Download Semantics

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Logistics
Problem Set 2
Due Wed
A few KR problems
Robocode
1. Form teams of 2 people
2. Write design document
© Daniel S. Weld
1
Paper Commentary
• Most important ideas
• Biggest flaws
• Open research questions
© Daniel S. Weld
2
573 Topics
Perception
NLP
Robotics
Multi-agent
Reinforcement
Learning
MDPs
Supervised
Learning
Planning
Search
Uncertainty
Knowledge
Representation
Problem Spaces
Agency
© Daniel S. Weld
3
Knowledge Representation
• Expressiveness
• Tractability
© Daniel S. Weld
4
Outline for Today
•
•
•
•
Review propositional logic
Inference in propositional logic
A sampling of first-order logic
Representing events, action & change
© Daniel S. Weld
5
Semantics
• Syntax: a description of the legal
arrangements of symbols
(Def “sentences”)
• Semantics: what the arrangement of
symbols means in the world
Sentences
Facts
© Daniel S. Weld
Sentences
Semantics
World
Semantics
Representation
Inference
Facts
6
Propositional Logic
• Syntax
Atomic sentences: P, Q, …
Connectives:  , , , 
• Semantics
Truth Tables
• Inference
Modus Ponens
Resolution
DPLL
WalkSAT
• Complexity
© Daniel S. Weld
7
Prop. Logic: Knowledge Engr
1)
2)
3)
4)
5)
One of the women is a biology major
Lisa is not next to Dave in the ranking
Dave is immediately ahead of Jim
Jim is immediately ahead of a bio major
Mary or Lisa is ranked first
1. Choose Vocabulary Universe: Lisa, Dave, Jim, Mary
LD = “Lisa is immediately ahead of Dav
D = “Dave is a Bio Major”
2. Choose initial sentences (wffs)
LM
 LD   DL
…
© Daniel S. Weld
8
Reasoning Tasks
• Model finding
KB = background knowledge
S = description of problem
Show (KB  S) is satisfiable
A kind of constraint satisfaction
• Deduction
S = question
Prove that KB |= S
Two approaches:
1. Rules to derive new formulas from old
(inference)
2. Show (KB   S) is unsatisfiable
© Daniel S. Weld
9
Propositional Logic: Inference
A mechanical process for computing new sentences
1. Backward & Forward Chaining
Based on rule of modus ponens
If know P1, …, Pn & know (P1 ...
Then can conclude Q
 Pn )=> Q
2. Resolution (Proof by Contradiction)
3. WalkSAT
4. Davis Putnam
© Daniel S. Weld
10
Special Syntactic Forms
• General Form:
((q r)  s))   (s  t)
• Conjunction Normal Form (CNF)
( q  r  s )  ( s   t)
Set notation: { ( q, r, s ), ( s,  t) }
empty clause () = false
• Binary clauses: 1 or 2 literals per clause
( q  r)
( s   t)
( q   r  s )
(qr)  s
( s   t)
(st)  false
• Horn clauses: 0 or 1 positive literal per clause
© Daniel S. Weld
11
Inference
Resolution
{ (p  ), ( p    ) } |-R (    )
Correctness
If S1 |-R S2 then S1 |= S2
Refutation Completeness:
If S is unsatisfiable then S |-R ()
© Daniel S. Weld
12
Resolution
If the unicorn is mythical, then it is immortal, but
if it is not mythical, it is a mammal. If the
unicorn is either immortal or a mammal, then it
is horned.
Prove: the unicorn is horned.
M = mythical
I = immortal
A = mammal
H = horned
( A  H)
(M  A)
(I  H)
( H)
(A)
(I)
(M)
( M  I)
( M)
()
© Daniel S. Weld
13
Structure in Clauses
• Unit Literals
A literal that appears in a singleton clause
{{b c}{c}{a b e}{d b}{e a c}}
Might as well set it true! And simplify
{{b}
{a b e}{d b}}
{{d}}
• Pure Literals
A symbol that always appears with same sign
{{a b c}{c d e}{a b e}{d b}{e a c}}
Might as well set it true! And simplify
{{a b c}
{a b e}
{e a c}}
© Daniel S. Weld
14
DPLL
Davis Putnam Loveland Logmann
• Model finding: Search (what kind?)
over space of partial truth assignments
DPLL( wff ):
If  a pure literal P, return DPLL(wff extended by P)
For each unit clause (Y), simplify wff:
Remove clauses containing Y
Shorten clauses contain Y
If no clause left, return true (satisfiable)
If  empty clause, return false
Choose a variable X & choose a value (0/1)
If DPLL(wff extended by X ) return true
else return DPLL(wff, X)
© Daniel S. Weld
15
DPLL
• Developed 1962 – still the best complete
algorithm for propositional reasoning
• State of the art solvers use:
Smart variable choice heuristics
“Clause learning” – at backtrack points, determine
minimum set of choices that caused
inconsistency, add new clause
• Limited resolution (Agarwal, Kautz, Beame 2002)
Randomized tie breaking & restarts
• Chaff – fastest complete SAT solver
Created by 2 Princeton undergrads, for a summer
project!
Superscaler processor verification
AI planning - Blackbox
© Daniel S. Weld
16
Horn Theories
• Recall the special case of Horn clauses:
{ ( q   r  s ), ( s   t) }
{ ((qr)  s ), ((st)  false) }
• Many problems naturally take the form
of such if/then rules
If (fever) AND (vomiting) then FLU
• Unit propagation is refutation complete
for Horn theories
Good implementation – linear time!
© Daniel S. Weld
17
WalkSat
• Local search over space of complete truth
assignments
With probability P: flip any variable in any
unsatisfied clause
With probability (1-P): flip best variable in
any unsat clause
• Like fixed-temperature simulated annealing
• SAT encodings of N-Queens, scheduling
• Best algorithm for random K-SAT
Best DPLL: 700 variables
Walksat: 100,000 variables
© Daniel S. Weld
18
Random 3-SAT
• Random 3-SAT
sample uniformly from
space of all possible 3clauses
n variables, l clauses
• Which are the hard
instances?
around l/n = 4.3
© Daniel S. Weld
19
Random 3-SAT
• Varying problem size, n
• Complexity peak
appears to be largely
invariant of algorithm
backtracking algorithms
like Davis-Putnam
local search procedures
like GSAT
• What’s so special about
4.3?
© Daniel S. Weld
20
Random 3-SAT
• Complexity peak
coincides with solubility
transition
l/n < 4.3 problems underconstrained and SAT
l/n > 4.3 problems overconstrained and UNSAT
l/n=4.3, problems on
“knife-edge” between
SAT and UNSAT
© Daniel S. Weld
21
Real-World Phase Transition
Phenomena
• Many NP-hard problem distributions show
phase transitions job shop scheduling problems
TSP instances from TSPLib
exam timetables @ Edinburgh
Boolean circuit synthesis
Latin squares (alias sports scheduling)
• Hot research topic: predicting hardness of a
given instance, & using hardness to control
search strategy (Horvitz, Kautz, Ruan 2001-3)
© Daniel S. Weld
22
Summary
• Expressiveness
Expressive but awkward
No notion of objects, properties, or relations
Number of propositions is fixed
• Tractability
NPC in general
Completeness / speed tradeoff
Horn clauses, binary clauses
© Daniel S. Weld
23
Related documents