]> matita.cs.unibo.it Git - helm.git/commitdiff
In the let-in case we compute the type and add it to the context.
authorAndrea Asperti <andrea.asperti@unibo.it>
Fri, 22 Dec 2006 10:37:35 +0000 (10:37 +0000)
committerAndrea Asperti <andrea.asperti@unibo.it>
Fri, 22 Dec 2006 10:37:35 +0000 (10:37 +0000)
Before it was computed every time

helm/software/components/cic_acic/cic2acic.ml

index 6cb2ad9a21fbbf4afaa16c3704c97a979daecf47..d8392f6206ab745e2647a75286e30745e481e18a 100644 (file)
@@ -301,12 +301,19 @@ let acic_of_cic_context' ~computeinnertypes:global_computeinnertypes
                (fresh_id'',n, aux' context idrefs s,
                 aux' ((Some (n, C.Decl s)::context)) (fresh_id''::idrefs) t)
           | C.LetIn (n,s,t) ->
-             xxx_add ids_to_inner_sorts fresh_id'' innersort ;
-             if innersort = `Prop then
-              add_inner_type fresh_id'' ;
-             C.ALetIn
-              (fresh_id'', n, aux' context idrefs s,
-               aux' ((Some (n, C.Def(s,None)))::context) (fresh_id''::idrefs) t)
+             let s_ty =
+              try
+               (cic_CicHash_find terms_to_types s).D.synthesized
+              with
+               Not_found ->
+                cicReduction_whd context (xxx_type_of_aux' metasenv context s);
+             in
+              xxx_add ids_to_inner_sorts fresh_id'' innersort ;
+              if innersort = `Prop then
+               add_inner_type fresh_id'' ;
+              C.ALetIn
+               (fresh_id'', n, aux' context idrefs s,
+                aux' ((Some (n, C.Def(s,Some s_ty)))::context) (fresh_id''::idrefs) t)
           | C.Appl l ->
              xxx_add ids_to_inner_sorts fresh_id'' innersort ;
              if innersort = `Prop then
@@ -556,8 +563,8 @@ let acic_object_of_cic_object ?(eta_fix=false) obj =
              = aconjecture_of_conjecture' conjectures conjecture in
            (cid,i,acanonical_context,aterm))
           conjectures' in 
-(*        let time1 = Sys.time () in *)
-       let bo' = (*eta_fix conjectures' []*) bo in
+       (* let bo' = eta_fix conjectures' [] bo in *)
+       let bo' = bo in
        let ty' = eta_fix conjectures' [] ty in
 (*
        let time2 = Sys.time () in