let p_cond c p1 p2 = match c, val_of p1, val_of p2 with
| _, Ptrue, Ptrue -> cut (cut Ptrue p2) p1
| _, Pfalse, Pfalse -> cut (cut Pfalse p2) p1
| Ttrue , _ , _ -> p1
| Tfalse , _ , _ -> p2
| Tprim(B_not,[t]) , _ , _ -> Pcond(t,p2,p1)
| _ -> Pcond(c,p1,p2)