property::hasprop
-- does an
object have properties?property::hasprop(
object)
tests, whether
an object has properties.
property::hasprop(object)
property::hasprop()
object |
- | any MuPAD object |
assume
, getprop
, is
, indets
, unassume
property::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)!
Does 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:
Is 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():
property::hasprop
returns FALSE
, but is
can determine an answer unequal to
UNKNOWN
:
>> property::hasprop(a + 1 > a)
FALSE
>> is(a + 1 > a)
TRUE