Documentation

Provenance.SymCode

Codes of parameter values relative to a cut #

The right side of an apply inside a recursive term cannot be decorrelated: the decorrelation would read the recursive relation twice. What replaces it is a table of the right side at every type of the parameter row, computed outside the recursion and joined to the recursive relation. The type of a parameter u is read relative to a finite set C of values, the cut: each component either is a value of C (or the null), or lies strictly between two consecutive non-null values of C – or below the least – and then only its rank among the components of u in the same gap is recorded. That is the component's code.

This file is the value-level part: the codes (Sym.Code), the code of a component (Sym.code), and the facts the symbolic evaluation rests on – two components have the same code exactly when they are equal (Sym.code_eq_code_iff), and the order of the codes, which reads the bound and the rank and never the value, is the order of the values wherever the concrete side is in the cut (Sym.Code.lt_iff).

def Sym.IsFresh {T : Type} [ValueType T] (C : Finset T) (a : T) :

A fresh value: non-null and outside the cut.

Equations
Instances For
    Dependency graph
    @[instance_reducible]
    instance Sym.instDecidableIsFresh {T : Type} [ValueType T] (C : Finset T) (a : T) :
    Equations
    Dependency graph
    def Sym.below {T : Type} [ValueType T] (C : Finset T) (a : T) :

    The non-null values of the cut strictly below a.

    Equations
    Instances For
      def Sym.lo {T : Type} [ValueType T] (C : Finset T) (a : T) :

      The gap's lower bound: the greatest non-null value of the cut below a, ⊥ if there is none.

      Equations
      Instances For
        Dependency graph
        def Sym.rank {T : Type} [ValueType T] (C : Finset T) {k : ℕ} (u : Fin k → T) (a : T) :

        The rank of a among the components of u: how many distinct fresh components share its gap and are below it.

        Equations
        Instances For
          Dependency graph

          Codes #

          inductive Sym.Code (T : Type) :

          A code: a value standing for itself, or a gap of the cut (its lower bound, ⊥ below the least non-null value) with a rank in it.

          Instances For
            Dependency graph
            Dependency graph
            def Sym.instDecidableEqCode.decEq {T✝ : Type} [DecidableEq T✝] (x✝ x✝¹ : Code T✝) :
            Decidable (x✝ = x✝¹)
            Equations
            Instances For
              Dependency graph
              def Sym.code {T : Type} [ValueType T] (C : Finset T) {k : ℕ} (u : Fin k → T) (i : Fin k) :

              The code of a component of the parameter row.

              Equations
              Instances For
                Dependency graph
                theorem Sym.code_eq_code_iff {T : Type} [ValueType T] {C : Finset T} {k : ℕ} {u : Fin k → T} {i j : Fin k} :
                code C u i = code C u j ↔ u i = u j

                Two components have the same code exactly when they are equal.

                Dependency graph

                The order of codes #

                def Sym.Code.lt {T : Type} [ValueType T] :
                Code T → Code T → Prop

                The order of codes: concrete values by their order; a concrete value below a gap when it is at most its bound; a gap below a concrete value when its bound is; two gaps by their bounds, then their ranks.

                Equations
                Instances For
                  Dependency graph
                  def Sym.Valid {T : Type} [ValueType T] (C : Finset T) {k : ℕ} (u : Fin k → T) (x : Code T) :

                  A code standing for a value of u, or for a value of the cut: what a cell holds wherever the symbolic evaluation is faithful. The null is set aside – a comparison with it is unknown, whatever the code.

                  Equations
                  Instances For
                    Dependency graph
                    noncomputable def Sym.dec {T : Type} [ValueType T] (C : Finset T) {k : ℕ} (u : Fin k → T) :
                    Code T → T

                    The value a code stands for under the parameter row u: a fresh code reads the component it is the code of.

                    Equations
                    Instances For
                      Dependency graph
                      theorem Sym.Code.lt_iff {T : Type} [ValueType T] {C : Finset T} {k : ℕ} {u : Fin k → T} {x y : Code T} (hx : Valid C u x) (hy : Valid C u y) :
                      x.lt y ↔ dec C u x < dec C u y

                      The order of valid codes is the order of the values they stand for.

                      Dependency graph