111 |
111 |
let pp fmt (f,r) =
|
112 |
112 |
match f, r with
|
113 |
113 |
| ST.I(a,b), ST.J(c,d) ->
|
114 |
|
Format.fprintf fmt "[%f, %f] + [%e, %e]" a b c d
|
|
114 |
Format.fprintf fmt "[%.50f, %.50f] + [%.50e, %.50e]" a b c d
|
115 |
115 |
| ST.I(a,b), ST.JInfty -> Format.fprintf fmt "[%f, %f] + oo" a b
|
116 |
116 |
| ST.Empty, _ -> Format.fprintf fmt "???"
|
117 |
117 |
|
... | ... | |
251 |
251 |
env
|
252 |
252 |
|
253 |
253 |
let rec salsa_expr2value_t vars_env cst_env e =
|
|
254 |
let e = Float.evalPartExpr e [] [] in
|
254 |
255 |
let salsa_expr2value_t = salsa_expr2value_t vars_env cst_env in
|
255 |
256 |
let binop op e1 e2 t =
|
256 |
257 |
let x = salsa_expr2value_t e1 in
|
... | ... | |
273 |
274 |
let s =
|
274 |
275 |
if new_float = 0. then "0." else
|
275 |
276 |
(* We have to convert it into our format: int * int * real *)
|
|
277 |
(* string_of_float new_float *)
|
276 |
278 |
let _ = Format.flush_str_formatter () in
|
277 |
|
Format.fprintf Format.str_formatter "%.50f" new_float;
|
278 |
|
Format.flush_str_formatter ()
|
|
279 |
Format.fprintf Format.str_formatter "%.11f" new_float;
|
|
280 |
Format.flush_str_formatter ()
|
279 |
281 |
in
|
280 |
282 |
Parser_lustre.signed_const Lexer_lustre.token (Lexing.from_string s)
|
281 |
283 |
in
|
... | ... | |
310 |
312 |
| _ -> raise (Salsa.Prelude.Error "Entschuldigung, salsaExpr2value_t case not yet implemented")
|
311 |
313 |
|
312 |
314 |
|
|
315 |
|
313 |
316 |
let rec get_salsa_free_vars vars_env constEnv absenv e =
|
314 |
317 |
let f = get_salsa_free_vars vars_env constEnv absenv in
|
315 |
318 |
match e with
|
on joue avec l'affiche des floats