I think that Brian Zhou wrote:

>> There must be a bug, either in sudoku.clp or jess 7.0b6. Shouldn't "FIRE 315
>> MAIN::cleancol" on line 1166 prevent "FIRE 316 MAIN::single_answer_col"?

>>I would really appreciate any insight into what is really happening.
>>You can try run the code.

Hi Brian,

First of all, I don't think that the bug is in Jess.  Look at this rule below from your code:

(defrule initial
?fact <- (initial-fact)
=>
(retract ?fact)
                ....

This is bad Jess karma.  Jess uses (initial-fact) for a number of housekeeping purposes.  (See docs sec 5.1 )  Now, many of your rules depend upon the (not) conditional element.  This CE depends upon (initial-fact) being in working memory (See JIA p. 111).  I commented out the retraction and added some debug code to pretty-print the other goings-on.  
 
I get:

_____________________________________
| 2 | 3 | 4 | 1 | 1 | 8 | 6 | 9 | 5 |
| 2 | 6 | 5 | 7 | 2 | 2 | 1 | 4 | - |
| 7 | 9 | 1 | 5 | 4 | 2 | 3 | - | 2 |
| 4 | 5 | 6 | 1 | 4 | - | 4 | 3 | 9 |
| 1 | 1 | 7 | 2 | 3 | 6 | 8 | 5 | 2 |
| 3 | 8 | 3 | 2 | 5 | 9 | 7 | 2 | 2 |
| 1 | 2 | 4 | 8 | 1 | 5 | 2 | 7 | 4 |
| 8 | 4 | 2 | 3 | 6 | 7 | 5 | 2 | 1 |
| 2 | 5 | 3 | 4 | 2 | 1 | 9 | 6 | 6 |
_____________________________________

Since there are still empty spaces and boxes with the same number used more than once, I'd say that there are still bugs in your rules.  Did the CalPoly code ever work?  I don't' see how it could with the busted (initial-fact) and all the (not) CEs.

My code is attached.  Hope this helps.

Cheers,
Jason

-----------------------------------------------------
Morris Technical Solutions LLC
www.morristechnicalsolutions.com
[EMAIL PROTECTED]
phone/fax: 503.692.1088

 

Attachment: mysudoku.clp
Description: Binary data

Reply via email to