Documentation

GeneralizationLinter.Analysis.Candidates

Candidates #

The kinds of possible weakening suggestions.

  • drop : WeakeningShape

    Binder may be droppable: as far as the linter can tell, nothing requires it, or everything it would have to provide is already available without it.

  • weaken (weakerVertex : Vertex) : WeakeningShape

    Binder may be weakenable to weakerVertex.

  • split (weakerVertices : Array Vertex) : WeakeningShape

    Binder may be weakenable by splitting it up into weakerVertices.

Instances For

    An unverified weakening candidate.

    Instances For

      The Vertexes of the classes of the proposed replacements.

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

        Returns true iff u and v can be unified.

        Note: We use syntactic equality in this process, so e.g. OrderDual ℕ does not unify with according to us, even though Lean's actual unification mechanism would unify them, since it uses definitional equality.


        Examples

        Vertex.unifiable (Monoid #0) (Semigroup #0) = false
        Vertex.unifiable (Pow #0 ℕ) (Pow #0 ℤ) = false
        Vertex.unifiable (Pow #0 ℕ) (Pow #0 #1) = true
        Vertex.unifiable (Module #0 #0) (Module #0 #1) = true
        Vertex.unifiable (Module #0 #0) (Module #0 (MulOpposite #0)) = false
        
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          def GeneralizationLinter.mcaCandidates (graph : ClassGraph) (binders : Array TargetedBinder) (reqs : Array Requirement) (cfg : LinterConfig := { }) (includeSubsumers : Bool := true) :

          Return a (possibly empty) array of candidate weakenings for any of the targeted binders binders such that the requirements reqs are still satisfied.

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