Abstract

Some existing systems for supporting reasoning about functional programs have been constructed without first formalising the semantics of the language. This paper discusses how a reasoning system can be built, within the HOL theorem proving environment, based on an operational semantics for the language and using a fully definitional approach. The theoretical structure of the system is based on work by Andrew Gordon, where applicative bisimulation is used to define program equivalence. We discuss how this theory can be embedded in HOL and the type of tools which can be built on top of this theoretical framework to make reasoning possible in practice.

Highlights

  • It is often stated that one advantage of functional programming languages, in particular pure functional languages, is that they are suitable for formal reasoning

  • One style used for reasoning about functional programs is equational reasoning

  • There is a tradition in the HOL community of taking a purely definitional approach to using logic; instead of postulating axioms to give meaning to new notations, as is typical in the use of theorem provers such as LP, new concepts are defined in terms of existing ones that already have the required semantics

Read more

Summary

Introduction

It is often stated that one advantage of functional programming languages, in particular pure functional languages, is that they are suitable for formal reasoning. With lazy languages many programs exhibit infinite behaviour and a proof method such as co-induction is required. Such proofs method are not yet widely understood and theorem proving support can help introduce them to a wider community and give greater confidence to a programmer using an unfamiliar method. The exact formulation of the syntax and semantics and the definition of program equality is taken from work by Andrew Gordon that provides a rigorous development, on paper, of a theory for a number of languages [7]. This paper does not attempt to provide all the details of the system developed but concentrates on how a system can be structured

The HOL theorem proving system
Semantics and meta-theoretic reasoning
Formalising the semantics
Embedding in theorem provers
An embedding for PCF plus streams
Call by name PCF plus streams
Syntax
Semantics
Defining an equivalence relation
Co-induction
A labelled transition system
Applicative bisimulation
Practical support for equational reasoning
Interpreter
Generation of proof
HOL variables and constants
Example
Conclusions
Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.