Lec 1 | Knowledge Flashcards
Terms lang
Agents that reason by operating on internal representations of knowledge
Knowledge Based Agents
An assertion about the world in a knowledge representation language
Sentence
It is based on propositions; statements about the world that can be either true or false
Propositional logic
What are propositional symbols?
Propositional symbols are most often letters (P, Q, R) that are used to represent a proposition.
What are the logical connectives?
not, and, or, implication, and biconditional
Logical Connectives:
Inverses the truth value of the proposition.
Not
Logical Connectives:
Connects two different propositions
And
Logical Connectives:
It is true as long as either one of its arguments is true
Or
Logical Connectives:
Represents a structure of “if P then Q.” Where P is the antecedent and Q is called the consequent
Implication
Logical Connectives:
An implication that goes both directions. You can read it as “if and only if.”
Biconditional
It is an assignment of a truth value to every propositional symbol (a “possible world”).
Model
It is the truth-value assignment that provides information about the world.
Model
A set of sentences known by a knowledge-based agent
Knowledge Base (KB)
This is knowledge that the AI is provided about the world in the form of propositional logic sentences that can be used to make additional inferences about the world.
Knowledge Base (KB)
In every model or world in which sentence α is true, sentence β is also true
Entailment
The process of deriving new sentences
from old ones
Inference
What is the Model Checking algorithm?
To determine if KB ⊨ α (in other words, answering the question: “can we conclude that α is true based on our knowledge base”)
* Enumerate all possible models.
* If in every model where KB is true, α is true as well, then KB entails α (KB ⊨ α).
* Otherwise KB does not entail α
Is the model checking algorithm efficient?
Model Checking is not an efficient algorithm because it has to consider every possible model before giving the answer (a reminder: a query R is true if under all the models (truth assignments) where the KB is true, R is true as well).
What is the difference between the Model Checking Algorithm and the Inference Rules?
Inference rules allow us to generate new information based on existing knowledge without considering every possible model.
What are needed to run the Model Checking algorithm?
- Knowledge Base, which will be used to draw inferences
- A query, or the proposition that we are interested in whether it is entailed by the KB
- Symbols, a list of all the symbols (or atomic propositions) used (in our case, these are rain, hagrid, and dumbledore)
- Model, an assignment of truth and false values to symbols
The process of figuring out how to represent propositions and logic in AI.
Knowledge Engineering
What are the Inference Rules?
Modus Ponens, Elimination, Double Negation Elimination, Biconditional Elimination, De Morgan’s Law, and Distributive Property
Theorem Proving
- Initial state: starting knowledge base
- Actions: inference rules
- Transition model: new knowledge base after inference
- Goal test: checking whether the statement that we are trying to prove is in the KB
- Path cost function: the number of steps in the proof
A powerful inference rule that states that if one of two atomic propositions in an Or proposition is false, the other has to be true.
Resolution
What does Resolution rely on?
Complementary Literals
Two of the same atomic propositions where one is negated and the other is not, such as P and ¬P.
Complementary Literals
It is a disjunction of literals (a propositional symbol or a negation of a propositional symbol, such as P, ¬P)
Clause
Consists of propositions that are connected with an Or logical connective (P ∨ Q ∨ R)
Disjunction
Logical sentence that is a conjunction of clauses. for example: (A ∨ B ∨ C) ∧ (D ∨ ¬E) ∧ (F ∨ G)
Conjunctive Normal Form (CNF)
Consists of propositions that are connected with an And logical connective (P ∧ Q ∧ R)
Conjunctions
What are the steps in Converting Propositions to CNF?
- Eliminate biconditionals
* Turn (α ↔ β) into (α → β) ∧ (β → α). - Eliminate implications
* Turn (α → β) into ¬α ∨ β. - Move negation inwards until only literals are being negated (and not clauses), using De Morgan’s Laws.
* Turn ¬(α ∧ β) into ¬α ∨ ¬β
What process is used when a clause contains the same literal twice?
Factoring. The duplicate literal is removed.
Proof by contradiction
To determine if KB ⊨ α: Check: is (KB ∧ ¬α) a contradiction? If so, then KB ⊨ α. Otherwise, no entailment.
Another Resolution Algorithm
To determine if KB ⊨ α: - Convert (KB ∧ ¬α) to Conjunctive Normal Form. - Keep checking to see if we can use resolution to produce a new clause. - If we ever produce the empty clause (equivalent to False), a contradiction has been reached, thus proving that KB ⊨ α. - However, if contradiction is not achieved and no more clauses can be inferred, there is no entailment.
Another type of logic that allows us to express more complex ideas more succinctly than propositional logic.
First Order Logic
What are the two types of Symbols used in First Order Logic?
Constant Symbols and Predicate Symbols.
What do constant symbols represent?
objects
What are predicate symnols?
Predicate symbols are like relations or functions that take an argument and return a true or false value.
It is a tool that can be used in first order logic to represent sentences without using a specific constant symbol.
Quantification
What symbol is used in Universal Quantification?
Universal quantification uses the symbol ∀ to express “for all.”
It is an idea parallel to universal quantification.
Existential Quantification
It is used to create sentences that are true for at least one x.
Existential Quantification
What symbol is used in Existential Quantification?
It is expressed using the symbol ∃.
Can the Existential and Universal Quantification be used in the same sentence?
Yes. For example, the sentence ∀x. Person(x) → (∃y. House(y) ∧ BelongsTo(x, y)) expresses the idea that if x is a person, then there is at least one house, y, to which this person belongs. In other words, this sentence means that every person belongs to a house.
CS50 QUIZ
Consider these logical sentences:
- If Hermione is in the library, then Harry is in the library.
- Hermione is in the library.
- Ron is in the library and Ron is not in the library.
- Harry is in the library.
- Harry is not in the library or Hermione is in the library.
- Ron is in the library or Hermione is in the library.
Which of the following logical entailments is true?
- Sentence 6 entails Sentence 2
- Sentence 1 entails Sentence 4
- Sentence 6 entails Sentence 3
- Sentence 2 entails Sentence 5
- Sentence 1 entails Sentence 2
- Sentence 5 entails Sentence 6
Sentence 2 entails Sentence 5
CS50 QUIZ
There are other logical connectives that exist, other than the ones discussed in lecture. One of the most common is “Exclusive Or” (represented using the symbol ⊕). The expression A ⊕ B represents the sentence “A or B, but not both.” Which of the following is logically equivalent to A ⊕ B?
- (A ∨ B) ∧ ¬ (A ∧ B)
- (A ∧ B) ∨ ¬ (A ∨ B)
- (A ∨ B) ∧ (A ∧ B)
- (A ∨ B) ∧ ¬ (A ∨ B)
(A ∨ B) ∧ ¬ (A ∧ B)
CS50 QUIZ
Let propositional variable R be that “It is raining,” the variable C be that “It is cloudy,” and the variable S be that “It is sunny.” Which of the following a propositional logic representation of the sentence “If it is raining, then it is cloudy and not sunny.”?
- (R → C) ∧ ¬S
- R → C → ¬S
- R ∧ C ∧ ¬S
- R → (C ∧ ¬S)
- (C ∨ ¬S) → R
R → (C ∧ ¬S)
CS50 QUIZ
Consider, in first-order logic, the following predicate symbols. Student(x) represents the predicate that “x is a student.” Course(x) represents the predicate that “x is a course.” Enrolled(x, y) represents the predicate that “x is enrolled in y.” Which of the following is a first-order logic translation of the sentence “There is a course that Harry and Hermione are both enrolled in.”?
- ∃x. Course(x) ∧ Enrolled(Harry, x) ∧ Enrolled(Hermione, x)
- ∀x. Course(x) ∧ Enrolled(Harry, x) ∧ Enrolled(Hermione, x)
- ∃x. Enrolled(Harry, x) ∧ ∃y. Enrolled(Hermione, y)
- ∀x. Enrolled(Harry, x) ∧ ∀y. Enrolled(Hermione, y)
- ∃x. Enrolled(Harry, x) ∨ Enrolled(Hermione, x)
- ∀x. Enrolled(Harry, x) ∨ Enrolled(Hermione, x)
∃x. Course(x) ∧ Enrolled(Harry, x) ∧ Enrolled(Hermione, x)