Deterministic polynomial-time tableaux as SO∃-Horn sentences #
Given a deterministic native multi-tape Turing machine tm and first-order formulas inputFormula
interpreting the three input-tape symbols over Ordered.language L, this module constructs a single
uniform SO∃-Horn sentence acceptanceHornSentence L tm inputFormula over Ordered.language L.
Its definite clauses mirror the positive local rules ImmermanVardi.Tableau.rowStep and initial
configuration ImmermanVardi.Tableau.initial, using auxiliary relation variables for positive
work-tape reads, running situations, head-elsewhere witnesses, and clamped/signed head predecessor
positions. On any finite ordered domain Fin B (2 ≤ B) large enough to hold the input plus both
endmarkers (input.length + 1 < B), the .tag relations in the sentence's least model equal the
exact run rows row (tm.runFrom (tm.initCfg input) t.val). Goal clauses at the maximum time B - 1
forbid every non-halted control state some s and every output view other than OutView.one true,
so the sentence holds on Fin B iff tm has halted with output [true] by step B - 1.
Main definitions #
Cslib.Complexity.Gradel.Tableau.TableauVar: binary relation variables of the Horn tableau sentence.Cslib.Complexity.Gradel.Tableau.acceptanceHornSentence: uniform SO∃-Horn sentence expressing bounded deterministic machine acceptance.
Main results #
Cslib.Complexity.Gradel.Tableau.realize_acceptanceHornSentence: the sentence holds onFin Biff the machine halts with output[true]withinB - 1steps.
References #
- E. Grädel, Finite Model Theory and Descriptive Complexity, Theorem 3.2.18 (p. 148), encoding polynomial-time deterministic computation tableaux by Horn clauses.
- E. Grädel, Capturing complexity classes by fragments of second-order logic, for the SO∃-Horn characterization of polynomial time. Section and theorem locators are unverified.
Binary relation variables of the deterministic computation tableau in SO∃-Horn form.
All variables have arity 2 ((time, pos)), ignoring the position coordinate on global features
such as .read, .state, and .out.
- tag {m : ℕ} {State : Type} (q : ImmermanVardi.Tableau.Tag m State) : TableauVar m State
Basic row feature
qat(time, pos). - read {m : ℕ} {State : Type} (i : Fin m) (s : Option Bool) : TableauVar m State
Positive work-head read witness
read R i sat(time, _). - sit {m : ℕ} {State : Type} (y : Turing.MultiTapeTM.Situation m State) : TableauVar m State
Positive running-situation witness
situation input R y aat(time, pos). - elsewhere {m : ℕ} {State : Type} (i : Fin m) (sign : Bool) : TableauVar m State
Positive head-elsewhere witness
elsewhere R i sign aat(time, pos). - inPrev {m : ℕ} {State : Type} (d : SignType) : TableauVar m State
Input-head predecessor
inputPrev input R d aat(time, pos). - headPrev {m : ℕ} {State : Type} (i : Fin m) (sign : Bool) (d : SignType) : TableauVar m State
Work-head predecessor
headPrev R i sign d aat(time, pos).
Instances For
Guards and atoms #
Clauses #
Uniform SO∃-Horn sentence over Ordered.language L expressing that tm halts with output
[true] by the maximum element of the domain.
Semantics and least-model characterization #
Soundness: targetModel is closed under all definite clauses #
Completeness: targetRow holds in leastModel #
Horn tableau acceptance. The uniform SO∃-Horn sentence acceptanceHornSentence holds on
Fin B (2 ≤ B, input.length + 1 < B) iff tm halts with output [true] by step B - 1.