]> matita.cs.unibo.it Git - helm.git/commitdiff
added annotations to Cic.Implicit
authorStefano Zacchiroli <zack@upsilon.cc>
Fri, 6 Feb 2004 17:16:20 +0000 (17:16 +0000)
committerStefano Zacchiroli <zack@upsilon.cc>
Fri, 6 Feb 2004 17:16:20 +0000 (17:16 +0000)
28 files changed:
helm/gTopLevel/logicalOperations.ml
helm/gTopLevel/proofEngine.ml
helm/ocaml/cic/cic.ml
helm/ocaml/cic/cicParser3.ml
helm/ocaml/cic/deannotate.ml
helm/ocaml/cic_annotations/cicXPath.ml
helm/ocaml/cic_disambiguation/disambiguate.ml
helm/ocaml/cic_disambiguation/logic_notation.ml
helm/ocaml/cic_omdoc/cic2acic.ml
helm/ocaml/cic_omdoc/cic2content.ml
helm/ocaml/cic_omdoc/doubleTypeInference.ml
helm/ocaml/cic_omdoc/eta_fixing.ml
helm/ocaml/cic_proof_checking/cicEnvironment.ml
helm/ocaml/cic_proof_checking/cicMiniReduction.ml
helm/ocaml/cic_proof_checking/cicPp.ml
helm/ocaml/cic_proof_checking/cicReductionMachine.ml
helm/ocaml/cic_proof_checking/cicReductionNaif.ml
helm/ocaml/cic_proof_checking/cicSubstitution.ml
helm/ocaml/cic_proof_checking/cicTypeChecker.ml
helm/ocaml/cic_unification/cicMetaSubst.ml
helm/ocaml/cic_unification/cicMkImplicit.ml
helm/ocaml/cic_unification/cicRefine.ml
helm/ocaml/cic_unification/cicUnification.ml
helm/ocaml/cic_unification/freshNamesGenerator.ml
helm/ocaml/mathql_generator/cGMatchConclusion.ml
helm/ocaml/mathql_generator/cGSearchPattern.ml
helm/ocaml/tactics/primitiveTactics.ml
helm/ocaml/tactics/proofEngineReduction.ml

index 5d06c95d21b55a94c72178eba18d9198771d68db..93c511f138336469b9bb5b3e9cc046effc9dd69f 100644 (file)
@@ -42,7 +42,7 @@ let get_context ids_to_terms ids_to_father_ids =
          | C.Var _
          | C.Meta _
          | C.Sort _
-         | C.Implicit
+         | C.Implicit _
          | C.Cast _ -> []
          | C.Prod (n,s,t) when t == term -> [Some (n,C.Decl s)]
          | C.Prod _ -> []
index f320f08379d78a5c33f94ca1ac807bd4f7e5e650..a9199c0e880f07b061a65d9b8655c334ec21eb6f 100644 (file)
@@ -83,7 +83,7 @@ let metas_in_term term =
       C.Rel _ -> []
     | C.Meta (n,_) -> [n]
     | C.Sort _
-    | C.Implicit -> []
+    | C.Implicit -> []
     | C.Cast (te,ty) -> (aux te) @ (aux ty)
     | C.Prod (_,s,t) -> (aux s) @ (aux t)
     | C.Lambda (_,s,t) -> (aux s) @ (aux t)
index 46126ff319236800f1a800ad255e2338a9bc24ef..55a338b3f3b54b7644894e6eceb194c40a258de0 100644 (file)
@@ -39,6 +39,8 @@
 type id = string  (* the abstract type of the (annotated) node identifiers *)
 type 'term explicit_named_substitution = (UriManager.uri * 'term) list
 
+type implicit_annotation = [ `Closed | `Type ]
+
 type anntarget =
    Object of annobj         (* if annobj is a Constant, this is its type *)
  | ConstantBody of annobj
@@ -62,7 +64,7 @@ and term =
  | Meta of int * (term option) list                 (* numeric id,    *)
                                                     (*  local context *)
  | Sort of sort                                     (* sort *)
- | Implicit                                         (* *)
+ | Implicit of implicit_annotation option           (* *)
  | Cast of term * term                              (* value, type *)
  | Prod of name * term * term                       (* binder, source, target *)
  | Lambda of name * term * term                     (* binder, source, target *)
@@ -123,7 +125,7 @@ and annterm =
  | AMeta of id * int * (annterm option) list        (* numeric id,    *)
                                                     (*  local context *)
  | ASort of id * sort                               (* sort *)
