aboutsummaryrefslogtreecommitdiffhomepage
path: root/contrib/correctness/penv.ml
diff options
context:
space:
mode:
authorGravatar filliatr <filliatr@85f007b7-540e-0410-9357-904b9bb8a0f7>2001-03-30 15:06:48 +0000
committerGravatar filliatr <filliatr@85f007b7-540e-0410-9357-904b9bb8a0f7>2001-03-30 15:06:48 +0000
commitf5f283ec29d79a64d8fdda92823fe606a475e625 (patch)
tree9ce71088b933336bad04250d32e9271498576eb0 /contrib/correctness/penv.ml
parentd7550d7625f9eb9bc9c0e88dabd744f6b1530891 (diff)
branchement extraction (bytecode seulement)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@1509 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'contrib/correctness/penv.ml')
-rw-r--r--contrib/correctness/penv.ml37
1 files changed, 19 insertions, 18 deletions
diff --git a/contrib/correctness/penv.ml b/contrib/correctness/penv.ml
index fe37f8308..31a2bad38 100644
--- a/contrib/correctness/penv.ml
+++ b/contrib/correctness/penv.ml
@@ -115,7 +115,6 @@ let (inProg,outProg) =
cache_function = cache_global;
open_function = (fun _ -> ());
export_function = (fun x -> Some x) })
-;;
let add_global id v p =
try
@@ -125,16 +124,17 @@ let add_global id v p =
Not_found -> begin
let id' =
if is_mutable v then id
- else id_of_string ("prog_" ^ (string_of_id id)) in
- add_named_object (id',OBJ) (inProg (id,TypeV v,p))
+ else id_of_string ("prog_" ^ (string_of_id id))
+ in
+ Lib.add_leaf id' OBJ (inProg (id,TypeV v,p))
end
let add_global_set id =
try
let _ = Env.find id !env in
- Prog_errors.clash id None
+ Perror.clash id None
with
- Not_found -> add_named_object (id,OBJ) (inProg (id,Set,None))
+ Not_found -> Lib.add_leaf id OBJ (inProg (id,Set,None))
let is_global id =
try
@@ -152,7 +152,7 @@ let is_global_set id =
let lookup_global id =
match Env.find id !env with TypeV v -> v | Set -> raise Not_found
-let find_pgm id = IdMap.find id !pgm_table
+let find_pgm id = Idmap.find id !pgm_table
let all_vars () =
Env.fold
@@ -167,17 +167,18 @@ let all_refs () =
(* initializations *)
let cache_init (_,(id,c)) =
- init_table := IdMap.add id c !init_table
+ init_table := Idmap.add id c !init_table
let (inInit,outInit) =
declare_object ("programs-objects-init",
- { load_function = (fun _ -> ());
+ { load_function = cache_init;
+ open_function = (fun _ -> ());
cache_function = cache_init;
- specification_function = fun x -> x})
+ export_function = fun x -> Some x })
-let initialize id c = add_anonymous_object (inInit (id,c))
+let initialize id c = Lib.add_anonymous_leaf (inInit (id,c))
-let find_init id = IdMap.find id !init_table
+let find_init id = Idmap.find id !init_table
(* access in env, local then global *)
@@ -206,19 +207,19 @@ let find_recursion = Env.find_rec
open Pp
open Himsg
-let (edited : (type_v * typed_program) IdMap.t ref) = ref IdMap.empty
+let (edited : (type_v * typed_program) Idmap.t ref) = ref Idmap.empty
let new_edited id v =
- edited := IdMap.add id v !edited
+ edited := Idmap.add id v !edited
let is_edited id =
- try let _ = IdMap.find id !edited in true with Not_found -> false
+ try let _ = Idmap.find id !edited in true with Not_found -> false
let register id id' =
try
- let (v,p) = IdMap.find id !edited in
- add_global id' v (Some p);
- mSGNL (hOV 0 [< 'sTR"Program "; pID id'; 'sPC; 'sTR"is defined" >]);
- edited := IdMap.remove id !edited
+ let (v,p) = Idmap.find id !edited in
+ let _ = add_global id' v (Some p) in
+ mSGNL (hOV 0 [< 'sTR"Program "; pr_id id'; 'sPC; 'sTR"is defined" >]);
+ edited := Idmap.remove id !edited
with Not_found -> ()