Logical operators

There are five logical operators in Maple; however, they also include a third state FAIL, which indicates that the truth or falsehood of a statement is not known.

Important: In almost all engineering applications, FAIL will not be used.

You will note that if either side does not evaluate to true or false and the truth or falsehood of the entire statement cannot be deduced from the information present, the expression remains unevaluated.

  1. not p is true if p is false, false if p is true, and FAIL otherwise.
  2. p and q is true if both the left- and right-hand sides are true, false if either of the sides is false, and FAIL otherwise.
  3. p or q is false if both the left- and right-hand sides are false, true if either of the sides is true, and FAIL otherwise.
  4. p xor q is true if exactly one of the left- and right-hand sides equals true and the other false, false if both sides have the same truth value, and if either of the sides is FAIL the result must be FAIL.
  5. p implies q is equivalent to not p or q.

Equivalence may be done with =. While many programming langauges have the first four, Maple is someone unique having the last.

If it is necessary to evaluate logical statement, one can explictly call evalb(...) on the statement.