Search code examples
logical-operatorssymbolic-mathmaxima

Maxima -- Reduction of Logical expressions


Consider the following sequences of maxima's instructions:

(in1) x=0;
(out) x=0

(in2) y>0;
(out) y>0

(in3) x>0 and y>0;
(out) x>0 and y>0

(in4) x=0 or y>0;
(out) y>0

(in5) x=0 and y>0;
(out) false

The first three instructions produce expected outputs. however, why does the logical proposition "x=0" in the inputs (in4) and (in5) are considered to be equal to false ?

We can see that when the expression "x=0" is isolated, it doesn't give a specific value (here false) to it, I don't understand these outputs conceptually and mathematically, it is not the mathematical behavior expected..

Here are some strange behavior when I try to debug.

(in1) prederror:true$
(in2) debugmode(true)$
(in3) x=0;
(out) x=0
(in4) y>0;
(out) y>0
(in5) x=0 or y>0;
(out) Unable to evaluate predicate y > 0

What does it mean ?


Solution

  • What happens here?

    x > 0 and y > 0;
    

    Arguments [x > 0] and [y > 0] are evaluated to themself. [[x > 0] and [y > 0]] is also evaluated to itself.

    x = 0 or y > 0;
    

    [x = 0] is evaluated to false and [y > 0] is evaluated to itself, [false or [y > 0]] is evaluated to [y > 0].

    x = 0 and y > 0;
    

    [x = 0] is evaluated to false and [false and [y > 0]] is immediately evaluted to false without evaluting a second argument.

    Relevent sections of documentation are