- | AImplicit of id                                  (* *)
+ | AImplicit of id * implicit_annotation option     (* *)
  | ACast of id * annterm * annterm                  (* value, type *)
  | AProd of id * name * annterm * annterm           (* binder, source, target *)
  | ALambda of id * name * annterm * annterm         (* binder, source, target *)
index 02d22b3216b0bf631f2be796689f627a775534be..121f36453a9930044f0d333937171baa338319e7 100644 (file)
@@ -205,7 +205,7 @@ class eltype_implicit =
      assert (exp_named_subst = []) ;
      let n = self#node in
       let id = string_of_xml_attr (n#attribute "id") in
-       Cic.AImplicit id
+       Cic.AImplicit (id, None)
   end
 ;;
 
index 2bee18d6f161e3c82c88c0e1d64fcd7f64df5204..289fe7db496afd9cee70b224616e6a6d2ff59e4e 100644 (file)
@@ -43,7 +43,7 @@ let rec deannotate_term =
       in
        C.Meta (n, l')
    | C.ASort (_,s) -> C.Sort s
-   | C.AImplicit _ -> C.Implicit
+   | C.AImplicit (_, annotation) -> C.Implicit annotation
    | C.ACast (_,va,ty) -> C.Cast (deannotate_term va, deannotate_term ty)
    | C.AProd (_,name,so,ta) ->
       C.Prod (name, deannotate_term so, deannotate_term ta)
index b20fbd5c03a946f11f7c6e94e7ef5c10c7d5f6f3..75a598d91990728b4361452e750bc7669778cd6c 100644 (file)
@@ -59,7 +59,7 @@ let get_ids_to_targets annobj =
         C.ARel (id,_,_,_)
       | C.AMeta (id,_,_)
       | C.ASort (id,_)
-      | C.AImplicit id ->
+      | C.AImplicit (id, _) ->
          set_target id (C.Term t)
       | C.ACast (id,va,ty) ->
          set_target id (C.Term t) ;
index f75941475563d0ec45e87f8f2dc25019f921430e..110f3d75ea1578b8f5ae2eb7735a48e61147eeae 100644 (file)
@@ -102,7 +102,7 @@ let interpretate ~context ~env ast =
                 let cic_body = do_branch' (name :: context) tl in
                 let typ =
                   match typ with
-                  | None -> Cic.Implicit
+                  | None -> Cic.Implicit (Some `Type)
                   | Some typ -> aux loc context typ
                 in
                 Cic.Lambda (name, typ, cic_body)
@@ -112,7 +112,7 @@ let interpretate ~context ~env ast =
         let (indtype_uri, indtype_no) =
           match resolve env (Id indty_ident) () with
           | Cic.MutInd (uri, tyno, _) -> uri, tyno
-          | Cic.Implicit -> raise Try_again
+          | Cic.Implicit -> raise Try_again
           | _ -> raise DisambiguateChoices.Invalid_choice
         in
         Cic.MutCase (indtype_uri, indtype_no, cic_outtype, cic_term,
@@ -175,7 +175,7 @@ let interpretate ~context ~env ast =
               "Explicit substitutions not allowed here";
           Cic.Rel index
         with Not_found -> resolve env (Id name) ())
-    | CicAst.Implicit -> Cic.Implicit
+    | CicAst.Implicit -> Cic.Implicit None
     | CicAst.Num (num, i) -> resolve env (Num i) ~num ()
     | CicAst.Meta (index, subst) ->
         let cic_subst =
@@ -191,7 +191,7 @@ let interpretate ~context ~env ast =
     | CicAst.Symbol (symbol, instance) ->
         resolve env (Symbol (symbol, instance)) ()
   and aux_option loc context = function
-    | None -> Cic.Implicit
+    | None -> Cic.Implicit (Some `Type)
     | Some term -> aux loc context term
   in
   match ast with
@@ -390,7 +390,11 @@ module Make (C: Callbacks) =
         let filled_env =
           List.fold_left
             (fun env item ->
-              Environment.add item ("Implicit", fun _ _ _ -> Cic.Implicit) env)
+              Environment.add item
+                ("Implicit",
+                 (match item with
+                 | Id _ | Num _ -> (fun _ _ _ -> Cic.Implicit (Some `Closed))
+                 | Symbol _ -> (fun _ _ _ -> Cic.Implicit None))) env)
             current_env todo_dom 
         in
         try
index a19361b32e7264717b96e5f5fc185353d50fff99..1d47711da721d2d9419169d460acf0df76ab9512 100644 (file)
@@ -57,6 +57,6 @@ let _ =
        in
        Cic.Appl [
          Cic.MutInd (HelmLibraryObjects.Logic.eq_URI, 0, []);
-           Cic.Implicit; t1; t2
+           Cic.Implicit (Some `Type); t1; t2
        ]))
 
index f7c2317ba660985d0d44285fe12e750b7a002e50..8418a64d42506796fc8afb5d245e12415c7c7869 100644 (file)
@@ -203,7 +203,7 @@ Cic.Sort Cic.Type ;
                   | Some _, None -> assert false (* due to typing rules *))
                 canonical_context l))
           | C.Sort s -> C.ASort (fresh_id'', s)
