Automating the synthesis of functional programs

AutomatingthesynthesisoffunctionalprogramsAlanSmaillIanGreenAbstractThe task of constructing programs can b e treated as a task of nding pro ofsinanappropriatelogic.Forrecursiveprograms,thecorresp ondinglogicincludesappropriate inductionprinciples.We describ ea system that auto-mates program synthesis via theorem proving in this way, building on controlstrategies develop ed for veri cation pro ofs using pro of plans.This involvessomeextensionstotheplanningsystem.Theresultantsystemautomatesanapproach to programming whereprogram development andcorrectnesspro of pro ceed hand in hand, as advo cated by Gries.1Intro ductionOurinterest isin theautomationofprogramsynthesis.Weworkconstructivtyp etheory,asimplementedintheOystersystem[Bundyetal.1990]acon-structive typ e theory, derived from Constable'sNuprl[Constableetal., 1986].In this setting program synthesis is achieved by proving asp eci cation statementofthe form8input9output spec(input; output)whereinputis avector of arguments (each p ossibly ofdi erent typ e) andoutputisaresult,andspecprop ositiondescribingtherequiredrelationb etweenthem.Aprogrammeetingthissp eci cationcanb eextractedfromitspro ofviathe formulae-as-typ es principle[Howard, 1980].This style of program synthesis iswidelyadvo cated[NordstromandSmith, 1990,Paulin-Mohring,1989],sup-p orted in a numb er of interactive implementations (Nuprl, Oyster, Alf[Nordstrom,1993]).Recursiveprogramscorresp ondheretopro ofsbyinduction.Byaveri cationproblem forarecursively de nedpro cedure, we understandpro ofgoalwhich ispurelyuniversallyquanti ed|itspro ofwillusesomeinductionprinciple.Tosynthesise such a pro cedure, we prove by induction a statement of the form ab oe,with some existential quanti cation.1

[1]  C. Cordell Green,et al.  Application of Theorem Proving to Problem Solving , 1969, IJCAI.

[2]  Toby Walsh,et al.  A Calculus for Rippling , 1994, CTRS.

[3]  Andrew Ireland,et al.  The Use of Planning Critics in Mechanizing Inductive Proofs , 1992, LPAR.

[4]  David Gries,et al.  The Science of Programming , 1981, Text and Monographs in Computer Science.