]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/cic_unification/cicMkImplicit.ml
first moogle template checkin
[helm.git] / helm / ocaml / cic_unification / cicMkImplicit.ml
index f433fb19b92ead3a19e0913b82f6dd108b73d9f2..41f0589453e7521bcdd091c67e5968e28f482c76 100644 (file)
@@ -1,3 +1,27 @@
+(* Copyright (C) 2004, HELM Team.
+ * 
+ * This file is part of HELM, an Hypertextual, Electronic
+ * Library of Mathematics, developed at the Computer Science
+ * Department, University of Bologna, Italy.
+ * 
+ * HELM is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * 
+ * HELM is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HELM; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ * MA  02111-1307, USA.
+ * 
+ * For details, see the HELM World-Wide-Web page,
+ * http://cs.unibo.it/helm/.
+ *)
 
 (* identity_relocation_list_for_metavariable i canonical_context         *)
 (* returns the identity relocation list, which is the list [1 ; ... ; n] *)
@@ -27,32 +51,40 @@ let new_meta metasenv =
 
 let mk_implicit metasenv context =
   let newmeta = new_meta metasenv in
+  let newuniv = CicUniv.fresh () in
   let irl = identity_relocation_list_for_metavariable context in
-  ([ newmeta, [], Cic.Sort Cic.Type ;
+  ([ newmeta, [], Cic.Sort (Cic.Type newuniv) ;
+    (* TASSI: ?? *)
     newmeta + 1, context, Cic.Meta (newmeta, []);
     newmeta + 2, context, Cic.Meta (newmeta + 1,irl) ] @ metasenv,
    newmeta + 2)
 
 let mk_implicit_type metasenv context =
   let newmeta = new_meta metasenv in
-  ([ newmeta, [], Cic.Sort Cic.Type ;
+  let newuniv = CicUniv.fresh () in
+  ([ newmeta, [], Cic.Sort (Cic.Type newuniv);
+    (* TASSI: ?? *)
     newmeta + 1, context, Cic.Meta (newmeta, []) ] @metasenv,
    newmeta + 1)
 
 let mk_implicit_sort metasenv =
   let newmeta = new_meta metasenv in
-  ([ newmeta, [], Cic.Sort Cic.Type] @ metasenv, newmeta)
+  let newuniv = CicUniv.fresh () in
+  ([ newmeta, [], Cic.Sort (Cic.Type newuniv)] @ metasenv, newmeta)
+  (* TASSI: ?? *)
 
 let n_fresh_metas metasenv context n = 
   if n = 0 then metasenv, []
   else 
     let irl = identity_relocation_list_for_metavariable context in
     let newmeta = new_meta metasenv in
+    let newuniv = CicUniv.fresh () in
     let rec aux newmeta n = 
       if n = 0 then metasenv, [] 
       else
         let metasenv', l = aux (newmeta + 3) (n-1) in 
-        (newmeta, context, Cic.Sort Cic.Type)::
+       (* TASSI: ?? *)
+        (newmeta, context, Cic.Sort (Cic.Type newuniv))::
         (newmeta + 1, context, Cic.Meta (newmeta, irl))::
         (newmeta + 2, context, Cic.Meta (newmeta + 1,irl))::metasenv',
         Cic.Meta(newmeta+2,irl)::l in
@@ -61,11 +93,13 @@ let n_fresh_metas metasenv context n =
 let fresh_subst metasenv context uris = 
   let irl = identity_relocation_list_for_metavariable context in
   let newmeta = new_meta metasenv in
+  let newuniv = CicUniv.fresh () in
   let rec aux newmeta = function
       [] -> metasenv, [] 
     | uri::tl ->
        let metasenv', l = aux (newmeta + 3) tl in 
-         (newmeta, context, Cic.Sort Cic.Type)::
+         (* TASSI: ?? *)
+        (newmeta, context, Cic.Sort (Cic.Type newuniv))::
          (newmeta + 1, context, Cic.Meta (newmeta, irl))::
          (newmeta + 2, context, Cic.Meta (newmeta + 1,irl))::metasenv',
           (uri,Cic.Meta(newmeta+2,irl))::l in