Hi!
> Second, while adding rule(s) and/or fact(s), I want to fire the rule at
any time and want to stop the rule engine.
I'm not sure why exactly you want to do this. But below I've summed up some
basic principles ...
> What I'm not clear is how to use "reset", "run", and "halt".
Let's see what (reset) does:
- All facts are removed from the fact list
- A special fact called (initial-fact) is asserted
- Facts defined by deffacts statements are asserted
You thus need to call (reset) before you do something else that depends on
any of the effects described above.
Some rules depend on the existence of (initial-fact). These are, among
others, the ones with no LHS:
(defrule has-empty-lhs
=>
(do-something-after-engine-has-been-reset))
Clearly, when you use the deffacts construct, this only works when using
(reset) correctly.
Calling (run) fires all activated rules. It stops automatically when no
activations are left. So, saying
(run)
(halt)
doesn't really make sense. You'd have to call (halt) on a rule's RHS to
make a difference.
When you've played around with Jess a bit, you can also have a look at
(run-until-halt). But that requires multi-threading, so you'd need to be
familiar with these issues, too.
Greetings, Thomas
+-------------------------------------------------------------+
| This message may contain confidential and/or privileged |
| information. If you are not the addressee or authorized to |
| receive this for the addressee, you must not use, copy, |
| disclose or take any action based on this message or any |
| information herein. If you have received this message in |
| error, please advise the sender immediately by reply e-mail |
| and delete this message. Thank you for your cooperation. |
+-------------------------------------------------------------+
---------------------------------------------------------------------
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]
---------------------------------------------------------------------