Logic: The Big Picture Propositional logic: atomic statements are facts –Inference via resolution is sound and complete (though likely computationally.

Slides:



Advertisements
Similar presentations
Inference in first-order logic
Advertisements

Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Some Prolog Prolog is a logic programming language
Inference in first-order logic
First-Order Logic.
Language for planning problems
Planning
Inference Rules Universal Instantiation Existential Generalization
Logic Programming Automated Reasoning in practice.
Planning Module THREE: Planning, Production Systems,Expert Systems, Uncertainty Dr M M Awais.
Inference in first-order logic Chapter 9. Outline Reducing first-order inference to propositional inference Unification Generalized Modus Ponens Forward.
UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
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)
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 20
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.
Logic Use mathematical deduction to derive new knowledge.
Agents That Reason Logically Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 7 Spring 2004.
Methods of Proof Chapter 7, Part II. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound) generation.
Logic.
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Mar, 4, 2015 Slide credit: some slides adapted from Stuart.
Proof methods Proof methods divide into (roughly) two kinds: –Application of inference rules Legitimate (sound) generation of new sentences from old Proof.
Inference in FOL Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 9 Spring 2004.
Inference and Resolution for Problem Solving
Logical Agents Chapter 7. Why Do We Need Logic? Problem-solving agents were very inflexible: hard code every possible state. Search is almost always exponential.
Methods of Proof Chapter 7, second half.
Logical Agents Chapter 7 Feb 26, Knowledge and Reasoning Knowledge of action outcome enables problem solving –a reflex agent can only find way from.
Logic. Knowledge-based agents Knowledge base (KB) = set of sentences in a formal language Declarative approach to building an agent (or other system):
Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions.
Inference is a process of building a proof of a sentence, or put it differently inference is an implementation of the entailment relation between sentences.
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.
CHAPTERS 7, 8 Oliver Schulte Logical Inference: Through Proof to Truth.
1-1 Introduction Logic programming languages, sometimes called declarative programming languages Express programs in a form of symbolic logic Use a logical.
Planning (Chapter 10)
Logical Inference 2 rule based reasoning
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Logical Agents Logic Propositional Logic Summary
First-Order Logic and Plans Reading: C. 11 (Plans)
Course Overview and Road Map Computability and Logic.
CPSC 322, Lecture 23Slide 1 Logic: TD as search, Datalog (variables) Computer Science cpsc322, Lecture 23 (Textbook Chpt 5.2 & some basic concepts from.
Logic (Chapters 7-9).
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
Great Theoretical Ideas in Computer Science.
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.:
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
1 Logical Agents Chapter 7. 2 A simple knowledge-based agent The agent must be able to: –Represent states, actions, etc. –Incorporate new percepts –Update.
Planning (Chapter 10)
Logic Programming and Prolog Goal: use formalism of first-order logic Output described by logical formula (theorem) Input described by set of formulae.
Great Theoretical Ideas in Computer Science.
CS6133 Software Specification and Verification
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Oct, 30, 2015 Slide credit: some slides adapted from Stuart.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
Inference in First Order Logic. Outline Reducing first order inference to propositional inference Unification Generalized Modus Ponens Forward and backward.
Reasoning with Propositional Logic automated processing of a simple knowledge base CD.
First-Order Logic Reading: C. 8 and C. 9 Pente specifications handed back at end of class.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Basic Concepts and Background.
Proof Methods for Propositional Logic CIS 391 – Intro to Artificial Intelligence.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
Logical Inference 2 Rule-based reasoning
Discrete Mathematics for Computer Science
Planning (Chapter 10) Slides by Svetlana Lazebnik, 9/2016 with modifications by Mark Hasegawa-Johnson, 9/2017
Resolution in the Propositional Calculus
Planning (Chapter 10)
Planning (Chapter 10)
Logical Inference 2 Rule-based reasoning
Artificial Intelligence
CS 416 Artificial Intelligence
Presentation transcript:

Logic: The Big Picture Propositional logic: atomic statements are facts –Inference via resolution is sound and complete (though likely computationally intractable) First-order logic: adds variables, relations, and quantification –Inference is essentially a generalization of propositional inference –Resolution is still sound and complete, but not guaranteed to terminate on non-entailed sentences (semidecidable) –Simple inference procedures (forward chaining and backward chanining) available for knowledge bases consisting of definite clauses

Logic programming: Prolog FOL: King(x) Greedy(x) Evil(x) Greedy(y) King(John) Prolog: evil(X) :- king(X), greedy(X). greedy(Y). king(john). Closed-world assumption: –Every constant refers to a unique object –Atomic sentences not in the database are assumed to be false Inference by backward chaining, clauses are tried in the order in which they are listed in the program, and literals (predicates) are tried from left to right

Prolog example parent(abraham,ishmael). parent(abraham,isaac). parent(isaac,esau). parent(isaac,jacob). grandparent(X,Y) :- parent(X,Z), parent(Z,Y). descendant(X,Y) :- parent(Y,X). descendant(X,Y) :- parent(Z,X), descendant(Z,Y). ? parent(david,solomon). ? parent(abraham,X). ? grandparent(X,Y). ? descendant(X,abraham).

Prolog example parent(abraham,ishmael). parent(abraham,isaac). parent(isaac,esau). parent(isaac,jacob). What if we wrote the definition of descendant like this : descendant(X,Y) :- descendant(Z,Y), parent(Z,X). descendant(X,Y) :- parent(Y,X). ? descendant(W,abraham). Backward chaining would go into an infinite loop! –Prolog inference is not complete, so the ordering of the clauses and the literals is really important

Backward chaining algorithm

Graph coloring colorable(Wa,Nt,Sa,Q,Nsw,V) :- diff(Wa,Nt), diff(Wa,Sa), diff(Nt,Q), diff(Nt,Sa), diff(Q,Nsw), diff(Q,Sa), diff(Nsw,V), diff(Nsw,Sa), diff(V,Sa). diff(red,blue).diff(red,green). diff(green,red). diff(green,blue). diff(blue,red).diff(blue,green).

Prolog lists Appending two lists to produce a third: append([],Y,Y). append([X|L],Y,[X|Z]) :- append(L,Y,Z). query: append(A,B,[1,2]) answers: A=[] B=[1,2] A=[1] B=[2] A=[1,2] B=[]

Logic: The Big Picture The original goal of formal logic was to axiomatize mathematics –Hilberts program (1920s): find a formalization of mathematics that is consistent, complete, and decidableHilberts program Completeness theorem (Gödel, 1929):Completeness theorem –Deduction in FOL is consistent and complete –Unfortunately, FOL is not strong enough to describe infinite structures such as natural or real numbers Incompleteness theorem (Gödel, 1931):Incompleteness theorem –Any consistent logic system strong enough to capture natural numbers and arithmetic will contain true sentences that cannot be proved Halting problem (Turing, 1936):Halting problem –There cannot be a general algorithm for deciding whether a given statement about natural numbers is true Profound implications for foundations of mathematics –What about implications for AI?

Applications of logic Automated theorem proving in mathematics –Robbins conjecture proved in 1996Robbins conjecture proved in 1996 Software verification Software synthesis VLSI verification VLSI design Planning

Planning What is planning? –Finding a sequence of actions to achieve ones goals How is planning different from regular search? –States and action sequences typically have complex internal structure –State space and branching factor are huge –Multiple objectives, resource constraints Examples of planning applications –Scheduling of tasks in space missions –Logistics planning for the army –Assembly lines, industrial processes

Propositional planning Start state, goal state are specified as conjunctions of predicates –Start state: At(P1, RDU) Plane(P1) Airport(RDU) Airport(ORD) –Goal state: At(P1, ORD) Actions are described in terms of their preconditions and effects: –Fly(p, source, destination) Precond: At(p, source) Plane(p) Airport(source) Airport(destination) Effect: ¬At(p, source) At(p, destination) Search problem: starting with the start state, find all applicable actions (actions for which preconditions are satisfied), compute the successor state based on the effects, etc.

Complexity of planning Planning is PSPACE-complete –Plans can be exponential in length! –Example: tower of Hanoitower of Hanoi

From propositional planning to real-world planning Incorporating the time dimension Resource constraints Contingencies: actions failing Qualification problem Hierarchical planning Uncertainty Observations Multiagent planning