From: Claudio Sacerdoti Coen Date: Mon, 9 Feb 2004 18:43:38 +0000 (+0000) Subject: Added flag ?eta_fix:bool to acic_object_of_cic_object. X-Git-Tag: V_0_3_0~41 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=9be7ec5bbacfafed8a3e37cfe0095f2aea1b9bf9;p=helm.git Added flag ?eta_fix:bool to acic_object_of_cic_object. --- diff --git a/helm/gTopLevel/gTopLevel.ml b/helm/gTopLevel/gTopLevel.ml index b62f4b624..03d12a4c5 100644 --- a/helm/gTopLevel/gTopLevel.ml +++ b/helm/gTopLevel/gTopLevel.ml @@ -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 diff --git a/helm/gTopLevel/proofEngine.ml b/helm/gTopLevel/proofEngine.ml index a9199c0e8..1077f15c2 100644 --- a/helm/gTopLevel/proofEngine.ml +++ b/helm/gTopLevel/proofEngine.ml @@ -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 diff --git a/helm/gTopLevel/testlibrary.ml b/helm/gTopLevel/testlibrary.ml index 90563a618..21173e9e5 100644 --- a/helm/gTopLevel/testlibrary.ml +++ b/helm/gTopLevel/testlibrary.ml @@ -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 = diff --git a/helm/ocaml/cic_omdoc/cic2acic.ml b/helm/ocaml/cic_omdoc/cic2acic.ml index 8418a64d4..ab6342b55 100644 --- a/helm/ocaml/cic_omdoc/cic2acic.ml +++ b/helm/ocaml/cic_omdoc/cic2acic.ml @@ -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)) ; diff --git a/helm/ocaml/cic_omdoc/cic2acic.mli b/helm/ocaml/cic_omdoc/cic2acic.mli index 9cef0cb38..0288125b9 100644 --- a/helm/ocaml/cic_omdoc/cic2acic.mli +++ b/helm/ocaml/cic_omdoc/cic2acic.mli @@ -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 *)