## Programming with Variable Functions (1998)

Venue: | In Proceedings of the 1998 ACM SIGPLAN International Conference on Functional Programming |

Citations: | 8 - 0 self |

### BibTeX

@INPROCEEDINGS{Odersky98programmingwith,

author = {Martin Odersky},

title = {Programming with Variable Functions},

booktitle = {In Proceedings of the 1998 ACM SIGPLAN International Conference on Functional Programming},

year = {1998},

pages = {105--116},

publisher = {ACM}

}

### Years of Citing Articles

### OpenURL

### Abstract

What is a good method to specify and derive imperative programs? This paper argues that a new form of functional programming fits the bill, where variable functions can be updated at specified points in their domain. Traditional algebraic specification and functional programming are a powerful pair of tools for specifying and implementing domains of discourse and operations on them. Recent work on evolving algebras has introduced the function update in algebraic specifications, and has applied it with good success in the modelling of reactive systems. We show that similar concepts allow one to derive efficient programs in a systematic way from functional specifications. The final outcome of such a derivation can be made as efficient as a traditional imperative program with pointers, but can still be reasoned about at a high level. Variable functions can also play an important role in the structuring of large systems. They can subsume object-oriented programming languages, without incu...

### Citations

5962 |
Design Patterns: Elements of Reusable ObjectOriented Software
- Gamma, Helm, et al.
- 1995
(Show Context)
Citation Context ...metric form. Nevertheless such flexibility requires planning -- the type of symbols has to be made instantiatable, and all program points that create symbols have to be supplied with a factory method =-=[GHJV94]-=- or something equivalent to generate the right kind of symbol. With variable functions, we can simply keep associations from symbols to additional data in the modules where they are maintained and use... |

1535 | A Discipline of Programming - DIJKSTRA - 1976 |

1064 | Bigraphs and mobile processes
- Jensen, Milner
- 2003
(Show Context)
Citation Context ...relation between terms that are taken to be identical. Besides ff conversion we have associativity and commutativity of declarations in a var clause. The remaining two rules allow for scope-extrusion =-=[MPW92]-=- and merging/splitting of scopes. These rules are subject to the hygiene condition that bound variables in a term are pairwise different, and 8 Term Structure: Terms M;N ::= x Pattern-bound variable j... |

766 | Notions of computation and monads - Moggi - 1991 |

457 | Computational lambda-calculus and monads - Moggi - 1989 |

430 |
Proof of correctness of data representations
- HOARE
- 1972
(Show Context)
Citation Context ...sfies algebraic laws on queues which were derived from the functional specification. Compared to this work, the present treatment is more systematic (since it uses a standard data refinement approach =-=[Hoa72]-=-), complete (since it directly relates to the functional specification), and concise. As a first step, here is the definition of an abstract type for immutable queues. module Queue type Queue = case E... |

419 | Evolving algebras 1993: Lipari guide
- Gurevich
- 1993
(Show Context)
Citation Context ...rogram logics to specification languages, to programming. Dynamic logic [Har79] makes extensive use of variable functions called arrays (but being not restricted to integer domains). Evolving algebras=-=[Gur95]-=-, now called abstract state machines, use a combination of algebraic data types and variable functions together with transition rules for system modelling [BBD + 96] as well as programming language se... |

230 | Report on the programming language Haskell: a non-strict, purely functional language. Version 1.2 - Hudak, Jones, et al. - 1992 |

193 | Parameter-passing and the lambda calculus
- Crank, Felleisen
- 1991
(Show Context)
Citation Context ...pdate can only occur in hole position of an evaluation context relative to their function definition and their operands have to be values. Similar rules for single-point variables were put forward in =-=[CF91]-=-. Note that the two reduction rules for function application and function update are symmetrical. Function application transfers a pattern matching case clause from the environment where the function ... |

93 | Lively linear Lisp — ‘Look Ma, no garbage - Baker - 1992 |

88 | The Semantics of the C Programming Language - Gurevich, Huggins - 1993 |

82 |
Some techniques for proving correctness of programs which alter data structures
- Burstall
- 1972
(Show Context)
Citation Context ...gram. The domain of these functions is unstructured, so that this approach does not lend itself immediately to program verification without additional techniques to address pointer aliasing. Burstall =-=[Bur72] uses a si-=-milar approach for program verification. He handles de-aliasing by the introduction of "changed" sets. Bijlsma [Bij89] and Moller [Mol93, Mol97] refine this approach by using maps or re2 lat... |

