Comparison operator for HAVING enumeration algorithms #
Shared definition used by Provenance.Algorithms.CountEnum,
Provenance.Algorithms.SumDP and Provenance.HavingMinMax. The operator
parameter is op ∈ {=, ≠, <, ≤, >, ≥}.
Comparison operator, as used by the HAVING enumeration algorithms.
syneq and synne are SQL's IS NOT DISTINCT FROM and IS DISTINCT FROM: they compare values as values, two nulls being the same value, and
so are never unknown. Every other comparison is null-strict
(CompOp.strict). The distinction is what grouping, partitioning,
duplicate elimination and difference need, since they key on values and
not on the three-valued equality.
- eq : CompOp
- ne : CompOp
- lt : CompOp
- le : CompOp
- gt : CompOp
- ge : CompOp
- syneq : CompOp
IS NOT DISTINCT FROM. - synne : CompOp
IS DISTINCT FROM.
Instances For
Dependency graph
Dependency graph
Equations
- instReprCompOp.repr CompOp.eq prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "CompOp.eq")).group prec✝
- instReprCompOp.repr CompOp.ne prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "CompOp.ne")).group prec✝
- instReprCompOp.repr CompOp.lt prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "CompOp.lt")).group prec✝
- instReprCompOp.repr CompOp.le prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "CompOp.le")).group prec✝
- instReprCompOp.repr CompOp.gt prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "CompOp.gt")).group prec✝
- instReprCompOp.repr CompOp.ge prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "CompOp.ge")).group prec✝
- instReprCompOp.repr CompOp.syneq prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "CompOp.syneq")).group prec✝
- instReprCompOp.repr CompOp.synne prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "CompOp.synne")).group prec✝
Instances For
Dependency graph
Equations
- instReprCompOp = { reprPrec := instReprCompOp.repr }
Dependency graph
Whether the comparison is null-strict, that is, unknown as soon as an operand is null. All of SQL's comparisons are, except the two syntactic ones.
Instances For
Dependency graph
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
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.