2006-09-01

Naming my Rete implementation

Last Saturday, as I was making pancakes for breakfast, I saw this post. In short, Peter points out that there are no shortcuts when it comes to implementing the Rete algorithm and that my blog post was stupid and uninformed in saying that Beta Memory objects are non-useful...

and, he's right: It was stupid and uninformed. I learned that 2 days after I had written it because that was when I started to implement retractFact and removeRule and realized that those Beta Memory objects come in quite handy after all.

In a way, I'm ashamed to have shown my hubris and having been shot down in public but Peter's post actually points to a problem. I need to show you my code. After all, I intend it to be Free Software (GPL that is) but I haven't felt that publishing my code would do any good. At least not until I have something that works, even if it's slow and unfinished. the problem is that until you can see my code there's no other information than my blog posts and that's not very much...

So this week I've been working on implementing a conflict resolver, an agenda, an execution engine and all of the other bits that are not part of the Rete algorithm but still are neccessary for all of this to work. And now, I've got something that can work as a rule engine.

It's not much, it's faulty and slow but at least it shows an intent and it's something that I can work with and improve as I go along. I still have some stuff to figure out about where I should publish it but as soon as I do. I'll let you know.

I've now started reading Peter's blog regularly. He's got a lot of great info about Rule Engines there. So if you're even the least interested you should check it out.

And, oh yeah. I wanted to call the project pyRETE but it'll have to be pyTER for now since I don't know if all of the vital parts of the Rete algorithm has been implemented and/or if I've messed them up in some way.

1 kommentar:

woolfel sa...

you shouldn't feel bad about it. Honestly, most of the literature on RETE is very hard to read. Even people with PHd in computer science have lots of difficulties understanding the papers. I've read most of the major RETE papers dozens of times and I'm still discovering little details I missed in the past. It's very easy to read Forgy or doorenbos paper and get a false sense of understanding. I know I definitely did when I read it the first 10 times. For several years, I kept referring to RETE-UL paper as "one of the optimization papers" until I started to hear people refer to it as RETE/UL or RETE-UL.

I think you'll find that the more you read it and work on a your engine, many of the things doorenbos glosses over are actually very important details. Even though RETE-UL is one of the best papers, it still isn't easy and many people mistakenly misread. God knows I did.