The definition of a computational automaton. It is meant to be more efficient than the definition in Mathlib.
- stateMax : State
- initials : Std.HashSet State
- finals : Std.HashSet State
- trans : Std.HashMap (State × A) (Std.HashSet State)
Instances For
def
NFA.addTrans
{A : Type}
[BEq A]
[Hashable A]
[DecidableEq A]
[FinEnum A]
(m : NFA A)
(a : A)
(s : State)
(s' : State)
:
NFA A
Equations
Instances For
def
NFA.addManyTrans
{A : Type}
[BEq A]
[Hashable A]
[DecidableEq A]
[FinEnum A]
(m : NFA A)
(a : List A)
(s : State)
(s' : State)
:
NFA A
Equations
- m.addManyTrans a s s' = List.foldl (fun (m : NFA A) (a : A) => m.addTrans a s s') m a
Instances For
def
NFA.transSet
{A : Type}
[BEq A]
[Hashable A]
[DecidableEq A]
[FinEnum A]
(m : NFA A)
(ss : Std.HashSet State)
(a : A)
:
Equations
- m.transSet ss a = Std.HashSet.fold (fun (ss' : Std.HashSet State) (s : State) => ss'.insertMany (m.trans.getD (s, a) ∅)) ∅ ss
Instances For
Equations
- NFA_Inhabited = { default := NFA.empty }
theorem
addOrCreateState_grow
(A : Type)
[BEq A]
[Hashable A]
[DecidableEq A]
[FinEnum A]
{S : Type}
[Hashable S]
[DecidableEq S]
(stateSpace : Finset S)
(st : worklist.St A stateSpace)
(b : Bool)
(sa : inSS stateSpace)
:
theorem
processOneElem_grow
(A : Type)
[BEq A]
[Hashable A]
[DecidableEq A]
[FinEnum A]
{S : Type}
[Hashable S]
[DecidableEq S]
(stateSpace : Finset S)
(st : worklist.St A stateSpace)
(final : S → Bool)
(a : A)
(sa' : inSS stateSpace)
(s : State)
:
def
worklist.initState
(A : Type)
[BEq A]
[Hashable A]
[DecidableEq A]
[FinEnum A]
{S : Type}
[Hashable S]
[DecidableEq S]
(stateSpace : Finset S)
(init : inSS stateSpace)
:
worklist.St A stateSpace
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
worklistRunAux
(A : Type)
[BEq A]
[Hashable A]
[DecidableEq A]
[FinEnum A]
{S : Type}
[Hashable S]
[DecidableEq S]
(stateSpace : Finset S)
(final : S → Bool)
(f : S → Array (A × inSS stateSpace))
(init : inSS stateSpace)
:
NFA A
Equations
- worklistRunAux A stateSpace final f init = worklistRunAux.go A stateSpace final f init (worklist.initState A stateSpace init)
Instances For
@[irreducible]
def
worklistRunAux.go
(A : Type)
[BEq A]
[Hashable A]
[DecidableEq A]
[FinEnum A]
{S : Type}
[Hashable S]
[DecidableEq S]
(stateSpace : Finset S)
(final : S → Bool)
(f : S → Array (A × inSS stateSpace))
(init : inSS stateSpace)
(st0 : worklist.St A stateSpace)
:
NFA A
Equations
- One or more equations did not get rendered due to their size.