Title: 15381 Artificial Intelligence
115-381 Artificial Intelligence
- Means-Ends Analysis and
- Constraint Propagation
- Jaime Carbonell
- 21 January 2003
- Topics Covered
- Homework 1 (generalized state-space search)
- Means-Ends Analysis (back-chaining)
- Search Control Rules in MEA
- Constraint-Based Search
2Search?Planning Parameterized Operations
- Multi-State Transitions
- Instead of Opi,j Si? Sj, We have Opk,l Sk?
Sl - Preconditions and Post-Conditions
- Conjunctive set of first-order predicates
- Arguments can be constants or (typed) variables
- Intentional description of subset of all states
- Pre-image Sk states where preconditions are
true - Post-image S1 states where post-conditions are
true - Requires Consistent variable bindings within and
across preconditions and post-conditions
3Search?Planning Parameterized Operations
- First Example
- OPERATOR DRIVE-CAR(ltcargt, ltdrivergt, ltkeysgt,
ltloc-1gt) - PRE (AT ltcargt ltloc-1gt)
- (AT ltdrivergt ltloc-1gt)
- (CONTAINS-GAS ltcargt)
- (HAVE ltkeysgt ltdrivergt)
- (CORRESPOND ltkeysgt ltcargt)
- POST (AT ltcargt ltloc-2gt)
- (AT ltdrivergt ltloc-2gt)
- (NOT (AT ltcargt ltloc-1gt))
- (NOT (AT ltdrivergt ltloc-1gt))
4Search?Planning Parameterized Operations
- Second Example
- (Previous example LISP-style, Current one
PROLOG-style) - OPERATOR move-robot(r,x,y)
- TYPE ROBOT(r) LOC(x) LOC(y)
- PRE AT(r,x) EMPTY(y) CONNECTED(x,y)
- POST AT(r,y), NOT(AT(r,x))
- OPERATOR pick-up(r,z)
- TYPE ROBOT(r) LOC(x) LOC(y)
- PRE AT(r,x) AT(z,y) NEXT-TO(x,y)
NOT(holding(r,w,)) - POST HOLDING(r,z)
- NOT(AT(z,y))
-
5Search?Planning Parameterized Operations
- Interpretation
- A plan is an o-path S0 followed by a sequence of
instantiated operators which result in the goal
state. - Variables match objects in state of specified
types only for which the preconditions hold at
plan execution time. - Planning can proceed by forward or backward (or
any other) search method. - More on Planning expected from Veloso (later
lecture)
6Means-Ends Analysis
- Backchaining/Subgoaling Search
- Let Scurr S0
- If Scurr SG, then go to next goal (or DONE)
- Let OPSapp match(SG POST(Opi))
- If OPSapp empty, then FAIL
- Else Select OP ? OPSapp, (save alt's)
- If match(PRE(OP), Scurr),
- a. let Scurr apply(OP, Scurr)
- b. Go to step 2
- Else (i.e. if NOT(match(PRE(OP), Scurr)))
- a. MEA(SG) unmatched(PRE(OP)), SI Scurr)
- b. If fail, go to step 4
- c. If succeed, apply OP as above
-
7Control Rules for MEA
- Choice Points in MEA
- Choose Operator, if several applicable
- Choose Goal, if gt 1 subgoals pending
- Choose Variable Bindings, if gt 1 tuple
- Types of Control Rules
- Select choose an alternative
- and eliminate other contenders
- Reject Reject an alternative
- and retain other contenders
- Prefer Try one alternative first
- and retain others for possible backtracking
8Control Rules for MEA
- Example
- CONTROL-RULE Carry-before-move
- TYPE SELECT
- PRE Goals(Move(r,x,y), Pick-up(r,z,v)))
- POST Pick-up(r,z)
-
- CONTROL-RULE Dont polish before machining
- TYPE REJECT
- PRE Goals(Mill(p,f), Drill(p,l,d,s),
Polish(p)) - POST Polish(p)
-
9Constraint-Based Search
- Satisfiability problems
- Find consistent bindings to a set of variables
- Consistent satisfy all constraints
- Example (X v Y) (X v Y)
- Example Match applicants to positions
- Two families of search methods apply
- State-space search on bindings
- Satisfiability-search on constraints
10Constraint-Based Search
- Example How fast can you solve this?
- Find a way to fit components (1, 2, 3, 4) into
slots (A,B,C,D) such that - Each slot only takes one component
- Slots are in LEFT-RIGHT sequence A, B, C, D
- Slots A and C are T-shaped
- Slots B and D are I-shaped
- Components 1 and 2 are 3-pronged
- Components 3 and 4 are 2-pronged
- 2-pronged fit into T-shaped or I-shaped
- 3-pronged fit only into T-shaped
- Component 3 must be LEFT of component 2
11Constraints
- Least Commitment Method
- For each Variable find all legal
unary-constrained assignments. - If no assignments possible, return FAILURE
- Assign most-constrained unassigned variable.
- If all variables assigned, return SUCCESS
- If the assigned variable is a member of a binary
constraint, propagate instantiation - Delete all residual un-viable assignments
- Go to 2
12Constraint-Based Search
A 1,2,3,4 B 3,4 C 1,2,3,4 D 3,4
B?4
B?3
A 1,2,4 C 1,2,4 D 4
A 1,2,3 C 1,2,3 D 3 FAILURE
D?4
A 1,2 C 1,2?C 2
D?3
C?2
A 1 SUCCESS
A?1
13(Dis)Advantages of Constraints
- Reduce the search space
- Early failure (upon constraint violation)
- Generate minimal-uncertainty step (least
commitment strategy) - Only applicable to satisfiability problems
- Finds an answer, not necessarily optimal
- Not all problems can be cast as constraints to
satisfy