Reasoning about functional programs : Sparkle, a proof assistant for Clean

Theorem proving for functional programming languages can be made much easier by the availability of a dedicated theorem prover. A theorem prover is dedicated to a specific programming language when it fully supports the syntax and semantics of the language and offers specialized proving support for it. Using a dedicated theorem prover is easy, because one can reason about a developed program without having to translate it. However, no suited dedicated theorem prover for a functional language exists yet. This paper describes a simple prototype of a dedicated theorem prover for the functional language Clean. A description of the possibilities of the prototype is given and an examination is made of the work that needs to be done to extend the prototype to a fully operational and truly useful programming tool. Also example proofs of some basic properties and of a graph transformation are given.

[1]  John Hughes,et al.  Generalising monads to arrows , 2000, Sci. Comput. Program..

[2]  Marko C. J. D. van Eekelen,et al.  Proof Tool Support for Explicit Strictness , 2005, IFL.

[3]  Gerard J. Holzmann,et al.  The Model Checker SPIN , 1997, IEEE Trans. Software Eng..

[4]  Peter Achten,et al.  A tutorial to the Clean object I/O library : version 1.2 , 2000 .

[5]  David Sands,et al.  Possibilities and limitations of call-by-need space improvement , 2001, ICFP '01.

[6]  Marko C. J. D. van Eekelen,et al.  Proving Properties of Lazy Functional Programs with Sparkle , 2007, CEFP.

[7]  Peter Verbaan,et al.  The Computational Complexity of Evolving Systems , 2006 .

[8]  Peyton Jones,et al.  Haskell 98 language and libraries : the revised report , 2003 .

[9]  Sebastian Maneth,et al.  Models of tree translation , 2004 .

[10]  Thomas Wolle,et al.  Computational aspects of treewidth : Lower bounds and network reliability , 2005 .

[11]  F. Alkemade,et al.  Evolutionary agent-based economics , 2004 .

[12]  Frits W. Vaandrager Modelgebaseerde verificatie en validatie loont , 2006 .

[13]  M.C.J.D. van Eekelen,et al.  A prototype dedicated theorem prover for Clean , 1998 .

[14]  Anton Wijs,et al.  Silent steps in transition systems and Markov chains , 2007 .

[15]  Zoltán Horváth,et al.  Temporal Properties of Clean Programs Proven in Sparkle-T , 2005, CEFP.

[16]  Joseph Sifakis,et al.  Specification and verification of concurrent systems in CESAR , 1982, Symposium on Programming.

[17]  Marko C. J. D. van Eekelen,et al.  A Proof Tool Dedicated to Clean - The First Prototype , 1999, AGTIVE.

[18]  Ivan Kurtev,et al.  Adaptability of model transformations , 2005 .

[19]  Marinus J. Plasmeijer,et al.  A Generic Programming Extension for Clean , 2001, IFL.

[20]  Ileana Buhan,et al.  Cryptographic keys from noisy data, theory and applications , 2008 .

[21]  Antony Courtney,et al.  Genuinely Functional User Interfaces , 2001 .

[22]  M. T. de Berg,et al.  Algorithms for Fat Objects: Decompositions and Applications , 2004 .

[23]  Geoffrey L. Burn Evaluation transformers—a model for the parallel evolution of functional languages , 1987 .

[24]  William C. Hetzel,et al.  The complete guide to software testing , 1984 .

[25]  C. A. R. Hoare,et al.  Communicating sequential processes , 1978, CACM.

[26]  Grzegorz Rozenberg Models of molecular computing based on molecular reactions , 2009, New Generation Computing.

[27]  Wpaj Wil Michiels Performance ratios for the differencing method , 2004 .

[28]  Marko C. J. D. van Eekelen,et al.  Term Graph Rewriting , 1987, PARLE.

[29]  T. van der Storm Component-based configuration, integration and delivery , 2003 .

[30]  AJ Arjan Mooij,et al.  Constructive formal methods and protocol standardization , 2006 .

