scispace - formally typeset
Search or ask a question
Journal ArticleDOI

From Natural Semantics to Abstract Machines

11 Oct 2004-BRICS Report Series-Vol. 11, Iss: 20
TL;DR: This work describes how to construct correct abstract machines from the class of L-attributed natural semantics and formalizes it as an extraction algorithm and proves that the algorithm produces abstract machines that are equivalent to the original natural semantics.
Abstract: We describe how to construct correct abstract machines from the class of L-attributed natural semantics introduced by Ibraheem and Schmidt at HOOTS 1997. The construction produces stack-based abstract machines where the stack contains evaluation contexts. It is defined directly on the natural semantics rules. We formalize it as an extraction algorithm and we prove that the algorithm produces abstract machines that are equivalent to the original natural semantics. We illustrate the algorithm by extracting abstract machines from natural semantics for call-by-value, call-by-name, and call-by-need evaluation of lambda terms.

Content maybe subject to copyright    Report

Citations
More filters
Book ChapterDOI
11 Jun 2012
TL;DR: This work interprets coinductively the rules for the standard big-step operational semantics of a Java-like language, thus making the claim of soundness more intuitive: whenever a program is well-typed, its coinductive operational semantics returns a value.
Abstract: It is well known that big-step operational semantics are not suitable for proving soundness of type systems, because of their inability to distinguish stuck from non-terminating computations. We show how this problem can be solved by interpreting coinductively the rules for the standard big-step operational semantics of a Java-like language, thus making the claim of soundness more intuitive: whenever a program is well-typed, its coinductive operational semantics returns a value.Indeed, coinduction allows non-terminating computations to return values; this is proved by showing that the set of proof trees defining the semantic judgment forms a complete metric space when equipped with a proper distance function.In this way, we are able to prove soundness of a nominal type system w.r.t. the coinductive semantics. Since the coinductive semantics is sound w.r.t. the usual small-step operational semantics, the standard claim of soundness can be easily deduced.

24 citations


Cites background from "From Natural Semantics to Abstract ..."

  • ...Similar approaches, although their corresponding semantics are not deterministic, are those of Ager [1] and Stoughton [18]....

    [...]

Book ChapterDOI
Mads Sig Ager1
26 Aug 2004
TL;DR: This work describes how to construct correct abstract machines from the class of L-attributed natural semantics and formalizes it as an extraction algorithm and proves that the algorithm produces abstract machines that are equivalent to the original natural semantics.
Abstract: We describe how to construct correct abstract machines from the class of L-attributed natural semantics introduced by Ibraheem and Schmidt at HOOTS 1997. The construction produces stack-based abstract machines where the stack contains evaluation contexts. It is defined directly on the natural semantics rules. We formalize it as an extraction algorithm and we prove that the algorithm produces abstract machines that are equivalent to the original natural semantics. We illustrate the algorithm by extracting abstract machines from natural semantics for call-by-value and call-by-name evaluation of lambda terms.

24 citations


Cites background from "From Natural Semantics to Abstract ..."

  • ...In an extended version of this article we also illustrate the algorithm by extracting an abstract machine from a natural semantics for call-by-need evaluation of λ-terms [1]....

    [...]

  • ...Due to lack of space we omit the details which can be found in an extended version of this article [1]....

    [...]

Journal ArticleDOI
TL;DR: This paper supports its claim by using a simple language called LM, for which it is claimed that a big-step semantics expressed with the new approach, allowing one to formulate a stronger type soundness property.
Abstract: In this paper we present a novel approach to big-step operational semantics. This approach stems from the observation that the typical type soundness property formulated via a big-step operational semantics is weak, while the option of using a small-step operational semantics is not always an option, because it is less intuitive to build and understand. We support our claim by using a simple language called LM, for which we present a big-step semantics expressed with the new approach, allowing one to formulate a stronger type soundness property. We prove this property for LM and we present an example of an error in the typing rules which does not violate the typical type soundness property, but does violate ours.

7 citations


Cites background or result from "From Natural Semantics to Abstract ..."

  • ...In particular, the solution in [2] is in many respects similar to ours....

    [...]

  • ...The big-step operational semantics formulation (as introduced by Kahn [8] and also known as natural semantics) is often thought as a more intuitive choice than small-step semantics [10, 7, 2, 6, 1]....

    [...]

  • ...Our approach is in many respects similar to that of Ager [2], which presents how to translate any big-step semantics into a stack machine....

    [...]

  • ...This property is very similar to the one defined for the L-attributed grammar by Ibraheem and Schmidt in [7] and explored deeper by Ager in [2]....

    [...]

  • ...These problems have already been pointed out in the literature and there exist some proposals of solutions in [10, 7, 2, 6, 13]....

    [...]

Book ChapterDOI
19 Sep 2005
TL;DR: This paper uses the process of mechanically derived abstract machines to derive a function that accurately counts the number of steps required to evaluate expressions in a simple language, and illustrates this function with a range of examples.
Abstract: Starting with an evaluator for a language, an abstract machine for the same language can be mechanically derived using successive program transformations. This has relevance to studying both the time and space properties of programs because these can be estimated by counting transitions of the abstract machine and measuring the size of the additional data structures needed, such as environments and stacks. In this paper we will use this process to derive a function that accurately counts the number of steps required to evaluate expressions in a simple language, and illustrate this function with a range of examples.

3 citations


Cites background from "From Natural Semantics to Abstract ..."

  • ...Recently Danvy et al have explored the basis of abstract machines, and the process of deriving them from evaluators [1, 2, 3, 5]....

    [...]

Journal ArticleDOI
Viviana Bono1
TL;DR: Magda is a mixin-oriented programming language and its goal is to improve code modularity and, as a consequence, code reuse.
Abstract: We discuss Magda ten years after its design. Magda is a mixin-oriented programming language and its goal is to improve code modularity and, as a consequence, code reuse. The aim of this paper is to survey Magda and position it in today’s programming language scenarios.