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)
    | PrelL_eq  , [a;b] ) -> PrelL_neq , [a;b] )
    | PrelL_neq , [a;b] ) -> PrelL_eq ,  [a;b] )
    | PrelI_lt  , [a;b] ) -> PrelI_leq ,  [b;a] )
    | PrelI_leq  , [a;b] ) -> PrelI_lt ,  [b;a] )
    | PrelR_lt  , [a;b] ) -> PrelR_leq ,  [b;a] )
    | PrelR_leq  , [a;b] ) -> PrelR_lt ,  [b;a] )
    | PrelB_true , [a] ) -> PrelB_false , [a] )
    | PrelB_false , [a] ) -> PrelB_true , [a] )
    | Pforall( x , p ) -> Pexists( x , p_not p )
    | Pexists( x , p ) -> Pforall( x , p_not p )
    | _ -> Pnot p