Gerador PDDL -> SAS - Cafeteria *$

Bruno Ribeiro

Preâmbulo

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)
    (:types light-bean medium-bean dark-bean - bean
        water milk sugar syrup)
    (:predicates
        (had-been-ground ?b - bean)
        (had-been-heated ?w - water)
        (frappe-is-ready)
        (espresso-is-ready)
        (filtrado-is-ready)
        (coldbrew-is-ready)
        (frappuccino-is-ready))
    (:action GRIND-BEANS
        :parameters (?b - bean)
        :precondition (and (not (had-been-ground ?b)))
        :effect (and (had-been-ground ?b)))
    (:action HEAT-WATER
        :parameters (?w - water)
        :precondition (not (had-been-heated ?w))
        :effect (and (had-been-heated ?w)))
    (:action MAKE-COFFEE-espresso
        :parameters (?beans - dark-bean ?w - water)
        :precondition (and (had-been-ground ?beans) (had-been-heated ?w))
        :effect (and (espresso-is-ready)
            (not (had-been-ground ?beans)) (not (had-been-heated ?w))))
    (:action MAKE-COFFEE-filtrado
        :parameters (?beans - light-bean ?w - water)
        :precondition (and (had-been-ground ?beans) (had-been-heated ?w))
        :effect (and (filtrado-is-ready)
            (not (had-been-ground ?beans)) (not (had-been-heated ?w))))
    (:action MAKE-COFFEE-coldbrew
        :parameters (?beans - medium-bean ?w - water)
        :precondition (and (had-been-ground ?beans) (not (had-been-heated ?w)))
        :effect (and (coldbrew-is-ready) (not (had-been-ground ?beans))))
    (:action MAKE-FRAPPE
        :parameters (?m - milk ?su - sugar ?sy - syrup)
        :precondition (and)
        :effect (and (frappe-is-ready)))
    (:action FUSION-CF
        :parameters ()
        :precondition (and (coldbrew-is-ready) (frappe-is-ready))
        :effect (and (frappuccino-is-ready)
            (not (coldbrew-is-ready)) (not (frappe-is-ready)))))
(define (problem cafe-espresso)
    (:domain cafe-com-pddl)
    (:objects dark-beans - dark-bean water - water)
    (:goal (espresso-is-ready)))

Entrada

Este exercício não recebe nenhum tipo de entrada.

Author: Bruno Ribeiro