No public endorsements yet.
Loading review…
Sign in with ORCIDConcept map
In the paper
- page 44 of the paper of lax-157538, Transducers
Definition
A bimachine (Definition B.2.2 of Transducers) is a deterministic model for the rational functions. It consists of input and output alphabets and , two deterministic automata over without accepting states — the prefix automaton and the suffix automaton — and an output function
On an input it considers, for every , the factorisation into the prefix and the suffix , runs the prefix automaton on the prefix and the suffix automaton on the reverse of the suffix, applies the output function to the resulting pair of states, and concatenates the pieces in increasing order of . Bimachines compute exactly the rational functions (Theorem B.2.3). A bimachine is aperiodic if both its automata are aperiodic, i.e. satisfy the stabilisation condition on state transformations; aperiodic bimachines compute exactly the first-order relabellings (Theorem C.4.16).
Lean source view on GitHub
| 1 | import Lax765601.StateTransformations |
| 2 | |
| 3 | /-! |
| 4 | --- |
| 5 | title: Bimachines |
| 6 | type: definition |
| 7 | --- |
| 8 | A *bimachine* (Definition B.2.2 of *Transducers*) is a deterministic model for |
| 9 | the rational functions. It consists of input and output alphabets and , |
| 10 | two deterministic automata over without accepting states — the *prefix* |
| 11 | automaton and the *suffix* automaton — and an output function |
| 12 | |
| 13 | On an input it considers, for every , |
| 14 | the factorisation into the prefix and the suffix |
| 15 | , runs the prefix automaton on the prefix and the suffix |
| 16 | automaton on the *reverse* of the suffix, applies the output function to the |
| 17 | resulting pair of states, and concatenates the pieces in increasing |
| 18 | order of . Bimachines compute exactly the rational functions (Theorem |
| 19 | B.2.3). A bimachine is *aperiodic* if both its automata are aperiodic, i.e. |
| 20 | satisfy the stabilisation condition on state transformations; aperiodic |
| 21 | bimachines compute exactly the first-order relabellings (Theorem C.4.16). |
| 22 | |
| 23 | # Formalization notes |
| 24 | |
| 25 | Each automaton is an initial state and a transition function; the state |
| 26 | transformation of a string is `strTrans` of `Lax765601.StateTransformations`, |
| 27 | and reading the suffix in reverse is `strTrans M.suffixStep (w.drop i).reverse`. |
| 28 | `IsBimachine f` asks for finite state spaces of both automata. |
| 29 | -/ |
| 30 | |
| 31 | namespace Lax132576.Bimachines |
| 32 | |
| 33 | open Lax765601.StateTransformations |
| 34 | |
| 35 | /-- A bimachine: a deterministic prefix automaton, a deterministic suffix automaton |
| 36 | (run on the reverse of the suffix) and an output function on pairs of states. -/ |
| 37 | structure Bimachine (A B P S : Type) where |
| 38 | /-- Initial state of the prefix automaton. -/ |
| 39 | prefixInit : P |
| 40 | /-- Transition function of the prefix automaton. -/ |
| 41 | prefixStep : P → A → P |
| 42 | /-- Initial state of the suffix automaton. -/ |
| 43 | suffixInit : S |
| 44 | /-- Transition function of the suffix automaton. -/ |
| 45 | suffixStep : S → A → S |
| 46 | /-- The output function. -/ |
| 47 | out : P → S → List B |
| 48 | |
| 49 | namespace Bimachine |
| 50 | |
| 51 | variable {A B P S : Type} |
| 52 | |
| 53 | /-- The semantics of a bimachine: for every gap `i` of the input, the prefix |
| 54 | automaton is run on the first `i` letters and the suffix automaton on the reverse |
| 55 | of the rest, and the pieces of output are concatenated. -/ |
| 56 | def eval (M : Bimachine A B P S) (w : List A) : List B := |
| 57 | ((List.range (w.length + 1)).map (fun i => |
| 58 | M.out (strTrans M.prefixStep (w.take i) M.prefixInit) |
| 59 | (strTrans M.suffixStep (w.drop i).reverse M.suffixInit))).flatten |
| 60 | |
| 61 | end Bimachine |
| 62 | |
| 63 | /-- A function computed by a bimachine with finite state spaces. -/ |
| 64 | def IsBimachine {A B : Type} (f : List A → List B) : Prop := |
| 65 | ∃ (P S : Type) (_ : Finite P) (_ : Finite S) (M : Bimachine A B P S), M.eval = f |
| 66 | |
| 67 | /-- A function computed by an aperiodic bimachine: both automata satisfy the |
| 68 | stabilisation condition on their state transformations. -/ |
| 69 | def IsAperiodicBimachine {A B : Type} (f : List A → List B) : Prop := |
| 70 | ∃ (P S : Type) (_ : Finite P) (_ : Finite S) (M : Bimachine A B P S), |
| 71 | M.eval = f ∧ TransAperiodic M.prefixStep ∧ TransAperiodic M.suffixStep |
| 72 | |
| 73 | end Lax132576.Bimachines |
| 74 |
Formalization notes
Each automaton is an initial state and a transition function; the state transformation of a string is of , and reading the suffix in reverse is . asks for finite state spaces of both automata.
Community review
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above; your ORCID profile must share a public name.
0 comments