Site banner
.
Home Forums Blogs Articles Photos Videos Contact FAQ                    
.
.
Wisdom Archive
Body Mind and Soul
Faith and Belief
God and Religion
Law of Attraction
Life and Beyond
Love and Happiness
Peace of Mind
Peace on Earth
Personal Faith
Spiritual Festivals
Spiritual Growth
Spiritual Guidance
Spiritual Inspiration
Spirituality and Science
Spiritual Retreats
More Wisdom
Buddhism Archives
Hinduism Archives
Sustainability
Theology Archives
Even more Wisdom
2012 - Year 2012
Affirmations
Aura
Ayurveda
Chakras
Consciousness
Cultural Creatives
Diksha (Deeksha)
Dream Dictionary
Dream Interpretation
Dream interpreter
Dreams
Enlightenment
Essential Oils
Feng Shui
Flower Essences
Gaia Hypothesis
Indigo Children
Kalki Bhagavan
Karma
Kundalini
Kundalini Yoga
Life after death
Mayan Calendar
Meaning of Dreams
Meditation
Morphogenetic Fields
Psychic Ability
Reincarnation
Spiritual Art, Music & Dance
Spiritual Awakening
Spiritual Enlightenment
Spiritual Healing
Spirituality and Health
Spiritual Jokes
Spiritual Parenting
Vastu Shastra
Womens Spirituality
Yoga Positions
Site map 2
Site map


Dream Sharing Forum

at Global Oneness Community.

Share your dreams and let others help you with the interpretation!
Dream Sharing Forum



.

Curry-Howard - Programs are proofs

Curry-Howard - Programs are proofs: Encyclopedia II - Curry-Howard - Programs are proofs

A second aspect of the Curry-Howard isomorphism is that a program whose type corresponds to a logical formula is itself analogous to a proof of that formula. Consider the two following functions of λ-calculus: K: λxy.x S: λxyz. (x z (y z)) It can be shown that any function can be created by suitable applications of K and S to each other. (See the combinatory logic article for a proof.) For example, the function B ...

See also:

Curry-Howard, Curry-Howard - Types, Curry-Howard - The type inhabitation problem, Curry-Howard - Intuitionistic logic, Curry-Howard - Hilbert-style proofs, Curry-Howard - Programs are proofs, Curry-Howard - Proof of α → α, Curry-Howard - Proof of β → α → γ → β → γ → α, Curry-Howard - Sequent calculus, Curry-Howard - Point of view of category theory

Curry-Howard, Curry-Howard - Hilbert-style proofs, Curry-Howard - Intuitionistic logic, Curry-Howard - Point of view of category theory, Curry-Howard - Programs are proofs, Curry-Howard - Proof of α → α, Curry-Howard - Proof of β → α → γ → β → γ → α, Curry-Howard - Sequent calculus, Curry-Howard - The type inhabitation problem, Curry-Howard - Types, Intuitionistic Type Theory

Curry-Howard: Encyclopedia II - Curry-Howard - Programs are proofs



Curry-Howard - Programs are proofs

A second aspect of the Curry-Howard isomorphism is that a program whose type corresponds to a logical formula is itself analogous to a proof of that formula.

Consider the two following functions of λ-calculus:

K: λxy.x S: λxyz. (x z (y z))

It can be shown that any function can be created by suitable applications of K and S to each other. (See the combinatory logic article for a proof.) For example, the function B defined above is equivalent to (S (K S) K). If a function, such as B, can be expressed as a composition of S and K, the expression can be converted directly into a proof that the type of B, interpreted as a logical formula, is a theorem of intuitionistic logic. Essentially, appearances of K correspond to uses of the first axiom schema, appearances of S correspond to uses of the second axiom schema, and function applications correspond to uses of the modus ponens deduction rule.

The first axiom schema is α → β → α, and this is precisely the type of the K function; similarly the second axiom schema, (α → β → γ) → (α → β) → α → γ, is the type of the S function. Modus ponens says that if we have two expressions, one of type α → β (that is, a function that takes a value of type α and returns a value of type β) and the other of type α (that is, a value of type α) then we should be able to find a value of type β; clearly, we can do this by applying the function to the value; the result will have type β.

