clipsexpert-systemrete

CLIPS- How to understand constructs-to-c output files?


I'm using constructs-to-c command in top-level to convert my constructs to c code. Till the moment I know how to use these source files as black boxes. I think in these files, CLIPS implement the RETE algorithm, right? I'd like to know how can I understand the name convention and the contents of these files? I found no explanation to this in the reference manuals. This is the only explanation I found to this point but I didn't understand a lot from the second point. I have a good understanding of RETE algorithm, though. Also is there someway to visualize the RETE network CLIPS creates for my constructs? Thanks


Solution

  • The constructs-to-c generated files are just a dump of the C data structures used to represent the CLIPS constructs, so they're not a representation of the rete algorithm but rather the data that the algorithm operates on. The naming convention used by the arrays in the generated files is designed to keep the pointer references from one array to another short and distinct--not to make them easy to read. To visualize the network you need to manually draw out the connections yourself. I'd say it's easier to do that by adding simple/single rules to CLIPS and step through the code with a debugger to see how asserts and retracts are processed.