Production rule systems have been used to define and reason about behavior of some system. A good introductory material can be found in Drools - rules engine from JBoss - documentation, chapter on Artificial intelligence.
I was wondering what could happen if such approach was applied to manage the behavior of user interface. As a basis I took redux async example, you can find out more about it at redux documentation on async stuff.
We'll make a simple idealized or data-oriented production system, there is an assumption that any triggered conditions should be executed: the consequent actions will update the agent's knowledge, removing or adding data to the working memory - in our case changing the store in terms of redux. The system stops processing when no rules can be executed anymore.
I was wondering what could happen if such approach was applied to manage the behavior of user interface. As a basis I took redux async example, you can find out more about it at redux documentation on async stuff.
We'll make a simple idealized or data-oriented production system, there is an assumption that any triggered conditions should be executed: the consequent actions will update the agent's knowledge, removing or adding data to the working memory - in our case changing the store in terms of redux. The system stops processing when no rules can be executed anymore.
For instance, given some state A user through UI can change it to B, then planner applies rules till no more rules are true and final result is being rendered to the browser.
The full source code is available.