http://wrap.warwick.ac.uk/
Original citation:Wadge, W. W. (1978) Programming constructs for nonprocedural languages. Coventry, UK: Department of Computer Science. (Theory of Computation Report). CS-RR-023
Permanent WRAP url:
http://wrap.warwick.ac.uk/46323
Copyright and reuse:
The Warwick Research Archive Portal (WRAP) makes this work by researchers of the University of Warwick available open access under the following conditions. Copyright © and all moral rights to the version of the paper presented here belong to the individual author(s) and/or other copyright owners. To the extent reasonable and practicable the material made available in WRAP has been checked for eligibility before being made available.
Copies of full items can be used for personal research or study, educational, or not-for-profit purposes without prior permission or charge. Provided that the authors, title and full bibliographic details are credited, a hyperlink and/or URL is given for the original metadata page and the content is not changed in any way.
A note on versions:
The version presented in WRAP is the published version or, version of record, and may be cited as it appears here.
The
Univensity
of
Warwlck'
THEORY
OF
COMPUTATION
REPORT
NO.23
',*O
G
RAI,I
I'II
NG
CONSTRU
CTS
FOR
N O N P RO C
ED
URA
L
LA
N G U A CES
BY
HILLIAI'1
l,l.
l^lADGE
Department
of
Computen ScienceUniversity
of
WarwickCOVENTRY CV4 ?AL E}IGIAND.
PROGRAMMING CONSTRUCTS
fon
NONPROCEDUML I,ANGUAGES
I{illiam
W. Wadgei
Abstract: In this
paper howa
prr:edenotative
(nonprocedural) language based on:
the
lambdacalculus
can be providedwith
purely
denotative analogsof
the
var"ious constr:ucts-
such aswhile
loops, blocksr
case statements andthe
like - of
conventional irnpenative stnuctured pnognarnninglanguages.
They can besinulated
quite
adequately usingonly
twosirnple
tools:
phrases, whichare
compound e:ipnessionsnot unlike
blockst and pnonouns,special
vaniablesnot unlike
keywonds between whichcertain
relationsbips are
runder"stoodrto
hold.Computen Scienqe Depantment, Univensity
of
Warwick, Coventry UKThis
paper was presentedat
the
3r'dfnternational
Symposiun on Prognarrning,0.
Introduction
A
denotative
(on nonpnocedural) programning languageis
a
language based onsome mathematical
fonnal
system, such asthe
l-calcuLus
or"predicate
logic.
Aproglram
in
sucha
tanguageis
a
tenn or" formulain
the
formai. system,rather
thana
sequenceof
comrnandsto
be executed, andits
neaningis
'she valueof
the
exppes-sion
o::the solution(s)
of
the
formula,
r,athen thanthe
nesult
of
obeyingthe
com-nands.
Thegreat
advantageof
denotati.ve languages i,sthat
the
tnansformation oninference
nulesof
the
fonmal systen can beapplied
dir:ectIy
to
prog:!'ams, andare
,'powenfut
nules fon
pnogranvenification
or
massage.
,
ffr"
merits
of
the
denotative approach have been wel-i under:stoodfo::
at
least
a
dozenyears
now (seethe
discussionfollowing
Landints rtThenext
700 programninglanguagesrr, Landin
[3]),
but
at
pnesent few computenscientists
would consider themto
be seniousalter"natives
to
conventional impenativelanguages" This
is in
palt
,due
to
sone sirnple nisunderstandings(fon
example,the
widespreadbelief that
com-putation
is
inherently a
sequential
activity);
but
thene anealso
rnone seniousob-jections
to
denotative languages,in
matters bothof
form(syntax)
and meaning(semantics).
The rnain
objection
on semantic groundsis that
progranmers usinga
denotative language have no contr"ol oventhe
behaviour.(as
opposedto
the
ureanl.ng)of
thei:t
prograns,
ie
they
cannot make anything happenthe
waythey
want.
The conclusion:that
denotative pnognanmingis
inhenently
inefficient.
r Andthe
rnainobjection
on s1mtactic grounds(the
onewith
whichthis
paper:is
concenned)
is that
denotative languagesare
too
impoverishedof
exp:ressionrlackingas
they
dothe
r^ich variet5rof
constr.ucts-
blocks,
for: Ioops,
case statements andso on
-
foundin
impenativelanguages.
The conclusion:that
denotative J-anguagesane
inhenently
clumsy.
It is
apparentthat this
objection
is
closely
nelatedto.
the
formen-
the
various
constnuctsof
irnpenative languages aneoperationally
mot-ivated (so
it
seems), i.e designedto
bring
about desinedactivity.
Thenefone (soit
seems)tbey
cannot have denotative analogsNow
it is
certainly
tnuethat
the
definition of
the
semanticsof
denotative Ianguages a:re pu:rely nathematicalin that
they
descnibeonly the
d.enotationsof
proglrans andparts
of
programs. But there
is
no reason why sucha
languge (onsub-set thereof)
cannot have analternate,
openational semantics which des$ribes themeaning
of
prognamsin
termsof activity
they
give
nise
to.
Aslong
asthe
oper-ational
semanticsis
equivalent
to
the
mathematical onethe
progranner may useeithen
(onboth)
asa
prognarnmingguide.
Moneoven,if
the
implementationis
based onthe
openational- semantics,the
programmen can usehis
knowledgeof it to
bning,
Considen,fon
example,the
caseof
blocks and procedure(ie.
function)
declan-ations.
Most A1go1 Prognammers havea
very
openationaL undenstandingof
theseconstructs'
onein
whichblocks are
entened andexited,
stonageis
allocated
and:deallocated,
and threaded stacks bob up anddown.
Now Landinin
the
papercited
descnibed
a
Pure nonpnocedunal language ISWfM which al-lows bothblock
structunes andfunction
definitions in
a
very
natural
(and veny simple) way.yet
neithen thes3rntactic
rules
of
the
language'nor the
formal senantics,
nonthe rules
of
infer-ence' make any r-efenence
to
stacks,
pointers, return
links
and soon.
Indeedno
.notion
of
tstoraget
is required. of
counse, theneis
nothiugto
stop a
prognamnenfrorn imagining an fSWfM b.Lock
being
?entenedt,or
a function
beingcalled, but
it
is
not
necessar5rto
think
oper^ationallylike that.
Eventhe
implementonnight
wantto
avoidthe
classical Algol
viewof
execution, perhapsby
usingthe
copynule
fonfunetions
and bytnanslating
blocks
into
pantsof
a
dataflow
netwonk.Sinilanly,
ther"eis
no neason why impenative languages should havea
rqonoporyof
conditional'
case'
andswitch
statements andthe
like. ft is
very
easyto
dev-ise
a
sirnple denotative case e>cpnession, andthe
usualoperational
viewinvolving
rrtestingrr and I'jumpingrr might on might
not
behelpful
to
the
usen. Evennepetitive
constnucts
(fon loops, while
statements and soon)
fit in to this
franewonkif
we
use
Lucidrs
denotative appr:oachto
iter"ation.
In this
paPer wegive details
of
the
denotative constnuctsjust
mentioned. whatis
especially
unusua.I aboutour
approachis that it
doesnot
nequine addingany new
slmtactie constnuctions.
Instead,
the
effect
can be achieved using onlyspecial
rkeJrwondr vaniablescalled
pnonouns anongwhich
centain
inplieit
nelation-ships
(in
the
forrnof
equations)are
assumedto
hold..1.
rn this
papenthe
formal
system on which we base oun programning languageis
.
the l'-ca1culus.
Nowit is
centainly
tnuethat
the
pu:rel-calcuLus by
itself
must,on s5rntactic g:rounds
alone,
be nejected asa
pnactical
prognamrninglanguage.
All
but the
simplest
l-e>pnessions ane (when pnesentedin fu1l)
almost unneadable (evLnif infix
notation
and othen minon suganings anea[owed).
This unneadahility
is
often
blamed onthe
tendencyof
tr-expnessionsto
be deepry nested;but
a
moreser-ious
pnoblemis
the
fnequently langetextual
distance between vaniabLes and theexpnessions
to
whichthey are
bor:nd.
Fon e:<ample, evenin
the
e:q>nession{lx ly
*2*y2}t"-b)
(a+b)the
connection betweenthe
vaniable
tty'r andthe
expnession ra+brr doesnot
leap to
the
eye.of
course,if
weare
intenestedin
the l-calculus only
asa
forrnal system,ie.
if *.
ar:einterested only in
tions
are
of
no consequence.a
prognaruning languagerie if
l-expnessions,
then problems ant.neasoning
g!gq!
l-expnessions, then theseobsenva-But
if
weare interested
in
adaptingthe
notation in
we
are
inter.estedin
actually
neading and w:ritingof
forrnlike
the
onejust
discussed anevery
funpont-Fortunately,
theneis
a
verly sirnplesolution
to
the problem.
It
involvesadding
a
class
of
special
expressions (which wecall
phrasgs) whichinclude
equa-tions
defining
vaniables;
a
vaniable andthe
expnessionto
whichit is
bound aneb:rought
together
across an ft=rrsymbol.
Ph::ases wenefirst
formalizedby
Landin(in t3l),
although(as
hepoints
out)
mathematicians have been using tbeminforrn-a1ly
for
a
long
tine.
Hene ane two examplesof
the
above l-expnessionin
phnaseforrn:
Ietx:a+bin
letY=a-bin
22
x+y
and
The sennntics
of
phnases can e:<anple oif v is
a variable
anda+b
a-b.
a
stnaightforryandtnanslation.
Fonare
expressions, then22
x+y
whene andx=
y=
by
N
be
M
given
and
Ietv:NinM
is
definedto
be{rvu}u.
0f
coursethe
fact that
phrases can be t::anslatedinto
l-expnessions does notin itself justify
the
claim
that
the
enlanged languageis
denotative;
becausein
genenal
translations are
definedin
terrnsof
the
folg of
expnessions.
Whatis
nonepensuasive
is
the
fact that
theneexist
nulesof
infenencefor
tnansfonning phrasesgb
that it is
possible
to
reason about such expressionswithout
refenenceto
thein
tnanslations.
Fu:rthennore,it is
also
possible
to
define the
denotationof
suchexpressions
in
a
given environmentin
a
stnaightfornar"d way,also without
consid-ening
translations.
So powerful
are
these simple constnucts,that if
we add thento
an appliedversion
of
the
tr-calculus
(ie
one which hasadditional
slrmbols suchas
rr+rr togethenwith
aninterpretation
of
these symbols); andif
weallow
infix
oper^atons and the2.
The pronoun rr::esultrlAIl
the
phrases rnentioned sofar
have,syntactically
speaking, twopants:
alist of definitions,
and an expressionto
whichthe definitions
ar.eto
be applied.'As
our
first
exampleof
the
useof
pronouns,le
define a
s3mtactica.lly slmpler:ph:rase which
consists
sole1yof
a
.'Listof
defj.nitions.
The phnase we ane deseribing might be eall-ed
the
"applicati.ve
valoflr.
A
;phnase
of this
t)pe collsists
of
a set
of
equations encl-osed bythe
tbr:acketsr.rrval.oflr and rf
endrr.
Each equationis of
the
formvariable :
expressionand no vaniable may occul' as
the
left
handside
of
twodifferent
equationsin
thesame
vaLof.
Thevariables
appeaning onthe
left
handside
of
equationsin
a
vblof
a::e
called the
loca1sof
the
valof;
and among these must bethe
special variable
rr!€sultrr.
i
thu following
is
a
typical
vat-of phnasevalof
X=canA
Y=cdrB
C
:
cons(yrB)nesult
= cons(XrC)end.
The
following
anenot
legal
valof
phnases.valof
X
Y Y regul_t
end
valof
=A-B
Q=A
=x+1.
R:A
=Y+1
Z=e
=X
end+B
-B
.R
the
first
becausethe
vaniable
rfY" has twodefinitions,
andthe
second because thespecial
var.iable rrnesultrtis
not
defined.,
The meaningof
a valof
phnaseis,
infonmally
at least,
clean enough:it is
thevalue
of
rrresultil
in
the
envi::onment defined bythe
body (necunsivedefinitions
areallowed). It is
possible
to
nakethis definition
precise
bygiving
a
nule
fontnanslating
valof
expressionsinto
punel-expressions,
but
we have alneady nemankedthat
the
existenceof
tnanslations
doesnot
necessanilyjustify
the
useof
the
ad-jective rtapplicativet'.
fnstead,
wegive a
direct
semantics and mention some nulesfon
tnansforrning valof f s.Let
us assumethat
we ah"eady havein
mind somestnucture,
ie
some donainof
possible
values togethenwith
interpnetations
of
constant s5rmbolslike
r'+r
orrrconsrt oven
the domain.
Then given any environrnento (ie
any
function
which mapsvalof
t.r-u2.
v
nn
end
to be
or(ttresulttt) where
sr is
the least
defined envinonrnent suchthat
(i) or
agreeswith o
exceptpossibly
onthe
values assignedto
the
locaI" r'rt2, ...
".ri
(ii) o'
makesvalid all
the
equationsin
the
bodyof
the
valof,
ie
ot(vr) is,
fon each
i,
the
valueof E. i.n
ffr.
Two
of
the nost
irnportantrules
which can be derived fnomthe
senanticsjust
given
are
the substitution
rule
andthe
renamingnuJ-e.
Thefinst
saysthat if
aphrase
contains
the equation
v : E then E
may be sr,rbstitutedfor
any occurn-enceof v
whichis
fueefon E in
any expnession whichis
the
right
hand sideof
an equationin
the
phr:ase. This nule
is
nelatedto
the
8-nuleof
the
l-calcul-us,
andit justifies
the
useof
the
symbol
t!=tr.
The second nu1e,the
nenamingnule,
allows
usto
neplaceall
free
occurrencesof
a
local v
bya vaniable
vrprovided
(i) vt
doesnot
occur fneein
any equationin
the phnase;
(ii) all
fnee occunnences
of v
ane fneefo:: vt;
and(iii) v is
not
the
vaniablerrresultrr.
This
last
restr"iction
extendsto all
the
pronounsto
be intr.oduced, andbnings
out clear'ly the
difference
between them and ondinarylocal
vaniables.
Pro-nouns may
not
be renamed becausethey
havepanticulan,
predefined nolesto
play
-in
the
caseof
rrresultrr,
to
define
the
val-ue onoutput
of
the
phrase.3.
Case statementsThe
intr.oduction
of
phnases doesnot
nemovethe only
sounceof
unwieldly
andun:readable
expressions.
Someof
the
wonst examples occur (andnot
just in
denot:ative
languages)when
if-then-else
expressionsare
deeplynested.
A good exrarnple appears
in
the following
recunsivedefinition of
a
function
comp whichtests
S-expressionsfor
equality:
comp =
lx try if
atom(x) thenif
atom(y) then eq(xry)else false else
if
atom(y) thenfalse
else
if
comp(canx,
car
y)
then conp(cdnx,
cd:ry)
else false.
0f
cou::sewniting
such an expnessionis
simplynot
goodstyle.
A far. betten wayis to
rewrite the
big
expnession asa
phnasewith locals
defined astests
andcon-nesponding
nesults.
Pnonounsallow
usto
dothis in
a
systenatic
way andat
thesame
time
simulatea
iina of logical
case statement.-r
-!l
-
r:^z
Thenefor:e we add
to
ou:rlist of
unr.enameahlespecial
'yaniables thosein
the thnee sequencestestO,
testl, testZ, ...
nes0
,
nes.l-., nes2, ...
condl,
cond2,...
We e:<pand
the class
of valid
phnases byallowing
vaniables frornthe
finst
two (butnot the
third) list to
bedefined
in
phrasebodies;
and byallowing, fon each
i,
.th
the
i-"
cond var"iableto
be used providedthe
phrase hasdefinitions
of
ever.ytest'
vaniable up
to the i-lth
and ever.y nes vaniable rrpto the ith.
Thefollowing
relationship
between these vaniabLesis
qlrderstoodto hold:
the
valueof
condiis,
fo::
each
i,
the
valueof nesj
fon
the
least j
less
than i
fon
whichtestj is
tnue;
andif all
are
false, condi is resi.
Oundefinition of
conpcan now be new:ritten:
plus the vaniable
ttdefaultrf:
cond3= atom(x) ,r aton(y)
= eq(xoy)
= atom(x)
v
aton(y)=
false
= comp(can
x,
cany)
= comp(cdr
x,
cdr y)
=false
caseO,
casel,
case2,...
And we add as dependent pronouns those
in
the
list
comP = ),x )'Y rralof
r"esult testO
r"esO
testl
nesl
test2
nes2 nes3 end
When we say
that
the
abover.elations
ane rrundenstoodrfto
hold
we can makethis
preeise
in
two ways:syntacticatly,
as meaningthat
the
equationsdefining
condi (such ascond3
=
if
testo
then nes0else
if testl
then resl_else
if
test2
then nes2else
nes3 )are
considenedas automatically
includedin
the
bodyof
eveuy phr^ase; on senantic*aIly,
as rneaningthat
we considenonly
those environments which make suchequa-tions tnue.
Notethat
thene a::e two typesof
pnonouns: indelendent pnonounslike
Itresult[
which can be definedby
the
pnognammen, and dependent pronounslike
"cond3[ which cannot be defined
but
may be used provided theneexist
definitions
for
those othen pnonouns upon whichthe
dependent pronounis
undenstoodto
depend.The pronouns and
nelationships
just
descr:ibedgive
usthe
effect of
a kind
of
logical
case statement.It is
easyto
devise othen pronouns andnelationships
whichgive
usthe
effect of
an integen casestatement.
He addas
independent pronounsswitchon0n
switchonl,
switchonZ,representing functions
of
one integen angument. The undenstood neLationship be-tween these pronounsis
that
switchoni
=
n
if
n
eq0 then
caseOelse
if
n
eqI
then caselelse
default.
The
pronoun
switchoni
may therefone be used pnovidedthe
ph::ase hasa definition
of casej
fon
every j
less
than i.
t
Hene
is
a
typical
phnase using these pronouns:valof
nesult
= switchon3(opcode)caseO=A+B
casel=A'B
case2 =
-
d.
default
= er:n(8)end
Sequences
of
pronouns(like
the
I'caselr sequence) could be neplacedby
singlefirnction
plronounsof
a natural
numben angunent althoughthis
meansthat
someeval-uation
must be penformedjust to
check whetheror
not
a
phnaseis well
forroed. One wayto
make sunethat
this is
alwavspossible
is to
requinethat
the
anguments beconstants
(eg
"case(z1tt1;but
it is
arsosufficient to
requi::ethat
the
angumentsdepend
only
on vaniables defined egualto
constantsin
some enclosing phnase. Thislast
appnoach, would allowvalof
plus
= 0;iffi:
=l
""i;;
nesult
= switchon3(opcode)case(p1us)=A+g
::::[;ffi:i
=i;'
default
= enn(B)end end
and
gives
usthe
effect of
the
rrmanifesttt constantsof
impenative languages.Cleanry othen
extensions,
such as simurtaneous switches on two o:r more expnessions,ane easiJ-y formulated.
4.
LoopsMany
of
the
constnuctsof
imperative languagesare
(fite
the classic
A1go1fon
statement)loop-related
constnucts:they are
used by prognamnersto
bning aboutf"rrgu.g.
cannotrbring
aloutt repetition or
any othenkind
of
operationally
de-fined
activity;
but
by usingthe
approachof
the
ranguageLucid
(see Ashcnoft and Wadgetrl) it is
possible
to
wnite
denotative pnograms which nay be understoodin
terms
of itenation.
Pronounsare
a
valuableaddition
to
the
Lueid. appr"oachbe-cause' as we
wiLl
see, they alIow
usto
simulatethe
inrperativeloop
constnucts.Lucid
aehievesits effect
by having vaniables anrl expnessions d.enotetine
se-quences
of
data sothat
time
dependentfunctions
suchas fir.st and next
can bedefined
denotatively.
The unaryfunctions finst and next
(onthe
binapyI
function fby
(t'followed
bytt))
a::e usedto
give inductive
definitions,
and thebinary function
asa
(ttas soonas
ft)
extnacts values fnom tfune sequences. Luciditself is
defined
in
tennsof
elauses (compoundassentions),
but
wewill
use anobvious analogous phrase oniented
vension.
Heneis
a sinple
prograrDto
conputethe
integen square nootof
the constant
N:valof
.I=0fbyI.+1
J=0fby"I+2.I+I
nesult
=
(I-l-)
asa J>Nend
Lucid
iter:ations
neven tenminate;they
ane(conceptually)
infinite
comput-ations
fnom which valuesare
extracted
usingasa. Explicit
useof asa is
not
-always convenient (especial-ly
in
pnoofs),
and so we show how pnonouns can be usedto
simulatethe
npre conventionalwhile
construct.
Ite use an independent pronounrfhaltrr
anda
dependentfunction
pronoun
t?lasttf
of
whichit is
undenstood
last
=
l,x x
asahalt.
The above
loop
can be new::itten asThese pronouns are
value
of
more thanvalof
?-
I-
T-halt
=nesult
=end
especiall-y useful
one expnessionreg
We can
also
simuLatethe
classic
ent
pnonoun |trangeil and two dependentundenstood:
index
=final
=OfbyI+1
OfbyJ+2.f+l
'J>N
last(I) - I
when
it is
necessa4rto
nefento
the last
for'-loop
with
pronouns.
We add anindepend-pnonouns, rrindexrt and |tfinaLtf
of
whichit is
can(r"ange)
fby
index+
1lx
x
asa index eq cdn(r,ange)9
if
tast(X)<M thenlast(y)
el_selast(y)+f
(we ane assuming
a
step
size
of one).
Heneis
a
simulated.fon-loop
which conputesthe vector
dot
pnoductof a(1), a(2),
, a(N) and b(r), b(2)
,
b(N):,
(we
are
using
"," to a"""::r:rtain
constnuctor) range:
(lrN)
I :
indexsum =
a(1).b(1) fby
sum*
next
a(I).b(I)
.rru
ot"ttt
= final(sum)A
very
impontant pnopentyof
loopslike
the
one aboveis that
they are
guananteedto
terminate
(provided Nis
defined).A fnequent
eniticism
of
the classical fon-
andwhile-
constructs
is that
in
'each case
the
loop
can terrninatein
only
one way; whereasin
fneal
tifer
thene aneiterative
algonithms which seemto
a11owseveral
different
waysof
terminating,each
giving diffenent
nesults.
Aclassic
e><ampleis
seanchinga
table
for
aniten
which nray
not
bepresent
(twoexits),
and anotheris
companing two seguencesto
detenmine
thein
nelationship
in
the
lexicogr.aphic ondening (thneeexits).
Whethencoded as
fon-
or
while-
loopsor
evenin
Lucidwith last,
the
nesulting
prognams. ane ver5r
inelegant
becauseof
the
needto find out,
aften the
loop has tenninated,,er<act1y how
it
wasterrninated.
Some author.s (eg Knuthin t3l)
have used theseexamples
to
anguethat
the
goto statement might havea place
in
stnuctunedpro-gr"amming.
Fortunately
pronounsprovide
a
simple (and, needlessto
say,
goto_Iess)solution.
We addthe
sequenceha1tl,
ha1t2,
ha1t3,
...
of
independent pronouns andthe
dependentfunction
pronounrtexits,,
of
whichit is
undenstood
exits(i)
=
(if haltl
then nesLelse
if
halt2
then res2 else...
nesi)
asahaltl v halt
2
v ,.. v halti
. Hereis
the
table
seareh programvalof
\r:esult
=exits(2)
I=lfbyf+l
haltl
=tab(f)
eq keynesl
=f
halt2:IeqN
nes2 = ni1
end
whieh
retu-rns
i if
keyis at position i in tab,
otherwisenil.
And heneis
the
comparison programvalof
result
I
haltl
nesl
halt2
nes2
halt3
res3
end
:
exits(3)
=
I
fby
I+l
=
a(I)<b(I)
=It
=
a(I)>b(I)
=gt
:IeqN
= ec{l
which
returns lt,
eql
or gt
accordingto
the
lexicognaphic or"deringof
the
se-'
quences
consisting
of
the
finst N
valuesof a and b respectively.
ThesePronouns and equations
give
the
prrcgrammen nloneor
less the
effect of
Zahn?s'rrevent
indicators"
(see Zahn[4])
without
the
cumber:some slmtax5.
Reasonj!-ng about pnognams:
It
venifying
or
massaging progr"arns which use pronouns theneis of
counse no' need
to fir"st
translate the
pnognaminto
a
pronoun fuee fonm; one can wonkdinect-Iy
onthe
original text
usingnules
such aslast(X+Y)
:
last(X)
+last(y)
which
involve
pronounsIt is
possible
to
venify
pnograms using tnansfo::mation nulesalone,
but
it
is
alnost
alwayshelpful
to
beable
to
use,
in
addition,
inference nules which allowus
to
deduce asser"tions aboutvar"iables.
This involves eithen using
clauses asopposed
to
phrases' 01'else
making pneclsethe notion
of
making asser:tions aboutthe locals
of
a phnase.
In
eithen
case wefind that
thene aFevery
natuna]- andsuggestive
rules
of
infenenceinvolving
pronouns.
Someinvolve
pronouns which ar:eused
in
proofs
only,
andnot
in
pnog::ams. Fon example,let
us introducethe
de-pendent pronoun rrter^minationft
with the
implicit
definition
tenmination
=
eventually(halt).
Then we have
the
followirrg
rule of
inferencefinst F,
pnlhalt +
next
po terrnination 'tslast(pnhalt)
which
is
the
analogof
Hoanefswhile rule.
6.
ExtensionsIt
should be apparentthat
a great
vaniety
of
constnucts can be simulatedusing
the
pnonounmethod.
One gneat advantageof
the
rnethodis that
the
semanticsof
these constnucts can bespecified
absolutely
pnecisely by an equation on two,without
nesontto
the.intnicacies
of
context
free
grammans,the
ViennaDefinition
Language, on
the
Scott-Stnacheymethod.
A second advantageis that in
rnany casesthe
pnonoun formsare actually
easier
to
use becausethe
angunentsare
specifiedby
an unondenedset
of
rkeywor"dr eguations, nathen than beir:gspecified
positlon-aIly
by plugging expnessionsin
the
pigeonholesof
some g::anmaticaltemplate.
Anobvious
possibility is to
combinethe
two approaches, egto
define
a
for
loop in
which
the
indexvalue
andthe
rangeare specified
positionally,
but
in
which thefinal
nesult
and enno::exits
ane definedwith
pronouns.
Anothenis to
definediffenent
phnaseswithin
whichdifferent
equations ar^e assumedto
hold;
and athind
is to
al-lowthe
usento
pnovidehis
ownimplicit
equations.
This
last
pos-sibility
mustnot
be undentakenlightlyo
fon
it
amountsto
perrnitting
a
forrnof
d5manic binding.
Refenences 1.
2.
3.
4.
Ashcnoft,
itenation,
E.A.,
CACM and20, ?
Wadge, (,July W.W.,197?);m.
Lucid,
a
nonpnocedunal language withKnuth,
?.E.,
Structuned p::og:rarnmingwith
goto statements, Comp.Sunv. 6,4
(1974),
261-301.Landin,
P.J.r
rhe
next
zoQprre"a*in
,
cAcM9,
g
(1966),
15?-164.Zahn,