property::simpex -- simplify
Boolean expressions
Introductionproperty::simpex(ex) simplifies the
Boolean expression ex.
Call(s)property::simpex(ex)
Parametersex |
- | Relation of type "_less",
"_leequal", "_unequal",
"_equal", or "_in"; or Boolean expression
whose atoms are Boolean constants or relations |
Returnsan expression that is equivalent to the given expression
Related
Functions
Detailsex by
TRUE or FALSE if possible.property::simpex tries to collect relations involving
the same identifier into a single Boolean atom.
Example
1A relation that is true:
>> property::simpex(1 > 0)
TRUE
An expression that is false:
>> property::simpex(x > 1 and x < -1)
FALSE
Find out the strongest border:
>> property::simpex(x > 3 and x > PI and x > ln(23))
PI < x
Example
2Simplification of relations with the same variable:
>> property::simpex(x >= 2 and x <= 2)
x = 2
expand
expands nested expressions (property::simpex does not call
expand):
>> property::simpex(expand(0 < x and x < 2 and
(-1 < x and x <= 0 or 3 < x and x <= 4)))
FALSE
Expressions that contains identifiers with properties can often be simplified:
>> assume(x > 0): property::simpex(x <> 0), property::simpex(x > 1)
TRUE, 1 < x
Also relations between identifiers are considered:
>> assume(x < y, _and): property::simpex(x < y and (x > y or x > 0) and y <> 0)
TRUE
Example
3Expressions of type _in can be simplified:
>> delete x: property::simpex(x in R_ and x >= 0)
x in [0, infinity[
>> property::simpex(not x in R_ and not x in Z_)
not x in R_
Backgroundproperty::simpex uses the property mechanism to simplify
expressions.