<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Compact data types</title>
	<atom:link href="http://lukepalmer.wordpress.com/2008/12/07/compact-data-types/feed/" rel="self" type="application/rss+xml" />
	<link>http://lukepalmer.wordpress.com/2008/12/07/compact-data-types/</link>
	<description>Functional programming and mathematical philosophy with musical interludes</description>
	<lastBuildDate>Sun, 15 Nov 2009 05:54:57 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Martin Escardo</title>
		<link>http://lukepalmer.wordpress.com/2008/12/07/compact-data-types/#comment-555</link>
		<dc:creator>Martin Escardo</dc:creator>
		<pubDate>Fri, 12 Dec 2008 09:12:26 +0000</pubDate>
		<guid isPermaLink="false">http://lukepalmer.wordpress.com/?p=643#comment-555</guid>
		<description>Here is is another way of defining the Cantor space.
(I use the notation of my original post.)

cantor&#039; :: S [Bool]
cantor&#039; = image (False:) cantor&#039; `union` image (True:) cantor&#039;

If you unfold the definitions, you conclude that this is the same as Berger&#039;s algorithm in the post &quot;seemimgly impossible functional programs&quot;.

And here is yet another natural way of defining search of the lazy natural numbers:

mu :: (Nat -&gt; Bool) -&gt; Nat
mu p = if p Zero then Zero else Succ(mu(p.Succ))

This is the minimization operator from recursion theory, except that you get infty rather than bottom.
Then nat as you defined it is equal to (S mu).

