CS157 Greatest Hits The Top 100 Slides of the Course

Slides:



Advertisements
Similar presentations
Resolution Proof System for First Order Logic
Advertisements

Biointelligence Lab School of Computer Sci. & Eng.
Standard Logical Equivalences
Resolution.
Automated Reasoning Systems For first order Predicate Logic.
1 Logic Logic in general is a subfield of philosophy and its development is credited to ancient Greeks. Symbolic or mathematical logic is used in AI. In.
First Order Logic Resolution
Inference and Reasoning. Basic Idea Given a set of statements, does a new statement logically follow from this. For example If an animal has wings and.
We have seen that we can use Generalized Modus Ponens (GMP) combined with search to see if a fact is entailed from a Knowledge Base. Unfortunately, there.
Methods of Proof Chapter 7, second half.. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound)
For Friday No reading Homework: –Chapter 9, exercise 4 (This is VERY short – do it while you’re running your tests) Make sure you keep variables and constants.
1 Applied Computer Science II Resolution in FOL Luc De Raedt.
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
Propositional Logic. Grammatical Complexity A natural language is complex. E.g. –The dog chased the cat. –The dog that ate the rat chased the cat. –The.
Logic in Computer Science Transparency No Chapter 3 Propositional Logic 3.6. Propositional Resolution.
Search in the semantic domain. Some definitions atomic formula: smallest formula possible (no sub- formulas) literal: atomic formula or negation of an.
Knoweldge Representation & Reasoning
Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy.
Chapter 3 Propositional Logic
Propositional Logic Reasoning correctly computationally Chapter 7 or 8.
Mathematical Structures A collection of objects with operations defined on them and the accompanying properties form a mathematical structure or system.
Proof Systems KB |- Q iff there is a sequence of wffs D1,..., Dn such that Dn is Q and for each Di in the sequence: a) either Di is in KB or b) Di can.
Propositional Resolution Computational LogicLecture 4 Michael Genesereth Spring 2005.
Conjunctive normal form: any formula of the predicate calculus can be transformed into a conjunctive normal form. Def. A formula is said to be in conjunctive.
Propositional Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma Guadalajara
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
Logical Agents Chapter 7. Knowledge bases Knowledge base (KB): set of sentences in a formal language Inference: deriving new sentences from the KB. E.g.:
LECTURE LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare.
CS6133 Software Specification and Verification
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
1 Knowledge Based Systems (CM0377) Lecture 6 (last modified 20th February 2002)
Resolution Preliminaries Computational LogicLecture 9 By Prof. Michael Genesereth, Computer Science, Stanford Univ Spring 2005 Modified by Charles Ling.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
March 3, 2016Introduction to Artificial Intelligence Lecture 12: Knowledge Representation & Reasoning I 1 Back to “Serious” Topics… Knowledge Representation.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
2. The Logic of Compound Statements Summary
Introduction to Logic for Artificial Intelligence Lecture 2
Knowledge Representation and Reasoning
Resolution in the Propositional Calculus
The Propositional Calculus
Relational Proofs Formal proofs in Relational Logic are analogous to formal proofs in Propositional Logic. The major difference is that there are additional.
Propositional Logic.
Propositional Resolution
Artificial Intelligence: Agents and Propositional Logic.
Relational Proofs Computational Logic Lecture 8
Back to “Serious” Topics…
MA/CSSE 474 More Math Review Theory of Computation
Computer Security: Art and Science, 2nd Edition
Metatheorems Computational Logic Lecture 8
Computational Logic Lecture 13
Biointelligence Lab School of Computer Sci. & Eng.
Relational Proofs Computational Logic Lecture 7
Relational Logic Semantics
Logical Entailment Computational Logic Lecture 3
Relational Logic Computational Logic Lecture 5
Herbrand Logic Semantics
CSNB234 ARTIFICIAL INTELLIGENCE
Methods of Proof Chapter 7, second half.
Davis-Putnam Methods Computational Logic Lecture 5
Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements.
Relational Logic Semantics
Relational Proofs Computational Logic Lecture 7
Properties of Relational Logic
Properties of Relational Logic
Model Minimization Computational Logic Lecture 16
Relational Proofs Computational Logic Lecture 7
Herbrand Semantics Computational Logic Lecture 15
Propositional Logic Computational Logic Lecture 2
Resolution Preliminaries
Herbrand Logic Semantics
Presentation transcript:

