A value domain. The isNull predicate says which of its values is
SQL's NULL; a domain without one answers false everywhere, which is the
default, and the three-valued semantics is then the two-valued one. Carrying
the test here rather than in a stronger class is what lets one semantics
serve both: the results proved over ℕ, where nothing is null, keep saying
what they said.
- zero : T
- add : T → T → T
- sub : T → T → T
- mul : T → T → T
- min : T → T → T
- max : T → T → T
- isNull : T → Bool
Whether a value is the null.
The domain's zero is not its null: an aggregate over no row is not an aggregate that came out zero.
- nonzero : T
A value of its own: one that is neither the zero nor the null. A domain of SQL has one, and a query needs one to mark a row with – which is what the difference does when it tags the two sides of a union to tell them apart afterwards.
It is not the zero.
And it is not the null.
- nullVal : Option T
isNullrecognizes exactly that value.
Instances
Dependency graph
A value domain in which nothing is null. The three-valued semantics agrees with the two-valued one there, which is why every statement proved before the null was introduced keeps saying what it said.
No value is the null.
Instances
Dependency graph
Equations
- One or more equations did not get rendered due to their size.