Ernest,
Thanks for fixing the "second call to query returns empty enum" problem in
60a3 but now my queries with back-chaining patterns have stopped working.
The following script works in 60a2 but not in 60a3:
(deffacts data
(foo blue red)
(foo blue pink)
(foo red blue)
(foo blue blue)
(foo orange yellow)
(foo orange black)
)
(do-backward-chaining bar)
(defrule do-bar
(need-bar ?X ?Y)
=>
(assert (bar ?X ?Y))
)
(defquery search
(declare (variables ?X))
(foo ?X ?Y)
(bar ?X ?Y)
)
(defrule find-orange
(initial-fact)
=>
(bind ?e (run-query search orange))
(facts)
(while (?e hasMoreElements)
(bind ?t (call ?e nextElement))
(bind ?f1 (call ?t fact 1))
(bind ?f2 (call ?t fact 2))
(printout t (call ?f1 toString) " "
(call ?f2 toString) crlf)
)
)
(reset)
(run)
********************************************
Here's my output (working 60a2 followed by non-working 60a3):
Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.
C:\>echo %classpath%
.;C:\jess60a2
C:\>java -version
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
C:\>cd jess60a2
C:\Jess60a2>java jess.Main
Jess, the Java Expert System Shell
Copyright (C) 1998 E.J. Friedman Hill and the Sandia Corporation
Jess Version 6.0a2 7/20/2000
Jess> (batch FooQuery.clp)
f-0 (initial-fact)
f-1 (foo blue red)
f-2 (foo blue pink)
f-3 (foo red blue)
f-4 (foo blue blue)
f-5 (foo orange yellow)
f-6 (foo orange black)
f-8 (need-bar orange yellow)
f-9 (need-bar orange black)
f-10 (bar orange black)
f-11 (bar orange yellow)
For a total of 11 facts.
(foo orange black) (bar orange black)
(foo orange yellow) (bar orange yellow)
1
Jess> (exit)
***********************************
C:\>cd jess60a3
C:\Jess60a3>echo %classpath%
.;C:\jess60a3
C:\Jess60a3>java jess.Main
Jess, the Java Expert System Shell
Copyright (C) 1998 E.J. Friedman Hill and the Sandia Corporation
Jess Version 6.0a3 1/25/2001
Jess> (batch FooQuery.clp)
f-0 (initial-fact)
f-1 (foo blue red)
f-2 (foo blue pink)
f-3 (foo red blue)
f-4 (foo blue blue)
f-5 (foo orange yellow)
f-6 (foo orange black)
f-8 (need-bar orange yellow)
f-9 (need-bar orange black)
For a total of 9 facts.
3
Jess> (exit)
---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list (use your own address!) List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------