skip to main content
research-article

An Experiment with Denotational Semantics

Published: 14 August 2019 Publication History

Abstract

The paper is devoted to showing how to systematically design a programming language in “reverse order”, i.e., from denotations to syntax. This construction is developed in an algebraic framework consisting of three many-sorted algebras: of denotations, of an abstract syntax and of a concrete syntax. These algebras are constructed in such a way that there is a unique homomorphism from concrete syntax to denotations, which constitutes the denotational semantics of the language. Besides its algebraic framework, the model is set-theoretic, i.e., the denotational domains are just sets, rather than Scott’s reflexive domains. The method is illustrated by a layer-by-layer development of a virtual language Lingua: an applicative layer, an imperative layer (with recursive procedures) and an SQL layer where Lingua is regarded as an API (Application Programming Interface) for an SQL engine. The latter is given a denotational semantics as well. Mathematically, the model is based on so-called naive denotational semantics (Blikle and Tarlecki in Information processing 83. Elsevier Science Publishers B.V., North-Holland, 1983), Many-sorted algebras (Goguen et al. in J ACM 24:68–95, 1977), equational grammars (Blikle in Inform Control 21:134–147, 1972), and a three-valued predicate calculus based on a three-valued proposition calculus of McCarthy (A basis for a mathematical theory of computation, North Holland, 1967). Three-valued predicates provide an adequate framework for error-handling mechanisms and also for the development of a Hoare-like logic with clean termination (Blikle in Acta Inform 16:199–217, 1981) for Lingua. That logic is used in Blikle and Chrząstowski-Wachtel (Complete Unambiguous, https://doi.org/10.13140/rg.2.2.27499.39201/3, 2019) for the development of correctness-preserving programs’ constructors. This issue is, however, not covered by the paper. The langue is equipped with a strong typing mechanism which covers basic types (numbers, Booleans, etc.), lists, arrays, record and their arbitrary combinations plus SQL-like types: rows, tables, and databases. The model of types includes SQL-integrity constraints.

References

[1]
Ahrent W, Beckert B, Bubel R, Hähnle R, Schmitt PH, and Ulbrich M Deductive software verification—the key book; from theory to practice. Lecture notes in computer science, 10001 2016 New York Springer
[2]
Binsbergena LT, Mosses PD, and Sculthorped CN Executable component-based semantics J Logical Algebraic Methods Program. 2019 103 184-212
[3]
Bjørner D and Jones BC The Vienna development method: the metalanguage 1982 Upper Saddle River Prentice Hall International
[4]
Bjørner D and Oest ON Towards a formal description of Ada. Lecture notes of computer science, 98 1980 New York Springer Verlag
[5]
Blikle A. Algorithmically definable functions. A contribution towards the semantics of programming languages, Dissertationes Mathematicae, LXXXV, PWN, Warszawa. 1971.
[6]
Blikle A Equational languages Inf Control 1972 21 2 134-147
[7]
Blikle A. Toward mathematical structured programming, formal description of programming concepts. In: Neuhold EJ, editors. Proc. IFIP Working Conf. St. Andrews, N.B., Canada 1977. North Holland, Amsterdam; 1978, pp. 183–2012.
[8]
Blikle A. On correct program development. In: Proceedings of the 4th international conference on software engineering, München, September 17–19, 1979. IEEE Computer Society, pp. 164–73.
[9]
Blikle A On the development of correct specified programs IEEE Trans Soft Eng 1981 SE-7 5 519-527
[10]
Andrzej Blikle The clean termination of iterative programs Acta Inform 1981 16 199-217
[11]
Blikle A MetaSoft primer—towards a metalanguage for applied denotational semantics, Lecture notes in computer science 1987 New York Springer Verlag
[12]
Blikle Andrzej, Denotational Engineering or from Denotations to Syntax, red. D. Bjørner, C.B. Jones, M. Mac an Airchinnigh, E.J. Neuhold, VDM: A Formal Method at Work, Lecture notes in Computer Science 252, Springer, Berlin 1987.
[13]
Blikle A. Three-valued predicates for software specification and validation. In: VDM’88, VDM: the way ahead. Proceedings of 2nd, VDM-Europe symposium, Dublin 1988, Lecture notes of computer science, New York: Springer; 1988, pp 243–66.
[14]
Blikle A Denotational engineering Sci Comput Program 1989 12 207-253
[15]
Blikle A. An experiment with a user manual based on a denotational semantics.
[16]
Blikle A, Chrząstowski-Wachtel P. A denotational engineering of programming languages—to make software systems reliable and user manuals clear, complete and unambiguous. 2019.
[17]
Blikle A and Tarlecki A Mason REA Naive denotational semantics Information processing 83 1983 North-Holland Elsevier Science Publishers
[18]
Branquart P, Luis G, and Wodon P An analytical description of CHILL, the CCITT high-level language. Lecture notes in computer science, 128 1982 New York Springer-Verlag
[19]
Chomsky N. Context-free grammar and pushdown storage. Quarterly Progress Report 65, MIT Research Laboratories of Electronics, Quarterly Report. 1962. pp. 187–94.
[20]
Ginsburg S The mathematical theory of context-free languages 1966 New York McGraw-Hill
[21]
Goguen JA, Thatcher JW, Wagner EG, and Wright JB Initial algebra semantics and continuous algebras J Assoc Comput Mach 1977 24 68-95
[22]
Gordon MJC The denotational description of programming languages 1979 Berlin Springer Verlag
[23]
Hoare CAR An axiomatic basis for computer programming Commun ACM 1969 12 576-583
[24]
Kleene SC. Introduction to metamathematics. North Holland 1952 (later republished in the years 1957, 59, 62, 64, 67, 71).
[25]
McCarthy J. A basis for a mathematical theory of computation. In: Brawffort P, Hirschberg D, editors. Western joint computer conference, May 1961 later republished in Computer programming and formal systems. North Holland; 1967.
[26]
Naur P (editors). Report on the algorithmic language ALGOL60. Communications of the association for computing machinery, Homepage archive Volume 3 Issue 5, 1960. pp 299–314.
[27]
Stoy JE Denotational semantics: the scott-strachey approach to programming language theory 1977 Cambridge MIT Press
[28]
Scott D. Strachey C. Towards a mathematical semantics of computer languages. Technical Monograph PRG-6, Oxford University, Oxford, 1971.
[29]
Turing A. On checking a large routine. Report of a conference on high-speed calculating machines, University Mathematical Laboratory, Cambridge. 1949, pp. 67–69.

Recommendations

Comments

Information & Contributors

Information

Published In

cover image SN Computer Science
SN Computer Science  Volume 1, Issue 1
Jan 2020
823 pages

Publisher

Springer-Verlag

Berlin, Heidelberg

Publication History

Published: 14 August 2019
Accepted: 15 July 2019
Received: 19 April 2019

Author Tags

  1. Set-theoretic denotational semantics
  2. Many-sorted algebras
  3. Three-valued predicate calculus
  4. A denotational model of types
  5. Abstract syntax
  6. Concrete syntax

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 0
    Total Downloads
  • Downloads (Last 12 months)0
  • Downloads (Last 6 weeks)0
Reflects downloads up to 18 Aug 2024

Other Metrics

Citations

View Options

View options

Get Access

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media

-