else Some (bag, clause)
;;
+ let rec keep_simplified (alist,atable) bag newc =
+ match newc with
+ | [] -> bag, (alist,atable)
+ | hd::tl ->
+ (match simplify atable bag hd with
+ | None -> keep_simplified (alist,atable) bag tl
+ | Some (bag, clause) ->
+ let ctable = IDX.index_unit_clause IDX.DT.empty clause in
+ let bag, newa, alist, atable =
+ List.fold_left
+ (fun (bag, newa, alist, atable) c ->
+ let bag, c1 = demodulate bag c ctable in
+ if (c1 == c) then
+ bag, newa, c :: alist, IDX.index_unit_clause atable c
+ else
+ bag, c :: newa, alist, atable)
+ (bag,[],[],IDX.DT.empty) alist
+ in
+ keep_simplified (alist, atable) bag newa)
+ ;;
+
(* this is like simplify but raises Success *)
let simplify_goal maxvar table bag clause =
let bag, clause = demodulate bag clause table in