We describe a technique for synthesising logic (Prolog) programs from non-executable specifications. This technique is adapted from one for synthesising functional programs as total functions. Logic programs, on the other hand, define predicates. They can be run in different input modes, they sometimes produce multiple outputs and sometimes none. They may not terminate. The key idea of the adaptation is that a predicate is a total function in the all-ground mode, i.e. when all its arguments are inputs (pred(+,...,+) in Prolog notation). The program is synthesised as a function in this mode and then run in other modes. To make the technique work it is necessary to synthesise pure logic programs, without the closed world assumption, and then compile these into Prolog programs. The technique has been tested on the OYSTER (functional) program development system.
[1]
Paul Brna,et al.
A recursive techniques editor for Prolog
,
1991
.
[2]
Per Martin-Löf,et al.
Constructive mathematics and computer programming
,
1984
.
[3]
Maurice Bruynooghe,et al.
Compiling Control
,
1989,
J. Log. Program..
[4]
John Wylie Lloyd,et al.
Foundations of Logic Programming
,
1987,
Symbolic Computation.
[5]
Zohar Manna,et al.
The Origin of the Binary-Search Paradigm
,
1985,
IJCAI.
[6]
Rance Cleaveland,et al.
Implementing mathematics with the Nuprl proof development system
,
1986
.
[7]
Christopher J. Hogger,et al.
Derivation of Logic Programs
,
1981,
JACM.
[8]
Alan Bundy.
A Broader Interpretation of Logic in Logic Programming
,
1988,
ICLP/SLP.