[31]  Philippe Schnoebelen,et al.  Systems and Software Verification, Model-Checking Techniques and Tools , 2001 .

[32]  Marko C. J. D. van Eekelen,et al.  Functional Programming and Parallel Graph Rewriting , 1993 .

[33]  Boris Beizer,et al.  Black Box Testing: Techniques for Functional Testing of Software and Systems , 1996, IEEE Software.

[34]  I C M Ingrid Flinsenberg,et al.  Route Planning Algorithms for Car Navigation , 2009 .

[35]  R. Bird Introduction to functional programming using Haskell, Second Edition , 1998 .

[36]  Malcolm Dowse,et al.  Modelling deterministic concurrent I/O , 2006, ICFP '06.

[37]  G. Rozenberg,et al.  Effective models for the structure of ð-calculus processes with replication , 2001 .

[38]  Glenford J. Myers,et al.  The art of software testing (2. ed.) , 2004 .

[39]  Jurgen Vinju,et al.  Analysis and transformation of source code by parsing and rewriting , 2005 .

[40]  Michael J. C. Gordon,et al.  Edinburgh LCF: A mechanised logic of computation , 1979 .

[41]  Rinus Plasmeijer,et al.  Concurrent Clean Language Report - version 1.3 , 1998 .

[42]  Andres Löh,et al.  Exploring generic Haskell , 2004 .

[43]  M. Kyas Verifying OCL Specifications of UML models , 2006 .

[44]  den Jeremy Ian Hartog,et al.  Probabilistic Extensions of Semantical Models , 2002 .

[45]  Jan Tretmans,et al.  TorX: Automated Model-Based Testing , 2003 .

[46]  Jens R. Calamé,et al.  Testing reactive systems with data: enumerative methods and constraint solving , 2008 .

[47]  Marko C. J. D. van Eekelen,et al.  Keep it clean: a unique approach to functional programming. , 1999, SIGP.

[48]  Simon L. Peyton Jones,et al.  Scrap your boilerplate: a practical design pattern for generic programming , 2003, TLDI '03.

[49]  Zoltán Horváth,et al.  Proving Invariants of Functional Programs , 2003, SPLST.

[50]  Marko C. J. D. van Eekelen,et al.  Generic Graphical User Interfaces , 2003, IFL.

[51]  Maurice H. ter Beek,et al.  Team Automata: A Formal Approach to the Modeling of Collaboration Between System Components , 2003 .

[52]  RH Rudolf Mak,et al.  Design and performance analysis of data-independent stream processing systems , 2008 .

[53]  Andrew M. Pitts Existential Types: Logical Relations and Operational Equivalence , 1998, ICALP.

[54]  Lawrence C. Paulson,et al.  Logic And Computation , 1987 .

[55]  Jjd Joep Aerts Random redundant storage for video on demand , 2003 .

[56]  Simona Orzan,et al.  On Distributed Verification and Verified Distribution , 2004 .

[57]  E Elena Mumford,et al.  Drawing graphs for cartographic applications , 2008 .

[58]  Ivan S. Zapreev Model checking Markov chains : techniques and tools , 2008 .

[59]  Marinus J. Plasmeijer,et al.  Generic Editors for the World Wide Web , 2005, CEFP.

[60]  Ana Sokolova,et al.  Coalgebraic analysis of probabilistic systems , 2005 .

[61]  C.-B. Breunesse On JML: topics in tool-assisted verification of Java programs , 2006 .

[62]  U Uzma Khadim,et al.  Process algebras for hybrid systems : comparison and development , 2008 .

[63]  EM Elena Bortnik,et al.  Formal methods in support of SMC design , 2008 .

[64]  Marko C. J. D. van Eekelen,et al.  Compositional Model-Views with Generic Graphical User Interfaces , 2004, PADL.

[65]  Jeroen Eggermont,et al.  Data Mining using Genetic Programming : Classification and Symbolic Regression , 2005 .

