A renomada cafeteria *$
não é apenas
famosa por seus cafés pouco especiais, mas também por ser o ponto de
encontro favorito de programadores, que para lá vão com seus laptops,
fingindo que trabalham enquanto esperam por um café que mais parece um
milkshake. Após o novo projeto de automação de pedidos usando a
linguagem PDDL
(Planning Domain
Definition Language), a *$
deseja, em
busca de otimizar seu mise en place, ter alguns pedidos já
pré-compilados em SAS
. Seu desafio é
escrevar a tradução do modelo PDDL
apresentado para SAS
. Você deverá submeter
somente o arquivo SAS que represente os códigos.
(define (domain cafe-com-pddl)
(:requirements :strips :typing :negative-preconditions)- bean
(:types light-bean medium-bean dark-bean
water milk sugar syrup)
(:predicates- bean)
(had-been-ground ?b - water)
(had-been-heated ?w
(frappe-is-ready)
(espresso-is-ready)
(filtrado-is-ready)
(coldbrew-is-ready)
(frappuccino-is-ready))
(:action GRIND-BEANS- bean)
:parameters (?b and (not (had-been-ground ?b)))
:precondition (and (had-been-ground ?b)))
:effect (
(:action HEAT-WATER- water)
:parameters (?w not (had-been-heated ?w))
:precondition (and (had-been-heated ?w)))
:effect (
(:action MAKE-COFFEE-espresso- dark-bean ?w - water)
:parameters (?beans and (had-been-ground ?beans) (had-been-heated ?w))
:precondition (and (espresso-is-ready)
:effect (not (had-been-ground ?beans)) (not (had-been-heated ?w))))
(
(:action MAKE-COFFEE-filtrado- light-bean ?w - water)
:parameters (?beans and (had-been-ground ?beans) (had-been-heated ?w))
:precondition (and (filtrado-is-ready)
:effect (not (had-been-ground ?beans)) (not (had-been-heated ?w))))
(
(:action MAKE-COFFEE-coldbrew- medium-bean ?w - water)
:parameters (?beans and (had-been-ground ?beans) (not (had-been-heated ?w)))
:precondition (and (coldbrew-is-ready) (not (had-been-ground ?beans))))
:effect (
(:action MAKE-FRAPPE- milk ?su - sugar ?sy - syrup)
:parameters (?m and)
:precondition (and (frappe-is-ready)))
:effect (
(:action FUSION-CF
:parameters ()and (coldbrew-is-ready) (frappe-is-ready))
:precondition (and (frappuccino-is-ready)
:effect (not (coldbrew-is-ready)) (not (frappe-is-ready))))) (
(define (problem cafe-espresso)
(:domain cafe-com-pddl)- dark-bean water - water)
(:objects dark-beans (:goal (espresso-is-ready)))
Este exercício não recebe nenhum tipo de entrada.
Author: Bruno Ribeiro