in aux ft (List.rev pl)
;;
- (* we should better split forward and backward rewriting *)
let mk_proof ?(demod=false) (bag : NCic.term Terms.bag) mp subst steps =
let module NCicBlob =
NCicBlob.NCicBlob(
let get_literal id =
let (_, lit, vl, proof),_,_ = Terms.get_from_bag id bag in
let lit =match lit with
- | Terms.Predicate t -> assert false
+ | Terms.Predicate t -> t (* assert false *)
| Terms.Equation (l,r,ty,_) ->
Terms.Node [ Terms.Leaf eqP(); ty; l; r]
in
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
+ let bag, ((i,_,_,_) as g1) = Sup.demodulate bag g (snd actives) in
+ if g1 = g then GaveUp else compute_result bag i []
+(*
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
+
+ else GaveUp *)
let fast_eq_check s goal =
let (_,_,_,_,_,g_passives) as s = initialize_goal s goal in
let rec demodulate bag (id, literal, vl, pr) table =
debug (lazy ("demodulate " ^ (string_of_int id)));
match literal with
- | Terms.Predicate t -> assert false
+ | Terms.Predicate t -> (* assert false *)
+ let bag,_,id1 =
+ visit bag [] (fun x -> x) id t (ctx_demod table vl)
+ in
+ let cl,_,_ = Terms.get_from_bag id1 bag in
+ bag,cl
| Terms.Equation (l,r,ty,_) ->
let bag,l,id1 =
visit bag [2]