[66]  Patricia Johann,et al.  Free theorems in the presence of seq , 2004, POPL.

[67]  M. Niqui,et al.  Formalising Exact Arithmetic. Representations, Algorithms and Proofs , 2004 .

[68]  Ricardo Corin,et al.  Analysis Models for Security Protocols , 2006 .

[69]  EO Esko Dijk Indoor ultrasonic position estimation using a single base station , 2004 .

[70]  S. Abramsky The lazy lambda calculus , 1990 .

[71]  F. Bartels,et al.  On Generalised Coinduction and Probabilistic Specification Formats , 2004 .

[72]  Mohammad Ali Abam New data structures and algorithms for mobile data , 2007 .

[73]  Ling Cheung,et al.  A testing scenario for probabilistic processes , 2007, JACM.

[74]  Lars-Åke Fredlund,et al.  The Erlang Verification Tool , 2001, TACAS.

[75]  Marinus J. Plasmeijer,et al.  Gast: Generic Automated Software Testing , 2002, IFL.

[76]  Robert Brijder,et al.  Models of natural computation : gene assembly and membrane systems , 2008 .

[77]  Gao Design and verification of lock-free parallel algorithms , 2005 .

[78]  Matthias Felleisen,et al.  A call-by-need lambda calculus , 1995, POPL '95.

[79]  R. Boumen,et al.  Integration and test plans for complex manufacturing systems , 2007 .

[80]  Nils Anders Danielsson,et al.  Chasing Bottoms: A Case Study in Program Verification in the Presence of Partial and Infinite Values , 2004, MPC.

[81]  G Giovanni Russello,et al.  Separation and adaptation of concerns in a shared data space , 2006 .

[82]  Andrew D. Gordon Bisimilarity as a theory of functional programming , 1995, MFPS.

[83]  Eelco Dolstra,et al.  The purely functional software deployment model , 2006 .

[84]  Bahareh Badban,et al.  Verification Techniques for Extensions of Equality Logic , 2006 .

[85]  Rinus Plasmeijer,et al.  The Implementation of iData - A Case Study in Generic Programming , 2006 .

[86]  Kent Beck,et al.  Test-infected: programmers love writing tests , 2000 .

[87]  R. Montague,et al.  Logic : Techniques of Formal Reasoning , 1964 .

[88]  Andy Gill The Technology Behind a Graphical User Interface for an Equational Reasoning Assistant , 1995, Functional Programming.

[89]  Mohammad Reza Mousavi,et al.  Structuring structural operational semantics , 2005 .

[90]  Joost Noppen,et al.  Imperfect Information in Software Design Processes , 2007 .

[91]  John McCarthy The A.M. Turing Award: 1971 ACM A. M. Turing Award , 1971, ACM '71.

[92]  Daniel R. Tauritz,et al.  Adaptive Information Filtering: Concepts and Algorithms , 2002 .

[93]  Markus Wenzel,et al.  Type Classes and Overloading in Higher-Order Logic , 1997, TPHOLs.

[94]  Mark P. Jones A system of constructor classes: overloading and implicit higher-order polymorphism , 1993, FPCA '93.

[95]  Marko C. J. D. van Eekelen,et al.  Analysis of a Session-Layer Protocol in mCRL2 , 2007, FMICS.

[96]  B. Gebremichael-Tesfagiorgis,et al.  Expressivity of Timed Automata Models , 2006 .

[97]  Tobias Nipkow,et al.  A Proof Assistant for Higher-Order Logic , 2002 .

[98]  Marinus J. Plasmeijer,et al.  A common Arrow based semantics for GEC and iData applications , 2008 .

[99]  Marinus J. Plasmeijer,et al.  Interactive Functional Objects in Clean , 1997, Implementation of Functional Languages.

[100]  M. J. Plasmeijer,et al.  Term graph rewriting: theory and practice , 1993 .

