190 likes | 315 Views
CPSC 7373: Artificial Intelligence Lecture 8: Representation with Logic. Jiang Bian, Fall 2012 University of Arkansas at Little Rock. Propositional Logic. In probabilistic model, our degree of belief is the probability (NUMBER).
E N D
CPSC 7373: Artificial IntelligenceLecture 8: Representation with Logic Jiang Bian, Fall 2012 University of Arkansas at Little Rock
Propositional Logic In probabilistic model, our degree of belief is the probability (NUMBER). In propositional logic, our belief is either: TRUE, FALSE, or UNKNOWN. B E Logic Sentences: e.g., (E V B) => A; E or B implies A A => (J ^ M); A implies J and M J M; J called is Equivalent to M calls J ¬M; Logical Operators: V: OR =>: Implies ^: AND : Equivalent (Bi-condition) ¬: Negation A J M The alarm (A) might go off because of either a Burglary (B) and/or an Earthquake (E). And when the alarm (A) goes off, either John (J) and/or Mary (M) will call to report.
Propositional Logic – cond. • A propositional logic sentence is either true or false with respect to a model of the world. • A model is a set of true/false values for all the propositional symbols. • e.g., {B: True, E: False, …} • We can define the truth of the sentence in terms of the truth of the symbols with respect to the models using truth tables.
True Tables • Atruth table does is list all the possibilities for the propositional symbols, e.g.,:
Logical disjunction • OR: in propositional logic is a logical disjunction, also known as inclusive disjunction, that results in true whenever one or more of its operands are true. • e.g., "A or B" is true if A is true, or if B is true, or if both A and B are true. • In ordinary English, “or” can be either inclusive or exclusive disjunction. • e.g., "Please ring me or send an email" means "do one or the other, but not both". • e.g., "Her grades are so good that she's either very bright or studies hard"
Quiz - 1 • Whether the sentence that 5 is an odd number implies Pairs is the capital of France is true or false??? • O: 5 is an order number • P: Pairs is the capital of France • O => P True/False ??? • Whether the sentence that 5 is an even number implies Moscow is the capital of France is true or false • E: 5 is an even number • M: Moscow is the capital of France • E => M True/False ???
Quiz - 2 Under what conditions the following logic sentences are true ???
Quiz - 3 • We know the following three sentences are true: • (E V B) => A • A => (J ^ M) • B B E A J M
Terminology • A valid sentence is one that is true in every possible model, for every combination of values of the propositional symbols. • A satisfiablesentence is one that is true in some models, but not necessarily in all the models.
Propositional Logic Limitations • It can only handle True or False • No capability to handle uncertainty • Only events that are True of False • Cannot handle objects that have properties, such as size, weight, color, etc. • Cannot handle relations between objects • No shortcuts • e.g., Vacuum world with 1000 propositions
First-Order Logic So logics vary both in what you can say about the world and what you can believe about what's been said about the world. VIEW OF LOGIC REPRESNETAIONS: 1) ATOMIC: Arepresentation of the state is just an individual state with no pieces inside of it. E.g., search and problem solving 2) FACTORED: The representation of an individual state of the world is factored into several variables. 3) STRUCTURED: include relationships between objects(FIRST-ORDER LOGIC)
FIRST-ORDER LOGIC: MODEL A,1 C,3 • CONSTANTS: {A, B, C, D, 1, 2, 3} • FUNCTIONS: • NUMBER-OF: {A -> 1, B -> 3, C -> 3, D -> 2} • RELATIONS: • ABOVE: {[A, B], [C, D]} • VOWEL: {[A]} • RAINY: {} B,3 D,2
FIRST-ORDER LOGIC: SYNTAX • SENTENCES: describe facts that are true or false • VOWEL(A) • ABOVE(A,B) • 2 = 2 • OPERATORS: ^, v, ¬, =>, , () • TERMS: describe objects • A, B, 2 • x, y • NUMBER-OF(A) • QUANTIFIERS: ∀, ∃ • ∀x VOWEL(X) => NUMBER-OF(X) = 1 • ∃x NUMBER-OF(X) = 2
VACCUM WORLD • LOCATION: • A, B, V, D1, D2 • RELATIONS: • LOC • VACUUM • DIRT • AT(O, L) • e.g., • the vacuum is at location A • AT(V,A) • there's no dirt in any location • ∀d ∀l DIRT(d) ^ ¬LOC(l) => AT(d, l) • the vacuum is in a location with dirt • ∃l ∃d DIRT(d) ^ LOC(l) => AT(d, l) ^ AT(V,l) FIRST-ORDER: RELATIONS ARE ON OBJECTS, BUT NOT ON RELATIONS