Deterministic Finite Automata #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
This file contains the definition of a Deterministic Finite Automaton (DFA), a state machine which
determines whether a string (implemented as a list over an arbitrary alphabet) is in a regular set
in linear time.
Note that this definition allows for Automaton with infinite states, a fintype
instance must be
supplied for true DFA's.
A DFA 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
).
Instances for DFA
- DFA.has_sizeof_inst
- DFA.inhabited
@[protected, instance]
Equations
- DFA.inhabited = {default := {step := λ (_x : σ) (_x : α), inhabited.default, start := inhabited.default _inst_1, accept := ∅}}