]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/cic_omdoc/doubleTypeInference.ml
New handling of substitution:
[helm.git] / helm / ocaml / cic_omdoc / doubleTypeInference.ml
index 441d7c9a938425a573c15f7236308f189e2be165..ea29f46fa456e2a4cde51ba1806bdb4d6a873c81 100644 (file)
@@ -361,9 +361,7 @@ let rec type_of_aux' subterms_to_types metasenv context t expectedty =
         CicSubstitution.subst_vars exp_named_subst (type_of_variable uri)
      | C.Meta (n,l) -> 
         (* Let's visit all the subterms that will not be visited later *)
-        let (_,canonical_context,_) =
-         List.find (function (m,_,_) -> n = m) metasenv
-        in
+        let (_,canonical_context,_) = CicUtil.lookup_meta n metasenv in
          let lifted_canonical_context =
           let rec aux i =
            function
@@ -398,9 +396,7 @@ let rec type_of_aux' subterms_to_types metasenv context t expectedty =
                | _,_ -> assert false (* the term is not well typed!!! *)
             ) l lifted_canonical_context
           in
-           let (_,canonical_context,ty) =
-            List.find (function (m,_,_) -> n = m) metasenv
-           in
+           let (_,canonical_context,ty) = CicUtil.lookup_meta n metasenv in
             (* Checks suppressed *)
             CicSubstitution.lift_meta l ty
      | C.Sort (C.Type t) -> (* TASSI: CONSTRAINT *)