ulfurinn/wongi-engine — pull request #24 by carlthuringer (2014-05-26 16:42:57+00:00)
Title: Allow ncc to be searched for vars.

I was running into a problem where the NccSet came up in the compilation
of a new join node if you added a new alpha node via `has` after
declaring a NccSet in the rule DSL.

After reading the literature and code a bit, I experimented with having
the JoinNode check the children of the NccSet for the member. When that
started working, I added a `contains?` method to the NccSet.

I reasoned that it should be possible for me to add Alpha nodes at any
time in declaring the rule. It seems to me that Wongi is order-dependent
when binding variables, but the documentation and code doesn't seem to
require ordering of the different matchers so long as you introduce
variables in the order that you want to use them.

The literature was pretty difficult for me to comprehend and I don't
understnd it fully so I hope there are no edge cases introduced here
that change behavior of Alpha nodes and NCCs when adding Alpha nodes
after a NCC.

Well, the specs pass, so I hope this is acceptable. :)