diff options
Diffstat (limited to 'abstract/formula_printer.ml')
-rw-r--r-- | abstract/formula_printer.ml | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/abstract/formula_printer.ml b/abstract/formula_printer.ml index 25b7b22..53a9b6a 100644 --- a/abstract/formula_printer.ml +++ b/abstract/formula_printer.ml @@ -39,12 +39,15 @@ let print_ah fmt pf fa a fe e = then Format.fprintf fmt "@[<hv 2>(%a)@]" pf a else Format.fprintf fmt "@[<hv 2>%a@]" pf a +let print_id fmt id = + let re = Str.regexp "/" in + Format.fprintf fmt "%s" (Str.global_replace re "·" id) + let rec print_num_expr fmt e = match e with | NIntConst i -> Format.fprintf fmt "%d" i | NRealConst f -> Format.fprintf fmt "%f" f | NIdent id -> - let re = Str.regexp "/" in - Format.fprintf fmt "%s" (Str.global_replace re "·" id) + print_id fmt id | NBinary(op, a, b) -> print_ch fmt print_num_expr ne_prec a ne_prec e; Format.fprintf fmt "@ %s " (string_of_binary_op op); |