21-22 KR Using Rules-Forward and Backward Reasoning
21-22 KR Using Rules-Forward and Backward Reasoning
Knowledge Representation
Using Rules
Representing Knowledge Using Rules
• Procedural vs. Declarative Knowledge
• Logic Programming
• Forward vs. backward reasoning
Introduction
• Humans are best at understanding, reasoning, and interpreting knowledge.
• Human knows things, which is knowledge and as per their knowledge they perform various
actions in the real world. But how machines do all these things comes under knowledge
representation and reasoning.
• One way to represent knowledge is by using rules that express what must happen or what
does happen when certain conditions are met.
Rules : assertions given in implicational form.
Facts : assertions that represent domain specific knowledge.
• Rules are usually expressed in the form of IF . . . THEN . . . statements, such as:
IF A THEN B
• This can be considered to have a similar logical meaning as the following: A→B
A is called the antecedent and B is the consequent in this statement-
IF <antecedent> THEN <consequent>
Rule Based Systems
• A system whose knowledge base is represented as a set of rules and facts is called a Rule
Based System Rule-based systems are based on rules that say what to DO, given various
conditions.
IF <this is the case> THEN <do this>,
• A rule-based system consists of a collection of IF-THEN rules, a collection of facts, and
some interpreter controlling the application of the rules, given the facts.
• When the antecedent part is NULL the Rule becomes a fact.
• Rules are normally represented as Horn Clause.
• A rule is triggered when all the antecedents evaluate to true.
• A rule is fired when the action stated in the consequent part or the inference related to
the consequent part is inferred / taken.
Example Rules
• If it rains today the roads will be wet today
Rains(today) à Wet-road (today)
If Rains(today) Then Wet-road(today)
Match Execute
Goal Check
Declarative and Procedural Knowledge
• Declarative knowledge involves knowing THAT something is the case –
• that J is the tenth letter of the alphabet,
• that Paris is the capital of France.
• Declarative knowledge is conscious; it can often be verbalized.
• Metalinguistic knowledge, or knowledge about a linguistic form, is declarative
knowledge.
• The system chooses a goal state and reasons in the backward direction.
• Steps:
• Firstly, the goal state and the rules are selected where the goal state reside in
the THEN part as the conclusion.
• From the IF part of the selected rule, the subgoals are made to be satisfied for
the goal state to be true.
• Set initial conditions important to satisfy all the subgoals.
• Verify whether the provided initial state matches with the established states.
If it fulfils the condition then the goal is the solution otherwise other goal
state is selected.
Key Differences Between Forward and Backward Reasoning
Objective is to find the Conclusion that must follow Facts to support the conclusions