diff options
author | Alex Auvolat <alex.auvolat@ansys.com> | 2014-06-17 14:34:40 +0200 |
---|---|---|
committer | Alex Auvolat <alex.auvolat@ansys.com> | 2014-06-17 14:34:40 +0200 |
commit | d57e3491720e912b4e2fd6c73f9d356901a42df5 (patch) | |
tree | bc0feb8577b162e3e735fa57c7b4b0d82be808ce /frontend | |
parent | 860ad2752ef0544bc6874d895875a78f91db9084 (diff) | |
download | scade-analyzer-d57e3491720e912b4e2fd6c73f9d356901a42df5.tar.gz scade-analyzer-d57e3491720e912b4e2fd6c73f9d356901a42df5.zip |
Write transformation of program into logical formula.
Diffstat (limited to 'frontend')
-rw-r--r-- | frontend/ast_printer.ml | 6 |
1 files changed, 3 insertions, 3 deletions
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); |