summaryrefslogtreecommitdiff
path: root/src/parser/smt2/Smt2.g
diff options
context:
space:
mode:
authorAndres Noetzli <andres.noetzli@gmail.com>2019-04-16 12:11:37 -0700
committerMathias Preiner <mathias.preiner@gmail.com>2019-04-16 12:11:37 -0700
commit2f7131c81078a964a4043ef79186cdcf91951974 (patch)
tree14fe132462c8be51f19578448033acd3f08b7eff /src/parser/smt2/Smt2.g
parenta47b722aa31cdd036f83425b2a805e6a572a974b (diff)
Make bv{add,mul,and,or,xor,xnor} left-associative (#2955)
The most recent version of SMT-LIB defines bv{add,mul,and,or,xor,xnor} [0, 1] as left-associative. CVC4 treats all but bvxnor as having variable arity anyway but the arity check was too strict when using `--strict-parsing`. This commit changes the strict parsing check. For bvxnor, it adds code to the parser that expands an application of bvxnor into multiple applications of a binary bvxnor if needed. References: [0] http://smtlib.cs.uiowa.edu/theories-FixedSizeBitVectors.shtml (bvand, bvor, bvadd, bvmul) [1] http://smtlib.cs.uiowa.edu/logics-all.shtml#QF_BV (bvxor, bvxnor)
Diffstat (limited to 'src/parser/smt2/Smt2.g')
-rw-r--r--src/parser/smt2/Smt2.g3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/parser/smt2/Smt2.g b/src/parser/smt2/Smt2.g
index 5c5b87f38..00f2e944d 100644
--- a/src/parser/smt2/Smt2.g
+++ b/src/parser/smt2/Smt2.g
@@ -1886,7 +1886,8 @@ termNonVariable[CVC4::Expr& expr, CVC4::Expr& expr2]
Kind lassocKind = CVC4::kind::UNDEFINED_KIND;
if (args.size() >= 2)
{
- if (kind == CVC4::kind::INTS_DIVISION)
+ if (kind == CVC4::kind::INTS_DIVISION
+ || (kind == CVC4::kind::BITVECTOR_XNOR && PARSER_STATE->v2_6()))
{
// Builtin operators that are not tokenized, are left associative,
// but not internally variadic must set this.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback