From 65438 to 0972, newell and Simon developed a rule-based production system in the study of human cognitive model. At present, production representation has become the most widely used knowledge representation in artificial intelligence, especially in expert systems. Many successful expert systems adopt production knowledge representation method. The basic form of production, P→Q or IF P THEN QP, is the premise of production, also known as antecedent, which gives the premise of whether production can be used or not and consists of logical combination of facts; Q is a group of conclusions or operations, also known as the continuation of production, which points out the conclusions or actions that should be deduced when the current problem P is satisfied. If the premise p is satisfied, the conclusion q can be deduced or the operation specified by q can be performed.
The basic form of production rule
P→Q or if p then q
Examples of production rules
R6: If an animal has canine teeth and claws, and its eyes are fixed on the front.
So this animal is a carnivore.
Where r6 is the number of the production formula; "Animals have canine teeth and claws, and their eyes are fixed in front" is the premise of making formula P; "Animals are carnivores" is the conclusion of production.
The main difference between and implication:
The knowledge represented by (1) implication can only be accurate, and the knowledge represented by production can be uncertain.
The reason is that implication is a logical expression with only true and false logical values.
(2) The matching of implication must be accurate, and the resulting matching can be uncertain.
The reason is that the preconditions and conclusions can be uncertain, so its matching can also be uncertain.
The main difference between conditional statements:
(1) The structure of the front part is different.
The production precursor can be a complex structure.
The left half of the traditional programming language is just a Boolean expression.
(2) The control flow is different
Rules that meet the preconditions in the production system may not be executed immediately after being activated, but whether they can be executed depends on the conflict resolution strategy.
In traditional programming languages, it is strictly passed from one conditional statement to the next.
Production representation
edit
Production is a kind of knowledge expression, which has the same expressive ability as Turing machine.
Statement of facts and rules
Facts can be regarded as declarative sentences that assert the value of a language variable or the relationship between multiple language variables, and the value of a language variable or the relationship between language variables can be a word. Not necessarily numbers. For example, snow is white, where snow is a linguistic variable and its value is white. John likes Mary, here John and Mary are two language variables, and their relationship is like.
Generally, facts are represented by triple (object, attribute, value) or (relation, object 1, object 2), in which the object is a linguistic variable, and if uncertainty is considered, it becomes a quaternary representation (increasing reliability). The internal implementation of this representation is a table.
If the fact is "Lao Li is 35 years old", write it as (Li, 35 years old)
The fact that Lao Li and Lao Zhang are friends can be written as (friends, Li, Zhang)
For rules, it refers to the causal relationship between things, which is manifested in the following forms:
Condition->; behaviour
Conditions are antecedents or ways, and actions are called actions or consequences or conclusions. The antecedent part is often the conjunction of some facts Ai, and the conclusion is often a fact B. If uncertainty is considered, a reliability measure should be attached.
Composition and reasoning of production system
Most simple expert systems express knowledge through production, and the corresponding systems are called production systems.
Production system consists of knowledge base and inference engine. Knowledge base consists of rule base and database. Rule base is a collection of production rules, and database is a collection of facts.
Rules are expressed by production. Rule set contains the transformation rules that transform the problem from initial state to solution state, and rule base is the core of expert system. Rules can be expressed in the form of AND or or tree, and the evaluation process of this AND or OR tree based on facts in the database is reasoning.
The database contains initial facts, facts input from external databases, intermediate result facts and final result facts.
Reasoning machine is a program that controls the operation of coordination rule base and database, including reasoning mode and control strategy.
The reasoning methods of production system include forward reasoning, backward reasoning and bidirectional reasoning.
Forward Reasoning: Proceed from known facts, and draw conclusions through rule base or data-driven mode. The reasoning process is:
Match the rule antecedents in the rule set with the facts in the database to get the matched rule set.
Select a rule from the matching rule set as the usage rule.
Execute the follow-up of the usage rule. Send a copy of the usage rule to the database.
Repeat this process until the goal is achieved.
Specifically, if the database contains fact a, the rule base contains rule a->; B, then this rule is a matching rule, and then send the latter part B to the database. In this way, the database can be continuously expanded until it contains the target. If there are multiple matching rules, one of them needs to be selected as the usage rule, and different selection methods directly affect the efficiency of solution. The problem of selecting rules is called control strategy. Forward reasoning will lead to some facts that are not directly related to the goal, which is very wasteful.
Reverse reasoning: starting from the goal (as a hypothesis), using rules to obtain known facts in reverse, or the goal-driven way, the reasoning process is:
Matching the rule sequence in the rule set with the target fact to obtain a matched rule set;
Select a rule from the matched rule set as the usage rule;
Take the antecedent of the usage rule as a sub-goal;
Repeat this process until all the sub-goals are known facts.
If the goal is clear, it is more efficient to use reverse reasoning.
Two-way reasoning: use both forward reasoning and backward reasoning.
Characteristics of production characterization
The production representation format is fixed, the form is single, the rules (knowledge units) are relatively independent, and there is no direct relationship, so it is easier to establish knowledge base and deal with simpler problems. In addition, the reasoning method is simple and there is no complicated calculation. In particular, the separation of knowledge base and inference engine brings convenience to the modification of knowledge, and the inference path of the system can be easily explained without modifying the program. Therefore, the production representation of knowledge is often used as the first choice to construct expert systems.