Revision 08faae63
Added by Pierre-Loïc Garoche about 5 years ago
src/plugins/salsa/salsaDatatypes.ml | ||
---|---|---|
6 | 6 |
|
7 | 7 |
let debug = ref false |
8 | 8 |
|
9 |
(* let _ = Salsa.Prelude.sliceSize := 1000 *) |
|
10 |
|
|
9 | 11 |
let pp_hash ~sep f fmt r = |
10 | 12 |
Format.fprintf fmt "[@[<v>"; |
11 | 13 |
Hashtbl.iter (fun k v -> Format.fprintf fmt "%t%s@ " (f k v) sep) r; |
... | ... | |
91 | 93 |
ST.(I(min x1 x1', max x2 x2'), J(min y1 y1', max y2 y2')) |
92 | 94 |
| _ -> Format.eprintf "%a cup %a failed@.@?" pp v1 pp v2; assert false |
93 | 95 |
*) |
94 |
let inject cst = match cst with (* ATTENTION ATTENTION !!!!! Remettre les Num !!!! *)
|
|
95 |
| LT.Const_int(i) -> Salsa.Builder.mk_cst (ST.R(float_of_int i (*Num.num_of_int i*), []), ST.R(float_of_int i (*Num.num_of_int i*), []))
|
|
96 |
let inject cst = match cst with |
|
97 |
| LT.Const_int(i) -> Salsa.Builder.mk_cst (ST.R(Salsa.NumMartel.of_int i, []), ST.R(Salsa.NumMartel.of_int i , []))
|
|
96 | 98 |
| LT.Const_real (c,e,s) -> (* TODO: this is incorrect. We should rather |
97 | 99 |
compute the error associated to the float *) |
98 | 100 |
let r = float_of_string s in |
... | ... | |
203 | 205 |
let get_var vars_env v = |
204 | 206 |
try |
205 | 207 |
VarEnv.find v vars_env |
206 |
with Not_found -> Format.eprintf "Impossible to find var %s@.@?" v; assert false |
|
208 |
with Not_found -> Format.eprintf "Impossible to find var %s in var env %a@.@?" v |
|
209 |
(Utils.fprintf_list ~sep:", " (fun fmt (id, _) -> Format.pp_print_string fmt id)) (VarEnv.bindings vars_env) |
|
210 |
; assert false |
|
207 | 211 |
|
208 | 212 |
let compute_vars_env m = |
209 | 213 |
let env = VarEnv.empty in |
Also available in: Unified diff
NumMartel functions