-          | C.Implicit -> C.AImplicit (fresh_id'')
+          | C.Implicit annotation -> C.AImplicit (fresh_id'', annotation)
           | C.Cast (v,t) ->
              xxx_add ids_to_inner_sorts fresh_id'' innersort ;
              if innersort = "Prop" then
index eac04e7aa4919b17d6eb94aec555b77a2d2ff3de..61003f930fbca68abc1515a78acf92122659e9d2 100644 (file)
@@ -70,7 +70,7 @@ let rec occur uri =
     | C.Var _ -> false
     | C.Meta _ -> false
     | C.Sort _ -> false
-    | C.Implicit -> raise NotImplemented
+    | C.Implicit _ -> assert false
     | C.Prod (_,s,t) -> (occur uri s) or (occur uri t)
     | C.Cast (te,ty) -> (occur uri te)
     | C.Lambda (_,s,t) -> (occur uri s) or (occur uri t) (* or false ?? *)
index 8880ff3f4d1dadb43a035a18bbb9a804cad43a64..3163dfe09bf21804932f3a4cabefad32745e1752 100644 (file)
@@ -58,7 +58,7 @@ let rec does_not_occur n =
    | C.Rel _
    | C.Meta _
    | C.Sort _
-   | C.Implicit -> true 
+   | C.Implicit -> true 
    | C.Cast (te,ty) ->
       does_not_occur n te && does_not_occur n ty
    | C.Prod (name,so,dest) ->
@@ -123,7 +123,7 @@ let rec head_beta_reduce =
          (function None -> None | Some t -> Some (head_beta_reduce t)) l
        )
     | C.Sort _ as t -> t
-    | C.Implicit -> assert false
+    | C.Implicit -> assert false
     | C.Cast (te,ty) ->
        C.Cast (head_beta_reduce te, head_beta_reduce ty)
     | C.Prod (n,s,t) ->
@@ -404,7 +404,7 @@ let rec type_of_aux' subterms_to_types metasenv context t expectedty =
             (* Checks suppressed *)
             CicSubstitution.lift_meta l ty
      | C.Sort s -> C.Sort C.Type (*CSC manca la gestione degli universi!!! *)
