Using the Specification CGI

Testing an example on the live specification page is done in two steps.

Step 1

In the first step you can You select from these options by using the drop down list on the right just below the first large text area. You make this choice by clicking on the button labeled "select". If you have selected "uses only built ins" or one of the predefined programs then the first text area is filled in either with the program or "Uses only Built In Predicates". Note that the boxes for the goal and expected result now both display the value ``true''.

If you have chosen "user program" the text area remains empty.

At present the menu continue to display "use only builtins" after you have made your selection. In a later version this will be changed.

You can change you selection if you wish before proceeding to the next step.

Step 2

  1. If you selected "user program" now is the time to enter your program. Enter it just as you would enter it to a file. In particular each clause should be terminated with a period.
  2. Next enter your goal. In this case you should NOT terminate your goal with a period.
  3. If you wish you can leave the expected result blank. Otherwise enter your expected result. In general your expected result will consist of a set of substitutions, one for each instance of the goal. The substitutions for each instance are separated by semi colons and in the order expected. Thus --
    X <-- 1 , Y <-- 2 ; X <-- 2, Y <-- 3
    This describes two substitutions one in which X gets 1 and Y gets 2, and a second in which X gets 2 and Y gets 3. There are a number of special cases:

Examples of Goals and Expected Results.

GoalExpected Result
(X = 1; X = 2) X <-- 1 ; X <-- 2
1 =:= 1.0 success
2 < 1 failure
functor(T,F,3) instantiation_error
f(X,1) = f(a(X), 2) undefined
f(X,1) @< f(Y,2) impl_dep

Once you have entered these data you click on "submit" and the result should appear in the lower text area.

Note At present it is not possible to test the input output predicates using this CGI program.

The Prolog Code for the CGI


Author: J.P.E. Hodgson
Inria Rocquencourt
78153 Le Chesnay Cedex
France

Saint Joseph's University
Philadelphia PA 19131
USA


Last Changed: 15 February 1999