1{action(down, T); action(up, T); action(right, T); action(left, T)}1 :- time(T), not finished(T). #show state_at/2. #show action/2. cell((0..17, 0..7)). #minimize{1, X, T: action(X,T)}. adjacent(right, (X+1,Y),(X,Y)) :- cell((X,Y)), cell((X+1,Y)). adjacent(left,(X,Y), (X+1,Y)) :- cell((X,Y)), cell((X+1,Y)). adjacent(down, (X,Y+1),(X,Y)) :- cell((X,Y)), cell((X,Y+1)). adjacent(up, (X,Y), (X,Y+1)) :- cell((X,Y)), cell((X,Y+1)). %AAA state_at((2, 5), 0). %BBB %CCC time(0..250). %DDD