## Weakest Precondition for General Recursive Programs Formalized in Coq (2002)

Citations: | 4 - 1 self |

### BibTeX

@MISC{Zhang02weakestprecondition,

author = {Xingyuan Zhang and Malcolm Munro and Mark Harman and Lin Hu},

title = {Weakest Precondition for General Recursive Programs Formalized in Coq},

year = {2002}

}

### OpenURL

### Abstract

This paper describes a formalization of the weakest precondition, wp, for general recursive programs using the type-theoretical proof assistant Coq. The formalization is a deep embedding using the computational power intrinsic to type theory. Since Coq accepts only structural recursive functions, the computational embedding of general recursive programs is non-trivial. To justify the embedding, an operational semantics is defined and the equivalence between wp and the operational semantics is proved. Three major healthiness conditions, namely: Strictness, Monotonicity and Conjunctivity are proved as well.

### Citations

1399 |
A Discipline of Programming
- Dijkstra
- 1976
(Show Context)
Citation Context ...otonicity and Conjunctivity are proved as well. Keywords: Weakest Precondition, Operational Semantics, Formal Verification, Coq 1 Introduction The weakest precondition, wp, proposed by E. W. Dijkstra =-=[5]-=- proved to be useful in various areas of software development and has been investigated extensively [1, 13, 12]. There have been a number of attempts to support wp and refinement calculus with compute... |

471 |
The calculus of constructions
- Coquand, Huet
- 1988
(Show Context)
Citation Context ...chnical development of this paper has been fully formalized and checked by Coq. The Coq scripts are available from http : //www.dur.ac.uk/xingyuan.zhang/tphol (1) (2)sConventions. Because type theory =-=[4, 15, 11]-=- was first proposed to formalize constructive mathematics, we are able to present the work in standard mathematical notation. For brevity, we use the name of a variable to suggest its type. For exampl... |

155 |
A Theoretical Basis for Stepwise Refinement and the Programming Calculus
- Morris
- 1989
(Show Context)
Citation Context ...Formal Verification, Coq 1 Introduction The weakest precondition, wp, proposed by E. W. Dijkstra [5] proved to be useful in various areas of software development and has been investigated extensively =-=[1, 13, 12]-=-. There have been a number of attempts to support wp and refinement calculus with computer assisted reasoning systems such as HOL [16, 19, 9], Isabelle [14, 17, 18], Ergo [3], PVS [8] and Alf [10]. Un... |

147 |
A calculus of refinements for program derivations
- Back
- 1988
(Show Context)
Citation Context ...Formal Verification, Coq 1 Introduction The weakest precondition, wp, proposed by E. W. Dijkstra [5] proved to be useful in various areas of software development and has been investigated extensively =-=[1, 13, 12]-=-. There have been a number of attempts to support wp and refinement calculus with computer assisted reasoning systems such as HOL [16, 19, 9], Isabelle [14, 17, 18], Ergo [3], PVS [8] and Alf [10]. Un... |

133 |
The specification statement
- Morgan
- 1988
(Show Context)
Citation Context ...Formal Verification, Coq 1 Introduction The weakest precondition, wp, proposed by E. W. Dijkstra [5] proved to be useful in various areas of software development and has been investigated extensively =-=[1, 13, 12]-=-. There have been a number of attempts to support wp and refinement calculus with computer assisted reasoning systems such as HOL [16, 19, 9], Isabelle [14, 17, 18], Ergo [3], PVS [8] and Alf [10]. Un... |

108 |
Computation and Reasoning, A Type Theory for Computer Science
- Luo
- 1994
(Show Context)
Citation Context ...chnical development of this paper has been fully formalized and checked by Coq. The Coq scripts are available from http : //www.dur.ac.uk/xingyuan.zhang/tphol (1) (2)sConventions. Because type theory =-=[4, 15, 11]-=- was first proposed to formalize constructive mathematics, we are able to present the work in standard mathematical notation. For brevity, we use the name of a variable to suggest its type. For exampl... |

