4 instantiate datatype Wff;
9 cout << "input = " << wff << '\n';
11 rewrite (wff) type (Wff) of
23 | Not(And(X,Y)): Or(Not(X),Not(Y))
24 | Not(Or(X,Y)): And(Not(X),Not(Y))
25 | And(And(X,Y),Z): And(X,And(Y,Z))
26 | Or(Or(X,Y),Z): Or(X,Or(Y,Z))
29 | And(X as Var a,Var b) | a == b: X
30 | Or(X as Var a,Var b) | a == b: X
31 | And(X as Var a,Y as Var b) | a > b: And(Y,X)
32 | Or(X as Var a,Y as Var b) | a > b: Or(Y,X)
33 | And(X as Var a,And(Y as Var b,Z)) | a > b: And(Y,And(X,Z))
34 | Or(X as Var a,Or(Y as Var b,Z)) | a > b: Or(Y,Or(X,Z))
35 | And(X as Var a,And(Y as Var b,Z)) | a == b: Or(X,Z)
36 | Or(X as Var a,Or(Y as Var b,Z)) | a == b: Or(X,Z)
37 | Xor(a,b): Or(And(a,Not b),And(a,Not b))
38 | Equiv(a,b): Or(And(a,b),And(Not a,Not b))
39 | Implies(a,b): Or(Not a, b)
42 cout << "output = " << wff << '\n';
47 Wff e = And(True,Or(True,Not(Var(#"x"))));