Documentation

DescriptiveComplexity.Problems.Wide.NexEval

The clocked evaluation's spine #

The space-bounded spine (DescriptiveComplexity.Draw.Data.evalRule) ends its last checkpoint in one of two outer phases – the sweep's advance, or the post-sweep reset – because it runs inside an iteration. A clocked program has neither: its evaluation runs once, and its last checkpoint leaves into whatever phase the caller names. So the spine's rules are not the space-bounded ones at another embedding; they are two rules per checkpoint instead of three, at the clocked program's own phases (DescriptiveComplexity.Draw.NexPh).

Everything else is shared: the sites are DescriptiveComplexity.Draw.EvalSite, the machineries' rules are the parameter, and the ownership and separation proofs are the same case analysis with the dead third rule gone.

The run is nexEval_reachesIn, and it is the space-bounded spine's count with the same shape: one machinery's width plus its dispatch and its walk back, once per variable.

The file also assembles the program: the spine's rules at the shared machineries – a clocked program's tower above the atom is the space-bounded one, PMF, SMF, SEF and varRuleF and all – with nexEvalHosrcF/nexEvalSepF, and nexProg – the outer layer's rules at the two sweep specifications with the evaluation's as their parameter. That last is built directly rather than through DescriptiveComplexity.Draw.Assembly, because a clocked program is not deterministic: its guess site fires three rules on the same data, which is the one piece of nondeterminism it has, and what does hold there is DescriptiveComplexity.Draw.Data.nexSep_postGuess.

The rules of a clocked checkpoint: the walk back to the marker, and the one dispatch – into the variable's machinery below the last checkpoint, out of the evaluation at it.

