let rec p_not p = match val_of p with
| Ptrue -> cut Pfalse p
| Pfalse -> cut Ptrue p
| Pnot p -> p
| Pand(p,q) -> Por(p_not p,p_not q)
| Por(p,q) -> Pand(p_not p,p_not q)
| Pimplies(p,q) -> Pand(p,p_not q)
| Prel( L_eq , [a;b] ) -> Prel( L_neq , [a;b] )
| Prel( L_neq , [a;b] ) -> Prel( L_eq , [a;b] )
| Prel( I_lt , [a;b] ) -> Prel( I_leq , [b;a] )
| Prel( I_leq , [a;b] ) -> Prel( I_lt , [b;a] )
| Prel( R_lt , [a;b] ) -> Prel( R_leq , [b;a] )
| Prel( R_leq , [a;b] ) -> Prel( R_lt , [b;a] )
| Prel( B_true , [a] ) -> Prel( B_false , [a] )
| Prel( B_false , [a] ) -> Prel( B_true , [a] )
| Pforall( x , p ) -> Pexists( x , p_not p )
| Pexists( x , p ) -> Pforall( x , p_not p )
| _ -> Pnot p