diff options
author | Tim King <taking@cs.nyu.edu> | 2012-04-17 16:07:22 +0000 |
---|---|---|
committer | Tim King <taking@cs.nyu.edu> | 2012-04-17 16:07:22 +0000 |
commit | ccd77233892ace44fd4852999e66534d1c2283ea (patch) | |
tree | a856cacd24508a5839fcdbe728583ff055b64e34 /src/context | |
parent | 9644b6e12fbd3b649daafa43c5400d272e27bfb4 (diff) |
Merges branches/arithmetic/atom-database r2979 through 3247 into trunk. Below is a highlight of the changes:
- This introduces a new normal form to arithmetic.
-- Equalities and disequalities are in solved form.
Roughly speaking this means: (= x (+ y z)) is in normal form.
(See the comments in normal_form.h for what this formally requires.)
-- The normal form for inequality atoms always uses GEQ and GT instead of GEQ and LEQ.
Integer atoms always use GEQ.
- Constraint was added to TheoryArith.
-- A constraint is a triple of (k x v) where:
--- k is the type of the constraint (either LowerBound, UpperBound, Equality or Disequality),
--- x is an ArithVar, and
--- v is a DeltaRational value.
-- Constraints are always attached to a ConstraintDatabase.
-- A Constraint has its negation in the ConstraintDatabase [at least for now].
-- Every constraint belongs to a set of constraints for each ArithVar sorted by the delta rational values.
-- This set can be iterated over and provides efficient access to other constraints for this variable.
-- A literal may be attached to a constraint.
-- Constraints with attached literals may be marked as being asserted to the theory (sat context dependent).
-- Constraints can be propagated.
-- Every constraint has a proof (sat context dependent).
-- Proofs can be explained for either conflicts or propagations (if the node was propagated). (These proofs may be different.)
-- Equalities and disequalities can be marked as being split (user context dependent)
- This removes and replaces:
-- src/theory/arith/arith_prop_manager.*
-- src/theory/arith/atom_database.*
-- src/theory/arith/ordered_set.h
- Added isZero(), isOne() and isNegativeOne() to Rational and Integer.
- Added operator+ to CDList::const_iterator.
- Added const_iterator to CDQueue.
- Changes to regression tests.
Diffstat (limited to 'src/context')
-rw-r--r-- | src/context/cdlist.h | 10 | ||||
-rw-r--r-- | src/context/cdqueue.h | 10 | ||||
-rw-r--r-- | src/context/cdtrail_queue.h | 6 |
3 files changed, 25 insertions, 1 deletions
diff --git a/src/context/cdlist.h b/src/context/cdlist.h index c22d617b0..9d7709589 100644 --- a/src/context/cdlist.h +++ b/src/context/cdlist.h @@ -384,6 +384,16 @@ public: /** Prefix decrement */ const_iterator& operator--() { --d_it; return *this; } + /** operator+ */ + const_iterator operator+(long signed int off) const { + return const_iterator(d_it + off); + } + + /** operator+ */ + const_iterator operator+(long unsigned int off) const { + return const_iterator(d_it + off); + } + // Postfix operations on iterators: requires a Proxy object to // hold the intermediate value for dereferencing class Proxy { diff --git a/src/context/cdqueue.h b/src/context/cdqueue.h index d8f6c42f1..b43217cfe 100644 --- a/src/context/cdqueue.h +++ b/src/context/cdqueue.h @@ -151,6 +151,16 @@ public: return ParentType::d_list[ParentType::d_size - 1]; } + typedef typename ParentType::const_iterator const_iterator; + + const_iterator begin() const { + return ParentType::begin() + d_iter; + } + + const_iterator end() const { + return ParentType::end(); + } + };/* class CDQueue<> */ }/* CVC4::context namespace */ diff --git a/src/context/cdtrail_queue.h b/src/context/cdtrail_queue.h index 3f6887d29..94d758ced 100644 --- a/src/context/cdtrail_queue.h +++ b/src/context/cdtrail_queue.h @@ -80,11 +80,15 @@ public: d_iter = d_iter + 1; } - const T& operator[](size_t index){ + const T& operator[](size_t index) const{ Assert(index < d_list.size()); return d_list[index]; } + size_t size() const{ + return d_list.size(); + } + };/* class CDTrailQueue<> */ }/* CVC4::context namespace */ |