Maple Professionel
Maple Académique
Maple Edition Étudiant
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professionel
MapleSim Académique
Maple T.A. - Suite d'examens de classement
Maple T.A. MAA Placement Test Suite
Möbius - Didacticiels de mathématiques en ligne
Machine Design / Industrial Automation
Aéronautique
Ingénierie des véhicules
Robotics
Energie
System Simulation and Analysis
Model development for HIL
Modélisation du procédé pour la conception de systèmes de contrôle
Robotics/Motion Control/Mechatronics
Other Application Areas
Enseignement des mathématiques
Enseignement de l’ingénierie
Enseignement secondaire et supérieur (CPGE, BTS)
Tests et évaluations
Etudiants
Modélisation financière
Recherche opérationnelle
Calcul haute performance
Physique
Webinaires en direct
Webinaires enregistrés
Agenda des évènements
Forum MaplePrimes
Blog Maplesoft
Membres Maplesoft
Maple Ambassador Program
MapleCloud
Livres blancs techniques
Bulletin électronique
Livres Maple
Math Matters
Portail des applications
Galerie de modèles MapleSim
Cas d'Etudes Utilisateur
Exploring Engineering Fundamentals
Concepts d’enseignement avec Maple
Centre d’accueil utilisateur Maplesoft
Centre de ressources pour enseignants
Centre d’assistance aux étudiants
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