(define (domain floor-tile)
(:requirements :typing)
(:types robot tile color)

(:predicates
		(robotat ?r - robot ?x - tile)
		(up ?x - tile ?y - tile)
		(down ?x - tile ?y - tile)
		(right ?x - tile ?y - tile)
		(left ?x - tile ?y - tile)

		(clear ?x - tile)
                (painted ?x - tile ?c - color)
		(robothas ?r - robot ?c - color)
                (availablecolor ?c - color)
                (freecolor ?r - robot))

(:action changecolor
  :parameters (?o1 - robot ?o2 - color ?o3 - color)
  :precondition (and (robothas ?o1 ?o2) (availablecolor ?o3))
  :effect (and (not (robothas ?o1 ?o2)) (robothas ?o1 ?o3))
)

(:action paintup
  :parameters (?o1 - robot ?o2 - tile ?o3 - tile ?o4 - color)
  :precondition (and (robothas ?o1 ?o4) (robotat ?o1 ?o3) (up ?o2 ?o3) (clear ?o2))
  :effect (and (not (clear ?o2)) (painted ?o2 ?o4))
)

(:action paintdown
  :parameters (?o1 - robot ?o2 - tile ?o3 - tile ?o4 - color)
  :precondition (and (robothas ?o1 ?o4) (robotat ?o1 ?o3) (down ?o2 ?o3) (clear ?o2))
  :effect (and (not (clear ?o2)) (painted ?o2 ?o4))
)

(:action up
  :parameters (?o1 - robot ?o2 - tile ?o3 - tile)
  :precondition (and (robotat ?o1 ?o2) (up ?o3 ?o2) (clear ?o3))
  :effect (and (robotat ?o1 ?o3) (not (robotat ?o1 ?o2))
               (clear ?o2) (not (clear ?o3)))
)

(:action down
  :parameters (?o1 - robot ?o2 - tile ?o3 - tile)
  :precondition (and (robotat ?o1 ?o2) (down ?o3 ?o2) (clear ?o3))
  :effect (and (robotat ?o1 ?o3) (not (robotat ?o1 ?o2))
               (clear ?o2) (not (clear ?o3)))
)

(:action right
  :parameters (?o1 - robot ?o2 - tile ?o3 - tile)
  :precondition (and (robotat ?o1 ?o2) (right ?o3 ?o2) (clear ?o3))
  :effect (and (robotat ?o1 ?o3) (not (robotat ?o1 ?o2))
               (clear ?o2) (not (clear ?o3)))
)

(:action left
  :parameters (?o1 - robot ?o2 - tile ?o3 - tile)
  :precondition (and (robotat ?o1 ?o2) (left ?o3 ?o2) (clear ?o3))
  :effect (and (robotat ?o1 ?o3) (not (robotat ?o1 ?o2))
               (clear ?o2) (not (clear ?o3)))
)

)