You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
machine =let
a =precond!(onenter!(re"XY", :a), :c)
b =precond!(onenter!(re"XZ", :b), :c; bool=false)
compile(a | b)
end;
Does not create an ambiguous NFA and thus compiles perfectly fine. However, the precondition :c is needlessly checked twice: First to check if it's true when entering a, then to check if it's false when entering b.
This needs to be optimised: When Automa detects that there are two edges which are only disambiguated by a precondition, emit code along the lines of this pseudocode
if byte in$(intersection(edge1, edge2))
if$(precond)
@goto a
else@goto a
endelseif byte in [ other edges... ]
[ ... ]
The text was updated successfully, but these errors were encountered:
In Automa v1, the following code:
Does not create an ambiguous NFA and thus compiles perfectly fine. However, the precondition
:c
is needlessly checked twice: First to check if it'strue
when enteringa
, then to check if it'sfalse
when enteringb
.This needs to be optimised: When Automa detects that there are two edges which are only disambiguated by a precondition, emit code along the lines of this pseudocode
The text was updated successfully, but these errors were encountered: