17 Pages
English

A Proposal for Modules in Prolog

Gain access to the library to view online
Learn more

Description

Niveau: Supérieur, Doctorat, Bac+8
A Proposal for Modules in Prolog ? Dale Miller Computer Science Department University of Pennsylvania Philadelphia, PA 19104-6389 USA Abstract. Higher-order hereditary Harrop formulas, the underlying log- ical foundation of Prolog [NM88], are more expressive than rst-order Horn clauses, the logical foundation of Prolog. In particular, various forms of scoping and abstraction are supported by the logic of higher- order hereditary Harrop formulas while they are not supported by rst- order Horn clauses. Various papers have argued that the scoping and abstraction available in this richer logic can be used to provide for mod- ular programming [Mil89b], abstract data types [Mil89a], and state en- capsulation [HM90]. None of these papers, however, have dealt with the problems of programming-in-the-large, that is, the essentially linguistic problems of putting together various dierent textual sources of code found, say, in dierent les on a persistent store into one logic program. In this paper, I propose a module system for Prolog and shall focus mostly on its static semantics. 1 Module syntax should be declarative Several modern programming languages are built on declarative, formal lan- guages: for example, ML and Scheme are based on the -calculus and Prolog is based on Horn clauses.

  • rst

  • module facility

  • kind list

  • programming

  • within logic

  • programming should

  • store into

  • order horn

  • such


Subjects

Informations

Published by
Reads 44
Language English

yo
ha
,w
em
tb
-calculus
dules
of
in
es,

not
Prolog
w
?
of
Dale
w
Miller
orkshop
Computer
languages
Science
as
Departmen
with
t
.
Univ
for
ersit
to
osal
earlier
f
y
P
Initial
ennsylv
ng-i
ania
that
Philadelph
language.
ia,
include
P
initial
A
programs
19104-6389
language
USA
,
dale@sau
uring
l.c
ob
is.
v
up
for
enn
as
.e
ted
du
D
Abstract.
based
Higher-order
dev
hereditary
con-
Harrop
with
form
ed
ulas,
a
the
top
underlying
parsing
log-
use
ical
generally
foundation
e
of
as

t
Prolog
w
[NM88],
the
are
since
more
purit
expressiv
inicted
e
the
than
T
Mo
they
rst-order
rst
Horn
w
clauses,
least
the
They
logical
seriously
foundation
including
of
this
Prolog.
at
In
The
particular,
orted
v
N00014-88-K-0633,
arious
the
forms
Prolog
of
Horn
scoping
ork
and
suc
abstraction
as
are
with
supp
ll:
orted
ng-i
b
attac
y
A
the
oin
logic
language
of
added
higher-
the
order
or
hereditary
compiler
Harrop
A
form
import
Prop
and
added.
ulas
second
while
little
they
original
are
of
not
it
supp
orn
orted
necessit
b
build
y
its
rst-
exp
order
meaning
Horn
h
clauses.
often
V
loses
arious
declarativ
pap
.
ers
design
ha
what
v
y
e
the
argued
hine"
that
mac
the
imp
scoping
-
and
ere
abstraction
system
a
computed
v
clearly
ailable
t
in
b
this
of
ric
v
her
een
logic
programming
can
eral
b
?
e
ersion
used
er
to
presen
pro
1992
vide

for
ork
mo
is
d-
part
ular
ts
programming
CCR-91-02753,
[Mil89b
A
],

abstract
and
data
is
t
on
yp
clauses.
es
w
[Mil89a
on
],
eloping
and
h
state
w
en-
rst
capsulation
cerned
[HM90].
programmi
None
n-the-sma
of
problems
these
programmi
pap
n-the-large
ers,
ere
ho
k
w
later.
ev
t
er,
p
ha
t,
v
second
e
w
dealt
often
with
on
the
of
problems
initial
of
F
pr
example,
o
and
gr
directiv
amming-in-the-l
suc
ar
s
ge
,
,
,
that
,
is,
local
the
ere
essen
This
tially
language
linguistic
had
problems
connection
of
the
putting
declarativ
together
foundation
v
the
arious
language:
dieren
w
t
b
textual
out
sources
the
of
y
co
o
de
large
found,
and
sa
function
y
as
,
ediency
i
The
n
of
dieren
resulting
t
ybrid
les
is
on
complex
a
it
p
some
ersisten
its
t
e
store
y
in
Occasionally
to
programming
one
is
logic
with
program.
w
In
a
this
call
pap
\recreating
er,
T
I
mac
prop
syndrome.
ose
uring
a
hines
m
ere
o
ortan
dule
e
system
cause
for
w

the
Prolog
formal
and
that
shall
viously
fo
and
cus
ere
mostly
easy
on
implemen
its
(at
static
the
seman
ounded
tics.
ersion
1
them).
Mo
ha
dule
e
syn
b
tax
considered
should
as
b
languages
e
sev
declarativ
reasons,
e
the
Sev
An
eral
v
mo
of
dern
pap
programmi
w
ng
rst
languages
ted
are
the
built
W
on
on
declarativ
Prolog.
e,
w
formal
presen
lan-
here
guages:
supp
for
in
example,
b
ML
gran
and
ONR
Sc
NSF
heme
and
are
ARP
based
N00014-85-K-0018.
ontb
tm
,w
e
f
v
understanding
Mo
and
on
reasoning
time
ab
program
out
n-the-large
transition
prop
tables.
b
Often
dieren
the
w
de-
5.
v
often
elopmen
The
t
its
o
used
f
Harr
m
,
o
Rossi
dular
hereditary
constructions
ecication
in
e
programmi
partial
ng
m
languages
mo
follo
6.
ws
supp
a
dular
similar
tation:
path:
large
it
are
is
and
generally
or
easy
w
to
McCart
dev
a
elop
mo
a
hered-
language
recen
for
das
programming-i
ort
n-the-large
tation.
that
desirable
ob
calculus
viously
dules,
separates
and
and
asp
hides
should
details
eried
and
Notions
for
prop
whic
tax
h
e
ecien
and
t
prop
implemen
b
ta-
or
tions
b
are
o
p
e
ossible.
a
Often,
that
ho
of
w
natural
ev
and
er,
of
it
parts
is
ed
dicult
and
to
McC88b],
reason
],
ab
structuring
out
of
the
Gior-
meaning
vides
of
ulas
the
structuring
resulting
re