Questions tagged [pyclips]

For issues relating to the PyCLIPS Python language extension module.

PyCLIPS is an extension module for the language that embeds full functionality in Python applications. This means that you can provide Python with a strong, reliable, widely used and well documented inference engine.

Resources:

23 questions
0
votes
1 answer

PyClips clips.BatchStar() and Clips (batch ...) do not work together

I have three files: 1.) A python filetest.py: import clips PATH_TO_CLP_FILE = r'd:\temp\batch_bug.clp' clips.BatchStar(PATH_TO_CLP_FILE) clips.PrintFacts() 2.) A file batch_bug.clp: (assert (asdf0)) (batch "D:\\temp\\batchbug2.clp") (assert…
langlauf.io
  • 3,009
  • 2
  • 28
  • 45
0
votes
1 answer

CLIPS (clear) command fails / throws exception in pyclips

I have a pyclips / clips program for which I wrote some unit tests using pytest. Each test case involes an initial clips.Clear() followed by the execution of real clips COOL code via clips.Load(rule_file.clp). Running each test individually works…
langlauf.io
  • 3,009
  • 2
  • 28
  • 45
0
votes
0 answers

Passing big numbers (bigger than python's int) from CLIPS to python via PyCLIPS

It seems that PyCLIPS converts very large numbers to int before translating them. See here for conversion Python -> CLIPS def _py2cl(o): """convert Python data to a well-formed tuple""" t1 = type(o) if t1 in (int, long): return…
langlauf.io
  • 3,009
  • 2
  • 28
  • 45
0
votes
1 answer

Propagating Clips Error Messages in PyClips

I'm finding it very difficult to develop with PyClips, because it appears to replace useful error messages thrown by Clips with a generic "syntax error" message. This makes debugging very laborious and practically impossible on large codebases when…
Cerin
  • 60,957
  • 96
  • 316
  • 522
0
votes
1 answer

Python function in LHS of CLIPS rule called multiple times - how to wait for a variable to contain a value?

I read here how to call a python function on the lhs of a clips rule. Now I have the following rule: (defrule python_func_lhs "comment me" (object (is-a clips_TEST_CLASS) (some_slot ?some_slot_value)) (test (eq (python-call python_print…
langlauf.io
  • 3,009
  • 2
  • 28
  • 45
0
votes
1 answer

Displaying the value of a variable in PyClips

I have been trying to print the value of a variable in PyClips without any success.Any help would be appreciated. Here is the code. Instead of "Are you observative" it prints "Are you ?name" def clips_raw_input(prompt): return…
Ingadi
  • 563
  • 1
  • 7
  • 20
0
votes
1 answer

Outputting pyCLIPS Fact-base to a file

Im using pyCLIPS and was curious if there was a way to output the entire contents of the fact-base into a new file for archiving results, analyzing past results with current ones, etc? thanks in advance
Icey370
  • 15
  • 4
0
votes
1 answer

Import .clp and add facts

I am using python and Clips to solve an issue, here is what I am trying to do: I am looking to load a .clp file from python and run it. I need to add facts based off a database as well. So the .clp file will have rules in it and I am using…
socbrian
  • 151
  • 1
  • 2
  • 8
1
2