Epsilon Nondeterministic Finite Automata #
This file contains the definition of an epsilon Nondeterministic Finite Automaton (εNFA
), a state
machine which determines whether a string (implemented as a list over an arbitrary alphabet) is in a
regular set by evaluating the string over every possible path, also having access to ε-transitions,
which can be followed without reading a character.
Since this definition allows for automata with infinite states, a Fintype
instance must be
supplied for true εNFA
's.
An εNFA
is a set of states (σ
), a transition function from state to state labelled by the
alphabet (step
), a starting state (start
) and a set of acceptance states (accept
).
Note the transition function sends a state to a Set
of states and can make ε-transitions by
inputting none
.
Since this definition allows for Automata with infinite states, a Fintype
instance must be
supplied for true εNFA
's.
Instances For
The εClosure
of a set is the set of states which can be reached by taking a finite string of
ε-transitions from an element of the set.
- base {α : Type u} {σ : Type v} {M : εNFA α σ} {S : Set σ} (s : σ) : s ∈ S → M.εClosure S s
- step {α : Type u} {σ : Type v} {M : εNFA α σ} {S : Set σ} (s t : σ) : t ∈ M.step s none → M.εClosure S s → M.εClosure S t
Instances For
M.IsPath
represents a traversal in M
from a start state to an end state by following a list
of transitions in order.
- nil {α : Type u} {σ : Type v} {M : εNFA α σ} (s : σ) : M.IsPath s s []
- cons {α : Type u} {σ : Type v} {M : εNFA α σ} (t s u : σ) (a : Option α) (x : List (Option α)) : t ∈ M.step s a → M.IsPath t u x → M.IsPath s u (a :: x)
Instances For
Alias of the forward direction of εNFA.isPath_nil
.
Regex-like operations #
Equations
- εNFA.instInhabited = { default := 0 }