Rabobank-Archive / rule-engine

A rule engine supporting forward chaining
MIT License
47 stars 5 forks source link

Checking and skipping outputs already in context #72

Closed jhkuperus closed 8 years ago

jhkuperus commented 8 years ago

From the beginning, we've been reasoning with the notion of being able to fixate any value in a series of derivation. If you want to skip a part of a calculation, simply set the Fact you know to a value and it will not be recomputed.

However, the engine did not actually support this... 😨 This PR actually corrects this behaviour and explicitly checks whether the current output is already set before even a condition is triggered. The debug runner also outputs this status in its trace by adding this message: Output exists in context, skipping.

jhkuperus commented 8 years ago

🎉 Yay for breakfast PRs 😄