verify/subset - Maple Programming Help

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

verify/subset

verify that the first set is a subset of the second

 Calling Sequence verify(expr1, expr2, subset) verify(expr1, expr2, 'subset(ver)')

Parameters

 expr1, expr2 - anything, assumed to be of type set ver - verification for the set operands

Description

 • The verify(expr1, expr2, subset) and verify(expr1, expr2, 'subset(ver)') calling sequences return true if for every operand in the first set it can be determined that there is an operand in the second set which satisfies a relationship that is determined either by testing with equality or by using the verification ver.
 • If true is returned, then it has been determined that each operand of the first set satisfies the relationship with at least one element in the second set. If false is returned, then there is at least one operand in the first set which does not satisfy the relationship (a result of type verify(false)) with each operand of the second set. Otherwise, FAIL is returned.
 • The relation of a proper subset can be implemented as the verification And(subset(ver), Not(set(ver))). This verification is not symmetric.
 • If either expr1 or expr2 is not of type set, then false is returned.
 • The name subset is a keyword and therefore it must be enclosed by backquotes in a call to verify.

Examples

 > $\mathrm{verify}\left(\left\{a,b,c\right\},\left\{a,b,c,d,e\right\},\mathrm{subset}\right)$
 ${\mathrm{true}}$ (1)
 > $\left\{a,b,c\right\}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{subset}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\left\{a,b,c,d,e\right\}$
 ${\mathrm{true}}$ (2)
 > $\mathrm{verify}\left(\left\{a,b,c,f\right\},\left\{a,b,c,d,e\right\},\mathrm{subset}\right)$
 ${\mathrm{false}}$ (3)
 > $\mathrm{verify}\left(\left\{a,b,x\left(x-1\right)\right\},\left\{a,b,{x}^{2}-x\right\},\mathrm{subset}\right)$
 ${\mathrm{false}}$ (4)
 > $\left\{a,b,x\left(x-1\right)\right\}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{subset}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\left\{a,b,{x}^{2}-x\right\}$
 ${\mathrm{false}}$ (5)
 > $\mathrm{verify}\left(\left\{a,b,x\left(x-1\right)\right\},\left\{a,b,{x}^{2}-x\right\},'\mathrm{subset}\left(\mathrm{expand}\right)'\right)$
 ${\mathrm{true}}$ (6)
 > $\mathrm{verify}\left(\left\{a,b,x\left(x-1\right)\right\},\left\{a,b,c,{x}^{2}-x\right\},'\mathrm{subset}\left(\mathrm{expand}\right)'\right)$
 ${\mathrm{true}}$ (7)
 > $\mathrm{verify}\left(\left\{0.10222,0.2333\right\},\left\{0.102221,0.2334\right\},\mathrm{subset}\right)$
 ${\mathrm{false}}$ (8)
 > $\mathrm{verify}\left(\left\{0.10222,0.2333\right\},\left\{0.102221,0.2334\right\},'\mathrm{subset}\left(\mathrm{float}\left({10}^{6}\right)\right)'\right)$
 ${\mathrm{true}}$ (9)

Consider the lattice of subsets of the set $\left\{a,b,c,d,e,f,g\right\}$. Given the point $\left\{a,b,d\right\}$, select all points which precede this point:

 > $\mathrm{select}\left(\mathrm{verify},\mathrm{combstruct}\left[\mathrm{allstructs}\right]\left(\mathrm{Subset}\left(\left\{a,b,c,d,e\right\}\right)\right),\left\{a,b,d\right\},\mathrm{subset}\wedge ¬\mathrm{set}\right)$
 $\left\{{\varnothing }{,}\left\{{a}\right\}{,}\left\{{b}\right\}{,}\left\{{d}\right\}{,}\left\{{a}{,}{b}\right\}{,}\left\{{a}{,}{d}\right\}{,}\left\{{b}{,}{d}\right\}\right\}$ (10)