Une MAJ de sécurité est nécessaire sur notre version actuelle. Elle sera effectuée lundi 02/08 entre 12h30 et 13h. L'interruption de service devrait durer quelques minutes (probablement moins de 5 minutes).

Commit d26cadfb authored by Guillaume Melquiond's avatar Guillaume Melquiond
Browse files

Avoid lazy variables in the Gappa printer, as it might happen that two tasks...

Avoid lazy variables in the Gappa printer, as it might happen that two tasks do not share the same environment.
See http://lists.gforge.inria.fr/pipermail/why3-commits/2011-April/000053.html for details.
There are still global references to unary minus symbols, but they are now refreshed each time.
parent 3f724028
...@@ -50,54 +50,27 @@ let find_th env file th = ...@@ -50,54 +50,27 @@ let find_th env file th =
let theory = Env.find_theory env [file] th in let theory = Env.find_theory env [file] th in
fun id -> Theory.ns_find_ls theory.Theory.th_export [id] fun id -> Theory.ns_find_ls theory.Theory.th_export [id]
let get_info = let get_info env task =
let arith_symbols = ref None in (* unary minus for constants *)
let ops_of_rels = ref Mls.empty in int_minus := find_th env "int" "Int" "prefix -";
let _inline = ref Sls.empty in real_minus := find_th env "real" "Real" "prefix -";
fun env task -> (* handling of inequalities *)
let syn = get_syntax_map task in let ops = on_meta arith_meta (fun acc meta_arg ->
let l = match meta_arg with
match !arith_symbols with | [MAls ls; MAstr s; MAstr op; MAstr rev_op] ->
| None -> Mls.add ls (s,op,rev_op) acc
let find_int = find_th env "int" "Int" in | _ -> assert false) Mls.empty task in
int_minus := find_int "prefix -"; (* sets of known symbols *)
let find_real = find_th env "real" "Real" in let syn = get_syntax_map task in
real_minus := find_real "prefix -"; let symb = Mid.map (Util.const ()) syn in
(* let symb = Mls.fold (fun ls _ acc -> Sid.add ls.ls_name acc) ops symb in
let no_overflow_single = find_single_theory "no_overflow" in let symb = Sid.add ps_equ.ls_name symb in
*) {
let ops = on_meta arith_meta info_symbols = symb;
(fun acc meta_arg -> info_ops_of_rel = ops;
match meta_arg with info_syn = syn;
| [MAls ls;MAstr s;MAstr op;MAstr rev_op] -> info_rem = get_remove_set task;
Mls.add ls (s,op,rev_op) acc }
| _ -> assert false) Mls.empty task in
ops_of_rels := ops;
(* sets of known symbols *)
let l = Mid.map (Util.const ()) syn in
let l = Mls.fold (fun ls _ acc -> Sid.add ls.ls_name acc) ops l in
let l =
List.fold_right (fun ls -> Sid.add ls.ls_name)
[ps_equ] l
in
arith_symbols := Some l;
(*
inline :=
List.fold_left
(fun acc ls -> Sls.add ls acc)
Sls.empty
[ real_lei ;
];
*)
l
| Some l -> l
in
{
info_symbols = l;
info_ops_of_rel = !ops_of_rels;
info_syn = syn;
info_rem = get_remove_set task;
}
(* Gappa printing *) (* Gappa printing *)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment