Maple für Professional
Maple für Akademiker
Maple für Studenten
Maple Personal Edition
Maple Player
Maple Player für iPad
MapleSim für Professional
MapleSim für Akademiker
Maple T.A. - Testen & beurteilen
Maple T.A. MAA Placement Test Suite
Möbius - Online-Courseware
Machine Design / Industrial Automation
Luft- und Raumfahrt
Fahrzeugtechnik
Robotics
Energiebranche
System Simulation and Analysis
Model development for HIL
Anlagenmodelle für den Regelungsentwurf
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematikausbildung
Technik
Allgemein- und berufsbildende Schulen
Testen und beurteilen
Studierende
Finanzmodelle
Betriebsforschung
Hochleistungsrechnen
Physik
Live-Webinare
Aufgezeichnete Webinare
Geplante Veranstaltungen
MaplePrimes
Maplesoft-Blog
Maplesoft-Mitgliedschaft
Maple Ambassador Program
MapleCloud
Technische Whitepapers
E-Mail Newsletters
Maple-Bücher
Math Matters
Anwendungs-Center
MapleSim Modell-Galerie
Anwenderberichte
Exploring Engineering Fundamentals
Lehrkonzepte mit Maple
Maplesoft Welcome-Center
Resource-Center für Lehrer
Help-Center für Studierende
Boolean Expressions
Description
Boolean expressions are formed by using the logical operators and, or, xor (exclusive disjunction), implies, and not, and the relational operators <, <=, >, >=, =, and <>.
In 2-D math, the relational operators <=, >=, and <> display as , , and .
For information on the order of precedence of these operators, see operators[precedence].
Maple uses three-valued logic for all of its Boolean operations. The special names true and false are used to represent logical truth and logical false. A third special name FAIL is used to represent an expression whose truth is unknown.
The evalb function evaluates its argument as a Boolean expression. For example, x = x is an algebraic equation in Maple and normally it is not treated as a Boolean expression. However, evalb(x = x) evaluates to true.
Evaluation as a Boolean expression takes place automatically if the expression:
contains a logical operator,
is in the if clause of a conditional statement, or
is in the while clause of a repetition statement.
The following type names are used: `=`, `<>`, `<`, `<=`, relation (means any of the preceding four), `and`, `or`, `xor`, `implies`, `not`, and logical (means any of the preceding five).
The type boolean is defined to be any of the above or the special names true, false, and FAIL.
Note: In 1-D Math notation, the boolean type names must be enclosed in left quotes (` `) as above. In 2-D Math notation, left quotes are not necessary.
Note: Expressions that use the operators > and >= are automatically converted to expressions of type `<` and `<=`, respectively.
The evaluation of expressions involving the logical operators uses the McCarthy evaluation rules. Namely, the left operand of the four operators and, or, xor, implies is always evaluated first, and the evaluation of the right operand is avoided if the truth value of the expression can be deduced from the value of the left operand alone. For example, the construct
does not cause a division by zero error because if , then the left operand of and becomes false and the right operand of and will not be evaluated.
The evaluation of a Boolean expression yields true, false, or FAIL according to the following table.
and
or
not
true
false
FAIL
xor
implies
Thread Safety
The boolean operators are thread safe as of Maple 15.
For more information on thread safety, see index/threadsafe.
Examples
See Also
equation, evalb, Logic, operators[precedence], type, type/boolean, type/logical, type/truefalse
Download Help Document