Following is a demo of the blocks.pl program, Task 2.
?- talktome. Currently... the large yellow block is on the table the large red block is on the table the large blue block is on the table the large green block is on the table the small yellow block is on the table the small red block is on the table the small blue block is on the table the small green block is on the table What would you like to do next? |: pickup the red block. Reference resolution error. Try again. What would you like to do next? |: stack the small red block on the small yellow block Currently... the large yellow block is on the table the large red block is on the table the large blue block is on the table the large green block is on the table the small yellow block is on the table the small red block is on the small yellow block the small blue block is on the table the small green block is on the table What would you like to do next? |: stack the large yellow block on the large green block Currently... the large yellow block is on the large green block the large red block is on the table the large blue block is on the table the large green block is on the table the small yellow block is on the table the small red block is on the small yellow block the small blue block is on the table the small green block is on the table What would you like to do next? |: pickup the red block from the yellow block Currently... the large yellow block is on the large green block the large red block is on the table the large blue block is on the table the large green block is on the table the small yellow block is on the table the small red block is in the hand the small blue block is on the table the small green block is on the table What would you like to do next? |: exit false.