Hi There!

I'm Dan Schlegel, an Associate Professor in the Computer Science Department at SUNY Oswego

Prolog Challenge 3

The Entrance

Over the past several class sessions we have been developing a blocks world model in which we have experimented with natural language input, reference resolution, state validation, acting, planning, and generating natural language output – a large swath of cognitive processes! In this challenge you will aim to improve what we have built in various respects, again exploring these same cognitive processes and honing your modeling ability.

Task 1: Improve User Interaction

The first task involves adding three niceties to the program, focusing on the natural language processing, natural language generation, and overall usability of the system. This task is designed to help you get a better feel for how the program fits together.

Begin with a copy of the program from class (see Blackboard). Then…

  1. Start by improving the feedback the program gives when something goes wrong. Minimally it should do the following: if reference resolution fails, the system should tell the user what it can’t resolve. If parsing fails, the system should tell the user that it doesn’t understand the input. There are more opportunities to do nice things, but these two are some minimal expectations.
  2. Add an ‘exit’ command so that you can get out of the talktome rule.
  3. Allow the user to optionally type a period at the end of a sentence. Do this by modifying the grammar so that there is a second rule for sentence (one which ends in a period). You’ll need to put the period in single-quotes to make Prolog happy.

Task 2: Improve Reference Resolution

Consider the following sequence of events, beginning from the initial state of all of the blocks on the table.

  1. Stack the small red block on the small blue block
  2. Stack the large red block on the large green block
  3. *Pickup the red block from the blue block

This last case doesn’t work because our reference resolution is not sophisticated enough to take the stacking context into account.

Continue to build upon your program from Task 1 and improve the reference resolution to allow taking stacking context into account. As you go, thoroughly test the reference resolution code, ensuring that appropriate resolution is always performed. Fix any issues you come across. (Note: in at least one case it currently allows for resolving a block when it’s actually ambiguous – fix this!)

Task 3: Heuristic Planning

Consider that we begin with the initial state:

And we’d like to get to the state:

Consider that you would like to do this yourself. What heuristics could you use? I assume you do it quite a bit differently than the brute-force technique from class! Begin by thinking hard about the problem and creating a list of heuristics. Then, implement one or more of your heuristics in Prolog and see how it works! Be sure to annotate your Prolog code with information about the heuristic chosen and why you chose it!

Hint: you should be able to do this entirely by performing the stack operation – no need to unstack!

Task 4 [Extra Credit]: Modeling Exercise

In this task you won’t write any Prolog code, instead you’ll simply write a document, leveraging your experience with modeling so far in the course, expressing your thoughts on what a more sophisticated blocks world model might look like.

Consider a blocks world in which we add:

  • Cones, one of each of the four colors. Cones may be stacked on blocks, but nothing may be stacked on top of a cone.
  • An ordering, from left to right, of the blocks/cones on the table, so that we can tell which which objects are left or right of the others.
  • The ability to ask the system hypothetical questions like: can the blue cone be stacked on the small red block? or can the red block be unstacked from the large blue block?
  • The ability to refer to objects by location, like: stack the cone to the right of the red block on the green block.

Discuss in a well-organized and well-written document how you would model this. What you are doing is essentially all of the planning work for enhancing our model, only you are not going to actually implement the changes in Prolog. Somethings to consider:

  • What new predicates or relations might you add?
  • How might you modify representations we already have?
  • What will the grammar look like?
  • How will we need to change our reference resolution rules?
  • How will validation and acting rules change?
  • What new natural language generation work is needed?

You may have more things to consider!

This extra credit will act to replace the grade of one task on any of the prolog challenge assignments if you missed one. Or, it will improve your score by an equal amount.

The Exit

When done, be sure to post all of the artifacts you have generated from this challenge on your course web site!