VeriFIT / mata

A fast and simple automata library
MIT License
19 stars 13 forks source link

Unify naming of operations in `nfa.hh` #172

Open Adda0 opened 1 year ago

Adda0 commented 1 year ago

There are a few functions, such as Nfa::determinize() which operate on automata passed as a parameter and return a new automaton. There are also method, usually called Nfa::Nfa::get_..._automaton() or Nfa::Nfa::get_..._words, etc., e.g., Nfa::Nfa::get_one_letter_automaton(), which operate on the underlying automaton object and return a new automaton. Finally, there are methods which operate on the underlying automaton object and perform the operation in place (for example, Nfa::Nfa::trim()).

We should agree on whether we want to try to unify these variants, or when each variant can be used.

Adda0 commented 1 year ago

There is a mismatch of names such as concatenate() (verb) and intersection() (noun). We should unify them.

Further suggestions are:

tfiedor commented 1 year ago

I'm also strongly voting for renaming uni function. Like what...the...fuck????

Adda0 commented 1 year ago

Definitely, I will add it to the list of names to change.

Adda0 commented 1 year ago

We agreed that methods should compute operations in-place, if possible, functions should return a new instance, making the computation of the operation out-of-place, and both should use verbs for their names. Furthermore, the method and its corresponding function should be named the same.

Adda0 commented 2 months ago

Should we add lang_union() (or something similar) as a single function to encapsulate calling operations union_nondet() and union_product() from #412, as discussed in https://github.com/VeriFIT/mata/pull/412#discussion_r1665758503?