[101]  Marko van Eekelen,et al.  Mixed Lazy/Strict Natural Semantics , 2004 .

[102]  M. B. van der Zwaag,et al.  Models and logics for process algebra , 2002 .

[103]  Arjen van Weelden,et al.  Putting Types To Good Use , 2007 .

[104]  Ncwm Niels Braspenning Model-based integration and testing of high-tech multi-disciplinary systems , 2008 .

[105]  N.J.M. van den Nieuwelaar,et al.  Supervisory machine control by predictive-reactive scheduling , 2004 .

[106]  Ichiro Hasuo,et al.  Tracing Anonymity with Coalgebras , 2008 .

[107]  Andrew Butterfield,et al.  Proving Correctness of Programs with IO - A Paradigm Comparison , 2001, IFL.

[108]  Nikolay Kavaldjiev,et al.  A run-time reconfigurable Network-on-Chip for streaming DSP applications , 2006 .

[109]  Siegfried Nijssen Mining Structured Data , 2006 .

[110]  Hartmut Peter Benz,et al.  Casual Multimedia Process Annotations -- CoMPAs , 2003 .

[111]  A Adam Koprowski,et al.  Termination of rewriting and its certification , 2004 .

[112]  Robert Cartwright,et al.  The semantics of lazy (and industrious) evaluation , 1982, LFP '82.

[113]  Gabriele Lenzini,et al.  Integration of Analysis Techniques in Security and Fault-Tolerance , 2005 .

[114]  Bengt Jonsson,et al.  Probabilistic Process Algebra , 2001 .

[115]  Clemens Grabmayer A duality between proof systems for cyclic term graphs , 2007, Math. Struct. Comput. Sci..

[116]  Aad Mathssen,et al.  Logical Calculi for Reasoning with Binding , 2008 .

[117]  C.-H. Luke Ong,et al.  Full Abstraction in the Lazy Lambda Calculus , 1993, Inf. Comput..

[118]  Daniel Kroening,et al.  Decision Procedures for Equality Logic and Uninterpreted Functions , 2008 .

[119]  Marcel Verhoef,et al.  Modeling and validating distributed embedded real-time control systems , 2009 .

[120]  J. Ketema,et al.  Bohm-Like Trees for Rewriting , 2006 .

[121]  Cfj Christian Lange,et al.  Assessing and improving the quality of modeling : a series of empirical studies about the UML , 2007 .

[122]  M. Tejfel,et al.  Verifying invariants of abstract functional objects — a case study ∗ , 2004 .

[123]  Simon Peyton Jones,et al.  Type classes: an exploration of the design space , 1997 .

[124]  Philip W. Trinder,et al.  Towards an Operational Semantics for a Parallel Non-Strict Functional Language , 1998, IFL.

[125]  Peter Achten Clean for Haskell98 Programmers -- A Quick Reference Guide -- , 2007 .

[126]  Henrik Nilsson,et al.  The Yampa arcade , 2003, Haskell '03.

[127]  T. Kuipers,et al.  Techniques for understanding legacy software systems , 2002 .

[128]  John Launchbury,et al.  A natural semantics for lazy evaluation , 1993, POPL '93.

[129]  Erik Barendsen,et al.  Graph rewriting aspects of functional programming , 1999 .

[130]  Clara Bertolissi,et al.  A Rewriting Calculus for Cyclic Higher-order Term Graphs , 2005, Electron. Notes Theor. Comput. Sci..

[131]  Jeroen Doumen,et al.  Searching in encrypted data , 2004 .

[132]  Anton Wijs,et al.  What to do next? Analysing and optimising system behaviour in time , 2007 .

[133]  Marko C. J. D. van Eekelen,et al.  Reasoning About Deterministic Concurrent Functional I/O , 2004, IFL.

[134]  Carlos Camarão,et al.  Constraint-set satisfiability for overloading , 2004, PPDP '04.

[135]  S. P. Luttik Choice quantification in process algebra , 2002 .

