unevaluated boolean and conditional expressions (take 1)
Subject: unevaluated boolean and conditional expressions (take 1)
From: Robert Dodier
Date: Sat, 28 Jan 2006 16:39:22 -0700
Hello,
I've put together some code to equip Maxima to handle unevaluated
boolean and conditional expressions.
(http://cvs.sf.net/viewcvs.py/maxima/maxima/share/contrib/boolsimp/)
It's not finished, but I think it is well on its way.
When it is completed (maybe another month or so) I want to merge it
into maxima/src/.
>From the comment header ---
; The functions in this file are an attempt to make Boolean (and, or, not)
; and conditional (if -- then -- else/elseif) expressions work more like
; arithmetic expressions in the treatment of predicates which are
; undecidable at the time the expression is evaluated,
; by allowing undecided predicates in simplified and evaluated
; expressions, instead of complaining or returning 'unknown.
Examples:
assume (a > 1);
a > 1 and b < 0 => b < 0
c > 1 and b < 0 => c > 1 and b < 0
not b < 0 => b >= 0
if c then d => if c then d
plot2d (if x > 0 then x else -x, [x, -1, 1]) => nice plot
quad_qags (if x > 0 then x else -x, x, -1 ,1) => [1.0,
1.1107651257113993E-14, 63, 0]
Comments?
Robert Dodier