https://www.cs.cornell.edu/courses/cs3110/2021sp/textbook/intro/intro.html [ ] * Cover Page * * 1. Introduction + 1.1. Programming Languages + 1.2. OCaml + 1.3. Mutability + 1.4. Summary + 1.5. Exercises + 1.6. A Brief History of CS 3110 * * 2. The Basics of OCaml + 2.1. Interacting with OCaml + 2.2. Expressions o 2.2.1. Operators o 2.2.2. If Expressions o 2.2.3. Let Expressions o 2.2.4. Scope + 2.3. Functions o 2.3.1. Anonymous Functions o 2.3.2. Function Application o 2.3.3. Polymorphic Functions o 2.3.4. Labeled and Optional Arguments o 2.3.5. Partial Application o 2.3.6. Operators as Functions o 2.3.7. Documentation o 2.3.8. Preconditions and Postconditions + 2.4. Debugging o 2.4.1. Printing o 2.4.2. Defensive Programming + 2.5. Summary + 2.6. Exercises * 3. Data in OCaml + 3.1. Standard Data Types o 3.1.1. Lists # 3.1.1.1. Building Lists # 3.1.1.2. Accessing Lists # 3.1.1.3. Mutating Lists # 3.1.1.4. Pattern Matching with Lists # 3.1.1.5. Tail Recursion # 3.1.1.6. More List Syntax o 3.1.2. Variants o 3.1.3. Unit Testing with OUnit # 3.1.3.1. An Example of OUnit # 3.1.3.2. Explanation of the OUnit Example # 3.1.3.3. Improving OUnit Output # 3.1.3.4. OUnit and Files # 3.1.3.5. Test-driven Development o 3.1.4. Records o 3.1.5. Tuples o 3.1.6. One-of vs. Each-of o 3.1.7. Advanced Pattern Matching # 3.1.7.1. Pattern Matching with Let # 3.1.7.2. Pattern Matching with Functions # 3.1.7.3. Pattern Matching Examples + 3.2. Advanced Data Types o 3.2.1. Options o 3.2.2. Association Lists o 3.2.3. Type Synonyms o 3.2.4. Algebraic Data Types # 3.2.4.1. Catch-all Cases # 3.2.4.2. Recursive Variants # 3.2.4.3. Parameterized Variants # 3.2.4.4. Polymorphic Variants # 3.2.4.5. Built-in Variants o 3.2.5. Exceptions o 3.2.6. Example: Trees o 3.2.7. Example: Natural Numbers + 3.3. Summary + 3.4. Exercises * 4. Higher-order Programming + 4.1. The Meaning of "Higher Order" + 4.2. The Abstraction Principle + 4.3. Famous Higher-order Functions o 4.3.1. Map o 4.3.2. Filter o 4.3.3. Fold Right o 4.3.4. Fold Left o 4.3.5. Fold Left vs. Fold Right o 4.3.6. Using Fold o 4.3.7. Fold vs. Recursive vs. Library o 4.3.8. Fold with Trees o 4.3.9. Generalized Folds + 4.4. Pipelining + 4.5. Currying + 4.6. Summary + 4.7. Exercises * 5. Modules + 5.1. Module Systems + 5.2. OCaml Modules o 5.2.1. Structures o 5.2.2. Scope o 5.2.3. Signatures o 5.2.4. Abstract Types o 5.2.5. Semantics of Modules o 5.2.6. Functional Data Structures # 5.2.6.1. Example: Stacks # 5.2.6.2. Example: Queues # 5.2.6.3. Example: Dictionaries # 5.2.6.4. Example: Sets # 5.2.6.5. Example: Arithmetic o 5.2.7. Sharing Constraints o 5.2.8. Compilation Units o 5.2.9. Modules and the Toplevel + 5.3. Code Reuse with Modules o 5.3.1. Includes # 5.3.1.1. Semantics of Includes # 5.3.1.2. Encapsulation and Includes # 5.3.1.3. Include vs. Open # 5.3.1.4. Including Code in Multiple Modules o 5.3.2. Functors # 5.3.2.1. Functor Syntax # 5.3.2.2. Using Functors # 5.3.2.3. Example: Standard Library Map + 5.4. Summary + 5.5. Exercises * 6. Specifications and Abstraction + 6.1. Specification of Functions + 6.2. The Specification Game + 6.3. Comments + 6.4. Specification of Modules + 6.5. Abstraction Functions + 6.6. Commutative Diagrams + 6.7. Representation Invariants + 6.8. Implementing the Representation Invariant + 6.9. Summary + 6.10. Exercises * 7. Testing + 7.1. Test Coverage + 7.2. Black-box Testing + 7.3. Glass-box Testing + 7.4. Bisect + 7.5. Testing Data Abstractions + 7.6. Faults + 7.7. Randomized Testing + 7.8. Random Number Generation + 7.9. *QCheck + 7.10. Summary + 7.11. Exercises * 8. Mutability + 8.1. Refs + 8.2. Refs: Syntax and Semantics + 8.3. Sequencing + 8.4. Example: Mutable Counter + 8.5. Example: Recursion Without Rec + 8.6. Physical Equality + 8.7. Mutable Fields + 8.8. Example: Mutable Stack + 8.9. Arrays and Loops + 8.10. Summary + 8.11. Exercises * 9. Efficiency + 9.1. Defining Efficiency o 9.1.1 Algorithms and Efficiency, Attempt 1 o 9.1.2 Algorithms and Efficiency, Attempt 2 o 9.1.3 Big-Oh Notation o 9.1.4 Algorithms and Efficiency, Attempt 3 + 9.2. Efficient Maps o 9.2.1. Association Lists o 9.2.2. Direct Address Tables o 9.2.3. Hash Tables + 9.3. Amortized Analysis o 9.3.1. Amortized Analysis of Hash Tables o 9.3.2. Amortized Analysis of Two-List Queues o 9.3.3. Bankers and Physicists o 9.3.4. Amortized Analysis and Persistence + 9.4. Functional Maps o 9.4.1. Binary Search Trees o 9.4.2. Red-Black Trees o 9.4.3. Maps and Sets from BSTs + 9.5. Summary + 9.6. Exercises * 10. Interpreters + 10.1. Lexing and Parsing o 10.1.1. Backus-Naur Form # 10.1.2. Example: SimPL # 10.1.3. A Front-End for SimPL + 10.2. Evaluation: The Substitution Model o 10.2.1. Evaluating SimPL in the Substitution Model o 10.2.2. Substitution in SimPL o 10.2.3. Capture-Avoiding Substitution o 10.2.4. Core OCaml o 10.2.5. Evaluating Core OCaml in the Substitution Model + 10.3. Evaluation: The Environment Model o 10.3.1. Evaluating the Lambda Calculus in the Environment Model o 10.3.2. Evaluating Core OCaml in the Environment Model + 10.4. Type Checking o 10.4.1. A Type System for SimPL o 10.4.2. A Type Checker for SimPL o 10.4.3. Type Safety + 10.5. Type Inference o 10.5.1. Type Constraints o 10.5.2. Solving Constraints o 10.5.3. Finishing Type Inference o 10.5.4. Let Polymorphism + 10.6. Summary + 10.7. Exercises * 11. Proofs about Programs + 11.1. Equality + 11.2. Equational Reasoning + 11.3. Induction on Integers + 11.4. Programs as Specifications + 11.5. Recursion vs Iteration + 11.6. Termination + 11.7. Induction on Variants o 11.7.1. Induction on Naturals o 11.7.2. Induction on Lists o 11.7.3. A Theorem about Folding o 11.7.4. Induction on Trees o 11.7.5. Induction Principles for All Variants + 11.8. Algebraic Specification o 11.8.1. Example: Stacks o 11.8.2. Example: Queues o 11.8.3. Example: Two-List Queues + 11.9. Designing Algebraic Specifications + 11.10. Summary + 11.11. Exercises * 12. Advanced Topics + 12.1. Infinite Data Structures o 12.1.1. Streams o 12.1.2. Programming with Streams o 12.1.3. Laziness + 12.2. Concurrency o 12.2.1. Promises o 12.2.3. Asynchronous I/O o 12.2.4. Callbacks o 12.2.5. Implementing Callbacks + 12.3. Monads o 12.3.1. Example: The Maybe Monad o 12.3.2. Example: The Writer Monad o 12.3.3. Example: The Lwt Monad o 12.3.4. Monad Laws + 12.4. The Curry-Howard Correspondence + 12.5. Memoization + 12.6. Summary + 12.7. Exercises * * Published with GitBook 1. Introduction What is 3110 about? You might think this course is about OCaml. It's not. You might think this course is about data structures. It's not. You might think this course is about "weeding out" from the CS major. It's not. Nan-in, a Japanese master during the Meiji era (1868-1912), received a university professor who came to inquire about Zen. Nan-in served tea. He poured his visitor's cup full, and then kept on pouring. The professor watched the overflow until he no longer could restrain himself. "It is overfull. No more will go in!" "Like this cup," Nan-in said, "you are full of your own opinions and speculations. How can I show you Zen unless you first empty your cup?" Folklore says that there is a 10x difference between professional programmers' productivity. One data-driven study suggests the factor is more like 2x to 4x. Wouldn't you like to be twice as productive, or more? This course is about making you a better programmer. Programming isn't hard. Programming well is very hard. results matching "" No results matching ""