let dnfToCond d = 
  let isTrue =ref false in
  
  let clauseToCond c = 
    if c=[PTruethen isTrue:=true;
    if List.length c =1 then 
      (List.hd c)
    else
      List.fold_left (fun c1 c2 -> PAnd(c1,c2)) (List.hd c) (List.tl c)
  in
  let res = 
    if List.length d=1 then 
      clauseToCond (List.hd d)
    else
      List.fold_left (fun d1 d2 -> POr(d1,(clauseToCond d2))) (clauseToCond (List.hd d)) (List.tl d)
  in
  if !isTrue then PTrue else res