let p_iff p1 p2 = match val_of p1,val_of p2 with | Ptrue ,_ -> p2 | _ ,Ptrue -> p1 | Pfalse, _ -> p2 | _ , Pfalse -> p_not p1 | _ -> Piff (p1,p2)