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
5
votes
1 answer

How to get a rule activation to call a python function, using PyClips

I am experimenting with PyClips and I want to integrate it tightly with Python, so that when a rule is activated, it calls a python function. Here is what I have so far: import clips def addf(a, b): return a +…
Homunculus Reticulli
  • 65,167
  • 81
  • 216
  • 341
1
vote
1 answer

module 'clips' has no attribute 'SetExternalTraceback'

We tried running this code in python 2.7 with clips - v6.3, kivy- v1.11.1. The error we are getting is on line main(sys.argv) saying "Module clips has no attribute SetExternalTraceback". And we think that this issue arises because pyclips is not…
Virti Parekh
  • 45
  • 1
  • 9
1
vote
0 answers

Python - complex questionaire with CLIPS

I have a rather large questionaire on my page right now with around 50 questions whose purpose is to see if the user could be a relevant client of mine. I want to reduce it to 5 or max 10 questions by only asking relevant questions at each step and…
Ondrej
  • 414
  • 1
  • 5
  • 13
1
vote
0 answers

Installing PyCLIPS based on CLIPS 6.30 for Windows Python 2.7 32 bit

I learned that there is a version of PyCLIPS based on CLIPS version 6.30. The same (or similar) PyCLIPS version can also be installed via pip, see here. On Linux, both approaches work fine, i.e. installing via git clone + setup.py, or via pip. On…
langlauf.io
  • 3,009
  • 2
  • 28
  • 45
1
vote
0 answers

PyCLIPS: How to recover from errors

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…
Fl0v0
  • 900
  • 11
  • 27
1
vote
2 answers

Output Multiple lines to file in Python 2.7.3

I'm currently writing a program in python with pyCLIPS. The clips module allows me to print multiple lines of output into the terminal simply by using: clips.PrintFacts() However, I would like to output this to a file to save results. I am using…
Icey370
  • 15
  • 4
1
vote
1 answer

Fact loading very slow with PyCLIPS, while fast with CLIPS

I have a rule-based system with several 100Ks of facts, and I'm getting very poor performance with PyCLIPS just for loading the facts. I've narrowed it down to a simple example with two templates and a single rule that joins them (and does nothing…
Uri Barkai
  • 90
  • 6
1
vote
1 answer

CLIPS infinite facts

I am developing an expert system which will make admission decisions using PyClips. However, the code kept generating 'out of memory' errors. I think I have isolated my problem. It is something wrong with my CLIPS file. Hoping someone can see what…
engr007
  • 51
  • 4
  • 12
1
vote
3 answers

Decorator to register Python methods in PyCLIPS

I make use of PyCLIPS to integrate CLIPS into Python. Python methods are registered in CLIPS using clips.RegisterPythonFunction(method, optional-name). Since I have to register several functions and want to keep the code clear, I am looking for a…
Lemoi
  • 149
  • 9
0
votes
1 answer

Clips Beginner: How to assign two variables to one template slot value without using multislot in pyclips

I want to insert two variable values in a string slot of a template but I am having errors. I know about the multislot but it is giving me a dictionary output like this: ('1.', '§ 2 is amended as follows:') But I want like this: 1. § 2 is amended…
ANA
  • 83
  • 5
0
votes
1 answer

"No module named _clips"after installed pyclips

I followed README to install pyclips in linux python2.7(ubuntu18),but it doesn’t work when “import clips”,like that: Traceback (most recent call last): File "", line 1, in File "clips/__init__.py", line 36, in from…
vinoz
  • 1
0
votes
3 answers

using pyclips and import clips as a python module

am using pyclips to generate the facts a nd rules of my system .. i have download every requirements for installing pyclips which include a clips directory that contatins the python files necessary for using clips inside the python code .. but when…
shaimaa
  • 1
  • 1
  • 2
0
votes
2 answers

How to use PyCLIPS for interactive sessions?

My clip file contains (printout t"text") and bind ?var (read) statements. If I run the .clp file from below C code, the program prints to console and reads my input from console as expected, thus making it an interactive session between program and…
greenlantern
  • 374
  • 1
  • 3
  • 15
0
votes
2 answers

Pyclips: Error when setting a clips class instance multislot to [ ]

I want a multislot of a class instance to become an empty list. I am not sure if there is a bug in clips or pyclips, or if I am doing it wrong. import clips C = clips.BuildClass("C", "(is-a USER)(multislot s)") i = clips.BuildInstance("test1",…
langlauf.io
  • 3,009
  • 2
  • 28
  • 45
0
votes
1 answer

Avoid pattern matching (errors) until a slot is set correctly

The LHS of a rule R_blup contains (test (>= ?s2 2)) that is, it checks if ?s2 is greater or equal to 2. ?s2 corresponds to an instance slot named s2. Unfortunately, I get the error Function >= expected argument #1 to be of type integer or float The…
langlauf.io
  • 3,009
  • 2
  • 28
  • 45
1
2