property::hasprop -- does an
object have properties?
Introductionproperty::hasprop(object) tests, whether
an object has properties.
Call(s)property::hasprop(object)
property::hasprop()
Parametersobject |
- | any MuPAD object |
Returns
Related
Functionsassume, getprop, is, indets, unassume
Detailsproperty::hasprop(object) tests, whether
the object has properties and returns
TRUE if the object or any
subexpression has a property, otherwise FALSE.property::hasprop always returns TRUE if the global
property is defined.getprop,
property::hasprop is a fast function and can be used to
determine, whether an object has properties without using the slower
functions getprop or
is.In some cases, the function is can derive some aspects without any
defined property (see example 3)!
Example
1Does the expression 2*(x+1) have any
properties?
>> property::hasprop(2*(x + 1))
FALSE
>> assume(x > 0): property::hasprop(2*(x + 1))
TRUE
>> getprop(2*(x + 1))
> 2
>> delete x:
Example
2Is the global property defined?
>> property::hasprop()
FALSE
If the global property is defined,
property::hasprop returns always TRUE:
>> assume(Type::Real): property::hasprop(2*(x + 1)), property::hasprop()
TRUE, TRUE
>> property::hasprop(sin(2*x^sqrt(2)) + cos(2*x)^sqrt(2))
TRUE
>> unassume():
Example
3property::hasprop returns FALSE, but is can determine an answer unequal to
UNKNOWN:
>> property::hasprop(a + 1 > a)
FALSE
>> is(a + 1 > a)
TRUE