Strange error message

Hello.  I got the following error message that I cannot make any sense of.
"Bad index 21 in call to get() on this vector: (MAIN::__not_or_test_CE)."

The rule generating the error is below, the error stack trace is after that.
If I use the (or ...) redoing two possible patient matches, it works. If I use the equivalent (test (or ...)) it gives the error message and seems to hang Jess badly.

Is this use of (test ...) legitimate, or did I stumble uppon a bug?

I am using Jess 6.

Regards,
Florian Fischer

---------------------------------------------------------------------------------------------
The rule
---------------------------------------------------------------------------------------------
(defrule topo-ATT-UPED-C-remove-patient
 ?f <- (zone-includes-patient (zone ?z&"ATT-UPED-C") (patient ?ipat))
 (not (and
           (patient (id ?ipat) (careUnitMnemo "UPED")
                    (flagCasChir ?fc) (flagTraumaRea ?ft))
; option 1 - test
;            (test (or (> ?fc 0) (> ?ft 0)) )
; option 2 - redo the matches
           (or
(patient (id ?ipat) (careUnitMnemo "UPED") (flagCasChir 1)) (patient (id ?ipat) (careUnitMnemo "UPED") (flagTraumaRea 1)) )
; end options
           (or
               ; explicit ATT-UPED
               (patient (id ?ipat) (room "ATT-UPED"))
               ; ATT-UPED is default for UPED
               (and
                    (patient (id ?ipat) (room ?r))
                    (not (zone (zonetype "room") (unit "UPED") (room ?r)) )
               )
           )
 )    )
 =>
 (printout t "(jess) Special zone " ?z " looses patient " ?ipat crlf)
 (retract ?f)
)

---------------------------------------------------------------------------------------------
The error
---------------------------------------------------------------------------------------------
Exception jess.JessException
Jess reported an error in routine ValueVector.get
       while executing (> ?_2_fc 0)
       while executing (or (> ?_2_fc 0) (> ?_2_ft 0))
       while executing 'test' CE
       while executing rule LHS (Node2)
       while executing rule LHS (Node2)
       while executing rule LHS (TEQ)
       while executing rule LHS (TECT).
Message: Bad index 21 in call to get() on this vector: (MAIN::__not_or_test_CE). Program text: ( defrule topo-ATT-UPED-C-remove-patient ?f <- ( zone-includes-patient ( zone ?z & "ATT-UPED-C" ) ( patient ?ipat ) ) ( not ( and ( patient ( id ?ipat ) ( careUnitMnemo "UPED" ) ( flagCasChir ?fc ) ( flagTraumaRea ?ft ) ) ( test ( or ( > ?fc 0 ) ( > ?ft 0 ) ) ) ( or ( patient ( id ?ipat ) ( room "ATT-UPED" ) ) ( and ( patient ( id ?ipat ) ( room ?r ) ) ( not ( zone ( zonetype "room" ) ( unit "UPED" ) ( room ?r ) ) ) ) ) ) ) = > ( printout t "(jess) Special zone " ?z " looses patient " ?ipat crlf ) ( retract ?f ) ) at line 455.
=== Stack trace:
Jess reported an error in routine ValueVector.get
       while executing (> ?_2_fc 0)
       while executing (or (> ?_2_fc 0) (> ?_2_ft 0))
       while executing 'test' CE
       while executing rule LHS (Node2)
       while executing rule LHS (Node2)
       while executing rule LHS (TEQ)
       while executing rule LHS (TECT).
Message: Bad index 21 in call to get() on this vector: (MAIN::__not_or_test_CE). Program text: ( defrule topo-ATT-UPED-C-remove-patient ?f <- ( zone-includes-patient ( zone ?z & "ATT-UPED-C" ) ( patient ?ipat ) ) ( not ( and ( patient ( id ?ipat ) ( careUnitMnemo "UPED" ) ( flagCasChir ?fc ) ( flagTraumaRea ?ft ) ) ( test ( or ( > ?fc 0 ) ( > ?ft 0 ) ) ) ( or ( patient ( id ?ipat ) ( room "ATT-UPED" ) ) ( and ( patient ( id ?ipat ) ( room ?r ) ) ( not ( zone ( zonetype "room" ) ( unit "UPED" ) ( room ?r ) ) ) ) ) ) ) = > ( printout t "(jess) Special zone " ?z " looses patient " ?ipat crlf ) ( retract ?f ) ) at line 455.
       at jess.ValueVector.get(ValueVector.java:77)
       at jess.Fact.get(Fact.java:117)
       at jess.BindingValue.resolveValue(BindingValue.java:82)
       at jess.BindingValue.numericValue(BindingValue.java:114)
       at jess.Gt.call(Funcall.java:1156)
       at jess.FunctionHolder.call(FunctionHolder.java:30)
       at jess.Funcall.execute(Funcall.java:266)
       at jess.FuncallValue.resolveValue(FuncallValue.java:33)
       at jess.Or.call(Funcall.java:1032)
       at jess.FunctionHolder.call(FunctionHolder.java:30)
       at jess.Funcall.execute(Funcall.java:266)
       at jess.FuncallValue.resolveValue(FuncallValue.java:33)
       at jess.Test1.doTest(Test1.java:88)
       at jess.NodeJoin.runTests(NodeJoin.java:131)
       at jess.NodeJoin.callNodeLeft(NodeJoin.java:115)
       at jess.NodeJoin.passAlong(NodeJoin.java:149)
       at jess.Node2.doRunTestsVaryRight(Node2.java:356)
       at jess.Node2.runTestsVaryRight(Node2.java:313)
       at jess.Node2.callNodeLeft(Node2.java:176)
       at jess.NodeJoin.passAlong(NodeJoin.java:149)
       at jess.NodeNot2.runTestsVaryRight(NodeNot2.java:45)
       at jess.Node2.callNodeLeft(Node2.java:188)
       at jess.NodeNot2.callNodeLeft(NodeNot2.java:25)
       at jess.Node1RTL.passAlong(Node1RTL.java:35)
       at jess.Node1RTL.callNodeRight(Node1RTL.java:25)
       at jess.Node1.passAlong(Node1.java:60)
       at jess.Node1TEQ.callNodeRight(Node1TEQ.java:48)
       at jess.Node1.passAlong(Node1.java:60)
       at jess.Node1TECT.callNodeRight(Node1TECT.java:38)
       at jess.Rete.updateNodes(Rete.java:973)
       at jess.ReteCompiler.addRule(ReteCompiler.java:103)
       at jess.Rete.addDefrule(Rete.java:799)
       at jess.Jesp.addARule(Jesp.java:1012)
       at jess.Jesp.doParseDefrule(Jesp.java:968)
       at jess.Jesp.parseDefrule(Jesp.java:893)
       at jess.Jesp.parseSexp(Jesp.java:149)
       at jess.Jesp.parse(Jesp.java:69)
       at jess.Rete.executeCommand(Rete.java:1413)
       at jess.Rete.executeCommand(Rete.java:1397)
at ch.hcuge.panorama.tbserver.TBJessManager.executeJessStringToString(TBJessManager.java:516) at org.apache.jsp.auth.JessConsole_jsp._jspService(org.apache.jsp.auth.JessConsole_jsp:180) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
       at java.lang.Thread.run(Thread.java:595)

--------------------------------------------------------------------
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]
--------------------------------------------------------------------

Reply via email to