tag:blogger.com,1999:blog-85209707077022191662018-03-06T06:26:06.848-08:00Duly DenotedFormal methods, denotational semantics, category theory, dependent types, rants about kyriarchy, and anything else relevant to my PhD.Caylee Hogghttp://www.blogger.com/profile/11879924482760620558noreply@blogger.comBlogger17125tag:blogger.com,1999:blog-8520970707702219166.post-71870411987062025942011-08-31T09:11:00.000-07:002011-08-31T09:11:15.431-07:00Catch-upSo for the past couple of months I've been reading more about directed type theory/homotopy type theory and trying to find a manageable sub-problem that I can honestly tackle at the moment.<br /><br />I've been interested in what the general induction story should be for higher-dimensional type theory, particularly 2-dimensional type theory as presented either <a href="http://www.comp.mq.edu.au/~rgarner/2-LCCC/2-LCCC.html">here</a> or <a href="http://www.cs.cmu.edu/~drl/pubs/lh112tt/lh112tt.pdf">here</a>. On the surface, writing down the rules of W-types and how they should transform seems rather straight forward - an iso between shapes should create an appropriate iso between W-types as should an iso between contents. The thing I'm not sure about is how to fit W-types into Garner's 2-dimensional type theory semantics. Of course, I think part of the problem is that I'm not really familiar with the <b>general</b> story of <a href="http://mathoverflow.net/questions/74119/what-are-categorical-models-of-w-types-in-intensional-type-theory">models for W-types in type theory</a>.<br /><br />Other than that, I helped organize and teach the very first Portland <a href="http://pdxtechworkshops.org/">intro to programming for women</a> workshop. Feedback from students has been extremely positive so far and I'm really glad to have been involved and look forward to continue organizing these events.Caylee Hogghttp://www.blogger.com/profile/11879924482760620558noreply@blogger.com0tag:blogger.com,1999:blog-8520970707702219166.post-63067950834847994622011-06-02T18:38:00.000-07:002011-06-02T18:46:37.063-07:00One of those daysMy update for the day is fairly skimpy. I skimmed "A View From The Left", started a paper on the omega-groupoid interpretation of ITT, and subsequently tripped over my lack of intuition about operads and landed flat on my fibration. I think I sprained a syntactic category, or something equivalent to it.<br /><br />In all seriousness, I clearly need to read some relevant chapters both from Jacobs's Giant Yellow Book and from Leinster's elaboration of operads and higher-order categories. I was skimming along fine with my current level of mathematical knowledge, but need to buff up a bit now. I've read a bit of the machinery for the syntactic category of a dependent theory but it was long enough ago I can barely hum the tune. I probably could have faked it slightly better today had I slept well, but it was one of those days when I woke up <6 for no apparent reason.<br /><br />I did, though, see a talk about relativistic programming and chatted briefly with one of the grad students working on it. It turns out that their last submission outlines a kind of induction principle for reasoning about concurrent programs that use their primitives for blocking. I was told that they hoped someone could pick up the note and mechanize the reasoning in some fashion, but I was good and didn't offer up my services. :-) Maybe it'd be a cute thing to do at some point during my PhD, but at the moment I'm too excited about digging into OTT/HTT/etc.Caylee Hogghttp://www.blogger.com/profile/11879924482760620558noreply@blogger.com0tag:blogger.com,1999:blog-8520970707702219166.post-24847019700896384992011-06-01T21:22:00.000-07:002011-06-01T21:22:19.113-07:00Papers of the Day: Moar TypesThis is the second day of my binging on type theory. For today's reading I read the first couple of chapters of Dan Licata's <a href="http://goo.gl/bMwhb">thesis</a>, Hoffman & Streicher's <a href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.37.606">paper</a> on groupoid models of type theory, and Altenkirch's <a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.119.2261&rep=rep1&type=pdf">original</a> paper on OTT. <div><br /></div><div>As far as the thesis went, I only read the introduction and the background chapters so I haven't gotten into the heart of it yet. Funnily enough, the background chapter did have some food for thought in the distinction between derivability and admissibility. I don't know if this is a common way of looking at things that I would have seen if I had ever really taken courses in logic, but in any case I think it makes a lot of sense. I'll probably try to read a chapter three tomorrow.</div><div><br /></div><div>Alright, so now we come to the things I'm still chewing on. First, there's the Hoffman & Streicher paper. The basic point of the paper was really about proving that uniqueness of identity proofs doesn't follow from intensional type theory by constructing a model where it didn't hold, but I can see that there was some deeper insight in terms of using groupoids to model types - setting the stage for the later omega-groupoid models which I intend to read about tomorrow - as well as it being a good illustration of the general technique of constructing models to help determine if a property of the logical system is necessarily true. I'll probably review some of the constructions again tomorrow, though, before I read some of the papers on omega-groupoid models.</div><div><br /></div><div>Speaking of models, that's the main thing I've gotten so far out of the other Altenkirch paper: the idea that one can construct a model of your proposed theory within another type theory to determine if it is even possible to make. I think there's more I should be getting out of it, but honestly it was the last thing I read today and I was a bit burned out. I think I'll put it back on the pile for tomorrow for another attack.</div><div><br /></div><div><br /></div>Caylee Hogghttp://www.blogger.com/profile/11879924482760620558noreply@blogger.com0tag:blogger.com,1999:blog-8520970707702219166.post-23349004215367214032011-05-31T20:00:00.000-07:002011-05-31T20:00:53.906-07:00Paper(s) of the day: Type Theory FrenzyToday was my first real day back in graduate school, starting my "second"* year and I had a meeting with my advisor where we discussed what my <i>focus</i> for the next few years will be so that I can start publishing and graduate. <div><br /></div><div>The idea I had over the weekend was to really dig into the cutting edge of type theory. It's got math, it's foundational, and it's relevant to mechanizing all the mathematics I love so much. It makes a lot of sense as a direction to go in. Of course, the next task was to figure out where the edge is so that I can start pushing. </div><div><br /></div><div>I started with <a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.99.7722&rep=rep1&type=pdf">two</a> <a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.117.4451&rep=rep1&type=pdf">papers</a> on observational type theory and a <a href="http://www.andrew.cmu.edu/user/awodey/preprints/TTH.pdf">survey</a> on homotopy type theory. </div><div><br /></div><div>I'm still very much processing what I read today, but I'll try to summarize things to the extent that I understand them.</div><div><br /></div><div>First, let's discuss observational type theory. As background, consider the difference between intensional and extensional type theory. In both, you have a propositional equality defined by a constructor representing reflexivity and a definitional equality used by the typechecker that compares the normal forms of the objects in question. The difference between intensional and extensional type theory is if you are allowed to use the propositional equality as a witness for the definitional equality, making it relevant to typechecking! This has the well-known effect of making typechecking undecidable as well as making execution hairier business by allowing ill-formed terms to typecheck in a context that contains falsity, thus also allowing them to be evaluated. I know that some people have found ways around the scary bits of extensional type theory in order to exploit the good properties it has, but I think it's not controversial to say that neither intensional nor extensional seems terribly satisfying as a stopping point. Now we come to observational type theory, which attempts to hit a sweeter spot that has more of the power of the extensional theory (e.g. functional extensionality) but doesn't lose the computational properties of the intensional theory. How? Well, I don't think I have a good way to explain it than thus; observational type theory is based off of a heterogeneous equality, based on coercions, that takes into account the actual type structure what is being compared - allowing for a term to be safely "cast" between two types exactly when the two types are "equal" computationally. Basically, it respects a notion of iso between types instead of a more evil (in the technical sense, mind you) equality. They don't quite put it that way in the two papers I read, but it seems like the way to take things. Having this less evil notion of equality allows us to have our cake and typecheck it too. The actual details of some of the coercions seem both a bit over my head yet not terribly exciting. I hope to scrutinize the actual Agda implementation a bit in order to get a feel for the way the isos are constructed.</div><div><br /></div><div>Alright, well speaking of isos now we come to homotopy type theory. From what I can tell homotopy type theory is, at the moment, an exploration of the connections between intensional type theory and higher-order category theory. For example, the structure of identity proofs over a type - including identity proofs on the type of identity proofs and the type of proof on the type of proof on the type of proofs on ... - has the structure of a weak omega-groupoid, a kind of "group-like" structure whose each level obeys certain laws only up to transformations by the next level up, in a way very similar to the actual omega-groupoid generated by the tower of homotopies on a space. I'm still really shaky on what's going on here, other than the fact that work done over the past 2-3 years has started to solidify the idea that generalized "homotopy-like" spaces are (probably?) sound and complete models for intensional type theory, meaning that type theory is the internal language of homotopy theory. The main thing that excites me about this is that it puts words to a gut feeling I had when I first started to learn type theory as I was getting into CS. My background at that point was a mish-mash of diff geo and category theory, and the relationship between operational and denotational semantics (for example) reminded me very much of two categories - leading me to an old paper by R.A.G. Seely that maybe I'll ramble on another time - and I wondered what higher order transformations might mean. In my head it looked a lot like, well, homotopies! I know that's a little different than the situation we're talking about here with homotopy type theory, but I'm excited to think that my first loves in mathematics have deep connections to CS & logic.<br /><div><br /></div><div>What about models of observational type theory? Do they also have rich higher-order category theoretic structure? I don't know! I'd like to know, whether that means I investigate myself or read someone else's work! Someone directed me to a recent dissertation on <i>directed</i> type theory which, I guess, is an approach to type theory based on higher-order categories without the restrictions to groupoids.</div><div><br /></div><div>* Technically, third, but I lost roughly a year total due to medical stuff & some heinousness and thankfully my department is respecting that these events were pretty much outside of my control.</div></div>Caylee Hogghttp://www.blogger.com/profile/11879924482760620558noreply@blogger.com2tag:blogger.com,1999:blog-8520970707702219166.post-71509907916977843192011-05-27T22:53:00.000-07:002011-05-27T22:54:01.635-07:00Paper of The Day: MonadsOkay, so since I was travelling for five hours for Memorial Day weekend then I wanted to do something kind of easy in the car on the way here.<br /><br />It's a paper that everyone should have (and probably has) read: Moggi's <a href="http://www.disi.unige.it/person/MoggiE/ftp/ic91.pdf">paper</a> on monads and the computational lambda calculus. <br /><br />The most basic point of this paper is a pretty well known story: strong monads act as generalized let-statements in the internal language of a category. Why do they need to be strong? Well, the strength essentially acts as a way of ensuring that you can "copy" the context from the binding part of the let-statement to be available in the final expression.<br /><br />Okay, yay, monads!<br /><br />Well, no, there's more to it than that. One thing that really jumped out at me when I was rereading this paper in the car was the methodical, elegant development that built up the internal language alongside the models by adding richer categorical constructions. It was really cute, but also an approach I see very rarely done in CS literature even though to me it feels very constructive and enlightening. I feel like that's the kind of approach I want to have to my own research once, y'know, I actually start publishing (*cough cough*). So, anyway, even if you already know the whole story of using monads in semantics I think there's something to be said for sitting down and working through this paper. It's really well structured, which I think is probably a good bit of why it was influential.Caylee Hogghttp://www.blogger.com/profile/11879924482760620558noreply@blogger.com0tag:blogger.com,1999:blog-8520970707702219166.post-21962984622704023502011-05-26T17:41:00.000-07:002011-05-26T17:41:21.451-07:00Paper of the day: Category Theoretic Solution of Recursive Domain EquationsOkay, this paper was a reread but it was something that I needed to digest better than the first time. Smyth & Plotkin's <a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.158.7928&rep=rep1&type=pdf">classic paper</a>. So what's the point of this paper?<br /><br />Okay, so Dana Scott had this classic result where he built - as a colimit - a domain D\inf (think partially ordered set with some nice properties) that was isomorphic to the set of continuous functions from D\inf to D\inf, thus showing a particular technique in domain theory for building models of the untyped lambda calculus. Another way to put this is that D\inf is the fixed point of the functor F(D) = D -> D.<br /><br />Well, the problem is that the original construction is fairly rigid, taking place only in a particular category of domains. So the point of this paper is try generalize it to all categories and functors that satisfy certain properties. So what properties do we require?<br /><br />Well, first we can generalize the notion of omega chain from domain theory to category theory. It's basically the same thing if you think of an arrow from objects A and B to be the same as "A < B", so it's a countable diagram of objects with an arrow leading from the previous to the next object in the sequence.<br /><br />So then what's a omega-continuous functor? Well, it's a functor that maps colimits of omega chains to colimits of the omega chain induced by the action of the functor. It's basically the interchange of function and limit we're used to from domain theory. Yay!<br /><br />So the paper establishes one thing right off the bat: if you have a continuous functor and colimits of omega chains exist, then you'll have a fixed point of that functor. So the problem becomes figuring out when you have an omega-complete category.<br /><br />However, requiring that the category we work in be omega-complete is actually a bit more restrictive than we want. Instead, we work in what are called O-categories which are categories enriched CPO. The bulk of the paper is about showing how most O-categories allow us to find the colimits in the subcategory of embeddings, which has nicer properties and can more readily be omega-complete, and then pull those colimits back to the original category.<br /><br />It's actually really cool to work through, although I feel like I haven't done the best job of explaining it! The math isn't terribly deep diagram chasing, so if you're at all familiar with category theory you can follow it with a bit of work. I'll confess, though, that the first time I tried to read it I was sitting and scratching my head wondering that the <i>point</i> was, but the point seems to basically be that by generalizing the D\inf construction to its minimal requirements you can get away with using slightly weaker categories than used to be considered prior to this paper.Caylee Hogghttp://www.blogger.com/profile/11879924482760620558noreply@blogger.com0tag:blogger.com,1999:blog-8520970707702219166.post-51708325553611758622011-05-25T12:49:00.000-07:002011-05-25T12:49:09.988-07:00Paper of the day: Lawvere Theories and MonadsOkay, so stuff on logical relations still isn't sinking in today and I'm feeling pretty foolish. So, let's get back a little more on my home territory: category theory. Specifically, a paper from a few years ago from <a href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.158.5440">Hyland & Power</a> about Lawvere theories and their connection to computer science.<br /><br />Okay, so first off what's a Lawvere theory? Well, basically, it's a category with only one "base" object that generates all other objects via finite products of the base object with itself. Each such category, up to iso obvs, corresponds to a single-sorted algebraic theory. There's a good explanation of them <a href="http://ncatlab.org/nlab/show/Lawvere+theory">here</a> that I recommend reading. In order to "get it" I had to work through their example of the theory of groups and sketch out the equivalence.<br /><br />...so, what's the connection to computer science? Well, first let's go back to monads. Err...real monads, not the burritos that appear in the over 9000 Haskell monad tutorials. So, in Moggi's work monads were useful because they were - basically - generalized let statements. These let statements allow us to sequence effects in our computations, such as state, IO, etc. which is really useful for describing the semantics of a language! Okay, but what about the actual morphisms that perform the side-effects? Well, they're left out in the cold so to speak. They're called "non-proper" morphisms and are subject only to some naturality conditions. Now, to be fair, that's nothing to sneeze at but it doesn't capture most equations you would want: just the bare minimum to make sense.<br /><br />Well, the neat thing is that if you describe side-effects by their operations as some kind of Lawvere theory, you can recover the monad of side-effects as a coend that kinda "rolls up" all the operations into the structure that they operate on. That description wasn't very good, was it? I'll have to think of some better picture at some point. Now, since monads are a more general structure than Lawvere theories you get a bit of a loss of information, i.e. the less stringent equations on operations; however, it does mean that from a more rigid description we can recover the "generalized let" we want from sequencing.<br /><br />Now here's where I get murky - I haven't done any serious examples so I don't see entirely how one would directly use this to describe the semantics of a programming language with side-effects. I get conceptually that it's more specific, but I'm not entirely clear on <i>how much</i> it buys you and if its worth it. I probably need to read the half-dozen papers written by Plotkin et al. on the topic. :-p<br /><br />Now, okay, so I've told a little bit of a lie so far - if one does these constructions in "ordinary" category theory, this whole trick of recovering the monad from the Lawvere theory only really works on the category Set, which isn't terribly useful for programming languages that allow general recursion...instead, we have to move over the enriched category theory which I'm still wrapping my head around.<br /><br />The basic point of enriched category theory is that rather than having sets of morphisms, one has hom-objects from another monoidal closed category. The normal rules about composition still, basically, hold the way you'd expect in the hom-objects. Again, the nitty-gritty of what changes in enriched category theory is lost on me at the moment; however, I know that there has been work to rebuild the work on Lawvere theories in the enriched setting and that this is what's actually used in the Plotkin et al. papers.<br /><br />So, yeah, this was a bit longer than I intended but I had a lot to talk out with this paper.Caylee Hogghttp://www.blogger.com/profile/11879924482760620558noreply@blogger.com0tag:blogger.com,1999:blog-8520970707702219166.post-21738651127664840662011-05-24T07:23:00.000-07:002011-05-24T07:23:21.345-07:00UpdatesHaven't posted for a few days because Barcamp was, while good, exhausting. Crowds are, honestly, not the easiest thing for me and it's taken a couple of days to feel rested and able to think creatively again.<br /><br />Back to reading papers and working on my Agda conversion of Software Foundations! I may not have a paper to post about tonight, but starting tomorrow I'll have at least one.Caylee Hogghttp://www.blogger.com/profile/11879924482760620558noreply@blogger.com0tag:blogger.com,1999:blog-8520970707702219166.post-3409218945762332822011-05-18T18:30:00.000-07:002011-05-18T18:30:01.424-07:00Paper of the day: Ad-hoc!!Okay, I decided to go easy on the writing today because I'm trying to digest other papers. So, yeah, I decided to read and write about the classic paper <a href="http://homepages.inf.ed.ac.uk/wadler/topics/type-classes.html">How To Make Ad-hoc Polymorphism Less Ad-hoc</a>. Well, there's not a <i>ton</i> of material to sink your teeth into these days, but I enjoyed reading it for the parts about explicitly translating typeclasses to dictionaries. What's neat to me is the idea that for the original proposal of typeclasses, this really <i>did</i> describe a suitable semantics that was entirely equivalent and you could think of overloading as syntactic sugar for dictionary building/passing. Haskell's typeclasses have evolved since then, and there's also the extensions my colleagues in Hasp have created for Habit, and I don't think that a simple dictionary translation within Haskell/Habit seems like it would be good enough to capture what qualified types really can do. Maybe I'm wrong about that? I suppose I haven't really tried to write down such a translation, but I'm not particularly hopeful about the endeavor.<br /><br />A proper semantic framework for qualified types in general is something that's been bothering me for awhile, though I don't think it's a question I'll be answering but rather a fellow grad student in Hasp. I look forward to seeing what he comes up with (and mechanizing it...)Caylee Hogghttp://www.blogger.com/profile/11879924482760620558noreply@blogger.com0tag:blogger.com,1999:blog-8520970707702219166.post-52152947740455374742011-05-17T21:10:00.000-07:002011-05-17T21:10:37.161-07:00Talking Things OutOkay, so I'm starting what is essentially my second year of my PhD. Err...there's kinda personal reasons why I was only enrolled for one quarter this past academic year, but suffice it to say that things are resolved <i>enough</i> that I'm starting back up again.<div><br /></div><div>I don't think I've explicitly said where I am and what I'm doing, though. So, to get things out of the way I'm a student at Portland State University. You may not have heard of it. That's okay, I hadn't either but I came here because of the <a href="http://hasp.cs.pdx.edu/">HASP</a> group. Formerly the Programatica team that brought you things like House. Since my interests are in logic, formal methods, type theory, and all that my piece in the research team is to work on defining the semantics of Habit, the language our team has designed and is building a certified compiler for. It's a Haskell-ish language that's strict, has a more interesting typeclass system, and is missing a number of type system extensions that - while interesting in terms of language design in Haskell - aren't really needed for Habit and would just make the semantics and compilation more annoying.</div><div><br /></div><div>My background really isn't in computer science, it's mostly math and physics, and I didn't start programming until I was in my early 20s. So, I'm not the most typical candidate for a PhD in CS but that's how things go! </div><div><br /></div><div>I used to be a bit intimidated by technical blogging, but after the past couple of years the idea of someone randomly showing up in my personal writing space and picking a fight with me just isn't scary anymore. </div>Caylee Hogghttp://www.blogger.com/profile/11879924482760620558noreply@blogger.com0tag:blogger.com,1999:blog-8520970707702219166.post-16889241521689170142011-05-17T16:58:00.000-07:002011-05-17T16:58:23.518-07:00Paper(s) of the day: Building and TranslatingOkay, so I'm going to write about two papers today. The first is <a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.99.9135&rep=rep1&type=pdf">Build, Augment, Destroy Universally</a> and the second is <a href="http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.134.9706">Verifying Haskell Programs Using Constructive Type Theory</a>, which I didn't even remember downloading. Slightly odd!<div><br /></div><div>So the first paper is actually really cute. So most functional programming peeps know that initial algebras give you the basic semantics of folds for datatypes in a language where types are defined inductively*. This initial algebra semantics also gives you the convenient fusion laws that a compiler can use in order to improve performance. Now, the major contribution of the paper is to show how for (co)inductive types you can consider the initial algebra(terminal coalgebra) to also be a (co)limit of a forgetful functor and that you get the build/destroy operators which help you build an entirely different kind of fusion law! I think it's really cute and the math is pretty simple. I think I'd like to try writing some small interpreter with explicit build/fold/etc keywords built in for the datatypes. </div><div><br /></div><div>The second paper is from back in 2005 and uses oldskool Agda, not Agda2, and came out pretty close to the paper I mentioned last night that uses coinduction to embed general recursive functions. Something I'm still turning around in my head it's cool for them to use Maybe as a monad for partiality when, as discussed in Capretta's paper, that's not really sound because it allows you to "decide" whether or not programs terminate which means that you can't really be talking about the computable functions. Maybe I'm just missing something? In any case, I need to look and see if people have tried to extend/update this translation for Agda2 since it actually has coinduction. One thing that bothers me a little is that I can't find them explain their restrictions on Haskell datatypes that are allowed. Clearly they can't shallowly embed all Haskell types, because then you'd have a copy of the untyped lambda calc as a type in Agda which is just a little unsound logically.</div><div><br /></div><div>There's some other things that I was thinking about and working on today - mostly picking up some pieces about the idea of a Pointed typeclass and thinking about how one would automatically translate a set of definitions for Haskell/Habit typeclasses into inductive universes in type theory. It seems a bit better than System F dictionaries...but that's just a gut feeling. I actually need to read about such translations a bit more. </div><div><br /></div><div>Tomorrow will, hopefully, really be about logical relations. :-p</div><div><br /></div><div><br /></div><div>* Yes, in Haskell things are a bit conflated between induction and coinduction because initial algebras and terminal coalgebras are the same thing in most models of Haskell-ish systems in categories of complete partial orders.</div>Caylee Hogghttp://www.blogger.com/profile/11879924482760620558noreply@blogger.com0tag:blogger.com,1999:blog-8520970707702219166.post-27350753505110988602011-05-16T20:29:00.000-07:002011-05-16T20:45:07.693-07:00Paper of the day: General Recursion Via Coinductive TypesOkay, so I read bits and pieces of a number of papers today - a bit of a draft by Conor McBride, the recent arrows papers by Lindley et al (just cuz...not because they're relevant to my research at all), one of the first containers papers by Abbott et al, reread Build Augment Destroy, but actually read all of this cool sounding paper by Venanzio Capretta <a href="http://arxiv.org/abs/cs/0505037">General Recursion Via Coinductive Types</a>. So, yeah, I think I'll talk about that instead as my Paper O' Teh Day.<br /><br />So, basically, this paper describes in great length the trick for actually describing the lifting monad constructively in type theory. Basically, the idea is that you use a coinductive type to represent partial computations. You can then show that you can embed the partial recursive functions into your type theory as functions on the lifted type. I feel like that was a really crappy way to describe that, so let me try again.<br /><br />So in order to have a logically useful type theory you probably want to restrict yourself to only normalizing terms (...you don't have to, by the way, but implementation gets interesting). General recursive functions, naively encoded, aren't necessarily normalizing. What to do!? Well, you use coinduction to describe a <i>potentially </i>non-terminating function by the explicit process of stepping through the computation...and since this is coinduction, there can be an infinite number of steps!<br /><br />So, basically, that's how you encode general recursion into it. There's more details related to how the Y-combinator works that I feel like I haven't entirely grokked, but I want to try and implement some of this structure in Agda. What's nice is that once you have your encoding of the computable functions this way, you can start building up some actual domain theory. Which I have just a tiny bit of interest in, coincidentally!<br /><br />Okay, so for tomorrow I should finish the build augment destroy paper and the initial semantics is enough paper. I kinda want to write a little implementation of a small language that has actual fold/build/etc. keywords as a proof of concept for something I want to propose for the Habit language.Caylee Hogghttp://www.blogger.com/profile/11879924482760620558noreply@blogger.com0tag:blogger.com,1999:blog-8520970707702219166.post-89986842161340547062011-05-15T16:58:00.000-07:002011-05-15T17:03:25.681-07:00Paper(s) of the day: BananasOkay, so as I said I would I ended up reading <a href="http://citeseer.ist.psu.edu/viewdoc/download;jsessionid=F4E6E4708691C1F6FAA9672CFA6EE8E9 doi=10.1.1.41.125&rep=rep1&type=pdf">Bananas, Envelopes, and Barbed Wire</a> as well as <a href="http://www.cs.nott.ac.uk/~gmh/bananas.ps">Bananas In Space</a>.<br /><br />Wow, so I don't think the original paper has aged well in some ways. The notation and equations are very different than any other way I've seen the material presented, and it's no wonder I feel like I didn't get much out of this paper five years ago when I was just learning category theory and knew essentially no computer science ("Oh, so you know computer science now?" "Stop that, Caylee!"). So, I read Freyd's papers on fixed points of functors a lot more recently and I think they're clearer if <em>much</em> harder to find. I've never found them available on the Interwebz, but I grabbed copies from my university library. There's no category theorists at Portland State, but we have copies of the category theory journals. Go figure!<br /><br />So, anyway, the original paper is cute from a historic perspective as it shows how natural fusion laws from the category of sets and functions can be extended to the the categoy of cpos with some strictness side conditions. It basically says, but doesn't show with commuting diagrams, that these laws come from universal mapping properties of limits and colimits.<br /><br />The Bananas in Space paper is really cute though because it shows how to describe these constructions as Haskell (well, Gofer...) code. The punchline is giving a demonstration of Freyd's difunctors as code. Which, honestly, makes sense if you think of Haskell programs as existing in some subcategory of CPO that's clearly going to be enriched in the ways that Freyd's work needs. I mean, clearly, that's not really rigorous math but it's a really cute example of the construction.<br /><br />So what did I really gleen from these papers? Well, I guess I didn't pick up stuff that I hadn't already known about. I suppose one thing I'm wondering about is why I haven't seen more systems for reasoning about programming languages using equational methods like these. I have seen papers talking about how you can do it, but I haven't seen many mechanized systems for doing the work and proving serious properties of programs. I've wondered before if that's because most of the languages we'd want to reason about don't have a formal semantics. <br /><br />I think I just made an argument for why I need to get back to working on a semantics for Habit...*scurry scurry*<br /><br />Tomorrow will be reviewing Plotkin's generalization of the D-infinity construction as well as Pitt's original paper on logical relations.Caylee Hogghttp://www.blogger.com/profile/11879924482760620558noreply@blogger.com0tag:blogger.com,1999:blog-8520970707702219166.post-62600693861430445952011-05-15T16:29:00.000-07:002011-05-15T16:29:23.252-07:00Computation & CardinalitySo about a month ago I spoke at code'n'splode, a women-focused tech group. Yes, women-focused as in "primarily for women" but men can attend when given the capability. Of course, like any proper capability system revocation is supported. <br /><br />My goal was to start with the cardinality of sets and get through Church encodings of common data types in the untyped lambda calculus.<br /><br />I think the talk was, for the most part, a success. I think I lost about half the room by the end, but given that I didn't get to give a practice talk <em>and</em> that my dying laptop prevented me from using the interpreters I wrote for examples I think it went fairly well.<br /><br />One of the main things I hope everyone understood right from the beginning is that the "set" of all mathematical functions is absurdly, ridiculously, mind-bogglingly bigger than the set of computable functions. There are only <em>countable</em> computable functions, but the set of all functions from the naturals to the naturals is already the size of the real numbers. <br /><br />In that light, computer science seems like an awesome - in the old sense of the word - pursuit!Caylee Hogghttp://www.blogger.com/profile/11879924482760620558noreply@blogger.com0tag:blogger.com,1999:blog-8520970707702219166.post-501211738263598852011-05-14T20:00:00.000-07:002011-05-14T20:00:32.779-07:00Paper of the day: Design Patterns as Higher-Order Datatype-Generic ProgramsSo for tonight's studying I decided to read something almost entirely unrelated to semantics and read the journal version of Jeremy Gibbons's paper, available online <a href="http://www.comlab.ox.ac.uk/publications/publication4052-abstract.html">here</a>. So, yeah, I guess this was really the clearest explanation of some of the tricks involving bifunctors and explicit fixed points that I've read. <div><br /></div><div>The whole punchline is really on page 13, but he spends the rest of the paper explaining how these constructions relate to the iteration patterns from OO programming. It's pretty cute and despite having used Haskell off and on for a few years, I'd never really written any examples with the generic fold, unfold, hylo, and map operations.</div><div><br /></div><div>Reading this also made me want to go back to the old "bananas" papers which I haven't read since I was trying to decide if I actually liked this whole computer science thing a few years back, just after burning out of grad school in a completely different field. (Spoiler alert: yes, it turned out that I liked computer science <i>a lot.</i>)</div><div><br /></div><div>I think I'll read the original bananas paper tomorrow, and then maybe get back to some things a bit more relevant to my actual research after that. For example, I want to read that paper about safely including partiality via coinduction. That felt like a jargon-y sentence. Ouch.</div>Caylee Hogghttp://www.blogger.com/profile/11879924482760620558noreply@blogger.com0tag:blogger.com,1999:blog-8520970707702219166.post-67862392892245433432011-05-14T17:53:00.000-07:002011-05-14T17:53:14.114-07:00Note to Self: Explaining System FWhen explaining Church encodings of data types in System F, we can say that we first come up with a type that encompasses the fundamental structure of what we can <i>do</i> with that type and then by quantifying over all possible types that have that property, you necessarily create a type that has <i>only</i> that behavior as a least common denominator. <div><br /></div><div>Need to figure out a better way of saying this, of creating the proper picture, before I give that second part of my talk where I talk about typed calculi.</div>Caylee Hogghttp://www.blogger.com/profile/11879924482760620558noreply@blogger.com0tag:blogger.com,1999:blog-8520970707702219166.post-17293513996678472482011-05-14T16:13:00.000-07:002011-05-14T16:13:36.733-07:00Proving. Things.I like theorem provers. I also like learning <em>new</em> theorem provers. At this point I'm pretty familiar with Coq and Isabelle, but am still learning Agda.<br /><br />My first theorem prover was Coq, via Benjamin Pierce's excellent book Software Foundations. Since then, whenever I begin learning a new system I convert proofs and exercises from Pierce's book to the new system I'm learning. I have a decent chunk of the book converted to Isabelle, and the first few chapters in Agda so far. <br /><br />My advisor has suggested that I attempt to write some kind of internal technical report comparing the advantages and disadvantages of each tool. For example, I might take the simply typed lambda calculus chapters from Software Foundations and write up all the proofs and exercises in each, along with perhaps some of the proofs from Chlipala's book Certified Programming with Dependent types written in Agda. That's right, I want to do some of the proofs he attacks with the crush uber-tactic in Agda. This might be a Poor Life Decision.<br /><br />I don't expect this to be particularly publishable, but I hope that I can create a bit of a comparative reference of idioms between the three some day that can act as a bit of a mini Rosetta Stone.<br /><br />Perhaps I can do a bit of the comparisons here on this blog. I haven't entirely decided <em>what</em> I want to use this space for other than to practice writing about technical topics and talking a bit about my PhD work.Caylee Hogghttp://www.blogger.com/profile/11879924482760620558noreply@blogger.com0