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:…mehr
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.
Thérèse Hardin is Professor Emeritus at the Laboratoire d¿Informatique de Paris 6 (LIP6), Sorbonne University, France. Mathieu Jaume is a lecturer at the Laboratoire d¿Informatique de Paris 6 (LIP6), Sorbonne University, France. François Pessaux is Associate Professor in the Computer Science and Systems Engineering Unit (U2IS) of ENSTA Paris, France. Véronique Viguié Donzeau-Gouge is Professor Emeritus at the Centre d¿études et de recherche en informatique (CEDRIC) of the Conservatoire national des arts et métiers (Cnam Paris), France.
Inhaltsangabe
Foreword xi
Preface xiii
Chapter 1. From Hardware to Software 1
1.1. Computers: a low-level view 1
1.1.1. Information processing 1
1.1.2. Memories 2
1.1.3. CPUs 3
1.1.4. Peripheral devices 7
1.2. Computers: a high-level view 8
1.2.1. Modeling computations 9
1.2.2. High-level languages 9
1.2.3. From source code to executable programs 10
Chapter 2. Introduction to Semantics of Programming Languages 15
2.1. Environment, memory and state 16
2.1.1. Evaluation environment 16
2.1.2. Memory 18
2.1.3. State 20
2.2. Evaluation of expressions 21
2.2.1. Syntax 21
2.2.2. Values 22
2.2.3. Evaluation semantics 24
2.3. Definition and assignment 26
2.3.1. Defining an identifier 26
2.3.2. Assignment 29
2.4. Exercises 31
Chapter 3. Semantics of Functional Features 35
3.1. Syntactic aspects 35
3.1.1. Syntax of a functional kernel 35
3.1.2. Abstract syntax tree 36
3.1.3. Reasoning by induction over expressions 39
3.1.4. Declaration of variables, bound and free variables 39