Artificial Intelligence-Knowledge Reasoning

In this chapter, you can recall the content in Discrete and look directly at the last two final questions↓.

1. Knowledge-based Agent

The core of the knowledge-based Agent is the knowledge base KB . Some statements in the knowledge base are directly given rather than derived as axioms. Knowledge-based agents use the TELL method to add new statements to the knowledge base and use ASK queries to query what they currently know. The contents of the knowledge base should be followed each time ASK is made.

Knowledge-based Agent needs to use logical reasoning to complete the two tasks of TELL and ASK. Here are some logically related definitions:

  • Semantics: Defining the meaning of a sentence

  • Model: The model represents a possible world, for example, x+y=4. The possible model is all possible assignments of x and y.

  • Logical implication: If in every model for which a is true, b is also true, then a|b

2. Propositional logic

Symbolist artificial intelligence is a school of thought in artificial intelligence research. Symbolist artificial intelligence is based on the following assumption: Logical methods can be used to calculate symbols and their relationships, achieve logical reasoning, and determine whether the content described by the symbols is correct.

Propositional logic is a system of formal rules for reasoning about descriptive statements expressed in symbols. The relevant definitions are as follows:

  • Atomic sentence: consists of a single propositional word, each propositional word represents a true or false proposition

  • Any proposition is either true or false

  • propositional connectives

  • Logical equivalence: If two statements are true in the same model, they are logically equivalent and they imply each other.

  • Validity: A statement is valid if it is true in all models

  • Satisfiability: If a statement is true in a certain model, then the statement is satisfiable. If a statement is not true in any model, the statement is unsatisfiable.

inference rules

The main inference rules in propositional logic are as follows:

Apply inference rules

In the resolution algorithm, existing propositions are often used for reasoning, new hypotheses are added to the existing propositions, and then reasoning is continued until a specific result is obtained, which is similar to the search process. Existing propositions are known to be true in the knowledge base (KB), so these propositions are often conjoined to produce a conjunctive paradigm. For a KB, the new hypothesis is α. Try to prove that KB implies α. If it can be proved, add α to KB and continue reasoning (search). The proof is as follows:

  • Calculate the conjunctive normal form of KB and combine it with ¬α to get KB∧¬α

  • Dissolve KB∧¬α until the conjunctive normal form contains ¬α and α, proving that this formula is always false. Therefore, KB∧¬α cannot be satisfied. It is proved that KB contains α.

Forward chaining algorithm and backward chaining algorithm

  • Forward chaining algorithm: Starting from the known facts in the knowledge base, if all the premises of the implication are known, then the conclusion is added to the set of known facts

  • Reverse chaining algorithm: starting from query Q and deriving forward, the derivation target is known, and the premise is assumed to be true. If the premise is consistent with the known facts, the algorithm ends

Forward chaining is data-driven and will perform many goal-independent derivation. Backward derivation is goal-driven, and its complexity is usually less than the size of the derivation rule of the knowledge base.

3. First-order logic (predicate logic)

In predicate logic, propositions are decomposed into individuals, predicates, and quantifiers, and the basic elements are objects, relationships, and functions.

 First-order logic requires that the statement must be in conjunction normal form (CNF).

Conjunctive paradigm of first-order logic

The process of converting a first-order logical expression into conjunctive normal form is as follows:

  • eliminate implicatures

  • move ¬ inside

  • Variable standardization: rename variables with the same name

  • Eliminate existing quantifiers : directly replace them with constants that are not limited by other quantifiers, otherwise replace them with F(x), for example:

    • ∃x∀yP(x, y) removes the existential quantifier to ∀yP(C, y)

    • ∀y∃xP(x, y) removes the existential quantifier and becomes ∀yP(F(y), y). Assume that the original meaning is that there is x for any y. If x is replaced by a constant, the semantics becomes that there is for any y. The same constant c, but in actual semantics each y can have a different x. For example, the original meaning is that everyone likes an animal. If the animal x is replaced by the constant meow, the semantics becomes that everyone likes cats. , this is incorrect, so x should be replaced by f(y), which means that any person likes an animal (this animal is related to specific y).

  • Delete the universal quantifier: delete directly

  • Assign ∧ to ∨

The conclusion of first-order logic

Convert the predicate logic formula in KB to CNF. Assume that the proof target is A, dissolve the CNF in KB with ¬A until the solution is empty.


Predicate reasoning question 1

 Predicate Reasoning Question 2

a) Convert the following expressions into CNF form (10 points )

b) Express the following statements as first-order logic statements, and use the reduction algorithm to prove the conclusion. ( 10 points)

Anyone who passes the exam and wins a lottery is happy; anyone who studies hard or is lucky is lucky. He will pass the exam; anyone who is lucky will win the lottery; James is lucky but he does not study hard; therefore, James is happy.

Guess you like

Origin blog.csdn.net/Aaron503/article/details/130875165