VeriFIT / mata

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

Debordelize complement #342

Closed kilohsakul closed 2 months ago

kilohsakul commented 1 year ago

The complement_classical should not have an option to do something different from classical complement, like brzozovski minimization complement. Make another complement instead. It would be good to have swapping of final and non-final states as a method. Getting the sink state from the unordered map as {} is somehow weird, the unordered map then becomes a neccessary thing to have (and we will want to change the unordered map to something else probably) and I suspect {} never gets created in the subset construction anyway. Lets rather trim the determinized automaton and than just add a sink state, and forget about subset map?

jurajsic commented 1 year ago

The complement_classical should not have an option to do something different from classical complement, like brzozovski minimization complement. Make another complement instead.

The idea with the minimization was that we have to determinize anyway, so we might as well minimize using brzozowski. But right now, it looks like the result of the complement will not be minimized automaton anyway, so maybe we should just completely scrap it.

It would be good to have swapping of final and non-final states as a method.

I agree, maybe even the whole make_complete+swap should be one function, so that you can easily complement deterministic automaton.

Getting the sink state from the unordered map as {} is somehow weird, the unordered map then becomes a neccessary thing to have (and we will want to change the unordered map to something else probably) and I suspect {} never gets created in the subset construction anyway. Lets rather trim the determinized automaton and than just add a sink state, and forget about subset map?

I don't know if {} is created, I think at one point it used to get created. But yeah, adding a sink state always is fine.