<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7486674684844560197</id><updated>2011-07-30T14:37:23.833-07:00</updated><category term='judgments'/><category term='unicode'/><category term='games'/><category term='topology'/><category term='agda'/><category term='polarity'/><category term='ludics'/><title type='text'>The Paralyzing Paradoxes of Professor Polaro</title><subtitle type='html'>Primarily about proofs and programs</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>33</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-2491699924523029912</id><published>2010-09-29T07:26:00.000-07:00</published><updated>2010-09-29T07:26:46.001-07:00</updated><title type='text'>reflecting and reifying the state monad</title><content type='html'>The Haskell code below was inspired by &lt;a href="http://math.andrej.com/2010/09/27/programming-with-effects-i-theory/"&gt;Andrej Bauer's visit last week&lt;/a&gt;, as well as thinking more about &lt;a href="http://www.google.com/search?q=filinski+representing+monads"&gt;this&lt;/a&gt;, &lt;a href="http://blog.sigfpe.com/2009/11/programming-with-impossible-functions.html"&gt;this&lt;/a&gt;, and &lt;a href="http://www.pps.jussieu.fr/%7Emellies/papers/segal-lics-2010-revised.pdf"&gt;this&lt;/a&gt; since writing &lt;a href="http://www.pps.jussieu.fr/%7Enoam/papers/polpol.pdf"&gt;this&lt;/a&gt;.&lt;hr&gt;&lt;p&gt;&lt;pre&gt;&lt;br /&gt;{-# LANGUAGE RankNTypes, FlexibleInstances #-}&lt;br /&gt;&lt;br /&gt;-- A "negative type" is a datatype of continuations, indexed by answer&lt;br /&gt;-- type.  Given such a description, we can define values, "algebras",&lt;br /&gt;-- and "handlers" as control expressions ("double negations") with&lt;br /&gt;-- different answer type constraints&lt;br /&gt;-- (cf. http://polaro.blogspot.com/2010/05/five-kinds-of-double-negation.html)&lt;br /&gt;&lt;br /&gt;newtype Value neg = Val { runVal :: forall r. neg r -&gt; r }&lt;br /&gt;newtype Algebra neg r = Alg { runAlg :: neg r -&gt; r }&lt;br /&gt;newtype Handler neg r1 r2 = Han { runHandle :: neg r1 -&gt; r2 }&lt;br /&gt;&lt;br /&gt;infixr 0 `plugV`, `plugA`, `plugH`&lt;br /&gt;&lt;br /&gt;plugV :: neg r -&gt; Value neg -&gt; r&lt;br /&gt;k `plugV` v = runVal v k&lt;br /&gt;&lt;br /&gt;plugA :: neg r -&gt; Algebra neg r -&gt; r&lt;br /&gt;k `plugA` v = runAlg v k&lt;br /&gt;&lt;br /&gt;plugH :: neg r -&gt; Handler neg r r' -&gt; r'&lt;br /&gt;k `plugH` v = runHandle v k&lt;br /&gt;&lt;br /&gt;-- We define the negative type Cell s&lt;br /&gt;&lt;br /&gt;data Cell s r = Update s (Cell s r)&lt;br /&gt;              | Lookup (s -&gt; Cell s r)&lt;br /&gt;              | Return r&lt;br /&gt;&lt;br /&gt;-- Example: given an initial state, we can create a cell value...&lt;br /&gt;&lt;br /&gt;new :: s -&gt; Value (Cell s)&lt;br /&gt;new s = Val newVal&lt;br /&gt;    where&lt;br /&gt;      newVal (Update s' k) = k `plugV` new s'&lt;br /&gt;      newVal (Lookup ks) = ks s `plugV` new s&lt;br /&gt;      newVal (Return a) = a&lt;br /&gt;&lt;br /&gt;-- Example: perform some operations on an initial state...&lt;br /&gt;&lt;br /&gt;r1 = (Lookup $ \s -&gt;&lt;br /&gt;      Update (s-1) $&lt;br /&gt;      Lookup $ \s' -&gt;&lt;br /&gt;      Return (s'+1))&lt;br /&gt;     `plugV`&lt;br /&gt;     new 2&lt;br /&gt;-- r1 = 2&lt;br /&gt;&lt;br /&gt;-- Monadic reification and reflection&lt;br /&gt;&lt;br /&gt;reify :: Cell s a -&gt; s -&gt; (s,a)&lt;br /&gt;reify k s = k `plugH` Han reifyHandle&lt;br /&gt;    where&lt;br /&gt;      reifyHandle (Update s' k') = reify k' s'&lt;br /&gt;      reifyHandle (Lookup ks) = reify (ks s) s&lt;br /&gt;      reifyHandle (Return a) = (s,a)&lt;br /&gt;&lt;br /&gt;reflect :: (s -&gt; (s,a)) -&gt; Cell s a&lt;br /&gt;reflect m = Lookup $ \s -&gt;&lt;br /&gt;            let (s',a) = m s in&lt;br /&gt;            Update s' $&lt;br /&gt;            Return a&lt;br /&gt;&lt;br /&gt;-- Example: Normalization by reification and reflection&lt;br /&gt;&lt;br /&gt;prog1 = Update 0 $&lt;br /&gt;        Lookup $ \s -&gt;&lt;br /&gt;        Return (s + 1)&lt;br /&gt;prog2 = Lookup $ \s -&gt;&lt;br /&gt;        Update 2 $&lt;br /&gt;        Update 0 $&lt;br /&gt;        Return 1&lt;br /&gt;&lt;br /&gt;-- a bit of code for printing cell continuations (prints only a small&lt;br /&gt;-- segment of lookup tables)&lt;br /&gt;instance Show r =&gt; Show (Cell Integer r) where&lt;br /&gt;    show (Update s k) = "upd " ++ show s ++ "; " ++ show k&lt;br /&gt;    show (Lookup ks) = show (map (\s -&gt; (s, ks s)) [0..3])&lt;br /&gt;    show (Return a) = "ret " ++ show a&lt;br /&gt;&lt;br /&gt;-- *Main&gt; prog1&lt;br /&gt;-- upd 0; [(0,ret 1),(1,ret 2),(2,ret 3),(3,ret 4)]&lt;br /&gt;-- *Main&gt; prog2&lt;br /&gt;-- [(0,upd 2; upd 0; ret 1),(1,upd 2; upd 0; ret 1),(2,upd 2; upd 0; ret 1),(3,upd 2; upd 0; ret 1)]&lt;br /&gt;-- *Main&gt; reflect(reify prog1)&lt;br /&gt;-- [(0,upd 0; ret 1),(1,upd 0; ret 1),(2,upd 0; ret 1),(3,upd 0; ret 1)]&lt;br /&gt;-- *Main&gt; reflect(reify prog2)&lt;br /&gt;-- [(0,upd 0; ret 1),(1,upd 0; ret 1),(2,upd 0; ret 1),(3,upd 0; ret 1)]&lt;br /&gt;&lt;/pre&gt;&lt;hr&gt;&lt;p&gt;Otherwise, things have been good.  This blog has been quiet for a while, but I'm still learning a lot from amazing people.  Though I can't resist quoting Henry Miller: "It is now the fall of my second year in Paris.  I was sent here for a reason I have not yet been able to fathom."&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-2491699924523029912?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/2491699924523029912/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=2491699924523029912' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/2491699924523029912'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/2491699924523029912'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2010/09/reflecting-and-reifying-state-monad.html' title='reflecting and reifying the state monad'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-6087422712638053997</id><published>2010-05-22T11:06:00.000-07:00</published><updated>2010-05-22T11:06:05.410-07:00</updated><title type='text'>Five kinds of double-negation</title><content type='html'>A &lt;a href="http://lists.seas.upenn.edu/pipermail/types-list/2010/001481.html"&gt;recent question on the TYPES mailing list&lt;/a&gt; reminded me that one reason negation is confusing is because it can mean so many different things.  I and others originally thought the answer the person was looking for (the type-theoretic reading of negation) was "continuations", but it turned out his intuition was about a &lt;a href="http://lists.seas.upenn.edu/pipermail/types-list/2010/001484.html"&gt;different form of negation&lt;/a&gt; not usually considered in constructive logic (but available in "refinement type systems", etc.), since it's tied to the "extrinsic" interpretation of types-as-properties.  (For more on this deficit of constructive logic, see the introduction to Paul Taylor's &lt;a href="http://www.paultaylor.eu/ASD/subasd/subasd.pdf"&gt;Subspaces in Abstract Stone Duality&lt;/a&gt;.)&lt;p&gt;But even restricted to plain old type theory, there are many different interpretations of negation!  Under the principle of "Why talk about something confusing when you can talk about something doubly confusing?", today I want to talk about different computational interpretations of &lt;i&gt;double&lt;/i&gt; negations in logic.&lt;ol&gt;&lt;li&gt;(A -&gt; 0) -&gt; 0.  Here 0 is falsehood, and this is the standard interpretation of double-negation in intuitionistic logic.  What does this mean computationally?  Well, one way to think about this is to interpret types as sets.  How many different functions f : X -&gt; 0 are there from any set X into the empty set?  None, unless X is itself empty, in which case there is exactly one.  Applying this reasoning to our double-negation, if A is non-empty, then A -&gt; 0 is empty, which in turn means that (A -&gt; 0) -&gt; 0 contains exactly one element; conversely, if A is empty, then A -&gt; 0 is non-empty, which in turns means that (A -&gt; 0) -&gt; 0 is empty.  What we see is that intuitionistic double-negation encodes the principle of &lt;i&gt;proof-irrelevance&lt;/i&gt;, i.e., it &lt;i&gt;forgets&lt;/i&gt; all the computational content of a type.  (The catch here is that set-theoretic reasoning doesn't always prove type isomorphisms&amp;mdash;this argument really only works for extensional type theory.)&lt;/li&gt;&lt;li&gt;(A -&gt; ⊥) -&gt; ⊥.  Here ⊥ represents &lt;a href="http://en.wikipedia.org/wiki/Minimal_logic"&gt;"minimal" falsehood&lt;/a&gt;, i.e., simply a logical atom with no introduction or elimination rules, and in particular without the principle of &lt;a href="http://en.wikipedia.org/wiki/Principle_of_explosion"&gt;explosion&lt;/a&gt;.  Because we have replaced "empty" with "unknown", minimal double-negation does not have the same computational degeneracy of intuitionistic double-negation: there are at least as many different constructive proofs of (A -&gt; ⊥) -&gt; ⊥ as there are of A, and often more.  For example, in general there is no proof in minimal logic of excluded middle A ∨ (A -&gt; ⊥), but there is a proof of ((A ∨ (A -&gt; ⊥)) -&gt; ⊥) -&gt; ⊥.  Indeed, minimal logic rather than intuitionistic logic really is the proper place to understand the computational content of the classical double-negation translations (something which I didn't fully appreciate until reading Jeremy Avigad's &lt;a href="http://arxiv.org/abs/0901.2551"&gt;The computational content of classical arithmetic&lt;/a&gt;).  As such, this form of double-negation is the first step towards understanding &lt;i&gt;continuation-passing style.&lt;/i&gt;&lt;/li&gt;&lt;li&gt;(A -&gt; R) -&gt; R, where R is any type of &lt;i&gt;answers&lt;/i&gt;.  We said that ⊥ above is a logical atom.  In type-theoretic terms, it is a type variable.  So to move to this form double-negation, we simply &lt;i&gt;instantiate&lt;/i&gt; the variable with a concrete type R.  Now, logically we are beginning to stretch the meaning of "negation".  In particular, nothing says that R is uninhabited&amp;mdash;indeed if it is provably uninhabited, we are back to the computationally degenerate situation (1).  But whether or not we accept the terminology, this form of double-negation is extremely important computationally, tied to the representation of control flow.  A function of type A -&gt; R is a continuation (transforming any value of type A into a result of type R), and so a term of type (A -&gt; R) -&gt; R is something which takes a continuation to a result&amp;mdash;a computation with "control effects".  The type (A -&gt; R) -&gt; R is so powerful that it comes with &lt;a href="http://www.haskell.org/all_about_monads/html/contmonad.html"&gt;the following warning&lt;/a&gt;:&lt;center&gt;&lt;img src="http://www.haskell.org/all_about_monads/html/warn.png"&gt;Abuse of the Continuation monad can produce code that is impossible to understand and maintain.&lt;/center&gt;The "principle of double-confusion" I mentioned at the beginning then motivates the following &lt;i&gt;pair&lt;/i&gt; of generalizations...&lt;/li&gt;&lt;li&gt;(A -&gt; R1) -&gt; R2, where R1 and R2 are two (possibly distinct) types of answers.  This form of double-negation comes up in the study of &lt;a href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.43.4822"&gt;delimited control operators&lt;/a&gt;, which were originally motivated by the fact that the type (A -&gt; R) -&gt; R is not only too powerful but also not powerful enough.  The type (A -&gt; R1) -&gt; R2 can be seen as a sort of &lt;a href="http://en.wikipedia.org/wiki/Hoare_logic"&gt;Hoare triple&lt;/a&gt; {R1}A{R2}, which gives an intimation of its power.&lt;/li&gt;&lt;li&gt;∀α.(A -&gt; α) -&gt; α, a polymorphic type (and more generally, ∀α.(A -&gt; Tα) -&gt; Tα, where T is an arbitrary &lt;a href="http://en.wikipedia.org/wiki/Monad_%28category_theory%29"&gt;monad&lt;/a&gt;).  It's easy to see that A ≡ ∀α.(A -&gt; α) -&gt; α is provable in second-order intuitionistic logic, but in fact this can also be interpreted as the Yoneda &lt;i&gt;isomorphism&lt;/i&gt; in category theory, as &lt;a href="http://blog.sigfpe.com/2006/11/yoneda-lemma.html"&gt;sigfpe explained a few years ago&lt;/a&gt;.  More generally, there is a Yoneda isomorphism between TA and ∀α.(A -&gt; Tα) -&gt; Tα for any monad T (and formally, a type isomorphism in System F + parametricity axioms).  This isomorphism lies at the heart of &lt;a href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.43.8213"&gt;Filinski's representation theorem&lt;/a&gt; that delimited control operators can be used to perform "monadic reflection".&lt;/li&gt;&lt;/ol&gt;So that is a small cast of characters, biased towards the view of "negation as continuation" (which as I said, is not the only view).  For more plots involving these different forms of double-negation (particularly (4) and (5)), you can read the &lt;a href="http://polaro.blogspot.com/2010/05/polarity-and-logic-of-delimited.html"&gt;paper I posted&lt;/a&gt; two weeks ago.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-6087422712638053997?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/6087422712638053997/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=6087422712638053997' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/6087422712638053997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/6087422712638053997'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2010/05/five-kinds-of-double-negation.html' title='Five kinds of double-negation'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-6617197386642402481</id><published>2010-05-02T12:31:00.000-07:00</published><updated>2010-05-02T12:31:48.097-07:00</updated><title type='text'>Polarity and the logic of delimited continuations</title><content type='html'>Text: &lt;a href="http://www.pps.jussieu.fr/~noam/papers/polpol.pdf"&gt;pdf&lt;/a&gt;&lt;br&gt;Code: &lt;a href="http://www.pps.jussieu.fr/~noam/src/delimited.tar"&gt;twelf&lt;/a&gt;&lt;br&gt;Abstract:&lt;p&gt;&lt;blockquote&gt;Polarized logic is the logic of values and continuations, and their interaction through continuation-passing style. The main limitations of this logic are the limitations of CPS: that continuations cannot be composed, and that programs are fully sequentialized.  Delimited control operators were invented in response to the limitations of classical continuation-passing. That suggests the question: what is the logic of delimited continuations?&lt;p&gt;We offer a simple account of delimited control, through a natural generalization of the classical notion of polarity.  This amounts to breaking the perfect symmetry between positive and negative polarity in the following way: answer types are positive.  Despite this asymmetry, we retain all of the classical polarized connectives, and can explain "intuitionistic polarity" (e.g., in systems like CBPV) as a restriction on the use of connectives, i.e., as a logical fragment.  Our analysis complements and generalizes existing accounts of delimited control operators, while giving us a rich logical language through which to understand the interaction of control with monadic effects.&lt;/blockquote&gt;To appear at &lt;a href="http://www2.informatik.hu-berlin.de/lics/lics10/"&gt;LICS 2010&lt;/a&gt;.&lt;p&gt;Writing this paper helped me sort out some things I'd been puzzled about for a while&amp;mdash;I hope you also find it useful!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-6617197386642402481?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/6617197386642402481/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=6617197386642402481' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/6617197386642402481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/6617197386642402481'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2010/05/polarity-and-logic-of-delimited.html' title='Polarity and the logic of delimited continuations'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-122854476933861153</id><published>2010-04-24T14:12:00.000-07:00</published><updated>2010-04-24T14:12:43.092-07:00</updated><title type='text'>"One of the first things to learn about category theory is that not everything in mathematics is a category"</title><content type='html'>Sorry, apologies, etc., for the long silence.  I've been working on the final version of &lt;a href="http://www2.informatik.hu-berlin.de/lics/lics10/lics10-accepted.html"&gt;a paper&lt;/a&gt; that I plan to post here in a few days.  This mini-post is just to highlight an exchange on &lt;a href="http://mathoverflow.net/"&gt;MathOverflow&lt;/a&gt; that jibes with some things I've been thinking about lately.  The quote in the title is from &lt;a href="http://math.uchicago.edu/~shulman/"&gt;Mike Shulman&lt;/a&gt; in response to &lt;a href="http://mathoverflow.net/questions/22359/why-havent-certain-well-researched-classes-of-mathematical-object-been-framed-by"&gt;this question&lt;/a&gt;, "Why haven’t certain well-researched classes of mathematical object been framed by category theory?"  I also like &lt;a href="http://mathoverflow.net/questions/22359/why-havent-certain-well-researched-classes-of-mathematical-object-been-framed-by/22380#22380"&gt;Reid Barton's response&lt;/a&gt;, in particular, "From the standpoint of higher category theory, categories (i.e., 1-categories) are just one level among many in a family of mathematical structures".  This seems to me like an important lesson to keep in mind when applying category theory to programming languages and proof theory: to resist the desire to phrase everything as a category.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-122854476933861153?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/122854476933861153/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=122854476933861153' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/122854476933861153'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/122854476933861153'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2010/04/one-of-first-things-to-learn-about.html' title='&quot;One of the first things to learn about category theory is that not everything in mathematics is a category&quot;'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-7764511668313889581</id><published>2010-01-26T15:32:00.000-08:00</published><updated>2010-01-26T15:44:03.078-08:00</updated><title type='text'>Twelf, my favorite general-purpose functional programming language</title><content type='html'>&lt;i&gt;(Disclaimer: the title of this post is tongue-in-cheek—I do not really like to play favorites.  But hopefully you will understand why I chose it: to mess with your head.)&lt;/i&gt;&lt;p&gt;Last week I was at &lt;a   href="http://www.cse.psu.edu/popl/10/index.html"&gt;POPL 2010&lt;/a&gt; in  Madrid.  Most fun of course was catching up with friends and meeting  new people, but there were also some excellent talks.  A few highlights:&lt;ul&gt;  &lt;li&gt;&lt;a href="http://www.cse.psu.edu/~swarat/pubs/index.html"&gt;Swarat Chaudhuri&lt;/a&gt;'s talk about &lt;a href="http://www.cse.psu.edu/~swarat/pubs/continuity.pdf"&gt;Continuity Analysis of Programs&lt;/a&gt;: continuity, like type safety, provides a measure of the "robustness" of programs&lt;/li&gt;  &lt;li&gt;&lt;a href="http://www2.research.att.com/~trevor/"&gt;Trevor Jim&lt;/a&gt;'s very fun talk on Yakker (&lt;a href="http://www.cs.princeton.edu/~dpw/papers/ddgrammars-0709.pdf"&gt;Semantics and Algorithms for Data-dependent Grammars&lt;/a&gt;)&lt;/li&gt;  &lt;li&gt;&lt;a href="http://www.diku.dk/hjemmesider/ansatte/andrzej/"&gt;Andrzej Filinski&lt;/a&gt; on &lt;a href="http://www.diku.dk/hjemmesider/ansatte/andrzej/papers/popl10-mia.pdf"&gt;Monads in Action&lt;/a&gt;: exploring the relationship between monadic and operational semantics&lt;/li&gt;  &lt;li&gt;&lt;a href="http://www.ccs.neu.edu/home/matthias/"&gt;Matthias Felleisen&lt;/a&gt;'s invited talk at TLDI, which opened with the following slide:  &lt;img width="600" src="http://www.pps.jussieu.fr/~noam/images/felleisen.jpg" alt="i see you're the keynote speaker at TYPES in language design and implementation.  what the f...??"&gt;&lt;/ul&gt;In this post I want to talk a bit about my favorite general-purposefunctional programming language, &lt;a href="http://twelf.plparty.org/wiki/Main_Page"&gt;Twelf&lt;/a&gt;.  If that sentence gives youcognitive dissonance, please read on!&lt;p&gt;Really, what I am going to be describing is a &lt;i&gt;very shallowembedding&lt;/i&gt; of a pure functional language within Twelf.  Forfamiliarity (though at a cost of expressiveness), I will limit our language to an ML-like, call-by-valuefragment (with arbitrary recursive datatypes and recursivefunctions), rather than a fully polarized type theory.  For fun, ourlanguage will also include Haskell-style typeclasses.  Our two weapons will betraditional LF-style (dependently-typed) higher-order abstract syntax, and thedefunctionalization trick I described &lt;a href="http://polaro.blogspot.com/2009/07/defunctionalizing-proofs-revised.html"&gt;a year ago&lt;/a&gt;.  Don't worry, we won't be proving any theorems, only writing programs.&lt;p&gt;We begin by declaring the (meta-level) type of (object-level) types:&lt;pre&gt;&lt;br /&gt;tp : type.                      % types&lt;br /&gt;&lt;/pre&gt;As we did informally &lt;a href="http://polaro.blogspot.com/2009/11/what-is-logic-of-ml-values.html"&gt;in a previous post&lt;/a&gt;, we will distinguish three syntactic categories:&lt;pre&gt;&lt;br /&gt;val : tp -&gt; type.               % values&lt;br /&gt;kon : tp -&gt; tp -&gt; type.         % "delimited" continuations&lt;br /&gt;exp : tp -&gt; type.               % expressions&lt;br /&gt;&lt;/pre&gt;(Note: there is nothing scary about delimited continuations—think of them as pure ML functions, or entailments, or morphisms in a category.)  Expressions in our language are constructed out of values and continuations, as follows:&lt;pre&gt;&lt;br /&gt;! : val A -&gt; exp A.             %prefix 10 !.&lt;br /&gt;$ : kon A B -&gt; exp A -&gt; exp B.  %infix right 11 $.&lt;br /&gt;&lt;/pre&gt;Because we are really restricting to types of &lt;i&gt;positivepolarity&lt;/i&gt;, values are built by applying constructors, whilecontinuations are defined by pattern-matching on values.  Thelatter principle is expressed (in defunctionalized form) by the &lt;i&gt;apply&lt;/i&gt; function, a Twelf logic program:&lt;pre&gt;&lt;br /&gt;apply : kon A B -&gt; val A -&gt; exp B -&gt; type.&lt;br /&gt;%mode apply +K +V -E.&lt;br /&gt;&lt;/pre&gt;Now, without knowing anything else about values and continuations,we can already give our language a generic (big-step) operationalsemantics:&lt;pre&gt;&lt;br /&gt;eval : exp A -&gt; val A -&gt; type.&lt;br /&gt;%mode eval +E -V.&lt;br /&gt;- : eval (! V) V.&lt;br /&gt;- : eval (F $ E) VR&lt;br /&gt;        &lt;- eval E V&lt;br /&gt;        &lt;- apply F V E'&lt;br /&gt;        &lt;- eval E' VR.&lt;br /&gt;&lt;/pre&gt;And that's the core language!  Next we can build up a nice libraryof datatypes and library routines.  We define some simple datatype constructors, by their value constructors:&lt;pre&gt;&lt;br /&gt;1 : tp.&lt;br /&gt;&lt;&gt; : val 1.&lt;br /&gt;&lt;br /&gt;0 : tp.&lt;br /&gt;&lt;br /&gt;* : tp -&gt; tp -&gt; tp.             %infix right 12 *.&lt;br /&gt;pair : val A -&gt; val B -&gt; val (A * B).&lt;br /&gt;&lt;br /&gt;+ : tp -&gt; tp -&gt; tp.             %infix right 11 +.&lt;br /&gt;inl : val A -&gt; val (A + B).&lt;br /&gt;inr : val B -&gt; val (A + B).&lt;br /&gt;&lt;br /&gt;=&gt; : tp -&gt; tp -&gt; tp.            %infix right 10 =&gt;.&lt;br /&gt;fn : kon A B -&gt; val (A =&gt; B).&lt;br /&gt;&lt;/pre&gt;We also introduce polymorphic and recursive types (noteour reliance on HOAS and substitution):&lt;pre&gt;&lt;br /&gt;∀ : (tp -&gt; tp) -&gt; tp.&lt;br /&gt;Λ : ({x}val (A x)) -&gt; val (∀ A).&lt;br /&gt;&lt;br /&gt;rec : (tp -&gt; tp) -&gt; tp.&lt;br /&gt;fold : val (A* (rec A*)) -&gt; val (rec A*).&lt;br /&gt;&lt;/pre&gt;Finally we derive some familiar datatypes:&lt;pre&gt;&lt;br /&gt;bool = 1 + 1.&lt;br /&gt;true = inl &lt;&gt;.&lt;br /&gt;false = inr &lt;&gt;.&lt;br /&gt;&lt;br /&gt;maybe = [A] A + 1.&lt;br /&gt;nothing : val (maybe A) = inr &lt;&gt;.&lt;br /&gt;just : val A -&gt; val (maybe A) = [V] inl V.&lt;br /&gt;&lt;br /&gt;nat = rec [X] 1 + X.&lt;br /&gt;z : val nat = fold (inl &lt;&gt;).&lt;br /&gt;s : val nat -&gt; val nat = [V] fold (inr V).&lt;br /&gt;&lt;br /&gt;list = [A] rec [X] 1 + A * X.&lt;br /&gt;nil : val (list A) = fold (inl &lt;&gt;).&lt;br /&gt;cons : val A -&gt; val (list A) -&gt; val (list A) =&lt;br /&gt;        [V] [Vs] fold (inr (pair V Vs)).&lt;br /&gt;&lt;/pre&gt;Just as we do in Haskell, we can define continuations (functions)by giving them a type declaration, and then a list of pattern-matching clauses.  For example, here we define theboolean operations "and" and "or":&lt;pre&gt;&lt;br /&gt;and : kon (bool * bool) bool.&lt;br /&gt;- : apply and (pair true true) (! true).&lt;br /&gt;- : apply and (pair true false) (! false).&lt;br /&gt;- : apply and (pair false _) (! false).&lt;br /&gt;&lt;br /&gt;or : kon (bool * bool) bool.&lt;br /&gt;- : apply or (pair false false) (! false).&lt;br /&gt;- : apply or (pair false true) (! true).&lt;br /&gt;- : apply or (pair true _) (! true).&lt;br /&gt;&lt;/pre&gt;We can also define some continuation constructors in the same way.For example, we can define the beloved lambda:&lt;pre&gt;&lt;br /&gt;λ : (val A -&gt; exp B) -&gt; kon A B.&lt;br /&gt;- : apply (λ F) V (F V).&lt;br /&gt;&lt;/pre&gt;λ constructs a continuation from an expression with a free valuevariable, which is useful when we &lt;i&gt;don't&lt;/i&gt; need to pattern-matchon the argument.  We also define some useful syntactic sugar:&lt;pre&gt;&lt;br /&gt;let : exp A -&gt; (val A -&gt; exp B) -&gt; exp B = [E] [F] λ F $ E.&lt;br /&gt;&lt;/pre&gt;In effect here we are using Twelf as a &lt;i&gt;macrosystem&lt;/i&gt; for our embedded language.  The following continuationconstructors correspond to (sequent calculus) "left rules" forthe various type constructors:&lt;pre&gt;&lt;br /&gt;split : (val A -&gt; val B -&gt; exp C) -&gt; kon (A * B) C.&lt;br /&gt;- : apply (split E*) (pair V1 V2) (E* V1 V2).&lt;br /&gt;&lt;br /&gt;case : kon A C -&gt; kon B C -&gt; kon (A + B) C.&lt;br /&gt;- : apply (case K1 K2) (inl V) E&lt;br /&gt;        &lt;- apply K1 V E.&lt;br /&gt;- : apply (case K1 K2) (inr V) E&lt;br /&gt;        &lt;- apply K2 V E.&lt;br /&gt;&lt;br /&gt;funsplit : (kon A B -&gt; exp C) -&gt; kon (A =&gt; B) C.&lt;br /&gt;- : apply (funsplit E*) (fn F) (E* F).&lt;br /&gt;&lt;br /&gt;gensplit : (({x}val (A x)) -&gt; exp C) -&gt; kon (∀ A) C.&lt;br /&gt;- : apply (gensplit E*) (Λ V) (E* V).&lt;br /&gt;&lt;br /&gt;unfold : kon (A* (rec A*)) C -&gt; kon (rec A*) C.&lt;br /&gt;- : apply (unfold K) (fold V) E&lt;br /&gt;        &lt;- apply K V E.&lt;br /&gt;&lt;/pre&gt;Note we are not obligated to use these constructors to definecontinuations, i.e., they are not part of the language specification:they are just library routines.  Here's an example of a recursivedefinition:&lt;pre&gt;&lt;br /&gt;append : kon (list A * list A) (list A).&lt;br /&gt;- : apply append (pair nil L2) (! L2).&lt;br /&gt;- : apply append (pair (cons V L1) L2)&lt;br /&gt;     (let (append $ ! pair L1 L2) [L'] ! cons V L').&lt;br /&gt;&lt;/pre&gt;Okay, hopefully by now you are convinced that in this style we we canwrite more or less ordinary (effect-free) ML programs.  Next we turnto typeclasses.  Typeclasses are basically type-indexed (or typeconstructor-indexed) records, and so their encoding in Twelf followsthe same pattern of defunctionalization (i.e., for thepolarity-sensitive, because they are &lt;i&gt;negative&lt;/i&gt; values).Here we introduce a few typeclasses familiar from Haskell:&lt;pre&gt;&lt;br /&gt;EQ : tp -&gt; type.&lt;br /&gt;eq : EQ A -&gt; kon (A * A) bool.&lt;br /&gt;&lt;br /&gt;FUNCTOR : (tp -&gt; tp) -&gt; type.&lt;br /&gt;fmap : FUNCTOR F -&gt; kon A B -&gt; kon (F A) (F B).&lt;br /&gt;&lt;br /&gt;MONAD : (tp -&gt; tp) -&gt; type.&lt;br /&gt;eta : MONAD T -&gt; kon A (T A).&lt;br /&gt;ext : MONAD T -&gt; kon A (T B) -&gt; kon (T A) (T B).&lt;br /&gt;&lt;br /&gt;% Wadler's syntactic sugar...&lt;br /&gt;return : MONAD T -&gt; exp A -&gt; exp (T A) = [M] [E] eta M $ E.&lt;br /&gt;bind : MONAD T -&gt; exp (T A) -&gt; kon A (T B) -&gt; exp (T B) = [M] [E] [K] ext M K $ E.&lt;br /&gt;&lt;/pre&gt;We can instantiate EQ in various ways:&lt;pre&gt;&lt;br /&gt;1eq : EQ 1.&lt;br /&gt;- : apply (eq 1eq) (pair &lt;&gt; &lt;&gt;) (! true).&lt;br /&gt;&lt;br /&gt;sumeq : EQ A -&gt; EQ B -&gt; EQ (A + B).&lt;br /&gt;- : apply (eq (sumeq EqA EqB)) (pair (inl Va1) (inl Va2))&lt;br /&gt;        (eq EqA $ ! pair Va1 Va2).&lt;br /&gt;- : apply (eq (sumeq EqA EqB)) (pair (inl Va1) (inr Vb2))&lt;br /&gt;        (! false).&lt;br /&gt;- : apply (eq (sumeq EqA EqB)) (pair (inr Vb1) (inl Va2))&lt;br /&gt;        (! false).&lt;br /&gt;- : apply (eq (sumeq EqA EqB)) (pair (inr Vb1) (inr Vb2))&lt;br /&gt;        (eq EqB $ ! pair Vb1 Vb2).&lt;br /&gt;&lt;br /&gt;paireq : EQ A -&gt; EQ B -&gt; EQ (A * B).&lt;br /&gt;- : apply (eq (paireq EqA EqB)) (pair (pair Va1 Vb1) (pair Va2 Vb2))&lt;br /&gt;       (let (eq EqA $ ! pair Va1 Va2) [x]&lt;br /&gt;          let (eq EqB $ ! pair Vb1 Vb2) [y]&lt;br /&gt;          and $ ! pair x y).&lt;br /&gt;&lt;br /&gt;nateq : EQ nat.&lt;br /&gt;- : apply (eq nateq) (pair z z) (! true).&lt;br /&gt;- : apply (eq nateq) (pair z (s _)) (! false).&lt;br /&gt;- : apply (eq nateq) (pair (s _) z) (! false).&lt;br /&gt;- : apply (eq nateq) (pair (s N1) (s N2)) (eq nateq $ ! pair N1 N2).&lt;br /&gt;&lt;/pre&gt;Likewise FUNCTOR:&lt;pre&gt;&lt;br /&gt;idf : FUNCTOR ([A]A).&lt;br /&gt;- : apply (fmap idf K) V E&lt;br /&gt;     &lt;- apply K V E.&lt;br /&gt;&lt;br /&gt;prodf : FUNCTOR F -&gt; FUNCTOR G -&gt; FUNCTOR ([A] F A * G A).&lt;br /&gt;- : apply (fmap (prodf F G) K) (pair V1 V2)&lt;br /&gt;     (let (fmap F K $ ! V1) [x] let (fmap G K $ ! V2) [y] ! pair x y).&lt;br /&gt;&lt;br /&gt;expf : FUNCTOR ([A]B =&gt; A).&lt;br /&gt;- : apply (fmap expf K) (fn K') (! fn (λ [x] K $ K' $ ! x)).&lt;br /&gt;&lt;br /&gt;listf : FUNCTOR ([A]list A).&lt;br /&gt;- : apply (fmap listf K) nil (! nil).&lt;br /&gt;- : apply (fmap listf K) (cons V VS) (let (K $ ! V) [x]&lt;br /&gt;                                  let (fmap listf K $ ! VS) [xs]&lt;br /&gt;                                  ! cons x xs).&lt;br /&gt;&lt;/pre&gt;And MONAD:&lt;pre&gt;&lt;br /&gt;idm : MONAD ([a]a).&lt;br /&gt;- : apply (eta idm) V (! V).&lt;br /&gt;- : apply (ext idm K) V E&lt;br /&gt;     &lt;- apply K V E.&lt;br /&gt;&lt;br /&gt;maybem : MONAD ([a]maybe a).&lt;br /&gt;- : apply (eta maybem) V (! just V).&lt;br /&gt;- : apply (ext maybem K) V (case K (λ [_] ! nothing) $ ! V).&lt;br /&gt;&lt;/pre&gt;And now an example where we run fmap on a pair of lists, usingTwelf's logic engine to automatically infer the appropriateinstance of FUNCTOR:&lt;pre&gt;&lt;br /&gt;%query 1 *&lt;br /&gt;  eval (fmap F (λ [x] ! s x) $&lt;br /&gt;            ! pair (cons z (cons z nil)) (cons (s z) (cons (s z) nil))) R.&lt;br /&gt;---------- Solution 1 ----------&lt;br /&gt;R = pair (cons (s z) (cons (s z) nil)) (cons (s (s z)) (cons (s (s z)) nil));&lt;br /&gt;F = prodf listf listf.&lt;br /&gt;____________________________________________&lt;br /&gt;&lt;/pre&gt;And finally, a slightly more involved example:&lt;pre&gt;&lt;br /&gt;cond : exp C -&gt; exp C -&gt; kon bool C =&lt;br /&gt;    [E1] [E2] case (λ [_] E1) (λ [_] E2).&lt;br /&gt;&lt;br /&gt;lookup : EQ A -&gt; val A -&gt; kon (list (A * B)) (maybe B).&lt;br /&gt;- : apply (lookup Eq V) nil (! nothing).&lt;br /&gt;- : apply (lookup Eq V) (cons (pair V' VE) Vs)&lt;br /&gt;     (cond (lookup Eq V $ ! Vs) (! just VE) $ &lt;br /&gt;        (eq Eq $ ! pair V V')).&lt;br /&gt;&lt;br /&gt;one = s z. two = s one. three = s two. four = s three.&lt;br /&gt;%query 1 *&lt;br /&gt;  eval (bind _ (lookup _ one $ ! cons (pair z three)&lt;br /&gt;                  (cons (pair one four) (cons (pair two z) nil)))&lt;br /&gt;          (λ [x] return _ (! s x))) R.&lt;br /&gt;---------- Solution 1 ----------&lt;br /&gt;R = just (s four).&lt;br /&gt;____________________________________________&lt;br /&gt;&lt;/pre&gt;And that's the gist of it.&lt;p&gt;If you are still reading this, perhaps you will be inspired and useour favorite general-purpose functional programming language to write,say, a webserver?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-7764511668313889581?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/7764511668313889581/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=7764511668313889581' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/7764511668313889581'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/7764511668313889581'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2010/01/twelf-my-favorite-general-purpose.html' title='Twelf, my favorite general-purpose functional programming language'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-7381505741402313151</id><published>2009-12-21T16:02:00.000-08:00</published><updated>2009-12-21T16:02:39.645-08:00</updated><title type='text'>The History of Categorical Logic</title><content type='html'>I'm currently making my way through Jean-Pierre Marquis and Gonzalo E. Reyes' 116-page-long &lt;a href="http://www.webdepot.umontreal.ca/Usagers/marquisj/MonDepotPublic/HistofCatLog.pdf"&gt;The History of Categorical Logic&lt;/a&gt;, and it is fascinating. Someone needs to &lt;a href="http://polaro.blogspot.com/2009/09/review-of-logicomix.html"&gt;make it into a comic book&lt;/a&gt;. [HT: &lt;a href="http://math.ucr.edu/home/baez/week287.html"&gt;This Week's Finds&lt;/a&gt;]&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-7381505741402313151?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/7381505741402313151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=7381505741402313151' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/7381505741402313151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/7381505741402313151'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2009/12/history-of-categorical-logic.html' title='The History of Categorical Logic'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-6123604858738600733</id><published>2009-11-16T17:10:00.000-08:00</published><updated>2009-11-16T17:10:05.830-08:00</updated><title type='text'>What is the logic of ML values?</title><content type='html'>Before approaching the question, "What is the logic of ML values?", Ifirst want to explain why there is more subtlety to the question thanis often assumed.&lt;p&gt;(Warning: this is a long post on something which most people probablycare very little about.  On the other hand, there are 19 google hits for&lt;a href="http://www.google.com/search?num=100&amp;q=%22logic+changed+my+life%22"&gt;"logic changed my life"&lt;/a&gt;.)&lt;p&gt;In general, how does one interpret the question, "What is the logic ofX?", for some programming language X?  A standard response is that thelogical theorems are exactly the inhabited types, i.e., types τ suchthat there is a closed term t:τ.  But what are the "terms"?  Theanswer is obvious enough in simple formal systems where there is onlyone typing judgment, and so we can say things like, "The inhabitedtypes of simply-typed lambda calculus are exactly the theorems ofminimal implicational logic".  Yet, real programming languages usuallyhave many different typing judgments, since programs are composed outof many different syntactic objects.  In ML, in particular, a programincludes some let-bound values and expressions, some functiondefinitions, and a result expression (in addition to datatypedefinitions, module definitions, etc., which are classified bydifferent kinds of "types").&lt;p&gt;(In this post, "ML" is meant in a slightly fuzzy but essentiallyunambiguous way, as a call-by-value language with effects.  To settlea concrete interpretation, I will be giving examples in &lt;a href="http://www.smlnj.org/"&gt;Standard ML of NJ&lt;/a&gt;, which notablyprovides the control operator callcc.  "Value" is meant in thestandard operational sense, i.e., a value is a fully evaluated MLexpression.  We can similarly ask, "What is the logic of Haskellvalues?", but that is a different, trickier question, to which I'mstill not sure of the answer.)  &lt;p&gt;When answering the question, "What is the logic of ML?" (or "What isthe logic of Haskell?"), the standard approach is to gloss over thesedifferent syntactic categories, and assume we are talking aboutexpressions.  This makes some sense, insofar as this is the largestsyntactic category: all values and functions are also expressions.And expressions also have easy-to-understand principles ofcomposition.  For example, the rule of application—from twoexpressions e₁:σ→τ and e₂:σ, we can form the expression (e₁ e₂):τ—witnesses the logical principle of modus ponens.  Whereas fromtwo &lt;i&gt;values&lt;/i&gt; v₁:σ→τ and v₂:σ, the application (v₁ v₂):τ is nolonger a value.&lt;p&gt;Yet, I believe it is a mistake to define "the" logic of a programminglanguage in this way, without realizing there is finer structure.That is why I phrased the question, "What is the logic of ML&lt;i&gt;values&lt;/i&gt;?", rather than full-stop, "What is the logic of ML?"And so how does the logic of ML values differ from the logic of MLexpressions?  &lt;p&gt;Well, it is often claimed that ML (and likewise Haskell) defines aninconsistent logic.  This is a statement about the logic of expressions.For example, non-terminating expressions such as &lt;blockquote&gt;fun loop() = loop()&lt;/blockquote&gt;inhabit every type, as do exception-raising expressions, such as&lt;blockquote&gt;fun fail() = raise (Fail "inconsistent!?")&lt;/blockquote&gt;(Note: the expressions here are &lt;code&gt;loop()&lt;/code&gt; and&lt;code&gt;fail()&lt;/code&gt;.  Here and below, I assign names toexpressions by declaring them as thunks.)But none of these are values.  Indeed, evaluation of the firstexpression will never yield a result,&lt;blockquote&gt;- loop(); &lt;br&gt;(* waiting a long time... *)&lt;/blockquote&gt;whereas the second will return immediately, but with an exception rather than a value:&lt;blockquote&gt;- fail(); &lt;br&gt;uncaught exception Fail [Fail: inconsistent!?] &lt;br&gt;  raised at: stdIn:2.3-3.5&lt;/blockquote&gt;(There are some additional complaints about the &lt;i&gt;value restriction&lt;/i&gt;when evaluating these polymorphic expressions, but for ourpurposes we can ignore them here.)In fact, the logic of ML values is consistent, as we can see bydefining the empty type:&lt;blockquote&gt;data void = Void of void&lt;/blockquote&gt;There are no values of type void, since the only way to construct oneis by already having one.  Note, though, that all bets are off "undera lambda"—we can still build a value inhabiting any function typeσ→τ, for example&lt;blockquote&gt;fun fnfail() = fn _ =&gt; raise (Fail "inconsistent!?")&lt;/blockquote&gt;Let's try to be a bit more precise about what happens before we reachthat point.&lt;p&gt;Another folk theorem about "the logic of ML" is that insofar as it isconsistent (i.e., if you avoid things like unrestricted recursion andexceptions), with the addition of control operators it becomes&lt;i&gt;classical&lt;/i&gt;.  We can import the relevant SML/NJ library andsee what they mean:&lt;blockquote&gt;- open SMLofNJ.Cont; &lt;br&gt;opening SMLofNJ.Cont &lt;br&gt;  type 'a cont = 'a ?.cont &lt;br&gt;  val callcc : ('a cont -&gt; 'a) -&gt; 'a &lt;br&gt;  val throw : 'a cont -&gt; 'a -&gt; 'b &lt;br&gt;  val isolate : ('a -&gt; unit) -&gt; 'a cont &lt;br&gt;(* ... *)&lt;/blockquote&gt;As first observed by Griffin, the type of callcc correspondslogically to the classical principle of Peirce's Law.  We canmake this a bit easier to see by defining another controloperator letcc, which essentially does the samething as callcc but with first-class ML functions, rather thanvalues of the cont type:&lt;blockquote&gt;- fun letcc f = callcc (fn k =&gt; f (fn x =&gt; throw k x)); &lt;br&gt;val letcc = fn : (('a -&gt; 'b) -&gt; 'a) -&gt; 'a&lt;/blockquote&gt;Using letcc,  we can derive the law of excluded middle, ∀α.α ∨ ¬α.To represent this type, we first introduce a type constructorfor disjunctions:&lt;blockquote&gt;data ('a,'b) either = Left of 'a | Right of 'b&lt;/blockquote&gt;Now we can witness excluded middle as follows:&lt;blockquote&gt;fun excluded_middle() : ('a,'a -&gt; void) either = &lt;br&gt;       letcc (fn k =&gt; Right (fn x =&gt; k (Left x)))&lt;/blockquote&gt;&lt;p&gt;So what happens when we attempt to evaluate this expression?  (To avoid complaints about the value restriction, we instantiate the type variable 'a at some arbitrary type a.)&lt;blockquote&gt;- excluded_middle() : (a,a -&gt; void) either; &lt;br&gt;val it = Right fn : (a,a -&gt; void) either &lt;/blockquote&gt;And now, in contrast to what happened above with the evaluation ofloop() and fail(), here we actually get a value!&lt;p&gt;So can we say that the logic of ML values really &lt;i&gt;is&lt;/i&gt; classical?Well, we evidently can under the "bag of tautologies" view of logic.But that is not necessarily the most useful view.&lt;p&gt;If we look up at the above ML session, a shockingly anti-classicalprinciple is already staring back down at us.  After evaluating&lt;code&gt;excluded_middle()&lt;/code&gt;, we got back &lt;i&gt;this&lt;/i&gt; value:&lt;blockquote&gt;val it = Right fn : (a,a -&gt; void) either&lt;/blockquote&gt;That is, not only is this a proof of α ∨ ¬α, but in fact it containsa proof of the right side of the disjunct, ¬α.  This is an instance of the &lt;i&gt;intuitionistic&lt;/i&gt; &lt;a href="http://en.wikipedia.org/wiki/Disjunction_property"&gt;disjunctionprinciple&lt;/a&gt;, that a proof of a disjunction is a proof of one of thetwo disjuncts.&lt;p&gt;The punchline, I would say, is that the logic of ML values isnot unsound, and not classical, but simply constructive.What is an ML value of type τ?  Just an intuitionistic proofof τ—but in a non-empty context.  This context includes the currentcontinuation of type ¬τ, as well as all of the other effects that canbe invoked &lt;i&gt;underneath&lt;/i&gt; a lambda, i.e., in values of functionaltype.&lt;p&gt;Okay, so what have we brushed over here?  Well first, the restrictionthat effects are only invoked underneath lambdas can actually beenforced by CPS translation.  Functions σ→τ are interpreted as¬(σ∧¬τ), where ¬(-) denotes minimal negation, i.e., ¬τ = τ→β, for somefixed parameter β, the &lt;i&gt;return type&lt;/i&gt;.  Effectful operations areencoded as things that return β.  Second, I said that a value of (aCPS translated) type τ is an intuitionistic proof of τ (in a non-emptycontext of effects), but are &lt;i&gt;all&lt;/i&gt; such intuitionstic proofsvalues?  Well, no, because some proofs involve "detours".  To beconcrete, if M₁ and M₂ are proofs of σ and τ, then π₁(M₁, M₂) is aproof of σ—yet, &lt;code&gt;#1 ("hello", "world")&lt;/code&gt; is typically notconsidered to be a value (it evaluates to "hello").  (&lt;a href="http://www.cs.cmu.edu/~rwh/courses/modules/papers/crary-etal99/paper.pdf"&gt;Somepeople&lt;/a&gt; like to call expressions like &lt;code&gt;#1 ("hello","world")&lt;/code&gt; "valuable".)  Third, to say that there is a "logic" ofML values, we really &lt;i&gt;do&lt;/i&gt; have to explain what its compositionprinciples are, and not just which principles fail.  I might revisitsome of these points in another post.&lt;p&gt;Finally, the whole idea of a "logic of ML values" is very close to theidea of the &lt;a href="http://math.andrej.com/2009/05/29/mathematically-structured-but-not-necessarily-functional-programming/"&gt;realizability interpretation of ML&lt;/a&gt;.  Some people believe thatrealizability is a distinct and very different alternative to Curry-Howard as aconstructive interpretation of logic.  My point with this post was mainlyto suggest that Curry-Howard need not exclude realizability-likeinterpretations, once we realize (so to speak) that there is more than one syntacticcategory of proofs.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-6123604858738600733?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/6123604858738600733/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=6123604858738600733' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/6123604858738600733'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/6123604858738600733'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2009/11/what-is-logic-of-ml-values.html' title='What is the logic of ML values?'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-5377072799554620208</id><published>2009-10-28T04:03:00.000-07:00</published><updated>2009-10-28T04:03:37.630-07:00</updated><title type='text'>Big-Step Normalisation</title><content type='html'>I realized that the idea of &lt;a href="http://polaro.blogspot.com/2009/10/normalization-by-evaluation.html"&gt;the previous post&lt;/a&gt; of factoring normalization as a translation to and from a syntactic model of normal forms is explored very nicely in a JFP article by Altenkirch and Chapman, indeed with a concrete environment semantics, albeit without a connection to focusing:&lt;br /&gt;&lt;br /&gt;"Big-Step Normalisation"&lt;br /&gt;Thorsten Altenkirch and James Chapman&lt;br /&gt;&lt;a href="http://cs.ioc.ee/~james/PUBLICATION_files/tait2.pdf"&gt;pdf&lt;/a&gt;&lt;br /&gt;Abstract:&lt;br /&gt;Traditionally, decidability of conversion for typed λ-calculi is established by showing that small-step reduction is conﬂuent and strongly normalising. Here we investigate an alternative approach employing a recursively defined normalisation function which we show to be terminating and which reﬂects and preserves conversion. We apply our approach to the simply-typed λ-calculus with explicit substitutions and βη-equality, a system which is not strongly normalising. We also show how the construction can be extended to System T with the usual β-rules for the recursion combinator. Our approach is practical, since it does verify an actual implementation of normalisation which, unlike normalisation by evaluation, is ﬁrst order. An important feature of our approach is that we are using logical relations to establish equational soundness (identity of normal forms reﬂects the equational theory), instead of the usual syntactic reasoning using the Church-Rosser property of a term rewriting system.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-5377072799554620208?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/5377072799554620208/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=5377072799554620208' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/5377072799554620208'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/5377072799554620208'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2009/10/big-step-normalisation.html' title='Big-Step Normalisation'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-936850434738446239</id><published>2009-10-11T11:56:00.000-07:00</published><updated>2009-10-11T14:30:59.124-07:00</updated><title type='text'>Normalization-By-Evaluation, Normalization-By-Focusing</title><content type='html'>So I've moved to Paris.  I finally arrived here last week (after a bit of a summer vacation), to begin a post-doc at Université Paris 7.  In addition to my host &lt;a href="http://www.pps.jussieu.fr/%7Emellies/"&gt;Paul-André Melliès&lt;/a&gt;, there is a ridiculous number of people based here doing exciting work in programming and proof theory, and also quite a few visitors.  So I'm excited.&lt;br /&gt;&lt;br /&gt;One of my goals with this post-doc is to better connect the general approach to logic and programming that I was trained in at CMU, which could be called a "syntactic" approach, to the more semantic approach prevalent in Europe.  "Syntactic" is in scare quotes because it is sometimes used as a derogatory term, slightly gentler than the epithet "symbol-pushing", and I don't think it is really appropriate.  Of course &lt;i&gt;I&lt;/i&gt; wouldn't think so!  But there's a burden of proof in explaining how this thing that looks like symbol-pushing to the outside world is actually just another way (and a useful way) of manipulating semantic content.&lt;br /&gt;&lt;br /&gt;So this post is in that vein, and was prompted by hearing &lt;a href="http://www.lix.polytechnique.fr/%7Edanko/"&gt;Danko Ilik&lt;/a&gt; (one of &lt;a href="http://pauillac.inria.fr/%7Eherbelin/"&gt;Hugo Herbelin&lt;/a&gt;'s students) give a talk two days ago about &lt;a href="http://en.wikipedia.org/wiki/Normalisation_by_evaluation"&gt;Normalization-By-Evaluation&lt;/a&gt; (NBE), and its apparently well-known (but I guess not well-known enough, since I hadn't seen it before) connection to &lt;a href="http://en.wikipedia.org/wiki/Kripke_semantics"&gt;Kripke semantics&lt;/a&gt; for intuitionistic logic.  The connection is extremely easy to state:&lt;br /&gt;&lt;center&gt;&lt;br /&gt;NBE = completeness ○ soundness&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;That is, constructively speaking, NBE for the lambda calculus (a.k.a. a proof system for intuitionistic logic) corresponds to applying the soundness theorem (if something is provable it is true in every Kripke model) followed by the completeness theorem (if something is true in every Kripke model then it is provable).  More precisely, the soundness theorem is applied to bring a lambda term into the &lt;i&gt;universal&lt;/i&gt; model of contexts ordered by inclusion, and then the completeness theorem takes it back into the lambda calculus, now in normal form.  Darin Morrison recently posted some &lt;a href="http://www.cs.nott.ac.uk/%7Edwm/nbe/html/NBE.html"&gt;elegant code&lt;/a&gt; to the Agda mailing list, demonstrating this explicitly.&lt;br /&gt;&lt;br /&gt;Okay, that's neat, now let's talk about something else: focusing.  If you are reading this blog you have probably heard something about it.  (If not, you can learn about it &lt;a href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.25.1142"&gt;here&lt;/a&gt; or &lt;a href="http://iml.univ-mrs.fr/%7Egirard/0.pdf.gz"&gt;here&lt;/a&gt; or &lt;a href="http://perso.ens-lyon.fr/olivier.laurent/llfoc.ps.gz"&gt;here&lt;/a&gt; or &lt;a href="http://www.lix.polytechnique.fr/%7Ekaustuv/assets/papers/chaudhuri06thesis.pdf"&gt;here&lt;/a&gt; or &lt;a href="http://www.cs.cmu.edu/%7Edrl/pubs/lzh08focbind/lzh08focbind.pdf"&gt;here&lt;/a&gt; or &lt;a href="http://www.cs.cmu.edu/%7Enoam/thesis.pdf"&gt;here&lt;/a&gt;.)  Originally, focusing was conceived as a search strategy for linear logic sequent calculus, achieving efficiency by severely restricting when you could apply the different rules, based on the &lt;i&gt;polarity&lt;/i&gt; of connectives (positive ⊗, ⊕, !, ∃, versus negative ⅋, &amp;amp;, ?, ∀).  The surprising and important result was that this strategy is complete, i.e.:&lt;br /&gt;&lt;br /&gt;THEOREM (Completeness of focusing) [Andreoli]: If the sequent Γ ⊢ Δ is provable in linear logic, then it has a focusing proof.&lt;br /&gt;&lt;br /&gt;The converse, soundness, is of course also important, but was obvious in Andreoli's original formulation, where focusing was seen as a &lt;i&gt;search&lt;/i&gt; strategy, and a focusing proof was just a special sort of sequent proof.&lt;br /&gt;&lt;br /&gt;Nonetheless, we have soundness and completeness theorems.  Great! Can we compose them?&lt;br /&gt;&lt;br /&gt;Well, let's not go there quite yet...&lt;br /&gt;&lt;br /&gt;First, let's move away from linear logic, which may seem exotic, to something more mundane: classical propositional logic.  Is there a notion of focusing proofs in classical logic?  In fact, there are too many.  Whereas the polarities of the connectives of linear logic are all somehow fixed by their inference rules, in classical logic there are many different, equally valid possibilities for inference rules, and as a result the propositional connectives are fundamentally bipolar.  The flip side is that the classical connectives can be explicitly &lt;i&gt;polarized&lt;/i&gt;, e.g.., we can choose whether to treat conjunction ∧ positively as ⊗, or negatively as &amp;amp;, and similarly with disjunction, negation, and implication.  And this act of disambiguation endows the classical connectives with constructive content.&lt;br /&gt;&lt;br /&gt;How so?&lt;br /&gt;&lt;br /&gt;Well, let's take another look at the soundness and completeness theorems for focusing.  Since focusing proofs deal with explicitly polarized propositions, and ordinary (classical) proofs don't, we will relate the two notions via an operation |-| that "forgets" polarity, i.e., collapses ⊗ and &amp; both to plain conjunction, ⅋ and &amp;amp; both to plain disjunction, etc.  Then we can state the following:&lt;br /&gt;&lt;br /&gt;THEOREM (Classical soundness of focusing): If the sequent Γ ⊢ Δ has a focusing proof, then |Γ| ⊢ |Δ| has an ordinary classical proof.&lt;br /&gt;&lt;br /&gt;THEOREM (Classical completeness of focusing): If the sequent |Γ| ⊢ |Δ| has an ordinary classical proof, then Γ ⊢ Δ has focusing proof.&lt;br /&gt;&lt;br /&gt;So &lt;i&gt;now&lt;/i&gt; can we compose?  &lt;br /&gt;&lt;br /&gt;Again speaking more constructively, suppose we take as our starting point some version of classical natural deduction, e.g., natural deduction adjoined with reductio ad absurdum, or with Peirce's law, a.k.a. &lt;a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.102.8007&amp;rep=rep1&amp;type=pdf"&gt;lambda calculus with control operators&lt;/a&gt;.  And suppose we have a proof (program) establishing (inhabiting) some proposition (type).  Now, to apply the completeness theorem to obtain a focusing proof/program, crucially, we must choose some polarization of the connectives.  What we obtain by applying the completeness theorem can and will depend on the particular polarization.  But then, once we have a focusing derivation, we can again obtain a classical derivation in a deterministic way, by applying the soundness theorem.&lt;br /&gt;&lt;br /&gt;And what do we get as a result?  Well, we can make two observations:&lt;br /&gt;&lt;br /&gt;1. The result is in normal form.  I.e., it corresponds to a β-reduced, η-expanded lambda term (or a sequent calculus proof without cuts and with only atomic initial axioms).&lt;br /&gt;2. The result is in continuation-passing style (CPS).&lt;br /&gt;&lt;br /&gt;And in fact, the choice we made when applying the completeness theorem—the way we polarized the connectives—is precisely the way we choose among the many different CPS translations, call-by-value vs call-by-name, etc.&lt;br /&gt;&lt;br /&gt;[Aside: it is well-known that different CPS transformations correspond to different double-negation translations, proof-theoretically.  This may seem at odds with the above statement, since the result of applying completeness followed by soundness is still a proof of the original sequent, not a double-negated sequent.  But we can make the connection to double-negation translation more transparent by factoring the soundness theorem by way of &lt;i&gt;minimal&lt;/i&gt; logic, i.e, the fragment of intuitionistic logic where negation is defined by ¬A = A ⊃ #, for some distinguished atom #.  The soundness theorem is then stated as follows:&lt;br /&gt;&lt;br /&gt;THEOREM (Minimal soundness of focusing): If the sequent Γ ⊢ Δ has a focusing proof, then Γ^t, Δ^f ⊢ # has an ordinary minimal proof.&lt;br /&gt;&lt;br /&gt;Here, -^t is the operation that interprets positive connectives "directly" (i.e., conjunction as conjunction, disjunction as disjunction, etc.) and interprets negative connectives as the negation of their De Morgan duals, while -^f interprets negative connectives as their duals, and positive connectives as their negations.  Now, the result of applying the classical completeness theorem followed by minimal soundness, followed by the inclusion of minimal logic into classical logic, is not necessarily the original sequent, but a (classically) equivalent one.  For more details, see Chapters 3 and 4 of &lt;a href="http://www.cs.cmu.edu/%7Enoam/thesis.pdf"&gt;my thesis&lt;/a&gt;.]&lt;br /&gt;&lt;br /&gt;In short, by composing the soundness and completeness theorems for focusing, we obtain a normalization procedure for a proof system/programming language, that moreover fixes an evaluation order based on the polarization.  We could call this "Normalization-By-Focusing":&lt;br /&gt;&lt;center&gt;&lt;br /&gt;NBF = soundness ○ completeness&lt;br /&gt;&lt;/center&gt;&lt;br /&gt;So how does this compare to the original equation, NBE = completeness ○ soundness?  First, observe that the fact that the positions of soundness and completeness are swapped is purely a historical convention!  Since focusing was originally conceived as a search strategy for sequent calculus, it made sense to ask that it be complete.  But in any case, it is clear that the focusing completeness theorem is playing a role analogous to the Kripke soundness theorem, and the focusing soundness theorem a role analogous to the Kripke completeness theorem.  In other words, in both cases we are going out of a formal system with some arbitrary collection of rules, into a very well-behaved system, and then back into a canonical fragment of the original system.&lt;br /&gt;&lt;br /&gt;In other words, I think it is entirely accurate to say that focusing provides a &lt;i&gt;semantics&lt;/i&gt; of proofs.  And a &lt;a href="http://en.wikipedia.org/wiki/Proof-theoretic_semantics"&gt;proof-theoretic semantics&lt;/a&gt; at that.&lt;br /&gt;&lt;br /&gt;But how does it really relate to other semantic approaches?  Again, that's what I'm here to find out.  I suspect, though, that there's more than a superficial resemblance between the NBE and NBF equations, and there might be a deeper connection between focusing and the technique of &lt;a href="http://www.andrew.cmu.edu/user/avigad/Papers/forcing.pdf"&gt;forcing in proof theory&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-936850434738446239?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/936850434738446239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=936850434738446239' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/936850434738446239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/936850434738446239'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2009/10/normalization-by-evaluation.html' title='Normalization-By-Evaluation, Normalization-By-Focusing'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-7057915982235531744</id><published>2009-09-30T14:31:00.000-07:00</published><updated>2009-09-30T14:42:59.869-07:00</updated><title type='text'>More on LOGICOMIX, from Richard Zach</title><content type='html'>Richard Zach of &lt;a href="http://www.ucalgary.ca/~rzach/logblog/index.html"&gt;LogBlog&lt;/a&gt; also wrote a &lt;a href="http://www.ucalgary.ca/~rzach/logblog/2009/09/logicomix-epic-search-for-truth.html"&gt;review of Logicomix&lt;/a&gt; last week, and today followed up specifically addressing the novel's theme of &lt;a href="http://www.ucalgary.ca/~rzach/logblog/2009/09/logic-and-madness.html"&gt;Logic and Madness&lt;/a&gt;.  This was something I left out of &lt;a href="http://polaro.blogspot.com/2009/09/review-of-logicomix.html"&gt;my review&lt;/a&gt;, but like Zach, I was similarly turned off by the novel's insinuations of a positive correlation.  Both posts by Zach point out several historical inaccuracies in Logicomix, where the novel overstates the "madness" of various logicians—important to keep in mind when reading Logicomix (which you should, nonetheless...).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-7057915982235531744?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/7057915982235531744/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=7057915982235531744' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/7057915982235531744'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/7057915982235531744'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2009/09/more-on-logicomix-from-richard-zach.html' title='More on LOGICOMIX, from Richard Zach'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-3215575768792932669</id><published>2009-09-15T15:26:00.000-07:00</published><updated>2009-09-16T02:12:16.105-07:00</updated><title type='text'>Review of LOGICOMIX</title><content type='html'>I was in New York City yesterday visiting the French consulate, on a mission to obtain a scientific visa (my second attempt).  The bus from Rochester got into Chinatown around 7:45am, so I made it to the consulate by 9am, got in line, handed in my documents, had a few pictures/fingerprints taken, and was told to come back at 3pm to pick up a visa.  With a few hours to kill in the city, I set out on another mission: to find a copy of Logicomix!&lt;br /&gt;&lt;br /&gt;&lt;i&gt;LOGICOMIX: an Epic Search for Truth&lt;/i&gt;&lt;br /&gt;Apostolos Doxiadis and Christos H. Papadimitriou&lt;br /&gt;art by Alecos Papadatos and Annie di Donna&lt;br /&gt;&lt;a href="http://www.logicomix.com/"&gt;http://www.logicomix.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;First, a note on availability.  This book was just released to the public in English, I believe a little over a week ago.  The UK edition is currently &lt;a href="http://www.amazon.com/gp/product/0747597200/"&gt;sold out&lt;/a&gt;, and the US edition is only available for pre-order on Amazon.  So the odds of my finding a copy were perhaps not so good.  On the other hand, New York City has the &lt;a href="http://en.wikipedia.org/wiki/Strand_Bookstore"&gt;Strand Bookstore&lt;/a&gt;.  With a bit of luck and perserverance, I managed to track down their only copy, which they received two [sic!] days ago (they are ordering more).  I finished reading it on the train ride back to Rochester.&lt;br /&gt;&lt;br /&gt;Second, a disclaimer: I had ridiculously high expectations for this book.  It has been at the top of my wishlist for years.  Anticipation for Logicomix has been floating around the net since the first half of the decade, based on its basic premise: a comic book about logic and logicians.  For example, you can find &lt;a href="http://wadler.blogspot.com/2005/08/logicomix.html"&gt;Philip Wadler drooling about the idea&lt;/a&gt; back in the summer of 2005.  I don't remember when I first found out about Logicomix, but it was a while before that (looking back at old email archives, it seems to have been May 2004), sometime after I heard about Papadimitriou's first work of fiction, &lt;a href="http://books.google.com/books?id=QJyX175VCj8C&amp;lpg=PP1&amp;dq=turing%20a%20novel%20about%20computation&amp;pg=PP1#v=onepage&amp;q=&amp;f=false"&gt;Turing: a novel about computation&lt;/a&gt; (which is a very fun book, by the way, basically a sci-fi thriller with some computer science lessons thrown in, and some pretty hot sex scenes).&lt;br /&gt;&lt;br /&gt;Given all this anticipation built on the idea of Logicomix, reading the actual Logicomix was bound to be somewhat of a let-down.  In a word, I was hoping for something impossibly &lt;i&gt;EPIC&lt;/i&gt;.  Let me say, though, that I still think Logicomix is a revolutionary book, with a brilliant premise that is very well executed but for a few flaws.  The premise is basically this: to convey the drama of the late 19th-/early 20th-century upheavals in mathematics and logic, focusing on the &lt;i&gt;people&lt;/i&gt; involved, but also giving a sense of their &lt;i&gt;ideas&lt;/i&gt;, and of the passion behind the debate.  The driving plot force is the life story of Bertrand Russell, and his (at times fictitious) interactions with some of logic's other major and minor figures.&lt;br /&gt;&lt;br /&gt;Logicomix &lt;i&gt;is&lt;/i&gt; epic in ambition.  In some form or another, the book looks at topics including: Euclid's Elements, Cantor's set theory, Boolean algebra, Leibniz's calculus ratiocinator, the 1900 International Congress of Mathematicians and Hilbert's problems, the Epimenides paradox and Russell's paradox, Frege's Begriffsschrift and the Foundations of Arithmetic, Principia Mathematica, simple and ramified type theory, Wittgenstein's Tractatus and the picture theory of language, the Vienna Circle, logical positivism, and the murder of Moritz Schlick, Godel's first incompleteness theorem, algorithms, atheism, World Wars I and II, pacifism, pedagogy, the connection between logic and madness, Aeschylus, street crime in Athens, and free love.  And it tries to examine all this as a &lt;i&gt;graphic novel&lt;/i&gt;, taking full advantage of the genre's literary/artistic conventions, such as flashbacks and self-reference.  The latter fits in well with the subject matter (e.g., Papadamitriou's character asks in the book, "Suppose now you make a complete catalogue of all books that are *not* self-referential"...), but also, more significantly, gives rise to a parallel story relating the intellectual process of writing the book, showing how Logicomix grew through the authors' own debates and discoveries.  Finally, a brief appendix at the end tries to fill in some of the historical/mathematical background for the story with a few traditional but well-written articles.&lt;br /&gt;&lt;br /&gt;Now, please stop.&lt;br /&gt;&lt;br /&gt;Go find a copy of Logicomix (don't worry, they're out there), and read it!  You will enjoy it.&lt;br /&gt;&lt;br /&gt;I do think the book has flaws, though.  I was hoping for Logicomix to do &lt;i&gt;more&lt;/i&gt;, but I think in reality it tries to do too much, leaving too much unresolved.  There is no doubt something intentional here on the part of the authors, in reference to their subject matter.  A chunk of the story revolves around the arduous task of writing the Principia, and how Whitehead after ten years finally convinces Russell to publish their manuscript, even in its unfinished, very imperfect state.  Through the self-referential segments of Logicomix, it is strongly implied that the authors had similar discussions of their own.  But of course that's not an excuse!  I would have liked to have seen some of the historical characters fleshed out more, and could have used less of the "behind the scenes" with the writers.  The latter had the feeling of unedited transcripts&amp;mdash;again, this was certainly intentional, but I felt it took away from the intensity of the main story.  Similarly, I didn't like the overall framing device of having Bertrand Russell relate his life story at a public lecture on "The Role of Logic in Human Affairs": again, because it dilutes the action through another level of indirection, and also because it is a completely implausible lecture.  (There are a few other moments where the authors take artistic license with history, which can be a bit grating if you are familiar with the history.)  Finally, it seems that the authors didn't know how to end the novel; Logicomix fades away in a highly unsatisfying way.&lt;br /&gt;&lt;br /&gt;That said, I am very very happy that Logicomix is finally in print.  I am waiting for the sequel.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-3215575768792932669?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/3215575768792932669/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=3215575768792932669' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/3215575768792932669'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/3215575768792932669'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2009/09/review-of-logicomix.html' title='Review of LOGICOMIX'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-8277185933243215647</id><published>2009-07-10T02:32:00.000-07:00</published><updated>2009-07-10T02:48:08.105-07:00</updated><title type='text'>Defunctionalizing proofs (revised + extended edition)</title><content type='html'>I wrote a paper that elaborates and improves upon the basic idea &lt;a href="http://polaro.blogspot.com/2009/01/defunctionalizing-proofs-and-how-to.html"&gt;I talked sketchily about some months ago&lt;/a&gt;, of applying defunctionalization towards a formal representation of "Ω-rules" in Twelf, with applications to pattern-matching and cut-elimination.  The paper was accepted to &lt;a href="http://www.lix.polytechnique.fr/~lengrand/Events/PSTT09/"&gt;Proof Search in Type Theory&lt;/a&gt;, next month in Montreal.&lt;br /&gt;&lt;br /&gt;Text: &lt;a href="http://www.cs.cmu.edu/~noam/papers/defunct.pdf"&gt;pdf&lt;/a&gt;&lt;br /&gt;Code: &lt;a href="http://www.cs.cmu.edu/~noam/code/defocus.lf"&gt;twelf&lt;/a&gt;&lt;br /&gt;Abstract:&lt;br /&gt;In previous work, the author gave a higher-order analysis of focusing proofs (in the sense of Andreoli’s search strategy), with a role for infinitary rules very similar in structure to Buchholz’s Ω-rule. Among other benefits, this “pattern-based” description of focusing simpliﬁes the cut-elimination procedure, allowing cuts to be eliminated in a connective-generic way. However, interpreted literally, it is problematic as a representation technique for proofs, because of the difficulty of inspecting and/or exhaustively searching over these infinite objects. In the spirit of infinitary proof theory, this paper explores a view of pattern-based focusing proofs as façons de parler, describing how to compile them  down to first-order derivations through defunctionalization, Reynolds’ program transformation. Our main result is a representation of pattern-based focusing in the Twelf logical framework, whose core type theory is too weak to directly encode infinitary rules—although this weakness directly enables so-called “higher-order abstract syntax” encodings. By applying the systematic defunctionalization transform, not only do we retain the beneﬁts of the higher-order focusing analysis, but we can also take advantage of HOAS within Twelf, ultimately arriving at a proof representation with surprisingly little bureaucracy.&lt;br /&gt;&lt;br /&gt;&lt;hrule&gt;&lt;br /&gt;This is very much work in progress&amp;mdash;comments much appreciated!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-8277185933243215647?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/8277185933243215647/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=8277185933243215647' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/8277185933243215647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/8277185933243215647'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2009/07/defunctionalizing-proofs-revised.html' title='Defunctionalizing proofs (revised + extended edition)'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-7919402754518291736</id><published>2009-07-03T19:13:00.000-07:00</published><updated>2009-07-03T19:54:47.059-07:00</updated><title type='text'>The Value of the Free Man</title><content type='html'>I found this political lecture by Albert Einstein (delivered before "The Friends of Europe" in London) in an old magazine (World Digest, April 1934), while &lt;a href="http://rochester.craigslist.org/vol/1207095664.html"&gt;sorting through piles and piles of books&lt;/a&gt;.  As far as I can tell it does not exist online, so I transcribed it and am placing it here (and &lt;a href="http://www.cs.cmu.edu/~noam/the-value-of-the-free-man.txt"&gt;here&lt;/a&gt;):&lt;br /&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;center&gt;&lt;b&gt;The Value of the Free Man&lt;/b&gt;&lt;/center&gt;&lt;br /&gt;&lt;br /&gt;Modern life is worth while because the individual guaranteed the possibility of free development, free communication, free religion, and, as far as the well-being of human society permits, free initiative of action.&lt;br /&gt;&lt;br /&gt;Nobody can deny that to-day this foundation of a worthy existence is in considerable danger.  Forces are at work which are attempting to destroy the European inheritance of freedom, tolerance, and human dignity.  The danger is characterised as Hitlerism, Militarism, and Communism which, while indicating different conditions, all lead to the subjugation and enslavement of the individual by the State, and bring tolerance and personal liberty to an end.&lt;br /&gt;&lt;br /&gt;When I speak of Europe, I do not mean the geographical conception of Europe, but a certain attitude of life and to society which has grown up in Europe and is characteristic of our civilisation.&lt;br /&gt;&lt;br /&gt;I mean the spirit which was born in ancient Greece and, more than a thousand years later, at the time of the Renaissance, spread from Italy: the spirit of personal liberty and regard for the individual. &lt;br /&gt;&lt;br /&gt;If to-day our knowledge of natural laws and the technical possibilities for the advancement of our lives have reached such perfection as never before in the known history of mankind, we owe this to the fact that only the individual can really create what is new and worthwhile.&lt;br /&gt;&lt;br /&gt;Without such freedom there would have been no Shakespeare, no Goethe, no Newton, no Faraday, no Pasteur, and no Lister.&lt;br /&gt;&lt;br /&gt;There would be no comfortable houses for the mass of the people, no railway, no wireless, no protection against epidemics, no cheap books, no culture and no enjoyment of art for all.&lt;br /&gt;&lt;br /&gt;There would be no machines to relieve the people from the arduous labour needed for the production of the necessities of life.&lt;br /&gt;&lt;br /&gt;It cannot be my task to act as judge of the conduct of a nation from the point of view of statesmen or as one who is immersed in the responsibilities and the details of the daily life of politics.&lt;br /&gt;&lt;br /&gt;Yet everyone who loves the subtler manifestations and the beauty of the human spirit, and who believes himself able to diagnose the deeper causes of the present situation, has the duty of raising his voice in warning.&lt;br /&gt;&lt;br /&gt;For if we do not make energetic resistance, we shall sink back into a way of life which is indistinguishable from that of the subjects of the old Asiatic despotisms.&lt;br /&gt;&lt;br /&gt;It will be worse than theirs, for the modern despots, while not disposing of more brains than their former colleagues, own the arm---and it is a long and strong arm---of a mighty technical apparatus for the exercise of physical power, and in their schools, radio, and press they possess an instrument of mental and moral influence which ordinary mortals cannot resist.&lt;br /&gt;&lt;br /&gt;It is of the essence of despotism not only that one individual with practically unlimited authority is at the head, but that society itself becomes the tool of the enslavement of the individual.&lt;br /&gt;&lt;br /&gt;I would therefore much rather call the enemy of the European spirit "Servitude to the State."&lt;br /&gt;&lt;br /&gt;This servitude exists when the State is not an instrument in the hands of the citizens, as it ought to be, but when the citizens are in practice unconditionally delivered over to the power of the State. This condition is expressed in the German language by speaking of the population as "human material" (Menschenmaterial).&lt;br /&gt;&lt;br /&gt;What is it that converts the free European into a slave of the State? My simple answer is: the necessity of military organisation on the part of each separate State.  In other words, the cause is international juridical anarchy.  I believe that the German has become the complete victim of the State because his country, by its geographical condition, is most exposed to attack, and was therefore most dependent on rigid military organisation.&lt;br /&gt;&lt;br /&gt;But military organisation means degradation of the individual to an obedient tool, void of will.  It demands the training of youth into an automatic and uncritical obedience towards a superior.&lt;br /&gt;&lt;br /&gt;In short, it implies the renunciation of personality and human worth.&lt;br /&gt;&lt;br /&gt;The petty persons who to-day govern Germany owe their power mainly to the education of former generations in a spirit of submissiveness and servility, a state of mind which is diametrically opposed to the consciousness of personal responsibility of the true European man.&lt;br /&gt;&lt;br /&gt;If it be true that individuality as the basis of the European ideal is gravely menaced by the necessity for military organisation of the several separate States, there can be no doubt as to how the danger may, and must be, overcome.&lt;br /&gt;&lt;br /&gt;The separate State must be offered an effective guarantee for its security in relation to neighbouring States.&lt;br /&gt;&lt;br /&gt;Disarmament according to a fixed plan without guarantee of security by the entire community of States is impossible, if for no other reason than that to-day war is not a society-game where one can be sure that everything will go according to rule.&lt;br /&gt;&lt;br /&gt;On this main issue of how to win through to civilisation, therefore, I share entirely the French point of view.&lt;br /&gt;&lt;br /&gt;I am also convinced that a universal collective guarantee for the security of individual States is in itself by no means enough.&lt;br /&gt;&lt;br /&gt;The military organisations of the separate States ought to be internationalised, that is, transformed into an international police force subject to a super-national authority.&lt;br /&gt;&lt;br /&gt;If the reader thinks this Utopian, he may, for comparison, imagine a State in which there are no police and no courts.  In their place a law exists which makes it compulsory for every citizen to help his fellow-citizen with whom a third citizen dares to interfere.  Do you believe that the citizens of such a State would desist from carrying their own weapons about with them?  I doubt it.&lt;br /&gt;&lt;br /&gt;The serious efforts of the Governments which have led to the Disarmament Conference show that there exists a general awareness of the danger in which we live.  In the light of the foregoing, lack of success is not difficult to understand.  There are problems which cannot be brought to solution by small steps and stages.&lt;br /&gt;&lt;br /&gt;Either the security of States is guaranteed internationally, in which case the separate State needs no military organisation at all, or this guarantee is not achieved, in which case the State must arm as effectively and completely as possible.&lt;br /&gt;&lt;br /&gt;Nationalism in my opinion is, in this respect, no more than an idealistic basis for the militarist and aggressive mental condition of a people.&lt;br /&gt;&lt;br /&gt;Hitlerism is a form of State thoroughly adapted to military purposes. This is so true that a "leader" can only hold himself in power by behaving aggressively, at least in appearance, in foreign relations, for he must always hold before the eyes of his people the real or imaginary purpose for which they are asked to sacrifice their freedom.&lt;br /&gt;&lt;br /&gt;Only through perils and upheavals can nations be brought to further developments.  It is in times of economic distress such as are experienced everywhere to-day, that one sees very clearly the strength of the moral forces which reside in a people.&lt;br /&gt;&lt;br /&gt;Let us hope that a historian, delivering judgment in some future period when Europe is politically and economically united, will be able to say that in our days the liberty and honour of this Continent were saved by its Western nations.&lt;br /&gt;&lt;br /&gt;Let him be able to say they stood fast together against the temptations of hatred and oppression, and that the Western world defended successfully the liberty of the individual, without which life to a self-respecting man is not worth living.&lt;br /&gt;&lt;br /&gt;The leading statesmen are burdened with tremendous responsibilities to-day as they were twenty years ago.&lt;br /&gt;&lt;br /&gt;May they succeed through timely agreement in establishing a condition of unity and clarity of international obligations in Europe, so that to every State a war-like adventure must appear foredoomed as utterly hopeless.&lt;br /&gt;&lt;br /&gt;But we are concerned not merely with the technical problem of securing and maintaining peace, but also with the important task of education and enlightenment.  If we want to resist the powers which threaten to suppress intellectual and individual freedom, we must keep clearly before us what is at stake, and what we owe to that freedom which our ancestors won for us after hard struggles.&lt;br /&gt;&lt;br /&gt;Thus, the work of statesmen can succeed only if it is supported by the serious and determined will of the peoples.  And the essence of that will is the creative adventure of free citizens.&lt;br /&gt;&lt;br /&gt;I know very many people who are willing to approve in principle opinions such as have been expressed here, but who will fall back the next moment into the ruts of ordinary political action.&lt;br /&gt;&lt;br /&gt;But he who is seriously convinced that the future growth of our civilisation is bound up with the preservation and development of the human personality, must be prepared to make sacrifices for his convictions.&lt;br /&gt;&lt;br /&gt;The sacrifice I am thinking of is the partial abandonment of State sovereignty by the separate States, and the yielding of the principle of egoism in favour of international security.&lt;br /&gt;&lt;br /&gt;Here lies the hope of Europe and the Western world.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-7919402754518291736?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/7919402754518291736/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=7919402754518291736' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/7919402754518291736'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/7919402754518291736'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2009/07/value-of-free-man.html' title='The Value of the Free Man'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-2399311161764110766</id><published>2009-06-08T15:39:00.000-07:00</published><updated>2009-06-08T20:37:23.459-07:00</updated><title type='text'>The Proofs of Life After Death: a 20th Century Symposium</title><content type='html'>Browsing in the local history section of the &lt;a href="http://rocwiki.org/Rundel_Memorial_Library_Building"&gt;Central Library&lt;/a&gt; in Rochester, NY, I stumbled on this curious book from 1902:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_8_mM8k3BkRU/Si2UnLPWcnI/AAAAAAAAD24/rtKQAB2iwjw/s1600-h/life-after-death.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 254px; height: 400px;" src="http://2.bp.blogspot.com/_8_mM8k3BkRU/Si2UnLPWcnI/AAAAAAAAD24/rtKQAB2iwjw/s400/life-after-death.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5345091733511631474" /&gt;&lt;/a&gt;&lt;br /&gt;Wonderfully, the full text is available online &lt;a href="http://books.google.com/books?id=12MAAAAAMAAJ&amp;dq=%22proofs+of+life+after+death%22&amp;printsec=frontcover&amp;source=bl&amp;ots=th6qV-fzmM&amp;sig=CsXEpFnaID36vI491GwO9RFQsAE&amp;hl=en&amp;ei=j4gtSs7YIozYM4-1gJ4G&amp;sa=X&amp;oi=book_result&amp;ct=result&amp;resnum=1#PPA7,M1"&gt;through google books&lt;/a&gt;.  The book is a collection of responses by various thoughtful people to the following request:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;Dear Sir:&lt;br /&gt;&lt;br /&gt;The Author of this letter, inspired by the untimely decease of a dear friend, and in contemplation of the numerous philosophical and logical theories leading to a belief in the continued existence of the soul, or personal identity after death, begs of you the great favor of a letter, setting out as briefly, or at such length as may be convenient, what you consider to be the strongest reason, or argument, advanced by science or philosophy, or by common sense, in favor of an affirmative answer to this mighty question; or preferably, a statement of your own deductions thereon.&lt;br /&gt;&lt;br /&gt;It is our desire to obtain from thinkers and educators of the world, an expression—a twentieth century bulletin, on this subject.&lt;br /&gt;&lt;br /&gt;Our request will impress you doubtless as an unusual one, but none the less will you see the force of it, and its possibilities. Who can measure the impetus such a compilation may have upon the inquiring human mind?&lt;br /&gt;&lt;br /&gt;May I not have your co-operation in this matter?&lt;br /&gt;&lt;br /&gt;Thanking you now in advance for the courtesy of a reply, I am&lt;br /&gt;&lt;br /&gt;Fraternally yours,&lt;br /&gt;ROBERT J. THOMPSON.&lt;br /&gt;&lt;br /&gt;Wellington Ave., Chicago, U. S. A.&lt;br /&gt;October, 1901. &lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;I had fun skimming through the first collection of responses, from "The Scientists".  The variety of responses is interesting.  Although there's the usual bloviation on the &lt;a href="http://en.wikipedia.org/wiki/Cosmological_argument"&gt;cosmological&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/Teleological_argument"&gt;teleological arguments&lt;/a&gt;, as well as some self-citations to studies confirming the existence of telepathy and other paranormal phenomena, there's also some healthy scientific modesty.  E.g., &lt;a href="http://en.wikipedia.org/wiki/%C3%89mile_Duclaux"&gt;E. Ducleaux&lt;/a&gt; writes,&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;Excuse me for not being able to help you in your investigation. I have no scientific opinion regarding the questions you put. I mean, no opinion that rests on anything but personal beliefs. Besides, I think that everybody is in about the same position and that any reasons that may be brought forth in favor of one's opinion are only good for the person that brings them forth, and that they cannot impress the listener; they are therefore not scientific reasons.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Dmitri_Mendeleev"&gt;D. I. Mend&amp;eacute;lieff&lt;/a&gt;'s response begins similarly, although he ends by arguing for the immortality of the soul by analogy with the laws of conservation of mass and energy (an analogy I was surprised to see repeated very often in the other responses!):&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;The question as to the continuance of the existence of the soul or personal identity after death, mentioned in your letter of August, 1901, I, as a natural philosopher, consider to be an hypothesis which cannot be proved by evidence of real facts.  But as a man educated in a religious sense, I prefer to remain in the belief of the immortality of the soul. It is my opinion that the philosophical side of the question consists in the relation between the soul, the natural forces, and matter; and if it were possible to clear up to some extent this feature of the problem---the relation between force and matter---then also the relation between the soul and natural forces would be forwarded to a great extent.&lt;br /&gt;&lt;br /&gt;The unquestionable existence of reason, will and consciousness compels us to acknowledge the existence of a special world of relations of this kind, and any rational conclusion in relation to this special world cannot be accepted as proved quite in the same manner.  Knowledge of physics and mechanics does not give anything in relation to chemistry or in relation to the existence of celestial bodies.&lt;br /&gt;&lt;br /&gt;We must simply confess that it is impossible to comprehend this question in a general way, but it would also be sheer nonsense to ignore the physical world; and as matter and natural forces must be acknowledged as eternal, it is also probable that the soul is eternal.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;But my favorite response was by James R. Nichols, marveling at the modern-day wonders of &lt;del&gt;Web 2.0&lt;/del&gt; the telephone:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;Do we not every day converse with unseen friends long distances away; do we not recognize their familiar voices, in homes separated from us by rivers, woods, and mountains?  These voices come out of the darkness, guided by a frail wire which science provides as a pathway.&lt;br /&gt;[...]&lt;br /&gt;If our friends in this life, dead to us (hidden as they are by the shroud of space), can be seen, and we can hear their voices, their shouts of laughter, the words of the hymns they sing, the cries of the little ones in the mother's arms, is it very absurd to anticipate a time when those dead to us by the dissolution of the body may, by some unknown telephony, send to us voices from a realm close at hand, but hidden from mortal vision?&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-2399311161764110766?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/2399311161764110766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=2399311161764110766' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/2399311161764110766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/2399311161764110766'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2009/06/proofs-of-life-after-death-20th-century.html' title='The Proofs of Life After Death: a 20th Century Symposium'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_8_mM8k3BkRU/Si2UnLPWcnI/AAAAAAAAD24/rtKQAB2iwjw/s72-c/life-after-death.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-8348221328032435879</id><published>2009-05-08T10:11:00.000-07:00</published><updated>2009-05-08T14:56:51.087-07:00</updated><title type='text'>The Logical Basis of Evaluation Order and Pattern-Matching</title><content type='html'>&lt;a href="http://www.cs.cmu.edu/~noam/thesis.pdf"&gt;The Logical Basis of Evaluation Order and Pattern-Matching&lt;/a&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;An old and celebrated analogy says that writing programs is like proving theorems.  This analogy has been productive in both directions, but in particular has demonstrated remarkable utility in driving progress in programming languages, for example leading towards a better understanding of concepts such as abstract data types and polymorphism.  One of the best known instances of the analogy actually rises to the level of an isomorphism: between Gentzen's natural deduction and Church's lambda calculus.  However, as has been recognized for a while, lambda calculus fails to capture some of the important features of modern programming languages.  Notably, it does not have an inherent notion of evaluation order, needed to make sense of programs with side effects.  Instead, the historical descendents of lambda calculus (languages like Lisp, ML, Haskell, etc.) impose evaluation order in an ad hoc way.&lt;br /&gt;&lt;br /&gt;This thesis aims to give a fresh take on the proofs-as-programs analogy---one which better accounts for features of modern programming languages---by starting from a different logical foundation.  Inspired by Andreoli's &lt;i&gt;focusing proofs&lt;/i&gt; for linear logic, we explain how to axiomatize certain canonical forms of logical reasoning through a notion of &lt;i&gt;pattern.&lt;/i&gt;  Propositions come with an intrinsic &lt;i&gt;polarity,&lt;/i&gt; based on whether they are defined by patterns of proof, or by patterns of refutation.  Applying the analogy, we then obtain a programming language with built-in support for pattern-matching, in which evaluation order is explicitly reflected at the level of types---and hence can be controlled locally, rather than being an ad hoc, global policy decision.  As we show, different forms of continuation-passing style (one of the historical tools for analyzing evaluation order) can be described in terms of different &lt;i&gt;polarizations.&lt;/i&gt;  This language provides an elegant, uniform account of both untyped and intrinsically-typed computation (incorporating ideas from infinitary proof theory), and additionally, can be provided an &lt;i&gt;extrinsic&lt;/i&gt; type system to express and statically enforce more refined properties of programs.  We conclude by using this framework to explore the theory of typing and subtyping for intersection and union types in the presence of effects, giving a simplified explanation of some of the unusual artifacts of existing systems.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Successfully defended April 17, 2009!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-8348221328032435879?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/8348221328032435879/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=8348221328032435879' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/8348221328032435879'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/8348221328032435879'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2009/05/logical-basis-of-evaluation-order-and.html' title='The Logical Basis of Evaluation Order and Pattern-Matching'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-373078627067406217</id><published>2009-02-04T21:59:00.000-08:00</published><updated>2009-02-04T22:05:37.182-08:00</updated><title type='text'>On the meaning of logical completeness</title><content type='html'>I would really like to have time to read &lt;a href="http://www.kurims.kyoto-u.ac.jp/~terui/meaning.pdf"&gt;this paper&lt;/a&gt; by Michele Basaldella and Kazushige Terui, as well as many of Terui's other highly interesting &lt;a href="http://www.kurims.kyoto-u.ac.jp/~terui/pub.html"&gt;recent papers&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-373078627067406217?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/373078627067406217/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=373078627067406217' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/373078627067406217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/373078627067406217'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2009/02/on-meaning-of-logical-completeness.html' title='On the meaning of logical completeness'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-7058938717418233319</id><published>2009-01-26T19:55:00.000-08:00</published><updated>2009-02-28T11:56:50.871-08:00</updated><title type='text'>Defunctionalizing Proofs (and how to define a pattern-matching, CPS language in Twelf)</title><content type='html'>I drove back from Savannah and POPL/PLPV/TLDI yesterday.  It was a long and exciting drive (in part because of the snow and frozen windshield washer fluid driving through West Virginia, god I hate that stretch of highway), and a long and exciting week at the conference.  My favorite talk was an invited one by &lt;a href="http://homepages.nyu.edu/%7Ecb125/"&gt;Chris Barker&lt;/a&gt; on &lt;a href="http://barker.linguistics.fas.nyu.edu/Stuff/barker-popl-abstract.pdf"&gt;Wild Control Operators&lt;/a&gt;, in the sense of "continuations in the wild".  Chris is a linguist who for several years (I think since around 2000) has been advocating the use of continuations to analyze apparently non-compositional phenomena in natural language.  He collaborates with brilliant computer scientist &lt;a href="http://www.cs.rutgers.edu/%7Eccshan/"&gt;Ken Shan&lt;/a&gt;, who wrote his PhD thesis on "Linguistic Side Effects".&lt;br /&gt;&lt;br /&gt;In this post I want to introduce some &lt;a href="http://www.cs.cmu.edu/~noam/code/focus.lf"&gt;Twelf code&lt;/a&gt; I wrote after getting back to Pittsburgh.  At the PLPV workshop I presented my paper on &lt;a href="http://www.cs.cmu.edu/%7Enoam/papers/rtcd.pdf"&gt;Refinement Types and Computational Duality&lt;/a&gt;.  I didn't exactly time the talk well, and ended up going through about half my slides in ten minutes past the allotted time.  (Luckily, I didn't run into Obama's talk, which was better prepared.)  The paper itself is similar in that respect, trying to rush through too much material in too short a space.  One of the ideas it describes probably too briefly is that of &lt;i&gt;defunctionalizing proofs&lt;/i&gt;.  Defunctionalization is a trick due to John Reynolds, from his paper on &lt;a href="http://www.brics.dk/%7Ehosc/local/HOSC-11-4-pp363-397.pdf"&gt;Definitional Interpreters for Higher-Order Programming Languages&lt;/a&gt;.  It allows you to take a program with higher-order functions and convert it into one with only first-order functions.  Essentially, it boils down to giving a unique tag to every function definition in your program, and then defining a separate "apply" function that tells you how to apply the function denoted by a tag to an argument.  (A complication is that function bodies may reference escaping variables, so defunctionalization has to be preceded by &lt;a href="http://en.wikipedia.org/wiki/Closure_conversion"&gt;closure conversion&lt;/a&gt;.)&lt;br /&gt;&lt;br /&gt;Why would &lt;i&gt;proofs&lt;/i&gt; contain functions in the first place?  For the same reason programs do: sometimes they are a useful abstraction.  An old example from proof theory comes in the work of Paul Lorenzen and Kurt Schütte, who in the 1950s began revisiting Gerhard Gentzen's work via infinitary methods (see &lt;a href="http://math.stanford.edu/~feferman/papers/bernays.pdf"&gt;"Lieber Herr Bernays!, Lieber Herr Gödel!"&lt;/a&gt; by Feferman for an interesting history).  Schütte simplified Gentzen's proof of cut-elimination for Peano arithmetic by replacing the usual schema of induction by the so-called ω-rule, which says, "To prove ∀x:ℕ.A(x), prove A(0), A(1), A(2), ...".  At first glance, the ω-rule seems silly: how can we ever apply a rule with infinitely many premises?  But a different way of looking at the ω-rule is that it demands a single &lt;i&gt;function&lt;/i&gt;, mapping natural numbers n to proofs of A(n).  And this function can certainly have a finite representation, for example as a C program.&lt;br /&gt;&lt;br /&gt;In &lt;a href="http://www.cs.cmu.edu/~noam/research/"&gt;some other papers&lt;/a&gt;, I described how to view Andreoli's "focusing" proofs as higher-order in this sense, containing functions that map &lt;i&gt;proof patterns&lt;/i&gt; (or refutation patterns) to other sorts of proof objects.  For example, to refute a proposition of &lt;i&gt;positive polarity&lt;/i&gt;, we build a function from proof patterns to proofs of contradiction.  This has a simple Curry-Howard interpretation: we can define &lt;i&gt;call-by-value&lt;/i&gt; continuations by functions from value patterns to expressions.  In other words, we actually represent the &lt;i&gt;syntax&lt;/i&gt; of a programming language using computation.&lt;br /&gt;&lt;br /&gt;Dependently-typed functional languages such as &lt;a href="http://wiki.portal.chalmers.se/agda/"&gt;Agda&lt;/a&gt; and &lt;a href="http://coq.inria.fr/"&gt;Coq&lt;/a&gt; turn out to be very convenient platforms for embedding such higher-order language definitions.  In the dependently-typed setting of &lt;a href="http://twelf.plparty.org/wiki/Main_Page"&gt;Twelf&lt;/a&gt;, frustratingly, it seems impossible!  This is surprising, at least in a superficial way, because Twelf is well-known for allowing language definition via "higher-order abstract syntax" (HOAS).  But HOAS is a different idea from the above technique (which I've taken to calling AHOS).  Essentially, the problem is that the function space of LF (the type-theoretic core of Twelf) is very weak: abstractly, a function A→B is just a B with a hole for an A, or in other words, A→B represents a &lt;i&gt;substitution function&lt;/i&gt;, something into which you can plug in an A to obtain a B.  This weakness is in fact crucial for doing HOAS.  But it means we absolutely cannot use the LF function space to do AHOS.  (Think, for example, what that would mean for the ω-rule: to prove ∀x:ℕ.A(x), we would have to give a proof of A(n) that &lt;i&gt;works the same way&lt;/i&gt; for every n.  But the predicate A might hold for different n for different reasons, so such a rule would be woefully incomplete.)  On the other hand, that we can't define languages using AHOS in Twelf is frustrating, because HOAS is rather nice for other parts of a language definition.&lt;br /&gt;&lt;br /&gt;Fortunately, it turns out we can have our AHOS and eat HOAS too!  And it all boils down to Reynolds' trick.  You can check out the code &lt;a href="http://www.cs.cmu.edu/~noam/code/focus.lf"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-7058938717418233319?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/7058938717418233319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=7058938717418233319' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/7058938717418233319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/7058938717418233319'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2009/01/defunctionalizing-proofs-and-how-to.html' title='Defunctionalizing Proofs (and how to define a pattern-matching, CPS language in Twelf)'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-1485029725693182643</id><published>2008-12-24T14:50:00.000-08:00</published><updated>2008-12-24T14:54:42.067-08:00</updated><title type='text'>bipolarism theory</title><content type='html'>Another &lt;a href="http://www.inu.edu.jo/Bi-Polarism%20Theory.htm"&gt;interesting conference&lt;/a&gt;, on &lt;i&gt;Bi-Polarism Theory and Mathematics is Inconsistent&lt;/i&gt;.  And while you're in the holiday spirit, check out &lt;a href="http://chrisamaphone.livejournal.com/671156.html"&gt;The Twelf Days of Christmas&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-1485029725693182643?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/1485029725693182643/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=1485029725693182643' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/1485029725693182643'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/1485029725693182643'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2008/12/bipolarism-theory.html' title='bipolarism theory'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-8370997338923792428</id><published>2008-12-04T14:16:00.000-08:00</published><updated>2008-12-04T14:18:06.959-08:00</updated><title type='text'>a conference dedicated to Per Martin-Löf on the occasion of his retirement</title><content type='html'>This promises to be &lt;a href="http://www.math.uu.se/PFM/"&gt;a very exciting conference&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-8370997338923792428?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/8370997338923792428/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=8370997338923792428' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/8370997338923792428'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/8370997338923792428'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2008/12/conference-dedicated-to-per-martin-lf.html' title='a conference dedicated to Per Martin-Löf on the occasion of his retirement'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-5839667412646080496</id><published>2008-11-18T20:45:00.000-08:00</published><updated>2008-11-18T22:08:48.850-08:00</updated><title type='text'>lies and updates</title><content type='html'>So in case you haven't realized, those &lt;a href="http://polaro.blogspot.com/2008/07/refinement-types-and-computational.html"&gt;promises&lt;/a&gt; to post more on this blog were just lies.  Not gonna happen.  But in the hope of generating a bit more content, and also to give this blog a more Web 2.0 feel, I've added a "google reader shared items" bar, which links to various posts by other people that I find interesting.  Don't worry, there aren't plans for an AdSense bar in the near future.&lt;br /&gt;&lt;br /&gt;A few other updates:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;This past weekend there was a small workshop at CMU, &lt;a href="http://www.hss.cmu.edu/philosophy/bernaysfest.php"&gt;Bernaysfest&lt;/a&gt;, dedicated to the life and work of Paul Bernays, a collaborator of David Hilbert.  I snuck in, and heard a bunch of interesting talks on the history of proof theory.  (&lt;a href="http://users.ipfw.edu/buldtb/"&gt;Bernd Buldt's&lt;/a&gt; talk, listed as TBA on the schedule, was on "Mathematical practice and platonism: A phenomenological perspective", and quite interesting once I understood what he was trying to do.  He wants to give an explanation for why so many mathematicians are platonists, why mathematical objects feel "real" to them, by looking at mathematics as a social process.)  The workshop also brought &lt;a href="http://home.uchicago.edu/~wwtx/"&gt;Bill Tait&lt;/a&gt;, who last week gave a standing-room-only talk about cut-elimination in predicative systems (&lt;a href="http://www.ucalgary.ca/~rzach/logblog/2008/11/tait-cut-elimination-for-predicative.html"&gt;Richard Zach blogs about&lt;/a&gt;).&lt;br /&gt;&lt;li&gt;A month ago I gave a fluffy talk on "walking the way of duality" at the Student Seminar Series.  Here are &lt;a href="http://www.cs.cmu.edu/~noam/talks/theway.pdf"&gt;the slides&lt;/a&gt;, but I'm keeping the video to myself, thank you very much.&lt;br /&gt;&lt;li&gt;My &lt;a href="http://www.cs.cmu.edu/~noam/refinements/"&gt;refinement types paper&lt;/a&gt; was accepted to &lt;a href="http://sneezy.cs.nott.ac.uk/darcs/plpv09/"&gt;PLPV&lt;/a&gt;, as was &lt;a href="http://www.cs.cmu.edu/~drl/pubs/lh08pdt/lh08pdt.pdf"&gt;Dan and Bob's paper&lt;/a&gt;, so we'll be going to Savannah.&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-5839667412646080496?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/5839667412646080496/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=5839667412646080496' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/5839667412646080496'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/5839667412646080496'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2008/11/lies-and-updates.html' title='lies and updates'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-4895605654465338365</id><published>2008-07-24T06:23:00.000-07:00</published><updated>2008-07-24T03:24:03.890-07:00</updated><title type='text'>Refinement types and computational duality</title><content type='html'>Apologies that this blog hasn't seen much action for a while.  Hopefully that will get fixed soon, but then again the whole thesis thing might get in the way.  This post is just to say that recently I've been having fun writing up a &lt;a href="http://www.cs.cmu.edu/~noam/papers/rtcd.pdf"&gt;paper&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;  One lesson learned painfully over the past twenty years is the perilous interaction of Curry-style refinement typing with evaluation order and side-effects.  This led eventually to the value restriction on polymorphism in ML, as well as, more recently, to similar artifacts in prototype refinement type systems for ML with intersection and union types.  For example, some of the traditional subtyping laws for unions and intersections are unsound in the presence of effects, while union-elimination requires an &lt;i&gt;evaluation context restriction&lt;/i&gt; in addition to the value restriction on intersection-introduction.&lt;br /&gt;&lt;br /&gt;  This paper reexamines the interaction between refinement types and evaluation order from the perspective of computational duality.  Building on recent work on the Curry-Howard interpretation of &lt;i&gt;focusing proofs&lt;/i&gt; as pattern-matching programs written in infinitary, higher-order syntax, I give a simple explanation of intersection and union types in the presence of effects, reconstructing phenomena such as the value restriction and differing subtyping laws for call-by-value and call-by-name-- not as ad hoc artifacts, but indeed as logical theorems.  However, this abstract account using infinitary syntax has the drawback that refinement checking is undecidable---to address this, I show how to systematically construct a finitary syntax via defunctionalization, and then give an algorithmic refinement checking system.  Parallel to the text, a formalization in the dependently-typed functional language Agda is described, both for the sake of clarifying these ideas, and also because it was an important guide in developing them.  As one example, the Agda encoding split very naturally into an intrinsic ("Church") view of well-typed programs, and an extrinsic ("Curry") view of refinement typing for those programs.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Code available &lt;a href="http://www.cs.cmu.edu/~noam/refinements/"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-4895605654465338365?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/4895605654465338365/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=4895605654465338365' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/4895605654465338365'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/4895605654465338365'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2008/07/refinement-types-and-computational.html' title='Refinement types and computational duality'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-2440161702561901126</id><published>2008-04-22T08:41:00.000-07:00</published><updated>2008-04-22T09:13:49.664-07:00</updated><title type='text'>Today is election day...</title><content type='html'>...so maybe I can post about a couple unusual things today.  First: go vote!  If you live in Pennsylvania, are eligible to vote, are registered with a political party, and haven't voted already.  (Not sure what segment of my huge readership that applies to.)  Yesterday I heard Barack Obama speak at the Petersen Events Center.  The content of the speech wasn't all that exciting (since it's all been said before), but I was very impressed by the fact that he made the effort for a last-minute, late-night stop in Pittsburgh.  You could see on his face just how tired he was, but also that he knew the stakes, and was determined to keep standing up.  It somewhat reminded me of &lt;a href="http://en.wikipedia.org/wiki/Kibadachi"&gt;kibadachi&lt;/a&gt; practice.&lt;br /&gt;&lt;br /&gt;Second: over the weekend I met an old friend from college, Ben Schmidt, who now studies American history at Princeton.  Later I was looking at his website, and saw that he has &lt;a href="http://www.princeton.edu/~bschmidt/Papers/index.html"&gt;a very interesting paper&lt;/a&gt; about using a variation of Google's PageRank algorithm to rank PhD programs:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Ranking Doctoral Programs by Placement: A New Method&lt;/i&gt;&lt;br /&gt;Benjamin M. Schmidt and Matthew M. Chingos &lt;br /&gt;Forthcoming in PS: Political Science &amp; Politics &lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;Most existing rankings of graduate programs rely on some measure of faculty quality, whether it be reputation (as in the National Research Council and US News rankings), honors (prizes, membership in learned societies, etc.), or research quality and quantity (as in citation studies and publication counts). We propose a ranking that focuses instead on the success of a program’s graduates. By using stochastic matrices, it is possible to create a system in which programs essentially “vote” for each other by hiring graduates of other programs as professors in their own department. This system allows us to create an objective, results-oriented measure that is well suited to measure the quality of departments whose graduates aspire to academic positions. The rankings correlate well with reputational ranking systems, and include a per capita measure that recognizes the accomplishments of smaller but high quality programs. &lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-2440161702561901126?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/2440161702561901126/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=2440161702561901126' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/2440161702561901126'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/2440161702561901126'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2008/04/today-is-election-day.html' title='Today is election day...'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-1488562219144775140</id><published>2008-04-14T15:53:00.000-07:00</published><updated>2008-04-14T15:59:55.189-07:00</updated><title type='text'>a paper</title><content type='html'>&lt;i&gt;&lt;a href="http://www.cs.cmu.edu/~noam/papers/focbind.pdf"&gt;Focusing on binding and computation&lt;/a&gt;&lt;/i&gt;&lt;br /&gt;&lt;a href="http://www.cs.cmu.edu/~drl/"&gt;Dan Licata&lt;/a&gt;, &lt;a href="http://www.cs.cmu.edu/~noam/"&gt;Noam Zeilberger&lt;/a&gt;, and &lt;a href="http://www.cs.cmu.edu/~rwh/"&gt;Robert Harper&lt;/a&gt;&lt;br /&gt;To appear at &lt;a href="http://www2.informatik.hu-berlin.de/lics/lics08/"&gt;LICS 08&lt;/a&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;Variable binding is a prevalent feature of the syntax and proof theory of many logical systems.  In this paper, we define a programming language that provides intrinsic support for both representing and computing with binding.  This language is extracted as the Curry-Howard interpretation of a focused sequent calculus with &lt;i&gt;two&lt;/i&gt; kinds of implication, of opposite polarity.  The &lt;i&gt;representational arrow&lt;/i&gt; extends systems of definitional reflection with a notion of scoped inference rules, which are used to represent binding.  On the other hand, the usual &lt;i&gt;computational arrow&lt;/i&gt; classifies recursive functions defined by pattern-matching.  Unlike many previous approaches, both kinds of implication are connectives in a single logic, which serves as a rich logical framework capable of representing inference rules that mix binding and computation.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Comments appreciated!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-1488562219144775140?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/1488562219144775140/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=1488562219144775140' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/1488562219144775140'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/1488562219144775140'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2008/04/paper.html' title='a paper'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-8247343778095532936</id><published>2008-04-12T14:36:00.000-07:00</published><updated>2008-04-12T16:17:44.940-07:00</updated><title type='text'>just wait a second...</title><content type='html'>An article of faith is that the undecidability of the halting problem makes it impossible to restrict to terminating programs and still have a general-purpose programming language.  On the other hand, another article of faith is that we'd be in big trouble if we allowed non-terminating &lt;i&gt;proofs&lt;/i&gt; in mathematics (e.g., "Trust me, I have a proof of the Riemann Hypothesis, just wait a second...").  Why the double standard?  Do we shackle ourselves by using a fragment of mathematics that disallows (we hope) non-terminating proofs?  Or have we been too hasty to accept non-terminating programs?  The latter stance is embraced in &lt;a href="http://en.wikipedia.org/wiki/Total_functional_programming"&gt;total functional programming&lt;/a&gt;.  But I think the former is also not super crazy.  With a more interactive notion of proof, potential non-termination would not be so dangerous.&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;b&gt;Z:&lt;/b&gt; "I have a proof of the Riemann Hypothesis, can you add it to the Book?"&lt;br /&gt;&lt;br&gt;&lt;b&gt;E:&lt;/b&gt; "Of course, but first can you tell me how you handle this tricky case?" &lt;br /&gt;&lt;br&gt;&lt;i&gt;E presents tricky case to Z&lt;/i&gt;&lt;br /&gt;&lt;br&gt;&lt;b&gt;Z:&lt;/b&gt; "Sure, no problem, this case is easily handled by, um, some math, er, ..."&lt;br /&gt;&lt;br&gt;&lt;i&gt;Z stalls&lt;/i&gt;&lt;br /&gt;&lt;br&gt;&lt;i&gt;E waits patiently, but keeps the Book firmly shut&lt;/i&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;In some sense, terminating proofs are just a time-saving mechanism for referees.  It would indeed be a shame if Z wasted all of E's time with this pseudoproof of RH.  On the other hand, E could be doing other things at the same time, such as drinking coffee, or running SETI@Home.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-8247343778095532936?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/8247343778095532936/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=8247343778095532936' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/8247343778095532936'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/8247343778095532936'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2008/04/just-wait-second.html' title='just wait a second...'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-4945009666857632339</id><published>2008-03-13T06:27:00.000-07:00</published><updated>2008-03-13T07:17:12.387-07:00</updated><title type='text'>anglo-franco photos</title><content type='html'>In Nottingham, a statue of &lt;a href="http://en.wikipedia.org/wiki/Robin_Hood:_Prince_of_Thieves"&gt;Kevin Costner&lt;/a&gt;:&lt;br /&gt;&lt;img src="http://lh3.google.com/noam.zeilberger/R9ko9UzcGOI/AAAAAAAABMo/yG1MtZmVqG8/IMG_6111.JPG?imgmax=512"&gt;&lt;br /&gt;&lt;br /&gt;In London, my sister's cat Arras:&lt;br /&gt;&lt;img src="http://lh4.google.com/noam.zeilberger/R9kpGkzcGPI/AAAAAAAABMw/-1TEAK9M2vU/IMG_6117.JPG?imgmax=512"&gt;&lt;br /&gt;&lt;br /&gt;A group of &lt;a href="http://www.youtube.com/watch?v=WsOofIHbkco&amp;feature=related"&gt;angry Serbian protesters&lt;/a&gt; in London:&lt;br /&gt;&lt;img src="http://lh5.google.com/noam.zeilberger/R9kpP0zcGQI/AAAAAAAABM4/EMNcfmbI0Ck/IMG_6129.JPG?imgmax=512"&gt;&lt;br /&gt;&lt;br /&gt;Chango Spasiuk!&lt;br /&gt;&lt;img src="http://lh6.google.com/noam.zeilberger/R9kpeEzcGRI/AAAAAAAABNA/kTHh2zqTOg0/IMG_6136.JPG?imgmax=512"&gt;&lt;br /&gt;&lt;br /&gt;The students at the Ecole Polytechnique in Loz&amp;egrave;re draw some neat murals:&lt;br /&gt;&lt;img src="http://lh6.google.com/noam.zeilberger/R9kp5EzcGUI/AAAAAAAABNY/-m_0FFIqTlo/IMG_6143.JPG?imgmax=512"&gt;&lt;br /&gt;&lt;br /&gt;Paris has a &lt;a href="http://www.washingtonpost.com/wp-dyn/content/article/2007/03/23/AR2007032301753.html"&gt;successful bike-sharing program&lt;/a&gt;:&lt;br /&gt;&lt;img src="http://lh4.google.com/noam.zeilberger/R9kqAkzcGVI/AAAAAAAABNg/smU4ITWTk1E/IMG_6158.JPG?imgmax=512"&gt;&lt;br /&gt;&lt;br /&gt;The French are &lt;i&gt;serious&lt;/i&gt; about their fast food.&lt;br /&gt;&lt;img src="http://lh4.google.com/noam.zeilberger/R9kqSkzcGWI/AAAAAAAABNo/AWm5er-BpiI/IMG_6163.JPG?imgmax=512"&gt;&lt;br /&gt;&lt;br /&gt;The town of &lt;a href="http://en.wikipedia.org/wiki/Antony%2C_Hauts-de-Seine"&gt;Antony&lt;/a&gt;, where I stayed with Kaustuv and Vivek, had a delightful Sunday market.&lt;br /&gt;&lt;img src="http://lh3.google.com/noam.zeilberger/R9kq4UzcGYI/AAAAAAAABN4/LAuxq15qA7Q/IMG_6185.JPG?imgmax=512"&gt;&lt;br /&gt;&lt;br /&gt;Un canard:&lt;br /&gt;&lt;img src="http://lh6.google.com/noam.zeilberger/R9krEEzcGZI/AAAAAAAABOA/HZgqfo6nqUE/IMG_6205.JPG?imgmax=512"&gt;&lt;br /&gt;&lt;br /&gt;Indian fast food, near the Gare du Nord:&lt;br /&gt;&lt;img src="http://lh4.google.com/noam.zeilberger/R9krQkzcGaI/AAAAAAAABOI/VMZJ5geXURo/IMG_6213.JPG?imgmax=512"&gt;&lt;br /&gt;&lt;br /&gt;My gracious host Kaustuv:&lt;br /&gt;&lt;img src="http://lh3.google.com/noam.zeilberger/R9krWUzcGbI/AAAAAAAABOQ/UKfTxG_FtOI/IMG_6217.JPG?imgmax=512"&gt;&lt;br /&gt;&lt;br /&gt;Jean-Yves, after his first lecture on &lt;a href="http://iml.univ-mrs.fr/~girard/GdI5.pdf"&gt;the Geometry of Interaction V&lt;/a&gt;:&lt;br /&gt;&lt;img src="http://lh4.google.com/noam.zeilberger/R9krckzcGcI/AAAAAAAABOY/exhSEuLuVeA/IMG_6218.JPG?imgmax=512"&gt;&lt;br /&gt;&lt;br /&gt;Neither the subject nor the cameraman were prepared for this photo, hence&lt;br /&gt;Paul-Andr&amp;eacute; came out a bit blurry.  In real life, he is quite sharp!&lt;br /&gt;&lt;img src="http://lh3.google.com/noam.zeilberger/R9krhUzcGdI/AAAAAAAABOk/z87VVACUZjw/IMG_6219.JPG?imgmax=512"&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-4945009666857632339?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/4945009666857632339/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=4945009666857632339' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/4945009666857632339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/4945009666857632339'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2008/03/anglo-franco-photos.html' title='anglo-franco photos'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-8305811334726335411</id><published>2008-02-24T12:08:00.000-08:00</published><updated>2008-02-24T12:52:02.046-08:00</updated><title type='text'>transatlantic updates</title><content type='html'>So I just arrived in Paris today.  Last week I was in Nottingham at &lt;a href="http://sneezy.cs.nott.ac.uk/darcs/DTP08/"&gt;DTP&lt;/a&gt;, then visiting my sister in London.  Both were awesome!  In my talk at DTP, I began with some ludics propaganda, then tried to walk the audience through how to encode focusing with higher-order rules in Agda (and extract a functional programming language with explicit evaluation order and pattern-matching).  You can check out the &lt;a href="http://www.cs.cmu.edu/~noam/research/dtp08.agda"&gt;annotated agda code&lt;/a&gt;.  I also had/overheard lots of great conversations, in particular Sebastian Hanowksy taught me some fascinating things about synthetic topology and the delay monad, and Anton Setzer/Peter Hancock piqued my interest in going back to Buchholz's work about the ω/Ω-rule.  The highlight of the London visit was probably seeing &lt;a href="http://www.changospasiuk.com.ar/camino2.html"&gt;Chango Spasiuk&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;This week I'll be meeting with Paul-André Mellies, and giving talks at PPS and LIX.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-8305811334726335411?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/8305811334726335411/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=8305811334726335411' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/8305811334726335411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/8305811334726335411'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2008/02/transatlantic-updates.html' title='transatlantic updates'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-3377880738703958401</id><published>2008-01-30T13:21:00.000-08:00</published><updated>2008-01-31T07:10:02.534-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='agda'/><category scheme='http://www.blogger.com/atom/ns#' term='games'/><category scheme='http://www.blogger.com/atom/ns#' term='unicode'/><category scheme='http://www.blogger.com/atom/ns#' term='polarity'/><title type='text'>Fun with polarity and unicode</title><content type='html'>&lt;i&gt;&gt; Dependent pattern-matching and unicode: a killer combination.&lt;br /&gt;&gt; I will try to post more about this in the next few days.&lt;/i&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;"Few" is subjective.&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Before getting to the Agda code that &lt;a href="http://www.cs.cmu.edu/~drl/"&gt;Dan&lt;/a&gt; and I wrote, though, I wanted to talk a little bit about a neat, simple idea I learned recently.  In &lt;a href="http://www.cs.cmu.edu/~noam/research/unity-duality.pdf"&gt;this paper&lt;/a&gt;, I argued that one way to rationally reconstruct the linear logic notion of polarity was to turn to so-called proof-theoretic semantics, and in particular Michael Dummett's distinction between &lt;i&gt;verificationist&lt;/i&gt; and &lt;i&gt;pragmatist&lt;/i&gt; justifications of the logical rules.  A verificationist meaning-theory supposes that connectives are defined by their introduction rules, and uses this definition to justify their elimination rules.  A pragmatist meaning-theory supposes the opposite: connectives are defined by their elimination rules, and this justifies their introduction rules.  Well, polarity lets us refine this picture: the &lt;i&gt;positive&lt;/i&gt; connectives are defined by their introduction rules, the &lt;i&gt;negative&lt;/i&gt; connectives by their elimination rules.&lt;br /&gt;&lt;p&gt;&lt;br /&gt;But another (more fun?) way to think about polarity is through &lt;i&gt;game&lt;/i&gt;-theoretic semantics.  Think of the truth of a proposition A as a game between Prover and Refuter: A is valid iff Prover has a winning strategy.  So the meaning of a connective is essentially a set of rules for playing a game.  A few examples:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;[A ⊕ B] : This is a game where Prover begins by selecting either A or B, after which play proceeds by the rules of that game.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;[A &amp; B] : This is a game where Refuter begins by selecting either A or B, after which play proceeds by the rules of that game.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;[A&lt;sup&gt;⊥&lt;/sup&gt;] : Play A, but with the roles of Prover and Refuter swapped.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;[0] : Prover begins but has no moves, so Refuter automatically wins.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;[⊤] : Refuter begins but has no moves, so Prover automatically wins.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;The polarity of a connective/formula is just the answer to the important question: "Which player begins?"  (By the way, this also gives another explanation for &lt;i&gt;focus&lt;/i&gt; and &lt;i&gt;inversion&lt;/i&gt;.  Focus is just the fact that after making a move in the game A ⊕ B, Prover doesn't have to give up her turn to Refuter, e.g., A could itself be the game A₁⊕ A₂.  Inversion is the fact that the second player really has no choice in the matter, e.g., in the game A ⊕ B, Refuter has to account for Prover playing either A or B.)&lt;br /&gt;&lt;p&gt;&lt;br /&gt;The reason I like this (I think pretty old) idea is that not only is it a good icebreaker at parties, but it also suggests a natural generalization, which Samson Abramsky (a bit tongue-in-cheek) calls &lt;a href="http://web.comlab.ox.ac.uk/oucl/work/samson.abramsky/sandu.pdf"&gt;Socially Responsive, Environmentally Friendly Logic&lt;/a&gt;.  Rather than treating only 2-player games between Prover and Refuter, we can encode n-player games using n distinct polarities.  For example, Abramsky defines the connective A ⊕&lt;sub&gt;α&lt;/sub&gt; B as the game where α begins play, selecting between A and B.  I think this is a really cool and promising generalization.&lt;br /&gt;&lt;p&gt;&lt;br /&gt;But anyways, today let's stick with the boring, bipolar world.  I'm going to talk about how to give a focused encoding of polarized intuitionistic logic in Agda, which is simultaneously a deep embedding of a language with explicit evaluation order and pattern-matching. For those playing along, the full code is available &lt;a href="http://www.cs.cmu.edu/~noam/research/polint.agda"&gt;here&lt;/a&gt;. Let's start with some boilerplate:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;open import Data.List&lt;br /&gt;open import Data.String renaming (_++_ to concat) &lt;br /&gt;&lt;br /&gt;module Main where&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Now we define the syntax of polarized formulas, as two mutually inductive datatypes.&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;  module Types where&lt;br /&gt;    Atom : Set &lt;br /&gt;    Atom = String&lt;br /&gt;&lt;br /&gt;    mutual&lt;br /&gt;      data Pos : Set where&lt;br /&gt;        X⁺  : Atom -&gt; Pos&lt;br /&gt;        ↓   : Neg -&gt; Pos&lt;br /&gt;        1⁺  : Pos&lt;br /&gt;        _*_ : Pos -&gt; Pos -&gt; Pos&lt;br /&gt;        0⁺  : Pos&lt;br /&gt;        _+_ : Pos -&gt; Pos -&gt; Pos&lt;br /&gt;        2⁺ : Pos&lt;br /&gt;        ℕ  : Pos&lt;br /&gt;&lt;br /&gt;      data Neg : Set where&lt;br /&gt;        X- : Atom -&gt; Neg&lt;br /&gt;        ↑ : Pos -&gt; Neg&lt;br /&gt;        ⊤ : Neg&lt;br /&gt;        _→_ : Pos -&gt; Neg -&gt; Neg&lt;br /&gt;        _&amp;_ : Neg -&gt; Neg -&gt; Neg&lt;br /&gt;&lt;br /&gt;      infixr 14 _→_&lt;br /&gt;      infixr 15 _&amp;_&lt;br /&gt;      infixr 15 _+_&lt;br /&gt;      infixr 16 _*_&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Positive formulas include positive atoms and shifted negative formulas, as well as strict products and sums.  (We would call the units 1 and 0, but unfortunately Agda doesn't let us overload numerical constants.)  For fun, we also defined the type of booleans 2⁺, and the type of natural numbers ℕ.  Negative formulas include negative atoms and shifted positive formulas, as well as functions and lazy products.  Observe the essential use of Unicode!&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Now we define hypotheses (positive atoms or arbitrary negative formulas) and conclusions (negative atoms or arbitrary positive formulas), as well as some simple machinery for inspecting contexts. Contexts are basically lists of hypotheses, but since inversion introduces multiple hypotheses at a time, it is more convenient to work with lists of &lt;i&gt;lists&lt;/i&gt; of hypotheses.  Hence we define LCtx (linear context) and UCtx (unrestricted context), and the membership relationships ∈ and ∈∈.  Proofs of membership are isomorphic to De Bruijn indices.&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;  module Contexts where&lt;br /&gt;    open Types public&lt;br /&gt;&lt;br /&gt;    data Hyp : Set where&lt;br /&gt;      HP : Atom -&gt; Hyp&lt;br /&gt;      HN : Neg -&gt; Hyp&lt;br /&gt;&lt;br /&gt;    data Conc : Set where&lt;br /&gt;      CP : Pos -&gt; Conc&lt;br /&gt;      CN : Atom -&gt; Conc&lt;br /&gt;&lt;br /&gt;    LCtx : Set&lt;br /&gt;    LCtx = List Hyp&lt;br /&gt;&lt;br /&gt;    UCtx : Set&lt;br /&gt;    UCtx = List LCtx&lt;br /&gt;&lt;br /&gt;    data _∈_ : Hyp -&gt; LCtx -&gt; Set where&lt;br /&gt;      f0 : {h : Hyp}   {Δ : LCtx} -&gt; h ∈ (h :: Δ )&lt;br /&gt;      fS : {h h' : Hyp} {Δ : LCtx} -&gt; h' ∈ Δ -&gt; h' ∈ (h :: Δ)&lt;br /&gt;&lt;br /&gt;    data _∈∈_ : Hyp -&gt; UCtx -&gt; Set where&lt;br /&gt;      s0 : {h : Hyp} {Δ : LCtx} {Γ : UCtx} -&gt; h ∈ Δ -&gt; h ∈∈ (Δ :: Γ)&lt;br /&gt;      sS : {h : Hyp} {Δ : LCtx} {Γ : UCtx} -&gt; h ∈∈ Γ -&gt; h ∈∈ (Δ :: Γ)&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Okay, now we can start the fun stuff.  First we define patterns:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;  module Patterns where&lt;br /&gt;    open Contexts public&lt;br /&gt;   &lt;br /&gt;    [_] : {A : Set} -&gt; A -&gt; List A&lt;br /&gt;    [_] x  = x :: []&lt;br /&gt;&lt;br /&gt;    -- Pat⁺ Δ A⁺ = linear entailment "Δ ⇒ A⁺"&lt;br /&gt;    data Pat⁺ : LCtx -&gt; Pos -&gt; Set where&lt;br /&gt;      Px  : {x : Atom} -&gt; Pat⁺ [ HP x ] (X⁺ x)&lt;br /&gt;      Pu  : {A⁻ : Neg} -&gt; Pat⁺ [ HN A⁻ ] (↓ A⁻)&lt;br /&gt;      P&lt;&gt; : Pat⁺ [] 1⁺&lt;br /&gt;      Ppair : {Δ1 : LCtx} { Δ2 : LCtx } {A : Pos} {B : Pos}&lt;br /&gt;                -&gt; Pat⁺ Δ1 A -&gt; Pat⁺ Δ2 B -&gt; Pat⁺ (Δ1 ++ Δ2) (A * B)&lt;br /&gt;                &lt;br /&gt;      Pinl : {Δ : LCtx} {A B : Pos} -&gt; Pat⁺ Δ A -&gt; Pat⁺ Δ (A + B)&lt;br /&gt;      Pinr : {Δ : LCtx} {A B : Pos} -&gt; Pat⁺ Δ B -&gt; Pat⁺ Δ (A + B)&lt;br /&gt;      Ptt  : Pat⁺ [] 2⁺&lt;br /&gt;      Pff  : Pat⁺ [] 2⁺&lt;br /&gt;      Pz   : Pat⁺ [] ℕ&lt;br /&gt;      Ps   : {Δ : LCtx } -&gt; Pat⁺ Δ ℕ -&gt; Pat⁺ Δ ℕ&lt;br /&gt;&lt;br /&gt;    -- Pat⁻ Δ A⁻ c = linear entailment "Δ ; A⁻ ⇒ c"&lt;br /&gt;    data Pat⁻ : LCtx -&gt; Neg -&gt; Conc -&gt; Set where&lt;br /&gt;      Dx  : forall {x} -&gt; Pat⁻ [] (X- x) (CN x)&lt;br /&gt;      Dp  : forall {A⁺} -&gt; Pat⁻ [] (↑ A⁺) (CP A⁺)&lt;br /&gt;      Dapp : {Δ1 : LCtx } {Δ2 : LCtx} {A⁺ : Pos} {B⁻ : Neg} {c : Conc}&lt;br /&gt;               -&gt; Pat⁺ Δ1 A⁺ -&gt; Pat⁻ Δ2 B⁻ c -&gt; Pat⁻ (Δ2 ++ Δ1) (A⁺ → B⁻) c&lt;br /&gt;      Dfst   : {Δ : LCtx} {A⁻ : Neg} {B⁻ : Neg} {c : Conc}&lt;br /&gt;                -&gt; Pat⁻ Δ A⁻ c -&gt; Pat⁻ Δ (A⁻ &amp; B⁻) c&lt;br /&gt;      Dsnd   : {Δ : LCtx} {A⁻ : Neg} {B⁻ : Neg} {c : Conc}&lt;br /&gt;                -&gt; Pat⁻ Δ B⁻ c -&gt; Pat⁻ Δ (A⁻ &amp; B⁻) c&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Observe that the constructors for Pat⁺ are just &lt;i&gt;value&lt;/i&gt; patterns.  The constructors for Pat⁻ are somewhat less familiar: they correspond to patterns for elimination contexts, which are sometimes called &lt;i&gt;spines&lt;/i&gt;.&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Finally, we define the generic focused sequent calculus:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;  module Logic where&lt;br /&gt;    open Patterns public&lt;br /&gt;&lt;br /&gt;    mutual&lt;br /&gt;       -- RFoc Γ A⁺ = right-focus "Γ ⊢ [A⁺]"&lt;br /&gt;       data RFoc : UCtx -&gt; Pos -&gt; Set where&lt;br /&gt;         Val : forall {Γ A⁺ Δ} -&gt; Pat⁺ Δ A⁺ -&gt; SatCtx Γ Δ -&gt; RFoc Γ A⁺ &lt;br /&gt;&lt;br /&gt;       -- LInv Γ c₀ c = left-inversion "Γ ; c₀ ⊢ c"&lt;br /&gt;       data LInv : UCtx -&gt; Conc -&gt; Conc -&gt; Set where&lt;br /&gt;         Id- : forall {Γ X- } -&gt; LInv Γ (CN X-) (CN X-)&lt;br /&gt;         Fn   : forall {Γ A⁺ c}&lt;br /&gt;                 -&gt; ({Δ : LCtx} -&gt; Pat⁺ Δ A⁺ -&gt; UnFoc (Δ :: Γ) c)&lt;br /&gt;                 -&gt; LInv Γ (CP A⁺) c&lt;br /&gt;&lt;br /&gt;       -- RInv Γ h = right-inversion "Γ ⊢ h;"&lt;br /&gt;       data RInv : UCtx -&gt; Hyp -&gt; Set where&lt;br /&gt;         Susp : forall {Γ A⁻ }&lt;br /&gt;                -&gt; ({Δ : LCtx} {c : Conc} -&gt; Pat⁻ Δ A⁻ c -&gt; UnFoc (Δ :: Γ) c)&lt;br /&gt;                -&gt; RInv Γ (HN A⁻)&lt;br /&gt;         Id+ : forall {Γ X⁺ } -&gt; ((HP X⁺) ∈∈ Γ) -&gt; RInv Γ (HP X⁺)&lt;br /&gt;    &lt;br /&gt;       -- LFoc Γ A⁻ c = left-focus "Γ ; [A⁻] ⊢ c"&lt;br /&gt;       data LFoc : UCtx -&gt; Neg -&gt; Conc -&gt; Set where&lt;br /&gt;         Spine : forall {Δ A⁻ c0 c Γ} -&gt; Pat⁻ Δ A⁻ c0  -&gt;  SatCtx Γ Δ  -&gt;  LInv Γ c0 c&lt;br /&gt;                 -&gt; LFoc Γ A⁻ c&lt;br /&gt;&lt;br /&gt;       -- UnFoc Γ c = unfocused "Γ ⊢ c"&lt;br /&gt;       data UnFoc : UCtx -&gt; Conc -&gt; Set where&lt;br /&gt;         Ret : forall {Γ A⁺ } -&gt; RFoc Γ A⁺ -&gt; UnFoc Γ (CP A⁺)&lt;br /&gt;         App : forall {Γ A⁻ c} -&gt; ((HN A⁻) ∈∈ Γ) -&gt; LFoc Γ A⁻ c -&gt; UnFoc Γ c&lt;br /&gt;&lt;br /&gt;       -- SatCtx Γ Δ = conjoined inversion "Γ ⊢ Δ;"&lt;br /&gt;       data SatCtx : UCtx -&gt; LCtx -&gt; Set where&lt;br /&gt;         Sub : forall {Γ Δ} -&gt;&lt;br /&gt;               ({h : Hyp} -&gt; (h ∈ Δ) -&gt; (RInv Γ h))&lt;br /&gt;               -&gt; SatCtx Γ Δ&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Some examples follow (translated from &lt;a href="http://www.cs.cmu.edu/~noam/research/focusing.hoas.pdf"&gt;this paper&lt;/a&gt;).  Here's where Agda's second most important feature (after Unicode support) gets to show off: dependent pattern-matching!  We reuse Agda's coverage checker to ensure that our object-level functions are total.&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;  module Examples where&lt;br /&gt;    open Logic&lt;br /&gt;    NilCtx : {Γ : UCtx} -&gt; SatCtx Γ []&lt;br /&gt;    NilCtx = Sub f&lt;br /&gt;     where f : forall {h} -&gt; h ∈ [] -&gt; RInv _ h&lt;br /&gt;           f ()&lt;br /&gt;&lt;br /&gt;    ⌊_⌋ : {Δ : LCtx} -&gt; Pat+ Δ 2⁺ -&gt; Pat+ [] 2⁺&lt;br /&gt;    ⌊_⌋ Ptt = Ptt&lt;br /&gt;    ⌊_⌋ Pff = Pff&lt;br /&gt;&lt;br /&gt;    tt : {Γ : UCtx} -&gt; RFoc Γ 2⁺&lt;br /&gt;    tt = Val Ptt NilCtx&lt;br /&gt;    ff : {Γ : UCtx} -&gt; RFoc Γ 2⁺&lt;br /&gt;    ff = Val Pff NilCtx&lt;br /&gt;&lt;br /&gt;    not : (Γ : UCtx) -&gt; RInv Γ (HN (2⁺ → ↑ 2⁺))&lt;br /&gt;    not Γ = Susp not*&lt;br /&gt;      where&lt;br /&gt;        not* : {Δ : LCtx} {c : Conc} -&gt; Pat- Δ (2⁺ → ↑ 2⁺) c -&gt; UnFoc (Δ :: Γ) c&lt;br /&gt;        not* (Dapp Ptt Dp) = Ret ff&lt;br /&gt;        not* (Dapp Pff Dp) = Ret tt&lt;br /&gt;&lt;br /&gt;    and : (Γ : UCtx) -&gt; RInv Γ (HN (2⁺ → 2⁺ → ↑ 2⁺))&lt;br /&gt;    and Γ = Susp and*&lt;br /&gt;      where&lt;br /&gt;        and* : {Δ : LCtx} {c : Conc} -&gt; Pat- Δ (2⁺ → 2⁺ → ↑ 2⁺) c -&gt; UnFoc (Δ :: Γ) c&lt;br /&gt;        and* (Dapp Ptt (Dapp Ptt Dp)) = Ret tt&lt;br /&gt;        and* (Dapp Ptt (Dapp Pff Dp)) = Ret ff&lt;br /&gt;        and* (Dapp Pff (Dapp Ptt Dp)) = Ret ff&lt;br /&gt;        and* (Dapp Pff (Dapp Pff Dp)) = Ret ff&lt;br /&gt;&lt;br /&gt;    App' : {Γ : UCtx} {A+ B+ : Pos} {c : Conc} -&gt; &lt;br /&gt;           (HN (A+ → ↑ B+) ∈∈ Γ) -&gt; (RFoc Γ A+) -&gt; (LInv Γ (CP B+) c) -&gt;&lt;br /&gt;           UnFoc Γ c&lt;br /&gt;    App' u (Val p σ) F = App u (Spine (Dapp p Dp) σ F)&lt;br /&gt;&lt;br /&gt;    table1 : (Γ : UCtx) -&gt; RInv Γ (HN (↓(2⁺ → ↑ 2⁺) → ↑ (2⁺ * 2⁺)))&lt;br /&gt;    table1 Γ = Susp table1*&lt;br /&gt;      where&lt;br /&gt;        table1* : {Δ : LCtx} {c : Conc} -&gt; Pat- Δ (↓(2⁺ → ↑ 2⁺) → ↑ (2⁺ * 2⁺)) c -&gt; UnFoc (Δ :: Γ) c&lt;br /&gt;        table1* (Dapp Pu Dp) = App' (s0 f0) tt (Fn (\b1 -&gt; &lt;br /&gt;                               App' (sS (s0 f0)) ff (Fn (\b2 -&gt; &lt;br /&gt;                                     Ret (Val (Ppair ⌊ b1 ⌋ ⌊ b2 ⌋) NilCtx)))))&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-3377880738703958401?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/3377880738703958401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=3377880738703958401' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/3377880738703958401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/3377880738703958401'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2008/01/fun-with-polarity-and-unicode.html' title='Fun with polarity and unicode'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-9106985083464515396</id><published>2008-01-14T20:19:00.000-08:00</published><updated>2008-01-31T07:07:51.931-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='agda'/><title type='text'>Back from POPL, forward to AGDA</title><content type='html'>I arrived back in Pittsburgh yesterday after a week at &lt;a href="http://www.cs.ucsd.edu/popl/08/program.html"&gt;POPL&lt;/a&gt; and related workshops in San Francisco.  Modulo the stress of having to prepare my presentation for the last day, it was a lot of fun!  Heard lots of interesting talks, and had many interesting conversations.  The highlight was probably Conor McBride's performance of &lt;a href="http://www.cs.nott.ac.uk/~ctm/CJ.pdf"&gt;"Clowns to the left of me, jokers to the right"&lt;/a&gt; ("I watch Olivier Danvy as he circles the room with a knife, threatening to defunctionalize my continuation"), but I also really enjoyed Janis Voigtlaender's talk, &lt;a href="http://wwwtcs.inf.tu-dresden.de/~voigt/popl202-voigtlaender.pdf"&gt;"Much Ado about Two"&lt;/a&gt;.  &lt;a href="http://www.inf.fh-flensburg.de/lang/algorithmen/sortieren/networks/nulleinsen.htm"&gt;Knuth's 0-1 principle&lt;/a&gt; states that any &lt;i&gt;oblivious&lt;/i&gt; sorting algorithm can be verified correct simply by testing it on arrays of 0s and 1s.  Voigtlaender proved an analogous result for parallel prefix sort: correctness can be verified simply by testing arrays of 0s, 1s, and 2s.  The neat thing is that the result can be obtained almost as a &lt;a href="http://citeseer.ist.psu.edu/250500.html"&gt;"free theorem"&lt;/a&gt;, i.e. by proving  a few simple combinatorial properties and applying &lt;i&gt;parametricity&lt;/i&gt;.  This paper also seems to me in a similar spirit as &lt;a href="http://math.andrej.com/2007/09/28/seemingly-impossible-functional-programs/"&gt;Martín Escardó's seemingly impossible functional programs&lt;/a&gt; and &lt;a href="http://www.cs.cmu.edu/~kw/pubs/conway.pdf"&gt;Kevin Watkin's 98-line proof of Conway's Cosmological Theorem&lt;/a&gt;─very clever uses of Haskell to reduce a seemingly infinite search space to a finite one.  These sort of results make me feel optimisic about the future.&lt;br /&gt;&lt;br /&gt;Another thing that makes me feel optimistic: &lt;a href="http://appserv.cs.chalmers.se/users/ulfn/wiki/agda.php"&gt;Agda2&lt;/a&gt;.  Dan Licata and I had a coding session today to try to translate focusing-with-higher-order-rules into Agda, and it seems almost perfectly suited.  Dependent pattern-matching &lt;i&gt;and&lt;/i&gt; unicode: a killer combination.  I will try to post more about this in the next few days.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-9106985083464515396?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/9106985083464515396/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=9106985083464515396' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/9106985083464515396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/9106985083464515396'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2008/01/back-from-popl-forward-to-agda.html' title='Back from POPL, forward to AGDA'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-2953255662723387157</id><published>2007-11-18T21:35:00.000-08:00</published><updated>2008-01-31T07:08:08.192-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ludics'/><category scheme='http://www.blogger.com/atom/ns#' term='judgments'/><title type='text'>lucidity vs ludicity, and translating one esoteric language into a slightly less esoteric one</title><content type='html'>One of the things I often wonder about is how to say things that are intelligible.  Too frequently, I lapse into jargon─sometimes even on-the-spot-invented jargon─and only realize this after the damage has been done.  An example: &lt;a href="http://polaro.blogspot.com/2007/11/location-phi-bar.html"&gt;the previous blog post&lt;/a&gt;, which was probably incomprehensible to all but...well, probably to all.  I promise I will try hard to avoid doing this in the future.&lt;br /&gt;&lt;br /&gt;But on the topic of making things less inscrutable─and not on the topic of Girard!, though keep your eyes on the &lt;a href="http://locuspocus.hyperkind.org/wiki/Girard_Reading_Group"&gt;Girard Reading Group Wiki&lt;/a&gt;─another thing I've been thinking about is how to translate Martin-Löf's "judgment vs proposition" distinction (as spelled out in the &lt;a href="http://www.cs.cornell.edu/info/Projects/Nuprl/cs671/cs671-fa99/martin.html"&gt;Siena Lectures&lt;/a&gt;) into the language of category theory.  At first, the judgment vs proposition distinction may seem pedantic: okay, one can distinguish between a well-formed proposition "A" and the assertion that it is true "A true"...but so what?  Well, the distinction helps get dependent type theory off the ground, since well-formedness is defined mutually with truth (the dependent quantifier ∏x:A.B is a well-formed proposition if and only if A is well-formed and B is well-formed &lt;i&gt;under the assumption&lt;/i&gt; x:A).  More mundanely, it is obvious that a separate notion of judgment is useful if we want to &lt;i&gt;refute&lt;/i&gt; propositions as well as assert them, using the judgment "A false" in addition to "A true".&lt;br /&gt;&lt;br /&gt;Well, this is actually not &lt;i&gt;quite&lt;/i&gt; so obvious.  Why not just assert ¬A?  For a philosophical explanation of why not, Greg Restall's essay &lt;a href="http://consequently.org/writing/multipleconclusions/"&gt;"Multiple Conclusions"&lt;/a&gt; is a nice read.  From a proof/type-theoretic perspective, the reason why not to identify "A false" with "¬A " is that we need the separate judgment in order to obtain "good compositionality" principles─this is an informal but very general law gleaned by Frank Pfenning and collaborators over years of refining the "judgmental method", to which the paper &lt;a href="http://www.cs.cmu.edu/~fp/papers/mscs00.pdf"&gt;"A judgmental reconstruction of modal logic"&lt;/a&gt; probably serves as the most complete introduction.  Unfortunately, though, my impression is that these principles are still not very widely accepted or understood.&lt;br /&gt;&lt;br /&gt;I think part of the problem is the seemingly obscure philosophical origins of the judgmental method (although its application is practically motivated), and so what I would like is a translation guide into the language of category theory (an order of magnitude less obscure, though granted still sometimes considered esoteric) .  I think there &lt;i&gt;must&lt;/i&gt; be such a translation, since the whole point of the judgmental method (at least in my mind) is obtaining compositionality principles.&lt;br /&gt;&lt;br /&gt;Does anyone know if the judgment vs proposition distinction has been explored before in category theory?  As a simple example of a system with two judgments that should be possible to explain categorically, I propose the bidirectional lambda calculus with implication and conjunction (described &lt;a href="http://www.cs.cmu.edu/~fp/courses/atp/handouts/ch3-seqcalc.ps"&gt;in Section 3.1 here&lt;/a&gt;).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-2953255662723387157?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/2953255662723387157/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=2953255662723387157' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/2953255662723387157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/2953255662723387157'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2007/11/lucidity-vs-ludicity-and-translating.html' title='lucidity vs ludicity, and translating one esoteric language into a slightly less esoteric one'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-2825645518981701172</id><published>2007-11-06T18:38:00.000-08:00</published><updated>2008-01-31T07:08:15.837-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ludics'/><title type='text'>Location: PHI Bar</title><content type='html'>(Only the location matters.)&lt;br /&gt;&lt;br /&gt;Today we had the second (or really 1.5th) meeting of the Girard Reading Group, a.k.a. the Locus Solum Drinking Group.  Many more people than I expected!  It seems that obscure proof theory is a sexy topic.  We're trying to go through Locus Solum systematically, although it's hard because the writing style makes digression so tempting.  Fortunately, it's a diverse enough group of people that we better stay disciplined or else anarchy will ensue (as in the first meeting).  Rob put up a &lt;a href="http://locuspocus.hyperkind.org/"&gt;wiki&lt;/a&gt; for us to pool whatever nuggets/maggots of wisdom we manage to extract.  Stay tuned there for updates!  Here I'll talk about a few of today's punchlines (these will probably go on the wiki soon).&lt;br /&gt;&lt;br /&gt;I think it was a pretty productive day.  We made it through the basics of designs-dessins, and started to talk about designs-desseins (what's the &lt;a href="http://en.wikipedia.org/wiki/Differance#Deliberate_misspelling"&gt;differance&lt;/a&gt; between them?).  Basically, designs-dessins are &lt;i&gt;focused&lt;/i&gt; sequent calculus proofs in &lt;i&gt;affine&lt;/i&gt;, &lt;i&gt;polarized&lt;/i&gt; linear logic, where formulas have been replaced by &lt;i&gt;loci&lt;/i&gt;.  I still don't have a good sense of the motivation for locativity, but the definition is very concrete: a locus ξ is just a finite sequence of natural numbers.  Appending a number ("bias") &lt;i&gt;i&lt;/i&gt; corresponds to taking an immediate subformula (ξ*&lt;i&gt;i&lt;/i&gt; is an "immediate sublocus" of ξ).  There are two kinds of sequents ("pitchforks"): ⊢ Λ (positive pitchfork) and ξ ⊢ Λ (negative pitchfork).  Here Λ is a finite set of loci.&lt;br /&gt;&lt;br /&gt;Now, Girard doesn't much intuition for what these judgments mean, but my running interpretation is as follows: a positive pitchfork asserts that all of the the loci in Λ can't be false, i.e. that if all the loci in Λ are false we have a contradiction; a negative pitchfork asserts that if all the loci in Λ are false, then ξ is also false.  (I'm not really sure what it means for a &lt;i&gt;locus&lt;/i&gt; to be false, as opposed to a formula, but let's run with it...)  Observe this is just an inversion of the usual interpretation of intuitionistic sequents Γ ⊢ A and Γ ⊢∙.  However, the system is not really "dual intuitionistic", because the notions "false" and "contradiction" used here are intuitionistic, and really there is a hidden notion of "direct truth" buried within the rules for proving pitchforks.&lt;br /&gt;&lt;br /&gt;Let's take Girard's example "pre-located" formula A = (P&lt;sup&gt;⊥&lt;/sup&gt;⊕ Q&lt;sup&gt;⊥&lt;/sup&gt;) ⊗ R&lt;sup&gt;⊥&lt;/sup&gt;.  There are two &lt;i&gt;proper positive rules&lt;/i&gt; (right-rules) for A:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;    &lt;br /&gt;  P ⊢ Γ      R ⊢ Δ            Q ⊢ Γ      R ⊢ Δ&lt;br /&gt;—————————————————————      ——————————————————————&lt;br /&gt;     ⊢ Γ, Δ, A                    ⊢ Γ, Δ, A&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Under our interpretation, to prove  ⊢ Γ, Δ, A we must show that all of the formulas in Γ, Δ, A can't be false.  These rules attempt to do this by &lt;i&gt;focusing&lt;/i&gt; on A, i.e. they try to show that A in particular is true (still under the assumption that Γ and Δ are false).  To prove A, we must prove both P&lt;sup&gt;⊥&lt;/sup&gt;⊕ Q&lt;sup&gt;⊥&lt;/sup&gt; and R&lt;sup&gt;⊥&lt;/sup&gt;.  To prove a disjunction we must prove either of the disjuncts, while proving the negation of a formula is the same as refuting it.  Hence to prove A (under falsehood assumptions Γ, Δ), we must either refute P and refute R (with an arbitrary splitting of the assumptions), or else refute Q and refute R.  This is exactly how we read the premises of the two rules.  On the other hand, see how in one step we are able to go all the way from "show Γ, Δ, A can't all be false" to "show A is true if Γ, Δ are false" to "show either (P is false if Γ is false and R is false if Δ is false) or (Q is false if Γ is false and R is false if Δ is false)"?  This is the &lt;i&gt;focalization&lt;/i&gt; property, and it's why we didn't explicitly have to mention "truth" when we glossed the two kinds of sequents.  (Editorial remark: if the truth judgment is hidden in there, though, why not show it?  I.e., use a third kind of pitchfork "⊢ Λ; ξ", where ξ is already in focus.  This is what I do in &lt;a href="http://www.cs.cmu.edu/~noam/research/unity-duality.pdf"&gt;my paper&lt;/a&gt;.)&lt;br /&gt;&lt;br /&gt;Designs-dessins are not a perfect notation for proofs, however.  The problem is that not all of the loci in a pitchfork will ever be placed in focus.  These loci can be split up arbitrarily among the different premises of a derivation---so we can have two dessins which apply essentially the same rules, but just differ in how they throw away these unused loci.  The situation here is more or less as it is for ordinary intuitionistic logic.  For any sequent calculus proof of Γ ⊢ A, we can get a "new" proof by weakening the derivation to Γ, Δ ⊢ A.  However, the sequence of rules applied in both proofs is the same.  Natural deduction/simply-typed lambda calculus get rid of these artificial distinctions between proofs: we can give one lambda term corresponding to both sequent calculus proofs (it simply won't mention the extra hypotheses in Δ).  So designs-desseins are something like a lambda calculus for focused proofs.  Yes, we should expect them to look something like spine form and pattern-matching...but we might have to squint pretty hard...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-2825645518981701172?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/2825645518981701172/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=2825645518981701172' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/2825645518981701172'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/2825645518981701172'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2007/11/location-phi-bar.html' title='Location: PHI Bar'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-100360444442173868</id><published>2007-07-31T13:38:00.000-07:00</published><updated>2008-01-31T07:08:25.278-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='topology'/><title type='text'>Synthetic topology</title><content type='html'>I've started reading about Martín Escardó's "synthetic topology", which seems closely related to (but not quite the same as) the ludics topological interpretation.  The basic idea is that rather than topologizing a language by first specifying a partial order on data, then constructing open sets using that order, and finally showing that all definable functions are continuous—the approach in traditional domain theory—instead one starts at the end and simply declares continuous functions to be those definable in the language.  An open set U of a datatype D is now defined by a continuous function χ&lt;sub&gt;U&lt;/sub&gt; : D → S from D into the &lt;i&gt;Sierpinski space&lt;/i&gt; S.  In classical topology, the Sierpinski space is simply the two point set {⊤, ⊥}, with open sets {{⊤, ⊥}, {⊤}, ∅}.  In synthetic topology, S is a datatype with the single element ⊤; a computation of type S can either evaluate to ⊤, or else diverge, which is represented by ⊥.  So the Sierpinski space essentially represents the &lt;i&gt;observable results&lt;/i&gt; of computation, where we only distinguish between termination and non-termination.  (In ludics, these two observable results are called daimon and faith.)&lt;br /&gt;&lt;br /&gt;So again, an open set U of D is defined by U = χ&lt;sub&gt;U&lt;/sub&gt;&lt;sup&gt;-1&lt;/sup&gt;(⊤), where χ&lt;sub&gt;U&lt;/sub&gt; : D → S is definable in the underlying programming language.  It follows immediately that U is closed under contextual equivalence, i.e. if d∈U and d ≈ d' then d'∈U.  However, it is &lt;i&gt;not&lt;/i&gt; necessarily the case that the collection of open sets is closed under (infinite or even finite) unions (as in classical topology).  For this to be the case, given any two functions f,g : D → S, we have to be able to construct an h : D → S such that h(d) = ⊤ iff either f(d) = ⊤ or g(d) = ⊤.  In other words, our language needs a sort of "parallel-or" construct.&lt;br /&gt;&lt;br /&gt;I haven't gotten much further yet, but this looks interesting.  Also, it seems that Escardó isn't just interested in applications to programming semantics, but in examining more traditional topological questions through synthetic topology.&lt;br /&gt;&lt;br /&gt;A tutorial: &lt;a href="http://www.cs.bham.ac.uk/~mhe/papers/entcs87.pdf"&gt;"Synthetic topology of data types and classical spaces"&lt;/a&gt; by Martín Escardó.&lt;br /&gt;&lt;br /&gt;A paper: &lt;a href="http://www.cs.bham.ac.uk/~mhe/papers/escardo-ho-op-journal.pdf"&gt;"Operational domain theory and topology of sequential programming languages"&lt;/a&gt; by Martín Escardó and Weng Kin Ho.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-100360444442173868?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/100360444442173868/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=100360444442173868' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/100360444442173868'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/100360444442173868'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2007/07/synthetic-topology.html' title='Synthetic topology'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-7574169465132835601</id><published>2007-06-28T20:53:00.000-07:00</published><updated>2007-06-29T01:39:58.992-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ludics'/><category scheme='http://www.blogger.com/atom/ns#' term='topology'/><title type='text'>A  topology of cut-elimination</title><content type='html'>One of the central ideas of Ludics is an &lt;span style="font-style: italic;"&gt;orthogonality&lt;/span&gt; relationship between proofs and refutations, which says, essentially, that they can be "successfully" cut against each other. Recall that Gentzen's cut rule is a method of composing derivations:&lt;br /&gt;&lt;div style="text-align: center;"&gt; &lt;pre style="font-family: courier new;"&gt;Γ ⊢ Δ, A      Γ, A ⊢ Δ&lt;br /&gt;———————————————————————&lt;br /&gt;Γ ⊢ Δ&lt;br /&gt;&lt;/pre&gt; &lt;div style="text-align: left;"&gt;The rule gives a derivation of &lt;span style="font-family:courier new;"&gt;Γ ⊢ Δ&lt;/span&gt; from derivations of weaker sequents, using &lt;span style="font-family:courier new;"&gt;A&lt;span style="font-family:arial;"&gt; &lt;/span&gt;&lt;/span&gt;as an intermediary. Gentzen proved that the cut rule is unnecessary, i.e. that it is always possible to obtain a direct derivation of &lt;span style="font-family:courier new;"&gt;Γ ⊢ Δ&lt;/span&gt; without going through the middle-man. However it turned out that this &lt;span style="font-style: italic;"&gt;process&lt;/span&gt; of cut-elimination was of extreme interest.&lt;br /&gt;&lt;br /&gt;In "Locus Solum", Girard tells us to focus our attention on the following instance of cut:&lt;br /&gt;&lt;div style="text-align: center;"&gt; &lt;pre&gt; ⊢ A      A ⊢&lt;br /&gt;——————————————&lt;br /&gt;⊢ &lt;/pre&gt; &lt;/div&gt; In words: "From a proof of&lt;span style="font-family:monospace;"&gt; &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;A&lt;/span&gt; and a refutation of&lt;span style="font-family:monospace;"&gt; &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;A&lt;/span&gt;, derive contradiction."  But isn't that a &lt;span style="font-style: italic;"&gt;vacuous&lt;/span&gt; instance of cut?  Logic is supposed to be consistent, so how could we ever have &lt;span style="font-style: italic;"&gt;both&lt;/span&gt; a proof and a refutation of the same proposition?  Well, Girard's solution is to add a single rule, the &lt;span style="font-style: italic;"&gt;daimon&lt;/span&gt;, that can conclude anything from no premises:&lt;br /&gt;&lt;div style="text-align: center;"&gt; &lt;pre&gt;——————&lt;br /&gt;Γ ⊢ Δ&lt;/pre&gt; &lt;/div&gt; Since the logic becomes inconsistent, it is now entirely possible to have both a proof and a refutation of the same proposition. But isn't that...&lt;span style="font-style: italic;"&gt;crazy?&lt;/span&gt;  Perhaps Girard inhaled a bit too much &lt;a href="http://iml.univ-mrs.fr/%7Egirard/mustard/article.html"&gt;mustard&lt;/a&gt; before coming up with this stuff?&lt;br /&gt;&lt;br /&gt;But actually, if we think of cut-elimination in terms of the Curry-Howard correspondence, the daimon makes a good deal of sense. A proof of &lt;span style="font-family:courier new;"&gt;A&lt;/span&gt; corresponds to a &lt;span style="font-style: italic;"&gt;value&lt;/span&gt; of type &lt;span style="font-family:courier new;"&gt;A&lt;/span&gt; (in the ordinary programming languages sense), while a refutation of &lt;span style="font-family:courier new;"&gt;A&lt;/span&gt; corresponds to a &lt;span style="font-style: italic;"&gt;continuation accepting&lt;/span&gt; type &lt;span style="font-family:courier new;"&gt;A&lt;/span&gt;. (Strictly speaking, in Ludics proofs don't correspond to values in the ordinary sense, but for now we can ignore the difference.) Now, what can a continuation &lt;span style="font-family:courier new;"&gt;K&lt;/span&gt; do with a value &lt;span style="font-family:courier new;"&gt;V:A&lt;/span&gt;?  Well, &lt;span style="font-family:courier new;"&gt;V&lt;/span&gt; might itself contain suspended continuations, and &lt;span style="font-family:courier new;"&gt;K&lt;/span&gt; could call any of those with some values.  But another possibility is that &lt;span style="font-family:courier new;"&gt;K&lt;/span&gt; simply terminates the computation.  And &lt;span style="font-style: italic;"&gt;that's&lt;/span&gt; when it calls the daimon.  In other words, &lt;span style="font-style: italic;"&gt;daimon&lt;/span&gt; is just French for "done". Thus when Girard defines a proof and a refutation to be orthogonal when their cut normalizes to the daimon, this is another way of saying that we can throw a value to a continuation and get a terminating result (notation: &lt;span style="font-family:courier new;"&gt;V⊥K&lt;/span&gt;).&lt;br /&gt;&lt;br /&gt;So what does this have to do with &lt;a href="http://en.wikipedia.org/wiki/Topology"&gt;topology&lt;/a&gt;?   For any type &lt;span style="font-family:courier new;"&gt;A&lt;/span&gt;, let's collect all of its values into a set &lt;span style="font-family:courier new;"&gt;X&lt;sub&gt;A&lt;/sub&gt; = {V | V:A}&lt;/span&gt;.  Now, let &lt;span style="font-family:courier new;"&gt;K&lt;/span&gt; be any &lt;span style="font-family:courier new;"&gt;A&lt;/span&gt;-accepting continuation.  We can use &lt;span style="font-family:courier new;"&gt;K&lt;/span&gt; to pick out a subset of &lt;span style="font-family:courier new;"&gt;X&lt;sub&gt;A&lt;/sub&gt;&lt;/span&gt;, namely the set of values on which &lt;span style="font-family:courier new;"&gt;K&lt;/span&gt; terminates.   That is, we build the set &lt;span style="font-family:courier new;"&gt;K&lt;sup&gt;⊥&lt;/sup&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;= {V:A | &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;V⊥K&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;.  And then we define a topology &lt;span style="font-family:courier new;"&gt;Ω&lt;sub&gt;A &lt;/sub&gt;&lt;/span&gt;on &lt;span style="font-family:courier new;"&gt;X&lt;sub&gt;A&lt;/sub&gt;&lt;/span&gt;, generated by all of the basic open sets &lt;span style="font-family:courier new;"&gt;K&lt;sup&gt;⊥&lt;/sup&gt;&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Let's try to see how this works for&lt;span style="font-family:courier new;"&gt;&lt;/span&gt; the type of booleans, with set of values &lt;span style="font-family:courier new;"&gt;X&lt;sub&gt;2&lt;/sub&gt; = {t, f}&lt;/span&gt;.  We can describe any boolean continuation as essentially fitting one of the following four recipes:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center; font-family: courier new;"&gt;[t|f ↦ done]&lt;br /&gt;&lt;br /&gt;[t ↦ done]         [f ↦ done]&lt;br /&gt;&lt;br /&gt;[]&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The top recipe (&lt;span style="font-family:courier new;"&gt;[t|f ↦ done])&lt;span style="font-family:lucida grande;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt; &lt;/span&gt;describes a continuation which, given either  &lt;span style="font-family:courier new;"&gt;t&lt;/span&gt; or &lt;span style="font-family:courier new;"&gt;f&lt;/span&gt;, simply returns.  The next recipe on the left (&lt;span style="font-family:courier new;"&gt;[t ↦ done]&lt;/span&gt;) describes a continuation which returns on &lt;span style="font-family:courier new;"&gt;t&lt;/span&gt;, but whose behavior is unspecified (and thus possibly non-terminating) on &lt;span style="font-family:courier new;"&gt;f&lt;/span&gt;.  Similarly with &lt;span style="font-family:courier new;"&gt;[f ↦ done]&lt;/span&gt;.  Finally, &lt;span style="font-family:courier new;"&gt;[]&lt;/span&gt; is the boolean continuation with totally unspecified behavior. It is easy to see the basic open set corresponding to each continuation:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-family:courier new;"&gt;{t,f}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;{t}   {f}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;{}&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;And so &lt;span style="font-family:courier new;"&gt;Ω&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;sub&gt;2&lt;/sub&gt;&lt;/span&gt; is simply the discrete topology.  In general, though, the topology &lt;span style="font-family:courier new;"&gt;Ω&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;sub&gt;A&lt;/sub&gt;&lt;/span&gt; will be more complicated.&lt;br /&gt;&lt;br /&gt;Fact: &lt;span style="font-family:courier new;"&gt;Ω&lt;sub&gt;A&lt;/sub&gt;&lt;/span&gt; is &lt;a href="http://en.wikipedia.org/wiki/Separation_axiom"&gt;T&lt;sub&gt;0&lt;/sub&gt;&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Expanding the definition of &lt;span style="font-family:courier new;"&gt;Ω&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;sub&gt;A&lt;/sub&gt;&lt;/span&gt; and of the separation axiom, this means that for any two "syntactically distinct" values of type A (omitting the precise definition), there is some continuation which terminates on one but not the other. Or in programming language terminology, T&lt;sub&gt;0&lt;/sub&gt; says that syntactic inequality implies contextual inequivalence.&lt;br /&gt;&lt;br /&gt;Fact: &lt;/sub&gt;&lt;span style="font-family:courier new;"&gt;Ω&lt;sub&gt;A&lt;/sub&gt;&lt;/span&gt; is &lt;span style="font-weight: bold;"&gt;not&lt;/span&gt; always T&lt;sub&gt;1&lt;/sub&gt;.&lt;br /&gt;Counter-example: Consider &lt;span style="font-family:courier new;"&gt;Ω&lt;sub&gt;¬2&lt;/span&gt;&lt;/sub&gt;, the topology on boolean continuations &lt;span style="font-style: italic;"&gt;treated as values&lt;/span&gt;.  We treat a continuation as a value by wrapping it in &lt;span style="font-family:courier new;"&gt;con&lt;/span&gt;, so for example &lt;span style="font-family:courier new;"&gt;con(&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;[t ↦ done])&lt;/span&gt; is a value of type &lt;span style="font-family:courier new;"&gt;¬2&lt;/span&gt;.  Now, we can again summarize the behavior of any &lt;span style="font-family:courier new;"&gt;¬2&lt;/span&gt;-continuation, this time with five possibilities:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center; font-family: courier new;"&gt;[con(k) ↦ done]&lt;br /&gt;&lt;br /&gt;[con(k) ↦ k(t)]         [con(k) ↦ k(f)]&lt;br /&gt;&lt;br /&gt;[con(k) ↦ k(t)∥k(f)]&lt;br /&gt;&lt;br /&gt;[]&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The top continuation simply ignores its argument and returns.  The next two call &lt;span style="font-family:courier new;"&gt;k&lt;/span&gt; with a single boolean, either &lt;span style="font-family:courier new;"&gt;t&lt;/span&gt; or &lt;span style="font-family:courier new;"&gt;f&lt;/span&gt;.  The continuation on the third line calls &lt;span style="font-family:courier new;"&gt;k&lt;/span&gt; with &lt;span style="font-style: italic;"&gt;both&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;t&lt;/span&gt; and &lt;span style="font-family:courier new;"&gt;f&lt;/span&gt;.  And finally, the behavior of the continuation &lt;span style="font-family:courier new;"&gt;[]&lt;/span&gt; is, again, unspecified.  Now let us use the shorthand &lt;span style="font-family:courier new;"&gt;{t,f}&lt;/span&gt;, &lt;span style="font-family:courier new;"&gt;{t}&lt;/span&gt;, &lt;span style="font-family:courier new;"&gt;{f}&lt;/span&gt;, &lt;span style="font-family:courier new;"&gt;{}&lt;/span&gt;, to refer to the four previously-defined boolean continuations in the evident way.  Then the above &lt;span style="font-family:courier new;"&gt;¬2&lt;/span&gt;-continuations generate the following basic open sets:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-family:courier new;"&gt;{{t,f},{t},{f},{}}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;{{t,f},{t}}     {{t,f},{f}}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;{{t,f}}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;{}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt; Then, for example, &lt;span style="font-family:courier new;"&gt;{t}&lt;/span&gt; and &lt;span style="font-family:courier new;"&gt;{t,f}&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;&lt;/span&gt; cannot be separated, since the latter is in every open set containing the former. Another way of putting this is that any context in which the value &lt;span style="font-family:courier new;"&gt;con(&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;[t ↦ done])&lt;/span&gt; is acceptable, the value&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;con(&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;[t|f ↦ done])&lt;/span&gt; is also acceptable; the former supplies a continuation guaranteed to terminate only on &lt;span style="font-family:courier new;"&gt;t&lt;/span&gt;, the latter one that that will terminate on any boolean.  It might also be worth noting that the two values &lt;span style="font-family:courier new;"&gt;con(&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;[t ↦ done])&lt;/span&gt;and &lt;span style="font-family:courier new;"&gt;con(&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;[f ↦ done])&lt;/span&gt; &lt;span style="font-style: italic;"&gt;are&lt;/span&gt; separable, but not by open neighborhoods.&lt;br /&gt;&lt;br /&gt;Okay!  Hopefully that's a reasonable sketch of the basics of the topological interpretation in Ludics.  Stay tuned for more...&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;sub&gt; &lt;/sub&gt;&lt;/div&gt;&lt;sub&gt; &lt;/sub&gt;&lt;/div&gt;&lt;sub&gt; &lt;/sub&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-7574169465132835601?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/7574169465132835601/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=7574169465132835601' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/7574169465132835601'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/7574169465132835601'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2007/06/topology-of-cut-elimination.html' title='A  topology of cut-elimination'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7486674684844560197.post-2272109298514008138</id><published>2007-06-10T13:39:00.000-07:00</published><updated>2007-06-10T15:06:58.745-07:00</updated><title type='text'>Preliminaries</title><content type='html'>The premise of this blog is first: wow, I have a blog! Second, I feel that at this point in my life I need to spend less time thinking up crackpot ideas, and more time writing up crackpot ideas.&lt;br /&gt;&lt;br /&gt;Additional introduction: I am a grad student at &lt;a href="http://www.cs.cmu.edu/"&gt;Carnegie Mellon&lt;/a&gt;, with broad interests in programming languages and proof theory, logic, categories and philosophy of language. More specifically, my thesis work has &lt;a href="http://www.cs.cmu.edu/%7Enoam/research/proposal.pdf"&gt;started to take shape&lt;/a&gt; after a couple years spent trying to make sense of &lt;a href="http://iml.univ-mrs.fr/%7Egirard/0.pdf"&gt;nonsense&lt;/a&gt;, and I might devote a few blog entries to this exegesis (hence the blog title).  At the moment, &lt;a href="http://www.pps.jussieu.fr/%7Elaurent/"&gt;many&lt;/a&gt;&lt;a href="http://www.dcs.st-and.ac.uk/%7Erd/"&gt; other&lt;/a&gt;&lt;a href="http://www.cs.bham.ac.uk/%7Epbl/"&gt; people&lt;/a&gt; are &lt;a href="http://www.mscs.dal.ca/%7Eselinger/"&gt;pursuing&lt;/a&gt;&lt;a href="http://www.pps.jussieu.fr/%7Emellies/"&gt; similar&lt;/a&gt;&lt;span style="text-decoration: underline;"&gt; &lt;/span&gt;&lt;a href="http://www.lix.polytechnique.fr/Labo/Dale.Miller/"&gt;ideas&lt;/a&gt;, some from  &lt;a href="http://consequently.org/"&gt;very&lt;/a&gt;&lt;a href="http://www.math.tau.ac.il/%7Eaa/"&gt; different&lt;/a&gt;&lt;a href="http://www.pitt.edu/%7Ebrandom/"&gt; backgrounds&lt;/a&gt;, and I might also spend some time trying to tie the threads. Otherwise, as I said, there will be lots of personal crackpot ideas, and alliteration.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7486674684844560197-2272109298514008138?l=polaro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://polaro.blogspot.com/feeds/2272109298514008138/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7486674684844560197&amp;postID=2272109298514008138' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/2272109298514008138'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7486674684844560197/posts/default/2272109298514008138'/><link rel='alternate' type='text/html' href='http://polaro.blogspot.com/2007/06/preliminaries.html' title='Preliminaries'/><author><name>Noam</name><uri>http://www.blogger.com/profile/09175792123472366590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>
