<s>
POP-2	B-Language
(	O
also	O
referred	O
to	O
as	O
POP2	O
)	O
is	O
a	O
programming	O
language	O
developed	O
around	O
1970	O
from	O
the	O
earlier	O
language	O
POP-1	B-Language
(	O
developed	O
by	O
Robin	O
Popplestone	O
in	O
1968	O
,	O
originally	O
named	O
COWSEL	B-Language
)	O
by	O
Robin	O
Popplestone	O
and	O
Rod	O
Burstall	O
at	O
the	O
University	O
of	O
Edinburgh	O
.	O
</s>
<s>
It	O
drew	O
roots	O
from	O
many	O
sources	O
:	O
the	O
languages	O
LISP	B-Language
and	O
ALGOL	B-Language
60	I-Language
,	O
and	O
theoretical	O
ideas	O
from	O
Peter	O
J	O
.	O
Landin	O
.	O
</s>
<s>
It	O
used	O
an	O
incremental	B-Application
compiler	I-Application
,	O
which	O
gave	O
it	O
some	O
of	O
the	O
flexibility	O
of	O
an	O
interpreted	B-Application
language	I-Application
,	O
including	O
allowing	O
new	O
function	O
definitions	O
at	O
run	O
time	O
and	O
modification	O
of	O
function	O
definitions	O
while	O
a	O
program	O
was	O
running	O
(	O
both	O
of	O
which	O
are	O
features	O
of	O
dynamic	B-Application
compilation	I-Application
)	O
,	O
without	O
the	O
overhead	O
of	O
an	O
interpreted	B-Application
language	I-Application
.	O
</s>
<s>
The	O
reason	O
for	O
this	O
was	O
that	O
the	O
language	O
had	O
explicit	O
notion	O
of	O
an	O
operand	B-Application
stack	I-Application
;	O
thus	O
,	O
the	O
previous	O
assignment	O
could	O
be	O
written	O
as	O
two	O
separate	O
statements	O
:	O
</s>
<s>
which	O
popped	O
the	O
top	O
value	O
off	O
the	O
stack	B-Application
and	O
assigned	O
it	O
to	O
the	O
variable	O
'	O
a	O
 '	O