-     | C.Implicit -> raise (Impossible 21)
+     | C.Implicit -> raise (Impossible 21)
      | C.Cast (te,ty) ->
         (* Let's visit all the subterms that will not be visited later *)
         let _ = type_of_aux context te (Some (head_beta_reduce ty)) in
@@ -447,7 +447,7 @@ let rec type_of_aux' subterms_to_types metasenv context t expectedty =
           if does_not_occur 1 t_typ then
            (* since [Rel 1] does not occur in typ, substituting any term *)
            (* in place of [Rel 1] is equivalent to delifting once        *)
-           CicSubstitution.subst C.Implicit t_typ
+           CicSubstitution.subst (C.Implicit None) t_typ
           else
            C.LetIn (n,s,t_typ)
      | C.Appl (he::tl) when List.length tl > 0 ->
index 49a68d1d0d23c9504f61c53248064d8410ee9c98..24242b42675f34f4f4cdefaca68cdaa1a2f4a5d4 100644 (file)
@@ -192,7 +192,7 @@ let eta_fix metasenv t =
        in
        C.Meta (n,l')
    | C.Sort s -> C.Sort s
-   | C.Implicit -> C.Implicit
+   | C.Implicit _ as t -> t
    | C.Cast (v,t) -> C.Cast (eta_fix' context v, eta_fix' context t)
    | C.Prod (n,s,t) -> 
        C.Prod 
index 3a201ad696b387222cde6a466f62004425e0cc17..22138dde8d1eee672f46385db7bc68f9428c29d7 100644 (file)
@@ -129,7 +129,7 @@ module Cache :
              in
               C.Meta(i,l')
           | C.Sort _ as t -> t
-          | C.Implicit as t -> t
+          | C.Implicit as t -> t
           | C.Cast (te,ty) -> C.Cast (restore_in_term te, restore_in_term ty)
           | C.Prod (n,s,t) -> C.Prod (n, restore_in_term s, restore_in_term t)
           | C.Lambda (n,s,t) -> C.Lambda (n, restore_in_term s, restore_in_term t)
index 1f6b72636662fbaec612898d0d41835907ee1c4b..bbf515a99c7908e8898456b7b07b9516f97b47a6 100644 (file)
@@ -34,7 +34,7 @@ let rec letin_nf =
        C.Var (uri,exp_named_subst')
    | C.Meta _ as t -> t
    | C.Sort _ as t -> t
-   | C.Implicit as t -> t
+   | C.Implicit as t -> t
    | C.Cast (te,ty) -> C.Cast (letin_nf te, letin_nf ty)
    | C.Prod (n,s,t) -> C.Prod (n, letin_nf s, letin_nf t)
    | C.Lambda (n,s,t) -> C.Lambda (n, letin_nf s, letin_nf t)
index 152cdd19835f602987b34bb762987cdb481b3d09..b0e7d64ed31be5f58e6c3c095b29eac6a845ee70 100644 (file)
@@ -88,7 +88,7 @@ let rec pp t l =
          | C.Type  -> "Type"
         | C.CProp -> "CProp" 
        )
-    | C.Implicit -> "?"
+    | C.Implicit -> "?"
     | C.Prod (b,s,t) ->
        (match b with
           C.Name n -> "(" ^ n ^ ":" ^ pp s l ^ ")" ^ pp t ((Some b)::l)
index 8c1c5017daa6ee5b53877bc7269f49a45fca6675..dbe22fb3e6ceb107b7d77d7af1d57fecb2e213df 100644 (file)
@@ -374,7 +374,7 @@ prerr_endline ("%%%%%UWVAR " ^ String.concat " ; " (List.map (function (uri,t) -
           in
            C.Meta (i, l')
        | C.Sort _ as t -> t
-       | C.Implicit as t -> t
+       | C.Implicit as t -> t
        | C.Cast (te,ty) -> C.Cast (unwind_aux m te, unwind_aux m ty) (*CSC ???*)
        | C.Prod (n,s,t) -> C.Prod (n, unwind_aux m s, unwind_aux (m + 1) t)
        | C.Lambda (n,s,t) -> C.Lambda (n, unwind_aux m s, unwind_aux (m + 1) t)
@@ -546,7 +546,7 @@ if List.mem uri params then prerr_endline "---- OK2" ;
         let t' = unwind k e ens t in
          if s = [] then t' else C.Appl (t'::(RS.from_stack_list ~unwind s))
      | (k, e, _, (C.Sort _ as t), s) -> t (* s should be empty *)
-     | (k, e, _, (C.Implicit as t), s) -> t (* s should be empty *)
+     | (k, e, _, (C.Implicit as t), s) -> t (* s should be empty *)
      | (k, e, ens, (C.Cast (te,ty) as t), s) ->
         reduce (k, e, ens, te, s) (* s should be empty *)
      | (k, e, ens, (C.Prod _ as t), s) ->
@@ -654,7 +654,7 @@ if List.mem uri params then prerr_endline "---- OK2" ;
                in
                 (* ts are already unwinded because they are a sublist of tl *)
                 reduce (k, e, ens, (List.nth pl (j-1)), (RS.to_stack_list ts)@s)
-          | C.Cast _ | C.Implicit ->
+          | C.Cast _ | C.Implicit ->
               raise (Impossible 2) (* we don't trust our whd ;-) *)
            | _ ->
              let t' = unwind k e ens t in
@@ -877,7 +877,7 @@ let are_convertible =
                 b && aux context ty1 ty2 && aux (tys@context) bo1 bo2)
               fl1 fl2 true
         | (C.Cast _, _) | (_, C.Cast _)
-        | (C.Implicit, _) | (_, C.Implicit) ->
+        | (C.Implicit _, _) | (_, C.Implicit _) ->
             assert false
         | (_,_) -> false
     end
index 5dce7c68da4eec64a6b33f09c4cdf365cb99c9e4..4362006447266b1fea7578adca00e4c7e59fa4c4 100644 (file)
@@ -67,7 +67,7 @@ let whd context =
        )
     | C.Meta _ as t -> if l = [] then t else C.Appl (t::l)
     | C.Sort _ as t -> t (* l should be empty *)
-    | C.Implicit as t -> t
+    | C.Implicit as t -> t
     | C.Cast (te,ty) -> whdaux l te  (*CSC E' GIUSTO BUTTARE IL CAST? *)
     | C.Prod _ as t -> t (* l should be empty *)
     | C.Lambda (name,s,t) as t' ->
@@ -136,7 +136,7 @@ let whd context =
                 eat_first (r,tl)
               in
                whdaux (ts@l) (List.nth pl (j-1))
-          | C.Cast _ | C.Implicit ->
+          | C.Cast _ | C.Implicit ->
              raise (Impossible 2) (* we don't trust our whd ;-) *)
           | _ -> if l = [] then t else C.Appl (t::l)
        )
@@ -290,7 +290,7 @@ let are_convertible =
                 b && aux context ty1 ty2 && aux (tys@context) bo1 bo2)
               fl1 fl2 true
         | (C.Cast _, _) | (_, C.Cast _)
-        | (C.Implicit, _) | (_, C.Implicit) ->
+        | (C.Implicit _, _) | (_, C.Implicit _) ->
            raise (Impossible 3) (* we don't trust our whd ;-) *)
         | (_,_) -> false
     end
index 704a8325ad806803c99f3990726e772fd794b4c5..17ee01b5333c3638e041d5cde49453123e5275c3 100644 (file)
@@ -54,7 +54,7 @@ let lift n =
        in
         C.Meta(i,l')
     | C.Sort _ as t -> t
-    | C.Implicit as t -> t
+    | C.Implicit as t -> t
     | C.Cast (te,ty) -> C.Cast (liftaux k te, liftaux k ty)
     | C.Prod (n,s,t) -> C.Prod (n, liftaux k s, liftaux (k+1) t)
     | C.Lambda (n,s,t) -> C.Lambda (n, liftaux k s, liftaux (k+1) t)
@@ -126,7 +126,7 @@ let subst arg =
        in
         C.Meta(i,l')
     | C.Sort _ as t -> t
-    | C.Implicit as t -> t
+    | C.Implicit as t -> t
     | C.Cast (te,ty) -> C.Cast (substaux k te, substaux k ty)
     | C.Prod (n,s,t) -> C.Prod (n, substaux k s, substaux (k + 1) t)
     | C.Lambda (n,s,t) -> C.Lambda (n, substaux k s, substaux (k + 1) t)
@@ -234,7 +234,7 @@ prerr_endline "---- END\n\n " ;
        in
         C.Meta(i,l')
     | C.Sort _ as t -> t
-    | C.Implicit as t -> t
+    | C.Implicit as t -> t
     | C.Cast (te,ty) -> C.Cast (substaux k te, substaux k ty)
     | C.Prod (n,s,t) -> C.Prod (n, substaux k s, substaux (k + 1) t)
     | C.Lambda (n,s,t) -> C.Lambda (n, substaux k s, substaux (k + 1) t)
@@ -370,7 +370,7 @@ let lift_meta l t =
        in
         C.Meta(i,l')
     | C.Sort _ as t -> t
-    | C.Implicit as t -> t
+    | C.Implicit as t -> t
     | C.Cast (te,ty) -> C.Cast (aux k te, aux k ty) (*CSC ??? *)
     | C.Prod (n,s,t) -> C.Prod (n, aux k s, aux (k + 1) t)
     | C.Lambda (n,s,t) -> C.Lambda (n, aux k s, aux (k + 1) t)
index 3959795055c0d8b9a2be4a9009c0f588b4419de5..8403f5f0c082e295da72e48c1764cd27adc24ea2 100644 (file)
@@ -66,7 +66,7 @@ let debrujin_constructor uri number_of_types =
         C.Var (uri,exp_named_subst')
     | C.Meta _ -> assert false
     | C.Sort _
-    | C.Implicit as t -> t
+    | C.Implicit as t -> t
     | C.Cast (te,ty) -> C.Cast (aux k te, aux k ty)
     | C.Prod (n,s,t) -> C.Prod (n, aux k s, aux (k+1) t)
     | C.Lambda (n,s,t) -> C.Lambda (n, aux k s, aux (k+1) t)
@@ -205,7 +205,7 @@ and does_not_occur context n nn te =
     | C.Rel _
     | C.Meta _
     | C.Sort _
-    | C.Implicit -> true
+    | C.Implicit -> true
     | C.Cast (te,ty) ->
        does_not_occur context n nn te && does_not_occur context n nn ty
     | C.Prod (name,so,dest) ->
@@ -567,7 +567,7 @@ and recursive_args context n nn te =
    | C.Var _
    | C.Meta _
    | C.Sort _
-   | C.Implicit
+   | C.Implicit _
    | C.Cast _ (*CSC ??? *) ->
       raise (AssertFailure "3") (* due to type-checking *)
    | C.Prod (name,so,de) ->
@@ -646,7 +646,7 @@ and check_is_really_smaller_arg context n nn kl x safes te =
    | C.Var _
    | C.Meta _
    | C.Sort _
-   | C.Implicit 
+   | C.Implicit _
    | C.Cast _
 (*   | C.Cast (te,ty) ->
       check_is_really_smaller_arg n nn kl x safes te &&
@@ -799,7 +799,7 @@ and guarded_by_destructors context n nn kl x safes =
       )
    | C.Meta _
    | C.Sort _
-   | C.Implicit -> true
+   | C.Implicit -> true
    | C.Cast (te,ty) ->
       guarded_by_destructors context n nn kl x safes te &&
        guarded_by_destructors context n nn kl x safes ty
@@ -977,7 +977,7 @@ and guarded_by_constructors context n nn h te args coInductiveTypeURI =
    | C.Rel _ -> true
    | C.Meta _
    | C.Sort _
-   | C.Implicit
+   | C.Implicit _
    | C.Cast _
    | C.Prod _
    | C.LetIn _ ->
@@ -1008,7 +1008,7 @@ and guarded_by_constructors context n nn h te args coInductiveTypeURI =
          | C.Var _
          | C.Sort _ ->
             does_not_occur context n nn te
-         | C.Implicit
+         | C.Implicit _
          | C.Cast _ ->
             raise (AssertFailure "24")(* due to type-checking *)
          | C.Prod (name,so,de) ->
@@ -1042,7 +1042,7 @@ and guarded_by_constructors context n nn h te args coInductiveTypeURI =
          | C.Var _
          | C.Meta _
          | C.Sort _
-         | C.Implicit
+         | C.Implicit _
          | C.Cast _ -> raise (AssertFailure "29")(* due to type-checking *)
          | C.Prod (name,so,de) ->
             begin
@@ -1353,7 +1353,7 @@ and type_of_aux' metasenv context t =
         check_metasenv_consistency metasenv context canonical_context l;
         CicSubstitution.lift_meta l ty
     | C.Sort s -> C.Sort C.Type (*CSC manca la gestione degli universi!!! *)
-    | C.Implicit -> raise (AssertFailure "21")
+    | C.Implicit -> raise (AssertFailure "21")
     | C.Cast (te,ty) as t ->
        let _ = type_of_aux context ty in
         if R.are_convertible context (type_of_aux context te) ty then
index 4ee37168450dc9fc84c409a82a40d9ef25828140..a19bb2b25e405a83b6de8026c0c7b9b2f9795c9d 100644 (file)
@@ -27,7 +27,7 @@ let apply_subst_gen ~appl_fun subst term =
           in
            C.Meta (i,l'))
     | C.Sort _ as t -> t
-    | C.Implicit -> assert false
+    | C.Implicit -> assert false
     | C.Cast (te,ty) -> C.Cast (um_aux te, um_aux ty)
     | C.Prod (n,s,t) -> C.Prod (n, um_aux s, um_aux t)
     | C.Lambda (n,s,t) -> C.Lambda (n, um_aux s, um_aux t)
@@ -280,7 +280,7 @@ let rec force_does_not_occur subst to_be_restricted t =
       C.Rel r when List.mem (r - k) to_be_restricted -> raise Occur
     | C.Rel _
     | C.Sort _ as t -> t
-    | C.Implicit -> assert false
+    | C.Implicit -> assert false
     | C.Meta (n, l) ->
        (* we do not retrieve the term associated to ?n in subst since *)
        (* in this way we can restrict if something goes wrong         *)
@@ -516,7 +516,7 @@ let delift n subst context metasenv l t =
            let l' = deliftl 1 l1 in
             C.Meta(i,l')
      | C.Sort _ as t -> t
-     | C.Implicit as t -> t
+     | C.Implicit as t -> t
      | C.Cast (te,ty) -> C.Cast (deliftaux k te, deliftaux k ty)
      | C.Prod (n,s,t) -> C.Prod (n, deliftaux k s, deliftaux (k+1) t)
      | C.Lambda (n,s,t) -> C.Lambda (n, deliftaux k s, deliftaux (k+1) t)
index 1817ac8613873ecd2276fae3da36f156d4afda7e..99e599ab2f6feff6e9bcfe4ce8d6a3d21fe3a3c6 100644 (file)
@@ -87,7 +87,14 @@ let expand_implicits metasenv context term =
     | Cic.Meta (n,l) -> 
         let metasenv', l' = do_local_context metasenv context l in
         metasenv', Cic.Meta (n, l')
-    | Cic.Implicit ->
+    | Cic.Implicit (Some `Type) ->
+        let (metasenv', idx) = mk_implicit_type metasenv context in
+        let irl = identity_relocation_list_for_metavariable context in
+        metasenv', Cic.Meta (idx, irl)
+    | Cic.Implicit (Some `Closed) ->
+        let (metasenv', idx) = mk_implicit metasenv [] in
+        metasenv', Cic.Meta (idx, [])
+    | Cic.Implicit None ->
         let (metasenv', idx) = mk_implicit metasenv context in
         let irl = identity_relocation_list_for_metavariable context in
         metasenv', Cic.Meta (idx, irl)
index 77b376d63e1615931f3de6e92d9b93f867f7cc3b..43ecd892915745020599e705acc6c341b583550f 100644 (file)
@@ -169,7 +169,7 @@ and type_of_aux' metasenv context t =
     | C.Sort s ->
        C.Sort C.Type, (*CSC manca la gestione degli universi!!! *)
         subst,metasenv
-    | C.Implicit -> raise (Impossible 21)
+    | C.Implicit -> raise (Impossible 21)
     | C.Cast (te,ty) ->
        let _,subst',metasenv' =
         type_of_aux subst metasenv context ty in
index 1dc4ae2bd0f08c373e7b96d359fa7a4a9e8ac249..3c8b077297fd5ad8da82700f4dd081fade124c19 100644 (file)
@@ -144,7 +144,7 @@ prerr_endline "********* PROCEED AT YOUR OWN RISK. AND GOOD LUCK." ;
        raise (UnificationFailure (sprintf
         "Can't unify %s with %s due to different inductive constructors"
         (CicPp.ppterm t1) (CicPp.ppterm t1)))
-   | (C.Implicit, _) | (_, C.Implicit) ->  assert false
+   | (C.Implicit _, _) | (_, C.Implicit _) ->  assert false
    | (C.Cast (te,ty), t2) -> fo_unif_subst subst context metasenv te t2
    | (t1, C.Cast (te,ty)) -> fo_unif_subst subst context metasenv t1 te
    | (C.Prod (n1,s1,t1), C.Prod (_,s2,t2)) -> 
index fc1b4f36e7c5cabf9efe6c992dedf428087e573e..1a94c318599e2678e0898618d1fe40c254653d4b 100644 (file)
@@ -95,7 +95,7 @@ let clean_dummy_dependent_types t =
        in
         C.Meta(i,l'),rels
     | C.Sort _ as t -> t,[]
-    | C.Implicit as t -> t,[]
+    | C.Implicit as t -> t,[]
     | C.Cast (te,ty) ->
        let te',rels1 = aux k te in
        let ty',rels2 = aux k ty in
index bb87b461efcf548cb7fe1749043c47d0ca5abc4b..42d52a7ac9c6e873fccc950b2b9f28bf6ee93434 100644 (file)
@@ -70,7 +70,7 @@ let levels_of_term metasenv context term =
         Cic.Rel _                        -> l
       | Cic.Meta _                       -> l
       | Cic.Sort _                       -> l 
-      | Cic.Implicit                     -> l 
+      | Cic.Implicit _                   -> l 
       | Cic.Var (u,exp_named_subst)      ->
          let l' = inspect_uri main l u [] v term in
           inspect_exp_named_subst l' (succ v) exp_named_subst
index a56d65959448421f872acc554e00edb194359ab8..7640a6b7678ec1aacbcc0802dc44f10b9fb6b938 100644 (file)
@@ -101,7 +101,7 @@ let get_constraints term =
             [],[],[!!kind,s']
          | _ -> [],[],[])
     | C.Meta _
-    | C.Implicit -> assert false
+    | C.Implicit -> assert false
     | C.Cast (te,_) ->
        (* type ignored *)
        process_type_aux kind te
index a518edaa67193486f259b643bdcc387a90a49798..326d9e2c28a882c6eb4f5dcb1a398318d9b2636e 100644 (file)
@@ -74,7 +74,7 @@ let eta_expand metasenv context t arg =
         C.Var (uri,exp_named_subst')
     | C.Meta _
     | C.Sort _
-    | C.Implicit as t -> t
+    | C.Implicit as t -> t
     | C.Cast (te,ty) -> C.Cast (aux n te, aux n ty)
     | C.Prod (nn,s,t) -> C.Prod (nn, aux n s, aux (n+1) t)
     | C.Lambda (nn,s,t) -> C.Lambda (nn, aux n s, aux (n+1) t)
index 9e5aa04ff6c71142660110f2e1513c532d45f54f..99eb43f6a56e65e8419b090e43a0d2016dd6651b 100644 (file)
@@ -142,7 +142,7 @@ let replace ~equality ~what ~with_what ~where =
         C.Var (uri,List.map (function (uri,t) -> uri, aux t) exp_named_subst)
      | C.Meta _ -> t
      | C.Sort _ -> t
-     | C.Implicit as t -> t
+     | C.Implicit as t -> t
      | C.Cast (te,ty) -> C.Cast (aux te, aux ty)
      | C.Prod (n,s,t) -> C.Prod (n, aux s, aux t)
      | C.Lambda (n,s,t) -> C.Lambda (n, aux s, aux t)
@@ -216,7 +216,7 @@ let replace_lifting ~equality ~what ~with_what ~where =
        in
         C.Meta(i,l')
     | C.Sort _ as t -> t
-    | C.Implicit as t -> t
+    | C.Implicit as t -> t
     | C.Cast (te,ty) -> C.Cast (substaux k what te, substaux k what ty)
     | C.Prod (n,s,t) ->
        C.Prod
@@ -315,7 +315,7 @@ let replace_lifting_csc nnn ~equality ~what ~with_what ~where =
         in
          C.Meta(i,l')
      | C.Sort _ as t -> t
-     | C.Implicit as t -> t
+     | C.Implicit as t -> t
      | C.Cast (te,ty) -> C.Cast (substaux k te, substaux k ty)
      | C.Prod (n,s,t) ->
         C.Prod (n, substaux k s, substaux (k + 1) t)
@@ -402,7 +402,7 @@ let reduce context =
        )
     | C.Meta _ as t -> if l = [] then t else C.Appl (t::l)
     | C.Sort _ as t -> t (* l should be empty *)
-    | C.Implicit as t -> t
+    | C.Implicit as t -> t
     | C.Cast (te,ty) ->
        C.Cast (reduceaux context l te, reduceaux context l ty)
     | C.Prod (name,s,t) ->
@@ -506,7 +506,7 @@ let reduce context =
                 eat_first (r,tl)
               in
                reduceaux context (ts@l) (List.nth pl (j-1))
-         | C.Cast _ | C.Implicit ->
+         | C.Cast _ | C.Implicit ->
             raise (Impossible 2) (* we don't trust our whd ;-) *)
          | _ ->
            let outtype' = reduceaux context [] outtype in
@@ -625,7 +625,7 @@ let simpl context =
         )
     | C.Meta _ as t -> if l = [] then t else C.Appl (t::l)
     | C.Sort _ as t -> t (* l should be empty *)
-    | C.Implicit as t -> t
+    | C.Implicit as t -> t
     | C.Cast (te,ty) ->
        C.Cast (reduceaux context l te, reduceaux context l ty)
     | C.Prod (name,s,t) ->
@@ -726,7 +726,7 @@ let simpl context =
                 eat_first (r,tl)
               in
                reduceaux context (ts@l) (List.nth pl (j-1))
-         | C.Cast _ | C.Implicit ->
+         | C.Cast _ | C.Implicit ->
             raise (Impossible 2) (* we don't trust our whd ;-) *)
          | _ ->
            let outtype' = reduceaux context [] outtype in