summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/parser/smt1/Smt1.g11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/parser/smt1/Smt1.g b/src/parser/smt1/Smt1.g
index ee4e19689..bfcd8cd4d 100644
--- a/src/parser/smt1/Smt1.g
+++ b/src/parser/smt1/Smt1.g
@@ -313,6 +313,10 @@ annotatedFormula[CVC4::Expr& expr]
expr = MK_CONST( AntlrInput::tokenToRational($RATIONAL_TOK) ); }
| n = BITVECTOR_BV_CONST '[' size = NUMERAL_TOK ']'
{ expr = MK_CONST( AntlrInput::tokenToBitvector($n, $size) ); }
+ | n = BITVECTOR1_BV_CONST
+ { unsigned int bit = AntlrInput::tokenText($n)[3] - '0';
+ expr = MK_CONST( BitVector(1, bit) );
+ }
// NOTE: Theory constants go here
/* TODO: quantifiers, arithmetic constants */
@@ -745,6 +749,13 @@ BITVECTOR_BV_CONST
: 'bv' DIGIT+
;
+/**
+ * Matches a bit-vector constant of the form bit(0|1)
+ */
+BITVECTOR1_BV_CONST
+ : 'bit0' | 'bit1'
+ ;
+
/**
* Matches an identifier from the input. An identifier is a sequence of letters,
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback