Query properties of expressions
This functionality does not run in MATLAB.
getprop(f) returns a set containing all possible values of the expression f.
The property mechanism helps to simplify expressions involving identifiers that carry "mathematical assumptions". The function assume allows to set basic assumptions such as 'x is a real number' or 'x is an odd integer', say. Arithmetical expressions involving x may inherit such properties. E.g., '1 + x^2 is positive' if 'x is a real number'.
getprop(f) examines the assumptions of all identifiers in the expression f and derives a superset of all values of f.
Only basic mathematical properties can be represented with the available properties. Therefore, getprop performs certain simplifications during the derivation of a property for an expression. Thus it may happen that getprop derives a too large set.
getprop only shows a mathematical (super-)set of all possible values in respect to the assumptions. The command property::showprops displays a list of all valid assumptions for a special identifier.
If x is a real number, then x^2 + 1 must be positive:
assume(x, Type::Real): getprop(x^2 + 1)
If x represents a number in the interval [1, infinity[, the expression 1 - x has the following property:
assume(x, Type::Interval(, infinity)): getprop(1 - x)
An expression returns the superset C_ or a set if it is constant, or if no properties are attached to the identifiers involved:
getprop(x), getprop(x + 2*y), getprop(sin(3))
delete x: getprop(abs(x)), getprop(Re(x)), getprop(Im(x))