block of worlds with position aware goal stack planning
Your best bet would be to formulate the problem in PDDL, which should be fairly easy, and then use a standard planner to generate a plan from that description.
In PDDL you describe the properties and the possible actions, the start state and the goal state, and the planner will then take this to produce a sequence of actions that leads from the start state to the goal state. There is a planner available on-line that you can use.