Skip to content
Snippets Groups Projects
Commit 6a5b1b67 authored by Etienne Kneuss's avatar Etienne Kneuss
Browse files

Reintroduce luckytests fix two problems arising from parallelism of task dispatching

parent 45985e1b
No related branches found
No related tags found
No related merge requests found
...@@ -447,7 +447,7 @@ class FairZ3Solver(context : LeonContext) extends Solver(context) with AbstractZ ...@@ -447,7 +447,7 @@ class FairZ3Solver(context : LeonContext) extends Solver(context) with AbstractZ
foundAnswer(Some(false), core = z3CoreToCore(solver.getUnsatCore)) foundAnswer(Some(false), core = z3CoreToCore(solver.getUnsatCore))
case Some(true) => case Some(true) =>
//reporter.info("SAT WITHOUT Blockers") //reporter.info("SAT WITHOUT Blockers")
if (Settings.luckyTest && !forceStop && false) { if (Settings.luckyTest && !forceStop) {
// we might have been lucky :D // we might have been lucky :D
val (wereWeLucky, cleanModel) = validateAndDeleteModel(solver.getModel, entireFormula, varsInVC) val (wereWeLucky, cleanModel) = validateAndDeleteModel(solver.getModel, entireFormula, varsInVC)
if(wereWeLucky) { if(wereWeLucky) {
......
...@@ -142,15 +142,19 @@ class AndOrGraph[AT <: AOAndTask[S], OT <: AOOrTask[S], S](val root: OT, val cos ...@@ -142,15 +142,19 @@ class AndOrGraph[AT <: AOAndTask[S], OT <: AOOrTask[S], S](val root: OT, val cos
} }
def unsolvable(l: AndTree) { def unsolvable(l: AndTree) {
triedAlternatives += l.task -> alternatives(l.task) if (alternatives contains l.task) {
alternatives -= l.task triedAlternatives += l.task -> alternatives(l.task)
alternatives -= l.task
if (alternatives.isEmpty) {
isUnsolvable = true if (alternatives.isEmpty) {
parent.unsolvable(this) isUnsolvable = true
} else { if (parent ne null) {
updateMin() parent.unsolvable(this)
}
} else {
updateMin()
}
} }
} }
......
...@@ -15,7 +15,7 @@ abstract class AndOrGraphSearch[AT <: AOAndTask[S], ...@@ -15,7 +15,7 @@ abstract class AndOrGraphSearch[AT <: AOAndTask[S],
def collectFromAnd(at: g.AndTree, costs: List[Int]) { def collectFromAnd(at: g.AndTree, costs: List[Int]) {
val newCosts = at.minCost.value :: costs val newCosts = at.minCost.value :: costs
if (!at.isSolved) { if (!at.isSolved && !at.isUnsolvable) {
at match { at match {
case l: g.Leaf => case l: g.Leaf =>
collectLeaf(WL(l, newCosts.reverse)) collectLeaf(WL(l, newCosts.reverse))
...@@ -30,7 +30,7 @@ abstract class AndOrGraphSearch[AT <: AOAndTask[S], ...@@ -30,7 +30,7 @@ abstract class AndOrGraphSearch[AT <: AOAndTask[S],
def collectFromOr(ot: g.OrTree, costs: List[Int]) { def collectFromOr(ot: g.OrTree, costs: List[Int]) {
val newCosts = ot.minCost.value :: costs val newCosts = ot.minCost.value :: costs
if (!ot.isSolved) { if (!ot.isSolved && !ot.isUnsolvable) {
ot match { ot match {
case l: g.Leaf => case l: g.Leaf =>
collectLeaf(WL(l, newCosts.reverse)) collectLeaf(WL(l, newCosts.reverse))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment