Abstract

Procedure call mechanisms have mainly been studied in the framework of recursive programs without assignments, for the simplicity of their operational and denotational semantics (See Scott [16], Nivat [14], Vuillemin [17]). According to operational semantics, procedure calls act as textual rewritings ; select at each computation step the occurrences of unknown functions to be rewritten. A computation is called correct if the value it computes is the one given by the denotational semantics. Correctness and efficiency of computation rules have been studied in Vuillemin [17,18], Montangero-Pacini-Turini [13], Downey-Sethi [7]. The main results are well-known: innermost evaluation (call by value) is not correct, parallel outermost or full substitution are correct. Vuillemin [17,18] gives a sufficient condition for a to be correct, (safety), later extended by Downey-Sethi [7] into a necessary and sufficient one (security). Vuillemin also studies particular implementation of call-by-name, the delay ; he shows its optimality with respect to a reasonable implementation cost, provided interpretations satisfy a sequentiality condition. This result is in fact twofold : sequentiality allows elimination of useless steps, and optimality follows by using sharing mechanisms in term implementation. The basis of all these studies is the following theorem (Vuillemin [17,18]) : provided some restrictive conditions on programs are satisfied, the set of terms derivable from a given term is a lattice under the derivation ordering. Our aim is to extend these results, for the three following reasons : first, though every program can be transformed to match Vuillemin's conditions, the transformations may affect the costs of computations : a more direct proof can be investigated. Second, a direct generalization to the e-calculus is not straightforward, since e-terms definitely do not form lattices. Third, the symbolic (or Herbrand) interpretation [5] is not sequential in the sense of Vuillemin, and no optimality result is known for it. Our point of view will be purely syntactic : we reconstruct the lattice property in derivations. We study minimal computations (i.e. finite or infinite derivations)in the symbolic interpretation, and transform them into optimal ones. Eventually, we characterize interpretations to which similar results apply. Extension towards the e-calculus is done in [10]. The lattice property of terms breaks down in general : two very different may lead to the same term by syntactical accidents, which collapse two a priori different terms. In section I, we take care of this fact by introducing an equivalence and a preorder on derivations. We give three characterizations of these relations. For the main one, we extend the classical notion of residuals [4] by defining residuals of by derivations. We show that derivation classes form a lattice. In section II, we study the simple derivations defined by Vuillemin with use of labels (named here complete derivations). We give two characterizations of them in the usual formalism. Section III, is devoted to minimality and optimality results. Ordering infinite as well as finite one, we construct least computations of every syntactic approximation of the infinite tree determined by the program. The associated complete derivation are optimal with respect to Vuillemin's cost. Extension to interpretations is then straightforward, as soon as they satisfy a syntactic condition. All classes of sequential interpretations considered in [2,6,11,17] do satisfy this condition. The rule we use for constructing the optimal computations is very inefficient in general, but reduces to the usual delay rules in sequential interpretations.

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.