Documentation

Provenance.Algorithms.CompOp

Comparison operator for HAVING enumeration algorithms #

Shared definition used by Provenance.Algorithms.CountEnum, Provenance.Algorithms.SumDP and Provenance.HavingMinMax. The operator parameter is op ∈ {=, ≠, <, ≤, >, ≥}.

inductive CompOp :

Comparison operator, as used by the HAVING enumeration algorithms.

Instances For
    Dependency graph
    @[instance_reducible]
    Equations
    Dependency graph
    Equations
    Instances For
      Dependency graph
      @[instance_reducible]
      Equations
      Dependency graph
      def CompOp.eval {V : Type u_1} [LinearOrder V] :
      CompOpVVProp

      Semantics of a comparison operator over any linearly ordered value domain (the aggregate values compared by a HAVING predicate; the enumeration algorithms use it at V = ℕ).

      Equations
      Instances For
        Dependency graph
        @[instance_reducible]
        instance instDecidableEval {V : Type u_1} [LinearOrder V] (op : CompOp) (a b : V) :
        Decidable (op.eval a b)
        Equations
        • One or more equations did not get rendered due to their size.
        Dependency graph

        The complementary comparison operator: op.negate holds exactly when op does not. This is how ProvSQL interprets NOT over an aggregate comparison (PostgreSQL's operator negator), with NOT pushed through Boolean combinations by De Morgan duality.

        Equations
        Instances For
          Dependency graph
          theorem CompOp.negate_eval {V : Type u_1} [LinearOrder V] (op : CompOp) (a b : V) :
          op.negate.eval a b ¬op.eval a b

          op.negate evaluates to the classical negation of op.

          Dependency graph