From Natural Semantics to Abstract Machines

  • Mads Sig Ager
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3573)


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.


Operational Semantic Extraction Algorithm Abstract Machine Functional Language Evaluation Context 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Ager, M.S.: From natural semantics to abstract machines. Technical Report BRICS RS-04-20, Department of Computer Science, University of Aarhus, Aarhus, Denmark (October 2004)Google Scholar
  2. 2.
    Ager, M.S., Biernacki, D., Danvy, O., Midtgaard, J.: A functional correspondence between evaluators and abstract machines. In: Miller, D. (ed.) Proceedings of the Fifth ACM-SIGPLAN International Conference on Principles and Practice of Declarative Programming, pp. 8–19. ACM Press, New York (2003)CrossRefGoogle Scholar
  3. 3.
    Ager, M.S., Danvy, O., Midtgaard, J.: A functional correspondence between monadic evaluators and abstract machines for languages with computational effects. Technical Report BRICS RS-03-35, DAIMI, Department of Computer Science, University of Aarhus, Aarhus, Denmark, Presented at the 2nd APPSEM II workshop, Talinn, Estonia (November 2003)Google Scholar
  4. 4.
    Ager, M.S., Danvy, O., Midtgaard, J.: A functional correspondence between call-by-need evaluators and lazy abstract machines. Information Processing Letters 90(5), 223–232 (2004)zbMATHCrossRefMathSciNetGoogle Scholar
  5. 5.
    Biernacki, D., Danvy, O.: From interpreter to logic engine by defunctionalization. In: Bruynooghe, M. (ed.) LOPSTR 2004. LNCS, vol. 3018, pp. 143–159. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  6. 6.
    Crégut, P.: An abstract machine for the normalization of λ-terms. In: Proceedings of the 1990 ACM conference on LISP and functional programming, pp. 333–340. ACM Press, New York (1990)CrossRefGoogle Scholar
  7. 7.
    Danvy, O.: A rational deconstruction of Landin’s SECD machine. Technical Report BRICS RS-03-33, DAIMI, Department of Computer Science, University of Aarhus, Aarhus, Denmark (October 2003)Google Scholar
  8. 8.
    Diehl, S., Hartel, P., Sestoft, P.: Abstract machines for programming language implementation. Future Generation Computer Systems 16, 739–751 (2000)CrossRefGoogle Scholar
  9. 9.
    Felleisen, M.: The Calculi of λ-v-CS Conversion: A Syntactic Theory of Control and State in Imperative Higher-Order Programming Languages. PhD thesis, Department of Computer Science, Indiana University, Bloomington, Indiana (August 1987)Google Scholar
  10. 10.
    Felleisen, M., Flatt, M.: Programming languages and lambda calculi. Unpublished lecture notes, (1989-2001)
  11. 11.
    Hannan, J., Miller, D.: From operational semantics to abstract machines. Mathematical Structures in Computer Science 2(4), 415–459 (1992)zbMATHCrossRefMathSciNetGoogle Scholar
  12. 12.
    Hardin, T., Maranget, L., Pagano, B.: Functional runtime systems within the lambda-sigma calculus. Journal of Functional Programming 1(1), 1–100 (1993)Google Scholar
  13. 13.
    Ibraheem, H., Schmidt, D.A.: Adapting big-step semantics to small-step style: Coinductive interpretations and “higher-order” derivations. In: Gordon, A., Pitts, A., Talcott, C. (eds.) Electronic Notes in Theoretical Computer Science, vol. 10. Elsevier, Amsterdam (2000)Google Scholar
  14. 14.
    Kahn, G.: Natural semantics. In: Brandenburg, F.-J., Vidal-Naquet, G., Wirsing, M. (eds.) STACS 1987. LNCS, vol. 247, pp. 22–39. Springer, Heidelberg (1987)CrossRefGoogle Scholar
  15. 15.
    Launchbury, J.: A natural semantics for lazy evaluation. In: Proceedings of the 20th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pp. 144–154. ACM Press, New York (1993)CrossRefGoogle Scholar
  16. 16.
    Milner, R., Tofte, M., Harper, R., MacQueen, D.: The Definition of Standard ML (Revised). MIT Press, Cambridge (1997)Google Scholar
  17. 17.
    Nielson, F., Nielson, H.R.: Semantics with Applications. John Wiley & Sons, Chichester (1992)zbMATHGoogle Scholar
  18. 18.
    Sestoft, P.: Deriving a lazy abstract machine. Journal of Functional Programming 7(3), 231–264 (1997)zbMATHCrossRefMathSciNetGoogle Scholar
  19. 19.
    Winskel, G.: The Formal Semantics of Programming Languages. Foundation of Computing Series. MIT Press, Cambridge (1993)zbMATHGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2005

Authors and Affiliations

  • Mads Sig Ager
    • 1
  1. 1.BRICS, Department of Computer ScienceUniversity of AarhusAarhus NDenmark

Personalised recommendations