Programming with Useful Quantifiers
Description
Many programming languages have functions which implement universal
and existential quantifiers. Typically these are implemented as
higher order functions which accept a Boolean predicate and some
sort of iterable and return a Boolean value indicating whether a
predicate is validated over the iterable or rather, whether a counterexample
or witness was encountered. These quantifiers are elegant to use
and allow application code to be written which closely resembles
axiomatic algebraic specifications. A disadvantage is seen when
unexpected results occur, \eg, when attempting to debug user
defined predicates. These quantifiers do not have easy ways of
returning the witness or counterexample as such would typically
violate the expected Boolean return value, and thus modify the
program flow or in some cases cause compilation errors. Users are
usually forced to refactor code to avoid the elegant quantifiers in
order to debug their code. We present implementations of universal
and existential quantifiers in Clojure, Common Lisp, Python, and
Scala, which conceptually extend the Boolean type with decorations
which are useful not only for debugging but for mathematical
purposes.
Files
newton.25.els.pdf
Files
(618.7 kB)
| Name | Size | Download all |
|---|---|---|
|
md5:d2239b9624e80709a14873c97b4f1bbe
|
618.7 kB | Preview Download |
Additional details
Identifiers
- ISSN
- 2677-3465
Dates
- Accepted
-
2025-05-12
Software
- Repository URL
- https://github.com/jimka2001/heavybool
- Programming language
- Python, Clojure, Common Lisp, Scala