summaryrefslogtreecommitdiff
path: root/src/parser
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2017-10-12 13:00:12 -0500
committerGitHub <noreply@github.com>2017-10-12 13:00:12 -0500
commitebd9c958a0c20e37cc0e1a79be26afd525dd8fb9 (patch)
treef53a09d9f8cba99173683ae6c43b386b6b057478 /src/parser
parent5dd102d4cb7fc8413d6e8f68b0c32c9ef06b1b17 (diff)
Sygus logics (#1226)
* Allow any smt2 logic to be a sygus logic. Add non-linear SyGuS regressions. * Minor * Add case for reals, comment. * Fix regress1.
Diffstat (limited to 'src/parser')
-rw-r--r--src/parser/smt2/smt2.cpp38
1 files changed, 16 insertions, 22 deletions
diff --git a/src/parser/smt2/smt2.cpp b/src/parser/smt2/smt2.cpp
index a186c052e..bc9f2a06f 100644
--- a/src/parser/smt2/smt2.cpp
+++ b/src/parser/smt2/smt2.cpp
@@ -365,30 +365,13 @@ void Smt2::resetAssertions() {
}
void Smt2::setLogic(std::string name) {
+
if(sygus()) {
- // sygus by default requires UF, datatypes, and LIA
+ // non-smt2-standard sygus logic names go here (http://sygus.seas.upenn.edu/files/sygus.pdf Section 3.2)
if(name == "Arrays") {
- name = "AUFDTLIA";
- } else if(name == "Reals") {
- name = "UFDTLIRA";
- } else if(name == "LIA") {
- name = "UFDTLIA";
- } else if(name == "LRA") {
- name = "UFDTLIRA";
- } else if(name == "LIRA") {
- name = "UFDTLIRA";
- } else if(name == "BV") {
- name = "UFDTBVLIA";
- } else if(name == "SLIA") {
- name = "UFDTSLIA";
- } else if(name == "SAT") {
- name = "UFDTLIA";
- } else if(name == "ALL" || name == "ALL_SUPPORTED") {
- //no change
- } else {
- std::stringstream ss;
- ss << "Unknown SyGuS background logic `" << name << "'";
- parseError(ss.str());
+ name = "A";
+ }else if(name == "Reals") {
+ name = "LRA";
}
}
@@ -398,6 +381,17 @@ void Smt2::setLogic(std::string name) {
} else {
d_logic = name;
}
+
+ // if sygus is enabled, we must enable UF, datatypes and integer arithmetic
+ if(sygus()) {
+ // get unlocked copy, modify, copy and relock
+ LogicInfo log(d_logic.getUnlockedCopy());
+ log.enableTheory(theory::THEORY_UF);
+ log.enableTheory(theory::THEORY_DATATYPES);
+ log.enableIntegers();
+ d_logic = log;
+ d_logic.lock();
+ }
// Core theory belongs to every logic
addTheory(THEORY_CORE);
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback