From 46864582756f3381cd5db3a0a977e8897fec66a7 Mon Sep 17 00:00:00 2001 From: Dejan Jovanović Date: Wed, 10 Oct 2012 19:07:16 +0000 Subject: fixing the cvc bv parser and typechecker --- src/theory/bv/kinds | 8 ++++---- src/theory/bv/theory_bv_type_rules.h | 19 ------------------- 2 files changed, 4 insertions(+), 23 deletions(-) (limited to 'src/theory') diff --git a/src/theory/bv/kinds b/src/theory/bv/kinds index 65500fe91..9dc2e66bb 100644 --- a/src/theory/bv/kinds +++ b/src/theory/bv/kinds @@ -128,10 +128,10 @@ typerule BITVECTOR_XNOR ::CVC4::theory::bv::BitVectorFixedWidthTypeRule typerule BITVECTOR_COMP ::CVC4::theory::bv::BitVectorCompRule -typerule BITVECTOR_MULT ::CVC4::theory::bv::BitVectorArithRule -typerule BITVECTOR_PLUS ::CVC4::theory::bv::BitVectorArithRule -typerule BITVECTOR_SUB ::CVC4::theory::bv::BitVectorArithRule -typerule BITVECTOR_NEG ::CVC4::theory::bv::BitVectorArithRule +typerule BITVECTOR_MULT ::CVC4::theory::bv::BitVectorFixedWidthTypeRule +typerule BITVECTOR_PLUS ::CVC4::theory::bv::BitVectorFixedWidthTypeRule +typerule BITVECTOR_SUB ::CVC4::theory::bv::BitVectorFixedWidthTypeRule +typerule BITVECTOR_NEG ::CVC4::theory::bv::BitVectorFixedWidthTypeRule typerule BITVECTOR_UDIV ::CVC4::theory::bv::BitVectorFixedWidthTypeRule typerule BITVECTOR_UREM ::CVC4::theory::bv::BitVectorFixedWidthTypeRule diff --git a/src/theory/bv/theory_bv_type_rules.h b/src/theory/bv/theory_bv_type_rules.h index 91b3a0e5d..8d8c31fa1 100644 --- a/src/theory/bv/theory_bv_type_rules.h +++ b/src/theory/bv/theory_bv_type_rules.h @@ -72,25 +72,6 @@ public: } }; -class BitVectorArithRule { -public: - inline static TypeNode computeType(NodeManager* nodeManager, TNode n, bool check) - throw (TypeCheckingExceptionPrivate, AssertionException) { - unsigned maxWidth = 0; - TNode::iterator it = n.begin(); - TNode::iterator it_end = n.end(); - // TODO: optimize unary neg - for (; it != it_end; ++ it) { - TypeNode t = (*it).getType(check); - if (check && !t.isBitVector()) { - throw TypeCheckingExceptionPrivate(n, "expecting bit-vector terms"); - } - maxWidth = std::max( maxWidth, t.getBitVectorSize() ); - } - return nodeManager->mkBitVectorType(maxWidth); - } -}; - class BitVectorFixedWidthTypeRule { public: inline static TypeNode computeType(NodeManager* nodeManager, TNode n, bool check) -- cgit v1.2.3