diff options
Diffstat (limited to 'abstract/formula.ml')
-rw-r--r-- | abstract/formula.ml | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/abstract/formula.ml b/abstract/formula.ml index 62acb28..cb7a4c4 100644 --- a/abstract/formula.ml +++ b/abstract/formula.ml @@ -34,7 +34,7 @@ type enum_expr = type enum_op = | E_EQ | E_NE -type enum_cons = enum_op * enum_expr * enum_expr +type enum_cons = enum_op * id * enum_expr type bool_expr = (* constants *) @@ -62,10 +62,10 @@ let f_or a b = match a, b with | a, BConst false -> a | a, b -> BOr(a, b) -let f_e_eq a b = match a, b with - | EItem u, EItem v -> BConst (u = v) - | _ -> BEnumCons(E_EQ, a, b) - +let f_e_op op a b = match a, b with + | EItem i, EItem j -> BConst (if op = E_EQ then i = j else i <> j) + | EIdent x, v | v, EIdent x -> BEnumCons(op, x, v) +let f_e_eq = f_e_op E_EQ (* Write all formula without using the NOT operator *) |