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 : (Q → A) → (W → A) → Prop

    When the rule applies.

  • dstPh : P

    The phase the rule moves to.

  • dstSt : (Q → A) → (W → A) → Q → A

    The pointer the rule leaves in the control.

  • wr : (Q → A) → (W → A) → W → A

    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 : SS → Type) :
          ChainSite n SS → Type

          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 : SS → Type} (one : A) (wk : W) (emb : ChainPh n PS → P) (ruleS : (s : SS) → ShS s → Rule A Q W P) (dsp : Fin n → Bool → PreRule A Q W P) (i : ChainSite n SS) :
            ChainSh n SS ShS i → Rule 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.chainSep {A Q W P PS SS : Type} {n : ℕ} {ShS : SS → Type} {one : A} {wk : W} {emb : ChainPh n PS → P} {ruleS : (s : SS) → ShS s → Rule A Q W P} {dsp : Fin n → Bool → PreRule A Q W P} (hwk : ∀ (k : Fin n) (b : Bool) (f : Q → A) (g : W → A), (dsp k b).guard f g → g wk = one) (hAB : ∀ (k : Fin n) (f : Q → A) (g : W → A), ¬((dsp k false).guard f g ∧ (dsp k true).guard f g)) (hsepS : ∀ (s : SS) (ρ ρ' : ShS s) (f : Q → A) (g : W → A), (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 : Q → A) (g : W → A) :
              (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