Skip to content

Instantly share code, notes, and snippets.

@d4hines
Last active November 26, 2019 00:55
Show Gist options
  • Save d4hines/78331a4e4e82f41463b301c69d9c54c3 to your computer and use it in GitHub Desktop.
Save d4hines/78331a4e4e82f41463b301c69d9c54c3 to your computer and use it in GitHub Desktop.
Tiny example domain for getting architecture feedback.
#const n = 4.
step(0..n).
% Actions can affect state.
% Actions always produce a single new model.
state(Val, I + 1) :- occurs(action(Val), I).
% Inertia for state.
state(Val, I + 1) :- state(Val, I), not occurs(action(_), I), I < n.
% Transient effects need to be rendered to the screen, but don't affect state.
% Transient effects are encoded in a way that sometimes produces multiple models.
% There may be #maximize/#minimize constraints on those models (or I could just use #max/#min)
{ transient((a;b)) } == 1 :- occurs(transientAction, I).
% Initial State.
state(x, 0).
% History
occurs(action(y), 0).
occurs(transientAction, 1).
occurs(action(z), 2).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment