mullSP
muSTAR 80
tm
Artificiallntellioence
.,
Development
SystemRe1ercnce
Manual
August
1980
•
Copyright
C)•
~
~
Th~
o t
W
IrehClus~
tt l
All
RiKhts
R~~nt ~~
\ 4lfldwide~
../
R. nri ·ft
~ f:l
,
••
·,,,,i··.....,
COpyrightNoticeCopyright
(0.
1980
by
The
o
Warehouse.
All
RightsReservedWorldwide.No
pan
ofthism.anual
rT
p oduced
transmined
transaibed stored
in
~
retrievalsystem.
or
translatedinto
iny
human
or
Corr
I.anguage.inanyform
or
by
anymeans,eleCtronic,mechanical,magnetic.optical.
chemical
man..
otherwise.
without
the
express
wrinenpcrmission
of
The
Soft
Warehouse.
P O
Box
74.
HonHawaii
96828.U.S.A.
Discbimer
The
Soh
Warehouse
makes
no
representations
or
warrantieswith-respect
tothecontents
hereof
and
specific
disd.ims
anyimpliedwarranties
of
merchantability
or
fitnessforany
paniculv
purpose.
funner
Soft
Warehouse
reserves
the
right
to
revisethispublication
andto
makechangesfromtimetotime
in
contenthereof
withoutobligation
of
The
Soft
Warehouseto
notifyany
personor
organizationof
S
revis;on
or
changes.
muUSP/muSTAft 80
i
distributedexclusively
by
Miaosoft
10800N.£.
Eighrh S\J tt
819.
Bellevue,
\VA
980048701
: 00-02
A
Brief
History
of
muLISP
muLISP-80
represents
theculminationof
4
years
of
effort
into
designing
a
general
purpose
LISP
system.
It
was
developed
almost
entirely
on
microcanputers
for
m.ic:rcx:ant:Uters.
1'he
original
interpret.er
was
completed
in
1977
by
Albert
O.
Rich
using
LISP1.5
as
a
guide.
It
was
int:.e.nCed
solely
for
use
in
mec ~caltheorem
PCCN ing,
s-pecifically
for
the
propositional
and
predicatecalculus
of
formal
logic.
This
system,
now
called
muLISP-77,
worked
quite
well
for
this
purpose,
althCl.lgh
someJhat
slcwly.
Ibrough
the
foresight
ofDavid
R.
Stoutemyer,
became
ap rent
that
the
potential
uses
for
a
microcanputer
LISP
were
t:emendOJS.
In
plrtiCJ.1a.r,
thepossibl
i
ty
of
imp
enent..i.D3
f
orthe
first
time
a
syrr.bol
ic
mat. 1enatics
systemon
a
microcanputer
was
set
as
a
gcaL
Influe.. .ced
by
t.. 1e
irrlaluable
suggestiQ lS
of
Martin
Griss
and
Peter
Deutsch.,
joint
work
by
Rich
and
Stcutemyer
yielded
a
greatly
enhancedand
robust
LIS?
system.
It
included
infinite
precisim
arithmetic,
streamed
ask
file
I/O,
ar..d
a
paJerful
functioo
bcdy
e laluatiOO
mec.bani.sm.
'. his
ptod1c
vasreleased
in
Juneof
1979
as
JDuLISP-79
by'l'he
50ft
Warehouse,
a
par+ -..nership
set
up
by
StOJtemye.r
andRich
to
facilitate
the
widespread
distrituticn
of
the
sofblare.
The
success
of
muLISP-79
and
its
companion
product
the
IUlSDlP/mu..M.1aB-79
CD
Symbolic
Math
system
encouraged
further
work
on
1m proving
the
systems..
The
need
for
greater
code
densi
ty
and
faster
leading
capabllit:::l
resulted
in
theaddition
of
a
pseudo-code
canpiler
and
interpreter
forthe
auLISP-80
system.
A
major
effort
went
into
making
the
documention
for
muLISP-80
of
the
same
high
caliber
as
the
software.
' be
clarit¥
arxi
completeness
of
this
m.aDJal
is
we
in
large
part
to
the
persistence
of
~
can
B.
Rich.
CUrrently
work
is
being
done
to
make
muLISP
available
for
otherpopularmicro
andminicomputers..
The
adventof
the
16
bit
microprccessors
will
make
possible
the
greatly
impr01ed
perfcrmanceand
data
space
sizes
r«iuired
to
satisfy
the
needs
ofever
larger
AI
research
efforts.
We
i.ntended
to
fulfill
those
needs.
August
2,
lSSO
•
iv
L
: ~
I
s,
~
Preface
The
LISP
computerlanguage
is
based
on
a
paper
by
John
McCart.by
[ 96 ]
entitled
~ J Csive
Functicnsof
Symbolic
Expressioos
and
~eir
Computation
by
Machine-.
Since
itsfirst
implementation
at
the
Massacl lusetts
Institute
of
Tec. malO3Y
in
the
early
1960's,
LLSP
b..:lS
remained
the
~machine
languase
ft
of
~~e
AI
ArtificialIntellisence
CCl't.Qunity.
'n1e
language
and
its
marrt
derivatives
ccnti e
to
monq;.cl.i=e
all
serious
work
in
such
diverse
fields
asrobotics,
nat.Utal
langl:ase
translation,
theorem
proving,
medical
diagnosis,
game
playing,
and
pro;ram
verificatiO l.
LISP
is
the
language
of
choice
for
such
a empt
at
mec ~cal
intelligence
for
the
fallON
ing
reasatS:
1.
LISP
is
an
applicative,
recursive
languagewhich
makes
an
ideal
formalism
for
describing
complex
mathematical
cooceptS..
2.
The
principal
data
structuresin
LISP
are
binarytrees.
SUch
abstract
cbject.s
canbe
made
isancrphic
to
(Le
a
one-to-one
model
of)
the
actual
data
in
mos~
AI
problems.
Once
this
is
accomplished,
the
properties
of
~~e
original
pr
cbl
em
can
be
investigated
by
t=erl
crmiD]
transf
erma
ti
Q 1S
on
the
LISP
datastruet1lres.
3~
When
a
computer
is
programmed
to
simulate
intelligence,
must
be
able
to
respond
to
queries
of
arbi
t.I
a.r:y
difficul
t y
The
static
storage
allccatioo
sc ~emes
of
ca rJ entioo.al
programming
languages
makes
very
diffiOJl
t
to
dea.:
with
such
ended
prcblems.
lbese
diffioJ.ltiesare
allevi.41ted
in
LIS?
by
dynamic
allocatioo
and
recycling
of
datastorage
re.soo.rces
by
means
of
autanatic
garbage
collecticn.4.
A
highly
interactive
environment
is
essential
for
intelligent
human-machine
canmunicatim.
' he
ease
with
which
LISP
functicn
definitioos
can
be
regarded
as
data
enccurages
incren\ental
system
development
and
makes
LISP
an
idealinteractive
language.
' be
Cevelc:pnent
aOO
distrituticn
of
muLISP-79
by
be
SCF1
WAR.EE:OSE
helped
to
make
LISP
available
to
th.e
rapidly
grOJing
communit:'J
of
micrcx:c:np.lter
users.
' his
was
the
first
efficient
r
-Ptcd1etioo·
versicn
of
LISP
for
such
computers
and
is
bein~
used
in
a
wide
variety
of
.
~icaticns
,
The
challenge
to
meet
the
ever
increasing
memory
and
speed
requirenents
ofmost
AI
software
systems
inspired
the
development
of
muLISP-80.
An
increase
in
code
densit::y
by
a
factor
of
three
and
a
20\increase
in
exeOJticn
speed
has
been
achieved
by
means
of
a
pseudo-cooe
compiler
and
interpreter.
Since
compilation
and
de-compilaticn
occ..:r
automatically,
theprocess
is
invisibleto
the
user.
Thus,
t e
interactive
r.atureof
muLISP,
so
essential
fer
mast
AI
aWlicati s
is
not
sacrificed
in
t.. 1e
interest
of
efficiency.
Finally,
t:. le
addi.
tion
of
the
mUS'r.J\R-80
AI
DevelopmentSystem
to
muLISP
ra.mded
out
the
package
vit. 'la
resident
display-oriented
editor
and
deb..lgging
facilities.
iii
......
.
_
.........
-------- ---_
fableof
Contents
Kemoxy
Management
A.
Initial
Data
Space
Partiticn
B.
GaJ:bage
COllection
••••••••••
C.
Reallocation
of
Data
Space
Boundaries
D.
Insufficient
Me:nory
Trap
.AD
Int.rcrlJct.ia1
to
D.1LISP-8O
A.
Major
Features
•••••
B.
' he
~ aster
Diskette
C.
The
Basic
Interac+ -lQ'1
Cycle
D.
he
Exec..1tive
Driver
Loop
E.
U11L.ISP
Ptog
ran:m.i.ng
•••••••
F.
Interrupting
Program
Execution
••
G.
Error
oiat;nostics
B.Eav ironment
SYS
Files
o
VI-2VI-3VI-4
V-2.1
V-25
V-31
V-32
A-l
A-2
A-4
A 5
A 6
A 9
VI-5
VI-6
VI
VI a
VI a
VI a
VI-9
VI IO
VI-ll
VI-ll
VI-12
...
...
.....
.
.
.
Printer
Functions
and
Control
Variables
Evaluation
Functions••••••••••••••••••
Me:Dory
Management
Functions
Environment
Functions
_•••
Backl..:S-Naur
Fom•••••••••••••
Bow
to
Copy
the
Master
Diskette
••••
ImpleDffiting
MachineLanguageSUbroutines
•••
LISP
Bibliography
•••••••••••••
Function
Index•••••••••••••
Concept:
I.rxiex
__•••
N.
o.
P.
Q.
Appendices
DIJSrAR
AIDS
A.
Main
Menu
Coaxnands
1.
e:titor
Facilities
Debugging
Facilities
Disk
~O
Facilities
B.
Text
Editing
1.
CUrsor
Control
•
2.
Display
Control
3.
Entering
Text
4.Deleting
Text
5.
F
irrling
Names
6•
Ex i
ting
Editor
•••••
7•
CClIma OO
SUntnary
Table
c.
Custanizing
II11STJ\R
1.
Console
CJ.stomi.zation
2.
The
lIIJSTAR
Executive
•••••••
3.
Text
Data
Structure
.
...
Text
Primitivies
••••••••••
_••••••
A.
B.
c.
D.
E.
-F.
VI.
i
1i
iii
iv
v
1-1
I-2
1-3
I-3
I-4I-6
I-7
1-7
II l
II-2II-3
•
III l
llI l
III-2III-2
.
.
IL
Primitive
Data
St:xuctw:es
.A..
Names
.B.
N mCers
c.
Title
Paoe
Copyright
Notice
Preface
••••
A
Brief
ei.story
of
muL.I.SP
Table
of
COntents
IV.
rbe
JIU-LI.SP
Meta-]
A.
Heta-syntax
B.
· e~tics
IV-l
IV-l
o
i
V-l
V 3
V 4
V 5
V o
v a
V-9
V-ll
V 12
V-D
V 14V 16
V-l7
••
.e
•
l~~r
Functioos
••
COnstructorFunctions
Modifier
Functicns
•
RecognizerFunctions
~ tor
Func ~cns
Log ieal
Functions
.
Assignment
Functions
Prope rt:
~ ons
•
Flag
Func --icns
•••
Def
tion
Functions
SUb-atemicFunctions••••••••
~erical
Functions
e
ReaderFunct:icnsand
Control
Variables
Prlmitively
Defined
FUrx:tioos
A..
B.
c.
D.
E.
F.
G.
B.
I.
J.
It.
L.
K.
v.
v
Section
I:
An
Intoduction
to
muLISP-80
Congratulations
on
your
purchase
of
the
muLISP-80
Artificial
Intelligence
Development
Syste.t1
mu.LlSP-80
AIDS).
This
system
is
a
revolutiof'..ary
and
sophisticated
soft-flarepackage
for
m.icrocomFuers.
It
has
been
designed
to
ce
capable
of
S l..rting
a
'Wide
range
ofserious
AI
research
efforts
Some
degree
of
study
and
patience
is
required
to
properly
use
muLISP-80
as
a
development
tool
forthe
'large
soft· 'are
systems
required
for
such
aA?lications.This
sectionofthe
muLISP-60
AIDS
Reference
Manual
providesthe
m ini um
infocnation
necessarJ
to
load
and
use
the
syste... l,.
The
re. Uair..c
of
the
mar.ual
provides
a
detailed
explanation
of
muL.ISP
di:lta
str....ure.s
memory
management,and
primitively
definedfunctions.
ery
atpt
r..as
been
made
to
make
the
manual
as
clear
and
precise
as
l=Ossible:howeve:-,
is
Dot
a
tutorial
en
t.he
LISP
programming
language.
The
best
way
to
learn
cuLISP
is
by
exploratory
use
of
thesystem
in
parallel
with
so.:dy
of
this
manual.
If
this
reveals
an
insufficient
knowledge
of
LISP
on
the
partof
the
user,several
good
references
are
given
in
tb.e
bibliography
at
the
end
of
this
mat IJal.
A.
Kajor
Features
1.
A
total
of
83
LISP
ftmctions
are
defined
in
machine
l.anguage
for
maximum,
efficiency.
These
functions
providean
array
ofdata
st.rueture
primitives
n l~
a
full
complement
of
selectors,
constructors,
modifiers,
re<:09ni ers
and
canparators.
see
secticn
V-A,B,C,D,E)
2.
Infinite
precisionintegerarithmetic,
expressed
in
any
desired
radixbase
from
2
through36,
is
supported
by·
a
c:cmplete
set
of
numerical
primitives-
see
section
V-L
3.
A
two-pass
compactinggarbage
collector
performsautomatic,
dynamic
memory
management
on
aJ.l
data
spaces.
A
garbage
collection
typically
requires
less
than
half
a
secood
to
canplete.
see
section
III-B)
,
4.
Dynamic
reallocati<n
of
data
spaceboundariesoccurs
automatically
to
most
efficiently
use
all
available
memory
resources.
see
sectim
III-C)
s.
Program
controlconstructs
incJ.JJde
an
exte.OOed
CCNJ,
a
multiple
exit
IDJP,
ar.da
powerful
function
body
evaluation
mec.. 1anism.
'lbese
features
[:er:nit
programs
to
be
writtenin
an
elegant,
p.1reLISP
style
while
still
allowingthe
efficiency
of
iteration
when
is
awlicable.
see
section
V-{])
6.
I AMEOA
defined
functions
can
be
made
either
call-by
value
CBV)
or
call-by-name
(CBN).
In
aeXtition
func ons
can
bedefined
as
being
either
spread
or
no-spread.
See
~ on
IV-B
7.
Inadditionto
muLISP's
interactive
environment,
programdebugging
is
facilitated
by
a
residentdisplay
oriented
editor
and
a
trace
package.
see
section
VII)
8.
muLISP
is
fully
integratedinto
Digital
Research's
cp/Mtm
Oisk
operating
system
and
such
upward
comptible
successors
as
Cromemco's
ax:s
tm
,
and
IMSt\I's
l:MIX Stm.
9.
muLISP
requires
only
9K
bytes
of
machinecode
storage,leavingthe
remainderof
the
compute;'s
memory
availablefor ta.stt:uctures.
A
m ini mum
system
will
run
in
as
little
as
20K
bytesof
comp.lte.rmemory.
10.Extremely
fast
program
execution
speeds
have
been
achieved
through
the
use
of
such
techniquesas
shallowvariable
bi..r¥iin3,
address
typed
data
sttuetures,
arx1
a
closed
pointe.t
universe.
see
section
II)
1 1
E\1IlCtioo
definiticns
are
automatically
compiled
intO
distilled
code
or
D COde
when
they
aredefined.
The
inverse
process
of
de-<:ompiling
occursautomatically
when
a
definitien
is
retrieved.
Thiscompilation
results
in
a
threefold
increase
in
code
density
over
storageas
a
linked
list
and
about
a
20
impl:ClVement
in
execution
speed.
(See
section
v J
12.
N.lmercus
I/O
control
variables
have
been
in:luded
tohandlesuch
issues
as
upper/lower
case
conversion,console
edit
mode,
and
the
pri