use set; k:set(num); k <= 1 & empty; m:set(num); m <= 2 & empty; k U m; z:set(num); z <= k U m; choose(z); let (a,b) == choose(z) in a; let (a,b) == choose(z) in b; card (z);
3 & empty;
"dog" & "cat" & empty;
('a' & empty) U ('b' & empty);
'a' isin ('a' & empty);
"cat" isin ("dog" & empty);
"cat" isin ("cat" & "dog" & empty);
gg
, below do?
gg: set(alpha) -> num; gg(S) <= if S = empty then 0 else let (a,T) == choose(S) in 1 + gg(T);
ff
, below do?
ff: set(alpha) X set(alpha) -> set(alpha); ff(S1,S2) <= if S1 = empty then empty else let (a,S3) == choose(S1) in if a isin S2 then a & ff(S3,S2) else ff(S3,S2);
ff
above, the function
setDifference: set(alpha) X set(alpha) -> set(alpha);in Hope.
diff: set(alpha) X set(alpha) -> set(alpha); diff(S1,S2) <= if S1 = empty then empty else let (a,S3) == choose(S1) in if a isin S2 then diff(S3,S2) else a & diff(S3,S2);