knowledge base
a set of sentences. - inference:deriving new sentences from old - TELL: add new sentences to the knowledge base - ASK: a way to query what is known. The standard names for these operations
Generic KB-Based Agent
Similar to agents with internal states.
Agent must be able to: - Represent stats and actions; - Incorporate new percepts; - Update internal representation of the world; - Deduce hidden properties of the world; - Deduce appropriate actions.
logic
- Syntax: what expressions are legal
Semantics: what legal expression mean
- entailment: α β if and only if, in every model in which α is true, β is also true.
- Models: M(alpha) = set of all models of alpha: alpha beta if and only if M(alpha) M(beta)
- Soundness: An inference algorithm that derives only entailed sentences is called sound or truth- preserving.
Completeness: an inference algorithm is complete if it can derive any sentence that is entailed.
Propositional logic:
- Syntax:
- sematic:
- ¬P is true iff P is false in m.
- P ∧ Q is true iff both P and Q are true in m.
- P ∨ Q is true iff either P or Q is true in m.
- P ⇒ Q is true unless P is true and Q is false in m.
- P ⇔ Q is true iff P and Q are both true or both false in m.
Truth tables (model checking)
P | Q | PQ | PQ | |||
---|---|---|---|---|---|---|
False | False | True | True | False | True | True |
False | True | True | False | True | True | False |
True | False | False | False | True | False | False |
True | True | False | True | True | True | True |
- True table enumeration algorithm is sound and complete
- Time: , n symbols
- Space:
Standard logical equivalences: α≡β if and only if α |= β and β |= α - (α ∧ β) ≡ (β ∧ α) commutativity of ∧ - (α ∨ β) ≡ (β ∨ α) commutativity of ∨ - ((α ∧ β) ∧ γ) ≡ (α ∧ (β ∧ γ)) associativity of ∧ - ((α ∨ β) ∨ γ) ≡ (α ∨ (β ∨ γ)) associativity of ∨ - ¬(¬α) ≡ α double-negation elimination - (α ⇒ β) ≡ (¬β ⇒ ¬α) contraposition - (α ⇒ β) ≡ (¬α ∨ β) implication elimination - (α ⇔ β) ≡ ((α ⇒ β) ∧ (β ⇒ α)) biconditional elimination - ¬(α ∧ β) ≡ (¬α ∨ ¬β) De Morgan - ¬(α ∨ β) ≡ (¬α ∧ ¬β) De Morgan - (α ∧ (β ∨ γ)) ≡ ((α ∧ β) ∨ (α ∧ γ)) distributivity of ∧ over ∨ - (α ∨ (β ∧ γ)) ≡ ((α ∨ β) ∧ (α ∨ γ)) distributivity of ∨ over ∧
Theorem proving
- A sentence is valid if it is true in all models
- Deduction theorem: for any sentences α and β, α β if and only if the sentence (α ⇒ β) is valid.
- A sentence is satisfiable if it is true in, or satisfied by, some model. α |= β if and only if the sentence (α ∧ ¬β) is unsatisfiable.
- Modus Ponens: whenever any sentences of the form α ⇒ β and α are given, then the sentence β can be inferred.
- And-Elimination:
- monotonicity: the set of entailed sentences can only increase as information is added to the knowledge base. $ if KB then KB $
unit clause, where clause is a disjunction of literals:
- conjunctive normal form:A sentence expressed as a conjunction of clauses
Resolution Algorithm:
12345678910function PL-Resolution(KB, a) returns true or falseclauses = the set of clauses in the CNF representation of KB and not anew = {}loop dofor each Ci, Cj in clauses doresolvents = PL-Resolution(Ci, Cj)If resolvents contains the empty clause return truenew = new U resolventsif new belongs to clauses then return falseclauses = clauses U new