]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/tactics/paramodulation/inference.ml
trans chains even inside letins body
[helm.git] / helm / software / components / tactics / paramodulation / inference.ml
index 1c3daffecf3fc1daff35973004d6d645e58fde74..408a7cdb8904771bc82a0e9f18dc2642ec66c0a1 100644 (file)
@@ -243,7 +243,8 @@ let find_equalities context proof =
                          (Printf.sprintf "OK: %s" (CicPp.ppterm term)));
                     let o = !Utils.compare_terms t1 t2 in
                     let stat = (ty,t1,t2,o) in
-                    let w = compute_equality_weight stat in
+                    (* let w = compute_equality_weight stat in *)
+                    let w = 0 in 
                     let proof = Equality.Exact p in
                     let e = Equality.mk_equality (w, proof, stat, newmetas) in
                     Some e, (newmeta+1)
@@ -331,12 +332,38 @@ let utty_of_u u =
   u, t, ty
 ;;
 
-let find_library_equalities dbd context status maxmeta = 
+let find_library_equalities caso_strano dbd context status maxmeta = 
   let module C = Cic in
   let module S = CicSubstitution in
   let module T = CicTypeChecker in
   let _ = <:start<equations_for_goal>> in
-  let eqs = (MetadataQuery.equations_for_goal ~dbd status) in
+  let signature = 
+    if caso_strano then
+      begin
+        let proof, goalno = status in
+        let _,metasenv,_,_ = proof in
+        let metano,context,ty = CicUtil.lookup_meta goalno metasenv in
+        match ty with
+        | Cic.Appl[Cic.MutInd(u,0,_);eq_ty;l;r] ->
+            (let mainl, sigl = MetadataConstraints.signature_of l in
+            let mainr, sigr = MetadataConstraints.signature_of r in
+            match mainl,mainr with
+            | Some (uril,tyl), Some (urir, tyr) 
+                when LibraryObjects.is_eq_URI uril && 
+                     LibraryObjects.is_eq_URI urir && 
+                     tyl = tyr ->
+                  Some (mainl,MetadataConstraints.UriManagerSet.union sigl sigr)
+            | _ -> 
+                let u = (UriManager.uri_of_string
+                  (UriManager.string_of_uri u ^ "#xpointer(1/1)")) in
+                let main = Some (u, []) in
+                Some (main,MetadataConstraints.UriManagerSet.union sigl sigr))
+        | _ -> assert false
+      end
+    else
+      None
+  in
+  let eqs = (MetadataQuery.equations_for_goal ~dbd ?signature status) in
   let _ = <:stop<equations_for_goal>> in
   let candidates =
     List.fold_left