MuPAD
Pro Computing Essentials - Examples
Example 11.3 - Checking Subsets
This is a procedure to check is a given set is a subset
of another set.
- subset:=proc(A,B)
local result, a, b;
begin
if testtype(A,Type::Set) and
testtype(B,Type::Set) then
result:=TRUE;
for a in A do
result:= bool(a in B) and result;
end;
return(result)
else
return(procname(args()))
end;
end:
|