Artificial Intelligence - Generative

Production Introduction

  • The term " production " was first proposed by the American mathematician Post in 1943. According to the string replacement rules , he proposed a calculation model called Post machine, and each rule in the model is called a production. Therefore, production representation is also called production rule representation .
  • In 1965, Newell and Simon in the United States established a cognitive model using this principle. In the same year, when Stanford University designed the first expert system DENDRAL, it adopted the structure of the production system.

production expression

knowledge of deterministic rules

  • Basic form: IF P THEN Q or: P → Q
  • Example: IF the animal flies AND lays eggs THEN the animal is a bird

Knowledge of Uncertainty Rules

  • Basic form: IF P THEN Q (confidence level) or: P → Q (confidence level)
  • Example: IF Fever THEN Cold (0.6)

deterministic factual knowledge

  • A triple means: (object, attribute, value) or: (relationship, object1, object2)
  • Example: Lao Li's age is 40 years old: (Li, age, 40)
    • Lao Li and Lao Wang are friends: (friend, Li, Wang)

Uncertain factual knowledge

  • Quads representing: (object, attribute, value, confidence) or: (relationship, object1, object2, confidence)
  • Example: Lao Li's age is likely to be 40 years old: (Li, age, 40, 0.8 )
    • Lao Li and Lao Wang are unlikely to be friends: (friend, Li, Wang, 0.1 )

thinking questions

The difference between production and implication in predicate logic

  • Implications can only represent precise knowledge , and the logical value is true or false, while productions can also represent uncertain knowledge ; during reasoning, exact matching is not required .
  • The implication itself is a predicate formula and has a truth value , while the production has no truth value .

production system

Components of a production system

insert image description here

Rule Base RB (Rule Base)

  • The rule base is used to describe the production set of knowledge in a certain field , including the transformation rules that transform the problem from the initial state to the target state (or solution state). It is the core of the expert system .

Comprehensive database DB (Data Base)

  • The comprehensive database is also called the fact library , which is used to store the initial facts input, the facts input from the external database , the intermediate results (facts) and the work area of ​​the final results . is dynamic .

Inference Engine

  • The reasoning engine is a program or a group of programs used to control and coordinate the operation of the rule base and the comprehensive database, including reasoning methods and control strategies . Decide what rules to choose or how to apply them.

three steps

Usually there are 3 steps from selecting a rule to executing an action: matching , conflict resolution , and action .

  • Matching : Matching is to compare the facts in the current comprehensive database with the conditions in the rules , and if they match, this rule is called a matching rule .
  • Conflict resolution : When there are multiple matching rules , the rule selected by the conflict resolution policy to be executed in the operation part is called the enabling rule . There are many conflict resolution strategies, among which specificity sorting, rule sorting, scale sorting and nearest sorting are common conflict resolution strategies.
  • Action : An action is the operational part of a rule that executes . After the operation, the current comprehensive database will be modified, and other rules may become enabled rules.

production system reasoning

  • Forward reasoning : Starting from the known facts , the conclusion is obtained through the rule base .
  • Reverse reasoning : Starting from the goal (as a hypothesis) , use the rules in reverse to obtain known facts .
  • Two-way reasoning : Two-way reasoning is a way of reasoning that combines forward reasoning and reverse reasoning. The reasoning is carried out simultaneously from two directions until the results of the two directions on a certain intermediate interface match, and then it ends successfully.

Example of a generative system - animal recognition system

insert image description here


rule base


insert image description here


insert image description here


demo


insert image description here


insert image description here


production notation

Features of production notation

insert image description here

Examples of production notation

insert image description here
insert image description here
insert image description here

Reflection Questions: Farmer, Fox, Goose, and Grains of Wheat

insert image description here
insert image description here
insert image description here
insert image description here

Guess you like

Origin blog.csdn.net/qq_45902301/article/details/125431435