Documentation

CslibFrontier.Computability.Complexity.Fagin.Tableau.Defs

Relation variables and first-order formulas for the ESO tableau sentence #

Given a deterministic multi-tape Turing machine tm : MultiTapeTM m Bool State ([Fintype State] [DecidableEq State]) and a bundle r : FO.TableauRels L' m State of relation symbols over a first-order language L', this file defines the relation-variable index types and first-order component formulas of the existential second-order tableau sentence on Fin B.

Main definitions #

References #

Relation variables of the ESO tableau sentence #

@[reducible, inline]

Indices of the unary relation variables of the ESO tableau sentence:

  • .inl (): endPos (holds of the unique element e = u.length + w.length),
  • .inr (.inl ()): certBit (holds of input position j for u.length < j ≤ e when w[j - 1 - u.length] = true),
  • .inr (.inr (.inl q)): state q at time t,
  • .inr (.inr (.inr o)): out o at time t.
@[reducible, inline]

Indices of the binary relation variables of the ESO tableau sentence:

  • .inl (): inPos at (t, j),
  • .inr (.inl i): head i (+a) at (t, a),
  • .inr (.inr (.inl i)): head i (-a) at (t, a),
  • .inr (.inr (.inr (.inl (i, s)))): cell i (+a) s at (t, a),
  • .inr (.inr (.inr (.inr (i, s)))): cell i (-a) s at (t, a).
@[reducible, inline]
abbrev Cslib.Logic.FO.TableauVar (m : ℕ) (State : Type) :

Indices of all existential relation variables of the ESO tableau sentence.

def Cslib.Logic.FO.tableauArity (m : ℕ) (State : Type) :
TableauVar m State → ℕ

Arity assignment for TableauVar m State.

