summaryrefslogtreecommitdiff
path: root/src/theory/logic_info.cpp
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2017-11-05 11:44:21 -0600
committerGitHub <noreply@github.com>2017-11-05 11:44:21 -0600
commitbfeedc822f39875c7d54dac0a744a63c5dc838bd (patch)
treee40b13a5763652db656fad133779c61e79a03d40 /src/theory/logic_info.cpp
parent2ef8fe2eefaecdb62653d36c88169fe906512b9d (diff)
Make higher-order a flag in logic info. (#1318)
* Make higher-order a flag in logic info. * Format * Minor * Format
Diffstat (limited to 'src/theory/logic_info.cpp')
-rw-r--r--src/theory/logic_info.cpp110
1 files changed, 77 insertions, 33 deletions
diff --git a/src/theory/logic_info.cpp b/src/theory/logic_info.cpp
index 335a87501..bf1a9bf65 100644
--- a/src/theory/logic_info.cpp
+++ b/src/theory/logic_info.cpp
@@ -30,48 +30,51 @@ using namespace CVC4::theory;
namespace CVC4 {
-LogicInfo::LogicInfo() :
- d_logicString(""),
- d_theories(THEORY_LAST, false),
- d_sharingTheories(0),
- d_integers(true),
- d_reals(true),
- d_linear(false),
- d_differenceLogic(false),
- d_cardinalityConstraints(false),
- d_locked(false) {
-
+LogicInfo::LogicInfo()
+ : d_logicString(""),
+ d_theories(THEORY_LAST, false),
+ d_sharingTheories(0),
+ d_integers(true),
+ d_reals(true),
+ d_linear(false),
+ d_differenceLogic(false),
+ d_cardinalityConstraints(false),
+ d_higherOrder(true),
+ d_locked(false)
+{
for(TheoryId id = THEORY_FIRST; id < THEORY_LAST; ++id) {
enableTheory(id);
}
}
-LogicInfo::LogicInfo(std::string logicString) throw(IllegalArgumentException) :
- d_logicString(""),
- d_theories(THEORY_LAST, false),
- d_sharingTheories(0),
- d_integers(false),
- d_reals(false),
- d_linear(false),
- d_differenceLogic(false),
- d_cardinalityConstraints(false),
- d_locked(false) {
-
+LogicInfo::LogicInfo(std::string logicString) throw(IllegalArgumentException)
+ : d_logicString(""),
+ d_theories(THEORY_LAST, false),
+ d_sharingTheories(0),
+ d_integers(false),
+ d_reals(false),
+ d_linear(false),
+ d_differenceLogic(false),
+ d_cardinalityConstraints(false),
+ d_higherOrder(false),
+ d_locked(false)
+{
setLogicString(logicString);
lock();
}
-LogicInfo::LogicInfo(const char* logicString) throw(IllegalArgumentException) :
- d_logicString(""),
- d_theories(THEORY_LAST, false),
- d_sharingTheories(0),
- d_integers(false),
- d_reals(false),
- d_linear(false),
- d_differenceLogic(false),
- d_cardinalityConstraints(false),
- d_locked(false) {
-
+LogicInfo::LogicInfo(const char* logicString) throw(IllegalArgumentException)
+ : d_logicString(""),
+ d_theories(THEORY_LAST, false),
+ d_sharingTheories(0),
+ d_integers(false),
+ d_reals(false),
+ d_linear(false),
+ d_differenceLogic(false),
+ d_cardinalityConstraints(false),
+ d_higherOrder(false),
+ d_locked(false)
+{
setLogicString(logicString);
lock();
}
@@ -98,6 +101,15 @@ bool LogicInfo::isQuantified() const {
return isTheoryEnabled(theory::THEORY_QUANTIFIERS);
}
+/** Is this a higher-order logic? */
+bool LogicInfo::isHigherOrder() const
+{
+ PrettyCheckArgument(d_locked,
+ *this,
+ "This LogicInfo isn't locked yet, and cannot be queried");
+ return d_higherOrder;
+}
+
/** Is this the all-inclusive logic? */
bool LogicInfo::hasEverything() const {
PrettyCheckArgument(d_locked, *this,
@@ -571,6 +583,38 @@ void LogicInfo::arithNonLinear() {
d_differenceLogic = false;
}
+void LogicInfo::enableCardinalityConstraints()
+{
+ PrettyCheckArgument(
+ !d_locked, *this, "This LogicInfo is locked, and cannot be modified");
+ d_logicString = "";
+ d_cardinalityConstraints = true;
+}
+
+void LogicInfo::disableCardinalityConstraints()
+{
+ PrettyCheckArgument(
+ !d_locked, *this, "This LogicInfo is locked, and cannot be modified");
+ d_logicString = "";
+ d_cardinalityConstraints = false;
+}
+
+void LogicInfo::enableHigherOrder()
+{
+ PrettyCheckArgument(
+ !d_locked, *this, "This LogicInfo is locked, and cannot be modified");
+ d_logicString = "";
+ d_higherOrder = true;
+}
+
+void LogicInfo::disableHigherOrder()
+{
+ PrettyCheckArgument(
+ !d_locked, *this, "This LogicInfo is locked, and cannot be modified");
+ d_logicString = "";
+ d_higherOrder = false;
+}
+
LogicInfo LogicInfo::getUnlockedCopy() const {
if(d_locked) {
LogicInfo info = *this;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback