[rules-users] Sudoku example doesn't work in drools 5.1

Mark Proctor mproctor at codehaus.org
Wed Jan 19 02:35:11 EST 2011


i'd like to see sudoku redone, the example we have at the moment is 
terrible. in that it uses a different salience per rule to drive it, 
which is very bad practice.

Any takers for a more robust sudoku example, that demonstrates best 
practice?

Mark
On 19/01/2011 06:38, cafebabe wrote:
> With reference to issue https://issues.jboss.org/browse/JBRULES-2867 and
> thread "Bug in Sudoku Example - with fix"
> http://drools-java-rules-engine.46999.n3.nabble.com/Bug-in-Sudoku-Example-with-fix-td196315.html,
> sudoku example in Drools 5.1 is not working correctly.
>
> drools version: 5.1.1
>
> Although the fix in "Bug in Sudoku Example - with fix" (not
> (PossibleCellValue( row == $row, value == $value ) || ResolvedCellValue( row
> == $row, value == $value) ) ) can fix the problem, I don't understand why
> rule #6, rule #7 and rule #8 are fired before rule #3, rule #4 and rule #5
> even through rules #3, #4 and #5 have higher salience. If rules #3, #4 and
> #5 have been fired first as expected, then PossibleCellValue with same value
> as ResolvedCellValue should have been retracted (so there is no need to
> check against ResolvedCellValue in rules #6, #7 and #8)
>
> Does it mean that salience will not be always followed strictly during
> runtime? Or it is an issue to be fixed in 5.2?
>
> I understand that dependence on salience is discouraged, however without it,
> extra condition is required.





More information about the rules-users mailing list