<?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"
	>
<channel>
	<title>Comments on: Proving the existence of curry</title>
	<atom:link href="http://blog.tmorris.net/proving-the-existence-of-curry/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tmorris.net/proving-the-existence-of-curry/</link>
	<description>The weblog of Tony Morris</description>
	<pubDate>Sat, 19 May 2012 03:02:58 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: Daniel Jimenez</title>
		<link>http://blog.tmorris.net/proving-the-existence-of-curry/#comment-14095</link>
		<dc:creator>Daniel Jimenez</dc:creator>
		<pubDate>Fri, 12 Sep 2008 17:47:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tmorris.net/?p=285#comment-14095</guid>
		<description>So I took a crack at implementing S.s (see below).

I think I understand it: return an implication that, given an implication from a conjunction, returns an implication to an implication.

My implementation just solves the type signatures, which wasn't very hard. I don't like that the two definitions of A (one is an argument to implies, one is an argument to and) aren't referring to each other, though. I tried to write S.s1 and S.s2 to isolate it but couldn't quite tie them together.

Another place where I had trouble understanding it was in the call to what S.s returns. As can be seen from my Call.call, I'm hardcoding the return values of the conjunction and the initial implication. But I want to say that the implication from a conjunction only makes sense if you have both parts of the conjunction, and returning a hardcoded b for any a doesn't seem right in that way.

Worse, I end up passing b twice, once hardcoded as the return value from the conjunction, and once when calling the original method.

Where did I go wrong? I'm pretty sure it's my understanding of Conjunction that's incorrect here (I remember and understand first-order logic just fine, I mean how those definitions apply to this Java code).

// curry.java
interface Implication&#60;P, Q&#62; {
&#160;Q implies(P p);
}

interface Conjunction&#60;P, Q&#62; {
&#160;Q and(P p);
}

class S {
&#160;/**
&#160; * return an implication that, given an implication from a conjunction, returns an implication to an implication
&#160; * given: (A^B)-&#62;C, return: A-&#62;(B-&#62;C), overall: [(A^B)-&#62;C] -&#62; [A-&#62;(B-&#62;C)]
&#160; */
&#160;static &#60;A, B, C&#62; Implication&#60;Implication&#60;Conjunction&#60;A, B&#62;, C&#62;, Implication&#60;A, Implication&#60;B, C&#62;&#62;&#62; s() {
&#160;&#160;return new Implication&#60;Implication&#60;Conjunction&#60;A, B&#62;, C&#62;, Implication&#60;A, Implication&#60;B, C&#62;&#62;&#62;()
&#160;&#160;{
&#160;&#160;&#160;public Implication&#60;A, Implication&#60;B, C&#62;&#62; implies(final Implication&#60;Conjunction&#60;A, B&#62;, C&#62; i) {
&#160;&#160;&#160;&#160;return new Implication&#60;A, Implication&#60;B, C&#62;&#62;()
&#160;&#160;&#160;&#160;{
&#160;&#160;&#160;&#160;&#160;public Implication&#60;B, C&#62; implies(final A a) {
&#160;&#160;&#160;&#160;&#160;&#160;return new Implication&#60;B, C&#62;()
&#160;&#160;&#160;&#160;&#160;&#160;{
&#160;&#160;&#160;&#160;&#160;&#160;&#160;public C implies(final B b) {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return i.implies(new Conjunction&#60;A, B&#62;()
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;public B and(A a) {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return b;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;});
&#160;&#160;&#160;&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;&#160;&#160;};
&#160;&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;};
&#160;&#160;&#160;}
&#160;&#160;};
&#160;}
&#160;static &#60;A, B, C&#62; Implication&#60;A, Implication&#60;B, C&#62;&#62; s1(final Implication&#60;Conjunction&#60;A, B&#62;, C&#62; i) {
&#160;&#160;return new Implication&#60;A, Implication&#60;B, C&#62;&#62;()
&#160;&#160;{
&#160;&#160;&#160;public Implication&#60;B, C&#62; implies(final A a) {
&#160;&#160;&#160;&#160;return new Implication&#60;B, C&#62;()
&#160;&#160;&#160;&#160;{
&#160;&#160;&#160;&#160;&#160;public C implies(final B b) {
&#160;&#160;&#160;&#160;&#160;&#160;return i.implies(new Conjunction&#60;A, B&#62;()
&#160;&#160;&#160;&#160;&#160;&#160;{
&#160;&#160;&#160;&#160;&#160;&#160;&#160;public B and(A a) {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return b;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;&#160;&#160;});
&#160;&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;};
&#160;&#160;&#160;}
&#160;&#160;};
&#160;}
&#160;static &#60;A, B, C&#62; Implication&#60;B, C&#62; s2(final A a) {
&#160;&#160;return new Implication&#60;B, C&#62;()
&#160;&#160;{
&#160;&#160;&#160;public C implies(final B b) {
&#160;&#160;&#160;&#160;&#160;throw new Error(); // surely not correct, but I'm stuck here
&#160;&#160;&#160;&#160;&#160;// s2(a).implies(conj.and(a))
&#160;&#160;&#160;}
&#160;&#160;};
&#160;}
}

