From 240f3b3a7f8dc31842e2913d14c554dbb995e67f Mon Sep 17 00:00:00 2001 From: Tobias Eidelpes Date: Fri, 22 Jul 2022 19:56:28 +0200 Subject: [PATCH] Initial commit --- crossing.bk | 1 + crossing.plan | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 crossing.bk create mode 100644 crossing.plan diff --git a/crossing.bk b/crossing.bk new file mode 100644 index 0000000..bef7b23 --- /dev/null +++ b/crossing.bk @@ -0,0 +1 @@ +animal(wolf1). animal(wolf2). animal(fox). animal(chicken). animal(worm). diff --git a/crossing.plan b/crossing.plan new file mode 100644 index 0000000..003fe59 --- /dev/null +++ b/crossing.plan @@ -0,0 +1,56 @@ +actions: + crossTogether(X,Y) requires animal(X), animal(Y), X < Y. + cross(X) requires animal(X). + +fluents: + here(X) requires animal(X). + boat_here. + +initially: + here(X). + boat_here. + +always: + nonexecutable crossTogether(X,Y) if -here(X), here(Y). + nonexecutable crossTogether(X,Y) if here(X), -here(Y). + + executable crossTogether(X,Y) if -here(X), -here(Y), -boat_here. + executable crossTogether(X,Y) if here(X), here(Y), boat_here. + + executable cross(X) if here(X), boat_here. + executable cross(X) if -here(X), -boat_here. + + caused -boat_here after crossTogether(_,_), boat_here. + caused boat_here after crossTogether(_,_), -boat_here. + + caused -boat_here after cross(_), boat_here. + caused boat_here after cross(_), -boat_here. + + caused here(X) after crossTogether(X,Y), -here(X). + caused here(Y) after crossTogether(X,Y), -here(Y). + caused -here(X) after crossTogether(X,Y), here(X). + caused -here(Y) after crossTogether(X,Y), here(Y). + + caused here(X) after cross(X), -here(X). + caused -here(X) after cross(X), here(X). + + forbidden here(wolf1), here(fox), -boat_here. + forbidden here(wolf2), here(fox), -boat_here. + forbidden here(wolf1), here(chicken), -boat_here. + forbidden here(wolf2), here(chicken), -boat_here. + forbidden here(fox), here(chicken), -boat_here. + forbidden here(chicken), here(worm), -boat_here. + + forbidden -here(wolf1), -here(fox), boat_here. + forbidden -here(wolf2), -here(fox), boat_here. + forbidden -here(wolf1), -here(chicken), boat_here. + forbidden -here(wolf2), -here(chicken), boat_here. + forbidden -here(fox), -here(chicken), boat_here. + forbidden -here(chicken), -here(worm), boat_here. + + inertial here(X). + inertial -here(X). + + noConcurrency. + +goal: -here(wolf1), -here(wolf2), -here(fox), -here(chicken), -here(worm)?