--- /dev/null
+/********************* */
+/*! \file assertion.cpp
+ ** \verbatim
+ ** Top contributors (to current version):
+ ** Tim King
+ ** This file is part of the CVC4 project.
+ ** Copyright (c) 2009-2016 by the authors listed in the file AUTHORS
+ ** in the top-level source directory) and their institutional affiliations.
+ ** All rights reserved. See the file COPYING in the top-level source
+ ** directory for licensing information.\endverbatim
+ **
+ ** \brief Theory assertions.
+ **
+ ** Theory assertions.
+ **/
+
+#include "theory/assertion.h"
+
+namespace CVC4 {
+namespace theory {
+
+std::ostream& operator<<(std::ostream& out, const Assertion& a) {
+ return out << a.assertion;
+}
+
+}/* CVC4::theory namespace */
+}/* CVC4 namespace */
--- /dev/null
+/********************* */
+/*! \file assertion.h
+ ** \verbatim
+ ** Top contributors (to current version):
+ ** Tim King
+ ** This file is part of the CVC4 project.
+ ** Copyright (c) 2009-2017 by the authors listed in the file AUTHORS
+ ** in the top-level source directory) and their institutional affiliations.
+ ** All rights reserved. See the file COPYING in the top-level source
+ ** directory for licensing information.\endverbatim
+ **
+ ** \brief The representation of the assertions sent to theories.
+ **
+ ** The representation of the assertions sent to theories.
+ **/
+
+
+#include "cvc4_private.h"
+
+#ifndef __CVC4__THEORY__ASSERTION_H
+#define __CVC4__THEORY__ASSERTION_H
+
+#include "expr/node.h"
+
+namespace CVC4 {
+namespace theory {
+
+/** Information about an assertion for the theories. */
+struct Assertion {
+ /** The assertion expression. */
+ const Node assertion;
+
+ /** Has this assertion been preregistered with this theory. */
+ const bool isPreregistered;
+
+ Assertion(TNode assertion, bool isPreregistered)
+ : assertion(assertion), isPreregistered(isPreregistered) {}
+
+ /** Convert the assertion to a TNode. */
+ operator TNode() const { return assertion; }
+
+ /** Convert the assertion to a Node. */
+ operator Node() const { return assertion; }
+
+}; /* struct Assertion */
+
+std::ostream& operator<<(std::ostream& out, const Assertion& a);
+
+}/* CVC4::theory namespace */
+}/* CVC4 namespace */
+
+#endif /* __CVC4__THEORY__ASSERTION_H */
#include "smt/command.h"
#include "smt/dump.h"
#include "smt/logic_request.h"
+#include "theory/assertion.h"
#include "theory/logic_info.h"
#include "theory/output_channel.h"
#include "theory/valuation.h"
class EqualityEngine;
}/* CVC4::theory::eq namespace */
-/**
- * Information about an assertion for the theories.
- */
-struct Assertion {
-
- /** The assertion */
- Node assertion;
- /** Has this assertion been preregistered with this theory */
- bool isPreregistered;
-
- Assertion(TNode assertion, bool isPreregistered)
- : assertion(assertion), isPreregistered(isPreregistered) {}
-
- /**
- * Convert the assertion to a TNode.
- */
- operator TNode () const {
- return assertion;
- }
-
- /**
- * Convert the assertion to a Node.
- */
- operator Node () const {
- return assertion;
- }
-
-};/* struct Assertion */
/**
- * A (oredered) pair of terms a theory cares about.
+ * A (ordered) pair of terms a theory cares about.
*/
struct CarePair {
-
- TNode a, b;
- TheoryId theory;
-
-public:
+ public:
+ const TNode a, b;
+ const TheoryId theory;
CarePair(TNode a, TNode b, TheoryId theory)
- : a(a < b ? a : b), b(a < b ? b : a), theory(theory) {}
+ : a(a < b ? a : b), b(a < b ? b : a), theory(theory) {}
- bool operator == (const CarePair& other) const {
+ bool operator==(const CarePair& other) const {
return (theory == other.theory) && (a == other.a) && (b == other.b);
}
- bool operator < (const CarePair& other) const {
+ bool operator<(const CarePair& other) const {
if (theory < other.theory) return true;
if (theory > other.theory) return false;
if (a < other.a) return true;
return b < other.b;
}
-};/* struct CarePair */
+}; /* struct CarePair */
/**
* A set of care pairs.
};/* class Theory */
std::ostream& operator<<(std::ostream& os, theory::Theory::Effort level);
-inline std::ostream& operator<<(std::ostream& out, const theory::Assertion& a);
+
inline theory::Assertion Theory::get() {
Assert( !done(), "Theory::get() called with assertion queue empty!" );
return fact;
}
-inline std::ostream& operator<<(std::ostream& out, const theory::Assertion& a) {
- return out << a.assertion;
-}
-
inline std::ostream& operator<<(std::ostream& out,
const CVC4::theory::Theory& theory) {
return out << theory.identify();