Assignment #1

Date Assigned: Friday, Jan. 23, 1998
Date Due: Friday, Feb. 6, 1998

  1. (Small warm up exercises in PROLOG)


  2. One major use of PROLOG is to create diagnostic expert systems. For example, if there is no fuel in your car, then it will not start. If the car doesn't start, we would like to diagnose that fault and perhaps, hypothesize that there is no gas, assuming we have no reason to believe otherwise (maybe you just filled the tank). So, assume that we say:
    
    nostart(X) :- nogas(X).
    nostart(pontiac).
    
    Is it possible to make PROLOG infer that pontiac has no gas? If so, how would you do it? If not, how would you go about doing this kind of "abductive" inference?
  3. (Reverse Engineering) Here's a logical description of Euclid's algorithm for finding the greatest common divisor (gcd) of two numbers:


    and here's one PROLOG version of it:

    
    gcd(U,0,U).
    gcd(U,V,W) :- not(V=0), R is U mod V, gcd(V,R,W).
    
    Of course, there is a lot of syntactic sugar in this, but the basic idea is the same. Alternatively, the last rule can be thought of as:
    
    gcd(U,V,W) :- notzero(V), modval(U,V,R), gcd(V,R,W).
    
    if you find this more intuitively appealing (But take care to note that notzero and modval need to be appropriately defined by you).

    The task of this problem is two fold :



  4. Conduct data mining on the Car Evaluation Database (it's really a file) from the UCI Machine Learning Database Repository (Scroll down the page to get to this database). The purpose of this database is to record car prices, technical and safety features and use this information to relate to the car's acceptability in the market. You can also obtain it from the ftp address ftp://ftp.ics.uci.edu/pub/machine-learning-databases/car/ (use the files car.names and car.data). Notice that you will have to change the format of this file from its present form to the format required by PROGOL (a knowledge of UNIX shell scripting would come in useful for this).



Return Home