CS157 Greatest Hits The Top 100 Slides of the Course Computational Logic Lecture 20 CS157 Greatest Hits The Top 100 Slides of the Course Michael Genesereth Autumn 2008

Syntax Propositional Constants: raining, snowing, cloudy Negations: raining Conjunctions: (raining  snowing) Disjunctions: (raining  snowing) Implications: (raining  cloudy) Reductions: (cloudy  raining) Equivalences: (cloudy  raining) Nesting: ((raining  snowing)  cloudy) 12/6/2018

Propositional Interpretation A propositional interpretation is an association between the propositional constants in a propositional language and the truth values T or F. 12/6/2018

Sentential Interpretation A sentential interpretation is an association between the sentences in a propositional language and the truth values T or F. pi = T (p  q)i = T qi = F (q  r)i = T ri = T ((p  q)  (q  r))i = T A propositional interpretation defines a sentential interpretation by application of operator semantics. 12/6/2018

Operator Semantics 12/6/2018

Evaluation Interpretation i: Compound Sentence (p  q)  (q  r) 12/6/2018

Truth Tables A truth table is a table of all possible interpretations for the propositional constants in a language. One column per constant. One row per interpretation. For a language with n constants, there are 2n interpretations. 12/6/2018

Properties of Sentences Valid Contingent Unsatisfiable A sentence is valid if and only if every interpretation satisfies it. A sentence is contingent if and only if some interpretation satisfies it and some interpretation falsifies it. A sentence is unsatisfiable if and only if no interpretation satisfies it. 12/6/2018

Properties of Sentences Valid Contingent Unsatisfiable  A sentences is satisfiable if and only if it is either valid or contingent. A sentences is falsifiable if and only if it is contingent or unsatisfiable.  12/6/2018

Evaluation Versus Satisfaction 12/6/2018

Logical Entailment A set of premises  logically entails a conclusion  (written as  |= ) if and only if every interpretation that satisfies the premises also satisfies the conclusion. {p} |= (p  q) {p} |# (p  q) {p, q} |= (p  q) 12/6/2018

Proof (Official Version) A proof of a conclusion from a set of premises is a sequence of sentences terminating in the conclusion in which each item is either: 1. a premise 2. An instance of an axiom schema 3. the result of applying a rule of inference to earlier items in sequence. 12/6/2018

Provability A conclusion is said to be provable from a set of premises (written  |- ) if and only if there is a finite proof of the conclusion from the premises using only Modus Ponens and the Standard Axiom Schemata. 12/6/2018

Soundness and Completeness Soundness: Our proof system is sound, i.e. if the conclusion is provable from the premises, then the premises propositionally entail the conclusion. ( |- )  ( |= ) Completeness: Our proof system is complete, i.e. if the premises propositionally entail the conclusion, then the conclusion is provable from the premises. ( |= )  ( |- ) 12/6/2018

Metatheorems Deduction Theorem:  |- (  ) if and only if {} |- . Equivalence Theorem:  |- (  ) and  |- , then it is the case that  |- . 12/6/2018

Clausal Form A literal is either an atomic sentence or a negation of an atomic sentence. p, p A clausal sentence is either a literal or a disjunction of literals. p, p, p  q A clause is a set of literals. {p}, {p}, {p,q} 12/6/2018

Conversion to Clausal Form Implications Out: Negations In: 12/6/2018

Conversion to Clausal Form Distribution Operators Out 12/6/2018

Resolution Principle General: Example: 12/6/2018