Curry-Howard - Proof of α → α

As a simple example, we will construct a proof of the theorem α → α. This is the type of the identity function I = λx.x. The function ((S K) K) is also equivalent to the identity function. As a description of a proof, this says that we need to first apply S to K. We do this as follows:

α → β → α (α → β → γ) → (α → β) → α → γ

If we let γ = α in S, we get:

(α → β → α) → (α → β) → α → α

Since the antecedent of this formula (α → β → α) is a known theorem, and is in fact precisely K, we can apply modus ponens and deduce the consequent:

(α → β) → α → α

This is the type of the function (S K). Now we need to apply this function to K. Again, we manipulate the formula so that the antecedent looks like K, this time by substituting (β → α) for β:

(α → β → α) → α → α

Once again we can use modus ponens to detach the consequent:

α → α

and we are done.

In general, the procedure is that whenever the program contains an application of the form (P Q), we should first prove theorems corresponding to the types of P and Q. Since P is being applied to Q, the type of P must have the form α → β and the type of Q must have the form α for some α and β. We can then detach the conclusion, β, via the modus ponens rule.

Curry-Howard - Proof of β → α → γ → β → γ → α

As a more complicated example, let's look at the theorem that corresponds to the B function. The type of B is (β → α) → (γ → β) → γ → α. B is equivalent to (S (K S) K). This is our roadmap for the proof of the theorem (β → α) → (γ → β) → γ → α.

First we need to construct (K S). We make the antecedent of the K axiom look like the S axiom by setting α equal to (α → β → γ) → (α → β) → α → γ, and β equal to δ:

α → β → α ((α → β → γ) → (α → β) → α → γ) → δ → (α → β → γ) → (α → β) → α → γ

Since the antecedent here is just S, we can detach the consequent:

δ → (α → β → γ) → (α → β) → α → γ

This is the theorem that corresponds to the type of (K S). We now apply S to this expression. Taking S

(α → β → γ) → (α → β) → α → γ

we put α = δ, β = (α → β → γ), and γ = ((α → β) → α → γ), yielding

(δ → (α → β → γ) → (α → β) → α → γ) → (δ → (α → β → γ)) → δ → (α → β) → α → γ

and we then detach the consequent:

(δ → α → β → γ) → δ → (α → β) → α → γ

This is the formula for the type of (S (K S)). A special case of this theorem has δ = (β → γ):

((β → γ) → α → β → γ) → (β → γ) → (α → β) → α → γ

We need to apply this last formula to K. Again, we specialize K, this time by replacing α with (β → γ) and β with α:

α → β → α (β → γ) → α → (β → γ)

This is the same as the antecedent of the prior formula, so we detach the consequent:

(β → γ) → (α → β) → α → γ

Switching the names of the variables α and γ gives us

(β → α) → (γ → β) → γ → α

which was what we had to prove.




Adapted from the Wikipedia article "Programs are proofs", under the G.N U Free Docmentation License. Please also see http://en.wikipedia.org/wiki

More material related to Curry-howard can be found here:
Main Page
for
Curry-howard
Index of Articles
related to
Curry-howard


« Back








Search the Global Oneness web site
Global Oneness is a huge, really huge, web site. Almost whatever you are searching for within health, spirituality, personal development and inspirationals - you will find it here!
Google
 
 

Rate this article!

Please rate this article with 10 as very good and 1 as very poor.

.








Sneak-Peek of Global Oneness Community

Hi friend! The Global Oneness Community, the place for information and sharing about Oneness is not really launched yet (you will see there is still some clean up to do) ...but it is now open for a sneak-peek! And if you wish - please register and become one of the very first members to do so! Jonas

Forum Home, Articles, Photo Gallery, Videos, News, Sitemap
...and much more!


Dream Sharing Forum

at Global Oneness Community.

Share your dreams and let others help you with the interpretation!
Dream Sharing Forum



Forum
Articles
Images Pictures
Videos
News
Sitemap




 

 

 

 

 


 








  » Home » » Home »