Documentation

DescriptiveComplexity.Problems.Wide.DrawEval

The evaluation's spine: the per-variable loop #

The per-address evaluation the outer program abstracts (DescriptiveComplexity.Problems.Wide.DrawOuter) factors once more, the same way: a spine – one checkpoint per variable position, dispatching into that variable's machinery and, after the last, back into the outer loop – around per-variable sub-machineries (the gates, the VAL loop, the atom subroutines, the stage write) that stay abstract here.

A checkpoint phase chk k owns two things: the walk back to the marker (entering rules step right off it, as everywhere in the assembly) and the dispatch at the marker. For k < nv the dispatch enters variable k's machinery; at k = nv it is the pair of outer boundary rules the outer file promised – erase the marker and step right, into the sweep's advance below the ltp cell, into the post-sweep reset at it. A sub-machinery's final exit targets the next checkpoint, which is how the spine needs to know nothing about its internals.

The spine's shapes #

The phases of the evaluation: one checkpoint per variable position (the last is the return to the outer loop), and the sub-machineries'.

  • chk {nv : } {PM : Type} : Fin (nv + 1)EvalPh nv PM

    The checkpoint before variable k (at k = nv: after the last).

  • sub {nv : } {PM : Type} : PMEvalPh nv PM

    A phase of a sub-machinery.

Instances For
    Dependency graph
    Dependency graph

    The sites of the evaluation: one per checkpoint, and the sub-machineries'.

    Instances For
      Dependency graph

      The rules of a checkpoint: the walk back to the marker, and the two dispatches (the second is only live at the last checkpoint).

      • stay : EvalChkRule

        Walk left back to the marker.

      • dspA : EvalChkRule

        Dispatch: into the variable's machinery, or – at the last checkpoint, below the ltp cell – into the sweep's advance.

      • dspB : EvalChkRule

        Dispatch at the last checkpoint, at the ltp cell: into the post-sweep reset. Dead below the last checkpoint.

      Instances For
        Dependency graph
        Dependency graph
        Dependency graph
        Dependency graph
        noncomputable def DescriptiveComplexity.Draw.Data.evalRule {L : FirstOrder.Language} (dt : Data L) {A Q PM SM : Type} {nv : } (zero one : A) {ShM : SMType} (ruleM : (s : SM) → ShM sRule A Q dt.SlotIx (OuterPh (EvalPh nv PM))) (subEntry : Fin nvPM) (i : EvalSite nv SM) :
        EvalSh nv SM ShM iRule A Q dt.SlotIx (OuterPh (EvalPh nv PM))

        The rules of the evaluation's spine: per checkpoint the walk back and the dispatches; the sub-machineries' rules are the parameter.

        Equations
        Instances For
          Dependency graph
          Dependency graph
          theorem DescriptiveComplexity.Draw.Data.evalHosrc {L : FirstOrder.Language} (dt : Data L) {A Q PM SM : Type} {nv : } (zero one : A) {ShM : SMType} {ruleM : (s : SM) → ShM sRule A Q dt.SlotIx (OuterPh (EvalPh nv PM))} {subEntry : Fin nvPM} {ownM : PMSM} (hosrcM : ∀ (s : SM) (ρ : ShM s), ∃ (p : PM), (ruleM s ρ).srcPh = OuterPh.evalP (EvalPh.sub p) ownM p = s) (e : EvalSite nv SM) (ρ : EvalSh nv SM ShM e) :
          ∃ (p : EvalPh nv PM), (dt.evalRule zero one ruleM subEntry e ρ).srcPh = OuterPh.evalP p evalOwn ownM p = e

          Every spine rule fires from a phase its site owns; the sub-machineries' obligation is the parameter.

          Dependency graph
          theorem DescriptiveComplexity.Draw.Data.evalSep {L : FirstOrder.Language} (dt : Data L) {A Q PM SM : Type} {nv : } (zero one : A) {ShM : SMType} {ruleM : (s : SM) → ShM sRule A Q dt.SlotIx (OuterPh (EvalPh nv PM))} {subEntry : Fin nvPM} (hsepM : ∀ (s : SM) (ρ ρ' : ShM s) (f : QA) (g : dt.SlotIxA), (ruleM s ρ).guard f g(ruleM s ρ').guard f g(ruleM s ρ).srcPh = (ruleM s ρ').srcPhρ = ρ') (e : EvalSite nv SM) (ρ ρ' : EvalSh nv SM ShM e) (f : QA) (g : dt.SlotIxA) :
          (dt.evalRule zero one ruleM subEntry e ρ).guard f g(dt.evalRule zero one ruleM subEntry e ρ').guard f g(dt.evalRule zero one ruleM subEntry e ρ).srcPh = (dt.evalRule zero one ruleM subEntry e ρ').srcPhρ = ρ'

          The spine separates in-shape: per checkpoint, the walk's guard is disjoint from the dispatches' and the two dispatches split on the ltp mark; the sub-machineries' separation is the parameter.

          Dependency graph