Boolean Monadic Recursive Schemes #
A Boolean monadic recursive scheme ([BCJO20]) is a program of
mutually recursive Boolean-valued unary predicates over words, built from if…then…else, the
edge tests initial/final (min/max), input class tests, and recursive calls. Its
one-sided fragments characterize the left- and right-subsequential functions;
[BCJ23] extends the characterization and [CJ21] applies
it to phonological modelling. Terms are the position walks of Subregular.Term.
Two symbol types dissolve the usual signature bookkeeping: input labels α get the
lookup rule, rule heads F get the unfolding rule, and a Program is a total map
F → Expr α F.
Evaluation is an inductive judgment Eval, faithful to partiality: a non-halting
program (f := g, g := f) derives nothing. evalFuel is its computable face, related
by eval_iff_evalFuel.
Main definitions #
BMRS.Expr,BMRS.Program: syntax.BMRS.Eval: the derivation system.BMRS.evalFuel: the fuel-bounded evaluator.Expr.Backward/Program.Backward(duallyForward): the one-sided fragments, in which every term reads only backwards (dually, forwards) from its index.
Main results #
Eval.deterministic: an expression has at most one value.eval_iff_evalFuel: adequacy of the fuel evaluator.Eval.congr_eqOn_Iic/Eval.congr_eqOn_Ici: one-sided locality: a backward program evaluated atireads only positions≤ i, so equal-length words agreeing there evaluate identically (dually for forward).
Syntax #
BMRS expressions: edge tests initial/final (the literature's min(T)/max(T)),
input class tests label (the lookup rule; a Finset of symbols, so featural
predicates like V or N over a segment alphabet are single atoms — a symbol test is the
singleton case), rule-head calls call (the unfolding rule), and if…then…else.
Terms are the position walks of Subregular.Term.
- tru {α : Type u_3} {F : Type u_4} : Expr α F
- fls {α : Type u_3} {F : Type u_4} : Expr α F
- initial {α : Type u_3} {F : Type u_4} (t : Term) : Expr α F
- final {α : Type u_3} {F : Type u_4} (t : Term) : Expr α F
- label {α : Type u_3} {F : Type u_4} (s : Finset α) (t : Term) : Expr α F
- call {α : Type u_3} {F : Type u_4} (f : F) (t : Term) : Expr α F
- ite {α : Type u_3} {F : Type u_4} (c e₁ e₂ : Expr α F) : Expr α F
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Subregular.BMRS.instDecidableEqExpr.decEq Subregular.BMRS.Expr.tru Subregular.BMRS.Expr.tru = isTrue ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq Subregular.BMRS.Expr.tru Subregular.BMRS.Expr.fls = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq Subregular.BMRS.Expr.tru (Subregular.BMRS.Expr.initial t) = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq Subregular.BMRS.Expr.tru (Subregular.BMRS.Expr.final t) = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq Subregular.BMRS.Expr.tru (Subregular.BMRS.Expr.label s t) = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq Subregular.BMRS.Expr.tru (Subregular.BMRS.Expr.call f t) = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq Subregular.BMRS.Expr.tru (c.ite e₁ e₂) = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq Subregular.BMRS.Expr.fls Subregular.BMRS.Expr.tru = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq Subregular.BMRS.Expr.fls Subregular.BMRS.Expr.fls = isTrue ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq Subregular.BMRS.Expr.fls (Subregular.BMRS.Expr.initial t) = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq Subregular.BMRS.Expr.fls (Subregular.BMRS.Expr.final t) = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq Subregular.BMRS.Expr.fls (Subregular.BMRS.Expr.label s t) = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq Subregular.BMRS.Expr.fls (Subregular.BMRS.Expr.call f t) = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq Subregular.BMRS.Expr.fls (c.ite e₁ e₂) = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (Subregular.BMRS.Expr.initial t) Subregular.BMRS.Expr.tru = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (Subregular.BMRS.Expr.initial t) Subregular.BMRS.Expr.fls = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (Subregular.BMRS.Expr.initial a) (Subregular.BMRS.Expr.initial b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (Subregular.BMRS.Expr.initial t) (Subregular.BMRS.Expr.final t_1) = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (Subregular.BMRS.Expr.initial t) (Subregular.BMRS.Expr.label s t_1) = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (Subregular.BMRS.Expr.initial t) (Subregular.BMRS.Expr.call f t_1) = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (Subregular.BMRS.Expr.initial t) (c.ite e₁ e₂) = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (Subregular.BMRS.Expr.final t) Subregular.BMRS.Expr.tru = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (Subregular.BMRS.Expr.final t) Subregular.BMRS.Expr.fls = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (Subregular.BMRS.Expr.final t) (Subregular.BMRS.Expr.initial t_1) = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (Subregular.BMRS.Expr.final a) (Subregular.BMRS.Expr.final b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (Subregular.BMRS.Expr.final t) (Subregular.BMRS.Expr.label s t_1) = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (Subregular.BMRS.Expr.final t) (Subregular.BMRS.Expr.call f t_1) = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (Subregular.BMRS.Expr.final t) (c.ite e₁ e₂) = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (Subregular.BMRS.Expr.label s t) Subregular.BMRS.Expr.tru = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (Subregular.BMRS.Expr.label s t) Subregular.BMRS.Expr.fls = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (Subregular.BMRS.Expr.label s t) (Subregular.BMRS.Expr.initial t_1) = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (Subregular.BMRS.Expr.label s t) (Subregular.BMRS.Expr.final t_1) = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (Subregular.BMRS.Expr.label s t) (Subregular.BMRS.Expr.call f t_1) = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (Subregular.BMRS.Expr.label s t) (c.ite e₁ e₂) = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (Subregular.BMRS.Expr.call f t) Subregular.BMRS.Expr.tru = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (Subregular.BMRS.Expr.call f t) Subregular.BMRS.Expr.fls = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (Subregular.BMRS.Expr.call f t) (Subregular.BMRS.Expr.initial t_1) = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (Subregular.BMRS.Expr.call f t) (Subregular.BMRS.Expr.final t_1) = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (Subregular.BMRS.Expr.call f t) (Subregular.BMRS.Expr.label s t_1) = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (Subregular.BMRS.Expr.call f t) (c.ite e₁ e₂) = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (c.ite e₁ e₂) Subregular.BMRS.Expr.tru = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (c.ite e₁ e₂) Subregular.BMRS.Expr.fls = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (c.ite e₁ e₂) (Subregular.BMRS.Expr.initial t) = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (c.ite e₁ e₂) (Subregular.BMRS.Expr.final t) = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (c.ite e₁ e₂) (Subregular.BMRS.Expr.label s t) = isFalse ⋯
- Subregular.BMRS.instDecidableEqExpr.decEq (c.ite e₁ e₂) (Subregular.BMRS.Expr.call f t) = isFalse ⋯
Instances For
A BMRS program: one defining expression per rule head.
Equations
- Subregular.BMRS.Program α F = (F → Subregular.BMRS.Expr α F)
Instances For
Negation as if…then…else.
Equations
Instances For
Substitute a term for the variable throughout an expression: e.subst u is
e[u/x], the operation the μ-calculus translation writes tr(φ)[s(x)].
Equations
- Subregular.BMRS.Expr.tru.subst x✝ = Subregular.BMRS.Expr.tru
- Subregular.BMRS.Expr.fls.subst x✝ = Subregular.BMRS.Expr.fls
- (Subregular.BMRS.Expr.initial t).subst x✝ = Subregular.BMRS.Expr.initial (t.comp x✝)
- (Subregular.BMRS.Expr.final t).subst x✝ = Subregular.BMRS.Expr.final (t.comp x✝)
- (Subregular.BMRS.Expr.label s t).subst x✝ = Subregular.BMRS.Expr.label s (t.comp x✝)
- (Subregular.BMRS.Expr.call f t).subst x✝ = Subregular.BMRS.Expr.call f (t.comp x✝)
- (c.ite e₁ e₂).subst x✝ = (c.subst x✝).ite (e₁.subst x✝) (e₂.subst x✝)
Instances For
Backward expressions: every term is backward.
Equations
- Subregular.BMRS.Expr.tru.Backward = True
- Subregular.BMRS.Expr.fls.Backward = True
- (Subregular.BMRS.Expr.initial t).Backward = t.Backward
- (Subregular.BMRS.Expr.final t).Backward = t.Backward
- (Subregular.BMRS.Expr.label s t).Backward = t.Backward
- (Subregular.BMRS.Expr.call f t).Backward = t.Backward
- (c.ite e₁ e₂).Backward = (c.Backward ∧ e₁.Backward ∧ e₂.Backward)
Instances For
Forward expressions.
Equations
- Subregular.BMRS.Expr.tru.Forward = True
- Subregular.BMRS.Expr.fls.Forward = True
- (Subregular.BMRS.Expr.initial t).Forward = t.Forward
- (Subregular.BMRS.Expr.final t).Forward = t.Forward
- (Subregular.BMRS.Expr.label s t).Forward = t.Forward
- (Subregular.BMRS.Expr.call f t).Forward = t.Forward
- (c.ite e₁ e₂).Forward = (c.Forward ∧ e₁.Forward ∧ e₂.Forward)
Instances For
Equations
- Subregular.BMRS.Expr.tru.instDecidableBackward = isTrue trivial
- Subregular.BMRS.Expr.fls.instDecidableBackward = isTrue trivial
- (Subregular.BMRS.Expr.initial t).instDecidableBackward = Subregular.BMRS.Expr.instDecidableBackward._aux_1 t
- (Subregular.BMRS.Expr.final t).instDecidableBackward = Subregular.BMRS.Expr.instDecidableBackward._aux_3 t
- (Subregular.BMRS.Expr.label s t).instDecidableBackward = Subregular.BMRS.Expr.instDecidableBackward._aux_5 s t
- (Subregular.BMRS.Expr.call f t).instDecidableBackward = Subregular.BMRS.Expr.instDecidableBackward._aux_7 f t
- (c.ite e₁ e₂).instDecidableBackward = instDecidableAnd
Equations
- Subregular.BMRS.Expr.tru.instDecidableForward = isTrue trivial
- Subregular.BMRS.Expr.fls.instDecidableForward = isTrue trivial
- (Subregular.BMRS.Expr.initial t).instDecidableForward = Subregular.BMRS.Expr.instDecidableForward._aux_1 t
- (Subregular.BMRS.Expr.final t).instDecidableForward = Subregular.BMRS.Expr.instDecidableForward._aux_3 t
- (Subregular.BMRS.Expr.label s t).instDecidableForward = Subregular.BMRS.Expr.instDecidableForward._aux_5 s t
- (Subregular.BMRS.Expr.call f t).instDecidableForward = Subregular.BMRS.Expr.instDecidableForward._aux_7 f t
- (c.ite e₁ e₂).instDecidableForward = instDecidableAnd
The derivation system #
The derivation system for BMRS expressions: Eval P w i e b is w, i ⊢_P e → b.
Partial by design: a non-halting program derives nothing.
- tru {α : Type u_1} {F : Type u_2} {P : Program α F} {w : List α} {i : ℕ} : Eval P w i Expr.tru true
- fls {α : Type u_1} {F : Type u_2} {P : Program α F} {w : List α} {i : ℕ} : Eval P w i Expr.fls false
- initial_true {α : Type u_1} {F : Type u_2} {P : Program α F} {w : List α} {i : ℕ} {t : Term} (h : Term.eval w i t = some 0) : Eval P w i (Expr.initial t) true
- initial_false {α : Type u_1} {F : Type u_2} {P : Program α F} {w : List α} {i : ℕ} {t : Term} {v : ℕ} (h : Term.eval w i t = some v) (hv : 0 < v) : Eval P w i (Expr.initial t) false
- final_true {α : Type u_1} {F : Type u_2} {P : Program α F} {w : List α} {i : ℕ} {t : Term} (h : Term.eval w i t = some (w.length - 1)) : Eval P w i (Expr.final t) true
- final_false {α : Type u_1} {F : Type u_2} {P : Program α F} {w : List α} {i : ℕ} {t : Term} {v : ℕ} (h : Term.eval w i t = some v) (hv : v < w.length - 1) : Eval P w i (Expr.final t) false
- label_true {α : Type u_1} {F : Type u_2} {P : Program α F} {w : List α} {i : ℕ} {s : Finset α} {t : Term} {v : ℕ} {a : α} (h : Term.eval w i t = some v) (hl : w[v]? = some a) (has : a ∈ s) : Eval P w i (Expr.label s t) true
- label_false {α : Type u_1} {F : Type u_2} {P : Program α F} {w : List α} {i : ℕ} {s : Finset α} {t : Term} {v : ℕ} {a : α} (h : Term.eval w i t = some v) (hl : w[v]? = some a) (has : a ∉ s) : Eval P w i (Expr.label s t) false
- call {α : Type u_1} {F : Type u_2} {P : Program α F} {w : List α} {i : ℕ} {f : F} {t : Term} {v : ℕ} {b : Bool} (h : Term.eval w i t = some v) (he : Eval P w v (P f) b) : Eval P w i (Expr.call f t) b
- ite_true {α : Type u_1} {F : Type u_2} {P : Program α F} {w : List α} {i : ℕ} {c e₁ e₂ : Expr α F} {b : Bool} (hc : Eval P w i c true) (h₁ : Eval P w i e₁ b) : Eval P w i (c.ite e₁ e₂) b
- ite_false {α : Type u_1} {F : Type u_2} {P : Program α F} {w : List α} {i : ℕ} {c e₁ e₂ : Expr α F} {b : Bool} (hc : Eval P w i c false) (h₂ : Eval P w i e₂ b) : Eval P w i (c.ite e₁ e₂) b
Instances For
Boolean-form introduction for the edge test: the value is the comparison.
Boolean-form introduction for the final test.
Boolean-form introduction for the class test.
A program is total on w when every rule head is defined at every position.
Equations
- P.TotalOn w = ∀ (f : F), ∀ i < w.length, ∃ (b : Bool), Subregular.BMRS.Eval P w i (Subregular.BMRS.Expr.call f Subregular.Term.var) b
Instances For
The fuel evaluator #
Fuel-bounded evaluator: the computable face of Eval.
Equations
- One or more equations did not get rendered due to their size.
- Subregular.BMRS.evalFuel P w 0 x✝¹ x✝ = none
- Subregular.BMRS.evalFuel P w n.succ x✝ Subregular.BMRS.Expr.tru = some true
- Subregular.BMRS.evalFuel P w n.succ x✝ Subregular.BMRS.Expr.fls = some false
- Subregular.BMRS.evalFuel P w n.succ x✝ (Subregular.BMRS.Expr.initial t) = Option.map (fun (x : ℕ) => x == 0) (Subregular.Term.eval w x✝ t)
- Subregular.BMRS.evalFuel P w n.succ x✝ (Subregular.BMRS.Expr.final t) = Option.map (fun (x : ℕ) => x == w.length - 1) (Subregular.Term.eval w x✝ t)
- Subregular.BMRS.evalFuel P w n.succ x✝ (Subregular.BMRS.Expr.label s t) = (Subregular.Term.eval w x✝ t).bind fun (v : ℕ) => Option.map (fun (a : α) => decide (a ∈ s)) w[v]?
- Subregular.BMRS.evalFuel P w fuel.succ x✝ (Subregular.BMRS.Expr.call f t) = (Subregular.Term.eval w x✝ t).bind fun (v : ℕ) => Subregular.BMRS.evalFuel P w fuel v (P f)
Instances For
Substitution #
Transport a derivation through substitution: evaluating e[u/x] at i is
evaluating e at the position u reads.
One-sided fragments and locality #
Successor-free programs compute left-subsequentially, predecessor-free programs
right-subsequentially. The locality lemmas below are what those inclusions rest on:
the flags of a one-sided program cannot see past their index. Equal length is
load-bearing — min/max atoms read w.length.
One-sided locality (left): a successor-free program evaluated at i reads only
positions ≤ i, so equal-length words agreeing up to i evaluate identically.
One-sided locality (right): a predecessor-free program evaluated at i reads
only positions ≥ i, so equal-length words agreeing from i on evaluate identically.