% % the Yale shooting problem -- no 'dead' fluent % with walking % % define fluents and actions fluent(alive). fluent(loaded). fluent(walking). action(shoot). action(load). action(start_walk). action(end_walk). % define time line time(0..n). % initial state h(alive, 0). h(neg(loaded), 0). h(walking, 0). % action effects % shooting causes neg(alive) only if % the gun is loaded and the turkey is not walking h(neg(alive), T+1):- time(T), o(shoot, T), h(loaded, T). h(neg(loaded), T+1):- time(T), o(shoot, T), h(loaded, T). % loading causes loaded h(loaded, T+1):- time(T), o(load, T). % start walking causes the turkey to be walking h(walking, T+1):- time(T), o(start_walk, T), h(neg(walking), T). % end walking causes the turkey to be not walking h(neg(walking), T+1):- time(T), o(end_walk, T), h(walking, T). % action occurrences %%% o(shoot, 0). %%% o(load, 0). o(shoot, 1). %o(load, 0). %o(shoot, 1). 1 { o(A1,T1) : action(A1) } 1 :- time(T1). :- not h(neg(alive), n). % static causal laws h(neg(walking), T):- time(T), h(neg(alive), T). % what was missing is the rule that say "thing do not % change by themselve" % F was true at T and is not false at T+1 then % F must continue to be true at T h(F, T+1):- time(T), T