CS440/ECE448: Intro to Artificial Intelligence � Thursday ʼ s key concepts � Combining CSP search and inference: � Lecture 7: Ordering variables (minimum remaining value, degree heuristics) � Propositional logic � Ordering values (forward checking, MAC) � � Global constraints: � Prof. Julia Hockenmaier � Constraint hypergraph; auxiliary variables � juliahmr@illinois.edu � Continuous domains: � http://cs.illinois.edu/fa11/cs440 � bounds consistency � � � CS440/ECE448: Intro AI � 2 � � � Path consistency Global (n-ary) constraints: and arc consistency � Constraint Hypergraph � X is arc consistent with respect to Y if for TWO � every value of X there exists some value of + TWO � Y such that C(X,Y) is satisfied. � = FOUR � � F � T � U � W R � O � X and Y are path consistent with respect to Z if for every pair of values of X and Y that satisfy C(X, Y), there exists some value of Z such that C(X,Z) and C(Y,Z) is satisfied. � C 1000 � C 100 � C 10 � � � CS440/ECE448: Intro AI � 3 � CS440/ECE448: Intro AI � 4 � �
Propositional logic � Syntax: What is the language of well-formed formulas of propositional logic? � Propositional logic � Semantics: What is the interpretation of a well-formed formula in propositional logic? Inference rules and algorithms: How can we reason with propositional logic? � � Syntax: the building blocks � Syntax: well-formed formulas � Variables: � p | q | r | … ! Atomic | Complex � WFF Constants: ⊤ (true) , ⊥ (false) � Atomic � � ! Constant | Variable �� ! Atomic | (Complex) � WFF’ Unary connectives: � � ¬ (negation) Complex � ! ¬ WFF’ | Binary connectives: ∧ (conjunction) WFF’ ∧ WFF’ | ∨ (disjunction) WFF’ ∨ WFF’ | ! (implication) � WFF’ ! WFF’ � � �
Interpretation ⟦ ! ⟧ v of ! � Semantics: truth values � The interpretation ⟦ " ⟧ v of a well-formed formula " Interpretation of constants : ⟦⊤⟧ v = true, ⟦⊥⟧ v = false under a model v is a truth value: Interpretation of variables defined by v ⟦ p ⟧ v = v(p) � ⟦ " ⟧ v ∈ {true, false}. Interpretation of connectives given by truth tables � A model (=valuation) v is a complete* assignment if… ….then: if… ….then: of truth values to variables: ⟦ p ⟧ v ⟦ ¬p ⟧ v ⟦ p ⟧ v ⟦ q ⟧ v ⟦ p ∧ q ⟧ v ⟦ p ∨ q ⟧ v ⟦ p ! q ⟧ v v(p) = true v(q) = false, … � true false true true true true true *each variable is either true or false � false true true false false true false With n variables, there are 2 n different models � � false true false true true Models of " ( ʻ M( " )’ ): set of models where " is true � false false false false true � � Validity and satisfiability � " is valid in a model m (‘m ⊨ " ’) iff m ∈ M( " ) = the model m satisfies " � � ( " is true in m ) � � Inference in � " is valid (‘ ⊨ " ’) iff ∀ m: m ∈ M( " ) propositional logic � ( " is true in all possible models. " is a tautology.) � " is satisfiable iff ∃ m: m ∈ M( " ) ( " is true in at least one model, M( " ) # ∅ ) �
Entailment � Logical equivalence � " is equivalent to $ (‘ " ≡ $ ’) iff M( " ) = M( $ ) � Definition: " entails $ (‘ " ⊨ $ ’) iff M( " ) ⊆ M( $ ) ≡ $ ∨ " " ∨ $ Commutativity � Entailment is monotonic: ≡ $ ∧ " " ∧ $ If " ⊨ $ , then " ∧ % ⊨ $ for any % ( " ∨ $ ) ∨ % ≡ " ∨ ( $ ∨ % ) Associativity � Proof: M( " ∧ % ) ⊆ M( " ) ⊆ M( $ ) ( " ∧ $ ) ∧ % ≡ " ∧ ( $ ∧ % ) " ∨ ( $ ∧ % ) ≡ ( " ∨ $ ) ∧ ( " ∨ % ) Distributivity � � We also write " , % ⊨ $ or { " , % } ⊨ $ for " ∧ % ⊨ $ " ∧ ( $ ∨ % ) ≡ ( " ∧ $ ) ∨ ( " ∧ % ) Entailment and implication � More logical equivalences � " entails $ (‘ " ⊨ $ ’) iff " ! $ is valid ¬ ( " ∨ $ ) ≡ ¬ " ∧ ¬ $ DeMorgan � ( ⊨ " ! $ ) � ¬ ( " ∧ $ ) ≡ ¬ " ∨ ¬ $ � Proof: � ≡ ¬ " ∨ $ If v ∈ M( " ): ⟦ " ⟧ v = true by definition. � " ! $ Implication � So ⟦ " ! $ ⟧ v = true only if ⟦ $ ⟧ v = true (v ∈ M( $ )) � elimination Thus, v ∈ M( " ) implies v ∈ M( $ ). � ≡ ¬ $ ! ¬ " " ! $ Contraposition � If v ∉ M( " ): ⟦ " ⟧ v = false by definition. � � So ⟦ " ! $ ⟧ v = true regardless of ⟦ $ ⟧ v � Thus, when v ∉ M( " ), v ∈ M( $ ) or v ∉ M( $ ). �
Biconditional (equivalence) " � Literals and clauses � We can also define a binary connective " : � Literal: p, ¬ p, q, ¬ q, � � an atomic formula, or a negated atomic " " $ ≡ ( " ! $ ) ∧ ( $ ! " ) formula � ≡ (¬ " ∨ $ ) ∧ (¬ $ ∨ " ) � ≡ ((¬ " ∨ $ ) ∧ ¬ $ ) Clause: p, ¬ p, p ∨ q, ¬ q ∨ p, � ∨ (¬ " ∨ $ ) ∧ " ) a literal (= unit clause), or a disjunction of ≡ ((¬ " ∧ ¬ $ ) ∨ ( $ ∧ ¬ $ )) literals � ∨ ((¬ " ∧ " ) ∨ ( $ ∧ " )) � � �≡ (¬ " ∧ ¬ $ ) ∨ ( $ ∧ " ) CS440/ECE448: Intro AI � 17 � Normal Forms � Inference in propositional logic � Every formula " in propositional logic has We often have prior domain knowledge. � two equivalent normal forms: � � � Given a knowledge base KB = { & 1 , …, & n } Conjunctive Normal Form (CNF) (a set of formulas that are true), how do we a conjunction of clauses � know " is valid given KB ? � " ≡ (p 11 ∨… ∨ p 1n ) ∧ (p 21 ∨… ∨ p 2m ) ∧ … � � � Validity: KB ⊨ " ( shorthand for & 1 ⋀ … ⋀ & n ⊨ " ) � Disjunctive Normal Form (DNF) Satisfiability: ∃ m: m ∈ M(KB) ⋀ m ∈ M( " ) a disjunction of conjoined literals � ( M(KB) shorthand for M( & 1 ⋀ … ⋀ & n ) � " ≡ (q 11 ∧… ∧ q 1n ) ∨ (q 21 ∧… ∧ q 2m ) ∨ … � � � �
Inference rules � Inference in propositional logic � How do we know whether " is valid Modus ponens � " ! $ " or satisfiable given KB? � '''''''''''''''' � $ Model checking: (semantic inference) � Enumerate all models for KB and " . � And-elimination � � " ⋀ $ Theorem proving: (syntactic inference) � '''''''''' Use inference rules to derive " from KB. � $ � � Inference rules: equivalences � Theorem proving as search � Proving " from KB: � ≡ $ ∨ " " ∨ $ Commutativity � � ≡ $ ∧ " " ∧ $ � States: sets of formulas that are true. � � � Initial state: KB � As inference rules: � � Goal state: any state that contains " � � � " ∨ $ $ ∨ " " ∧ $ $ ∧ " Actions : a set of inference rules � '''' '''' '''' ''''' � $ ∨ " " ∨ $ $ ∧ " " ∧ $
Inference procedures � The resolution rule � A procedure P that derives " from KB… � Unit resolution: � KB ⊢ P " p 1 ∨… ∨ p i-1 ∨ p i ∨ p i+1 ∨… ∨ p n ¬ p i � � '''''''''''''''''''''''''''' p 1 ∨… ∨ p i-1 ∨ p i+1 ∨… ∨ p n …is sound if it only derives valid sentences: � Full resolution: � if KB ⊢ P " , then KB ⊨ " (soundness) � � p 1 ∨… ∨…∨ p i ∨ …∨ …∨ p n q 1 ∨… ∨…∨ ¬ p i ∨ …∨ …∨ q m '''''''''''''''''''''''''''''''' …is complete if it derives any valid p 1 ∨ … ∨ p n ∨ q 1 ∨… ∨…∨ q m sentence: � � if KB ⊨ " , then KB ⊢ P " � Final step: factoring (remove any duplicate literals (completeness) � from the result A ∨ A ≡ A) � � � Proof by contradiction � A resolution algorithm � How do we prove that " ⊨ $ ? Goal: prove " ⊨ $ ’ by showing that " ∧ ¬ $ is not satisfiable ( false ) � " entails $ (‘ " ⊨ $ ’) iff " ∧ ¬ $ not satisfiable. � � Observation: Proof: � Resolution derives a contradiction ( false ) " ∧ ¬ $ not satisfiable iff ⊨ ¬ ( " ∧ ¬ $ ) � ⊨ ¬ ( " ∧ ¬ $ ). Assume � � if it derives the empty clause: � ⊨ ¬ " ∨ $ ) � p i ¬ p i �⊨ " ! $ . � � � � � ''''''' Thus, ¬ ( " ∧ ¬ $ ) ≡ " ! $ . ∅� � � CS440/ECE448: Intro AI � 28 �
Recommend
More recommend