3 ms·
The current plan is not to perform any part of the canonisation on a graph, but to calculate a language table for the network and canonise the resultant express
by yarg 2y ago
The current plan is not to perform any part of the canonisation on a graph, but to calculate a language table for the network and canonise the resultant expressions (which are trees not graphs).
I've mostly figured out the sorting aspect. The problematic part is language de-aliasing which means I'm going to have to refactor some things.
The language extraction (it's just iterative expression expansion and a language mapping function, example below) shouldn't be too hard to write down, I've already implemented it in my head and I don't think that there are any corner cases that I'm missing.
The language de-aliasing is going to change the way that certain expressions get translated into automata.
For example, right now there are generator methods for things like & and ^, but in order to de-alias the languages it's better if the expression gets expanded, and then the expanded form gets converted into a machine.
So ^(A,B) ≡ &(:(A,!B),:(!A,B)) ≡ !:(!:(A,!B),!:(!A,B)).
Even a simple expression such as !a needs to be de-aliased.
!/a ≡ :([.../.],[/b...])
(in my insane non-standard syntax, NOT 'a' is the OR of all chars up to and including '.' (the char before 'a') and all chars 'b' and above.
Language mapping example:
S0{
^
Expr0 + S0
Expr1 + S1
Expr2 + S2
}
Is equivalent to
S0{
Expr0*
Expr0* + Expr1 + S1;
Expr0* + Expr2 + S2;
}
So just run through iterating away the state symbols until all that's left are pure expressions, attempt to de-alias the languages, then do a recursive sort on the expression trees.