@@ -29,6 +29,7 @@ open scoped Cslib.FLTS
2929
3030namespace Cslib.Automata
3131
32+ /-- A deterministic automaton extends a `FLTS` with a unique initial state. -/
3233structure DA (State Symbol : Type *) extends FLTS State Symbol where
3334 /-- The initial state of the automaton. -/
3435 start : State
@@ -66,7 +67,7 @@ theorem mtr_extract_eq_run {da : DA State Symbol} {xs : ωSequence Symbol} {n :
6667
6768/-- A deterministic automaton that accepts finite strings (lists of symbols). -/
6869structure FinAcc (State Symbol : Type *) extends DA State Symbol where
69- /-- The accept states. -/
70+ /-- The set of accepting states. -/
7071 accept : Set State
7172
7273namespace FinAcc
@@ -77,33 +78,39 @@ the string to an accept state.
7778This is the standard string recognition performed by DFAs in the literature. -/
7879@[simp, scoped grind =]
7980instance : Acceptor (DA.FinAcc State Symbol) Symbol where
80- Accepts (a : DA.FinAcc State Symbol) (xs : List Symbol) := a.mtr a.start xs ∈ a.accept
81+ Accepts (a : DA.FinAcc State Symbol) (xs : List Symbol) :=
82+ a.mtr a.start xs ∈ a.accept
8183
8284end FinAcc
8385
8486/-- Deterministic Buchi automaton. -/
8587structure Buchi (State Symbol : Type *) extends DA State Symbol where
86- /-- The accept states -/
88+ /-- The set of accepting states. -/
8789 accept : Set State
8890
8991namespace Buchi
9092
93+ /-- An infinite run is accepting iff accepting states occur infinitely many times. -/
9194@[simp, scoped grind =]
9295instance : ωAcceptor (Buchi State Symbol) Symbol where
93- Accepts (a : Buchi State Symbol) (xs : ωSequence Symbol) := ∃ᶠ k in atTop, a.run xs k ∈ a.accept
96+ Accepts (a : Buchi State Symbol) (xs : ωSequence Symbol) :=
97+ ∃ᶠ k in atTop, a.run xs k ∈ a.accept
9498
9599end Buchi
96100
97101/-- Deterministic Muller automaton. -/
98102structure Muller (State Symbol : Type *) extends DA State Symbol where
99- /-- The accepting set of sets of states. -/
103+ /-- The set of sets of accepting states. -/
100104 accept : Set (Set State)
101105
102106namespace Muller
103107
108+ /-- An infinite run is accepting iff the set of states that occur infinitely many times
109+ is one of the sets in `accept`. -/
104110@[simp, scoped grind =]
105111instance : ωAcceptor (Muller State Symbol) Symbol where
106- Accepts (a : Muller State Symbol) (xs : ωSequence Symbol) := (a.run xs).infOcc ∈ a.accept
112+ Accepts (a : Muller State Symbol) (xs : ωSequence Symbol) :=
113+ (a.run xs).infOcc ∈ a.accept
107114
108115end Muller
109116
0 commit comments