let simplifyClauses clauses =
let result= ref [] in
List.iter
(fun c ->
(* If 2 clauses are C and not C then theire disjunction implies true *)
if List.exists (clausesAreEqual (negativeClause c)) !result then result:=[PTrue]::!result
(* If an observed clause c2 is include inside the current clause then the current is not add *)
else if (List.exists (fun c2 -> clausesAreSubSetEq c2 c) !result) then ()
(* If the current clause is include inside an observed clause c2 then the current is add and c2 is removed *)
else if (List.exists (fun c2 -> clausesAreSubSetEq c c2) !result) then result:=c::(removeClause !result c)
(* If no simplification then c is add to the list *)
else result:=c::!result
)
clauses;
!result