verify/wildcard - Maple Programming Help

Home : Support : Online Help : Programming : Logic : Boolean : verify : verify/wildcard

verify/wildcard

verify a relation between two expressions, independent of variable names

 Calling Sequence verify(expr1, expr2, wildcard) verify(expr1, expr2, wildcard(typ)) verify(expr1, expr2, wildcard(typ, ver))

Parameters

 expr1, expr2 - expressions typ - (optional) type ver - (optional) verification

Description

 • The verify(expr1, expr2, wildcard) and verify(expr1, expr2, wildcard(typ, ver)) calling sequences return true if it can be determined that the expressions expr1 and expr2 are equivalent except for their subexpressions of type typ, either by testing for equality or by using verify with verification ver.
 • Concretely, this command determines all subexpressions of expr1 and expr2 of type typ and verifies that expr1 has equally many different subexpressions of type typ as expr2 does. If this is not the case, then the command returns false. Otherwise, it goes through all possible matchings m that pair one subexpression of type typ of expr1 with one of expr2; for each m, Maple tests if substituting the paired subexpression into expr1 yields an expression that is equal to expr2. If ver is specified, then instead of testing for equality, Maple tests if the result of the substitution is in the relation tested by that verification to expr2.
 • The default value for the type typ is name.
 • The verifications wildcard and wildcard(typ) are symmetric. A verification wildcard(typ, ver) is symmetric if and only if the verification ver is symmetric.
 • If expr1 and expr2 have many subexpressions of type typ, this command can take a long time.

Examples

This returns true, because both expressions contain a single name and substituting $y$ for $x$ in the first expression yields the second.

 > $\mathrm{verify}\left({x}^{2}-x,{y}^{2}-y,'\mathrm{wildcard}'\right)$
 ${\mathrm{true}}$ (1)

In the following two examples, only the name $a$ indexed by something is allowed to be considered a wildcard.

 > $\mathrm{verify}\left({x}^{2}-a\left[0\right],{x}^{2}-a\left[1\right],'\mathrm{wildcard}'\left('\mathrm{specindex}'\left('a'\right)\right)\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{verify}\left({x}^{2}-a\left[0\right],{y}^{2}-a\left[1\right],'\mathrm{wildcard}'\left('\mathrm{specindex}'\left('a'\right)\right)\right)$
 ${\mathrm{false}}$ (3)

In the following examples, the order of the entries of the lists does not matter. You can specify this by using the verification as_set.

 > $\mathrm{verify}\left(\left[{x}^{2}-a,x+xy\right],\left[s+sz,{s}^{2}-y\right],'\mathrm{wildcard}'\left('\mathrm{name}','\mathrm{as_set}'\right)\right)$
 ${\mathrm{true}}$ (4)
 > $\mathrm{verify}\left(\left[{x}^{2}-a,x+xy+1\right],\left[s+sz,{s}^{2}-y\right],'\mathrm{wildcard}'\left('\mathrm{name}','\mathrm{as_set}'\right)\right)$
 ${\mathrm{false}}$ (5)

Compatibility

 • The verify/wildcard command was introduced in Maple 2017.
 • For more information on Maple 2017 changes, see Updates in Maple 2017.