On 2014-11-20, Emmanuel Charpentier <
emanuel.c...@gmail.com> wrote:
> BTW, Maxima has this kind of logic (for example, "is" can return "true",
> "false" or "unknown") and uses it, so it's at least conceptually doable.
> And useful ! But with very deep consequences.
For the record, Maxima has a global flag prederror which governs the
evaluation of predicates. When prederror=false (default), is(p) =>
unknown when p is not known (to Maxima) to be true or false, and
if p then ... evaluates to a partially-evaluated conditional
expression. When prederror=true, is(p) and if p then ... trigger
an error.
In practice, this has worked well enough, i.e. without causing too
much confusion -- I don't remember any complaints about programs
assuming true/false not working as expected. A more theoretical
problem is that Maxima's partial evaluation policy isn't entirely
consistent -- when p isn't decidable to Maxima, you can get a
partially-evaluated conditional, but not a partially-evaluated
loop (triggers an error), and various programming functions (e.g.
length, first, integerp) might act in an unexpected way. This, too,
hasn't caused trouble, from what I remember.
FWIW
Robert Dodier