Up Next
Go up to Question 5
Go forward to Answer to Question 5 part 1

Answer to Question 5 part 1

Let's assume that the action paint_everything(Robot,Color) is always possible.
color(Obj,Color,do(paint_everything(Robot,Color),S)) <-
    at(Robot,Loc,S) &
    at(Obj,Loc,S).
color(Obj,C1,do(paint_everything(Robot,Color),S)) <-
    at(Robot,Loc,S) &
    at(Obj,Loc1,S) &
    Loc \= Loc1 &
    color(Obj,C1,S).
color(Obj,C,do(A,S)) <-
    poss(A,S) &
    ~ paint_everything_action(A) &
    color(Obj,C,S).
paint_everything_action(paint_everything(Robot,Color)).
poss(paint_everything(Robot,Color),S).

Up Next