77 |
An Axiomatic Definition of the Programming Language PASCAL
- Hoare, Wirth
- 1973
(Show Context)
Citation Context ...ntext of a polymorphically typed, higher-order language. There are several other approaches to the semantics, derivation and verification of pointer-based programs. The axiomatic definition of Pascal =-=[HW73]-=- treats the whole program heap as a collection of variable functions, one per record type declared in a program. The domain of these functions is unstructured, so that this approach does not lend itse... |

75 | Integrating Independently-Developed Components
- Hölzle
- 1993
(Show Context)
Citation Context ...odule Backend var (sym: Symbol) adr: int ... module XRef var (sym: Symbol) uses: List[Position] ... This use of variable functions in program composition can be seen a special case of type adaptation =-=[Hol93]-=-, restricted to the case of instance fields. An extension to methods seems feasible, but is not part of the current paper. 5 A Calculus for Variable Functions This section gives an operational semanti... |

57 | Proof of a program: Find - Hoare - 1971 |

56 | A mathematical definition of full Prolog - Börger, Rosenzweig - 1995 |

54 |
Lazy memo-functions
- Hughes
- 1985
(Show Context)
Citation Context ... t. case Empty ) 0 case Branch(l, x, r) ) if h(t) = 0 then h(t) := max(h(left(t)), h(right(t))) + 1 h(t) The last definition is a bit more involved than the others. It introduces a lazy memo function =-=[Hug85]-=-, height. The function computes the height of its tree parameter t from the height of t's subtrees, and updates a map h with that value. Subsequent accesses to height(t) then take the value directly f... |

46 | Operational aspects of linear lambda calculus - Lincoln, Mitchell - 1992 |

40 |
and Urs Holzle. Binary component adaptation
- Keller
- 1997
(Show Context)
Citation Context ...ufficient support for component composition. Variable functions promise to provide a better framework for this task, and their implementation fits well with techniques for binary component adaptation =-=[KH98]-=-. Acknowledgements. This work was motivated by Egon Borger's talks on evolving algebras given in Karlsruhe in 1994 and 1996, and by John Reynold's POPL keynote address in which he brought back into me... |

31 | Call-by-name, call-by-value, callby-need, and the linear lambda calculus - Maraist, Odersky, et al. - 1995 |

25 | Observers for Linear Types - Odersky - 1992 |

21 | Real-time queue operations - HOOD, R - 1981 |

20 |
First-Order Dynamic Logic, volume 68
- Harel
- 1979
(Show Context)
Citation Context ...al modular decompositions. Section 4 will give examples. Variable functions have come up in a number of contexts, ranging from program logics to specification languages, to programming. Dynamic logic =-=[Har79]-=- makes extensive use of variable functions called arrays (but being not restricted to integer domains). Evolving algebras[Gur95], now called abstract state machines, use a combination of algebraic dat... |

18 | Towards pointer algebra - Möller - 1993 |

16 | Efficient functional implementation of FIFO queues - Burton - 1982 |

16 | Calculating with pointer structures - Möller - 1997 |

15 | R.: CLAM Specification for Provably Correct Compilation of CLP(R - Börger, Salamone - 1995 |

13 | Rolling your own mutable adt: A connection between linear types and monads - Chen, Hudak - 1997 |

12 | Verification of programs that destructively manipulate data - Mason - 1988 |

4 | Hints on Programming Language Design, Stanford University Artificial Intelligence memo AIM-224/STAN-CS-73-403 - Hoare - 1973 |

4 | Equivalence in functional languages with side effects - Mason, Talcott - 1991 |

2 | Towards distributed interactive programs in the functional programming language Clean - Achten, Plasmeijer - 1994 |

1 |
Calculating with pointers
- Bijslma
- 1989
(Show Context)
Citation Context ...ion without additional techniques to address pointer aliasing. Burstall [Bur72] uses a similar approach for program verification. He handles de-aliasing by the introduction of "changed" sets=-=. Bijlsma [Bij89]-=- and Moller [Mol93, Mol97] refine this approach by using maps or re2 lational algebra to express the topology of pointer structures. In all these treatments, the topological information about a pointe... |