state_after(V0) :- state_before(V0). state_before((2,5)). action(down). 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)). cell((0..17, 0..7)). #show state_after/1.