Skip to content

feat(Automata): Two-way automaton - #834

Open
crei wants to merge 1 commit into
leanprover:mainfrom
crei:two-na
Open

feat(Automata): Two-way automaton#834
crei wants to merge 1 commit into
leanprover:mainfrom
crei:two-na

Conversation

@crei

@crei crei commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

This defines a (nondeterministic) two-way automaton, i.e. an automaton with an input tape that can move its input tape head in both directions, following the definition by [Vardi1989]. The purpose of introducing two-way automata is to prove the power of Turing machines with constant space following Vardi's proof of equivalence of two-way and one-way automata.

The definition is not via LTS mainly because the labels would not coincide with the input symbols, which makes it a bit more awkward. Instead, this defines a single-step relation between configurations and then List.IsChain is used to define a "Run", e.g. a sequence of configurations such that adjacent ones are Step-related and which starts at an initial configuration.

@crei crei changed the title feat(Automata): Two-way automaton. feat(Automata): Two-way automaton Aug 24, 2026
@crei
crei requested a review from SamuelSchlesinger August 24, 2026 12:36
automaton can move from state `q` to state `q'` and move its head according to `m`. -/
Tr (q : State) (x : Symbol) (m : SignType) (q' : State) : Prop
/-- The set of initial states of the automaton. -/
start : Set State

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you want a set of starting and accepting states and not a single starting and single accpting state?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's just Vardi's definition. In the end, it doesn't really matter much, but this is also how NA is defined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants