expert-system

Clips matching expression is not working

hello in clips i have this template: (deftemplate cell(slot x)(slot y)(slot alive)) and this fact : (start 1 1) then i have this claus in the LHS : ?start<-(start ?x ?y) and i want to get the variable ?a1 (cell (x (+ ?x 1) )(y ?y)(alive ?a1)) it seems that it's not allowed to add to the variable "(+ ?x 1)" so how can i achive what i wan...

Modeling complex hierarchies

To gain some experience, I am trying to make an expert system that can answer queries about the animal kingdom. However, I have run into a problem modeling the domain. I originally considered the animal kingdom hierarchy to be drawn like -animal -bird -carnivore -hawk -herbivore -bluejay -mammals -carnivores ...

Using Python Functions From the Clips Expert System

Using PyClips, I'm trying to build rules in Clips that dynamically retrieve data from the Python interpreter. To do this, I register an external function as outlined in the manual. The code below is a toy example of the problem. I'm doing this because I have an application with a large corpus of data, in the form of a SQL database, whic...

Dereferencing a Slot in a Matched Fact in Clips

How do you dereference a slot in a fact matched in the LHS of a rule? If a variable matches a fact, I can't find how to create further conditions that match slots within that fact. For example, in the code below, I want to print some text if there's a fact of the form "(do (action ?action))". However, ?action is itself a fact, and I ...

What is the best language in which to write an expert system?

Is LISP or something like Jess the best choice? I'm interested in writing a program that makes a suggestion based on users' answers. Computational considerations are not really a factor this is pretty much a pattern matching engine. Also I would like to make an app for this and put it up on the web. UPDATE: I would like to put this u...

Counting Existing Facts in the RHS of Clips Rules

How do you test for fact existence in the RHS of rules in Clips? I'm trying to design a rule that will "score" the current state by counting how many goal facts exist. It's obvious how to test for facts in the LHS, but I can't find how to do the equivalent in the RHS. I want to do something like this, albeit this isn't valid Clips code:...

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 using PyClips. Consider the following example. I wrote a very large expression, which con...