Documentation

DescriptiveComplexity.Problems.Wide.DrawChain

The chain combinator: checkpoints around abstract stages #

The outer program, the evaluation's spine and one variable's machinery all repeat one pattern: checkpoints – a phase whose stay rule walks left to the working-cell marker and whose dispatch rules fire there – between stages that are kit instances or further abstract blocks. The remaining machinery (the gates, the per-atom subroutines, the tuple and element loops) is more of the same, so this file is the pattern as a combinator, built once:

A machinery block is then a stage family (its kits, with their sep and exit_disjoint) plus a descriptor list, and nothing else.

Rules without their source phase #

A rule without its source phase: what a chain's dispatch descriptor is – the checkpoint it belongs to supplies the source.

  • guard : (QA)(WA)Prop

    When the rule applies.

  • dstPh : P

    The phase the rule moves to.

  • dstSt : (QA)(WA)QA

    The pointer the rule leaves in the control.

  • wr : (QA)(WA)WA

    The tracks the rule writes.

  • moveRight : Prop

    Whether the rule moves the head right.

Instances For
    Dependency graph
    def DescriptiveComplexity.Draw.PreRule.toRule {A Q W P : Type} (r : PreRule A Q W P) (p : P) :
    Rule A Q W P

    A descriptor, at a source phase.

    Equations
    Instances For
      Dependency graph

      The chain's shapes #

      The phases of a chain: n checkpoints, and the stages'.

      Instances For
        Dependency graph
        Dependency graph

        The sites of a chain.

        Instances For
          Dependency graph
          def DescriptiveComplexity.Draw.ChainSh (n : ) (SS : Type) (ShS : SSType) :
          ChainSite n SSType

          The rule shape of each chain site: checkpoints carry the three-rule gadget, stages their own shapes.

          Equations
          Instances For
            Dependency graph

            The rules #

            def DescriptiveComplexity.Draw.chainRule {A Q W P PS SS : Type} {n : } {ShS : SSType} (one : A) (wk : W) (emb : ChainPh n PSP) (ruleS : (s : SS) → ShS sRule A Q W P) (dsp : Fin nBoolPreRule A Q W P) (i : ChainSite n SS) :
            ChainSh n SS ShS iRule A Q W P

            The rules of a chain: per checkpoint the walk back to the marker and its two dispatch descriptors; the stages' rules are the parameter.

            Equations
            Instances For
              Dependency graph
              theorem DescriptiveComplexity.Draw.chainRule_dstIn {A Q W P PS SS : Type} {n : } {ShS : SSType} {one : A} {wk : W} {emb : ChainPh n PSP} {ruleS : (s : SS) → ShS sRule A Q W P} {dsp : Fin nBoolPreRule A Q W P} {S : PProp} (hemb : ∀ (p : ChainPh n PS), S (emb p)) (hdsp : ∀ (k : Fin n) (b : Bool), S (dsp k b).dstPh) (hS : ∀ (s : SS) (ρ : ShS s), S (ruleS s ρ).dstPh) (i : ChainSite n SS) (ρ : ChainSh n SS ShS i) :
              S (chainRule one wk emb ruleS dsp i ρ).dstPh

              A property of a chain's phases and its dispatches' destinations holds of every phase it can move to: the checkpoints stay where they are, the dispatches go where their descriptors say, and the stages are the parameter. This is what a determinism-after-the-guess argument asks of a sequenced machinery (DescriptiveComplexity.Draw.Data.nexProg_uniqueFrom).

              Dependency graph
              theorem DescriptiveComplexity.Draw.chainSep {A Q W P PS SS : Type} {n : } {ShS : SSType} {one : A} {wk : W} {emb : ChainPh n PSP} {ruleS : (s : SS) → ShS sRule A Q W P} {dsp : Fin nBoolPreRule A Q W P} (hwk : ∀ (k : Fin n) (b : Bool) (f : QA) (g : WA), (dsp k b).guard f gg wk = one) (hAB : ∀ (k : Fin n) (f : QA) (g : WA), ¬((dsp k false).guard f g (dsp k true).guard f g)) (hsepS : ∀ (s : SS) (ρ ρ' : ShS s) (f : QA) (g : WA), (ruleS s ρ).guard f g(ruleS s ρ').guard f g(ruleS s ρ).srcPh = (ruleS s ρ').srcPhρ = ρ') (i : ChainSite n SS) (ρ ρ' : ChainSh n SS ShS i) (f : QA) (g : WA) :
              (chainRule one wk emb ruleS dsp i ρ).guard f g(chainRule one wk emb ruleS dsp i ρ').guard f g(chainRule one wk emb ruleS dsp i ρ).srcPh = (chainRule one wk emb ruleS dsp i ρ').srcPhρ = ρ'

              A chain separates in-shape: the stay's guard is disjoint from the dispatches' – they only fire at the marker – and the two dispatches of a checkpoint never fire together; the stages' separation is the parameter.

              Dependency graph
              theorem DescriptiveComplexity.Draw.chainHosrc {A Q W P PS SS : Type} {n : } {ShS : SSType} {one : A} {wk : W} {emb : ChainPh n PSP} {ruleS : (s : SS) → ShS sRule A Q W P} {dsp : Fin nBoolPreRule A Q W P} {S' : Type} (site : ChainSite n SSS') (own : ChainPh n PSS') (hownChk : ∀ (k : Fin n), own (ChainPh.chk k) = site (ChainSite.chk k)) (hosrcS : ∀ (s : SS) (ρ : ShS s), ∃ (p : ChainPh n PS), (ruleS s ρ).srcPh = emb p own p = site (ChainSite.sub s)) (i : ChainSite n SS) (ρ : ChainSh n SS ShS i) :
              ∃ (p : ChainPh n PS), (chainRule one wk emb ruleS dsp i ρ).srcPh = emb p own p = site i

              Every chain rule fires from a phase its site owns; the stages' obligation is the parameter.

              Dependency graph