class Call {
&#160;static int call(final boolean a, final String b, final int c) {
&#160;&#160;Conjunction&#60;Boolean, String&#62; and = new Conjunction&#60;Boolean, String&#62;() {
&#160;&#160;&#160;public String and(Boolean p) {
&#160;&#160;&#160;&#160;return b;
&#160;&#160;&#160;}
&#160;&#160;};
&#160;&#160;Implication&#60;Conjunction&#60;Boolean, String&#62;, Integer&#62; from = new Implication&#60;Conjunction&#60;Boolean, String&#62;, Integer&#62;() {
&#160;&#160;&#160;public Integer implies(Conjunction&#60;Boolean, String&#62; conjunction) {
&#160;&#160;&#160;&#160;return c;
&#160;&#160;&#160;}
&#160;&#160;};
&#160;&#160;Implication&#60;Implication&#60;Conjunction&#60;Boolean, String&#62;, Integer&#62;, Implication&#60;Boolean, Implication&#60;String, Integer&#62;&#62;&#62; s = S.s();
&#160;&#160;Implication&#60;Boolean, Implication&#60;String, Integer&#62;&#62; to = s.implies(from);
&#160;&#160;return to.implies(a).implies(b);
&#160;}
}

public class curry {
&#160;&#160;public static void main( String[] args ) {
&#160;&#160;&#160;&#160;int result = Call.call(true, &#34;two&#34;, 0);
&#160;&#160;&#160;&#160;System.out.println(&#34;call(true, \&#34;two\&#34;, 0)=&#34; + result);
&#160;&#160;}
}</description>
		<content:encoded><![CDATA[<p>So I took a crack at implementing S.s (see below).</p>
<p>I think I understand it: return an implication that, given an implication from a conjunction, returns an implication to an implication.</p>
<p>My implementation just solves the type signatures, which wasn&#8217;t very hard. I don&#8217;t like that the two definitions of A (one is an argument to implies, one is an argument to and) aren&#8217;t referring to each other, though. I tried to write S.s1 and S.s2 to isolate it but couldn&#8217;t quite tie them together.</p>
<p>Another place where I had trouble understanding it was in the call to what S.s returns. As can be seen from my Call.call, I&#8217;m hardcoding the return values of the conjunction and the initial implication. But I want to say that the implication from a conjunction only makes sense if you have both parts of the conjunction, and returning a hardcoded b for any a doesn&#8217;t seem right in that way.</p>
<p>Worse, I end up passing b twice, once hardcoded as the return value from the conjunction, and once when calling the original method.</p>
<p>Where did I go wrong? I&#8217;m pretty sure it&#8217;s my understanding of Conjunction that&#8217;s incorrect here (I remember and understand first-order logic just fine, I mean how those definitions apply to this Java code).</p>
<p>// curry.java<br />
interface Implication&lt;P, Q&gt; {<br />
&nbsp;Q implies(P p);<br />
}</p>
<p>interface Conjunction&lt;P, Q&gt; {<br />
&nbsp;Q and(P p);<br />
}</p>
<p>class S {<br />
&nbsp;/**<br />
&nbsp; * return an implication that, given an implication from a conjunction, returns an implication to an implication<br />
&nbsp; * given: (A^B)-&gt;C, return: A-&gt;(B-&gt;C), overall: [(A^B)-&gt;C] -&gt; [A-&gt;(B-&gt;C)]<br />
&nbsp; */<br />
&nbsp;static &lt;A, B, C&gt; Implication&lt;Implication&lt;Conjunction&lt;A, B&gt;, C&gt;, Implication&lt;A, Implication&lt;B, C&gt;&gt;&gt; s() {<br />
&nbsp;&nbsp;return new Implication&lt;Implication&lt;Conjunction&lt;A, B&gt;, C&gt;, Implication&lt;A, Implication&lt;B, C&gt;&gt;&gt;()<br />
&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;public Implication&lt;A, Implication&lt;B, C&gt;&gt; implies(final Implication&lt;Conjunction&lt;A, B&gt;, C&gt; i) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;return new Implication&lt;A, Implication&lt;B, C&gt;&gt;()<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public Implication&lt;B, C&gt; implies(final A a) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return new Implication&lt;B, C&gt;()<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public C implies(final B b) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return i.implies(new Conjunction&lt;A, B&gt;()<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public B and(A a) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return b;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;};<br />
&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;};<br />
&nbsp;}<br />
&nbsp;static &lt;A, B, C&gt; Implication&lt;A, Implication&lt;B, C&gt;&gt; s1(final Implication&lt;Conjunction&lt;A, B&gt;, C&gt; i) {<br />
&nbsp;&nbsp;return new Implication&lt;A, Implication&lt;B, C&gt;&gt;()<br />
&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;public Implication&lt;B, C&gt; implies(final A a) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;return new Implication&lt;B, C&gt;()<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public C implies(final B b) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return i.implies(new Conjunction&lt;A, B&gt;()<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public B and(A a) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return b;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;};<br />
&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;};<br />
&nbsp;}<br />
&nbsp;static &lt;A, B, C&gt; Implication&lt;B, C&gt; s2(final A a) {<br />
&nbsp;&nbsp;return new Implication&lt;B, C&gt;()<br />
&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;public C implies(final B b) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw new Error(); // surely not correct, but I&#8217;m stuck here<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// s2(a).implies(conj.and(a))<br />
&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;};<br />
&nbsp;}<br />
}</p>
<p>class Call {<br />
&nbsp;static int call(final boolean a, final String b, final int c) {<br />
&nbsp;&nbsp;Conjunction&lt;Boolean, String&gt; and = new Conjunction&lt;Boolean, String&gt;() {<br />
&nbsp;&nbsp;&nbsp;public String and(Boolean p) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;return b;<br />
&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;};<br />
&nbsp;&nbsp;Implication&lt;Conjunction&lt;Boolean, String&gt;, Integer&gt; from = new Implication&lt;Conjunction&lt;Boolean, String&gt;, Integer&gt;() {<br />
&nbsp;&nbsp;&nbsp;public Integer implies(Conjunction&lt;Boolean, String&gt; conjunction) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;return c;<br />
&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;};<br />
&nbsp;&nbsp;Implication&lt;Implication&lt;Conjunction&lt;Boolean, String&gt;, Integer&gt;, Implication&lt;Boolean, Implication&lt;String, Integer&gt;&gt;&gt; s = S.s();<br />
&nbsp;&nbsp;Implication&lt;Boolean, Implication&lt;String, Integer&gt;&gt; to = s.implies(from);<br />
&nbsp;&nbsp;return to.implies(a).implies(b);<br />
&nbsp;}<br />
}</p>
<p>public class curry {<br />
&nbsp;&nbsp;public static void main( String[] args ) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;int result = Call.call(true, &quot;two&quot;, 0);<br />
&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(&quot;call(true, \&quot;two\&quot;, 0)=&quot; + result);<br />
&nbsp;&nbsp;}<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bobby Moretti</title>
		<link>http://blog.tmorris.net/proving-the-existence-of-curry/#comment-12433</link>
		<dc:creator>Bobby Moretti</dc:creator>
		<pubDate>Sat, 06 Sep 2008 01:35:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tmorris.net/?p=285#comment-12433</guid>
		<description>@Apocalisp: double negation doesn't always work so well. You picked a rather specific example. You can think of other ones that are a lot more gray. For example, suppose P stands for "Jim Bob is a likable fellow".

