============================================================================= CS2710 ISSP 2160 Foundations of Artificial Intelligence Fall 2014 In-class Exercise ** Situation Calculus. Below are operators in the STRIPS language for representing actions and their effects. The domain is the blocks world. Imagine a child's set of building blocks on the a table top. The problem is to move the blocks from their starting configuration into some goal configuration. We will assume that each block can have only one other block directly on top of it, althrough blocks can be stacked to arbitrary heights. A block may be on another block, or on the table. A robot is performing the actions. Before he can pickup a block, or stack one on top of the other, his arm must be empty. Here are operators for this world, in STRIPS. The "P" are preconditions that must be true before you can perform that action. The "D" are things that are no longer true after performing the action. The "A" are new things that are true after performing the action. stack(x,y) P: clear(y) and holding(x) D: clear(y) and holding(x) A: armempty and on(x,y) unstack(x,y) P: on(x,y) and clear(x) and armempty D: on(x,y) and armempty A: holding(x) and clear(y) pickup(x) P: clear(x) and ontable(x) and armempty D: ontable(x) and armempty A: holding(x) putdown(x) P: holding(x) D: holding(x) A: ontable(x) and armempty There is no explicit negation in STRIPS. There is a working memory holding the current positive true statements. If something becomes false (such as "holding(block1)"), then that is simply removed from working memory. Your task is to represent the above operators in the Situation Calculus, specifically the version described ending on page 333 in Russell and Norvig (2nd edition). Assume that your sentences are to be processed by a full-first-order-logic theorem prover. Thus, you have no notion of "working memory", and you *do* need to represent negation. Be sure to remember the frame problem. If your operators were entered into a full-first-order-logic theorem prover, the theorem prover ought to be able to infer the same things that could be inferred with the corresponding STRIPS operators and facts. Answer: Actions: Stack, unstack, pickup, putdown Fluent: clear,holding,armempty,on,ontable 'a' denotes Action, 's' denotes Situation,'x','y' are blocks. Possibility axioms (1) stack all x,y,s ((clear(y,s) and holding(x,s)) --> poss(stack(x,y),s)) (2)unstack all x,y,s ((on(x,y,s) and clear(x,s) and armempty(s)) --> poss(unstack(x,y),s)) (3)pickup all x,y,s ((clear(x,s) and ontable(x,s) and armempty(s)) --> poss(pickup(x),s)) (4)putdown all x,y,s (holding(x,s) --> poss(putdown(x),s)) Successor-state axioms: If a is possible in s, then y is clear in the result of doing a in s if a is to unstack a block from y, or y is already clear in s and a is not the action of stack a block on y. Note added Dec 3, 2014: The <-->'s have been replaced by <--'s (1)clear all a,s,x,y (poss(a,s) --> (clear(y,result(a,s)) <-- ( a = unstack(x,y) or (clear(y,s) and not (a = stack(x,y)))))) (2)holding all a,s,x,y (poss(a,s) --> (holding(x,result(a,s)) <-- ((a = unstack(x,y) or a = pickup(x)) or (holding(x,s) and not (a = stack(x,y) or a = putdown(x)))))) (3)armempty all a,s,x,y (poss(a,s) --> (armempty(result(a,s)) <-- ((a = stack(x,y) or a = putdown(x)) or (armempty(s) and not (a = unstack(x,y) or a = pickup(x)))))) (4)on all a,s,x,y (poss(a,s) --> (on(x,y,result(a,s)) <-- (a = stack(x,y) or (on(x,y,s) and not (a = unstack(x,y)))))) (5)ontable all a,s,x,y (poss(a,s) --> (ontable(x,result(a,s)) <-- (a = putdown(x) or (ontable(x,s) and not (a = pickup(x)))))) ===To support the negations: This paragraph is above: If your operators were entered into a full-first-order-logic theorem prover, the theorem prover ought to be able to infer the same things that could be inferred with the corresponding STRIPS operators and facts. all a1,a2,x1,x2,y1,y2 ((a1 = stack(x1,y1) and a2 = unstack(x2,y2)) --> a1 != a2) plus similar axioms for all pairs of types of actions then, for each type of action, you need: all a1,a2,x1,x2,y1,y2 ((a1 = stack(x1,y1) and a2 = stack(x2,y2) and not (x1 == x2 and y1 == y2)) --> a1 != a2) plus, axioms for equality and inequality such as this: all x,y (x != y <--> y !=x) plus, you need to say that all different blocks are not equal to each other. Suppose the blocks are A,B,C,D A != B B != A and so on.