Contents

  1. Home
  2. Colophon
  3. Preface
  4. Acknowledgements
  5. Contents
  6. 1 Computer Arithmetic
  7. 1.1 Positional Notation
  8. 1.2 Binary Numbers
  9. 1.3 Addition and Subtraction
  10. 1.4 The Integers
  11. 1.5 Shifts
  12. 1.6 Summary
  13. 2 Machine Code
  14. 2.1 The von-Neumann Architecture
  15. 2.2 The RV32I ISA
  16. 2.3 The Assembler
  17. 2.4 Execution Traces
  18. 2.5 The Data Segment
  19. 2.6 Memory Segmentation
  20. 2.7 Linking
  21. 2.8 Calling Functions
  22. 3 Some Simple Algorithms
  23. 3.1 Number Conversion
  24. 3.2 The Sieve of Eratosthenes
  25. 3.3 Insertion Sort
  26. 3.4 Evaluating Polynomials with Horner’s Method
  27. 3.5 The Tortoise and the Hare
  28. 4 Introduction to C
  29. 4.1 Basics
  30. 4.2 Execution Traces
  31. 4.3 Imperative Variables
  32. 4.4 The C Memory Model
  33. 4.5 Translation Units
  34. 4.6 Number Types
  35. 4.7 Control Flow
  36. 4.8 Expressions
  37. 4.9 Calling Functions
  38. 4.10 Pointers
  39. 4.11 Examples
  40. 4.12 Dynamic Memory Management
  41. 4.13 Structs
  42. 4.14 Input and Output
  43. 4.15 Undefined Behavior
  44. 5 Algorithms and Data Structures
  45. 5.1 Lists
  46. 5.2 Trees
  47. 5.3 Hashing
  48. 5.4 Dynamic Programming
  49. 6 Formal Semantics
  50. 6.1 The Syntax of Programming Languages
  51. 6.2 The Abstract Syntax of C0
  52. 6.3 The Semantics of C0
  53. 6.4 Pointers (C0p)
  54. 6.5 Scopes (C0b)
  55. 6.6 A Simple Type System (C0t)
  56. 6.7 Summary and Further Reading
  57. 7 Testing and Verification
  58. 7.1 Functional Correctness
  59. 7.2 Failures
  60. 7.3 Testing
  61. 7.4 Verification
  62. 8 Object-Oriented Programming with Java
  63. 8.1 Compilation, Main Method, Packages
  64. 8.2 Types
  65. 8.3 Reference Types
  66. 8.4 Classes
  67. 8.5 Encapsulation
  68. 8.6 References, Aliasing, and Immutable Objects
  69. 8.7 Inheritance
  70. 8.8 Overloading Methods
  71. 8.9 The Java Collections Framework
  72. 8.10 Using Object Orientation Properly
  73. 8.11 The Expression Problem and the Visitor Pattern
  74. 8.12 Object-Oriented Programming with C
  75. 9 A Simple Compiler
  76. 9.1 A Brief Overview of Syntactic Analysis
  77. 9.2 Type Checking
  78. 9.3 Syntax-Directed Code Generation
  79. A RISC-V Assembler Reference
  80. A.1 Instruction Set Reference
  81. A.2 OS Calls
  82. A.3 Assembler Directives
  83. B ASCII Table
  84. C Course Structure
  85. C.1 I: Course Introduction
  86. C.2 R1: Computer Arithmetic
  87. C.3 R2: Computer Arithmetic
  88. C.4 M1: Introduction to Machine Code Programming
  89. C.5 M2: Simple Algorithms in Machine Code
  90. C.6 M3: Function Calls
  91. C.7 C1: Introduction to C
  92. C.8 C2: Expressions and Pointers
  93. C.9 C3: Arrays, Structs, I/O
  94. C.10 A1: Lists and Trees
  95. C.11 A2: Dynamic Programming
  96. C.12 S1: C0 Syntax and Semantics
  97. C.13 S2: Extending C0 to Pointers and Scopes
  98. C.14 S3: Correctness
  99. C.15 S4: Testing
  100. C.16 J1: Intro to Java
  101. C.17 J2: Immutable Objects, Interfaces, Subtyping
  102. C.18 J3: Abstract Classes, Object, Overriding and Overloading Methods
  103. C.19 J4: Using OO Properly, OO in C, The Expression Problem, Visitor Pattern
  104. C.20 A3: Java Collections Framework and Hashing
  105. C.21 A4: Project Specific
  106. C.22 O1: Compiler Introduction (Syntax Analysis, Static Semantics)
  107. C.23 O2: Type Checking Examples, Implementation of Type Checking
  108. C.24 O3: Syntax-Directed Code Generation
  109. C.25 V1: Hoare Logics
  110. C.26 V2: Loop Invariants and Mechanizing Verification
  111. Exercise Solutions
  112. List of Symbols
  113. Index
  114. Literature