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
- Choose whether your goal is to use
only builtin predicates; or
- Your goal will use one of a small number of
predefined programs, reverse/2, append/3, length/2, or max/2; or
- Your goal will use a program that you enter yourself
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
-
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.
- Next enter your goal. In this case you should NOT
terminate your goal with a period.
- 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:
- success a success with an empty answer substitution
expected, or
- failure if a finitely failed search tree is expected,
or
- error-identifier which is a term identifying the expected error.
Examples: instantiation_error, type_error(atom, 1),
permission_error(modify, static_procedure, foo/2), ...,
or
- impl_dep or impl_defined or
undefined if the expected
behaviour is implementation dependent or implementation defined
or undefined.
Examples of Goals and Expected Results.
Goal | Expected 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.
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