convert/boolean_operator - convert boolean statements involving {And, Or, Xor, Implies, Not} into equivalent boolean operators using {and, or, xor, implies, not}
|
Calling Sequence
|
|
convert(expr, boolean_operator)
convert(expr, boolean_operator, Or, And, ...)
|
|
Description
|
|
•
|
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.
|
•
|
Each of the operator or function representations for boolean statements has its own features, which represent advantages or desadvantages 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.
|
|
|
Examples
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
>
|
|
| (4) |
To reverse these conversions use convert, boolean_function
>
|
|
| (5) |
To restrict the application of the conversion only to one (or some) type of boolean functions use for instance
>
|
|
| (6) |
>
|
|
| (7) |
Note that, convert, boolean_operator also converts {Xor, Implies}
>
|
|
| (8) |
>
|
|
| (9) |
On the other hand, convert, boolean_function only returns results involving {And, Or, Not}
>
|
|
| (10) |
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}.
>
|
|
| (11) |
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
>
|
|
| (12) |
>
|
|
| (13) |
>
|
|
| (14) |
>
|
|
| (15) |
For information on manipulating and simplifying boolean expressions see the Logic package.
|
|