Download presentation
Presentation is loading. Please wait.
Published byAleesha Pearson Modified over 9 years ago
1
Artificial Intelligence Chapter 13 The Propositional Calculus Biointelligence Lab School of Computer Sci. & Eng. Seoul National University
2
(c) 1999-2010 SNU CSE Biointelligence Lab Outline Using Constraints on Feature Values The Language Rules of Inference Definition of Proof Semantics Soundness and Completeness The PSAT Problem Other Important Topics 2
3
(c) 1999-2010 SNU CSE Biointelligence Lab 13.1 Using Constraints on Feature Values Two different methods for modeling an agent’s world 3 011101… 1111? 10000? 10000? 100 R 0? 10000? ?????? Feature-based representation : feature vectors Iconic representation E.g. maps Simulations of important aspects of the environment Sometimes called analogical representations
4
Feature based representation – descriptions of the world Binary-valued features: what is true about the world and what is not true easy to communicate In cases where the values of some features cannot be sensed directly, their values can be inferred from the values of other features using constraints (c) 1999-2010 SNU CSE Biointelligence Lab4
5
Iconic representation – simulations of certain aspects of the world data structures and computations that simulate aspects of an agent’s environment the effects of agent actions upon that environment more direct and more efficient Requires elaborate processing for construction or modification (c) 1999-2010 SNU CSE Biointelligence Lab5
6
Difficult or impossible environment to represent iconically General laws, such as “all blue boxes are pushable” Negative information, such as “block A is not on the floor” (without saying where block A is) Uncertain information, such as “either block A is on block B or block A is on block C” Some of this difficult-to-represent information can be formulated as constraints on the values of features These constraints can be used to infer the values of features that cannot be sensed directly. Reasoning inferring information about an agent’s personal state 13.1 Using Constraints on Feature Values (Cont’d) 6
7
(c) 1999-2010 SNU CSE Biointelligence Lab Applications involving reasoning Reasoning can enhance the effectiveness of agents To diagnose malfunction in various physical systems Represent the functioning of the systems by appropriate set of features Constraints among features encode physical laws relevant to the organism or device. Features associated with “causes” can be inferred from features associated with “symptoms,” Expert Systems 13.1 Using Constraints on Feature Values (Cont’d) 7
8
(c) 1999-2010 SNU CSE Biointelligence Lab Motivating example for reasoning techniques Consider a robot that is able to lift a block 13.1 Using Constraints on Feature Values (Cont’d) 8 Liftable Not Liftable Battery Causal relation diagram Moves Gauge for battery
9
Condition 1: The block is liftable Condition 2: The robot’s battery power source is adequate If both are satisfied, then when the robot tries to lift a block it is holding, its arm moves. Representing conditions by binary-valued features x 1 (BAT_OK) x 2 (LIFTABLE) x 3 (MOVES) (c) 1999-2010 SNU CSE Biointelligence Lab9 13.1 Using Constraints on Feature Values (Cont’d) x i = 0 or 1
10
Let the robot do reasoning For this we need Language – expressing constraints and values of features Inference mechanisms – performing required reasoning One possible tool for this: propositional calculus A descendant of Boolean algebra Expressing the constraint of the example in the language of the propositional calculus BAT_OK LIFTABLE MOVES (c) 1999-2010 SNU CSE Biointelligence Lab10 13.1 Using Constraints on Feature Values (Cont’d)
11
(c) 1999-2010 SNU CSE Biointelligence Lab Logic involves A language (with a syntax – what is a legal expression) Inference rule Semantics for associating elements of the language with elements of some subject matter Two logical languages that you will learn propositional calculus 13.2 Language 13.3 Rules of Inference, Ch 14. Resolution 13.5 Semantics first-order predicate calculus (FOPC) Ch 15, Ch. 16 13.1 Using Constraints on Feature Values (Cont’d) 11
12
Note on Notations In the textbook Logical expressions: typewriter font Symbols that stand for logical expressions: lowercase Greek letters α, β, γ, … (c) 1999-2010 SNU CSE Biointelligence Lab12
13
(c) 1999-2010 SNU CSE Biointelligence Lab 13.2 The Language - Elements Atoms two distinguished atoms T and F and the countably infinite set of those strings of characters that begin with a capital letter, for example, P, Q, R, …, P1, P2, ON_A_B, and so on. Connectives , , , and , called “or”, “and”, “implies”, and “not”, respectively. 13
14
13.2 The Language - Elements Syntax of well-formed formula (wff), also called sentences Any atom is a wff. If ω 1 and ω 2 are wffs, so are ω 1 ω 2 (disjunction) ω 1 ω 2 (conjunction) ω 1 ω 2 (implication) ω 1 (negation) There are no other wffs. Example: P is not a wff (c) 1999-2010 SNU CSE Biointelligence Lab14
15
(c) 1999-2010 SNU CSE Biointelligence Lab 13.2 The Language (Cont’d) Literal atoms and a sign in front of them Antecedent and Consequent In ω 1 ω 2, ω 1 is called the antecedent of the implication. ω 2 is called the consequent of the implication. Extra-linguistic separators, ( and ) group wffs into (sub) wffs according to the recursive definitions. 15
16
(c) 1999-2010 SNU CSE Biointelligence Lab 13.3 Rule of Inference Ways by which additional wffs can be produced from other ones Commonly used rules modus ponens: wff ω 2 can be inferred from the wffs ω 1 and ω 1 ω 2 introduction: wff ω 1 ω 2 can be inferred from the two wffs ω 1 and ω 2 commutativity : wff ω 2 ω 1 can be inferred from the wff ω 1 ω 2 elimination: wff ω 1 can be inferred from the ω 1 ω 2 introduction: wff ω 1 ω 2 can be inferred from either from the single wff ω 1 or from the single wff ω 2 elimination: wff ω 1 can be inferred from the wff ( ω 1 ). 16
17
(c) 1999-2010 SNU CSE Biointelligence Lab 13.4 Definitions of Proof Proof The sequence of wffs {ω 1, ω 2, …, ω n } is called a proof (or a deduction) of ω n from a set of wffs iff each ω i is either in or can be inferred from a wff earlier in the sequence by using one of the rules of inference. Theorem If there is a proof of ω n from , ω n is a theorem of the set . ㅏ ω n Denote the set of inference rules by the letter R. ㅏ R ω n ω n can be proved from using the inference rules in R 17
18
(c) 1999-2010 SNU CSE Biointelligence Lab Example Given a set, , of wffs: {P, R, P Q}, {P, P Q, Q, R, Q R} is a proof of Q R. The concept of proof can be based on a partial order. Figure 13.1 A Sample Proof Tree 18
19
(c) 1999-2010 SNU CSE Biointelligence Lab 13.5 Semantics Talking about “meanings” Semantics Has to do with associating elements of a logical language with elements of a domain of discourse. Meaning - Such associations Interpretation An association of atoms with propositions Denotation In a given interpretation, the proposition associated with an atom 19
20
(c) 1999-2010 SNU CSE Biointelligence Lab 13.5 Semantics (Cont’d) Under a given interpretation, atoms have values – True or False. Special Atom T : always has value True F : always has value False An interpretation by assigning values directly to the atoms in a language can be specified – regardless of which proposition about the world each atom denotes. 20
21
(c) 1999-2010 SNU CSE Biointelligence Lab Propositional Truth Table Given the values of atoms under some interpretation, use a truth table to compute a value for any wff under that same interpretation. Let ω 1 and ω 2 be wffs. (ω 1 ω 2 ) has True if both ω 1 and ω 2 have value True. (ω 1 ω 2 ) has True if one or both ω 1 or ω 2 have value True. ω 1 has value True if ω 1 has value False. The semantics of is defined in terms of and . Specifically, (ω 1 ω 2 ) is an alternative and equivalent form of ( ω 1 ω 2 ). 21
22
(c) 1999-2010 SNU CSE Biointelligence Lab Propositional Truth Table (Cont’d) If an agent describes its world using n features and these features are represented in the agent’s model of the world by a corresponding set of n atoms, then there are 2 n different ways its world can be. Given values for the n atoms, the agent can use the truth table to find the values of any wffs. Suppose the values of wffs in a set of wffs are given. Do those values induce a unique interpretation? Usually “No.” Instead, there may be many interpretations that give each wff in a set of wffs the value True. 22
23
(c) 1999-2010 SNU CSE Biointelligence Lab Satisfiability An interpretation satisfies a wff if the wff is assigned the value True under that interpretation. Model An interpretation that satisfies a wff In general, the more wffs that describe the world, the fewer models. Inconsistent or Unsatisfiable When no interpretation satisfies a wff, the wff is inconsistent or unsatisfiable. e.g. F or P P 23 BAT_OK LIFTABLE MOVES
24
(c) 1999-2010 SNU CSE Biointelligence Lab Validity A wff is said to be valid It has value True under all interpretations of its constituent atoms. e.g. P P T ( P P ) Q T [(P Q) P] P P (Q P) Use of the truth table to determine the validity of a wff takes time exponential in the number of atoms 24
25
(c) 1999-2010 SNU CSE Biointelligence Lab Equivalence Two wffs are said to be equivalent iff their truth values are identical under all interpretations. DeMorgan’s laws (ω 1 ω 2 ) ω 1 ω 2 (ω 1 ω 2 ) ω 1 ω 2 Law of the contrapositive (ω 1 ω 2 ) ( ω 2 ω 1 ) If ω 1 and ω 2 are equivalent, then the following formula is valid: (ω 1 ω 2 ) (ω 2 ω 1 ) abbreviated as ω 1 ω 2 25
26
(c) 1999-2010 SNU CSE Biointelligence Lab Entailment If a wff ω has value True under all of interpretations for which each of the wffs in a set has value True, logically entails ω and ω logically follows from and ω is a logical consequence of . e.g. {P} ㅑ P {P, P Q} ㅑ Q F ㅑ ω (any wff) P Q ㅑ P 26 {BAT_OK, MOVES, BAT_OK LIFTABLE MOVES} ㅑ LIFTABLE
27
Entailment & Inference Importance of entailment in AI provides a very strong way of showing that if certain propositions are true about a world, then some other propositions of interest must also be true Powerful tool for determining the truth or falsity of propositions about the world Study of the following themes are important How to represent information as wffs How to produce entailed wffs efficiently We can always to this using the truth table method Inference is an attractive substitute for entailment They are linked by the concepts of soundness and completeness (c) 1999-2010 SNU CSE Biointelligence Lab27
28
(c) 1999-2010 SNU CSE Biointelligence Lab 13.6 Soundness and Completeness If, for any set of wffs, , and wff, ω, ㅏ R ω implies ㅑ ω, the set of inference rules, R, is sound. If, for any set of wffs, , and wff, ω, it is the case that whenever ㅑ ω, there exist a proof of ω from using the set of inference rules, we say that R is complete. When inference rules are sound and complete, we can determine whether one wff follows from a set of wffs by searching for a proof (instead of by using the truth table). 28
29
(c) 1999-2010 SNU CSE Biointelligence Lab 13.6 Soundness and Completeness (Cont’d) When the inference rules are sound, if we can find a proof of ω from , ω logically follows from . When the inference rules are complete, we will eventually be able to confirm that ω follows from by using a complete search procedure to search for a proof. Substituting proof methods for truth table methods usually gives great computational advantage To determine whether or not a wff logically follows from a set of wffs or can be proved from a set of wffs is, in general, an NP-hard problem. 29
30
(c) 1999-2010 SNU CSE Biointelligence Lab 13.7 The PSAT Problem Propositional satisfiability (PSAT) problem: the problem of finding a model for a formula. Clause - a disjunction of literals Conjunctive Normal Form (CNF) A formula written as a conjunction of clauses An exhaustive procedure for solving the CNF PSAT problem is to try systematically all of the ways to assign True and False to the atoms in the formula. If there are n atoms in the formula, there are 2 n different assignments For large n, it is computationally infeasible 30 ex) BAT_OK LIFTABLE ex) (BAT_OK MOVES) (LIFTABLE MOVES)
31
(c) 1999-2010 SNU CSE Biointelligence Lab 13.7 The PSAT Problem (Cont’d) Interesting special cases of the PSAT problem 2SAT and 3SAT kSAT problem To find a model for a conjunction of clauses, the longest of which contains exactly k literals 2SAT Polynomial complexity 3SAT NP-complete Many problems take only polynomial expected time. 31
32
(c) 1999-2010 SNU CSE Biointelligence Lab 13.7 The PSAT Problem (Cont’d) GSAT (Greedy SAT) Nonexhaustive, greedy, hill-climbing type of search procedure Begin by selecting a random set of values for all of the atoms in the formula. The number of clauses having value True under this interpretation is noted. Next, go through the list of atoms and calculate, for each one, the increase in the number of clauses whose values would be True if the value of that atom were to be changed. Change the value of that atom giving the largest increase Terminated after some fixed number of changes May terminate at a local maximum 32
33
(c) 1999-2010 SNU CSE Biointelligence Lab 13.8 Other Important Topics 13.8.1 Language Distinctions The propositional calculus is a formal language that an artificial agent uses to describe its world. Possibility of confusing the informal languages of mathematics and of English with the formal language of the propositional calculus itself. {P, P Q} ㅏ Q ㅏ is not a symbol in the language of propositional calculus It is a symbol in language used to talk about the propositional calculus ㅏ, ㅑ : metalinguistic symbols Never be confused with the symbol 33
34
(c) 1999-2010 SNU CSE Biointelligence Lab 13.8.2 Metatheorems Theorems about the propositional calculus Important Theorems Deductive theorem If {ω 1, ω 2, …, ω n } ㅑ ω, (ω 1 ω 2 … ω n ) ω is valid. Vice versa Reductio ad absurdum (Latin: "reduction to the absurd") If the set has a model but { ω} does not, then ㅑ ω. 34
35
(c) 1999-2010 SNU CSE Biointelligence Lab 13.8.3 Associative Laws and Distributive Laws Associative Laws (ω 1 ω 2 ) ω 3 ω 1 ( ω 2 ω 3 ) (ω 1 ω 2 ) ω 3 ω 1 ( ω 2 ω 3 ) Distributive Laws ω 1 (ω 2 ω 3 ) (ω 1 ω 2 ) (ω 1 ω 3 ) ω 1 (ω 2 ω 3 ) (ω 1 ω 2 ) (ω 1 ω 3 ) 35
36
Appendix1: Review of the NP-family NP-hard (non-deterministic polynomial- time hard) As hard as the hardest problems in NP. Such problems need not be in NP; indeed, they may not even be decision problems. NP-complete These are the hardest problems in NP. Such a problem is NP-hard and in NP. NP-easy At most as hard as NP, but not necessarily in NP, since they may not be decision problems. NP-equivalent Exactly as difficult as the hardest problems in NP, but not necessarily in NP. (c) 1999-2010 SNU CSE Biointelligence Lab36 source: http://en.wikipedia.org/wiki/NP-hard NP is the set of all decision problems for which the 'yes'-answers have efficiently verifiable proofs of the fact that the answer is indeed 'yes'.
37
Appendix 2: GSAT Example Flip most-improving variable What if first guess is A=1, B=1, C=1? 2 clauses satisfied Flip A to 0 3 clauses satisfied Flip B to 0 all 4 clauses satisfied (pick this!) Flip C to 0 3 clauses satisfied But what if first guess is A=0, B=1, C=1? 3 clauses satisfied Flip A to 1 3 clauses satisfied Flip B to 0 3 clauses satisfied Flip C to 0 3 clauses satisfied Pick one anyway … (picking A wins on next step) (c) 1999-2010 SNU CSE Biointelligence Lab37 A v C A v B ~C v ~B ~B v ~A
38
(c) 1999-2010 SNU CSE Biointelligence Lab38
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.