Then consider !!P: 'it's not the case that Jim Bob is not a likable fellow'.  If we allow this form of double negation rule, then this would imply P, or 'Jim Bob is a likable fellow.' But can we really infer that? It might be the case that everyone is ambivalent towards Jim Bob: he's kinda likable, but also kinda unlikable.

The problem with the !!P &#124;-- P form of double negation is that assumes that P is either true or false; there's no middle ground. That's what's known as the law of excluded middle. So there are systems of logic (such as the one that Pseudonym is referring to) that deal with more truth values than just purely true and purely false.</description>
		<content:encoded><![CDATA[<p>@Apocalisp: double negation doesn&#8217;t always work so well. You picked a rather specific example. You can think of other ones that are a lot more gray. For example, suppose P stands for &#8220;Jim Bob is a likable fellow&#8221;.</p>
<p>Then consider !!P: &#8216;it&#8217;s not the case that Jim Bob is not a likable fellow&#8217;.  If we allow this form of double negation rule, then this would imply P, or &#8216;Jim Bob is a likable fellow.&#8217; But can we really infer that? It might be the case that everyone is ambivalent towards Jim Bob: he&#8217;s kinda likable, but also kinda unlikable.</p>
<p>The problem with the !!P |&#8211; P form of double negation is that assumes that P is either true or false; there&#8217;s no middle ground. That&#8217;s what&#8217;s known as the law of excluded middle. So there are systems of logic (such as the one that Pseudonym is referring to) that deal with more truth values than just purely true and purely false.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Apocalisp</title>
		<link>http://blog.tmorris.net/proving-the-existence-of-curry/#comment-12276</link>
		<dc:creator>Apocalisp</dc:creator>
		<pubDate>Fri, 05 Sep 2008 14:59:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tmorris.net/?p=285#comment-12276</guid>
		<description>Pseudonym: That's not not utter nonsense.</description>
		<content:encoded><![CDATA[<p>Pseudonym: That&#8217;s not not utter nonsense.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pseudonym</title>
		<link>http://blog.tmorris.net/proving-the-existence-of-curry/#comment-12259</link>
		<dc:creator>Pseudonym</dc:creator>
		<pubDate>Fri, 05 Sep 2008 11:14:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tmorris.net/?p=285#comment-12259</guid>
		<description>DavidLG: Even without a truth table, in intuitionistic logic, !!a does not necessarily imply a (though a does imply !!a).  This is a direct consequence of not including the law of the excluded middle as an axiom.</description>
		<content:encoded><![CDATA[<p>DavidLG: Even without a truth table, in intuitionistic logic, !!a does not necessarily imply a (though a does imply !!a).  This is a direct consequence of not including the law of the excluded middle as an axiom.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tony Morris</title>
		<link>http://blog.tmorris.net/proving-the-existence-of-curry/#comment-12256</link>
		<dc:creator>Tony Morris</dc:creator>
		<pubDate>Fri, 05 Sep 2008 10:04:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tmorris.net/?p=285#comment-12256</guid>
		<description>David,
There are many methods of proof, but the point is really the relationship to C-H. I am often faced by people who are baffled by the implication symbol in type signatures and I think it is demystified a little by pointing out its relationship to a simple boolean operator.</description>
		<content:encoded><![CDATA[<p>David,<br />
There are many methods of proof, but the point is really the relationship to C-H. I am often faced by people who are baffled by the implication symbol in type signatures and I think it is demystified a little by pointing out its relationship to a simple boolean operator.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DavidLG</title>
		<link>http://blog.tmorris.net/proving-the-existence-of-curry/#comment-12255</link>
		<dc:creator>DavidLG</dc:creator>
		<pubDate>Fri, 05 Sep 2008 09:57:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tmorris.net/?p=285#comment-12255</guid>
		<description>(That was supposed to be static &#60;X&#62; X foo().)</description>
		<content:encoded><![CDATA[<p>(That was supposed to be static &lt;X&gt; X foo().)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DavidLG</title>
		<link>http://blog.tmorris.net/proving-the-existence-of-curry/#comment-12254</link>
		<dc:creator>DavidLG</dc:creator>
		<pubDate>Fri, 05 Sep 2008 09:55:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tmorris.net/?p=285#comment-12254</guid>
		<description>The statement can be quickly proved without a truth table.

a-&#62;b is logically the same as (!a + b), meaning (not a) or b.  So the statement in question is !(!(ab) + c) + (!a + (!b + c)), which simplifies with one application of de Morgan's law to (ab + !c + !a + !b + c), which is obviously true.

What does the Java snippet show?  Do the Implication and Conjunction interfaces have any semantics, or are they interchangeable?  How many implementations of static  X foo() are there, and why is your method more interesting?  I guess I must be missing your point, I'm just a Scala programmer. :)</description>
		<content:encoded><![CDATA[<p>The statement can be quickly proved without a truth table.</p>
<p>a-&gt;b is logically the same as (!a + b), meaning (not a) or b.  So the statement in question is !(!(ab) + c) + (!a + (!b + c)), which simplifies with one application of de Morgan&#8217;s law to (ab + !c + !a + !b + c), which is obviously true.</p>
<p>What does the Java snippet show?  Do the Implication and Conjunction interfaces have any semantics, or are they interchangeable?  How many implementations of static  X foo() are there, and why is your method more interesting?  I guess I must be missing your point, I&#8217;m just a Scala programmer. <img src='http://blog.tmorris.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pseudonym</title>
		<link>http://blog.tmorris.net/proving-the-existence-of-curry/#comment-12208</link>
		<dc:creator>Pseudonym</dc:creator>
		<pubDate>Fri, 05 Sep 2008 01:33:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tmorris.net/?p=285#comment-12208</guid>
		<description>Be careful using truth tables.  A theorem which is true in Boolean logic may not be true in a topos, and in intuitionistic logic in particular.</description>
		<content:encoded><![CDATA[<p>Be careful using truth tables.  A theorem which is true in Boolean logic may not be true in a topos, and in intuitionistic logic in particular.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

