## Metavariables and Conditional Refinements in the Refinement Calculus (1994)

Venue: | Proceedings of the 6th Refinement Workshop |

Citations: | 7 - 2 self |

### BibTeX

@INPROCEEDINGS{Nickson94metavariablesand,

author = {Raymond G. Nickson and Lindsay J. Groves},

title = {Metavariables and Conditional Refinements in the Refinement Calculus},

booktitle = {Proceedings of the 6th Refinement Workshop},

year = {1994},

pages = {167--187},

publisher = {Springer-Verlag}

}

### OpenURL

### Abstract

We describe two techniques for the refinement calculus that facilitate goal-directed development. The techniques achieve this by allowing the deferring of decisions about the precise form of refinement steps, so high-level choices can be expressed as soon as those choices are appropriate. Metavariables are place-holders for components of partly developed programs that will be instantiated when they are suitably constrained by later refinements. The conditional refinements technique allows the development of alternative refinements of a specification, and the collection of those alternative refinements into a guarded command set. We think that programmers developing programs using the refinement calculus make use of both of these techniques informally, but the written derivation does not usually reflect their use. We describe and illustrate a rigorous way to apply these techniques and record their use. Publishing Information To appear in: David Till and Roger C. F. Shaw (Editors), Proceedings of the 6th Refinement Workshop, London, 5-7 January 1994, Springer-Verlag, 1994. Software Verification Research Centre, University of Queensland, Brisbane, Australia. Email: nickson@cs.uq.oz.au. y Email: lindsay@comp.vuw.ac.nz. 1

### Citations

1535 |
A Discipline of Programming
- DIJKSTRA
- 1976
(Show Context)
Citation Context ...se cases, it is usually more convenient to construct the required command, then find an adequate precondition satisfying one of Dijkstra's basic theorems for the alternative and repetitive constructs =-=[6, pp37--40]-=-. But we can avoid directly appealing to such theorems, because we have designed our Introduce IF and Introduce DO rules to take them into account. We propose to achieve the effect of Weakest Prespeci... |

509 |
Programming from Specifications
- Morgan
(Show Context)
Citation Context ...Verlag, 1994. Software Verification Research Centre, University of Queensland, Brisbane, Australia. Email: nickson@cs.uq.oz.au. y Email: lindsay@comp.vuw.ac.nz. 1 Introduction The refinement calculus =-=[1, 2, 3]-=- provides a set of rules for deriving programs from formal specifications. Each rule defines a small step from specification to program; by building an appropriate sequence of rule applications, we ca... |

498 |
The Science of Programming
- Gries
- 1981
(Show Context)
Citation Context ... of refinements to be packaged into logical units. One of our aims in doing this is to be able to emulate in the refinement calculus some of the goal-directed strategies discussed in Gries's textbook =-=[5]-=- on the formal development of programs from their specifications. The essence of the goal-directed approach is that derivation steps are motivated by the structure of the specification (in particular,... |

162 |
A theoretical basis for stepwise refinement and the programming calculus
- Morris
- 1987
(Show Context)
Citation Context ...ows guarded commands to be developed one at a time, hence deferring the decision of how many branches an if or do command should have. The semantics makes each guarded command alone a `minor miracle' =-=[14]-=- that behaves magically if executed when its guard is false. Each individual guarded command is then an alternative valid refinement of the original specification. These alternatives can be combined u... |

153 |
A calculus of refinements for program derivations
- Back
- 1988
(Show Context)
Citation Context ...Verlag, 1994. Software Verification Research Centre, University of Queensland, Brisbane, Australia. Email: nickson@cs.uq.oz.au. y Email: lindsay@comp.vuw.ac.nz. 1 Introduction The refinement calculus =-=[1, 2, 3]-=- provides a set of rules for deriving programs from formal specifications. Each rule defines a small step from specification to program; by building an appropriate sequence of rule applications, we ca... |

138 |
The specification statement
- Morgan
- 1988
(Show Context)
Citation Context ...es have been covered. To do this, we need a semantics for guarded commands independent of the if or do that normally surrounds them; this is provided by an extension to the guarded commands language (=-=[8, 9]-=-) that treats the normal if command as being a composition using distinct operators: guarding (!), demonically nondeterministic alternative composition ([]), and if itself. Each of these operators has... |

136 |
A generalization of Dijkstraâ€™s calculus
- Nelson
- 1989
(Show Context)
Citation Context ...es have been covered. To do this, we need a semantics for guarded commands independent of the if or do that normally surrounds them; this is provided by an extension to the guarded commands language (=-=[8, 9]-=-) that treats the normal if command as being a composition using distinct operators: guarding (!), demonically nondeterministic alternative composition ([]), and if itself. Each of these operators has... |

89 | mural: A Formal Development Support System
- Jones, Jones, et al.
- 1991
(Show Context)
Citation Context ...constraints on them using the co-routining mechanisms available in some versions of Prolog [11]. Clement [12] has used metavariables in the context of proof by natural deduction in the ral proof tool =-=[13]-=-. There, too, the benefit is avoiding the need to plan ahead so that steps can be done when they prove necessary, rather than needing to be anticipated. Clement's metavariables can represent predicate... |

34 |
Specification Statements and Refinements
- Morgan, Robinson
- 1987
(Show Context)
Citation Context ...Verlag, 1994. Software Verification Research Centre, University of Queensland, Brisbane, Australia. Email: nickson@cs.uq.oz.au. y Email: lindsay@comp.vuw.ac.nz. 1 Introduction The refinement calculus =-=[1, 2, 3]-=- provides a set of rules for deriving programs from formal specifications. Each rule defines a small step from specification to program; by building an appropriate sequence of rule applications, we ca... |

24 |
Negation and Quantifiers in NU-Prolog
- Naish
- 1986
(Show Context)
Citation Context ...ent an extension to our refinement tool that represents metavariables with Prolog variables and collects the constraints on them using the co-routining mechanisms available in some versions of Prolog =-=[11]-=-. Clement [12] has used metavariables in the context of proof by natural deduction in the ral proof tool [13]. There, too, the benefit is avoiding the need to plan ahead so that steps can be done when... |

12 | A tactic driven refinement tool - Groves, Nickson, et al. |

5 |
Using metavariables in natural deduction proofs
- Clement
- 1992
(Show Context)
Citation Context ...on to our refinement tool that represents metavariables with Prolog variables and collects the constraints on them using the co-routining mechanisms available in some versions of Prolog [11]. Clement =-=[12]-=- has used metavariables in the context of proof by natural deduction in the ral proof tool [13]. There, too, the benefit is avoiding the need to plan ahead so that steps can be done when they prove ne... |

1 |
An intelligent editor for constructing correct programs
- Groves, Nickson
- 1988
(Show Context)
Citation Context ... PsC ) xsysv = x + 1 from the first assignment PsD ) ysxsv = x + 1 from the second assignment Once again, there is no single solution. A heuristic that we have found appropriate in such circumstances =-=[7]-=- is to treat the right-hand sides of the implications in the last two constraints as sets of conjuncts. Conjuncts in the intersection of the sets (v = x + 1 in this example) are associated with the co... |

1 |
Deriving language recognition algorithms: A case study in combining program specialisation and data refinement
- Groves
- 1994
(Show Context)
Citation Context ... be instantiated (subject to the accumulated constraints) at any time we find convenient. We have found this technique useful in many of the derivations we have done by hand; for another example, see =-=[10]-=-. We hope to implement an extension to our refinement tool that represents metavariables with Prolog variables and collects the constraints on them using the co-routining mechanisms available in some ... |