Soundness and Completeness A sentence is provable from a set of sentences by propositional resolution if and only if there is a derivation of the empty clause from the clausal form of {}. Theorem: Propositional Resolution is sound and complete, i.e.  |=  if and only if  |- . 12/6/2018

Davis Putnam Procedure function dp () {for  in vocabulary() do {var ’{}; for 1 in  for 2 in  such that   1   2 do {var ’ 1 {}  2  {}; if not tautology(’) then ’’{’}};   { |    or   }  ’}; return {if {}   then unsatisfiable else satisfiable}} function tautology() {  and   } 12/6/2018

Davis-Putnam Example {p, q, r} {q, r} {p, q, r} {q, r} {p, q, r} {r} {p, q, r} {r} {p, q, r} {} Cost = 16 + 4 + 1 = 21 resolutions 12/6/2018

Davis Putnam Logemann Loveland function dpll () {var ; if  = {} then return yes; if {}  then return no;   choose vocabulary()); if dpll(simplify(, )) return yes else return dpll(simplify(,))} 12/6/2018

simplify ({{p,q},{p,r},{r,s}}, p) = {{r},{r,s}} Simplification function simplify (, ) {var ’; for    do {if  then skip else if negation() then ’ ’  {  {negation()}} else ’ ’  {}}} Example: simplify ({{p,q},{p,r},{r,s}}, p) = {{r},{r,s}} 12/6/2018

12/6/2018

Words Variables begin with characters from the end of the alphabet (from u through z). Constants begin with digits or letters from the beginning of the alphabet (from a through t). Object constants refer to objects. Function constants denote functions. Relation constants refer to relations. There is no syntactic distinction between object, function, and relation constants. The type of each such word is determined from context. 12/6/2018

plus2(age1(father1(joe)),age1(mother1(joe))) Functional Terms A functional term is an expression formed from an n-ary function constant and n terms enclosed in parentheses and separated by commas. father1(joe) age1(joe) plus2(x,2) Functional terms are terms and so can be nested. plus2(age1(father1(joe)),age1(mother1(joe))) 12/6/2018

No! happy1(person1(joe)) No! Relational Sentences A relational sentence is an expression formed from an n-ary relation constant and n terms enclosed in parentheses and separated by commas. happy1(art) loves2(art,cathy) Relational sentences are not terms and cannot be nested in terms or relational sentences. No! happy1(person1(joe)) No! happy1(joe) person1(joe) 12/6/2018

Logical Sentences Logical sentences in Relational Logic are analogous to those in Propositional Logic. loves(art,cathy) (loves(art,betty)  loves(betty,art)) (loves(art,betty)  loves(art,cathy)) (loves(x,y)  loves(y,x)) (loves(x,y)  loves(y,x)) (loves(x,y)  loves(y,x)) Parenthesization rules are the same as for Propositional Logic. 12/6/2018

Quantified Sentences Universal sentences assert facts about all objects. x.(person(x)  mammal(x)) Existential sentence assert the existence of an object with given properties. x.(person(x)  happy(x)) Quantified sentences can be nested within other sentences. x.apple(x)  x.pear(x)) x.y.loves(x,y) 12/6/2018

Conceptualization Universe of Discourse - a set U of objects. {, } Functional Basis Set - set {f1,…,fm} of functions on U. fi: Uk  U Relational Basis Set - set {r1,…,rn} of relations on U. ri  Uk 12/6/2018

Interpretations An interpretation is a mapping from the constants of a language into elements of a conceptualization U,F,R. i: objconst  U i: funconst  F i: relconst  R The arity of the function and relation constants must match the arity of their interpretations. 12/6/2018

Variable Assignments An variable assignment for a conceptualization U,F,R is a mapping of variables into U. v: variable  U Universe of Discourse: U={, } Example: Example: v(x) =  v(x) =  v(y) =  v(y) =  v(z) =  v(z) =  12/6/2018

