Inference in production models. Inference engine and recursion

Lecture



The inference procedure in systems based on production models is not complicated in principle. As a rule, it includes the following parts:
  • Working memory (database) - the actual data describing the possible and current state of the subject area - stored in RAM;
  • the base of production rules containing all permissible dependencies between the facts of the subject area and stored in long-term memory;
  • inference engine.
The mechanism of inference provides for the formation of conclusions, perceiving the facts entered as elements of the rules, looking for rules that include the facts entered, and actualizing those parts of the products to which the facts entered correspond. The theoretical basis for the construction of the mechanism of logical inference is the theory of the Post machine.
The inference engine performs the functions of searching the rule base, performing operations on knowledge and obtaining conclusions. There are two ways to carry out such conclusions - direct conclusions and reverse conclusions.
Suppose there is a set of products in the form of chains of rules:
  Inference in production models.  Inference engine and recursion
  Inference in production models.  Inference engine and recursion
Direct conclusions (direct chain of reasoning) correspond to the movement from premises to consequences.
The inference engine using direct inferences chooses a fact entered into the database (working memory) as a model.   Inference in production models.  Inference engine and recursion and if, by comparison, it agrees with the premise of the rule, then the conclusion is made   Inference in production models.  Inference engine and recursion which is also placed in the database as a fact describing the state of the subject area. New results are consistently displayed, starting with the already known ones. However, the lack of a connection between facts   Inference in production models.  Inference engine and recursion and   Inference in production models.  Inference engine and recursion can lead to a breakage of the procedure and the final result   Inference in production models.  Inference engine and recursion cannot be received. This is considered the main disadvantage of direct inference mechanisms and requires the user to know the entire structure of the domain model. This deficiency is especially evident when new facts and rules are included in the knowledge base: if they are not linked to the existing facts, then they become ballast - the mechanism of logical inference will never find them. From this point of view, the use of a reverse chain of reasoning is preferable.
Reverse conclusions (reverse chain of reasoning) correspond to the movement from the goal (the fact that you want to establish) to the premises. In the reverse mechanism of inference, work begins on the goal. If the goal   Inference in production models.  Inference engine and recursion consistent with the sequential (conclusion) of the product, the antecedent (package) is taken as a sub-goal and an attempt is made to confirm the truth of this fact. The process is repeated until all the rules that have the required fact as a conclusion are reviewed.
So, in the above example, the movement from the conclusion   Inference in production models.  Inference engine and recursion leads to the need to confirm the fact   Inference in production models.  Inference engine and recursion . Fact   Inference in production models.  Inference engine and recursion can be confirmed if confirmed   Inference in production models.  Inference engine and recursion . If a   Inference in production models.  Inference engine and recursion not confirmed, the inference engine will find the rule linking   Inference in production models.  Inference engine and recursion with   Inference in production models.  Inference engine and recursion and go to the analysis of the second chain of rules. Reaching the rules   Inference in production models.  Inference engine and recursion , the system will query the database (working memory) or the user about the validity of the fact   Inference in production models.  Inference engine and recursion . If fact   Inference in production models.  Inference engine and recursion confirmed, then there is a return movement according to the rules, all the facts are updated (considered fair) and the goal is achieved successfully. Otherwise, the system clearly indicates the reason for the lack of evidence that, unlike the straightforward chain of reasoning, facilitates the user's work.
The function that implements the work of the logical inference mechanism is a recursive pattern matching procedure.
Recursion (lat. "Recurso" - I run back, I hurry back, I return) - a way to solve problems, which consists in splitting the original problem into subtasks. If the subtask is a reduced version of the original problem, then the method of its splitting and solving is identical to that applied to the original problem. Sequential splitting leads to a problem solved directly. This decision serves as the basis for solving the top-level subtask, etc., until the initial problem is solved.
An example of recursive reasoning:
How to find a lion in the desert? To do this, follow these steps:
  1. Put a fence along the perimeter of the desert (so that the lion does not run away).
  2. Catch the lion in the allocated space. If the lion is not caught,
    then go to paragraph 3, otherwise - to paragraph 5.
  3. The allocated space is divided by a fence into two equal parts.
    (double the search space).
  4. Choose one of the subspaces and go to step 2.
  5. Completion, goal achieved
In conclusion, we note that in practice, the most common mechanisms of logical inference, based on the reverse chain of reasoning. This is due to their more reliable work (almost always there is an opportunity to find a chain of reasoning from the end to the beginning) and greater productivity, which becomes especially noticeable with a large number of products.

Comments


To leave a comment
If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Knowledge Representation Models

Terms: Knowledge Representation Models