└── README.md /README.md: -------------------------------------------------------------------------------- 1 | # learn-tt 2 | 3 | Lots of people seem curious about type theory but it's not at all 4 | clear how to go from no math background to understanding "Homotopical 5 | Patch Theory" or whatever the latest cool paper is. In this repository 6 | I've gathered links to some of the resources I've personally found 7 | helpful. 8 | 9 | ## Reading Advice 10 | 11 | I strongly urge you to start by reading one or more of the textbooks 12 | immediately below. They give a nice self-contained introduction and a 13 | foundation for understanding the papers that follow. Don't get hung up 14 | on any particular thing, it's always easier to skim the first time and 15 | read closely on a second pass. 16 | 17 | ## The Resources 18 | 19 | ### Textbooks 20 | 21 | - Practical Foundations of Programming Languages (PFPL) 22 | 23 | I reference this more than any other book. It's a very wide 24 | ranging survey of programming languages that assumes very little 25 | background knowledge. A lot people prefer the next book I mention 26 | but I think PFPL does a better job explaining the foundations it 27 | works from and then covers more topics I find interesting. 28 | 29 | * [Online copy](http://www.cs.cmu.edu/~rwh/plbook/2nded.pdf) 30 | * [Dead-tree copy](http://www.amazon.com/Practical-Foundations-Programming-Languages-Professor/dp/1107029570/ref=sr_1_1?ie=UTF8&qid=1439346858&sr=8-1&keywords=practical+foundations+for+programming+languages) 31 | 32 | - Types and Programming Languages (TAPL) 33 | 34 | Another very widely used introductory book (the one I learned 35 | with). It's good to read in conjunction with PFPL as they 36 | emphasize things differently. Notably, this includes descriptions 37 | of type inference which PFPL lacks and TAPL lacks most of PFPL's 38 | descriptions of concurrency/interesting imperative languages. Like 39 | PFPL this is very accessible and well written. 40 | 41 | * [Online supplements](http://www.cis.upenn.edu/~bcpierce/tapl/) 42 | * [Dead-tree copy](https://mitpress.mit.edu/books/types-and-programming-languages) 43 | 44 | - Advanced Topics in Types and Programming Languages (ATTAPL) 45 | 46 | Don't feel the urge to read this all at once. It's a bunch of fully 47 | independent but excellent chapters on a bunch of different 48 | topics. Read what looks interesting, save what doesn't. It's good 49 | to have in case you ever need to learn more about one of the 50 | subjects in a pinch. 51 | 52 | * [Online supplements](http://www.cis.upenn.edu/~bcpierce/attapl/) 53 | * [Dead-tree copy](http://www.amazon.com/exec/obidos/ASIN/0262162288/benjamcpierce) 54 | 55 | - Type Theory and Functional Programming (TTFP) 56 | 57 | * [Online Copy](https://www.cs.kent.ac.uk/people/staff/sjt/TTFP/ttfp.pdf) 58 | 59 | - Practical Foundations of Mathematics (PFM) 60 | 61 | * [Online Copy](http://www.paultaylor.eu/~pt/prafm/html/) 62 | 63 | ### Proof Assistants 64 | 65 | One of the fun parts of taking in an interest in type theory is that 66 | you get all sorts of fun new programming languages to play with. Some 67 | major proof assistants are 68 | 69 | - Coq 70 | 71 | Coq is one of the more widely used proof assistants and has the 72 | best introductory material by far in my opinion. 73 | 74 | * [Official site](https://coq.inria.fr/) 75 | * [Software Foundations](http://www.cis.upenn.edu/~bcpierce/sf/current/index.html) 76 | * [Certified Programming with Dependent Types](http://adam.chlipala.net/cpdt/) 77 | * [The paper on the calculus of constructions](https://hal.inria.fr/inria-00076024/document) 78 | * [The paper on the calculus of inductive constructions](http://www.cs.cmu.edu/~fp/papers/mfps89.pdf) (What Coq 79 | is based on) 80 | 81 | - Agda 82 | 83 | Agda is in many respects similar to Coq, but is a smaller language 84 | overall. It's relatively easy to learn Agda after Coq so I 85 | recommend doing that. Agda has some really interesting advanced 86 | constructs like induction-recursion. 87 | 88 | * [Official site](http://wiki.portal.chalmers.se/agda/pmwiki.php) 89 | * [Tutorial](http://www.cse.chalmers.se/~ulfn/papers/afp08/tutorial.pdf) 90 | * [Records tutorial](http://wiki.portal.chalmers.se/agda/pmwiki.php?n=ReferenceManual.RecordsTutorial) 91 | * [Conor McBride's](https://github.com/pigworker/MetaprogAgda) [fun Agda code](https://github.com/pigworker/CS410-14) 92 | 93 | - Idris 94 | 95 | It might not be fair to put Idris in a list of "proof assistants" 96 | since it really wants to be a proper programming language. It's 97 | one of the first serious attempts at writing a programming 98 | language with dependent types *for actual programming* though. 99 | 100 | * [Official site](http://idris-lang.org/) 101 | * [Quick tutorial](http://docs.idris-lang.org/en/latest/tutorial/index.html#tutorial-index) 102 | * [A list of talks on Idris](https://www.youtube.com/watch?v=O1t4xJzrOng) 103 | * [David Christiansen's cool talk](https://www.youtube.com/watch?v=dP2imvL92sY) 104 | 105 | - Twelf 106 | 107 | Twelf is by far the simplest system in this list, it's the 108 | absolute minimum a language can have and still be dependently 109 | typed. All of this makes it easy to pick up, but there are very 110 | few users and not a lot of introductory material which makes it a 111 | bit harder to get started with. It does scale up to serious use 112 | though. 113 | 114 | * [Official site](http://twelf.org/) 115 | * [Wiki Tutorials](http://twelf.org/wiki/Tutorials) 116 | * [My tutorial](http://jozefg.bitbucket.org/posts/2015-02-28-twelf.html) 117 | * [The paper on LF, the underlying system of Twelf](http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.21.5854) 118 | 119 | ### Type Theory 120 | 121 | - The Works of Per Martin-Löf 122 | 123 | Per Martin-Löf has contributed a *ton* to the current state of 124 | dependent type theory. So much so that it's impossible to escape 125 | his influence. His papers on Martin-Löf Type Theory (he called it 126 | Intuitionistic Type Theory) are seminal. 127 | 128 | If you're confused by the papers above read the book in the next 129 | entry and try again. The book doesn't give you as good a feel for 130 | the various flavors of MLTT (which spun off into different areas 131 | of research) but is easier to follow. 132 | 133 | * [1972](https://github.com/michaelt/martin-lof/blob/master/pdfs/An-Intuitionistic-Theory-of-Types-1972.pdf?raw=true) 134 | * [1979](https://github.com/michaelt/martin-lof/blob/master/pdfs/Constructive-mathematics-and-computer-programming-1982.pdf?raw=true) 135 | * [1984](https://github.com/michaelt/martin-lof/blob/master/pdfs/Bibliopolis-Book-retypeset-1984.pdf?raw=true) 136 | 137 | - Programming In Martin-Löf's Type Theory 138 | 139 | It's good to read the original papers and here things from the 140 | horses mouth, but Martin-Löf is much smarter than us and it's nice 141 | to read other people explanations of his material. A group of 142 | people at Chalmer's have elaborated it into a book. 143 | 144 | * [Online link](http://www.cse.chalmers.se/research/group/logic/book/book.pdf) 145 | 146 | - The Works of John Reynolds 147 | 148 | John Reynolds' works are similarly impressive and always a pleasure 149 | to read. 150 | 151 | * [Types, Abstraction and Parametric Polymorphism](http://www.cse.chalmers.se/edu/year/2010/course/DAT140_Types/Reynolds_typesabpara.pdf) (Parametricity for 152 | System F) 153 | * [A Logic For Shared Mutable State](http://www.cs.cmu.edu/~jcr/seplogic.pdf) 154 | * [Course notes on separation logic](http://www.cs.cmu.edu/afs/cs.cmu.edu/project/fox-19/member/jcr/www15818As2011/cs818A3-11.html) 155 | * [Course notes on denotational semantics](http://www.cs.cmu.edu/~jcr/cs819-00.html) 156 | 157 | - Computational Type Theory 158 | 159 | While most dependent type theories (like the ones found in Coq, 160 | Agda, Idris..) are based on Martin-Löf later intensional type 161 | theories, computational type theory is different. It's a direct 162 | descendant of his extensional type theory that has been heavily 163 | developed and forms the basis of NuPRL nowadays. The resources 164 | below describe the various parts of how CTT works. 165 | 166 | * [Type Theory and its Meaning Explanations](https://github.com/jonsterling/type-theory-and-its-meaning-explanations) 167 | * [A Non-Type-Theoretic Definition of Martin-Löf’s Types](http://www.cs.cornell.edu/Info/Projects/NuPrl/documents/Allen/lics87.html) 168 | * [Constructing a type system over operational semantics](https://www.cs.uoregon.edu/research/summerschool/summer10/lectures/Harper-JSC92.pdf) 169 | (Similar to the above, they're helpful to read together) 170 | * [Equality in Lazy Computation System](http://www.nuprl.org/documents/Howe/EqualityinLazy.html) (of general interest) 171 | * [Naive Computational Type Theory](http://www.nuprl.org/documents/Constable/naive.pdf) 172 | * [Innovations in CTT using NuPRL](http://www.nuprl.org/documents/Allen/05-jal-final.pdf) 173 | * [Two Lectures on Constructive Type Theory](https://www.cs.uoregon.edu/research/summerschool/summer15/notes/OPLSS-Short-2015-2.pdf) 174 | 175 | - Homotopy Type Theory 176 | 177 | A new exciting branch of type theory. This exploits the connection 178 | between homotopy theory and type theory by treating types as 179 | spaces. It's the subject of a lot of active research but has some 180 | really nice introductory resources even now. 181 | 182 | * [The HoTT book](http://homotopytypetheory.org/book/) 183 | * [Student's Notes on HoTT](https://github.com/RobertHarper/hott-notes) 184 | 185 | 186 | ### Proof Theory 187 | 188 | - Frank Pfenning's Lecture Notes 189 | 190 | Over the years, Frank Pfenning has accumulated lecture notes that 191 | are nothing short of heroic. They're wonderful to read and almost 192 | as good as being in one of his lectures. 193 | 194 | * [Introductory Course](http://www.cs.cmu.edu/~fp/courses/15317-f09/) 195 | * [Linear Logic](http://www.cs.cmu.edu/~fp/courses/15816-s12/) 196 | * [Modal Logic](http://www.cs.cmu.edu/~fp/courses/15816-s10/) 197 | 198 | ### Category Theory 199 | 200 | Learning category theory is necessary to understand some parts of type 201 | theory. If you decide to study categorical semantics, realizability, 202 | or domain theory eventually you'll have to buckledown and learn a 203 | little at least. It's actually really cool math so no harm done! 204 | 205 | - Category Theory for Computer Scientists 206 | 207 | This is the absolute smallest introduction to category theory you 208 | can find that's still useful for a computer scientist. It's very 209 | light on what it demands for prior knowledge of pure math but 210 | doesn't go into too much depth. 211 | 212 | * [Early version available online](http://repository.cmu.edu/cgi/viewcontent.cgi?article=2846&context=compsci) 213 | * [Dead-tree version](https://mitpress.mit.edu/index.php?q=books/basic-category-theory-computer-scientists) 214 | 215 | - Category Theory 216 | 217 | One of the better introductory books to category theory in my 218 | opinion. It's notable in assuming relatively little mathematical 219 | background and for covering quite a lot of ground in a 220 | readable way. 221 | 222 | * [Dead-tree version](http://www.amazon.com/Category-Theory-Oxford-Logic-Guides/dp/0199237182/ref=sr_1_1?ie=UTF8&qid=1439348930&sr=8-1&keywords=awodey+category+theory) 223 | 224 | - Ed Morehouse's Category Theory Lecture Notes 225 | 226 | Another valuable piece of reading are these lecture notes. They 227 | cover a lot of the same areas as "Category Theory" so they can help 228 | to reinforce what you learned there as well giving you some of 229 | the author's perspective on how to think about these things. 230 | 231 | * [Online copy](http://www.cs.cmu.edu/~edmo/research/notes/intro_categorical_semantics.pdf) 232 | 233 | ### Other Goodness 234 | 235 | - Gunter's "Semantics of Programming Language" 236 | 237 | While I'm not as big a fan of some of the earlier chapters, the 238 | math presented in this book is absolutely top-notch and gives a 239 | good understanding of how some cool fields (like domain theory) 240 | work. 241 | 242 | * [Dead-tree version](http://www.amazon.com/Semantics-Programming-Languages-Structures-Foundations/dp/0262071436/ref=sr_1_1?ie=UTF8&qid=1439349219&sr=8-1&keywords=gunter+semantics+of+programming+languages) 243 | 244 | - OPLSS 245 | 246 | The Oregon Programming Languages Summer School is a 2 week long 247 | bootcamp on PLs held annually at the university of Oregon. It's a 248 | wonderful event to attend but if you can't make it they record all 249 | their lectures anyways! They're taught be a variety of lecturers 250 | but they're all world class researchers. 251 | 252 | * [2012](https://www.cs.uoregon.edu/research/summerschool/summer12/curriculum.html) 253 | * [2013](https://www.cs.uoregon.edu/research/summerschool/summer13/curriculum.html) 254 | * [2014](https://www.cs.uoregon.edu/research/summerschool/summer14/curriculum.html) 255 | * [2015](https://www.cs.uoregon.edu/research/summerschool/summer15/curriculum.html) 256 | --------------------------------------------------------------------------------