Skip to content

Instantly share code, notes, and snippets.

@simonespa
Created November 26, 2023 15:51
Show Gist options
  • Select an option

  • Save simonespa/d39b97cafc54059aca7830f12bc61a5c to your computer and use it in GitHub Desktop.

Select an option

Save simonespa/d39b97cafc54059aca7830f12bc61a5c to your computer and use it in GitHub Desktop.
Monkey & Banana in DataLog
object(box). object(monkey). object(banana).
fluents: at(O,L) requires object(O), #int(L).
onBox.
hasBanana.
actions: walk(L) requires #int(L).
pushBox(L) requires #int(L).
climbBox.
graspBanana.
always: caused at(monkey,L) after walk(L).
caused -at(monkey,L) after walk(L1), at(monkey,L), L<>L1.
executable walk(L) if not onBox.
caused at(monkey,L) after pushBox(L).
caused at(box,L) after pushBox(L).
caused -at(monkey,L) after pushBox(L1), at(monkey,L), L<>L1.
caused -at(box,L) after pushBox(L1), at(box,L), L<>L1.
executable pushBox(L) if at(monkey,L1), at(box,L1), not onBox.
caused onBox after climbBox.
executable climbBox if not onBox, at(monkey,L), at(box,L).
caused hasBanana after graspBanana.
executable graspBanana if onBox, at(monkey,L), at(banana,L).
inertial at(O,L).
inertial onBox.
inertial hasBanana.
initially: at(monkey,1).
at(box,2).
at(banana,3).
noConcurrency.
goal: hasBanana ? (4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment