Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If You like "programming" in <a href="http://en.wikipedia.org/wiki/Combinatory_logic" rel="noreferrer">combinatory logic</a>, then</p> <ul> <li>You can automatically "translate" some logic problems into another field: proving equality of combinatory logic terms.</li> <li>With a good functional programming practice, You can solve that,</li> <li>and afterwards, You can translate the answer back to a Hilbert style proof of Your original logic problem.</li> </ul> <p>The possibility of this translation in ensured by <a href="http://en.wikipedia.org/wiki/Curry-Howard_correspondence" rel="noreferrer">Curry-Howard correspondence</a>.</p> <p>Unfortunately, the situation is so simple only for a subset of (propositional) logic: restricted using conditionals. Negation is a complication, I know nothing about that. Thus I cannot answer this concrete question:</p> <p>¬ (<em>α</em> ⊃ ¬<em>β</em>) &nbsp; ⊢ &nbsp; <em>α</em></p> <p>But in cases where negation is not part of the question, the mentioned automatic translation (and back-translation) can be a help, provided that You have already practice in functional programming or combinatory logic.</p> <hr> <p>Of course, there are other helps, too, where we can remain inside the realm of logic:</p> <ul> <li>proving the problem in some more intuitive deductive system (e.g. <a href="http://en.wikipedia.org/wiki/Natural_deduction" rel="noreferrer">natural deduction</a>)</li> <li>and afterwards using <a href="http://en.wikipedia.org/wiki/Metatheorem" rel="noreferrer">metatheorem</a>s that provide a "compiler" possibility: translating the "high-level" proof of natural deduction to the "machine-code" of Hilbert-style deduction system. I mean, for example, the metalogical theorem called "<a href="http://en.wikipedia.org/wiki/Deduction_theorem" rel="noreferrer">deduction theorem</a>".</li> </ul> <hr> <p>As for theorem provers, as far as I know, the capabilities of some of them are extended so that they can harness interactive human assistance. E.g. <a href="http://en.wikipedia.org/wiki/Coq" rel="noreferrer">Coq</a> is such.</p> <hr> <hr> <h1>Appendix</h1> <p>Let us see an example. How to prove <em>α</em> ⊃ <em>α</em>?</p> <h1>Hilbert system</h1> <ul> <li><strong>Verum ex quolibet</strong><sub><em>α</em>,<em>β</em></sub> is assumed as an axiom scheme, stating that sentence <em>α</em> ⊃ <em>β</em> ⊃ <em>α</em> is expected to be deducible, instantiated for any subsentences <em>α</em>,<em>β</em></li> <li><strong>Chain rule</strong><sub><em>α</em>,<em>β</em>,<em>γ</em></sub> is assumed as an axiom scheme, stating that sentence (<em>α</em> ⊃ <em>β</em> ⊃ <em>γ</em>) ⊃ (<em>α</em> ⊃ <em>β</em>) ⊃ <em>α</em> ⊃ <em>γ</em> is expected to be deducible, instantiated for any subsentences <em>α</em>,<em>β</em></li> <li><strong>Modus ponens</strong> is assumed as a rule of inference: provided that <em>α</em> ⊃ <em>β</em> is deducible, and also <em>α</em> is deducible, then we expect to be justified to infer that also <em>α</em> ⊃ <em>β</em> is deducible.</li> </ul> <p>Let us prove theorem: <em>α</em> ⊃ <em>α</em> is deducible for any <em>α</em> proposition.</p> <p>Let us introduce the following notations and abbreviations, developing a "proof calculus":</p> <h2>Proof calculus</h2> <ul> <li><strong>VEQ</strong><sub><em>α</em>,<em>β</em></sub>: &nbsp; ⊢ &nbsp; <em>α</em> ⊃ <em>β</em> ⊃ <em>α</em> </li> <li><strong>CR</strong><sub><em>α</em>,<em>β</em>,<em>γ</em></sub>: &nbsp; ⊢ &nbsp; (<em>α</em> ⊃ <em>β</em> ⊃ <em>γ</em>) ⊃ (<em>α</em> ⊃ <em>β</em>) ⊃ <em>α</em>⊃ <em>γ</em></li> <li><strong>MP</strong>: If &nbsp; ⊢ &nbsp; <em>α</em> ⊃ <em>β</em> and &nbsp; ⊢ &nbsp; <em>α</em>, then also &nbsp; ⊢ &nbsp; <em>β</em></li> </ul> <p>A tree diagram notation:</p> <h3>Axiom scheme — Verum ex quolibet:</h3> <p><br> &nbsp;&nbsp;&nbsp;&nbsp;━━━━━━━━━━━━━━━━━ [<strong>VEQ</strong><sub><em>α</em>,<em>β</em></sub>]<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ⊢ &nbsp; <em>α</em> ⊃ <em>β</em> ⊃ <em>α</em> <br></p> <h3>Axiom scheme — chain rule:</h3> <p><br> &nbsp;&nbsp;&nbsp;&nbsp;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ [<strong>CR</strong><sub><em>α</em>,<em>β</em>,<em>γ</em></sub>]<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ⊢ &nbsp; (<em>α</em> ⊃ <em>β</em> ⊃ <em>γ</em>) ⊃ (<em>α</em> ⊃ <em>β</em>) ⊃ <em>α</em>⊃ <em>γ</em> <br></p> <h3>Rule of inference — modus ponens:</h3> <p><br> &nbsp;&nbsp;&nbsp;&nbsp; ⊢ &nbsp; <em>α</em> ⊃ <em>β</em> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ⊢ &nbsp; <em>α</em><br> &nbsp;&nbsp;&nbsp;&nbsp;━━━━━━━━━━━━━━━━━━━ [<strong>MP</strong>]<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ⊢ &nbsp; <em>β</em></p> <p><br><br></p> <h2>Proof tree</h2> <p>Let us see a tree diagram representation of the proof:<br><br></p> <p><br></p> <p>━━━━━━━━━━━━━━━━━━━━━━━━━━━━&nbsp;[<strong>CR</strong><sub><em>α</em>, <em>α</em>⊃<em>α</em>, <em>α</em></sub>] &nbsp;&nbsp; ━━━━━━━━━━━━━━━&nbsp;[<strong>VEQ</strong><sub><em>α</em>, <em>α</em>⊃<em>α</em></sub>] <br> ⊢ &nbsp; [<em>α</em>⊃(<em>α</em>⊃<em>α</em>)⊃<em>α</em>]⊃(<em>α</em>⊃<em>α</em>⊃<em>α</em>)⊃<em>α</em>⊃<em>α</em> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ⊢ &nbsp; <em>α</em> ⊃ (<em>α</em> ⊃ <em>α</em>) ⊃ <em>α</em> <br> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━&nbsp;[<strong>MP</strong>]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;━━━━━━━━━━━&nbsp;[<strong>VEQ</strong><sub><em>α</em>,<em>α</em></sub>]<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ⊢ &nbsp; (<em>α</em> ⊃ <em>α</em> ⊃ <em>α</em>) ⊃ <em>α</em> ⊃ <em>α</em> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ⊢ &nbsp; <em>α</em> ⊃ <em>α</em> ⊃ <em>α</em> <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━&nbsp;[<strong>MP</strong>]<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ⊢ &nbsp; <em>α</em> ⊃ <em>α</em></p> <h2>Proof formulae</h2> <p>Let us see an even conciser (algebraic? calculus?) representation of the proof:</p> <p>(<strong>CR</strong><sub><em>α</em>,<em>α</em>⊃<em>α</em>,<em>α</em></sub> <strong>VEQ</strong><sub><em>α</em>,<em>α</em> ⊃ <em>α</em></sub>) <strong>VEQ</strong><sub><em>α</em>,<em>α</em></sub>: &nbsp; ⊢ &nbsp; <em>α</em>⊃ <em>α</em></p> <p>so, we can represent the proof tree by a single formula:</p> <ul> <li>the forking of the tree (modus ponens) is rendered by simple concatenation (parentheses),</li> <li>and the leaves of the tree are rendered by the abbreviations of the corresponding axiom names.</li> </ul> <p>It is worth of keep record about the concrete instantiation, that' is typeset here with subindexical parameters.</p> <p>As it will be seen from the series of examples below, we can develop a <em>proof calculus</em>, where axioms are notated as sort of <em>base combinators</em>, and modus ponens is notated as a mere <strong>application</strong> of its "premise" subproofs:</p> <h3>Example 1</h3> <p><strong>VEQ</strong><sub><em>α</em>,<em>β</em></sub>: &nbsp; ⊢ &nbsp; <em>α</em> ⊃ <em>β</em> ⊃ <em>α</em> </p> <p>meant as</p> <p><strong>Verum ex quolibet</strong> axiom scheme instantiated with <em>α</em>,<em>β</em> provides a proof for the statement, that <em>α</em> ⊃ <em>β</em> ⊃ <em>α</em> is deducible.</p> <h3>Example 2</h3> <p><strong>VEQ</strong><sub><em>α</em>,<em>α</em></sub>: &nbsp; ⊢ &nbsp; <em>α</em> ⊃ <em>α</em> ⊃ <em>α</em> </p> <p><strong>Verum ex quolibet</strong> axiom scheme instantiated with <em>α</em>,<em>α</em> provides a proof for the statement, that <em>α</em> ⊃ <em>α</em> ⊃ <em>α</em> is deducible.</p> <h3>Example 3</h3> <p><strong>VEQ</strong><sub><em>α</em>, <em>α</em>⊃<em>α</em></sub>: &nbsp; ⊢ &nbsp; <em>α</em> ⊃ (<em>α</em> ⊃ <em>α</em>) ⊃ <em>α</em></p> <p>meant as</p> <p><strong>Verum ex quolibet</strong> axiom scheme instantiated with <em>α</em>, <em>α</em>⊃<em>α</em> provides a proof for the statement, that <em>α</em> ⊃ (<em>α</em> ⊃ <em>α</em>) ⊃ <em>α</em> is deducible.</p> <h3>Example 4</h3> <p><strong>CR</strong><sub><em>α</em>,<em>β</em>,<em>γ</em></sub>: &nbsp; ⊢ &nbsp; (<em>α</em> ⊃ <em>β</em> ⊃ <em>γ</em>) ⊃ (<em>α</em> ⊃ <em>β</em>) ⊃ <em>α</em>⊃ <em>γ</em></p> <p>meant as</p> <p><strong>Chain rule</strong> axiom scheme instantiated with <em>α</em>,<em>β</em>,<em>γ</em> provides a proof for the statement, that (<em>α</em> ⊃ <em>β</em> ⊃ <em>γ</em>) ⊃ (<em>α</em> ⊃ <em>β</em>) ⊃ <em>α</em>⊃ <em>γ</em> is deducible.</p> <h3>Example 5</h3> <p><strong>CR</strong><sub><em>α</em>,<em>α</em>⊃<em>α</em>,<em>α</em></sub>: &nbsp; ⊢ &nbsp; [<em>α</em> ⊃ (<em>α</em>⊃<em>α</em>) ⊃ <em>α</em>] ⊃ (<em>α</em> ⊃ <em>α</em>⊃<em>α</em>) ⊃ <em>α</em>⊃ <em>α</em></p> <p>meant as</p> <p><strong>Chain rule</strong> axiom scheme instantiated with <em>α</em>,<em>α</em>⊃<em>α</em>,<em>α</em> provides a proof for the statement, that [<em>α</em> ⊃ (<em>α</em>⊃<em>α</em>) ⊃ <em>α</em>] ⊃ (<em>α</em> ⊃ <em>α</em>⊃<em>α</em>) ⊃ <em>α</em>⊃ <em>α</em> is deducible.</p> <h3>Example 6</h3> <p><strong>CR</strong><sub><em>α</em>,<em>α</em>⊃<em>α</em>,<em>α</em></sub> <strong>VEQ</strong><sub><em>α</em>,<em>α</em> ⊃ <em>α</em></sub>: &nbsp; ⊢ &nbsp; (<em>α</em> ⊃ <em>α</em>⊃<em>α</em>) ⊃ <em>α</em>⊃ <em>α</em></p> <p>meant as</p> <p>If we combine <strong>CR</strong><sub><em>α</em>,<em>α</em>⊃<em>α</em>,<em>α</em></sub> and <strong>VEQ</strong><sub><em>α</em>,<em>α</em> ⊃ <em>α</em></sub> together via <strong>modus ponens</strong>, then we get a proof that proves the following statement: (<em>α</em> ⊃ <em>α</em>⊃<em>α</em>) ⊃ <em>α</em>⊃ <em>α</em> is deducible.</p> <h3>Example 7</h3> <p>(<strong>CR</strong><sub><em>α</em>,<em>α</em>⊃<em>α</em>,<em>α</em></sub> <strong>VEQ</strong><sub><em>α</em>,<em>α</em> ⊃ <em>α</em></sub>) <strong>VEQ</strong><sub><em>α</em>,<em>α</em></sub>: &nbsp; ⊢ &nbsp; <em>α</em>⊃ <em>α</em></p> <p>If we combine the compund proof (<strong>CR</strong><sub><em>α</em>,<em>α</em>⊃<em>α</em>,<em>α</em></sub>) together with <strong>VEQ</strong><sub><em>α</em>,<em>α</em> ⊃ <em>α</em></sub> (via <strong>modus ponens</strong>), then we get an even more compund proof. This proves the following statement: <em>α</em>⊃ <em>α</em> is deducible.</p> <h1>Combinatory logic</h1> <p>Although all this above has indeed provided a proof for the expected theorem, but it seems very unintuitive. It cannot be seen how people can "find out" the proof.</p> <p>Let us see another field, where similar problems are investigated.</p> <h2>Untyped combinatory logic</h2> <p><a href="http://en.wikipedia.org/wiki/Combinatory_logic" rel="noreferrer">Combinatory logic</a> can be regarded also as an extremely minimalistic functional programming language. Despite of its minimalism, it entirely Turing complete, but evenmore, one can write quite intuitive and complex programs even in this seemingly obfuscated language, in a modular and reusable way, with some practice gained from "normal" functional programming and some algebraic insights, .</p> <h2>Adding typing rules</h2> <p>Combinatory logic also has typed variants. Syntax is augmented with types, and evenmore, in addition to reduction rules, also typing rules are added.</p> <p>For base combinators:</p> <ul> <li><strong>K</strong><sub><em>α</em>,<em>β</em></sub> is selected as a basic combinator, <a href="http://en.wikipedia.org/wiki/Type_inhabitation" rel="noreferrer">inhabiting type</a> <em>α</em> → <em>β</em> → <em>α</em></li> <li><strong>S</strong><sub><em>α</em>,<em>β</em>,<em>γ</em></sub> is selected as a basic combinator, inhabiting type (<em>α</em> → <em>β</em> → <em>γ</em>) → (<em>α</em> → <em>β</em>) → <em>α</em> → <em>γ</em>.</li> </ul> <p>Typing rule of application:</p> <ul> <li>If <em>X</em> inhabits type <em>α</em> → <em>β</em> and <em>Y</em> inhabits type <em>α</em>, then <em>X</em> <em>Y</em> inhabits type <em>β</em>.</li> </ul> <h3>Notations and abbreviations</h3> <ul> <li><strong>K</strong><sub><em>α</em>,<em>β</em></sub>: <em>α</em> → <em>β</em> → <em>α</em></li> <li><strong>S</strong><sub><em>α</em>,<em>β</em>,<em>γ</em></sub>: (<em>α</em> → <em>β</em> → <em>γ</em>) → (<em>α</em> → <em>β</em>)* → <em>α</em> → <em>γ</em>.</li> <li>If <em>X</em>: <em>α</em> → <em>β</em> and <em>Y</em>: <em>α</em>, then <em>X</em> <em>Y</em>: <em>β</em>.</li> </ul> <h1>Curry-Howard correspondence</h1> <p>It can be seen that the "patterns" are isomorphic in the proof calculus and in this typed combinatory logic.</p> <ul> <li>The <strong>Verum ex quolibet</strong> axiom of the proof calculus corresponds to the <strong>K</strong> base combinator of combinatory logic</li> <li>The <strong>Chain rule</strong> axiom of the proof calculus corresponds to the <strong>S</strong> base combinator of combinatory logic</li> <li>The <strong>Modus ponens</strong> rule of inference in the proof calculus corresponds to the operation "application" in combinatory logic.</li> <li>The "conditional" connective ⊃ of logic corresponds to type constructor → of type theory (and typed combinatory logic)</li> </ul> <h1>Functional programming</h1> <p>But what is the gain? Why should we translate problems to combinatory logic? I, personally, find it sometimes useful, because functional programming is a thing which has a large literature and is applied in practical problems. People can get used to it, when forced to use it in erveryday programming tasks ans pracice. And some tricks and hints of functional programming practice can be exploited very well in combinatory logic reductions. And if a "transferred" practice develops in combinatory logic, then it can be harnessed also in finding proofs in Hilbert system.</p> <h1>External links</h1> <h2>Links how types in functional programming (lambda calculus, combinatory logic) can be translated into logical proofs and theorems:</h2> <ul> <li>Wadler, Philip (1989). <em><a href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.38.9875" rel="noreferrer">Theorems for free!</a></em>. </li> </ul> <h2>Links (or books) how to learn methods and practice to program directly in combinatory logic:</h2> <ul> <li>Madore, David (2003). <a href="http://www.madore.org/~david/programs/unlambda/" rel="noreferrer">The Unlambda Programming Language. Unlambda: Your Functional Programming Language Nightmares Come True</a>.</li> <li>Curry, Haskell B. &amp; Feys, Robert &amp; Craig, William (1958). <em>Combinatory Logic</em>. <strong>Vol. I</strong>. Amsterdam: North-Holland Publishing Company.</li> <li>Tromp, John (1999). <em>Binary Lambda Calculus and Combinatory Logic</em>. Downloadable in PDF and Postscript from the author's <a href="http://homepages.cwi.nl/~tromp/cl/cl.html" rel="noreferrer">John's Lambda Calculus and Combinatory Logic Playground</a>.</li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload