Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convention for Automata Operation Names in Automata Script #179

Open
Heizmann opened this issue May 18, 2017 · 7 comments
Open

Convention for Automata Operation Names in Automata Script #179

Heizmann opened this issue May 18, 2017 · 7 comments
Assignees

Comments

@Heizmann
Copy link
Member

Automata Script is case insensitive for automata operations. In our example files we have the convention to use camel case for longer operation names e.g., buchiAccepts, getAcceptedLassoWord
However there is no convention for the starting letter, we sometimes write buchiAccpets and sometimes BuchiAccepts.

I would like to have a convention for that but I do not have any preferences (uppercase/lowercase). What is your opinion?

Should we drop the conventions that the names are case insensitive?

Two arguments

  • Lowercase names for operations are more natural. An operation is very similar to a method.
  • If we drop the case insensitivity and enforce the convention, then uppercase might be more natural. The operation name is defined by the name of a Java class and class names start with uppercase letters. It might be confusing to tell people that the operation name is indentical to the class name but there is a special exception for the first letter....
@danieldietsch
Copy link
Member

AutomataScript is the only place in which the names occur, right?
I think it should be consistent with other things in AutomataScript. It seems that it is quite Java-like, so I would say keep the CamelCase, drop the case insensitiveness.

Explaining to users is quite simple, you already did it with one sentence: "the operation name is identical to the class name but the first letter is lower case".

@schillic
Copy link
Member

@danieldietsch: Yes, this is the only place.

I do not really have an opinion here.
But if you want to have a convention, I also find it more natural to enforce the original name of the class.
One could also say that AutomataScript is C#-like; in C# method names start with capitals (and there are certainly more examples).

@danieldietsch
Copy link
Member

danieldietsch commented May 19, 2017

@schillic : True, but what about

  • print
  • assert
  • automata definitions (alphabet, places, transitions, ...) ?

I also do not have an opinion, but

  • Getting rid of case insensitivity sounds good.
  • If I had to decide I would say make everything similar. So either write Assert, Print, Alphabet, CamelCase operations (C#-style) or keep it like it is (Java-style).

@schillic
Copy link
Member

@danieldietsch

  • Good catch, I agree that those "hard-coded" functions should follow the convention. There are at least two more: write, parseAutomata
  • I think that the parser already requires variable types (automata, words) to be written exactly as the class name and components (alphabet etc.) to be lowercase (but I could be wrong here, did not check). Assuming this is the case, I would keep this convention.

@schillic
Copy link
Member

schillic commented May 19, 2017

I discussed with @Heizmann and we agreed on the convention that we use the Java style (i.e., case sensitive, but the first letter is lowercase).
I already prepared code to enforce that convention, but we first want to adapt all examples in the regression test folder.

Currently there are some delicate names for alternating automata written AA_Operation which would now have to be used as aA_Operation.
@alexandernutz : Any opinion about the names of these operations?

@Heizmann
Copy link
Member Author

Heizmann commented May 19, 2017

I can probably implement the renaming this weekend, but not today.

Can just drop the AA prefix? Operation names do not have to be unique (only combination of name and parameter types has to be unique)

Btw, there is a wikipedia page about some AA operation

@Heizmann
Copy link
Member Author

Convention is enforced. Most commits of the last two hours are related to this.
Still open is the prefixed names of alternating automata.

@schillic schillic removed their assignment Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants