Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python function returns immediately after any clips command #12

Closed
srajan3012 opened this issue Dec 28, 2018 · 3 comments
Closed

python function returns immediately after any clips command #12

srajan3012 opened this issue Dec 28, 2018 · 3 comments

Comments

@srajan3012
Copy link

srajan3012 commented Dec 28, 2018

;;--- KB.clp---;;
deftemplate fact_template(
   (slot slot_1 (type SYMBOL))
)

(assert (fact 1))

(defrule rule1
  (fact 1)
  =>
  ?p <- (assert (fact_template (slot_1 v_1)))
  (py_foo ?p ))
# run.py
import clips
clips_env = clips.Environment()
clips_env.load("KB.clp")

def py_foo(p):
   p['slot_1'] = 'slot_value'
   p.assertit()
   print "Done"

clips_env.define_function(py_foo)
clips_env.run()


anything after assertit() is not executed.

@noxdafox
Copy link
Owner

noxdafox commented Dec 28, 2018

Please provide a MWE which reproduces your issue. With the provided example I can't say much. What are the symbols fact_template and python_func?

@srajan3012
Copy link
Author

updated example.

@noxdafox
Copy link
Owner

noxdafox commented Dec 28, 2018

Closing this as invalid, please check issue #13 for explanation.

More precisely: you cannot change or re-assert an already asserted fact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants