{"id":310,"date":"2007-02-15T21:45:30","date_gmt":"2007-02-15T21:45:30","guid":{"rendered":"http:\/\/scientopia.org\/blogs\/goodmath\/2007\/02\/15\/not-quite-basics-the-logicians-idea-of-calculus\/"},"modified":"2007-02-15T21:45:30","modified_gmt":"2007-02-15T21:45:30","slug":"not-quite-basics-the-logicians-idea-of-calculus","status":"publish","type":"post","link":"http:\/\/www.goodmath.org\/blog\/2007\/02\/15\/not-quite-basics-the-logicians-idea-of-calculus\/","title":{"rendered":"Not quite Basics: The Logician&#039;s Idea of Calculus"},"content":{"rendered":"<p>In yesterdays basics post, I alluded to the second kind of calculus &#8211; the thing that computer scientists like me call <em>a<\/em> calculus. Multiple people have asked  me to explain what our kind of calculus is.<\/p>\n<p> In the worlds of computer science and logic, calculus isn&#8217;t a particular thing:<br \/>\nit&#8217;s a <em>kind<\/em> of thing. A calculus is a sort of a logician&#8217;s automaton: a purely<br \/>\nsymbolic system where there is a set of rules about how to perform transformations of<br \/>\nany value string of symbols. The classic example is <a href=\"http:\/\/scienceblogs.com\/goodmath\/goodmath\/lambda_calculus\/\">lambda calculus<\/a>,<br \/>\nwhich I&#8217;ve written about before, but there are numerous other calculi.<\/p>\n<p><!--more--><\/p>\n<p> For a few examples: here are two calculi designed by one of my favorite researchers, Robin Milner, for describing distributed computation with communication: the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Calculus_of_Communicating_Systems\">calculus of communicating systems (CCS)<\/a>, and the <a href=\"http:\/\/www.lfcs.inf.ed.ac.uk\/reports\/91\/ECS-LFCS-91-180\/\">&pi; calculus<\/a>. Another great programming language researcher, Luca Cardelli, designed <a href=\"http:\/\/citeseer.ist.psu.edu\/abadi96imperative.html\">a calculus for describing object-oriented computation<\/a>. There&#8217;s another calculus that combines properties of Cardelli&#8217;s object calculus and &pi;-calculus, called <a href=\"http:\/\/join.inria.fr\/\">Join calculus<\/a>. At some point, I&#8217;m going to do some writing about &pi; calculus here &#8211; I did a lot of &pi;-calculus work for my dissertation, and I think it&#8217;s remarkably cool.<\/p>\n<p> Just to give you a very brief idea of what I mean by this kind of thing, I&#8217;ll<br \/>\ngive you a quick taste of lambda calculus. To see an explanation of lambda calculus and how it works, you can look <a href=\"http:\/\/scientopia.org\/blogs\/goodmath\/2006\/08\/a-lambda-calculus-rerun\">here<\/a>.<\/p>\n<p> Assuming that we handwave a bit to let us use recursion (lambda calculus allows recursion, but it does it by way of a fairly complicated construction called the <a href=\"http:\/\/scientopia.org\/blogs\/goodmath\/2006\/08\/why-oh-why-y\">Y combinator<\/a>); and also assuming we have Peano arithmetic (so we have numbers, comparison, increment, and decrement) we can write a general addition function as:<\/p>\n<p>Add &equiv; &lambda; x y . if (= x 0) y (Add (Dec x) (Inc y))<\/p>\n<p> The way that this would &#8220;run&#8221; on an example like 2+3 is:<\/p>\n<ol>\n<li> Add 2 3 &equiv; if (= 2 0) 3 (Add (Dec 2) (Inc 3)) = (Add 1 4)<\/li>\n<li> Add 1 4 &equiv; if (= 1 0) 4 (Add (Dec 1) (Inc 4)) = (Add 0 5)<\/li>\n<li> Add 0 5 &equiv; if (= 0 0) 5 (Add (Dec 0) (Inc 5)) = 5<\/li>\n<\/ol>\n<p> One important thing to understand that sequence is that <em>if<\/em> is a function with three arguments: a test expression, and expressions for the true and false cases. It&#8217;s all functions in lambda calculus.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In yesterdays basics post, I alluded to the second kind of calculus &#8211; the thing that computer scientists like me call a calculus. Multiple people have asked me to explain what our kind of calculus is. In the worlds of computer science and logic, calculus isn&#8217;t a particular thing: it&#8217;s a kind of thing. A [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[74],"tags":[],"class_list":["post-310","post","type-post","status-publish","format-standard","hentry","category-basics"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4lzZS-50","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/310","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/comments?post=310"}],"version-history":[{"count":0,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/310\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/media?parent=310"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/categories?post=310"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/tags?post=310"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}