siv((1,…,n)=i()(siv(1),…, siv(n)) Value Assignments A value assignment siv based on interpretation i and variable assignment v is a mapping from the terms of the language into the universe of discourse that agrees with i on constants, that agrees with v on variables, and that, for functional terms, yields the result of applying the interpretation of the functional constant to the values assigned to the argument terms. siv()=i() siv()=v() siv((1,…,n)=i()(siv(1),…, siv(n)) 12/6/2018

tiv: sentence  {true, false} Truth Assignments A truth assignment tiv based on interpretation i and variable assignment v is a mapping from the sentences of the language into {true, false}. tiv: sentence  {true, false} The details of the definition are given on the following slides. 12/6/2018

Relational Sentences A truth assignment satisfies a relational sentence if and only if the tuple of objects denoted by the arguments is a member of the relation denoted by the relation constant. tiv((1,…,n)) = true if siv(1),…, siv(1)  i() = false otherwise 12/6/2018

Logical Sentences tiv() = true iff tiv() = false tiv( ) = true iff tiv() = true and tiv() = true tiv( ) = true iff tiv() = true or tiv() = true tiv( ) = true iff tiv() = false or tiv() = true tiv( ) = true iff tiv() = true or tiv() = false tiv( ) = true iff tiv() = tiv() 12/6/2018

Versions A version w[x] of a variable assignment w is the variable assignment that agrees with w on all variables except , which is assigned the value x. w[x]() = w() w[x]() = x 12/6/2018

Quantified Sentences A universally quantified sentence is true in interpretation I and variable assignment v if and only if the scope is true for I and every version of v. tiw(. )=true iff tiw[x]()=true for all x|i|. An existentially quantified sentence is true in interpretation I and variable assignment v if and only if the scope is true for I and some version of v. tiw(v. )=true iff tiw[x]()=true for some x|i|. 12/6/2018

HHHHerbrand The Herbrand universe for a set of sentences in Relational Logic (with at least one object constant) is the set of all ground terms that can be formed from just the constants used in those sentences. If there are no object constants, then we add an arbitrary object constant, say a. The Herbrand base for a set of sentences is the set of all ground atomic sentences that can be formed using just the constants in the Herbrand universe. 12/6/2018

Herbrand Theorem Herbrand Theorem: A set of quantifier-free sentences in Relational Logic is satisfiable if and only if it has a Herbrand model. 12/6/2018

Modus Ponens 12/6/2018

Universal Generalization Rule of Inference Examples: p(x) p(x)  q(x) x.p(x) x.(p(x)  q(x)) 12/6/2018

Standard Axiom Schemata II:   (  ) ID: (  (  ))  ((  )  (  )) CR: (  )  ((  )  ) (  )  ((  )  ) EQ: (  )  (  ) (  )  (  ) (  )  ((  )  (  )) OQ: (  )  (  ) (  )  (  ) (  )  (  ) 12/6/2018

Standard Axiom Schemata (concluded) UG:   . where  is not free in  UI: .  [] where  is free for  in  ED: . . 12/6/2018

Freedom A variable is free in a sentence if and only if it occurs outside of the scope any quantifier of that variable. x is free in p(x). x is free in y.p(x,y). x is free in (p(x)  x.q(x)). x is not freex.p(x). The statement that a variable is free in a sentence is not the same as the statement that a term is free for a variable in a sentence! 12/6/2018

Substitutability A term  is substitutable for  in  if and only if it there are no occurrences of  in the scope of a quantifier of a variable in . Some texts say “x is free for y in ” instead of “x is substitutable for y in ”. mother(jane) is free for y in hates(jane,y). mother(x) is free for y in hates(jane,y). mother(x) is free for y in z.hates(z,y). mother(x) is not free for y in x.hates(x,y). mother(x) is free for y in (x.y.l(x,y)  z.h(z,y)). 12/6/2018

Formal Proofs A formal proof of  from  is a sequence of sentences terminating in  in which each item is either: 1. a premise (a member of ) 2. an instance of an axiom schema 3. the result of applying a rule of inference to earlier items in the sequence. 12/6/2018

Provability A sentence  is provable from a set of sentences  if and only if there is a finite formal proof of  from  using only Modus Ponens, Universal Generalization, and the standard axiom schemata. Soundness Theorem: If  is provable from , then  logically entails . Completeness Theorem (Godel): If  logically entails , then  is provable from . 12/6/2018

Decidability Results Logical Entailment for Relational Logic is semidecidable. Logical Entailment for Relational Logic is not decidable. Arithmetic is not finitely axiomatizable in Relational Logic. 12/6/2018

12/6/2018

Inseado Implications Out: Negations In: 12/6/2018

Inseado (continued) Standardize variables Existentials Out (Outside in) 12/6/2018

Inseado (continued) Alls Out Distribution 12/6/2018

Inseado (concluded) Operators Out 12/6/2018

Unification A substitution  is a unifier for an expression  and an expression  if and only if =. p(X,Y){Xa,Yb,Vb}=p(a,b) p(a,V){Xa,Yb,Vb}=p(a,b) If two expressions have a unifier, they are said to be unifiable. Otherwise, they are nonunifiable. p(X,X) p(a,b) 12/6/2018

Most General Unifier A substitution  is a most general unifier (mgu) of two expressions if and only if it is as general as or more general than any other unifier. Theorem: If two expressions are unifiable, then they have an mgu that is unique up to variable permutation. p(X,Y){Xa,YV}=p(a,V) p(a,V){Xa,YV}=p(a,V) p(X,Y){Xa,VY}=p(a,Y) p(a,V){Xa,VY}=p(a,Y) 12/6/2018

Relational Resolution I 12/6/2018

Relational Resolution II 12/6/2018

Relational Resolution III (Final Version) 12/6/2018

Provability A resolution derivation of a clause  from a set  of clauses is a sequence of clauses terminating in  in which each item is (1) a member of  or (2) the result of applying the resolution to earlier items. A sentence  is provable from a set of sentences  by resolution if and only if there is a derivation of the empty clause from the clausal form of {}. A resolution proof is a derivation of the empty clause from the clausal form of the premises and the negation of the desired conclusion. 12/6/2018

Soundness and Completeness Metatheorem: Provability using the Relational Resolution Principle is sound and complete for Relational Logic (without equality). 12/6/2018

Answer Extraction Method Alternate Method for Logical Entailment: To determine whether a set  of sentences logically entails a closed sentence  , rewrite {  goal} in clausal form and try to derive goal. Method for Answer Extraction: To get values for free variables 1,…,n in  for which  logically entails , rewrite {  goal(1,…,n)} in clausal form and try to derive goal(1,…,n). Intuition: The sentence (q(z)  goal(z)) says that, whenever, z satisfies q, it satisfies the “goal”. 12/6/2018

Strategies Elimination Strategies (Constraints on clauses): Identical Clause Elimination Pure Literal Elimination Tautology Elimination Subsumption Elimination Restriction Strategies (Constraints on inferences): Unit Restriction Input Restriction Linear Restriction Set of Support Restriction 12/6/2018

Clauses and Chains A clause is a set of literals. {p,q,r} A chain is a sequence of literals p,q,r 12/6/2018

Ordered Resolution 12/6/2018

Semi-Ordered Resolution 12/6/2018

Contrapositives A contrapositive of a chain is a permutation in which a different literal is placed at the front. Chain: p,q,r Contrapositive: q,p,r Contrapositive: r,p,q The contrapositives of a chain are logically equivalent to the original chain. 12/6/2018

Model Elimination Model Elimination is a variant of Ordered Resolution that incorporates the Linearity Restriction in the definition of the rules of inference. Using Model Elimination alone, it is possible to build a theorem prover that is sound and complete for all of Relational Logic. Moreover, it works with the Set of Support strategy and the Input Restriction!!! 12/6/2018

Normal and Reduced Literals Normal Literals: p q Reduced Literals: [p] [q] Chains: p,q,[p],r 12/6/2018

Model Elimination Rules Reduction Cancellation Dropping 12/6/2018

Epilog Epilog is a theorem prover for Relational Logic. It is sound and complete. It is at least as efficient as Model Elimination, and it is arguably more efficient. It is somewhat more intuitive than ordinary Resolution. Features: Rule Form instead of Clausal Form Backward Chaining variant of the ME rule Iterative Deepening rather than Breadth-First Search 12/6/2018

Rule Form Premises are expressed as rules. Conclusions are expressed as questions. 12/6/2018

Backward Chaining Backward Chaining is the same as reduction except that it works on rule form rather than clausal form. Reduced literals need be retained only for non-Horn premises. Cancellation and Dropping are analogous. 12/6/2018

12/6/2018

Equality An equation  =  is true in an interpretation i if and only if the terms in the equation refer to the same object in the universe of discourse. i = i 12/6/2018

Example Interpretation: i(a) =  i(b) =  i(c) =  i(f ) = {, } i(r) = {, , , } Satisfied Sentences a = a a = f(b) a= f(f(a)) a  b b = f(a) a=f(f(c)) a = c b = f(c) b=f(f(b)) b = b c = f(b) c=f(f(a)) b  c c=f(f(c)) 12/6/2018

Unique Names Assumption In many applications, one makes the assumption that every object has a unique name. This is called the unique names assumption (UNA). The upshot is that a difference in name implies a difference in referent. =   i = i The unique names assumption is not true in general!!! Question: How does one express the unique names assumption in Relational Logic? 12/6/2018

Equational Reasoning Axioms (reflexivity, symmtery, transitivity, subst) Paramodulation and Demodulation x RUE (Disagreement Sets) x AC-unification x Rewrite Rules 12/6/2018

Equality Axioms Reflexivity x.x=x Symmetry: x.y.(x=y  y=x) Transitivity: x.y.z.(x=y  y=z  x=z) 12/6/2018

Equality Axioms in Rule Form Reflexivity x=x Symmetry: x=y  y=x Transitivity: x=z  x=y  y=z 12/6/2018

Equality Proof 12/6/2018

Equality Problem 12/6/2018

f(f(a))=a  x.(f(a)=x  f(x)=a) Flattening Equivalence: f(f(a))=a  x.(f(a)=x  f(x)=a) Rewrite: f(f(a))=a As: x.(f(a)=x  f(x)=a) As: f(a)=c  f(c)=a As: f(a)=c f(c)=a Rewrite: f(f(a))=a? As: x.(f(a)=x  f(x)=a)? As: f(a)=x  f(x)=a? 12/6/2018

Proof With Flattening 12/6/2018

f(f(a))=a  x.(f(a)=x  f(x)=a) Substitution Axiom Flattening Rule: f(f(a))=a  x.(f(a)=x  f(x)=a) Substitution Axiom: f(x)=z  x=y  f(y)=z 12/6/2018

Proof With Substitution 12/6/2018

p(x,y)=z  x=u  y=v  p(u,v) Notes Substitution axioms for relation constants too. p(x)  x=y  p(y) Substitution axioms for multiple arguments p(x,y)=z  x=u  y=v  p(u,v) Need one substitution for each function and relation constant. 12/6/2018

Demodulation 12/6/2018

Examples 12/6/2018

Non-Examples Unit Equations Only Variables Substituted in Equation Only 12/6/2018

Problems With Demodulation Cannot bind variables in expression: Equation must be a unit clause 12/6/2018

Paramodulation 12/6/2018

Example 12/6/2018

Proof With Paramodulation 12/6/2018

Proof With Paramodulation 12/6/2018

Differences (1) Demodulation requires a unit equation. (2) Demodulation binds variables in equation only. (3) Demodulation deletes parent. 12/6/2018

Power Theorem: Resolution and Paramodulation (together with the reflexivity axiom) are refutation complete for all of Relational Logic*. *including equality 12/6/2018

Details Monday 3:30pm in Terman Auditorium. One hour and 15 minutes of three hours. Closed book. Easy. 12/6/2018

Hints 1. Study the Problems on the Problem Sets. 12/6/2018