Fixed bug in smtlib translation

This commit is contained in:
Guillaume Bury 2014-11-15 19:42:09 +01:00
parent 384bcb7270
commit c6dd201014
2 changed files with 5 additions and 4 deletions

View file

@ -52,7 +52,7 @@ module Fsmt = struct
let add_label _ _ = ()
let print fmt = function
| Prop i -> Format.fprintf fmt "%s%s%d" (if i < 0 then "¬ " else "") (if i mod 2 = 0 then "v" else "f") (abs i)
| Prop i -> Format.fprintf fmt "%s%s%d" (if i < 0 then "¬ " else "") (if i mod 2 = 0 then "v" else "f") ((abs i) / 2)
| Equal (a, b) -> Format.fprintf fmt "%s = %s" a b
| Distinct (a, b) -> Format.fprintf fmt "%s ≠ %s" a b

View file

@ -46,9 +46,10 @@ let left_assoc s f = function
| x :: r -> List.fold_left f x r
| _ -> raise (Bad_arity s)
let right_assoc s f = function
| x :: r -> List.fold_right f r x
| _ -> raise (Bad_arity s)
let rec right_assoc s f = function
| [] -> raise (Bad_arity s)
| [x] -> x
| x :: r -> f x (right_assoc s f r)
let translate_atom = function
| TermSpecConst(_, const) -> translate_const const