Type::Property -- type to
identify properties
IntroductionWith Type::Property, properties can be identified.
Call(s)testtype(obj, Type::Property)
Parametersobj |
- | any MuPAD object |
Returnssee testtype
Related
Functions
Detailstesttype(obj, Type::Property)
checks, whether the MuPAD object obj is a property and returns TRUE, if it holds, otherwise FALSE.Type serve two functions. One is to
perform syntactical tests to identify the type of an object (with
testtype), the other
is to occur as a property within assume and is.
Type::Property itself is not a
property.
Type is a property,
Type::Property can be used with testtype.
Example
1Is Type::PosInt a property?
>> testtype(Type::PosInt, Type::Property)
TRUE
Also an interval created with Type::Interval is a property:
>> testtype(Type::Interval(0, 1), Type::Property)
TRUE
Is Type::Constant a property?
>> testtype(Type::Constant, Type::Property)
FALSE
Type::Constant is not a property and
cannot be used as argument of assume:
>> assume(x, Type::Constant)
Error: second argument must be a property [property::assume]
The next example shows the usage of testtype to select properties among operands of Type:
>> T := Type::Numeric, Type::PosInt, Type::Unknown, Type::Zero: select(T, testtype, Type::Property)
Type::PosInt, Type::Zero
>> delete x, T: