GNaive / naive-rete

Python RETE algorithm
MIT License
64 stars 35 forks source link

Fix add intracondition test #30

Closed 64kbytes closed 3 years ago

64kbytes commented 3 years ago

Should fix https://github.com/GNaive/naive-rete/issues/25

Added an intra-condition var consistency check on ConstantTestNode to fix issue on cases like ($x, A, $x)

Also created VarConsistencyTestNode to cover the cases like ($x, $x, $y) when no ConstantTestNode are instantiated

Couldn't find info on implementing this check (the rule itself not being seemingly useful) and the other option I could think of was to add a single check on AlphaMemory. Although that would cover the two cases with minimal fuss I didn't want to break the responsibilities as they are laid now.