Instances For
    Dependency graph
    Dependency graph
    Dependency graph
    Dependency graph
    noncomputable def DescriptiveComplexity.Draw.Data.nexEvalRule {L : FirstOrder.Language} (dt : Data L) {A Q PM SM B : Type} {nv : ℕ} (one : A) {ShM : SM → Type} (ruleM : (s : SM) → ShM s → Rule A Q dt.SlotIx (NexPh B (EvalPh nv PM))) (subEntry : Fin nv → PM) (exitPh : NexPh B (EvalPh nv PM)) (i : EvalSite nv SM) :
    NexEvalSh nv SM ShM i → Rule A Q dt.SlotIx (NexPh B (EvalPh nv PM))

    The rules of a clocked evaluation's spine: per checkpoint the walk back and the dispatch; the sub-machineries' rules are the parameter, and the exit at the last checkpoint is the caller's phase.

    Equations
    Instances For
      Dependency graph

      The spine at the clocked machineries #

      The types of the spine, and its rules at the clocked variable machineries: what DescriptiveComplexity.Draw.Data.nexRule takes as its evaluation parameter. The phases are EvalPh over the machineries', as in the space-bounded program; only the machineries are the clocked ones and the exit is the accepting phase.

      The rule shape of the clocked evaluation's sites: the spine's own, two rules per checkpoint, over the machinery sites of the shared tower.

      Equations
      Instances For
        Dependency graph
        noncomputable def DescriptiveComplexity.Draw.Data.nexSmRule {L : FirstOrder.Language} (dt : Data L) {A Q B : Type} (zero one : A) (args : (v : dt.VarIx) → dt.VarArgs v) (s : dt.SMF) :
        dt.SMSh s → Rule A Q dt.SlotIx (NexPh B (EvalPh dt.nv dt.PMF))

        The rules of the clocked evaluation's machineries: one copy of the clocked variable machinery per spine position – its exit the next checkpoint – and the output's, whose exit is the accepting phase.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          Dependency graph
          noncomputable def DescriptiveComplexity.Draw.Data.nexEvalRuleF {L : FirstOrder.Language} (dt : Data L) {A Q B : Type} (zero one : A) (args : (v : dt.VarIx) → dt.VarArgs v) (e : dt.SEF) :
          dt.NexSESh e → Rule A Q dt.SlotIx (NexPh B (EvalPh dt.nv dt.PMF))

          The rules of the clocked evaluation: the spine over the machineries, leaving at the last checkpoint into the output's machinery, whose own exit is the accepting phase. The accepting predicate reads that machinery's verdict bit, so the evaluation has to run it: a last checkpoint that went straight to acceptP would leave the bit unwritten.

          Equations
          Instances For
            Dependency graph

            The clocked program #

            The rule set assembled: the outer layer's rules at the two sweep specifications, with the evaluation's as their parameter. Unlike the space-bounded program this is not an DescriptiveComplexity.Draw.Assembly – the guess site fires three rules on the same data, which is the program's one piece of nondeterminism – so the record is built directly and the separation that does hold is DescriptiveComplexity.Draw.Data.nexSep_postGuess.

            @[reducible, inline]
            noncomputable abbrev DescriptiveComplexity.Draw.Data.NexRIx {L : FirstOrder.Language} (dt : Data L) {G : Type} :

            The rule names of the clocked program: a site of its outer layer, or of its evaluation, and one of that site's rules.

            Equations
            Instances For
              Dependency graph
              noncomputable def DescriptiveComplexity.Draw.Data.nexProg {L : FirstOrder.Language} (dt : Data L) {A G : Type} [Fintype dt.CtlIx] [Fintype dt.SlotIx] [DecidableEq dt.SlotIx] [LinearOrder A] [Finite A] [Finite dt.KIx] [Nonempty A] (zero one : A) (hzo : zero ≠ one) (hpl : Fintype.card (dt.CtlIx ⊕ dt.SlotIx) ≤ dt.dd) (coord : Fin dt.dd → dt.CtlIx) (β : SweepSpec A dt.CtlIx dt.SlotIx (Option dt.KIx)) (γ : GuessSpec A dt.CtlIx dt.SlotIx (Option dt.KIx) G) (args : (v : dt.VarIx) → dt.VarArgs v) (bot : Option dt.KIx) :
              Prog A dt.NexRIx (NexPh (Option dt.KIx) (EvalPh dt.nv dt.PMF)) dt.CtlIx dt.SlotIx dt.KIx dt.dd

              The clocked program: the outer layer's rules – the opening step, the build sweep, the walk home, the guess sweep, the walk home – with the clocked evaluation's as their parameter, and the reduction's constants. The accepting phase is the outer layer's, and its verdict is read from the control exactly as the space-bounded program's is.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                Dependency graph
                theorem DescriptiveComplexity.Draw.Data.nexEval_reachesIn {L : FirstOrder.Language} {dt : Data L} {A R Q PM SM B : Type} {nv : ℕ} [Fintype Q] [Fintype dt.SlotIx] [LinearOrder A] [LinearOrder R] [LinearOrder (NexPh B (EvalPh nv PM))] [FirstOrder.Language.wide.Structure (Univ A R (NexPh B (EvalPh nv PM)) dt.KIx dt.dd)] [Finite A] [Finite R] [Finite (NexPh B (EvalPh nv PM))] {ShM : SM → Type} {PR : Prog A R (NexPh B (EvalPh nv PM)) Q dt.SlotIx dt.KIx dt.dd} {I : Type} {ile : I → I → Prop} (RF : IxFile (Univ A R (NexPh B (EvalPh nv PM)) dt.KIx dt.dd) I ile) {ruleM : (s : SM) → ShM s → Rule A Q dt.SlotIx (NexPh B (EvalPh nv PM))} {subEntry : Fin nv → PM} {exitPh : NexPh B (EvalPh nv PM)} {rEmb : (i : EvalSite nv SM) → NexEvalSh nv SM ShM i → R} (hrules : ∀ (i : EvalSite nv SM) (ρ : NexEvalSh nv SM ShM i), PR.rules (rEmb i ρ) = dt.nexEvalRule PR.one ruleM subEntry exitPh i ρ) (hR : PR.table.Reads) (hlin : IsLinOrd WMLe) (hix : IsLinOrd ile) {gbot : I} (hbot : ∀ (y : I), ile gbot y) {v v' : Univ A R (NexPh B (EvalPh nv PM)) dt.KIx dt.dd → Prop} (hv : WMSetLt WMLe v (RF.cell gbot)) (hvi : WMIncr WMLe v v') {restOf : Fin (nv + 1) → (Univ A R (NexPh B (EvalPh nv PM)) dt.KIx dt.dd → Prop) → dt.SlotIx → A} {mvOf : Fin (nv + 1) → I → Prop} (hwkOf : ∀ (k : Fin (nv + 1)) (r : Univ A R (NexPh B (EvalPh nv PM)) dt.KIx dt.dd → Prop), restOf k r Slot.wk = bitVal PR.zero PR.one (r = v)) (hrgOf : ∀ (k : Fin (nv + 1)) (r : Univ A R (NexPh B (EvalPh nv PM)) dt.KIx dt.dd → Prop), restOf k r Slot.reg = bitVal PR.zero PR.one (∃ (u : I), r = RF.cell u)) (fs : Fin (nv + 1) → Q → A) (w : ℕ) (hVar : ∀ (k : Fin nv), (wideData (Univ A R (NexPh B (EvalPh nv PM)) dt.KIx dt.dd)).ReachesIn w { state := Sum.inr (PR.stElt (NexPh.evalP (EvalPh.sub (subEntry k))) (fs k.castSucc)), head := Sum.inl v', tape := wideTape (PR.trackTapeAt RF.cell Slot.val (restOf k.castSucc) (mvOf k.castSucc)) (PR.syElt PR.blank) } { state := Sum.inr (PR.stElt (NexPh.evalP (EvalPh.chk k.succ)) (fs k.succ)), head := Sum.inl v', tape := wideTape (PR.trackTapeAt RF.cell Slot.val (restOf k.succ) (mvOf k.succ)) (PR.syElt PR.blank) }) :
                (wideData (Univ A R (NexPh B (EvalPh nv PM)) dt.KIx dt.dd)).ReachesIn ((w + 2) * nv) { state := Sum.inr (PR.stElt (NexPh.evalP (EvalPh.chk 0)) (fs 0)), head := Sum.inl v, tape := wideTape (PR.trackTapeAt RF.cell Slot.val (restOf 0) (mvOf 0)) (PR.syElt PR.blank) } { state := Sum.inr (PR.stElt (NexPh.evalP (EvalPh.chk (Fin.last nv))) (fs (Fin.last nv))), head := Sum.inl v, tape := wideTape (PR.trackTapeAt RF.cell Slot.val (restOf (Fin.last nv)) (mvOf (Fin.last nv))) (PR.syElt PR.blank) }

                The spine's run, on a clock: from the checkpoint before the first variable at the marker to the checkpoint after the last, one machinery run per position, each with its dispatch and its walk back.

                Dependency graph