1

I'm using PyCLIPS to integrate CLIPS in a program that should act as a ECA-Server (event-conditon-action). There are incoming events that, together with the system state, may or may not trigger rules that then emit actions on a message bus.

The system state manifests itself in form of instances whose slots are being modified depending on the incoming events.

The software is intended to be a long-lived service, but when an error occurs during the execution of a rule for example through a misnamed handler:

ERROR: [MSGFUN1] No applicable primary message-handlers found for event-handler.
[PRCCODE4] Execution halted during the actions of defrule event-rule.

The clips session becomes unresponsive to new messages. Slots are no longer updated using:

clips_instance.Send(event, event_args)

There is nothing happening in clips even with clips.DebugConfig.WatchAll() there is no debug output.

Example:

>>> import clips
>>> clips.Build("(defclass POINT (is-a USER) (slot x) (slot y))")
>>> clips_instance = clips.BuildInstance("p1","POINT","(x 3) (y 5)")
>>> clips_instance.Send("get-x","")
<Integer 3>
>>> clips_instance.Send("get-z","")
<Symbol 'FALSE'>
>>> clips_instance.Send("get-y","")
<Symbol 'FALSE'>
>>> 

Is there any possibility to avoid this or recover from this state?

Amittai Shapira
3,8351 gold badge33 silver badges56 bronze badges
asked Jun 28, 2016 at 12:05
3
  • This looks to be a very old issue: sourceforge.net/p/pyclips/discussion/390146/thread/3d9ece3a. It's likely that the EvaluationError flag is not getting reset after PyCLIPS calls into the CLIPS API, so you may be able to solve the issue by placing this line of C code into the appropriate places in the PyCLIPS code: SetEvaluationError(GetCurrentEnvironment(),FALSE); Commented Jun 30, 2016 at 23:48
  • @GaryRiley Thank you! i will look into this. So you assume the error lies in PyCLIPS not in CLIPS itself? I will update the topic of the question to reflect this. Commented Jul 4, 2016 at 7:52
  • @ FIOvO I wasn't able to figure out how to put debugging statements into PyCLIPS and rebuild it, but I think that's the issue. The error reporting and recovery mechanism in CLIPS needs an overhaul, but as things stand today wrapper classes should reset the error state after making calls that can execute CLIPS code. Commented Jul 4, 2016 at 17:23

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.