The Cook–Levin tableau of a multi-input machine #
The 3SAT formula tableau M s₀ s₁ S fixed chk of a run of S steps of the machine M
(planning/succinct-cook-levin.md, S1; answer_reduction.tex prop:standard-succinct-sat):
- Variables (
TabVar): for each timet ≤ S, tape and cell position, the one-hot cell values and the head bit; for each time the one-hot state; per step the emission flagsemitOne(the accepting symbolaccis emitted) andemitBad(another symbol is), and per time the flagemitted(something was emitted before); and, per step and window, the gate variables of the check circuitchk. - Cells:
2S + 7positions per tape; cells0, 1and the last two hold the boundary marker. Input position valuekof the machine (0the blank before the input,1..Lthe input,L + 1the blank after it) is cellk + 2; work-tape positionz ∈ ℤis cellz + S + 3, so that a head, which moves at mostScells, stays inside2..2S+4provided the inputs have length at most2S + 1. - Clauses: the start rows (heads on their first cells, the start state, the fixed input
tapes holding their strings, blank work tapes), the boundary rows (boundary cells and no
heads there at every time), the free input tapes (a string over the two bit symbols
s₀,s₁followed by blanks), the emission bookkeeping, the acceptance row (halted at timeS, one emission, ofacc), and at every step and window the circuit-to-3SAT clauses ofchkon the window's variables. Windows are indexed by a center on every tape; the five cells of a window are the center and its two neighbors on each side. - The assignment of a run (
runAssign): the encodings of the configurations of the machine and the gate values of the check circuit on every window.
The check circuit is a parameter with its specification IsCheckCircuit: chk.evalBits (winBits win) = true ↔ checkPred M acc win; the correctness of the tableau (Correct.lean)
is proved against the specification, and S3 supplies the circuit.
Positions #
The number of cells of a tape of the tableau of S steps.
Equations
- MIPRE.TM.CookLevin.numCells S = 2 * S + 7
Instances For
A cell position.
Equations
Instances For
A window center, offset by two: the window of center c covers the cells c .. c + 4,
its middle cell being c + 2.
Equations
- MIPRE.TM.CookLevin.Center S = Fin (2 * S + 3)
Instances For
The middle cell of a window.
Equations
Instances For
Equations
The cell of a head at time 0: an input head starts on the first symbol, position
value 1, cell 3; a work head at position 0, cell S + 3.
Equations
Instances For
The value of cell p of an input tape holding x: the boundary marker on boundary
cells, the symbols of x on cells 3 .. |x| + 2, blanks elsewhere.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The value of cell p of a work tape at time 0.
Equations
Instances For
Variables #
The variables of the tableau.
- cell {i w : ℕ} {Symbol : Type u_1} {State : Type u_2} {S G : ℕ} (t : Fin (S + 1)) (d : Tape i w) (p : Pos S) (v : CellVal Symbol) : TabVar i w Symbol State S G
- head {i w : ℕ} {Symbol : Type u_1} {State : Type u_2} {S G : ℕ} (t : Fin (S + 1)) (d : Tape i w) (p : Pos S) : TabVar i w Symbol State S G
- state {i w : ℕ} {Symbol : Type u_1} {State : Type u_2} {S G : ℕ} (t : Fin (S + 1)) (q : Option State) : TabVar i w Symbol State S G
- emitOne {i w : ℕ} {Symbol : Type u_1} {State : Type u_2} {S G : ℕ} (t : Fin S) : TabVar i w Symbol State S G
- emitBad {i w : ℕ} {Symbol : Type u_1} {State : Type u_2} {S G : ℕ} (t : Fin S) : TabVar i w Symbol State S G
- emitted {i w : ℕ} {Symbol : Type u_1} {State : Type u_2} {S G : ℕ} (t : Fin (S + 1)) : TabVar i w Symbol State S G
- aux {i w : ℕ} {Symbol : Type u_1} {State : Type u_2} {S G : ℕ} (t : Fin S) (js : Tape i w → Center S) (g : Fin G) : TabVar i w Symbol State S G
Instances For
Equations
- One or more equations did not get rendered due to their size.
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.cell t d p v) (MIPRE.TM.CookLevin.TabVar.head t_1 d_1 p_1) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.cell t d p v) (MIPRE.TM.CookLevin.TabVar.state t_1 q) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.cell t d p v) (MIPRE.TM.CookLevin.TabVar.emitOne t_1) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.cell t d p v) (MIPRE.TM.CookLevin.TabVar.emitBad t_1) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.cell t d p v) (MIPRE.TM.CookLevin.TabVar.emitted t_1) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.cell t d p v) (MIPRE.TM.CookLevin.TabVar.aux t_1 js g) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.head t d p) (MIPRE.TM.CookLevin.TabVar.cell t_1 d_1 p_1 v) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.head t d p) (MIPRE.TM.CookLevin.TabVar.state t_1 q) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.head t d p) (MIPRE.TM.CookLevin.TabVar.emitOne t_1) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.head t d p) (MIPRE.TM.CookLevin.TabVar.emitBad t_1) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.head t d p) (MIPRE.TM.CookLevin.TabVar.emitted t_1) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.head t d p) (MIPRE.TM.CookLevin.TabVar.aux t_1 js g) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.state t q) (MIPRE.TM.CookLevin.TabVar.cell t_1 d p v) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.state t q) (MIPRE.TM.CookLevin.TabVar.head t_1 d p) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.state t q) (MIPRE.TM.CookLevin.TabVar.emitOne t_1) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.state t q) (MIPRE.TM.CookLevin.TabVar.emitBad t_1) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.state t q) (MIPRE.TM.CookLevin.TabVar.emitted t_1) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.state t q) (MIPRE.TM.CookLevin.TabVar.aux t_1 js g) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.emitOne t) (MIPRE.TM.CookLevin.TabVar.cell t_1 d p v) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.emitOne t) (MIPRE.TM.CookLevin.TabVar.head t_1 d p) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.emitOne t) (MIPRE.TM.CookLevin.TabVar.state t_1 q) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.emitOne a) (MIPRE.TM.CookLevin.TabVar.emitOne b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.emitOne t) (MIPRE.TM.CookLevin.TabVar.emitBad t_1) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.emitOne t) (MIPRE.TM.CookLevin.TabVar.emitted t_1) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.emitOne t) (MIPRE.TM.CookLevin.TabVar.aux t_1 js g) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.emitBad t) (MIPRE.TM.CookLevin.TabVar.cell t_1 d p v) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.emitBad t) (MIPRE.TM.CookLevin.TabVar.head t_1 d p) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.emitBad t) (MIPRE.TM.CookLevin.TabVar.state t_1 q) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.emitBad t) (MIPRE.TM.CookLevin.TabVar.emitOne t_1) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.emitBad a) (MIPRE.TM.CookLevin.TabVar.emitBad b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.emitBad t) (MIPRE.TM.CookLevin.TabVar.emitted t_1) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.emitBad t) (MIPRE.TM.CookLevin.TabVar.aux t_1 js g) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.emitted t) (MIPRE.TM.CookLevin.TabVar.cell t_1 d p v) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.emitted t) (MIPRE.TM.CookLevin.TabVar.head t_1 d p) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.emitted t) (MIPRE.TM.CookLevin.TabVar.state t_1 q) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.emitted t) (MIPRE.TM.CookLevin.TabVar.emitOne t_1) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.emitted t) (MIPRE.TM.CookLevin.TabVar.emitBad t_1) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.emitted a) (MIPRE.TM.CookLevin.TabVar.emitted b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.emitted t) (MIPRE.TM.CookLevin.TabVar.aux t_1 js g) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.aux t js g) (MIPRE.TM.CookLevin.TabVar.cell t_1 d p v) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.aux t js g) (MIPRE.TM.CookLevin.TabVar.head t_1 d p) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.aux t js g) (MIPRE.TM.CookLevin.TabVar.state t_1 q) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.aux t js g) (MIPRE.TM.CookLevin.TabVar.emitOne t_1) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.aux t js g) (MIPRE.TM.CookLevin.TabVar.emitBad t_1) = isFalse ⋯
- MIPRE.TM.CookLevin.instDecidableEqTabVar.decEq (MIPRE.TM.CookLevin.TabVar.aux t js g) (MIPRE.TM.CookLevin.TabVar.emitted t_1) = isFalse ⋯
Instances For
The tableau variable of a window variable, at step t and centers js.
Equations
- MIPRE.TM.CookLevin.winVarOf t js (MIPRE.TM.CookLevin.WinVar.cellPre d δ v) = MIPRE.TM.CookLevin.TabVar.cell t.castSucc d (MIPRE.TM.CookLevin.cellIdx (js d) δ) v
- MIPRE.TM.CookLevin.winVarOf t js (MIPRE.TM.CookLevin.WinVar.headPre d δ) = MIPRE.TM.CookLevin.TabVar.head t.castSucc d (MIPRE.TM.CookLevin.cellIdx (js d) δ)
- MIPRE.TM.CookLevin.winVarOf t js (MIPRE.TM.CookLevin.WinVar.cellPost d v) = MIPRE.TM.CookLevin.TabVar.cell t.succ d (MIPRE.TM.CookLevin.center (js d)) v
- MIPRE.TM.CookLevin.winVarOf t js (MIPRE.TM.CookLevin.WinVar.headPost d) = MIPRE.TM.CookLevin.TabVar.head t.succ d (MIPRE.TM.CookLevin.center (js d))
- MIPRE.TM.CookLevin.winVarOf t js (MIPRE.TM.CookLevin.WinVar.statePre q) = MIPRE.TM.CookLevin.TabVar.state t.castSucc q
- MIPRE.TM.CookLevin.winVarOf t js (MIPRE.TM.CookLevin.WinVar.statePost q) = MIPRE.TM.CookLevin.TabVar.state t.succ q
- MIPRE.TM.CookLevin.winVarOf t js MIPRE.TM.CookLevin.WinVar.emitOne = MIPRE.TM.CookLevin.TabVar.emitOne t
- MIPRE.TM.CookLevin.winVarOf t js MIPRE.TM.CookLevin.WinVar.emitBad = MIPRE.TM.CookLevin.TabVar.emitBad t
Instances For
The number of window variables: the number of inputs of a check circuit.
Equations
- MIPRE.TM.CookLevin.winCard i w Symbol State = Fintype.card (MIPRE.TM.CookLevin.WinVar i w Symbol State)
Instances For
The bits of a window, in the canonical order.
Equations
- MIPRE.TM.CookLevin.winBits win = List.ofFn fun (n : Fin (MIPRE.TM.CookLevin.winCard i w Symbol State)) => win ((Fintype.equivFin (MIPRE.TM.CookLevin.WinVar i w Symbol State)).symm n)
Instances For
chk computes local consistency of a window: its specification, the hypothesis of the
correctness of the tableau (Correct.lean); S3 supplies the circuit.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The input variables of the check circuit at a window: the n-th window variable.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The gate variables of the check circuit at a window.
Equations
- MIPRE.TM.CookLevin.auxOf t js g = if h : g < G then MIPRE.TM.CookLevin.TabVar.aux t js ⟨g, h⟩ else MIPRE.TM.CookLevin.TabVar.emitted 0
Instances For
A unit clause.
Equations
- MIPRE.TM.CookLevin.unit v b = MIPRE.SAT.cl { var := v, pos := b } { var := v, pos := b } { var := v, pos := b }
Instances For
The clause ¬a ∨ b.
Equations
Instances For
The clause ¬a ∨ ¬b.
Equations
Instances For
The start rows: heads on their first cells, the start state, the fixed input tapes holding their strings, the work tapes blank.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The free input tapes at time 0: boundary cells, the cell before the input blank, the
other cells one of s₀, s₁, blank, exactly one of them, with blanks trailing.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The boundary rows: boundary cells hold the marker and carry no head, at every time.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The emission bookkeeping: nothing emitted before time 0, emitted (t + 1) ↔ emitted t ∨ emitOne t, no emission after an emission, nothing but acc ever emitted.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The window clauses: the circuit-to-3SAT formula of the check circuit at every step and window.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The tableau formula.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The assignment of a run #
The value of cell p of tape d in a configuration.
Equations
- MIPRE.TM.CookLevin.cellValAt c (Sum.inl val) p = MIPRE.TM.CookLevin.inputCellVal (input val) p
- MIPRE.TM.CookLevin.cellValAt c (Sum.inr val) p = if p.IsBdry then MIPRE.TM.CookLevin.CellVal.bdry else MIPRE.TM.CookLevin.CellVal.ofOpt (c.workTapes val (↑↑p - (↑S + 3)))
Instances For
The cell of the head of tape d, as an integer.
Equations
- MIPRE.TM.CookLevin.headCell c (Sum.inl val) = ↑↑(c.inputPos val) + 2
- MIPRE.TM.CookLevin.headCell c (Sum.inr val) = c.workTapePos val + (↑S + 3)
Instances For
The configuration at time t of the run on input.
Equations
Instances For
The assignment of the run on the non-auxiliary variables.
Equations
- One or more equations did not get rendered due to their size.
- MIPRE.TM.CookLevin.baseAssign M acc G (MIPRE.TM.CookLevin.TabVar.cell t d p v) = decide (MIPRE.TM.CookLevin.cellValAt (MIPRE.TM.CookLevin.cfgAt M ↑t) d p = v)
- MIPRE.TM.CookLevin.baseAssign M acc G (MIPRE.TM.CookLevin.TabVar.head t d p) = decide (MIPRE.TM.CookLevin.headCell (MIPRE.TM.CookLevin.cfgAt M ↑t) d = ↑↑p)
- MIPRE.TM.CookLevin.baseAssign M acc G (MIPRE.TM.CookLevin.TabVar.state t q) = decide ((MIPRE.TM.CookLevin.cfgAt M ↑t).state = q)
- MIPRE.TM.CookLevin.baseAssign M acc G (MIPRE.TM.CookLevin.TabVar.emitOne t) = decide (Turing.MultiInputTM.outputSymbol (MIPRE.TM.CookLevin.cfgAt M ↑t) = some acc)
- MIPRE.TM.CookLevin.baseAssign M acc G (MIPRE.TM.CookLevin.TabVar.emitted t) = decide (M.outputString (Turing.MultiInputTM.initCfg input) ↑t ≠ [])
- MIPRE.TM.CookLevin.baseAssign M acc G (MIPRE.TM.CookLevin.TabVar.aux t js g) = false
Instances For
The assignment of the run: the encodings of its configurations, and on the auxiliary variables the gate values of the check circuit at every window.
Equations
- One or more equations did not get rendered due to their size.
- MIPRE.TM.CookLevin.runAssign M acc chk x✝ = MIPRE.TM.CookLevin.baseAssign M acc chk.gates.length x✝