[136]  Simon Thompson,et al.  Haskell: The Craft of Functional Programming , 1996 .

[137]  Reinder J. Bril,et al.  Real-time scheduling for media processing using conditionally guaranteed budgets , 2004 .

[138]  Marko C. J. D. van Eekelen,et al.  CLEAN: A language for functional graph writing , 1987, FPCA.

[139]  Magiel Bruntink,et al.  Renovation of idiomatic crosscutting concerns in embedded systems , 2005 .

[140]  Michel A. Reniers,et al.  Hybrid process algebra , 2005, J. Log. Algebraic Methods Program..

[141]  Bastiaan Stephan Graaf,et al.  Model-Driven Evolution of Software Architectures , 2007, 11th European Conference on Software Maintenance and Reengineering (CSMR'07).

[142]  M. T. de Berg,et al.  Multi-functional geometric data structures , 2003 .

[143]  M. G. van der Horst,et al.  Scalable block processing algorithms , 2008 .

[144]  Dmitri Jarnikov,et al.  QoS framework for video streaming in home networks , 2007 .

[145]  Zoltán Horváth,et al.  Extending the Sparkle Core language with object abstraction , 2005, Acta Cybern..

[146]  Pascal Durr,et al.  Resource-based Verification for Robust Composition of Aspects , 2008 .

[147]  Goran Frehse,et al.  Compositional verification of hybrid systems using simulation relations , 2005 .

[148]  Iris Loeb Natural Deduction, Sharing By Presentation , 2007 .

[149]  A. L. de Groot,et al.  Practical Automaton proofs in PVS , 2000 .

[150]  Cjf Cas Cremers Scyther : semantics and verification of security protocols , 2006 .

[151]  Sava Mintchev,et al.  Mechanized Reasoning about Functional Programs , 1994, Functional Programming.

[152]  Bastiaan Heeren,et al.  Top quality type error Messages , 2005 .

[153]  Paul Hudak The Haskell School of Expression: Learning Functional Programming through Multimedia , 1999 .

[154]  Tac Tim Willemse Semantics and verification in process algebras with data and timing , 2003 .

[155]  RJ Roy Willemen,et al.  School timetable construction : algorithms and complexity , 2002 .

[156]  Jasen Markovski,et al.  Real and stochastic time in process algebras for performance evaluation , 2008 .

[157]  Paul Hudak,et al.  Arrows, Robots, and Functional Reactive Programming , 2002, Advanced Functional Programming.

[158]  Marko C. J. D. van Eekelen,et al.  Automatic Generation of Editors for Higher-Order Data Structures , 2004, APLAS.

[159]  Stephan Merz,et al.  Model Checking , 2000 .

[160]  Cheun Ngen Chong Experiments in rights control : expression and enforcement , 2005 .

[161]  Erika Ábrahám,et al.  An Assertional Proof System for Multithreaded Java - Theory and Tool Support , 2005 .

[162]  Marinus J. Plasmeijer,et al.  Theorem Proving for functional Programmers - Sparkle: A Functional Theorem Prover , 2001 .

[163]  Laura Brandán Briones,et al.  Theories for Model-based Testing: Real-time and Coverage , 2007 .

[164]  Ys Yaroslav Usenko,et al.  Linearization in muCRL , 2002 .

[165]  Cruz Filipe,et al.  Constructive real analysis : a type-theoretical formalization and applications , 2004 .

[166]  Kim G. Larsen,et al.  A Tutorial on Uppaal , 2004, SFM.

[167]  Hans-Wolfgang Loidl,et al.  Algorithm + strategy = parallelism , 1998, Journal of Functional Programming.

[168]  Nils Anders Danielsson,et al.  Fast and loose reasoning is morally correct , 2006, POPL '06.

[169]  Atze Dijkstra Stepping through Haskell , 2000 .

[170]  de Hayco Jong Flexible heterogeneous software systems , 2007 .

[171]  Ulf Norell,et al.  Verifying haskell programs using constructive type theory , 2005, Haskell '05.

[172]  Simon L. Peyton Jones,et al.  Derivable Type Classes , 2001, Haskell.

[173]  H.M.A. van Beek,et al.  Specification and analysis of Internet applications , 2005 .

[174]  Marko C. J. D. van Eekelen,et al.  Parallel graph rewriting - some contributions to its theory, its implementation and its application , 1988 .

[175]  Andy Gill Introducing the Haskell equational reasoning assistant , 2006, Haskell '06.

[176]  Paul Hudak,et al.  Functional reactive animation , 1997, ICFP '97.

[177]  Leon Moonen,et al.  Exploring software systems , 2003, International Conference on Software Maintenance, 2003. ICSM 2003. Proceedings..

[178]  de Ism Ivo Jong Integration and test strategies for complex manufacturing machines , 2008 .

[179]  Martijn M. Schrage,et al.  Proxima: a presentation-oriented editor for structured documents , 2000 .

[180]  R Ronald Ruimerman,et al.  Modeling and remodeling in bone tissue , 2005 .

[181]  Leonard Lensink,et al.  Induction and Co-induction in Sparkle , 2004 .

[182]  Ling Cheung,et al.  Reconciling nondeterministic and probabilistic choices , 2006 .

[183]  Mariëlle Stoelinga,et al.  Alea jacta est : verification of probabilistic, real-time and parametric systems , 2002 .

[184]  Jan Friso Groote,et al.  Algebraic Process Verification , 2001, Handbook of Process Algebra.

[185]  Philip W. Trinder,et al.  An operational semantics for parallel lazy evaluation , 2000, ICFP '00.

[186]  M.C.J.D. van Eekelen,et al.  Proof Support for General Type Classes , 2004 .

[187]  Maria Eva Magdalena Lijding,et al.  Real-Time Scheduling of Tertiary Storage , 2003 .

[188]  Martin Bravenboer,et al.  Exercises in Free Syntax. Syntax Definition, Parsing, and Assimilation of Language Conglomerates , 2003 .

[189]  M. A. Valero Espada,et al.  Modal Abstraction and Replication of Processes with Data , 2005 .

[190]  Philip Wadler,et al.  How to make ad-hoc polymorphism less ad hoc , 1989, POPL '89.

[191]  Bart Jacobs,et al.  Java Program Verification at Nijmegen: Developments and Perspective , 2003, ISSS.

[192]  John Hughes,et al.  Why Functional Programming Matters , 1989, Comput. J..

[193]  Flavio D. Garcia Formal and Computational Cryptography: Protocols, Hashes and Commitments , 2008 .

[194]  John Hughes,et al.  Report on the Programming Language Haskell 98 , 1999 .

[195]  Tobias Nipkow,et al.  The Isabelle Reference Manual , 2007 .

[196]  Daan Leijen,et al.  The λ Abroad - A Functional Approach to Software Components , 2003 .

[197]  Peter Sestoft,et al.  Deriving a lazy abstract machine , 1997, Journal of Functional Programming.

[198]  P. Zoeteweij,et al.  Composing constraint solvers , 2005 .

[199]  A. J. Markvoort Towards hybrid molecular simulations , 2006 .

[200]  Sander M. Bohte,et al.  Spiking Neural Networks , 2003 .

[201]  Tomas Krilavicius,et al.  Hybrid Techniques for Hybrid Systems , 2006 .

[202]  Tobias Nipkow,et al.  Order-sorted polymorphism in Isabelle , 1993 .

[203]  Wolter Pieters,et al.  La volonté machinale: understanding the electronic voting controversy , 2008 .

[204]  Y Yuechen Qian,et al.  Data synchronization and browsing for home environments , 2004 .

[205]  Rinus Plasmeijer,et al.  The Mathematical Foundation of the Proof Assistant Sparkle , 2007 .