partially-evaluated Boolean expression stuff committed



Hello,

I've committed changes to the code for Boolean expressions per
discussion here recently. Changes to the code for conditional
expressions (i.e. if--then--else) were not committed.

Hope this helps,
Robert

PS. Here is the log message.

Make Maxima comfortable with partially-evaluated Boolean expressions
by merging code from share/contrib/boolsimp.lisp into src.
(Only the stuff for Boolean expressions has been brought over;
the stuff for partially-evaluated conditional expressions was not.)

The global flag prederror is still honored. When prederror=true,
Boolean expressions which evaluate (under "is", "if",
or one of the operators "and", "or", or "not") to something
other than true or false trigger an error.
The default value of prederror is now false (was true).

With these modifications, run_testsuite() (including new tests for
Boolean expressions) succeeds without unexpected errors.

Residual strangeness: "and", "or", and "not" cause evaluation of
their operands via MEVALP. So (foo or bar) is equivalent to
(?mevalp(foo) or ?mevalp(bar)). This is mostly OK but for operands
which are a=b or a#b, MEVALP always returns T or NIL so "and", "or",
and "not" turn anything with = or # into true or false. I'm inclined
to think that's a bug. (The structure of the previous code was
pretty much entirely preserved, which is the source of this bug;
there may be other strangeness present for the same reason.)

  * doc/info/Operators.texi:
    Update descriptions of "and", "or", and "not"
    Update descriptions of "equal" and "notequal"

  * doc/info/Program.texi:
    Update description of "if"

  * share/contrib/boolsimp/boolsimp.lisp:
    Cut out code which was merged into various src files

  * share/contrib/boolsimp/rtest_boolsimp.mac:
    Cut out tests which were moved to tests/rtest_boolean.mac

  * src/acall.lisp:
    Cut $MAYBE (redefined elsewhere)
    Cut special declaration for PATEVALLED
    Modify MEVALP_TR and MEVALP1_TR

  * src/asum.lisp:
    Modify NARY1 to better flatten Boolean expressions

  * src/compar.lisp:
    Change default value of $PREDERROR to NIL
    Cut out obsolete special PATEVALLED (now a lexical variable)
    Paste in lengthy comments about evaluation and simplification
    policies for Boolean expressions
    Redefine $MAYBE
    Define simplification functions for Boolean operators
    Modify MEVAP, MEVALP1, and MEVALP2
    Redefine MAND, MOR, and MNOT

  * src/trpred.lisp:
    Cut out translation properties for MAND, MOR, and MNOT

  * tests/Makefile.am:
    Put rtest_boolean.mac on list of files
    Put rtest_mset.mac on list (was omitted by mistake before)

  * tests/rtest_boolean.mac: (new)
    Tests for partially-evaluated Boolean expressions

  * tests/rtestsum.mac:
    Problem 5 no longer fails so cut out comment about known failure

  * tests/testsuite.lisp;
    Remove rtestsum problem 5 from known failures
    Put rtest_boolean on list of tests