I have the following blocks world program and I want to create a serializable plan for the following scenario:
Initially:
loc(m)=table, loc(l)=m, loc(a)=l, loc(b)=a, loc(c)=b,
loc(o)=table, loc(n)=o, loc(d)=n, loc(e)=d, loc(j)=e,
loc(k)=j, loc(f)=table, loc(g)=f, loc(h)=g, loc(i)=h
In maxstep:
loc(e)=j, loc(a)= e, loc(n)=a, loc(i)=d, loc(h)=i,
loc(m)=h, loc(o)= m, loc(k)=g, loc(c)=k, loc(b)=c,
loc(l)=b.
The scenario says that initially block m is on the table, block l is on block m and so forth. The blocks world scenario would look something like the following:
[initial state][1]
Following is my code:
location(B) :- block(B).
location(table).
% two blocks can't be on the same block at the same time
:- 2{on(BB,B,T)}, block(B), T = 0..m.
on(B,L,T+1) :- move(B,L,T).
:- not {move(BB,LL,T)} grippers, T = 0..m-1.
:- move(B,L,T), on(B1,B,T).
:- move(B,B1,T), move(B1,L,T).
1{on(B,LL,0):location(LL)}1 :- block(B).
:- not 1{on(B,LL,T)}1, block(B), T=1..m.
{move(B,L,T)} :- block(B), location(L), T = 0..m-1.
{on(B,L,T+1)} :- on(B,L,T), T < m.
#show move/3.
I looked up the definition of a serializable plan and it says that actions that are scheduled for the same time period can be instead executed consecutively, in any order without affecting the result.
How can I modify my code so that I can input the number of maxstep and get the minimum number of actions? Also, the grippers could be thought of as arms that moves the blocks. [1]: https://i.stack.imgur.com/cfN3W.png