From 15061f75a9ccf9ba76b7b9b6f795fab17661bcd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Thu, 9 Jun 2016 18:48:16 +0200 Subject: [PATCH] Added test covering last issue. --- tests/TestPDDLParser.cpp | 3 ++ tests/data/issues/issue-2.pddl | 51 ++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 tests/data/issues/issue-2.pddl diff --git a/tests/TestPDDLParser.cpp b/tests/TestPDDLParser.cpp index a0c1100..254390b 100644 --- a/tests/TestPDDLParser.cpp +++ b/tests/TestPDDLParser.cpp @@ -370,4 +370,7 @@ TEST(PDDLParserTests, CheckIssues) { // Check white space issues with constants and parsing unsupported sections ASSERT_NO_THROW(Description::fromFile("data/issues/issue-1.pddl")); + + // Check white space issues with empty n-ary predicates + ASSERT_NO_THROW(Description::fromFile("data/issues/issue-2.pddl")); } diff --git a/tests/data/issues/issue-2.pddl b/tests/data/issues/issue-2.pddl new file mode 100644 index 0000000..bdb5b3f --- /dev/null +++ b/tests/data/issues/issue-2.pddl @@ -0,0 +1,51 @@ + +(define (domain openstacks-netbenefit-numeric-ADL) + (:requirements :typing :adl :numeric-fluents :goal-utilities) + (:types order product) + (:predicates (includes ?o - order ?p - product) + (waiting ?o - order) + (started ?o - order) + (shipped ?o - order) + (delivered ?o - order ?p - product) + (made ?p - product)) + +(:functions (total-cost) + (stacks-in-use) + (max-in-use) + (stack-cost) ) + + (:action open-new-stack + :parameters () + :precondition (and) + :effect (and (increase (max-in-use) 1) + (increase (total-cost) (stack-cost))) + ) + + (:action start-order + :parameters (?o - order) + :precondition (and (waiting ?o) + (< (stacks-in-use) (max-in-use))) + :effect (and (not (waiting ?o)) + (started ?o) + (increase (stacks-in-use) 1)) + ) + + (:action make-product + :parameters (?p - product) + :precondition (and (not (made ?p))) + :effect (and (made ?p) + (forall (?o - order) + (when (and (includes ?o ?p) + (started ?o)) + (delivered ?o ?p)))) + ) + + (:action ship-order + :parameters (?o - order) + :precondition (and (started ?o)) + :effect (and (not (started ?o)) + (shipped ?o) + (decrease (stacks-in-use) 1)) + ) + + )