how to understand clips c code

74 views
Skip to first unread message

aiclips

unread,
May 13, 2009, 2:23:42 AM5/13/09
to CLIPSESG
hi, to all..
I want to understand clips c code, I got c code and I want to fetch
inference engine. Please tell me how to start and understand

Xin Liu

unread,
May 13, 2009, 11:45:26 AM5/13/09
to CLIP...@googlegroups.com
Hi,

I am reading CLIPS code at the moment for a project. Here are some of my suggestions to begin with, hope they can help.

1) You need to have a basic understanding of the underline algorithm of the CLIPS inference engine, that is the Rete algorithm. I find Doorenbos' Production Matching for Large Learning Systems to be a good starter reading for understanding Rete, whose chapter 2 contains a detailed description and pseudo code of Rete's basic operations. Here is the link for that paper:


As alternatives, you can also read Charles Forgy's self-introductory paper on Rete A Fast Algorithm for the Many Pattern/Many Object Pattern Match Problem or his PhD thesis On the efficient implementation of production systems, which is long and detailed.

2) CLIPS‘ implementation of the inference engine can be broken into several modules. You need to have a general understanding of these modules to have a grasp of the whole picture. To begin with, I denote some of the modules I consider essential:

A) Module for building the Rete topology from rules, and for updating the contents of the nodes when facts are updated. This is the core of the inference engine, and you need to have a basic understanding of Rete to understand this module.

B) Module for parsing defrules and expressions, and for evaluating expressions.

C) Module for parsing deftemplates, and for parsing fact assertion & retraction.

D) Module for agenda management and rule firing.

These modules constitute the very basics of an inference engine. Other modules like memory management, I/O rerouters, are support modules for efficiency issues and code encapsulation, and at the first read you only need to know their general purposes. Yet other modules like the class module, defglobal, etc. are modules adding more features to CLIPS, you can start to understand them one by one after you have understood the core.

CLIPS comes with an architecture manual briefly explaining each module, which can be a good reference, though some information is not consistent with the newest 6.3 version. You can also check out the CLIPS' bundled Advanced Programming Guide, which has some helpful information for your understanding of the code.

Good luck! 

Rocky Liu

2009/5/13 aiclips <preeti...@gmail.com>

marshal

unread,
May 13, 2009, 2:28:08 PM5/13/09
to CLIPSESG
Xin:

That's an excellent and neat piece of information.

Thanks,
Anup.
> 2009/5/13 aiclips <preeti.141...@gmail.com>

prity sahu

unread,
May 15, 2009, 6:23:35 AM5/15/09
to CLIP...@googlegroups.com
thanks ..........
xin liu.......
I will try ...then I will contact u

--- On Wed, 5/13/09, Xin Liu <liux...@gmail.com> wrote:

From: Xin Liu <liux...@gmail.com>
Subject: Re: how to understand clips c code
To: CLIP...@googlegroups.com
Date: Wednesday, May 13, 2009, 8:45 AM

Hi,

I am reading CLIPS code at the moment for a project. Here are some of my suggestions to begin with, hope they can help.

1) You need to have a basic understanding of the underline algorithm of the CLIPS inference engine, that is the Rete algorithm. I find Doorenbos' Production Matching for Large Learning Systems to be a good starter reading for understanding Rete, whose chapter 2 contains a detailed description and pseudo code of Rete's basic operations. Here is the link for that paper:


As alternatives, you can also read Charles Forgy's self-introductory paper on Rete A Fast Algorithm for the Many Pattern/Many Object Pattern Match Problem or his PhD thesis On the efficient implementation of production systems, which is long and detailed.

2) CLIPS‘ implementation of the inference engine can be broken into several modules. You need to have a general understanding of these modules to have a grasp of the whole picture. To begin with, I denote some of the modules I consider essential:

A) Module for building the Rete topology from rules, and for updating the contents of the nodes when facts are updated. This is the core of the inference engine, and you need to have a basic understanding of Rete to understand this module.

B) Module for parsing defrules and expressions, and for evaluating expressions.

C) Module for parsing deftemplates, and for parsing fact assertion & retraction.

D) Module for agenda management and rule firing.

These modules constitute the very basics of an inference engine. Other modules like memory management, I/O rerouters, are support modules for efficiency issues and code encapsulation, and at the first read you only need to know their general purposes. Yet other modules like the class module, defglobal, etc. are modules adding more features to CLIPS, you can start to understand them one by one after you have understood the core.

CLIPS comes with an architecture manual briefly explaining each module, which can be a good reference, though some information is not consistent with the newest 6.3 version. You can also check out the CLIPS' bundled Advanced Programming Guide, which has some helpful information for your understanding of the code.

Good luck! 

Rocky Liu

2009/5/13 aiclips <preeti...@gmail.com>

Xin Liu

unread,
May 15, 2009, 8:34:52 AM5/15/09
to CLIP...@googlegroups.com
No problem.

If you have any questions, feel free to ask...

2009/5/15 prity sahu <prity_...@yahoo.com>
Reply all
Reply to author
Forward
0 new messages