(* prerr_endline s *)
;;
-let nparamod metasenv subst context t table =
+let nparamod rdb metasenv subst context t table =
let nb_iter = ref 100 in
prerr_endline "========================================";
let module C = struct
in
let actives = [], IDX.DT.empty in
try given_clause bag maxvar actives passives g_actives g_passives
- with Sup.Success (bag, _, mp) ->
- prerr_endline "YES!";
- prerr_endline "Meeting point :"; prerr_endline (Pp.pp_unit_clause mp)
- (* prerr_endline "Bag :"; prerr_endline (Pp.pp_bag bag) *)
- | Failure _ -> prerr_endline "FAILURE"
+ with
+ | Sup.Success (bag, _, (i,_,_,_)) ->
+ let l =
+ let module S =
+ HTopoSort.Make(struct type t=int let compare=Pervasives.compare end)
+ in
+ let module C : Set.S with type elt = int =
+ Set.Make(struct type t=int let compare=Pervasives.compare end)
+ in
+ let all id =
+ let rec traverse acc i =
+ match Terms.M.find i bag with
+ | (_,_,_,Terms.Exact _) -> acc
+ | (_,_,_,Terms.Step (_,i1,i2,_,_,_)) ->
+ traverse (traverse (C.add i1 (C.add i2 acc)) i1) i2
+ in
+ C.elements (traverse C.empty id)
+ in
+ S.topological_sort (all i) all
+ in
+ prerr_endline "YES!";
+ prerr_endline "Proof:";
+ List.iter (fun x ->
+ prerr_endline (Pp.pp_unit_clause (Terms.M.find x bag))) l;
+ let proofterm = B.mk_proof bag l in
+ prerr_endline
+ (NCicPp.ppterm ~metasenv:C.metasenv ~subst:C.subst ~context:C.context
+ proofterm);
+ let _metasenv, _subst, _proofterm, _prooftype =
+ NCicRefiner.typeof rdb C.metasenv C.subst C.context proofterm None
+ in
+ ()
+ | Failure _ -> prerr_endline "FAILURE";
;;