structure Cslib.Logic.FO.TableauRels (L' : FirstOrder.Language) (m : ℕ) (State : Type) :

Bundle of the 12 relation-symbol families used by the first-order tableau formulas over L'.

  • lt : L'.Relations 2

    Strict linear order < on Fin B.

  • uLen : L'.Relations 1

    Unary relation holding of the unique element z = u.length.

  • uBit : L'.Relations 1

    Unary relation holding of p < u.length when u[p] = true.

  • endPos : L'.Relations 1

    Unary relation holding of the unique certificate end position e = u.length + w.length.

  • certBit : L'.Relations 1

    Unary relation holding of j ∈ (u.length, e] when w[j - 1 - u.length] = true.

  • state : Option State → L'.Relations 1

    Unary relation family for (Feature.state q).Holds (cfg t).

  • out : Turing.OutView → L'.Relations 1

    Unary relation family for (Feature.out o).Holds (cfg t).

  • inPos : L'.Relations 2

    Binary relation for (Feature.inPos j).Holds (cfg t).

  • headPos : Fin m → L'.Relations 2

    Binary relation family for (Feature.head i (+a)).Holds (cfg t).

  • headNeg : Fin m → L'.Relations 2

    Binary relation family for (Feature.head i (-a)).Holds (cfg t).

  • cellPos : Fin m → Option Bool → L'.Relations 2

    Binary relation family for (Feature.cell i (+a) s).Holds (cfg t).

  • cellNeg : Fin m → Option Bool → L'.Relations 2

    Binary relation family for (Feature.cell i (-a) s).Holds (cfg t).

noncomputable def Cslib.Logic.FO.endPosSentence {L' : FirstOrder.Language} {m : ℕ} {State : Type} (r : TableauRels L' m State) :

Sentence asserting that r.endPos holds of a unique element e, and that r.uLen ≤ e and e is not the maximum element (e + 1 < B).

noncomputable def Cslib.Logic.FO.inputAtFormula {L' : FirstOrder.Language} {m : ℕ} {State : Type} (r : TableauRels L' m State) (s : Option Bool) {V : Type u_1} (vJ : V) :
L'.Formula V

Formula expressing inputAt (u ++ w) j = s at variable vJ : V.

noncomputable def Cslib.Logic.FO.inReadFormula {L' : FirstOrder.Language} {m : ℕ} {State : Type} (r : TableauRels L' m State) (s : Option Bool) {V : Type u_1} (vT : V) :
L'.Formula V

Formula expressing (Feature.inRead s).Holds (cfg t) at time variable vT : V.

noncomputable def Cslib.Logic.FO.readFormula {L' : FirstOrder.Language} {m : ℕ} {State : Type} (r : TableauRels L' m State) (i : Fin m) (s : Option Bool) {V : Type u_1} (vT : V) :
L'.Formula V

Formula expressing (Feature.read i s).Holds (cfg t) at time variable vT : V.

noncomputable def Cslib.Logic.FO.sitFormula {L' : FirstOrder.Language} {m : ℕ} {State : Type} (r : TableauRels L' m State) (y : Turing.MultiTapeTM.Situation m State) {V : Type u_1} (vT : V) :
L'.Formula V

Formula expressing (Feature.sit y).Holds (cfg t) at time variable vT : V.

noncomputable def Cslib.Logic.FO.inPosPrevFormula {L' : FirstOrder.Language} {m : ℕ} {State : Type} (r : TableauRels L' m State) (d : SignType) {V : Type u_1} (vT vJ : V) :
L'.Formula V

Formula expressing that the input head moves to vJ from its position at time vT under direction d.

noncomputable def Cslib.Logic.FO.headPrevFormula {L' : FirstOrder.Language} {m : ℕ} {State : Type} (r : TableauRels L' m State) (headSame headOpp : L'.Relations 2) (d : SignType) {V : Type u_1} (vT vA : V) :
L'.Formula V

Formula expressing that a work-tape head moves to signed offset vA from its position at time vT under effective direction d (where d = .pos means moving away from 0 and d = .neg means moving toward 0, crossing into headOpp at 1 when vA = 0 and d = .pos).

noncomputable def Cslib.Logic.FO.stateStepRHS {L' : FirstOrder.Language} {m : ℕ} {State : Type} (r : TableauRels L' m State) [Fintype State] [DecidableEq State] (tm : Turing.MultiTapeTM m Bool State) (q' : Option State) {V : Type u_1} (vT : V) :
L'.Formula V

Right-hand side of the step equation for state q' at time vT.

noncomputable def Cslib.Logic.FO.outStepRHS {L' : FirstOrder.Language} {m : ℕ} {State : Type} (r : TableauRels L' m State) [Fintype State] (tm : Turing.MultiTapeTM m Bool State) (o : Turing.OutView) {V : Type u_1} (vT : V) :
L'.Formula V

Right-hand side of the step equation for out o at time vT.

noncomputable def Cslib.Logic.FO.inPosStepRHS {L' : FirstOrder.Language} {m : ℕ} {State : Type} (r : TableauRels L' m State) [Fintype State] (tm : Turing.MultiTapeTM m Bool State) {V : Type u_1} (vT vJ : V) :
L'.Formula V

Right-hand side of the step equation for inPos at time vT and position vJ.

noncomputable def Cslib.Logic.FO.headStepRHS {L' : FirstOrder.Language} {m : ℕ} {State : Type} (r : TableauRels L' m State) [Fintype State] (tm : Turing.MultiTapeTM m Bool State) (headSame headOpp : L'.Relations 2) (sign : SignType) (i : Fin m) {V : Type u_1} (vT vA : V) :
L'.Formula V

Right-hand side of the step equation for a work-tape head at time vT and offset vA, with orientation sign (1 for +a, -1 for -a).

noncomputable def Cslib.Logic.FO.cellStepRHS {L' : FirstOrder.Language} {m : ℕ} {State : Type} (r : TableauRels L' m State) [Fintype State] (tm : Turing.MultiTapeTM m Bool State) (headSame : L'.Relations 2) (cellSame : Option Bool → L'.Relations 2) (i : Fin m) (s : Option Bool) {V : Type u_1} (vT vA : V) :
L'.Formula V

Right-hand side of the step equation for a work-tape cell at time vT and offset vA.

noncomputable def Cslib.Logic.FO.initSentence {L' : FirstOrder.Language} {m : ℕ} {State : Type} (r : TableauRels L' m State) [Fintype State] [DecidableEq State] (tm : Turing.MultiTapeTM m Bool State) :

Sentence fixing all basic features at t = 0.

noncomputable def Cslib.Logic.FO.stepSentence {L' : FirstOrder.Language} {m : ℕ} {State : Type} (r : TableauRels L' m State) [Fintype State] [DecidableEq State] (tm : Turing.MultiTapeTM m Bool State) :

Sentence imposing the step equations from t to t + 1 for all basic features.

noncomputable def Cslib.Logic.FO.acceptSentence {L' : FirstOrder.Language} {m : ℕ} {State : Type} (r : TableauRels L' m State) :

Sentence asking that at the maximum time step B - 1, the machine is halted (state none) with output [true] (out (.one true)).