Instructions for Installation of the BELIEF package:

1) Using FTP copy the file belief1.2.tar.Z.  This is available from
belgica.stat.washington.edu (128.95.17.57) or stat.washington.edu.

2) Extract the files from the tared and compressed version with 
	zcat belief1.2.tar.Z | tar xfv - belief1.2

this will create a directory belief1.2 and put all the files beneath it.

3) Edit the lisp-init.lisp file to show the home directory of the
BELIEF package on your system.  If you changed the names of the files
lisp-init.lisp or belief-init.lisp to reflect your operating systems
naming conventions you should edit the (bel-require 'belief-init)
call.  If you are using Allegro CL, you should use the file
franzinit.lisp instead of lisp-init.lisp

3) Compile the c program rng.c which provides the random number
generator for the simulator (note: it is perfectly possible to run
many routines without the random number generator, but for the Monte
Carlo algorithms, you will need it).  Edit the file bymachine.lisp to
reflect your location for the file rng.o.  

4) If you are using a Common Lisp Implementations other than Lucid,
Allegro, CMU Lisp or Kcl, you may need to modify the code it
bymachine.lisp and add a new by???.lisp file.  (If so, or if you fix
one of the ones I have, please send me a copy).

5) If you are running an older version of Lisp which does not support
the Steele[1990] draft of the ANSI standard, you may need to make some
changes.  (Version~1.1 is written to Steele[1984] standards but has
several known bugs).  In particular, if your system does not have the
defpackage macro, you should use the version in the borrowed
directory.  If your system does not have the declaim macro, you may
need to define it:
	(defmacro declaim (&rest args) `(proclaim ',args))
This may need to be wrapped in an eval-when if you are compiling.

6) Uncompress the files in the doc director and TeX (literally, not
LaTeX) the files.  Print the resulting user manuals.

7) Test the core program by running some of the sample data bases.  The
correct results from the smoker and smokepot data bases are given in
Lauritzen and Spiegelhalter[1988].  The correct results from failure2
are given in Dempster and Kong[1988].  The correct results from
captain are given in Almond[1988,1989].  All of these rule bases,
except for smokepot should be loaded with load-bel.  smokepot should
be loaded with load-prob.  smokepot is currently the only test data
base using the potential mode.  

Now test the monte carlo stuff, by loading the data bases
crossed-tree.rules and martz.rules.  Crossed-tree is in belief mode
and martz is in prob mode.  You should be able to run (mc-up-loop 4)
and get sensible answers.

If there are no errors, then you may go on to the next step.  If there
are errors, it is due to incompatibilities between lisp versions.  I
would appreciate mail (to almond@stat.washington.edu) describing any
problems.  Unfortunately, you will probably need to debug them
yourselves.

8) You may consider the program installed at this point, however, it
will work much faster on your system if you compile it.  Edit the file
compilation.lisp to reflect local compilation options, and then run it
(using load from inside lisp).  Note that this must be a version of
lisp which loaded lisp-init.lisp because the compiler will need the #?
and #! read macros.  If you have difficulty compiling, it may be
because these need to be defined at the top of the input files for
your version of lisp.  Copy the set-dispatched-etc command from the
belief-init file to the other files.  If you succeed in compiling
these files, then you should edit the lisp-init file to load the
compiled rather than the interpreted versions of the commands.

9) Good luck!  I will try to answer any questions sent to
almond@stat.washington.edu or almond@statsci.com

---------------------------------------------------------------

Known incompatibilities between lisps which effect the BELIEF package.
The following "feature" was found in VAX Common LISP which caused the
need to patch certain portions of the code dealing with potentials.  

The function (map '(vector long-float) #'* vec1 vec2) where vec1 and
vec2 are of type (vector long-float) yields and answer which is of
type (vector t).  Furthermore, in VAX Common LISP (coerce '(vector
long-float) x) where x is of type (vector t) returns an object of type
'(vector t) which is in spec for the coerce statement but kind of
sleazy.  To get around this problem, I have used the expression 
(coerce '(vector long-float) (map 'lisp #'* vec1 vec2)).  
This is found in the functions prod-array and renormalize array in the
potentials file.  If your lisp somehow lacks this "feature", you may
wish to edit this to reflect the more straight forward (map '(vector
long-float))

SUN Common LISP (at least version 2.0 which I have) neatly finesses
the operation by not supporting long floating point numbers.  
It appears to work correctly in Kyoto Common LISP.

----------------------------------------------


Allegro Common Lisp: there are some problems with the global versus
process local redefinition of input read characters.  The file
franzinit.lisp is the version of the lisp-init file I genertated to
deal with this problem.  


--------------------------------------------------------

Version 1.2  --- In order to migrate to the way Allegro Common Lisp
4.0 works, I have had to re-write the package interface.  It uses the
new "defpackage" construct as specified in CLtL-2, which (barring any
late changes) should be the version avaible in ANSI Common Lisp.
Users of the older lisp standard (Steele[1984] will need a "defpackage"
macro loaded.  The should explicitly load the file
belief1.2/borrowed/defpackage.lisp which provides a free definition of
"defpackage".  



	--Russell 

