category = "regular"
long = "sygus-repair-const"
type = "bool"
- default = "false"
+ default = "true"
help = "use approach to repair constants in sygus candidate solutions"
[[option]]
std::vector<Node> candidate_values;
bool constructed_cand = false;
+ // If a module is not trying to repair constants in solutions and the option
+ // sygusRepairConst is true, we use a default scheme for trying to repair
+ // constants here.
+ if (options::sygusRepairConst() && !d_master->usingRepairConst())
+ {
+ Trace("cegqi-check") << "CegConjuncture : repair previous solution..."
+ << std::endl;
+ // have we tried to repair the previous solution?
+ // if not, call the repair constant utility
+ unsigned ninst = d_cinfo[d_candidates[0]].d_inst.size();
+ if (d_repair_index < ninst)
+ {
+ std::vector<Node> fail_cvs;
+ for (const Node& cprog : d_candidates)
+ {
+ Assert(d_repair_index < d_cinfo[cprog].d_inst.size());
+ fail_cvs.push_back(d_cinfo[cprog].d_inst[d_repair_index]);
+ }
+ d_repair_index++;
+ if (d_sygus_rconst->repairSolution(
+ d_candidates, fail_cvs, candidate_values))
+ {
+ constructed_cand = true;
+ }
+ }
+ }
+
// get the model value of the relevant terms from the master module
std::vector<Node> enum_values;
getModelValues(terms, enum_values);
lems.push_back(rlem);
}
+bool Cegis::usingRepairConst() { return d_using_gr_repair; }
+
void Cegis::getRefinementEvalLemmas(const std::vector<Node>& vs,
const std::vector<Node>& ms,
std::vector<Node>& lems)
virtual void registerRefinementLemma(const std::vector<Node>& vars,
Node lem,
std::vector<Node>& lems) override;
+ /** using repair const */
+ virtual bool usingRepairConst() override;
protected:
/** the evaluation unfold utility of d_tds */
{
return Node::null();
}
+ /**
+ * Are we trying to repair constants in candidate solutions?
+ * If we return true for usingRepairConst is true, then this module has
+ * attmepted to repair any solutions returned by constructCandidates.
+ */
+ virtual bool usingRepairConst() { return false; }
protected:
/** reference to quantifier engine */
-; COMMAND-LINE: --cegqi-si=all --sygus-out=status
+; COMMAND-LINE: --cegqi-si=all --sygus-out=status --no-sygus-repair-const
; SCRUBBER: sed -e 's/The fact in question: .*$/The fact in question: TERM/'
; EXPECT: (error "A non-linear fact was asserted to arithmetic in a linear logic.
; EXPECT: The fact in question: TERM
(assert (forall ((x Int)) (=> (= x 0) (I x))))
-(assert (forall ((x Int)) (=> (and (I x) (< x 1)) (I (+ x 1)))))
+(assert (forall ((x Int)) (=> (and (I x) (< x 6)) (I (+ x 1)))))
(assert (forall ((x Int)) (=> (I x) (<= x 10))))
; EXPECT: unsat
-; COMMAND-LINE: --sygus-out=status
+; COMMAND-LINE: --sygus-out=status --no-sygus-repair-const
(set-logic LIA)
(synth-fun f1 ((x1 Int) (x2 Int)) Int)