Linear-bounded automata as certified row systems #
This file presents the computation graph of a marker-free nondeterministic LBA as a
CertifiedRowSystem. A configuration is represented by one row of cells. The control state is
repeated in every cell and a Boolean marks the unique head position; this makes one LBA step
checkable by a finite left-to-right scan.
A raw input cell, or one cell of an encoded LBA configuration. Configuration rows repeat the
control state in every cell and mark the unique head position with head = true.
- raw {I : Type u_4} {Γ : Type u_5} {Λ : Type u_6} (input : I) : RowCell I Γ Λ
- cfg {I : Type u_4} {Γ : Type u_5} {Λ : Type u_6} (symbol : Γ) (head : Bool) (state : Λ) : RowCell I Γ Λ
Instances For
Equations
- One or more equations did not get rendered due to their size.
- LBA.instDecidableEqRowCell.decEq (LBA.RowCell.raw a) (LBA.RowCell.raw b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- LBA.instDecidableEqRowCell.decEq (LBA.RowCell.raw input) (LBA.RowCell.cfg symbol head state) = isFalse ⋯
- LBA.instDecidableEqRowCell.decEq (LBA.RowCell.cfg symbol head state) (LBA.RowCell.raw input) = isFalse ⋯
Instances For
Equations
- LBA.instDecidableEqRowCert.decEq LBA.RowCert.plain LBA.RowCert.plain = isTrue ⋯
- LBA.instDecidableEqRowCert.decEq LBA.RowCert.plain (LBA.RowCert.head dir) = isFalse ⋯
- LBA.instDecidableEqRowCert.decEq (LBA.RowCert.head dir) LBA.RowCert.plain = isFalse ⋯
- LBA.instDecidableEqRowCert.decEq (LBA.RowCert.head a) (LBA.RowCert.head b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
Instances For
State of the left-to-right verifier for one row transition.
- start {Λ : Type u_4} : RowScan Λ
- initRest {Λ : Type u_4} : RowScan Λ
- before {Λ : Type u_4} (oldState newState : Λ) : RowScan Λ
- expectLeft {Λ : Type u_4} (oldState newState : Λ) : RowScan Λ
- expectRight {Λ : Type u_4} (oldState newState : Λ) : RowScan Λ
- after {Λ : Type u_4} (oldState newState : Λ) : RowScan Λ
- rightClamp {Λ : Type u_4} (oldState newState : Λ) : RowScan Λ
- bad {Λ : Type u_4} : RowScan Λ
Instances For
Equations
- LBA.instDecidableEqRowScan.decEq LBA.RowScan.start LBA.RowScan.start = isTrue ⋯
- LBA.instDecidableEqRowScan.decEq LBA.RowScan.start LBA.RowScan.initRest = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq LBA.RowScan.start (LBA.RowScan.before oldState newState) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq LBA.RowScan.start (LBA.RowScan.expectLeft oldState newState) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq LBA.RowScan.start (LBA.RowScan.expectRight oldState newState) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq LBA.RowScan.start (LBA.RowScan.after oldState newState) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq LBA.RowScan.start (LBA.RowScan.rightClamp oldState newState) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq LBA.RowScan.start LBA.RowScan.bad = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq LBA.RowScan.initRest LBA.RowScan.start = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq LBA.RowScan.initRest LBA.RowScan.initRest = isTrue ⋯
- LBA.instDecidableEqRowScan.decEq LBA.RowScan.initRest (LBA.RowScan.before oldState newState) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq LBA.RowScan.initRest (LBA.RowScan.expectLeft oldState newState) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq LBA.RowScan.initRest (LBA.RowScan.expectRight oldState newState) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq LBA.RowScan.initRest (LBA.RowScan.after oldState newState) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq LBA.RowScan.initRest (LBA.RowScan.rightClamp oldState newState) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq LBA.RowScan.initRest LBA.RowScan.bad = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.before oldState newState) LBA.RowScan.start = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.before oldState newState) LBA.RowScan.initRest = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.before a a_1) (LBA.RowScan.before b b_1) = if h : a = b then h ▸ if h : a_1 = b_1 then h ▸ isTrue ⋯ else isFalse ⋯ else isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.before oldState newState) (LBA.RowScan.expectLeft oldState_1 newState_1) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.before oldState newState) (LBA.RowScan.expectRight oldState_1 newState_1) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.before oldState newState) (LBA.RowScan.after oldState_1 newState_1) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.before oldState newState) (LBA.RowScan.rightClamp oldState_1 newState_1) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.before oldState newState) LBA.RowScan.bad = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.expectLeft oldState newState) LBA.RowScan.start = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.expectLeft oldState newState) LBA.RowScan.initRest = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.expectLeft oldState newState) (LBA.RowScan.before oldState_1 newState_1) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.expectLeft a a_1) (LBA.RowScan.expectLeft b b_1) = if h : a = b then h ▸ if h : a_1 = b_1 then h ▸ isTrue ⋯ else isFalse ⋯ else isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.expectLeft oldState newState) (LBA.RowScan.expectRight oldState_1 newState_1) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.expectLeft oldState newState) (LBA.RowScan.after oldState_1 newState_1) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.expectLeft oldState newState) (LBA.RowScan.rightClamp oldState_1 newState_1) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.expectLeft oldState newState) LBA.RowScan.bad = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.expectRight oldState newState) LBA.RowScan.start = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.expectRight oldState newState) LBA.RowScan.initRest = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.expectRight oldState newState) (LBA.RowScan.before oldState_1 newState_1) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.expectRight oldState newState) (LBA.RowScan.expectLeft oldState_1 newState_1) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.expectRight a a_1) (LBA.RowScan.expectRight b b_1) = if h : a = b then h ▸ if h : a_1 = b_1 then h ▸ isTrue ⋯ else isFalse ⋯ else isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.expectRight oldState newState) (LBA.RowScan.after oldState_1 newState_1) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.expectRight oldState newState) (LBA.RowScan.rightClamp oldState_1 newState_1) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.expectRight oldState newState) LBA.RowScan.bad = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.after oldState newState) LBA.RowScan.start = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.after oldState newState) LBA.RowScan.initRest = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.after oldState newState) (LBA.RowScan.before oldState_1 newState_1) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.after oldState newState) (LBA.RowScan.expectLeft oldState_1 newState_1) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.after oldState newState) (LBA.RowScan.expectRight oldState_1 newState_1) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.after a a_1) (LBA.RowScan.after b b_1) = if h : a = b then h ▸ if h : a_1 = b_1 then h ▸ isTrue ⋯ else isFalse ⋯ else isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.after oldState newState) (LBA.RowScan.rightClamp oldState_1 newState_1) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.after oldState newState) LBA.RowScan.bad = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.rightClamp oldState newState) LBA.RowScan.start = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.rightClamp oldState newState) LBA.RowScan.initRest = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.rightClamp oldState newState) (LBA.RowScan.before oldState_1 newState_1) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.rightClamp oldState newState) (LBA.RowScan.expectLeft oldState_1 newState_1) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.rightClamp oldState newState) (LBA.RowScan.expectRight oldState_1 newState_1) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.rightClamp oldState newState) (LBA.RowScan.after oldState_1 newState_1) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.rightClamp a a_1) (LBA.RowScan.rightClamp b b_1) = if h : a = b then h ▸ if h : a_1 = b_1 then h ▸ isTrue ⋯ else isFalse ⋯ else isFalse ⋯
- LBA.instDecidableEqRowScan.decEq (LBA.RowScan.rightClamp oldState newState) LBA.RowScan.bad = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq LBA.RowScan.bad LBA.RowScan.start = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq LBA.RowScan.bad LBA.RowScan.initRest = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq LBA.RowScan.bad (LBA.RowScan.before oldState newState) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq LBA.RowScan.bad (LBA.RowScan.expectLeft oldState newState) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq LBA.RowScan.bad (LBA.RowScan.expectRight oldState newState) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq LBA.RowScan.bad (LBA.RowScan.after oldState newState) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq LBA.RowScan.bad (LBA.RowScan.rightClamp oldState newState) = isFalse ⋯
- LBA.instDecidableEqRowScan.decEq LBA.RowScan.bad LBA.RowScan.bad = isTrue ⋯
Instances For
Equations
- LBA.instDecidableEqRowFinal.decEq LBA.RowFinal.start LBA.RowFinal.start = isTrue ⋯
- LBA.instDecidableEqRowFinal.decEq LBA.RowFinal.start (LBA.RowFinal.noHead state) = isFalse ⋯
- LBA.instDecidableEqRowFinal.decEq LBA.RowFinal.start (LBA.RowFinal.oneHead state) = isFalse ⋯
- LBA.instDecidableEqRowFinal.decEq LBA.RowFinal.start LBA.RowFinal.bad = isFalse ⋯
- LBA.instDecidableEqRowFinal.decEq (LBA.RowFinal.noHead state) LBA.RowFinal.start = isFalse ⋯
- LBA.instDecidableEqRowFinal.decEq (LBA.RowFinal.noHead a) (LBA.RowFinal.noHead b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- LBA.instDecidableEqRowFinal.decEq (LBA.RowFinal.noHead state) (LBA.RowFinal.oneHead state_1) = isFalse ⋯
- LBA.instDecidableEqRowFinal.decEq (LBA.RowFinal.noHead state) LBA.RowFinal.bad = isFalse ⋯
- LBA.instDecidableEqRowFinal.decEq (LBA.RowFinal.oneHead state) LBA.RowFinal.start = isFalse ⋯
- LBA.instDecidableEqRowFinal.decEq (LBA.RowFinal.oneHead state) (LBA.RowFinal.noHead state_1) = isFalse ⋯
- LBA.instDecidableEqRowFinal.decEq (LBA.RowFinal.oneHead a) (LBA.RowFinal.oneHead b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- LBA.instDecidableEqRowFinal.decEq (LBA.RowFinal.oneHead state) LBA.RowFinal.bad = isFalse ⋯
- LBA.instDecidableEqRowFinal.decEq LBA.RowFinal.bad LBA.RowFinal.start = isFalse ⋯
- LBA.instDecidableEqRowFinal.decEq LBA.RowFinal.bad (LBA.RowFinal.noHead state) = isFalse ⋯
- LBA.instDecidableEqRowFinal.decEq LBA.RowFinal.bad (LBA.RowFinal.oneHead state) = isFalse ⋯
- LBA.instDecidableEqRowFinal.decEq LBA.RowFinal.bad LBA.RowFinal.bad = isTrue ⋯
Instances For
Scan the first pair of configuration cells.
Equations
- LBA.RowScan.scanFirst M a false q b false q' LBA.RowCert.plain = if a = b then LBA.RowScan.before q q' else LBA.RowScan.bad
- LBA.RowScan.scanFirst M a false q b true q' LBA.RowCert.plain = if a = b then LBA.RowScan.expectLeft q q' else LBA.RowScan.bad
- LBA.RowScan.scanFirst M a true q b false q' (LBA.RowCert.head DLBA.Dir.right) = if LBA.RowScan.transitionOK M q a q' b DLBA.Dir.right = true then LBA.RowScan.expectRight q q' else LBA.RowScan.bad
- LBA.RowScan.scanFirst M a true q b true q' (LBA.RowCert.head DLBA.Dir.stay) = if LBA.RowScan.transitionOK M q a q' b DLBA.Dir.stay = true then LBA.RowScan.after q q' else LBA.RowScan.bad
- LBA.RowScan.scanFirst M a true q b true q' (LBA.RowCert.head DLBA.Dir.left) = if LBA.RowScan.transitionOK M q a q' b DLBA.Dir.left = true then LBA.RowScan.after q q' else LBA.RowScan.bad
- LBA.RowScan.scanFirst M a true q b true q' (LBA.RowCert.head DLBA.Dir.right) = if LBA.RowScan.transitionOK M q a q' b DLBA.Dir.right = true then LBA.RowScan.rightClamp q q' else LBA.RowScan.bad
- LBA.RowScan.scanFirst M a h q b h' q' cert = LBA.RowScan.bad
Instances For
Scan a pair strictly before the source head.
Equations
- One or more equations did not get rendered due to their size.
- LBA.RowScan.scanBefore M q q' a false r b false r' LBA.RowCert.plain = if r ≠ q ∨ r' ≠ q' then LBA.RowScan.bad else if a = b then LBA.RowScan.before q q' else LBA.RowScan.bad
- LBA.RowScan.scanBefore M q q' a false r b true r' LBA.RowCert.plain = if r ≠ q ∨ r' ≠ q' then LBA.RowScan.bad else if a = b then LBA.RowScan.expectLeft q q' else LBA.RowScan.bad
- LBA.RowScan.scanBefore M q q' a h r b h' r' cert = if r ≠ q ∨ r' ≠ q' then LBA.RowScan.bad else LBA.RowScan.bad
Instances For
The cellwise verifier. Interior left and right moves use one pending scanner state so the destination head is checked on the adjacent cell.
Equations
- One or more equations did not get rendered due to their size.
- LBA.RowScan.scanCell M embed LBA.RowScan.start (LBA.RowCell.raw i) (LBA.RowCell.cfg b true q') LBA.RowCert.plain = if b = embed i ∧ q' = M.initial then LBA.RowScan.initRest else LBA.RowScan.bad
- LBA.RowScan.scanCell M embed LBA.RowScan.start (LBA.RowCell.cfg a h q) (LBA.RowCell.cfg b h' q') x✝ = LBA.RowScan.scanFirst M a h q b h' q' x✝
- LBA.RowScan.scanCell M embed LBA.RowScan.initRest (LBA.RowCell.raw i) (LBA.RowCell.cfg b false q') LBA.RowCert.plain = if b = embed i ∧ q' = M.initial then LBA.RowScan.initRest else LBA.RowScan.bad
- LBA.RowScan.scanCell M embed (LBA.RowScan.before q q') (LBA.RowCell.cfg a h r) (LBA.RowCell.cfg b h' r') x✝ = LBA.RowScan.scanBefore M q q' a h r b h' r' x✝
- LBA.RowScan.scanCell M embed x✝³ x✝² x✝¹ x✝ = LBA.RowScan.bad
Instances For
Equations
- LBA.RowScan.initRest.done = true
- (LBA.RowScan.after oldState newState).done = true
- (LBA.RowScan.rightClamp oldState newState).done = true
- x✝.done = false
Instances For
Equations
- LBA.RowFinal.start.next (LBA.RowCell.cfg symbol false q) = LBA.RowFinal.noHead q
- LBA.RowFinal.start.next (LBA.RowCell.cfg symbol true q) = LBA.RowFinal.oneHead q
- (LBA.RowFinal.noHead q).next (LBA.RowCell.cfg symbol false r) = if r = q then LBA.RowFinal.noHead q else LBA.RowFinal.bad
- (LBA.RowFinal.noHead q).next (LBA.RowCell.cfg symbol true r) = if r = q then LBA.RowFinal.oneHead q else LBA.RowFinal.bad
- (LBA.RowFinal.oneHead q).next (LBA.RowCell.cfg symbol false r) = if r = q then LBA.RowFinal.oneHead q else LBA.RowFinal.bad
- x✝¹.next x✝ = LBA.RowFinal.bad
Instances For
Equations
- LBA.RowFinal.done M (LBA.RowFinal.oneHead q) = M.accept q
- LBA.RowFinal.done M x✝ = false
Instances For
The certified row system whose reachable rows are precisely the configurations reachable by
M from the canonically embedded, nonempty input.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Semantic row relations #
A block of non-head configuration cells carrying the same control state.
Equations
- LBA.noHeadCells q xs = List.map (fun (a : Γ) => LBA.RowCell.cfg a false q) xs
Instances For
The intended semantic transition between rows.
- init {I : Type u_1} {Γ : Type u_2} {Λ : Type u_3} {M : Machine Γ Λ} {embed : I → Γ} (i : I) (is : List I) : RowMove M embed (List.map RowCell.raw (i :: is)) (RowCell.cfg (embed i) true M.initial :: noHeadCells M.initial (List.map embed is))
- stay {I : Type u_1} {Γ : Type u_2} {Λ : Type u_3} {M : Machine Γ Λ} {embed : I → Γ} (q q' : Λ) (a b : Γ) (left right : List Γ) (hstep : (q', b, DLBA.Dir.stay) ∈ M.transition q a) : RowMove M embed (noHeadCells q left ++ RowCell.cfg a true q :: noHeadCells q right) (noHeadCells q' left ++ RowCell.cfg b true q' :: noHeadCells q' right)
- leftClamp {I : Type u_1} {Γ : Type u_2} {Λ : Type u_3} {M : Machine Γ Λ} {embed : I → Γ} (q q' : Λ) (a b : Γ) (right : List Γ) (hstep : (q', b, DLBA.Dir.left) ∈ M.transition q a) : RowMove M embed (RowCell.cfg a true q :: noHeadCells q right) (RowCell.cfg b true q' :: noHeadCells q' right)
- rightClamp {I : Type u_1} {Γ : Type u_2} {Λ : Type u_3} {M : Machine Γ Λ} {embed : I → Γ} (q q' : Λ) (a b : Γ) (left : List Γ) (hstep : (q', b, DLBA.Dir.right) ∈ M.transition q a) : RowMove M embed (noHeadCells q left ++ [RowCell.cfg a true q]) (noHeadCells q' left ++ [RowCell.cfg b true q'])
- left {I : Type u_1} {Γ : Type u_2} {Λ : Type u_3} {M : Machine Γ Λ} {embed : I → Γ} (q q' : Λ) (x a b : Γ) (left right : List Γ) (hstep : (q', b, DLBA.Dir.left) ∈ M.transition q a) : RowMove M embed (noHeadCells q left ++ RowCell.cfg x false q :: RowCell.cfg a true q :: noHeadCells q right) (noHeadCells q' left ++ RowCell.cfg x true q' :: RowCell.cfg b false q' :: noHeadCells q' right)
- right {I : Type u_1} {Γ : Type u_2} {Λ : Type u_3} {M : Machine Γ Λ} {embed : I → Γ} (q q' : Λ) (a b x : Γ) (left right : List Γ) (hstep : (q', b, DLBA.Dir.right) ∈ M.transition q a) : RowMove M embed (noHeadCells q left ++ RowCell.cfg a true q :: RowCell.cfg x false q :: noHeadCells q right) (noHeadCells q' left ++ RowCell.cfg b false q' :: RowCell.cfg x true q' :: noHeadCells q' right)
Instances For
The local scanner accepts exactly the intended raw initialization or one LBA row move.
Bisimulation with bounded-tape configurations #
A well-formed configuration row, split immediately before and after its unique head.
Equations
- LBA.configCells q left a right = LBA.noHeadCells q left ++ LBA.RowCell.cfg a true q :: LBA.noHeadCells q right
Instances For
Symbols strictly to the left of the head.
Equations
- LBA.leftSymbols cfg = List.take (↑cfg.tape.head) (LBA.tapeList cfg)
Instances For
Symbols strictly to the right of the head.
Equations
- LBA.rightSymbols cfg = List.drop (↑cfg.tape.head + 1) (LBA.tapeList cfg)
Instances For
Canonical row encoding of a bounded-tape configuration.
Equations
- LBA.configRow cfg = LBA.configCells cfg.state (LBA.leftSymbols cfg) cfg.tape.read (LBA.rightSymbols cfg)
Instances For
Every bounded-tape LBA step is represented by one semantic row move.
Soundness of semantic row moves from a well-formed configuration row.
A canonical configuration row is final exactly when its LBA state is accepting.
The canonical initial configuration row is the initialization target of the raw input row.
Lift an LBA run pointwise to the certified row relation.
The certified row system presents exactly the nonempty language of the original LBA.