Add multiple rules in clipspy

188 Views Asked by At

I have been working on an expert system using clipspy recently. A problem I find is whenever I build a rule, all the previous rules are lost and only one rule can be defined. This is what I have tried.

enter image description here

If I also tried to merge two rule strs into one, and call env.build() once. It doesn't work.

enter image description here

I also tried to put these rules into a text file, and use env.load() function to load that file. However there is still one rule I can find.

I really run out of ways to define more than one rule. I am not sure if this is a bug, or maybe there is something I didn't do correctly. Any help is appreciated!

1

There are 1 best solutions below

0
On

The build function is supposed to be used on one construct at a time. Passing more than a construct to the build function will lead to only the first one being loaded into the environment.

To pass multiple constructs to the environment, simply write them down into a file and use the load function.