]> matita.cs.unibo.it Git - helm.git/commitdiff
Added flag ?eta_fix:bool to acic_object_of_cic_object.
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Mon, 9 Feb 2004 18:43:38 +0000 (18:43 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Mon, 9 Feb 2004 18:43:38 +0000 (18:43 +0000)
helm/gTopLevel/gTopLevel.ml
helm/gTopLevel/proofEngine.ml
helm/gTopLevel/testlibrary.ml
helm/ocaml/cic_omdoc/cic2acic.ml
helm/ocaml/cic_omdoc/cic2acic.mli

index b62f4b6245dbc5b88b73df47bc8ab77633277f49..03d12a4c5150057c475785775d702a3b873b1ab5 100644 (file)
@@ -478,7 +478,7 @@ let save_obj uri obj =
   (acic,ids_to_terms,ids_to_father_ids,ids_to_inner_sorts,
    ids_to_inner_types,ids_to_conjectures,ids_to_hypotheses)
  =
-  Cic2acic.acic_object_of_cic_object obj
+  Cic2acic.acic_object_of_cic_object ~eta_fix:false obj
  in
   (* let's save the theorem and register it to the getter *) 
   let pathname = pathname_of_annuri (UriManager.buri_of_uri uri) in
index a9199c0e880f07b061a65d9b8655c334ec21eb6f..1077f15c2bc6a03cdaa7b2c9cd6b854c857446a5 100644 (file)
@@ -43,7 +43,7 @@ let get_current_status_as_xml () =
        Cic.CurrentProof (UriManager.name_of_uri uri,metasenv,bo,ty,[])
       in
        let (acurrentproof,_,_,ids_to_inner_sorts,_,_,_) =
-        Cic2acic.acic_object_of_cic_object currentproof
+        Cic2acic.acic_object_of_cic_object ~eta_fix:false currentproof
        in
         let xml, bodyxml =
          match
index 90563a6186ec078dc9d34252c8372ad6aa59b9be..21173e9e5308221a81ddb53841c44a0ba2827e9e 100644 (file)
@@ -35,7 +35,7 @@ let debug_print s = prerr_endline ("^^^^^^ " ^ s)
 let test_uri uri =
   let obj = CicCache.get_obj uri in
   let (annobj, _, _, ids_to_inner_sorts, _, _, _) =
-    Cic2acic.acic_object_of_cic_object obj
+    Cic2acic.acic_object_of_cic_object ~eta_fix:false obj
   in
   let ids_to_uris = Hashtbl.create 1023 in
   let round_trip annterm =
index 8418a64d42506796fc8afb5d245e12415c7c7869..ab6342b55892acf917bea708f444123b0e6dc5a7 100644 (file)
@@ -392,7 +392,7 @@ let asequent_of_sequent (metasenv:Cic.metasenv) (sequent:Cic.conjecture) =
      ids_to_terms,ids_to_father_ids,ids_to_inner_sorts,ids_to_hypotheses
 ;;
 
-let acic_object_of_cic_object obj =
+let acic_object_of_cic_object ?(eta_fix=true) obj =
  let module C = Cic in
  let module E = Eta_fixing in
   let ids_to_terms = Hashtbl.create 503 in
@@ -411,27 +411,30 @@ let acic_object_of_cic_object obj =
   let aconjecture_of_conjecture' = aconjecture_of_conjecture seed 
     ids_to_terms ids_to_father_ids ids_to_inner_sorts ids_to_inner_types 
     ids_to_hypotheses hypotheses_seed in 
+   let eta_fix context t =
+    if eta_fix then E.eta_fix context t else t
+   in
    let aobj =
     match obj with
       C.Constant (id,Some bo,ty,params) ->
-       let bo' = E.eta_fix [] bo in
-       let ty' = E.eta_fix [] ty in
+       let bo' = eta_fix [] bo in
+       let ty' = eta_fix [] ty in
        let abo = acic_term_of_cic_term' bo' (Some ty') in
        let aty = acic_term_of_cic_term' ty' None in
         C.AConstant
          ("mettereaposto",Some "mettereaposto2",id,Some abo,aty,params)
     | C.Constant (id,None,ty,params) ->
-       let ty' = E.eta_fix [] ty in
+       let ty' = eta_fix [] ty in
        let aty = acic_term_of_cic_term' ty' None in
         C.AConstant
          ("mettereaposto",None,id,None,aty,params)
     | C.Variable (id,bo,ty,params) ->
-       let ty' = E.eta_fix [] ty in
+       let ty' = eta_fix [] ty in
        let abo =
         match bo with
            None -> None
          | Some bo ->
-            let bo' = E.eta_fix [] bo in
+            let bo' = eta_fix [] bo in
              Some (acic_term_of_cic_term' bo' (Some ty'))
        in
        let aty = acic_term_of_cic_term' ty' None in
@@ -445,13 +448,13 @@ let acic_object_of_cic_object obj =
             List.map
              (function
                  None -> None
-               | Some (n, C.Decl t)-> Some (n, C.Decl (E.eta_fix conjectures t))
+               | Some (n, C.Decl t)-> Some (n, C.Decl (eta_fix conjectures t))
                | Some (n, C.Def (t,None)) ->
-                  Some (n, C.Def ((E.eta_fix conjectures t),None))
+                  Some (n, C.Def ((eta_fix conjectures t),None))
                | Some (_,C.Def (_,Some _)) -> assert false
              ) canonical_context
            in
-           let term' = E.eta_fix conjectures term in
+           let term' = eta_fix conjectures term in
             (i,canonical_context',term')
          ) conjectures
        in
@@ -506,8 +509,8 @@ let acic_object_of_cic_object obj =
               (cid,i,(List.rev revacanonical_context),aterm) 
          ) conjectures' in *)
        let time1 = Sys.time () in
-       let bo' = E.eta_fix conjectures' bo in
-       let ty' = E.eta_fix conjectures' ty in
+       let bo' = eta_fix conjectures' bo in
+       let ty' = eta_fix conjectures' ty in
        let time2 = Sys.time () in
        prerr_endline
         ("++++++++++ Tempi della eta_fix: "^ string_of_float (time2 -. time1)) ;
index 9cef0cb38155a164403d1f909b2dd6970088336e..0288125b9a8ef6e64c17c6c85379346105d2b163 100644 (file)
@@ -45,6 +45,7 @@ val acic_of_cic_context' :
   Cic.annterm                             (* annotated term *)
 
 val acic_object_of_cic_object :
+  ?eta_fix: bool ->                       (* perform eta_fixing; default: true*)
   Cic.obj ->                              (* object *)
    Cic.annobj *                           (* annotated object *)
     (Cic.id, Cic.term) Hashtbl.t *        (* ids_to_terms *)