2007-02-04

A first attempt at NotNodes

I've just checked in the first, rather naive, implementation of a NotNode. It's split in two, one for inverting AlphaNodes and one for BetaNodes. I didn't do one for TestNode since you can just as easily write: Test(not foo) as Not(Test(foo)). Whether or not they are equivalent I cannot say, yet.

I should also confess that the Alpha- and BetaNotNodes work in a similar fashion. The AlphaNotNode is quite simple to explain. It simply tests the expression in the Node and propagates tokens if the expression return False. For example, Not(a==1) is the same as a != 1. The BetaNotNode however, is not so simple. It does something similar but it also propagates tokens if its bindings are not the same.

I'll have to test this behaviour to see if it's really up to standard. Luckily I've got plenty of material and examples from books, webpages and other documentation.

I've also started to clean up the code. I'm trying to enforce some form of coding standard and making sure that it's all readable and that there are no lies in the comments :-)

Inga kommentarer: