Top Banner
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
13

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

Mar 31, 2015

Download

Documents

Kassidy Rasor
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Logic: The Big Picture Propositional logic: atomic statements are facts –Inference via resolution is sound and complete (though likely computationally.

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

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

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

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

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).

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

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

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

Backward chaining algorithm

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

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).

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

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=[]

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

Logic: The Big Picture• The original goal of formal logic was to axiomatize mathematics

– Hilbert’s program (1920’s): find a formalization of mathematics that is consistent, complete, and decidable

• Completeness theorem (Gödel, 1929):– 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):

– Any consistent logic system strong enough to capture natural numbers and arithmetic will contain true sentences that cannot be proved

• Halting problem (Turing, 1936):– 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?

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

Applications of logic

• Automated theorem proving in mathematics– Robbins conjecture proved in 1996

• Software verification• Software synthesis• VLSI verification• VLSI design• Planning

http://www.cs.miami.edu/~tptp/OverviewOfATP.html

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

Planning

• What is planning?– Finding a sequence of actions to achieve one’s 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

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

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.

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

Complexity of planning

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

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

From propositional planning to real-world planning

• Incorporating the time dimension• Resource constraints• Contingencies: actions failing• “Qualification problem”• Hierarchical planning• Uncertainty• Observations• Multiagent planning