hw4 - COP4020 Spring 2011 Homework Assignment 4 1. Consider...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
COP4020 Spring 2011 Homework Assignment 4 1. Consider the following tic-tac-toe board positions: X O O X X O That is, the program database holds the following facts (in this order): x(1). x(5). x(6). o(2). o(3). o(7). Show a trace of the execution of sub-goals to solve the goal ‘ move(X). ’: Use the tic-tac-toe program shown in the lecture notes, not the one in the textbook, which is slightly different. You can download the program from: http://www.cs.fsu.edu/~engelen/courses/COP4020/tictactoe.gz Change the source so that the X and O are set as shown in the figure. On linprog, start Prolog with ‘ pl ’ (or swipl ’ or ‘ xpce ’ when available) and load the program with [tictactoe]. ’ (don’t forget the period to terminate the command). Type move(X). ’ to query the system, but notice that the starting board positions are different in this demo. Use ‘ listing. ’ to show the program database. Use ‘ trace. to activate the tracer before you enter a goal (use ? for help and type ENTER to creep
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

hw4 - COP4020 Spring 2011 Homework Assignment 4 1. Consider...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online