<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Seemingly impossible functional programs</title>
	<atom:link href="http://math.andrej.com/2007/09/28/seemingly-impossible-functional-programs/feed/" rel="self" type="application/rss+xml" />
	<link>http://math.andrej.com/2007/09/28/seemingly-impossible-functional-programs/</link>
	<description>Mathematics for computers</description>
	<lastBuildDate>Mon, 22 Feb 2010 15:48:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Martin Escardo</title>
		<link>http://math.andrej.com/2007/09/28/seemingly-impossible-functional-programs/comment-page-1/#comment-13032</link>
		<dc:creator>Martin Escardo</dc:creator>
		<pubDate>Wed, 16 Dec 2009 09:29:35 +0000</pubDate>
		<guid isPermaLink="false">http://math.andrej.com/2007/09/28/seemingly-impossible-functional-programs/#comment-13032</guid>
		<description>The promised follow-up blog post hasn&#039;t been written, although there is a related one at

http://math.andrej.com/2008/11/21/a-haskell-monad-for-infinite-search-in-finite-time/

There are, however, a couple of papers that develop/apply these ideas, available from my web page, written after this post:

1. Exhaustible sets in higher-type computation
2. (With P. Oliva) Selection functions, bar recursion, and backward induction.
3. Semi-decidability of may, must and probabilistic testing in a higher-type setting.
4. Computability of continuous solutions of higher-type equations.</description>
		<content:encoded><![CDATA[<p>The promised follow-up blog post hasn&#8217;t been written, although there is a related one at</p>
<p><a href="http://math.andrej.com/2008/11/21/a-haskell-monad-for-infinite-search-in-finite-time/" rel="nofollow">http://math.andrej.com/2008/11/21/a-haskell-monad-for-infinite-search-in-finite-time/</a></p>
<p>There are, however, a couple of papers that develop/apply these ideas, available from my web page, written after this post:</p>
<p>1. Exhaustible sets in higher-type computation<br />
2. (With P. Oliva) Selection functions, bar recursion, and backward induction.<br />
3. Semi-decidability of may, must and probabilistic testing in a higher-type setting.<br />
4. Computability of continuous solutions of higher-type equations.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason Orendorff</title>
		<link>http://math.andrej.com/2007/09/28/seemingly-impossible-functional-programs/comment-page-1/#comment-13004</link>
		<dc:creator>Jason Orendorff</dc:creator>
		<pubDate>Wed, 09 Dec 2009 18:06:24 +0000</pubDate>
		<guid isPermaLink="false">http://math.andrej.com/2007/09/28/seemingly-impossible-functional-programs/#comment-13004</guid>
		<description>Martin, this whole post was fascinating but even so those last two sentences pack the biggest punch of all. Where should I look for the follow-up?</description>
		<content:encoded><![CDATA[<p>Martin, this whole post was fascinating but even so those last two sentences pack the biggest punch of all. Where should I look for the follow-up?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: A Rant A Day - The Power of The Functional or: I&#8217;ll bet you can&#8217;t do this in Java</title>
		<link>http://math.andrej.com/2007/09/28/seemingly-impossible-functional-programs/comment-page-1/#comment-10834</link>
		<dc:creator>A Rant A Day - The Power of The Functional or: I&#8217;ll bet you can&#8217;t do this in Java</dc:creator>
		<pubDate>Wed, 10 Dec 2008 02:53:49 +0000</pubDate>
		<guid isPermaLink="false">http://math.andrej.com/2007/09/28/seemingly-impossible-functional-programs/#comment-10834</guid>
		<description>[...] With Lazy Evaluation, an expression isn&#8217;t evaluated as soon as it is created; instead it is delayed until that expression&#8217;s value is needed. One of the neat tricks provided by lazy evaluation is the ability to work with infinite sets - for example, you can literally have a variable which holds all the natural numbers, all the primes, or all the Fibonacci numbers. This sometimes provides rather surprising results - such as the ability to exhaustively search over infinite spaces. [...]</description>
		<content:encoded><![CDATA[<p>[...] With Lazy Evaluation, an expression isn&#8217;t evaluated as soon as it is created; instead it is delayed until that expression&#8217;s value is needed. One of the neat tricks provided by lazy evaluation is the ability to work with infinite sets &#8211; for example, you can literally have a variable which holds all the natural numbers, all the primes, or all the Fibonacci numbers. This sometimes provides rather surprising results &#8211; such as the ability to exhaustively search over infinite spaces. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: What do We Have to Know About a Function in Order to Compute its Definite Integral? &#171; XOR&#8217;s Hammer</title>
		<link>http://math.andrej.com/2007/09/28/seemingly-impossible-functional-programs/comment-page-1/#comment-9297</link>
		<dc:creator>What do We Have to Know About a Function in Order to Compute its Definite Integral? &#171; XOR&#8217;s Hammer</dc:creator>
		<pubDate>Thu, 21 Aug 2008 04:54:50 +0000</pubDate>
		<guid isPermaLink="false">http://math.andrej.com/2007/09/28/seemingly-impossible-functional-programs/#comment-9297</guid>
		<description>[...] Actually this algorithm doesn&#8217;t quite work, as there are some a couple of details that I&#8217;ve omitted, but it is essentially correct.  For more information, see Alex Simpson&#8217;s paper, and for more on Berger&#8217;s work, see Martin Escardó&#8217;s blog post. [...]</description>
		<content:encoded><![CDATA[<p>[...] Actually this algorithm doesn&#8217;t quite work, as there are some a couple of details that I&#8217;ve omitted, but it is essentially correct.  For more information, see Alex Simpson&#8217;s paper, and for more on Berger&#8217;s work, see Martin Escardó&#8217;s blog post. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Escardó</title>
		<link>http://math.andrej.com/2007/09/28/seemingly-impossible-functional-programs/comment-page-1/#comment-5868</link>
		<dc:creator>Martin Escardó</dc:creator>
		<pubDate>Mon, 01 Oct 2007 14:28:45 +0000</pubDate>
		<guid isPermaLink="false">http://math.andrej.com/2007/09/28/seemingly-impossible-functional-programs/#comment-5868</guid>
		<description>I&#039;ve found a way of making the fastest algorithm about 40 faster by avoiding the trees and instead treating functions as trees:
&lt;pre&gt;
&gt; find = find_viii
&gt; findBit :: (Bit -&gt; Bool) -&gt; Bit
&gt; findBit p = if p Zero then Zero else One
&gt; branch :: Bit -&gt; Cantor -&gt; Cantor -&gt; Cantor
&gt; branch x l r n &#124;  n == 0    = x
&gt;                    &#124;  odd n     = l ((n-1) `div` 2)
&gt;                    &#124;  otherwise = r ((n-2) `div` 2)
&gt; find_viii :: (Cantor -&gt; Bool) -&gt; Cantor
&gt; find_viii p = branch x l r
&gt;  where x = findBit(\x -&gt; forsome(\l -&gt; forsome(\r -&gt; p(branch x l r))))
&gt;          l = find_viii(\l -&gt; forsome(\r -&gt; p(branch x l r)))
&gt;          r = find_viii(\r -&gt; p(branch x l r))
&lt;/pre&gt;
This doesn&#039;t need the memoization, because the things one needs to remember are bound to variables in the where-clause. Using this algorithm, comparing f&#039; and g&#039;, and f&#039; and h&#039; for equality moves from 6.75 and 3.20 seconds to respectively 0.14 and 0.09 seconds (using the Glasgow interpreter in all cases).
</description>
		<content:encoded><![CDATA[<p>I&#8217;ve found a way of making the fastest algorithm about 40 faster by avoiding the trees and instead treating functions as trees:</p>
<pre>
&gt; find = find_viii
&gt; findBit :: (Bit -&gt; Bool) -&gt; Bit
&gt; findBit p = if p Zero then Zero else One
&gt; branch :: Bit -&gt; Cantor -&gt; Cantor -&gt; Cantor
&gt; branch x l r n |  n == 0    = x
&gt;                    |  odd n     = l ((n-1) `div` 2)
&gt;                    |  otherwise = r ((n-2) `div` 2)
&gt; find_viii :: (Cantor -&gt; Bool) -&gt; Cantor
&gt; find_viii p = branch x l r
&gt;  where x = findBit(\x -&gt; forsome(\l -&gt; forsome(\r -&gt; p(branch x l r))))
&gt;          l = find_viii(\l -&gt; forsome(\r -&gt; p(branch x l r)))
&gt;          r = find_viii(\r -&gt; p(branch x l r))
</pre>
<p>This doesn&#8217;t need the memoization, because the things one needs to remember are bound to variables in the where-clause. Using this algorithm, comparing f&#8217; and g&#8217;, and f&#8217; and h&#8217; for equality moves from 6.75 and 3.20 seconds to respectively 0.14 and 0.09 seconds (using the Glasgow interpreter in all cases).</p>
]]></content:encoded>
	</item>
</channel>
</rss>
