Reasoner
A reasoner (a.k.a. semantic reasoner, reasoning engine, rules engine, business rules engine, solver) is a special type of software application that is build to infer logical consequences from a set of asserted facts or axioms or rules.
To understand what a reasoner is, it helps to understand the difference between imperative programming and declarative programming.
You can understand the difference between imperative and declarative by, say, thinking of how a self driving car might work. There are perhaps two approaches to giving instructions to a self driving car to, say, get to the airport:
- Using an imperative approach you're telling the car "Turn right at the next light, then go straight for two miles, then turn left..." You're giving step-by-step instructions, the algorithm, to get from where you are to the airport.
- Using a declarative approach you're telling the car "Take me to the airport." The car figures out the best route, handles the turns, and gets you there. Using this approach you separate the logic and the control. (Algorithm = Logic + Control)
One advantage of declarative programming is that the declarative rules are separated from the software code. This can make it easier to maintain business rules and can make those business rules reusable by different processes. This is why the Business Rules Manifesto suggests that business rules be declarative.
There tends to be a spectrum of reasoning approaches which are summarized below; note that each approach has a basket of advantages and disadvantages you need to be aware of in order to pick the right approach:
- Sequential: Sequential reasoning is when someone puts the rules in a specific order or sequence and then software executes that sequence or "chain" of logic. The chain of logic provides the "reasoning" and the rules must be executed in that specific order.
- Forward Chaining: This reasoning approach starts with a known set of facts and applies inference rules to extract more information until a specific goal is reached. This approach is an information driven reasoning model and can satisfy any use case. For example, in an expert system for medical diagnosis, forward chaining can be used to infer possible diseases from observed symptoms.
- Backward Chaining: This reasoning approach starts with a goal and works backward to determine which facts must be true in order to achieve that stated goal. This approach is a goal-driven reasoning model. This chaining model is very efficient for certain types of use cases; but it does not work for other types of use cases (meaning forward chaining can do everything that backward chaining can do; but backward chaining CANNOT DO certain tasks that only forward chaining can do). For example, in a troubleshooting system, backward chaining helps identify the cause of a problem by starting with the issue and tracing back to possible sources.
- Hybrid: A hybrid reasoner might combined aspects of forward chaining and backward chaining together to leverage the strengths and avoid weaknesses of the different reasoning approaches.
- Deterministic: A deterministic rules engine refers to a specialized software system that applies a set of predefined rules to input data, always producing the same output for the same input. This means that there is no randomness or uncertainty involved in the decision-making process (reasoning). A deterministic rules engine follows some strict, fixed logic where each rule has a clear cause-and-effect relationship, ensuring consistent outcomes based on the given set of area of knowledge specific rules. This type of rules engine may forgo both forward chaining and backward chaining and instead use that domain specific language approach to describe the operating logic of the engine.
Comments
Post a Comment