]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/ng_paramodulation/superposition.ml
update in basic_2
[helm.git] / helm / software / components / ng_paramodulation / superposition.ml
index f38acb536a707eeb5d0871b781af25cd2af412eb..42cf063b64f08b3e352693d7a30bebff78025e95 100644 (file)
@@ -272,7 +272,12 @@ module Superposition (B : Orderings.Blob) =
     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]
@@ -412,6 +417,7 @@ module Superposition (B : Orderings.Blob) =
       match acc with 
       | None -> None
       | Some(bag,maxvar,(id,lit,vl,p),subst) -> 
+          (* prerr_endline ("input subst = "^Pp.pp_substitution subst); *)
           let l = Subst.apply_subst subst l in 
           let r = Subst.apply_subst subst r in 
             try 
@@ -426,6 +432,8 @@ module Superposition (B : Orderings.Blob) =
             with FoUnif.UnificationFailure _ -> 
               match rewrite_eq ~unify l r ty vl table with
               | Some (id2, dir, subst1) ->
+                 (* prerr_endline ("subst1 = "^Pp.pp_substitution subst1);
+                    prerr_endline ("old subst = "^Pp.pp_substitution subst);*)
                   let newsubst = Subst.concat subst1 subst in
                   let id_t = 
                     FoSubst.apply_subst newsubst
@@ -437,7 +445,9 @@ module Superposition (B : Orderings.Blob) =
                         subst1 id id2 (pos@[2]) dir 
                     with
                     | Some ((bag, maxvar), c), r ->
-                       let newsubst = Subst.concat r newsubst in
+                       (* prerr_endline ("r = "^Pp.pp_substitution r); *)
+                       let newsubst = Subst.flat 
+                         (Subst.concat r subst) in
                         Some(bag,maxvar,c,newsubst)
                     | None, _ -> assert false)
               | None ->