Academia.eduAcademia.edu

Outline

Forth Semantics for Compiler Verification

2012

Abstract

Here we are interested in the semantics of Forth from the point of view of using Forth as a target language for a formally verified compiler for Ruth-R, a reversible sequential programming language we are currently developing. We limit out attention to those Forth operations and constructs which will be targetted by the Ruth-R compiler. To facilitate the comparison of meanings of source and target languages, we represent the semantics of Forth code by translation into a form which can be described using the ”prospective value” semantics we use for Ruth-R.

Key takeaways
sparkles

AI

  1. This work develops semantics for RVM-Forth to facilitate compiler verification for the reversible language Ruth-R.
  2. The semantics are based on prospective value (PV) semantics, allowing direct meaning comparison between languages.
  3. Forth operations are translated into a form suitable for PV semantics, ensuring compositionality and minimizing semantic distance.
  4. Two approaches for modeling the Forth stack are evaluated: cell sequences and a conceptual stack structure.
  5. The text concludes that the chosen Forth semantics lays a foundation for formal verification in the compiler context.

References (12)

  1. J-R Abrial. The B Book. Cambridge University Press, 1996.
  2. E C R Hehner. A Practical Theory of Programming. Springer Verlag, 1993. Latest version available on-line.
  3. E R Hehner. Retrospective and Prospective for Unifying Theories of Pro- gramming. In S. E. Dunne and W Stoddart, editors, UTP2006 The First International Symposium on Unifying Theories of Programming, number 4010 in Lecture Notes in Computer Science, 2006.
  4. P. K. Knaggs and W. J. Stoddart. The Cell Type. In University of Rochester Forth Conference on Automated Instruments, The Journal of Forth Appli- cation and Research (JFAR), June 1991.
  5. J F Power and D Sinclair. A Formal Model of Forth Control Words in the Pi-Calculus. Journal of Universal Computer Science, 10.9, 2004.
  6. W. J. Stoddart. An Event Calculus Model of the Forth Programming System. In 12th EuroForth Conference Proceedings, October 1996. Note that the downloadable document contains the pages in reverse order.
  7. W. J. Stoddart and P. K. Knaggs. Type Inference in Stack Based Lan- guages. Formal Aspect of Computing, 5(4):289-298, 1993.
  8. W J Stoddart and F Zeyda. A Unification of Probabilistic Choice within a Design-based Model of Reversible Computation. Formal Aspect of Com- puting, 2007. Published on line, DOI 10.1007/s00165-007-0048-1.
  9. W J Stoddart, F Zeyda, and S Dunne. Preference and non-deterministic choice. In ICTAC'10. Proceedings of the 7th International colloquium con- ference on Theoretical aspects of computing, volume 6255 of LNCS, 2010.
  10. W J Stoddart, F Zeyda, and A R Lynas. A Design-based model of reversible computation. In UTP'06, First International Symposium on Unifying The- ories of Programming, volume 4010 of LNCS, June 2006.
  11. W J Stoddart, F Zeyda, and A R Lynas. A virtual machine for supporting reversible probabilistic guarded command languages. ENTCS, 253, 2010. Extended version of a paper presented at RC2009.
  12. F Zeyda. Reversible Computations in B. PhD thesis, University of Teesside, 2007.