0%

This book – the first of two volumes – explores the syntactical constructs of the most common programming languages, and sheds a mathematical light on their semantics, while also providing an accurate presentation of the material aspects that interfere with coding.

Concepts and Semantics of Programming Languages 1 is dedicated to functional and imperative features. Included is the formal study of the semantics of typing and execution; their acquisition is facilitated by implementation into OCaml and Python, as well as by worked examples. Data representation is considered in detail: endianness, pointers, memory management, union types and pattern-matching, etc., with examples in OCaml, C and C++. The second volume introduces a specific model for studying modular and object features and uses this model to present Ada and OCaml modules, and subsequently Java, C++, OCaml and Python classes and objects.

This book is intended not only for computer science students and teachers but also seasoned programmers, who will find a guide to reading reference manuals and the foundations of program verification.

Table of Contents

  1. Cover
  2. Title Page
  3. Copyright
  4. Foreword
  5. Preface
  6. 1 From Hardware to Software
    1. 1.1. Computers: a low-level view
    2. 1.2. Computers: a high-level view
  7. 2 Introduction to Semantics of Programming Languages
    1. 2.1. Environment, memory and state
    2. 2.2. Evaluation of expressions
    3. 2.3. Definition and assignment
    4. 2.4. Exercises
  8. 3 Semantics of Functional Features
    1. 3.1. Syntactic aspects
    2. 3.2. Execution semantics: evaluation functions
    3. 3.3. Execution semantics: operational semantics
    4. 3.4. Evaluation functions versus evaluation relations
    5. 3.5. Semantic properties
    6. 3.6. Exercises
  9. 4 Semantics of Imperative Features
    1. 4.1. Syntax of a kernel of an imperative language
    2. 4.2. Evaluation of expressions
    3. 4.3. Evaluation of definitions
    4. 4.4. Operational semantics
    5. 4.5. Semantic properties
    6. 4.6. Procedures
    7. 4.7. Other approaches
    8. 4.8. Exercises
  10. 5 Types
    1. 5.1. Type checking: when and how?
    2. 5.2. Informal typing of a program Exp2
    3. 5.3. Typing rules in Exp2
    4. 5.4. Type inference algorithm in Exp2
    5. 5.5. Properties
    6. 5.6. Typechecking of imperative constructs
    7. 5.7. Subtyping and overloading
  11. 6 Data Types
    1. 6.1. Basic types
    2. 6.2. Arrays
    3. 6.3. Strings
    4. 6.4. Type definitions
    5. 6.5. Generalized conditional
    6. 6.6. Equality
  12. 7 Pointers and Memory Management
    1. 7.1. Addresses and pointers
    2. 7.2. Endianness
    3. 7.3. Pointers and arrays
    4. 7.4. Passing parameters by address
    5. 7.5. References
    6. 7.6. Memory management
  13. 8 Exceptions
    1. 8.1. Errors: notification and propagation
    2. 8.2. A simple formalization: ML-style exceptions
    3. 8.3. Exceptions in other languages
  14. Conclusion
  15. Appendix: Solutions to the Exercises
  16. List of Notations
  17. Index of Programs
  18. References
  19. Index
  20. End User License Agreement
54.163.200.109