94 |
The Coq proof assistant reference manual (version 8.3
- Barras, Boutin, et al.
- 2010
(Show Context)
Citation Context ...ng these works, only Laibinis and Wright [9] deals with general recursion. In this paper, an embedding of wp is given for general recursive programs using the intentional type theory supported by Coq =-=[2]-=-. Since the computational mechanism peculiar to type theory is used, we name such a style of embedding ‘computational embedding’. The importance of computational embedding is that it can be seen as a ... |

51 | Winskel is (almost) right: Towards a mechanized semantics
- Nipkow
- 1998
(Show Context)
Citation Context ...nd has been investigated extensively [1, 13, 12]. There have been a number of attempts to support wp and refinement calculus with computer assisted reasoning systems such as HOL [16, 19, 9], Isabelle =-=[14, 17, 18]-=-, Ergo [3], PVS [8] and Alf [10]. Unfortunately, among these works, only Laibinis and Wright [9] deals with general recursion. In this paper, an embedding of wp is given for general recursive programs... |

31 | Hoare Logic and VDM: Machine-Checked Soundness and Completeness Proofs
- Kleymann
- 1999
(Show Context)
Citation Context ... guarantee the correctness of the annotated imperative programs. Since it uses shallow embedding, meta programming (such as program transformation) can not be verified in Fillitre’s setting. Kleymann =-=[7]-=- derived Hoare logic directly from operational semantics. Since Kleymann’s treatment is a deep embedding, program transformations can be verified. However, because the operational semantics is formali... |

21 |
Programming in Martin-Lof's Type Theory, volume 7
- Nordstrom, Petersson, et al.
- 1990
(Show Context)
Citation Context ...chnical development of this paper has been fully formalized and checked by Coq. The Coq scripts are available from http : //www.dur.ac.uk/xingyuan.zhang/tphol (1) (2)sConventions. Because type theory =-=[4, 15, 11]-=- was first proposed to formalize constructive mathematics, we are able to present the work in standard mathematical notation. For brevity, we use the name of a variable to suggest its type. For exampl... |

12 | Proof of Imperative Programs in Type Theory
- Filliâtre
- 1998
(Show Context)
Citation Context ...ion in HOL. But that is a shallow embedding and there is no relation between wp and operational semantics. There have been some efforts to verification imperative programs using type theory. Fillitre =-=[6]-=- implemented an extension of Coq to generate proof obligations from annotated imperative programs. The proof of these proof obligations in Coq will guarantee the correctness of the annotated imperativ... |

9 |
A Mechanised Theory of Refinement
- Staples
- 1999
(Show Context)
Citation Context ...nd has been investigated extensively [1, 13, 12]. There have been a number of attempts to support wp and refinement calculus with computer assisted reasoning systems such as HOL [16, 19, 9], Isabelle =-=[14, 17, 18]-=-, Ergo [3], PVS [8] and Alf [10]. Unfortunately, among these works, only Laibinis and Wright [9] deals with general recursion. In this paper, an embedding of wp is given for general recursive programs... |

4 | Refinement in Ergo
- Carrington, Hayes, et al.
- 1994
(Show Context)
Citation Context ...gated extensively [1, 13, 12]. There have been a number of attempts to support wp and refinement calculus with computer assisted reasoning systems such as HOL [16, 19, 9], Isabelle [14, 17, 18], Ergo =-=[3]-=-, PVS [8] and Alf [10]. Unfortunately, among these works, only Laibinis and Wright [9] deals with general recursion. In this paper, an embedding of wp is given for general recursive programs using the... |

4 |
Program transformations and refinements in HOL
- Wright, Sere
- 1992
(Show Context)
Citation Context ...software development and has been investigated extensively [1, 13, 12]. There have been a number of attempts to support wp and refinement calculus with computer assisted reasoning systems such as HOL =-=[16, 19, 9]-=-, Isabelle [14, 17, 18], Ergo [3], PVS [8] and Alf [10]. Unfortunately, among these works, only Laibinis and Wright [9] deals with general recursion. In this paper, an embedding of wp is given for gen... |

2 | A PVS based tool for developing programs in the refinement calculus
- Knappmann
- 1996
(Show Context)
Citation Context ...ensively [1, 13, 12]. There have been a number of attempts to support wp and refinement calculus with computer assisted reasoning systems such as HOL [16, 19, 9], Isabelle [14, 17, 18], Ergo [3], PVS =-=[8]-=- and Alf [10]. Unfortunately, among these works, only Laibinis and Wright [9] deals with general recursion. In this paper, an embedding of wp is given for general recursive programs using the intentio... |

2 | Functional procedures in higher-order logic
- Laibinis, Wright
- 1999
(Show Context)
Citation Context ...software development and has been investigated extensively [1, 13, 12]. There have been a number of attempts to support wp and refinement calculus with computer assisted reasoning systems such as HOL =-=[16, 19, 9]-=-, Isabelle [14, 17, 18], Ergo [3], PVS [8] and Alf [10]. Unfortunately, among these works, only Laibinis and Wright [9] deals with general recursion. In this paper, an embedding of wp is given for gen... |

1 |
Specifying and measuring quality of service in distributed object systems
- Lindqvist
- 1997
(Show Context)
Citation Context ... 13, 12]. There have been a number of attempts to support wp and refinement calculus with computer assisted reasoning systems such as HOL [16, 19, 9], Isabelle [14, 17, 18], Ergo [3], PVS [8] and Alf =-=[10]-=-. Unfortunately, among these works, only Laibinis and Wright [9] deals with general recursion. In this paper, an embedding of wp is given for general recursive programs using the intentional type theo... |

1 |
Refinement concepts formalized in higherorder logic
- Back, Wright
- 1989
(Show Context)
Citation Context ...software development and has been investigated extensively [1, 13, 12]. There have been a number of attempts to support wp and refinement calculus with computer assisted reasoning systems such as HOL =-=[16, 19, 9]-=-, Isabelle [14, 17, 18], Ergo [3], PVS [8] and Alf [10]. Unfortunately, among these works, only Laibinis and Wright [9] deals with general recursion. In this paper, an embedding of wp is given for gen... |

1 |
Program transformations and refinements in HOL
- Staples
- 1999
(Show Context)
Citation Context ...nd has been investigated extensively [1, 13, 12]. There have been a number of attempts to support wp and refinement calculus with computer assisted reasoning systems such as HOL [16, 19, 9], Isabelle =-=[14, 17, 18]-=-, Ergo [3], PVS [8] and Alf [10]. Unfortunately, among these works, only Laibinis and Wright [9] deals with general recursion. In this paper, an embedding of wp is given for general recursive programs... |