module NCicParamod(C : NCicBlob.NCicContext) = Paramod.Paramod(B(C))
-let readback rdb metasenv subst context (bag,i,fo_subst,l) =
+let readback ?(demod=false) rdb metasenv subst context (bag,i,fo_subst,l) =
(*
List.iter (fun x ->
print_endline (Pp.pp_unit_clause ~margin:max_int
(fst(Terms.M.find x bag)))) l;
*)
(* let stamp = Unix.gettimeofday () in *)
- let proofterm,prooftype = NCicProof.mk_proof bag i fo_subst l in
+ let proofterm,prooftype = NCicProof.mk_proof ~demod bag i fo_subst l in
(* debug (lazy (Printf.sprintf "Got proof term in %fs"
(Unix.gettimeofday() -. stamp))); *)
(*
| _ -> s
;;
+let demod rdb metasenv subst context s goal =
+ (* let stamp = Unix.gettimeofday () in *)
+ match P.demod s goal with
+ | P.Error _ | P.GaveUp | P.Timeout _ -> []
+ | P.Unsatisfiable solutions ->
+ (* print (lazy (Printf.sprintf "Got solutions in %fs"
+ (Unix.gettimeofday() -. stamp))); *)
+ List.map (readback ~demod:true rdb metasenv subst context) solutions
+;;
+
let paramod rdb metasenv subst context s goal =
(* let stamp = Unix.gettimeofday () in *)
match P.nparamod ~useage:true ~max_steps:max_int
state ->
(NCic.term * NCic.term) ->
(NCic.term * NCic.term * NCic.metasenv * NCic.substitution) list
+val demod :
+ #NRstatus.status ->
+ NCic.metasenv -> NCic.substitution -> NCic.context ->
+ state ->
+ (NCic.term * NCic.term) ->
+ (NCic.term * NCic.term * NCic.metasenv * NCic.substitution) list
in aux ft (List.rev pl)
;;
- let mk_proof (bag : NCic.term Terms.bag) mp subst steps =
+ (* we should better split forward and backard rewriting *)
+ let mk_proof ?(demod=false) (bag : NCic.term Terms.bag) mp subst steps =
let module NCicBlob =
NCicBlob.NCicBlob(
struct
if not ongoal && id = mp then
let lit = Subst.apply_subst subst lit in
let eq_ty = extract amount [] lit in
- let refl = mk_refl eq_ty in
+ let refl =
+ if demod then NCic.Implicit `Term
+ else mk_refl eq_ty in
(* prerr_endline ("Reached m point, id=" ^ (string_of_int id));
(NCic.LetIn ("clause_" ^ string_of_int id, eq_ty, refl,
aux true ((id,([],lit))::seen) (id::tl))) *)
val get_sig: eq_sig_type -> NCic.term
val mk_proof:
- NCic.term Terms.bag
+ ?demod:bool
+ -> NCic.term Terms.bag
-> Terms.M.key
-> NCic.term Terms.substitution
-> Terms.M.key list
let print s = prerr_endline (Lazy.force s) ;;
let noprint s = ();;
-let debug = noprint;;
+let debug = print;;
let monster = 100;;
bag ->
g_passives:t Terms.unit_clause list ->
passives:t Terms.unit_clause list -> szsontology
+ val demod :
+ state -> input* input -> szsontology
val fast_eq_check :
state -> input* input -> szsontology
val nparamod :
| Stop o -> o
;;
+let demod s goal =
+ let bag,maxvar,actives,passives,g_actives,g_passives = s in
+ let (bag,maxvar), g = mk_goal (bag,maxvar) goal in
+ if Terms.is_eq_clause g then
+ let bag, ((i,_,_,_) as g1) = Sup.demodulate bag g (snd actives) in
+ if g1 = g then GaveUp else compute_result bag i []
+ else GaveUp
+
let fast_eq_check s goal =
let (_,_,_,_,_,g_passives) as s = initialize_goal s goal in
if is_passive_g_set_empty g_passives then Error "not an equation"
bag ->
g_passives:t Terms.unit_clause list ->
passives:t Terms.unit_clause list -> szsontology
+ val demod :
+ state -> input* input -> szsontology
val fast_eq_check :
state -> input* input -> szsontology
val nparamod :