Skip to content
Snippets Groups Projects
Commit 0bf3da19 authored by SimonGuilloud's avatar SimonGuilloud
Browse files

Corrected a bug in the equivalence checker. Due to small optimisations, part...

Corrected a bug in the equivalence checker. Due to small optimisations, part of checkForContradiction was reversing a list at one point, and expecting it not reverse at some other point.
This made the check non-sufficient.
parent e5c8bd0d
No related branches found
No related tags found
No related merge requests found
......@@ -135,7 +135,7 @@ private[fol] trait EquivalenceChecker extends FormulaDefinitions {
})
*/
def checkForContradiction(children:List[(NormalFormula, Int)]): Boolean = {
val (negatives_temp, positives) = children.foldLeft[(List[NormalFormula], List[NormalFormula])]((Nil, Nil))(
val (negatives_temp, positives_temp) = children.foldLeft[(List[NormalFormula], List[NormalFormula])]((Nil, Nil))(
(acc, ch) => acc match {
case (negatives, positives) => ch._1 match {
case NNeg(child, c) =>(child::negatives, positives)
......@@ -143,7 +143,7 @@ private[fol] trait EquivalenceChecker extends FormulaDefinitions {
}
}
)
val negatives = negatives_temp.sortBy(_.code)
val (negatives, positives) = (negatives_temp.sortBy(_.code), positives_temp.reverse)
var i, j = 0
while (i<positives.size && j<negatives.size){ //checks if there is a positive and negative nodes with same code.
val (c1, c2) = (positives(i).code, negatives(j).code)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment