convert/boolean_operator
convert boolean statements involving {And, Or, Xor, Implies, Not} into equivalent boolean operators using {and, or, xor, implies, not}
Calling Sequence
Parameters
Description
Examples
convert(expr, boolean_operator)
convert(expr, boolean_operator, Or, And, ...)
expr
-
Maple expression possibly containing boolean statements constructed using the operators {And, Or, Xor, Implies, Not}
The convert(expr, boolean_operator) command converts, in a given expression, all boolean statements constructed using the functions {And, Or, Xor, Implies, Not} into equivalent boolean constructions using {and, or, xor, implies, not}. If the given expression contains no such boolean functions, it is returned unchanged. To perform the opposite conversion, that is, from the operators {and, or, xor, implies, not} to the corresponding boolean functions expressed using only {And, Or, Not} see convert,boolean_function.
To restrict the application of the conversion to boolean functions of only certain type, for instance only to And functions, give the name of these functions after the keyword boolean_operator - see the Examples section.
Each of the operator or function representations for boolean statements has its own features, which represent advantages or disadvantages depending on the framework these statements are used. Boolean operators are evaluated inside the Maple kernel and have automatic simplifications carried out; boolean functions are evaluated outside the kernel and no automatic simplifications are performed on them - see details in convert,boolean_function.
And⁡a,b
a∧b
convert⁡,boolean_operator
aandb
Or⁡a,And⁡b,c
a∨b∧c
aorbandc
To reverse these conversions use convert, boolean_function
convert⁡,boolean_function
To restrict the application of the conversion only to one (or some) type of boolean functions use for instance
convert⁡,boolean_operator,And
a∨bandc
convert⁡,boolean_operator,Or
aorb∧c
Note that, convert, boolean_operator also converts {Xor, Implies}
a⊻b⇒c
axorb⇒c
On the other hand, convert, boolean_function only returns results involving {And, Or, Not}
a∧¬¬b∨c∨¬a∧¬b∨c
To express boolean statements constructed with {xor, implies} using only the operators {and, or, not} you can convert to boolean_function then back to boolean_operator; for instance, the example above involving {xor, implies} is equivalent to the following one that involves only {and, or, not}.
aandnotnotborcornotaandnotborc
Note also that Or and And constructions, regardless of the number of operands, can be respectively expressed in terms of each other by using Not and this happens automatically when converting to boolean operators
Or⁡a,b,c=Not⁡And⁡Not⁡a,Not⁡b,Not⁡b
a∨b∨c=¬¬a∧¬b∧¬b
aorborc=aorborb
And⁡a,b,c=Not⁡Or⁡Not⁡a,Not⁡b,Not⁡b
a∧b∧c=¬¬a∨¬b∨¬b
aandbandc=aandbandb
For information on manipulating and simplifying boolean expressions see the Logic package.
See Also
convert
convert/and
convert/boolean_function
Logic
type/And
Download Help Document