(We deliberate not about ends but about means. For a doctor does not deliberate whether he shall heal, nor an orator whether he shall persuade, nor a statesman whether he shall produce law and order, nor does any one else deliberate about his end. They assume the end and consider how and by what means it is to be attained; and if it seems to be produced by several means they consider by which it is most easily and best produced, while if it is achieved by one only they consider how it will be achieved by this and by what means this will be achieved, till they come to the first cause, which in the order of discovery is last. — Aristotle, Nicomachean Ethics Book III.3, 1112b, translated by W.D. Ross, 1908.)
In this lab exercise, you’ll work with the General Problem Solver (GPS).
The General Problem Solver (GPS) was an attempt by H. Simon, J. Shaw and A. Newell to build a universal problem-solving engine based on means-ends analysis (as articulated by Aristotle in Nicomachean Ethics, III.3). It was first developed in 1957 and written using the Information Processing Language (IPL - basically an assembly language with list processing). You’ll be using a Python implementation of the General Problem Solver (GPS) built by D. Connelly for P. Norvig’s Paradigms of Artificial Intelligence Programming text.
To install the course Python tools and get started with the GPS implementation, do the following:
If you haven’t already done so, create a Python virtual environment for this course, clone the course code repo, and fire up the IDE (see the guide). The course repo includes tool libraries for:
Take a look at the gps.py
file in the PAIP tools and
answer the following questions:
If you haven’t already done so, create your own course repo
(again, see the guide), and create your own package for lab 1
(cs344/lab01
).
Copy monkeys.py
into your new package, and get it to
run. Then answer the following
questions:
Save the answers to these questions in a text file,
lab_1.txt
, so that you can submit them later.
The blocks world is probably the most famous of the “toy” domains studied in AI. Familiarize yourself with the domain’s rules before proceeding.
Load blocksworld.py
and configure it to solve the following
problems:
Save your program file for this exercise. Name it lab_2.py
.
In retrospect, GPS wasn’t very G; it’s P’s weren’t very interesting; and it didn’t always find an S. First, it turns out that planning for common problems in the blocks world is NP-hard, but this wasn’t well-understood in the early days of artificial intelligence. Second, there are limitations of the mechanism that had to be painstakingly identified and addressed over the years.
Specify and implement a problem that GPS cannot solve. Special honor goes to those problems that you can solve but GPS can’t solve. When you’ve specified your problem, check to see if you can get things to work by manually re-ordering the sub-goals or operators.
Save a program file, lab_3.py
, with your problem
specification and comments.
In retrospect, one wonders what basis there was for the triumphalist quotes common in the early days of AI (e.g., these quotes from Herbert Simon in 1956 and 1958).
Submit your solution by committing the files specified above to your GitHub
repo under the directory cs344/lab01
. We will grade your work
according to the following criteria:
See the policies page for lab due-dates and times.