From d57e3491720e912b4e2fd6c73f9d356901a42df5 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Tue, 17 Jun 2014 14:34:40 +0200 Subject: Write transformation of program into logical formula. --- frontend/ast_printer.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'frontend') diff --git a/frontend/ast_printer.ml b/frontend/ast_printer.ml index b6dcdbc..641e4fd 100644 --- a/frontend/ast_printer.ml +++ b/frontend/ast_printer.ml @@ -52,8 +52,8 @@ let binary_rel_precedence = function | AST_EQ | AST_NE -> 41 | AST_LT | AST_LE | AST_GT | AST_GE -> 40 let binary_bool_precedence = function - | AST_AND -> 31 - | AST_OR -> 30 + | AST_OR -> 31 + | AST_AND -> 30 let arrow_precedence = 20 let if_precedence = 10 @@ -127,7 +127,7 @@ let rec print_expr fmt e = then Format.fprintf fmt " (%a)" print_expr e2 else Format.fprintf fmt " %a" print_expr e2 | AST_binary_bool (op,(e1,_),(e2,_)) -> - if expr_precedence e1 < expr_precedence e + if expr_precedence e1 <= expr_precedence e then Format.fprintf fmt "(%a) " print_expr e1 else Format.fprintf fmt "%a " print_expr e1; Format.pp_print_string fmt (string_of_binary_bool op); -- cgit v1.2.3