Formal Aspects of Computing

, Volume 5, Issue 4, pp 289–298 | Cite as

Type inference in stack based languages

  • Bill Stoddart
  • Peter J. Knaggs


We consider a language of operations which pass parameters by means of a stack. An algebra over the set of type signatures is introduced, which allows the type signature of a program to be obtained from the type signatures of its constituent operations.

Although the theories apply in principle to any stack based language, they have been evolved with particular regard to the proposed ANSI Standard Forth language, which is currently implemented in a type free manner. We hope this work will stimulate an interest in Forth amongst those applying algebraic techniques in software engineering, and we hope to lay the theoretical foundations for implementing practical type checkers to support Forth.


Formal aspects Stack based languages Semantic model language Algebras Type inference Forth 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [ANS91]
    ANS ACS X3/X3J14 Programming Languages: Forth, Draft Standard, 1st Revision, American National Standards Institute, 1991.Google Scholar
  2. [Bro87]
    Brodie, L.:Starting Forth, 2nd Edition, Prentice Hall International, 1987.Google Scholar
  3. [NiP70]
    Nivat, M. and Perrot, J. F.: Une generalisation du monoid bicyclique,C.R. Acad Sci., Paris, 271A, 1970, pp. 824–827.Google Scholar
  4. [Pöi90a]
    Pöial, J.: The Algebraic Specification of Stack Effects for Forth Programs,Proc. Euro-Forml90 Conf., Southampton, UK, October, 1990.Google Scholar
  5. [Pöi90b]
    Pöial, J.: Letter to the authors, 1990.Google Scholar
  6. [Pöi91]
    Pöial, J.: Multiple Stack Effects of Forth Programs,Proc. EuroForml91 Conf., Marianbad, Czechoslovakia, October, 1991.Google Scholar
  7. [Wic88]
    Wickes, W. C.: RPL: A Mathematical Control Language,Proc. 1988 Rochester Forth Conf., Rochester, NY, USA, 1988.Google Scholar

Copyright information

© BCS 1993

Authors and Affiliations

  1. 1.School of Computing and MathematicsUniversity of TeessideMiddlesbroughUK

Personalised recommendations