Thompson's construction #
Thompson's construction turns a regular expression into an εNA with a single initial state and
at most one accepting state [Tho68]. This file defines the automata it is assembled from,
with their languages.
Main definitions #
εNA.FinAcc.zero,εNA.FinAcc.epsilon,εNA.FinAcc.char x: automata for the empty language, the empty word and the word[x].εNA.FinAcc.sum a b: the states and transitions ofaandbside by side, throughLTS.unionSum.εNA.FinAcc.union a b:sum a bwith a single initial and a single accepting state, throughtoSingleStartAccept.εNA.FinAcc.concat a b:ε-transitions from the accepting states ofato the initial states ofb.εNA.FinAcc.star a: a fresh hub state, initial and accepting, withε-transitions to the initial states ofaand from its accepting states.
Main statements #
εNA.FinAcc.language_zero,εNA.FinAcc.language_epsilon,εNA.FinAcc.language_char,εNA.FinAcc.language_sum,εNA.FinAcc.language_union,εNA.FinAcc.language_concatandεNA.FinAcc.language_star.
References #
An automaton with a single state, initial but not accepting, and no transitions.
Equations
Instances For
An automaton with a single state, initial and accepting, and no transitions.
Equations
Instances For
An automaton with two states, false initial and true accepting, joined by an
x-transition.
Equations
Instances For
The union of a and b: their disjoint sum, with a single initial state and a single
accepting state added by toSingleStartAccept.
Equations
- a.union b = (a.sum b).toSingleStartAccept
Instances For
The transitions of concat a b, whose states are those of a followed by those of b.
- left {Symbol : Type u_1} {S₁ : Type u_2} {S₂ : Type u_3} {a : FinAcc S₁ Symbol} {b : FinAcc S₂ Symbol} {s : S₁} {μ : Option Symbol} {s' : S₁} : a.Tr s μ s' → a.ConcatTr b (Sum.inl s) μ (Sum.inl s')
- right {Symbol : Type u_1} {S₁ : Type u_2} {S₂ : Type u_3} {a : FinAcc S₁ Symbol} {b : FinAcc S₂ Symbol} {s : S₂} {μ : Option Symbol} {s' : S₂} : b.Tr s μ s' → a.ConcatTr b (Sum.inr s) μ (Sum.inr s')
- bridge {Symbol : Type u_1} {S₁ : Type u_2} {S₂ : Type u_3} {a : FinAcc S₁ Symbol} {b : FinAcc S₂ Symbol} {s : S₁} {s' : S₂} : s ∈ a.accept → s' ∈ b.start → a.ConcatTr b (Sum.inl s) none (Sum.inr s')
Instances For
A run of concat a b between two states of b is a run of b.
A run of concat a b from a state of a to a state of b is a run of a to an accepting
state, an ε-transition to an initial state of b, and a run of b.
The transitions of star a, whose states are a fresh hub inl () and the states of a.
- inner {Symbol : Type u_1} {S₁ : Type u_2} {a : FinAcc S₁ Symbol} {s : S₁} {μ : Option Symbol} {s' : S₁} : a.Tr s μ s' → a.StarTr (Sum.inr s) μ (Sum.inr s')
- enter {Symbol : Type u_1} {S₁ : Type u_2} {a : FinAcc S₁ Symbol} {s : S₁} : s ∈ a.start → a.StarTr (Sum.inl ()) none (Sum.inr s)
- exit {Symbol : Type u_1} {S₁ : Type u_2} {a : FinAcc S₁ Symbol} {s : S₁} : s ∈ a.accept → a.StarTr (Sum.inr s) none (Sum.inl ())
Instances For
The Kleene star of a: a fresh hub state, initial and accepting, with ε-transitions to the
initial states of a and from its accepting states.
Instances For
A run of star a from a state of a to the hub is a run of a to an accepting state, an
ε-transition to the hub, and a run from the hub back to the hub.
Every word of (language a)∗ is read by a run of star a from the hub back to the hub.