(Thus, mu is to nat as berger&#039;s algorithm is to cantor&#039;.)</description>
		<content:encoded><![CDATA[<p>Here is is another way of defining the Cantor space.<br />
(I use the notation of my original post.)</p>
<p>cantor&#8217; :: S [Bool]<br />
cantor&#8217; = image (False:) cantor&#8217; `union` image (True:) cantor&#8217;</p>
<p>If you unfold the definitions, you conclude that this is the same as Berger&#8217;s algorithm in the post &#8220;seemimgly impossible functional programs&#8221;.</p>
<p>And here is yet another natural way of defining search of the lazy natural numbers:</p>
<p>mu :: (Nat -&gt; Bool) -&gt; Nat<br />
mu p = if p Zero then Zero else Succ(mu(p.Succ))</p>
<p>This is the minimization operator from recursion theory, except that you get infty rather than bottom.<br />
Then nat as you defined it is equal to (S mu).</p>
<p>(Thus, mu is to nat as berger&#8217;s algorithm is to cantor&#8217;.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luke</title>
		<link>http://lukepalmer.wordpress.com/2008/12/07/compact-data-types/#comment-554</link>
		<dc:creator>Luke</dc:creator>
		<pubDate>Fri, 12 Dec 2008 00:37:08 +0000</pubDate>
		<guid isPermaLink="false">http://lukepalmer.wordpress.com/?p=643#comment-554</guid>
		<description>Martin, thanks for your comments.  These topological ideas are getting clearer with every minute. :-)

When I said &quot;haskell ADTs&quot;, I was implicitly assuming no arrows, thus polynomial functors, and &quot;no strict fields&quot; is the maximal notion of totality you referred to.  Cool, maybe I&#039;ll try to prove it using the surjection approach you outlined.

The &quot;unamb&quot; package implements said parallel or. 

I get the impression that topology could be pretty important to software engineering once we have the tools to talk about it.  That&#039;s why I&#039;m interested in this stuff.</description>
		<content:encoded><![CDATA[<p>Martin, thanks for your comments.  These topological ideas are getting clearer with every minute. :-)</p>
<p>When I said &#8220;haskell ADTs&#8221;, I was implicitly assuming no arrows, thus polynomial functors, and &#8220;no strict fields&#8221; is the maximal notion of totality you referred to.  Cool, maybe I&#8217;ll try to prove it using the surjection approach you outlined.</p>
<p>The &#8220;unamb&#8221; package implements said parallel or. </p>
<p>I get the impression that topology could be pretty important to software engineering once we have the tools to talk about it.  That&#8217;s why I&#8217;m interested in this stuff.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Escardo</title>
		<link>http://lukepalmer.wordpress.com/2008/12/07/compact-data-types/#comment-553</link>
		<dc:creator>Martin Escardo</dc:creator>
		<pubDate>Wed, 10 Dec 2008 22:42:31 +0000</pubDate>
		<guid isPermaLink="false">http://lukepalmer.wordpress.com/?p=643#comment-553</guid>
		<description>Luke, 

One further comment. I like very much your concise way of introducing compactness into the picture, in particular the sentence &quot;If we could figure out a way to form topological spaces on our data types, then we can know whether they are exhaustively searchable (and construct algorithms to search them).&quot;. 

Martin</description>
		<content:encoded><![CDATA[<p>Luke, </p>
<p>One further comment. I like very much your concise way of introducing compactness into the picture, in particular the sentence &#8220;If we could figure out a way to form topological spaces on our data types, then we can know whether they are exhaustively searchable (and construct algorithms to search them).&#8221;. </p>
<p>Martin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Escardo</title>
		<link>http://lukepalmer.wordpress.com/2008/12/07/compact-data-types/#comment-552</link>
		<dc:creator>Martin Escardo</dc:creator>
		<pubDate>Wed, 10 Dec 2008 22:11:32 +0000</pubDate>
		<guid isPermaLink="false">http://lukepalmer.wordpress.com/?p=643#comment-552</guid>
		<description>Just a few remarks. 

(1) Here is another way of seeing that the total elements of the lazy natural numbers (including infty) is searchable. (Topologically, this set (with the relative Scott topology), is the so-called one-point compactification of the discrete natural numbers. 

surjection :: [Bool] -&gt; Nat
surjection(False:xs) = Succ(surjection xs)
surjection(True:_) = Zero

nat&#039; :: Set Nat
nat&#039; = image surjection cantor

where cantor is defined as in the cited post.

(2) For your conjecture about searchability of (total) elements of domain equations (data declarations in Haskell) to be true, you will have to impose restrictions, for two reasons:

(i) For data declarations such as

data D = Function(D -&gt; Bool)

involving so called contravariant occurrences of the defined type, Gordon Plotkin showed that there is no notion of totality (I heard this in a talk in 1997 in a Domains Workshop in Munich, but I don&#039;t think he published that). 

(ii) So assume that you only have covariant occurrences (i.e. only on the righthand side of an arrow). You will still have problems. Consider e.g.

data Tree = Branch(Integer -&gt; Tree)

The total elements are the well founded omega-branching trees. But this cannot be searchable as it is not compact. 

So you have to restrict further. One good candidate are the so-called polynomial functors (defined using finite products and sums). Now if you look for the initial solution of the domain equation then you get a minimal notion of totality, and if you look at the final solution (which includes the previous elements plus infinite objects), you get a maximal notion of totality. For the second one, your conjecture ought to be true. 

(3) Regarding searchable = compact + overt, claimed by Andrej, we have to be careful. I think he has in mind his joint work with Paul Taylor. But now there are a few differences, which certainly need to be clarified. Firstly their work is in the framework of ASD (I understand a bit about this, but I am far from an expert, and Andrej knows much more about that), which at the moment doesn&#039;t apply to Haskell (but this may change in the near future). On the other hand, the work here is in the classical framework of higher-type computability theory established by Kleene and Kreisel, which applies to (a large subset of) Haskell. In ASD you use a Sierpinski type (roughly corresponding to the unit type in Haskell) to define compact (universal quantifier) and overt (existential quantifier), rather than the booleans.
This makes a big difference, because, as Andrej said, booleans classify clopen sets (=open-and-closed sets), whereas the Sierpinski space classifies open sets. If you want to avoid topology, clopen corresponds to decidable in computability theory, and open corresponds to semi-decidable. If you have Sierpinski valued universal and existential quantifiers for the same subset of a type, and moreover you have weak-parallel or, you can certainly construct a boolean valued quantifier. The converse is much trickier. The inputs of the boolean valued quantifier are decidable predicates. How do you construct from this quantifier two quantifiers that accept semi-decidable predicates as inputs? Well, this actually turns out to be possible by a results proved in previous work. You first show that every searchable subset turns out to be a computable image of the Cantor space (rather tricky, and useless, brute force algorithm, using the so-called Kleene-Kreisel density theorem). Now, the cantor space is both (effectively) Sierpinski-compact and Sierpinski-overt, and this property is preserved by computable images. So Andrej is right. (I was doubtful when he said that, and actually wrote to him saying that, postponing a reply to think a bit about that.) But notice that one direction of the proof depends on weak-parallel or, which cannot be defined in Haskell (unless you allow unsafePerformIO and concurrency). 

(4) Andrej said that I define compactness wrt clopens. I don&#039;t. But, it turns out, a subset of a higher-type over the integers, is compact wrt opens iff it is compact wrt clopens. This is a crucial lemma in the development of the theory of searchability, but is not my definition of compactness (I take the usual definition).

(5) Here &quot;totality&quot; is rather important. I have little clue what arbitrary searchable subsets (including partial elements) look like. It is not that I didn&#039;t bother because partial elements tend to be uninteresting. It is rather than total elements, sets of total elements, and total functions turn out to have very good properties for the subject of searchability (and very bad properties for other considerations).</description>
		<content:encoded><![CDATA[<p>Just a few remarks. </p>
<p>(1) Here is another way of seeing that the total elements of the lazy natural numbers (including infty) is searchable. (Topologically, this set (with the relative Scott topology), is the so-called one-point compactification of the discrete natural numbers. </p>
<p>surjection :: [Bool] -&gt; Nat<br />
surjection(False:xs) = Succ(surjection xs)<br />
surjection(True:_) = Zero</p>
<p>nat&#8217; :: Set Nat<br />
nat&#8217; = image surjection cantor</p>
<p>where cantor is defined as in the cited post.</p>
<p>(2) For your conjecture about searchability of (total) elements of domain equations (data declarations in Haskell) to be true, you will have to impose restrictions, for two reasons:</p>
<p>(i) For data declarations such as</p>
<p>data D = Function(D -&gt; Bool)</p>
<p>involving so called contravariant occurrences of the defined type, Gordon Plotkin showed that there is no notion of totality (I heard this in a talk in 1997 in a Domains Workshop in Munich, but I don&#8217;t think he published that). </p>
<p>(ii) So assume that you only have covariant occurrences (i.e. only on the righthand side of an arrow). You will still have problems. Consider e.g.</p>
<p>data Tree = Branch(Integer -&gt; Tree)</p>
<p>The total elements are the well founded omega-branching trees. But this cannot be searchable as it is not compact. </p>
<p>So you have to restrict further. One good candidate are the so-called polynomial functors (defined using finite products and sums). Now if you look for the initial solution of the domain equation then you get a minimal notion of totality, and if you look at the final solution (which includes the previous elements plus infinite objects), you get a maximal notion of totality. For the second one, your conjecture ought to be true. </p>
<p>(3) Regarding searchable = compact + overt, claimed by Andrej, we have to be careful. I think he has in mind his joint work with Paul Taylor. But now there are a few differences, which certainly need to be clarified. Firstly their work is in the framework of ASD (I understand a bit about this, but I am far from an expert, and Andrej knows much more about that), which at the moment doesn&#8217;t apply to Haskell (but this may change in the near future). On the other hand, the work here is in the classical framework of higher-type computability theory established by Kleene and Kreisel, which applies to (a large subset of) Haskell. In ASD you use a Sierpinski type (roughly corresponding to the unit type in Haskell) to define compact (universal quantifier) and overt (existential quantifier), rather than the booleans.<br />
This makes a big difference, because, as Andrej said, booleans classify clopen sets (=open-and-closed sets), whereas the Sierpinski space classifies open sets. If you want to avoid topology, clopen corresponds to decidable in computability theory, and open corresponds to semi-decidable. If you have Sierpinski valued universal and existential quantifiers for the same subset of a type, and moreover you have weak-parallel or, you can certainly construct a boolean valued quantifier. The converse is much trickier. The inputs of the boolean valued quantifier are decidable predicates. How do you construct from this quantifier two quantifiers that accept semi-decidable predicates as inputs? Well, this actually turns out to be possible by a results proved in previous work. You first show that every searchable subset turns out to be a computable image of the Cantor space (rather tricky, and useless, brute force algorithm, using the so-called Kleene-Kreisel density theorem). Now, the cantor space is both (effectively) Sierpinski-compact and Sierpinski-overt, and this property is preserved by computable images. So Andrej is right. (I was doubtful when he said that, and actually wrote to him saying that, postponing a reply to think a bit about that.) But notice that one direction of the proof depends on weak-parallel or, which cannot be defined in Haskell (unless you allow unsafePerformIO and concurrency). </p>
<p>(4) Andrej said that I define compactness wrt clopens. I don&#8217;t. But, it turns out, a subset of a higher-type over the integers, is compact wrt opens iff it is compact wrt clopens. This is a crucial lemma in the development of the theory of searchability, but is not my definition of compactness (I take the usual definition).</p>
<p>(5) Here &#8220;totality&#8221; is rather important. I have little clue what arbitrary searchable subsets (including partial elements) look like. It is not that I didn&#8217;t bother because partial elements tend to be uninteresting. It is rather than total elements, sets of total elements, and total functions turn out to have very good properties for the subject of searchability (and very bad properties for other considerations).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luke</title>
		<link>http://lukepalmer.wordpress.com/2008/12/07/compact-data-types/#comment-551</link>
		<dc:creator>Luke</dc:creator>
		<pubDate>Mon, 08 Dec 2008 09:56:13 +0000</pubDate>
		<guid isPermaLink="false">http://lukepalmer.wordpress.com/?p=643#comment-551</guid>
		<description>Thanks for your clarifications, Andrej.

For my conjecture, I&#039;m thinking in the modeled type, with possibly infinite elements and no bottoms.  The domain structure induces the topology, but bottoms are not included in that topology.  In that way, the strict naturals:


data Nat = Zero &#124; Succ !Nat


have a discrete topology because it is a flat domain.

I&#039;m just barely starting to learn about ASD, but the literature is a bit over my head (I&#039;m trying though!).  Maybe I&#039;ll know what overt means in a few weeks :-)</description>
		<content:encoded><![CDATA[<p>Thanks for your clarifications, Andrej.</p>
<p>For my conjecture, I&#8217;m thinking in the modeled type, with possibly infinite elements and no bottoms.  The domain structure induces the topology, but bottoms are not included in that topology.  In that way, the strict naturals:</p>
<p>data Nat = Zero | Succ !Nat</p>
<p>have a discrete topology because it is a flat domain.</p>
<p>I&#8217;m just barely starting to learn about ASD, but the literature is a bit over my head (I&#8217;m trying though!).  Maybe I&#8217;ll know what overt means in a few weeks :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrej Bauer</title>
		<link>http://lukepalmer.wordpress.com/2008/12/07/compact-data-types/#comment-550</link>
		<dc:creator>Andrej Bauer</dc:creator>
		<pubDate>Mon, 08 Dec 2008 09:17:06 +0000</pubDate>
		<guid isPermaLink="false">http://lukepalmer.wordpress.com/?p=643#comment-550</guid>
		<description>First a small correction: when you define the Scott topology you say &quot;To construct a topology (the Scott topology?) for the type, generate it by the sets of all compatible elements with some finite element of the domain.&quot; That should read: &quot;generate it by the sets which are above all some finite element of the domain&quot;. The word &quot;compatible&quot; means &quot;have common upper bound&quot;, which would give you more than you want.

As far as your conjecture is concerned, all Scott domains are compact, quite obviously: if you have an open cover, then some element of the cover already covers the bottom element, but then it covers the whole space (because open sets are upper sets).

But this is not quite what Martin was talking about. He considers compactness with respect to clopen sets (simultaneously open and closed), not open ones. I think in the case of Kleene-Kreisel types, as he calls them, it does not make a difference. Also, &quot;compact&quot; is not the same as searchable. &quot;Compact and overt&quot; is the same as searchable.</description>
		<content:encoded><![CDATA[<p>First a small correction: when you define the Scott topology you say &#8220;To construct a topology (the Scott topology?) for the type, generate it by the sets of all compatible elements with some finite element of the domain.&#8221; That should read: &#8220;generate it by the sets which are above all some finite element of the domain&#8221;. The word &#8220;compatible&#8221; means &#8220;have common upper bound&#8221;, which would give you more than you want.</p>
<p>As far as your conjecture is concerned, all Scott domains are compact, quite obviously: if you have an open cover, then some element of the cover already covers the bottom element, but then it covers the whole space (because open sets are upper sets).</p>
<p>But this is not quite what Martin was talking about. He considers compactness with respect to clopen sets (simultaneously open and closed), not open ones. I think in the case of Kleene-Kreisel types, as he calls them, it does not make a difference. Also, &#8220;compact&#8221; is not the same as searchable. &#8220;Compact and overt&#8221; is the same as searchable.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
