summaryrefslogtreecommitdiff
path: root/src/theory/arith/ordered_set.h
diff options
context:
space:
mode:
authorTim King <taking@cs.nyu.edu>2010-11-15 21:15:45 +0000
committerTim King <taking@cs.nyu.edu>2010-11-15 21:15:45 +0000
commitec4e1bdba56565d6372cb19ded12c9cadc506870 (patch)
treec263b7bf2e38034885089633677513e2ceff366e /src/theory/arith/ordered_set.h
parent24b8c7f104ae9bebbbb04b973d62337c43c6adb8 (diff)
This commit merges the arith-prop-opt branch into the main trunk. This was done by way of the intermediate branch arith-prop-tmp. Both arith-prop-opt and arith-prop-tmp will now be phased out.
Diffstat (limited to 'src/theory/arith/ordered_set.h')
-rw-r--r--src/theory/arith/ordered_set.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/theory/arith/ordered_set.h b/src/theory/arith/ordered_set.h
new file mode 100644
index 000000000..fa606188a
--- /dev/null
+++ b/src/theory/arith/ordered_set.h
@@ -0,0 +1,35 @@
+#include <set>
+#include "expr/kind.h"
+#include "expr/node.h"
+#include "util/Assert.h"
+
+
+namespace CVC4 {
+namespace theory {
+namespace arith {
+
+struct RightHandRationalLT
+{
+ bool operator()(TNode s1, TNode s2) const
+ {
+ TNode rh1 = s1[1];
+ TNode rh2 = s2[1];
+ const Rational& c1 = rh1.getConst<Rational>();
+ const Rational& c2 = rh2.getConst<Rational>();
+ int cmpRes = c1.cmp(c2);
+ return cmpRes < 0;
+ }
+};
+
+typedef std::set<Node, RightHandRationalLT> OrderedSet;
+
+struct SetCleanupStrategy{
+ static void cleanup(OrderedSet* l){
+ Debug("arithgc") << "cleaning up " << l << "\n";
+ delete l;
+ }
+};
+
+}/* CVC4::theory::arith namespace */
+}/* CVC4::theory namespace */
+}/* CVC4 namespace */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback