X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Fparamodulation%2Finference.ml;h=04cdb0aeb8ebf8c8cff587dc81909045b76d3004;hb=d3e3b22ce9cca9e4ca80f75a6bdc4c2df93efb0b;hp=105b708e92d47d21c4b812d58876f405fe9347bd;hpb=db57b08d789de234c152c3f2a665000311b7335d;p=helm.git diff --git a/helm/ocaml/paramodulation/inference.ml b/helm/ocaml/paramodulation/inference.ml index 105b708e9..04cdb0aeb 100644 --- a/helm/ocaml/paramodulation/inference.ml +++ b/helm/ocaml/paramodulation/inference.ml @@ -23,6 +23,8 @@ * http://cs.unibo.it/helm/. *) +(* $Id$ *) + open Utils;; @@ -917,8 +919,34 @@ type environment = Cic.metasenv * Cic.context * CicUniv.universe_graph;; let is_identity ((metasenv, context, ugraph) as env) = function | ((_, _, (ty, left, right, _), menv, _) as equality) -> - (left = right || + (left = right || (* (meta_convertibility left right) || *) (fst (CicReduction.are_convertible ~metasenv:(metasenv @ menv) context left right ugraph))) ;; + + +let term_of_equality equality = + let _, _, (ty, left, right, _), menv, args = equality in + let eq i = function Cic.Meta (j, _) -> i = j | _ -> false in + let argsno = List.length args in + let t = + CicSubstitution.lift argsno + (Cic.Appl [Cic.MutInd (LibraryObjects.eq_URI (), 0, []); ty; left; right]) + in + snd ( + List.fold_right + (fun a (n, t) -> + match a with + | Cic.Meta (i, _) -> + let name = Cic.Name ("X" ^ (string_of_int n)) in + let _, _, ty = CicUtil.lookup_meta i menv in + let t = + ProofEngineReduction.replace + ~equality:eq ~what:[i] + ~with_what:[Cic.Rel (argsno - (n - 1))] ~where:t + in + (n-1, Cic.Prod (name, ty, t)) + | _ -> assert false) + args (argsno, t)) +;;