Documentation

Determinize.Frontend.Affinity

Affinity constraints #

After shape unification and decomposition, inference is left with atomic constraints a ≤ b between affinities in the order G ≤ E. Each side is a variable or an affinity fixed by the program. A variable must be G in every solution if it lies below a G, directly or through other such variables; solveAffinities collects these variables, sets them to G and every other variable to E, and checks the result. Proof/Frontend/Affinity.lean proves that it returns the greatest solution, and fails exactly when there is none.

One side of an affinity constraint.

Instances For
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      @[reducible, inline]

      lower ≤ upper in the order G ≤ E.

      Equations
      Instances For

        The variables on the lower side of some constraint.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          def Determinize.Frontend.below {V : Type} [DecidableEq V] (constraints : List (AffinityConstraint V)) (general : Finset V) :

          The variables v with a constraint v ≤ t where t is G or a variable in general.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            theorem Determinize.Frontend.below_subset_lowerVars {V : Type} [DecidableEq V] (constraints : List (AffinityConstraint V)) (general : Finset V) :
            below constraints general ⊆ lowerVars constraints
            @[irreducible]
            def Determinize.Frontend.forcedGeneral {V : Type} [DecidableEq V] (constraints : List (AffinityConstraint V)) (general : Finset V) :

            Close general under below. Started from ∅, this gives the variables that every solution sets to G.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For

              The greatest solution: G on the variables that every solution sets to G, E elsewhere; or none if that assignment, and hence every assignment, violates a constraint.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For