}
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";
}
}
} 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);
--- /dev/null
+; EXPECT: unsat
+; COMMAND-LINE: --cegqi-si=all --no-dump-synth --nl-ext-tplanes
+(set-logic NIA)
+
+(synth-fun max ((x Int) (y Int)) Int)
+
+(declare-var x Int)
+(declare-var y Int)
+
+(constraint (>= (max x y) (* x x)))
+(constraint (>= (max x y) (* y y)))
+
+(check-synth)
--- /dev/null
+; EXPECT: unsat
+; COMMAND-LINE: --no-dump-synth --nl-ext-tplanes
+(set-logic NIA)
+
+(synth-fun max ((x Int) (y Int)) Int
+ ((Start Int (0 1 x y
+ (+ Start Start)
+ (- Start Start)
+ (* Start Start)
+ (ite StartBool Start Start)))
+ (StartBool Bool ((and StartBool StartBool)
+ (not StartBool)
+ (<= Start Start)))))
+
+(declare-var x Int)
+(declare-var y Int)
+
+(constraint (>= (max x y) (* x x)))
+(constraint (>= (max x y) (* y y)))
+
+(check-synth)