Skip to main content

Language Theory and Semantics

  • Chapter
  • First Online:
Mathematics in Computing

Part of the book series: Undergraduate Topics in Computer Science ((UTICS))

  • 2684 Accesses

Abstract

This chapter discusses language theory and includes a discussion on grammar, parse trees and derivations from grammar. The important area of programming language semantics is discussed, including axiomatic, denotational and operational semantics.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    ε denotes the empty word.

  2. 2.

    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’.

  3. 3.

    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.

  4. 4.

    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.

  5. 5.

    It is possible that what the programmer has written is not be what the programmer had intended.

  6. 6.

    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.

  7. 7.

    Hoare was influenced by earlier work by Floyd on assigning meanings to programs using flowcharts (Floyd 1967).

  8. 8.

    Total correctness is expressed using {P}a{Q} and 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.

  9. 9.

    This virtual stack-based machine was originally designed by Peter Landin (a British computer scientist) to evaluate lambda calculus expressions, and it has since been used as a target for several compilers. Landin was influenced by McCarthy’s LISP.

  10. 10.

    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.

  11. 11.

    This essentially expresses that the names of bound variables are unimportant.

  12. 12.

    This essentially expresses the idea of function application.

  13. 13.

    This essentially expresses the idea that two functions are equal if and only if they give the same results for all arguments.

References

  • Floyd R (1967) Assigning meanings to programs. Proc Symp Appl Math (19):19–32

    Google Scholar 

  • Hoare CAR (1969) An axiomatic basis for computer programming. Commun ACM 12(10):576–585

    Article  Google Scholar 

  • Meyer (1990) Introduction to the theory of programming languages. Prentice Hall

    Google Scholar 

  • Naur P (ed) (1960) Report on the algorithmic language, ALGOL 60. Commun ACM 3(5):299–314

    Google Scholar 

  • O’Regan G (2006) Mathematical approaches to software quality. Springer, Berlin

    Google Scholar 

  • O’Regan G (2016) Introduction to the history of computing. Springer, Berlin

    Chapter  Google Scholar 

  • Plotkin G (1981) A structural approach to operational semantics. Technical Report DAIM FN-19. Computer Science Department. Aarhus University, Denmark

    Google Scholar 

  • Stoy J (1977) Denotational semantics. the scott-strachey approach to programming language theory. MIT Press

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Gerard O’Regan .

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

O’Regan, G. (2020). Language Theory and Semantics. In: Mathematics in Computing. Undergraduate Topics in Computer Science. Springer, Cham. https://doi.org/10.1007/978-3-030-34209-8_12

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-34209-8_12

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-34208-1

  • Online ISBN: 978-3-030-34209-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics