Deductive techniques are presented for deriving programs systematically from given specifications. The specifications express the purpose of the desired program without giving any hint of the algorithm to be employed. The basic approach Is to transform the specifications repeatedly according to certain rules, until a satisfact ory program is produced. The rules are guided by a number of strategic controls. These techniques have been incorporated in a running program-synthesis system, called DEDALUS.Many of the transformation rules represent knowledge about the program's subject domain (e.g., numbers, lists, sets); some represent the meaning of the constructs of the specification language and the target programming language; and a few rules represent basic programming principles. Two of these principles, the conditional-formation rule and the recursion-formation rule , account for the introduction of conditional expressions and of recursive calls Into the synthesized program. The termination of the program is ensured as new recursive calls are formed .Two extensions of the recursion-formation rule are discussed: a ~r oceduro-formatIon rule, which admits the introduction of auxilliary subroutines in the course of the synthesis process . and a generali zation rule, which causes the specifications to be altered to represent a more general problem that is nevertheless easier to solve. S pecial techniques are Introduced for the formation of programs with side effects.The techniques of this paper are illustrated with a sequence of ex amples of Increasing complexity; programs are constructed for list processing, numerical cakulatlon, and array computation.The methods of program synthesis can be applied to various aspects of programming methodology --program transformation, data abstraction, program modification, and structured programming.The DEDA LUS system accepts specifications expressed in a high-level language, including set notation, logical quantification, and a rich vocabulary drawn from a var iety of subject domains. The system attempts to transform the specifications into a recursive, LISP-like target program. Over one hundred rules have been implemented, each expressed as a small program in the ~L •
Extens Ions of Recursion Format ion
08