Cover Page
1. Introduction
1.1. CS 3110
1.2. Programming Languages
1.3. OCaml
1.4. Mutability
1.5. Summary
1.6. Exercises
1.7. A Brief History of CS 3110
2. The Basics of OCaml
2.1. Preface: Learning a Language
2.2. Interacting with OCaml
2.3. Expressions
2.4. Operators
2.5. If Expressions
2.6. Function Definitions
2.7. Anonymous Functions
2.8. Function Application
2.9. Polymorphic Functions
2.10. Labelled and Optional Arguments
2.11. Partial Application
2.12. Operators as Functions
2.13. Let Expressions
2.14. Scope
2.15. Printing
2.16. What about Main?
2.17. Debugging
2.18. Documentation
2.19. Preconditions and Postconditions
2.20. Defensive Programming
2.21. Summary
2.22. Exercises
3. Data in OCaml
3.1. Lists
3.2. Building Lists
3.3. Accessing Lists
3.4. Mutating Lists
3.5. Pattern Matching with Lists
3.5. Tail Recursion
3.6. More List Syntax
3.7. Unit Testing with OUnit
3.8. An Example of OUnit
3.9. Explanation of the OUnit Example
3.10. Improving OUnit Output
3.11. OUnit and Files
3.12. Variants
3.13. Test-driven Development
3.14. Records
3.15. Tuples
3.16. One-of vs. Each-of
3.17. Pattern Matching with Let
3.18. Pattern Matching with Functions
3.19. Advanced Patterns
3.20. Pattern Matching Examples
3.21. Options
3.22. Association Lists
3.23. Type Synonyms
3.24. Algebraic Data Types
3.25. Catch-all Cases
3.26. Recursive Variants
3.27. Parameterized Variants
3.28. Polymorphic Variants
3.29. Built-in Variants
3.30. Exceptions
3.31. Trees
3.32. Natural Numbers
3.33. Summary
3.34. Exercises
4. Higher-order Programming
4.1. Higher-order Functions
4.1. The Meaning of "Higher Order"
4.2. The Abstraction Principle
4.3. Map
4.4. Filter
4.5. Fold Right
4.6. Fold Left
4.7. Fold Left vs. Fold Right
4.8. Using Fold
4.9. Fold vs. Recursive vs. Library
4.10. Fold with Trees
4.11. Generalized Folds
4.12. Pipelining
4.13. Currying
4.14. Summary
4.15. Exercises
5. Modules
5.1. Modular Programming
5.2. Module Systems
5.3. Structures
5.4. Scope
5.5. Signatures
5.6. Functional Data Structures
5.7. Abstract Types
5.8. Example: Stacks
5.9. Example: Queues
5.10. Example: Dictionaries
5.11. Example: Sets
5.12. Example: Arithmetic
5.13. Sharing Constraints
5.14. Semantics of Modules
5.15. Compilation Units
5.16. Modules and the Toplevel
5.17. Includes
5.18. Semantics of Includes
5.19. Encapsulation and Includes
5.20. Include vs. Open
5.21. Including Code in Multiple Modules
5.22. Functors
5.23. Functor Syntax
5.24. Using Functors
5.25. Example: Standard Library Map
5.26. Summary
5.27. Exercises
6. Abstraction and Specification
6.1. Specification
6.2. Abstraction by Specification
6.3. Specification of Functions
6.4. The Specification Game
6.5. Comments
6.6. Specification of Modules
6.7. Abstraction Functions
6.8. Commutative Diagrams
6.9. Representation Invariants
6.10. Implementing the Representation Invariant
6.11. Summary
6.12. Exercises
7. Testing
7.1. Validation
7.2. Test Coverage
7.3. Black-box Testing
7.4. Glass-box Testing
7.5. Bisect
7.6. Testing Data Abstractions
7.7. Faults
7.8. Randomized Testing
7.9. Random Number Generation
7.10. *QCheck
7.11. Summary
7.12. Exercises
8. Advanced Data Structures
8.1. Infinite Data Structures
8.2. Streams
8.3. Programming with Streams
8.4. Laziness
8.5. Binary Search Trees
8.6. Red-Black Trees
8.7. Mutability
8.8. Refs
8.9. Refs: Syntax and Semantics
8.10. Sequencing
8.11. Example: Mutable Counter
8.12. Example: Recursion Without Rec
8.13. Physical Equality
8.14. Mutable Fields
8.15. Example: Mutable Stack
8.16. Arrays and Loops
8.17. Concurrency
8.18. Promises
8.19. Asynchronous I/O
8.20. Callbacks
8.21. Implementing Callbacks
8.22. Monads
8.23. Example: The Maybe Monad
8.24. Example: The Writer Monad
8.25. Example: The Lwt Monad
8.26. Monad Laws
8.27. Memoization
8.28. Summary
8.29. Exercises
9. Interpreters
9.1. Compilation and Interpretation
9.2. Syntax
9.3. Example: SimPL
9.4. Lexing and Parsing
9.5. A Front-End for SimPL
9.6. Type Checking
9.7. A Type System for SimPL
9.8. A Type Checker for SimPL
9.9. Evaluation
9.10. Evaluating SimPL in the Substitution Model
9.11. Substitution in SimPL
9.12. Capture-Avoiding Substitution
9.13. Core OCaml
9.14. Evaluating Core OCaml in the Substitution Model
9.15. Type Safety
9.16. The Environment Model
9.17. Evaluating the Lambda Calculus in the Environment Model
9.18. Evaluating Core OCaml in the Environment Model
9.19. Type Inference
9.20. Type Constraints
9.21. Contraint Collection
9.22. Unification
9.23. Summary
9.24. Exercises
10. Coq
Published with GitBook
9. Interpreters
Introduction
Topics:
Interpreters and compilers
Lexing and parsing
Abstract syntax trees
Small-step and big-step semantics
Closures
Type checking
Type inference
results matching "
"
No results matching "
"