COSC 159 - Artificial Intelligence Assignment #6 Building with Blocks Due: Monday, April 20 GOAL: Write Prolog predicates which define operators for stacking and unstacking blocks and demonstrate how they can be used with the means_ends predicate (discussed in class) to plan block-stacking tasks. DETAILS: On pages 313 and 314 in the textbook, operators are defined for a simple block-stacking task. The basic assignment calls for you to use the Prolog format presented in class to define these operators for use with the Prolog means-ends analysis predicate. The directory ~mikes/159/planning on studsys contains files such as machine.pr and flash.pr which show how to define operators in other task settings. Also there are log files (log1, log2) which show how to "run" these problems. The file mea.pr contains the definition and supporting predicates for the means-ends analysis. You shouldn't need to change anything in this file. Note that the book is using these operators (on p.314) for a different type of planning (plan-space search) than we are. Also, recall that the book is using Lisp syntax for its operators and state descriptions, whereas we will be using Prolog syntax. You can simply define specific operators for every combination of blocks which will need to be moved (this is the book's approach), or you could use an operator schema to combine similar operators. A simple example of such a schema approach for the flashlight repair task can be found in the files flash2.pr and log3 (and was discussed in class). Also, the text discusses an operator schema for the block-stacking tasks on pages 307 and 308. Implementing the schema will be considered "extra effort", but you may find it's actually easier than writing out all of the specific operators. REQUIRED TASKS: Your code should allow you to produce plans for the following two tasks: Task 1: Given three blocks in the following configuration --- | C | --- --- --- | A | | B | --- --- -------------------------- TABLE construct a plan which will produce the goal state --- | C | --- --- | A | --- --- | B | --- -------------------------- TABLE Task 2: Construct a plan which will change from the first state below to the second START: GOAL: --- | A | --- --- --- --- | B | | D | | C | --- --- --- --- --- --- --- | A | | C | | B | | D | --- --- --- --- ---------------------- ----------------------- TABLE TABLE Remember, you can't move blocks which have other blocks on top of them. Also, the book's operators require that a block be on the table before you can put it onto another block. If you decide to change that requirement, be sure and document that fact. HAND-IN: A brief written description of whatever variables or predicates you use to describe the state, Prolog code defining the operators for this project, and sample runs showing how means_ends can construct plans for the two tasks given above.