Skip to content

Commit

Permalink
Fix an OPNF bug that was uncovered by speedChess.
Browse files Browse the repository at this point in the history
There was a non-deterministic bug causing the AssignmentIterator to
sometimes try to fill in a variable using a function that wasn't
really a function (because the variable was in the conjunct
multiple times).
  • Loading branch information
AlexLandau committed May 29, 2014
1 parent cfbadf7 commit e6d1f27
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -482,6 +482,9 @@ private GdlVariable getBestVariable(GdlSentence functionalSentence,
&& varsToAssign.contains(term))
candidateVars.add((GdlVariable) term);
}
//TODO: Should we just generate the candidate vars with a call to getProducibleVars?
Set<GdlVariable> producibleVars = functionInfo.getProducibleVars(functionalSentence);
candidateVars.retainAll(producibleVars);
//Now we look at the domains, trying to find the largest
GdlVariable bestVar = null;
int bestDomainSize = 0;
Expand Down

0 comments on commit e6d1f27

Please sign in to comment.