From: Mark Tarver
Subject: testing an SBCL port of Qi
Date: 
Message-ID: <1177108614.887838.259860@p77g2000hsh.googlegroups.com>
This is a copy of a response on Qilang.

Hi,

You've made an SBCL port of Qi and want to know how to test it.

There are two sets of test suites for Qi which you can run to see if
your patches work.  They are included in the distribution.  The
programs in them include ones in the text FPQI. Here's how to do it.

1.  First load a Lisp program "test harness.lsp".  It's Lisp so use
LOAD.

(0-) (LOAD "test harness.lsp")
T

2.  Then run the first test suite which uses the harness

(1-) (load "test suite 1.qi")

You'll get nothing until you hit RETURN.  After that Qi will print an
expression and wait, you hit RETURN and it will produce the result of
evaluating that expression.  You keep on going until the suite is
finished.

Test suite 1 goes through > 100 examples from FPQi and tests Qi Prolog
and Qi YACC.  It was put together to save the tedium of bashing all
this into the terminal.

The second test suite goes through all the typed stuff in FPQi and
works in the same way as test suite 1 - you just load it.  Two small
patches to this file which I've not got to putting in.

At the head of the suite, before

(cd "Qi Programs")

put (cd "")

You need to reset the home directory by entering (cd "") into Qi
before you load it because test suite 1 sets it to "Qi Programs".

Also you should add

(preclude-all-but [])

before

(load "Chap16/microMycin.qi")

because this suite will load *every type theory in FPQi* and the type
checker gets stuffed with irrelevant junk from all the previous
chapters. The typechecker is preset to abandon checking when the
maxinferences counter exceeds 10^6.   See FPQi on that.  At 600 KLIPs
(CMU) you can comfortably reset this to 10^7 (see maxinferences
function), but it's better to clean the junk out by precluding it. See
chap 11 on preclude.

(To give you an idea, the program in appendix G takes about 700,000
inferences to prove type secure in a clean image and > 2,000,000 if
the TC has to carry around all the junk rules from earlier programs)

These test suites were originally intended just for my use and so I
didn't doc them as I did a lot of other stuff.  Hence you have to be
able to see what the results should be.  Not a problem for me, but if
people are making patches, probably some comments would be good and
I'll put them in. At any rate, if your version has a bug of the crash-
producing kind this will almost certainly unearth it.

Somebody asked after an SBCL port of Qi on comp.lang.lisp so I've
copied this response to that forum too.

Mark