.	O
</s>
<s>
An	O
interesting	O
operation	O
on	O
functions	O
was	O
,	O
(	O
sometimes	O
referred	O
to	O
as	O
"	O
currying	B-Application
"	O
)	O
.	O
</s>
<s>
In	O
partial	O
application	O
some	O
number	O
of	O
the	O
rightmost	O
arguments	O
of	O
the	O
function	O
(	O
which	O
would	O
be	O
the	O
last	O
ones	O
placed	O
on	O
the	O
stack	B-Application
before	O
the	O
function	O
is	O
involved	O
)	O
were	O
frozen	O
to	O
given	O
values	O
,	O
to	O
produce	O
a	O
new	O
function	O
of	O
fewer	O
arguments	O
,	O
which	O
is	O
a	O
closure	B-Language
of	O
the	O
original	O
function	O
.	O
</s>
<s>
applies	O
the	O
closure	B-Language
of	O
poly2	O
with	O
three	O
arguments	O
frozen	O
,	O
to	O
the	O
argument	O
3	O
,	O
returning	O
the	O
square	O
of	O
(	O
3	O
-	O
1	O
)	O
,	O
which	O
is	O
4	O
.	O
</s>
<s>
The	O
application	O
of	O
the	O
partially	O
applied	O
function	O
causes	O
the	O
frozen	O
values	O
(	O
in	O
this	O
case	O
1	O
,	O
-2	O
,	O
1	O
)	O
to	O
be	O
added	O
to	O
whatever	O
is	O
already	O
on	O
the	O
stack	B-Application
(	O
in	O
this	O
case	O
3	O
)	O
,	O
after	O
which	O
the	O
original	O
function	O
poly2	O
is	O
invoked	O
.	O
</s>
<s>
In	O
POP-2	B-Language
,	O
it	O
was	O
possible	O
to	O
define	O
new	O
operations	O
(	O
operators	O
in	O
modern	O
terms	O
)	O
.	O
</s>
<s>
The	O
original	O
version	O
of	O
POP-2	B-Language
was	O
implemented	O
on	O
an	O
Elliott	O
4130	O
computer	O
in	O
the	O
University	O
of	O
Edinburgh	O
(	O
with	O
only	O
64KB	O
RAM	O
,	O
doubled	O
to	O
128KB	O
in	O
1972	O
)	O
.	O
</s>
<s>
POP-2	B-Language
was	O
ported	O
to	O
the	O
ICT	B-Device
1900	I-Device
series	I-Device
on	O
a	O
1909	O
at	O
Lancaster	O
University	O
by	O
John	O
Scott	O
in	O
1968	O
.	O
</s>
<s>
In	O
the	O
mid-1970s	O
,	O
POP-2	B-Language
was	O
ported	O
to	O
BESM-6	B-Device
(	O
POPLAN	O
System	O
)	O
.	O
</s>
<s>
Later	O
versions	O
were	O
implemented	O
for	O
CTL	O
Modular	O
One	O
,	O
PDP-10	B-Device
,	O
ICL	B-Device
1900	I-Device
series	I-Device
(	O
running	O
the	O
George	O
operating	O
system	O
)	O
.	O
</s>
<s>
Julian	O
Davies	O
,	O
in	O
Edinburgh	O
,	O
implemented	O
an	O
extended	O
version	O
of	O
POP-2	B-Language
,	O
which	O
he	O
called	O
POP-10	O
on	O
the	O
PDP-10	B-Device
computer	O
running	O
TOPS-10	B-Operating_System
.	O
</s>
<s>
This	O
was	O
the	O
first	O
dialect	O
of	O
POP-2	B-Language
that	O
treated	O
case	O
as	O
significant	O
in	O
identifier	O
names	O
,	O
used	O
lower	O
case	O
for	O
most	O
system	O
identifiers	O
,	O
and	O
supported	O
long	O
identifiers	O
with	O
more	O
than	O
8	O
characters	O
.	O
</s>
<s>
In	O
parallel	O
with	O
that	O
Steve	O
Hardy	O
at	O
Sussex	O
University	O
implemented	O
a	O
subset	O
of	O
POP-2	B-Language
,	O
which	O
he	O
called	O
POP-11	B-Language
which	O
ran	O
on	O
a	O
DEC	O
PDP-11/40	O
computer	O
.	O
</s>
<s>
It	O
was	O
originally	O
designed	O
to	O
run	O
on	O
the	O
DEC	O
operating	O
system	O
RSX-11D	O
,	O
in	O
time-shared	O
mode	O
for	O
teaching	O
,	O
but	O
that	O
caused	O
so	O
many	O
problems	O
that	O
an	O
early	O
version	O
of	O
Unix	B-Application
was	O
installed	O
and	O
used	O
instead	O
.	O
</s>
<s>
That	O
version	O
of	O
Pop-11	B-Language
was	O
written	O
in	O
Unix	B-Application
assembler	O
,	O
and	O
code	O
was	O
incrementally	O
compiled	O
to	O
an	O
intermediate	O
byte	O
code	O
which	O
was	O
interpreted	O
.	O
</s>
<s>
That	O
port	O
was	O
completed	O
around	O
1976	O
and	O
as	O
a	O
result	O
Pop-11	B-Language
was	O
used	O
in	O
several	O
places	O
for	O
teaching	O
.	O
</s>
<s>
In	O
order	O
to	O
support	O
its	O
teaching	O
function	O
many	O
of	O
the	O
syntactic	O
features	O
of	O
POP-2	B-Language
were	O
modified	O
,	O
e.g.	O
</s>
<s>
replacing	O
function	O
...	O
end	O
with	O
define	O
...	O
enddefine	O
and	O
adding	O
a	O
wider	O
variety	O
of	O
looping	O
constructs	O
with	O
closing	O
brackets	O
to	O
match	O
their	O
opening	O
brackets	O
instead	O
of	O
the	O
use	O
of	O
close	O
for	O
all	O
loops	O
in	O
POP-2	B-Language
.	O
</s>
<s>
Pop-11	B-Language
also	O
introduced	O
a	O
for	O
list	O
structures	O
,	O
making	O
it	O
much	O
easier	O
to	O
teach	O
AI	O
programming	O
.	O
</s>
<s>
Around	O
1980	O
Pop-11	B-Language
was	O
ported	O
to	O
a	O
VAX-11/780	O
computer	O
by	O
Steve	O
Hardy	O
and	O
John	O
Gibson	O
,	O
and	O
soon	O
after	O
that	O
it	O
was	O
replaced	O
by	O
a	O
full	O
incremental	B-Application
compiler	I-Application
(	O
producing	O
machine-code	O
instead	O
of	O
an	O
interpreted	O
intermediate	O
code	O
)	O
.	O
</s>
<s>
The	O
existence	O
of	O
the	O
compiler	O
and	O
all	O
its	O
subroutines	O
at	O
run	O
time	O
made	O
it	O
possible	O
to	O
support	O
far	O
richer	O
language	O
extensions	O
than	O
were	O
possible	O
with	O
Macros	O
,	O
and	O
as	O
a	O
result	O
Pop-11	B-Language
was	O
used	O
(	O
by	O
Steve	O
Hardy	O
,	O
Chris	O
Mellish	O
and	O
John	O
Gibson	O
)	O
to	O
produce	O
an	O
implementation	O
of	O
Prolog	B-Language
,	O
using	O
the	O
standard	O
syntax	O
of	O
Prolog	B-Language
,	O
and	O
the	O
combined	O
system	O
became	O
known	O
as	O
Poplog	B-Language
,	O
to	O
which	O
Common	B-Language
Lisp	I-Language
and	O
Standard	B-Language
ML	I-Language
were	O
later	O
added	O
.	O
</s>
<s>
This	O
version	O
was	O
later	O
ported	O
to	O
a	O
variety	O
of	O
machines	O
and	O
operating	O
systems	O
and	O
as	O
a	O
result	O
Pop-11	B-Language
became	O
the	O
dominant	O
dialect	O
of	O
POP-2	B-Language
,	O
still	O
available	O
in	O
the	O
Poplog	B-Language
system	O
.	O
</s>
<s>
Around	O
1986	O
a	O
new	O
AI	O
company	O
Cognitive	O
Applications	O
Ltd.	O
,	O
collaborated	O
with	O
members	O
of	O
Sussex	O
university	O
to	O
produce	O
a	O
variant	O
of	O
Pop-11	B-Language
called	O
AlphaPop	O
running	O
on	O
Apple	O
Mac	O
computers	O
,	O
with	O
integrated	O
graphics	O
.	O
</s>
