The second example implements the LTL property "Safety". This type of property is used to impose that, starting from the current time step, some properties have to never be verified. In the particular case of the waiter robot task, this operator can be used to impose a constraint on the entire path of the robot while it reaches the goal. Here, the property to be satisfied is that the robot never passes through the corridor.
Figures show the DFA and the linear trace associated to the LTL property, and the plan generated by the automated planner. It is easy to verify the difference between the previous practical example: this time the robot takes the way of the bedroom both going to the kitchen and then returning to the living room. The DFA reaches the goal state immediately after the first update and stays there for the rest of the plan execution.
(define(domain robotdomain) (:requirements :equality :adl) (:predicates (happy ?client) (robot ?robot) (free_arm ?robot) (room ?room) (client ?client) (coke ?coke) (dfa ?dfa) (instate ?state) (in ?object ?room) (update ?dfa) (edge ?s-state ?e-state) (near ?from-room ?to-room) (state ?state) ) (:action go_to :parameters (?robot ?from-room ?to-room ?dfa) :precondition (and (robot ?robot) (room ?from-room) (room ?to-room) (near ?from-room ?to-room) (in ?robot ?from-room) (dfa ?dfa) (update ?dfa) ) :effect (and (not (in ?robot ?from-room)) (in ?robot ?to-room) (not(update ?dfa)) ) ) (:action grab :parameters(?robot ?coke ?room ?dfa) :precondition (and (robot ?robot) (coke ?coke) (free_arm ?robot) (dfa ?dfa) (update ?dfa) (in ?robot ?room) (in ?coke ?room) ) :effect (and (not (free_arm ?robot)) (not (update ?dfa)) (not (in ?coke ?room)) ) ) (:action give_to :parameters (?robot ?client ?coke ?where-room ?dfa) :precondition (and (robot ?robot) (coke ?coke) (in ?robot ?where-room) (in ?client ?where-room) (not (free_arm ?robot)) (dfa ?dfa) (update ?dfa) ) :effect (and (free_arm ?robot) (happy ?client) (not(update ?dfa)) ) ) (:action move12 :parameters(?robot ?e-state ?dfa) :precondition (and (robot ?robot) (state ?e-state) (not(in ?robot corridor)) (instate state_1) (edge state_1 ?e-state) (dfa ?dfa) (not(update ?dfa)) ) :effect (and (instate ?e-state) (not(instate state_1)) (update ?dfa) ) ) (:action move22 :parameters(?robot ?e-state ?dfa) :precondition (and (robot ?robot) (not(in ?robot corridor)) (instate state_2) (edge state_2 ?e-state) (dfa ?dfa) (not(update ?dfa)) ) :effect (update ?dfa) ) (:action move13 :parameters(?robot ?s-state ?e-state ?dfa) :precondition (and (robot ?robot) (state ?s-state) (state ?e-state) (= ?e-state state_3) (instate ?s-state) (edge ?s-state ?e-state) (in ?robot corridor) (dfa ?dfa) (not(update ?dfa)) ) :effect (and (instate ?e-state) (not(instate ?s-state)) (update ?dfa) ) ) (:action move33 :parameters(?robot ?e-state ?dfa) :precondition (and (robot ?robot) (instate state_3) (edge state_3 ?e-state) (dfa ?dfa) (not(update ?dfa)) ) :effect (update ?dfa) ) (:action move23 :parameters(?robot ?e-state ?dfa) :precondition (and (robot ?robot) (in ?robot corridor) (instate state_2) (edge state_2 ?e-state) (= ?e-state state_3) (dfa ?dfa) (not(update ?dfa)) ) :effect (and (not(instate state_2)) (update ?dfa) (instate ?e-state) ) ))(define (problem robotproblem) (:domain robotdomain) (:objects livingroom kitchen bathroom bedroom corridor hall robot_1 state_1 state_2 state_3 dfa_1 coke_1 client_1 ) (:init (robot robot_1) (client client_1) (room livingroom) (room kitchen) (room bedroom) (room corridor) (room hall) (room bathroom) (coke coke_1) (free_arm robot_1) (in client_1 livingroom) (in robot_1 livingroom) (in coke_1 kitchen) (near livingroom corridor) (near corridor livingroom) (near livingroom bedroom) (near bedroom livingroom) (near kitchen bathroom) (near bathroom kitchen) (near corridor hall) (near hall corridor) (near hall kitchen) (near kitchen hall) (near bedroom bathroom) (near bathroom bedroom) (instate state_1) (dfa dfa_1) (update dfa_1) (state state_1) (state state_2) (state state_3) (edge state_1 state_2) (edge state_1 state_3) (edge state_2 state_2) (edge state_2 state_3) (edge state_3 state_3) ) (:goal (and (happy client_1) (instate state_2) ) ))