Abstract
There are two key parts to any programming language, and these are its syntax and semantics.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
Recall from Chap. 6 that a monoid (M, *, e) is a structure that is closed and associative under the binary operation ‘*’, and it has an identity element ‘e’.
- 2.
Chomsky made important contributions to linguistics and the theory of grammars. He is more widely known today as a critic of United States foreign policy.
- 3.
A linear bounded automaton is a restricted form of a nondeterministic Turing machine in which a limited finite portion of the tape (a function of the length of the input) may be accessed.
- 4.
A pushdown automaton is a finite automaton that can make use of a stack containing data, and it is discussed in Chap. 7.
- 5.
Backus Naur Form is named after John Backus and Peter Naur. It was created as part of the design of the Algol 60 programming language, and is used to define the syntax rules of the language.
- 6.
Of course, what the programmer has written may not be what the programmer had intended.
- 7.
There are attribute (or affix) grammars that extend the syntactic description of the language with supplementary elements covering the semantics. The process of adding semantics to the syntactic description is termed decoration.
- 8.
Hoare was influenced by earlier work by Floyd on assigning meanings to programs using flowcharts [4].
- 9.
Total correctness is expressed using {P}a{Q} amd program fragment a is totally correct for precondition P and postcondition Q if and only if whenever a is executed in any state in which P is satisfied then execution terminates, and the resulting state satisfies Q.
- 10.
This virtual stack based machine was originally designed by Peter Landin to evaluate lambda calculus expressions, and it has since been used as a target for several compilers.
- 11.
This is similar to what a compiler does in that if errors are found during the compilation phase, the compiler halts and displays the errors and does not continue with code generation.
- 12.
This essentially expresses that the names of bound variables is unimportant.
- 13.
This essentially expresses the idea of function application.
- 14.
This essentially expresses the idea that two functions are equal if and only if they give the same results for all arguments.
References
O’Regan G (2016) Introduction to the history of computing. Springer
ALGOL 60 (1960) Report on the algorithmic language. Commun ACM 3(5):299–314
Hoare CAR (1969) An axiomatic basis for computer programming. Commun of the ACM 12(10):576–585
Floyd R (1967) Assigning meanings to programs. Proc Symp Appl Math 19:19–32
O’ Regan G (2006) Mathematical approaches to software quality. Springer
Plotkin G (1981) A structural approach to operational semantics. Technical Report DAIM FN-19. Computer Science Department. AarhusUniversity, Denmark
Meyer B (1990) Introduction to the theory of programming languages. Prentice Hall.
Denotational Semantics (1977) The scott-strachey approach to programming language theory. Joseph Stoy. MIT Press
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2021 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this chapter
Cite this chapter
O’Regan, G. (2021). Language Theory and Semantics. In: Guide to Discrete Mathematics. Texts in Computer Science. Springer, Cham. https://doi.org/10.1007/978-3-030-81588-2_12
Download citation
DOI: https://doi.org/10.1007/978-3-030-81588-2_12
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-81587-5
Online ISBN: 978-3-030-81588-2
eBook Packages: Computer ScienceComputer Science (R0)