Questions tagged [curry-howard]

The Curry–Howard correspondence is the direct relationship between computer programs and proofs in programming language theory and proof theory.

Curry–Howard correspondence is also known as Curry–Howard isomorphism, proofs-as-programs correspondence and formulae-as-types correspondence. It is a generalization of a syntactic analogy between systems of formal logic and computational calculi that was first discovered by the American mathematician Haskell Curry and logician William Alvin Howard.

Source http://en.wikipedia.org/wiki/Curry%E2%80%93Howard_correspondence

43 questions
1
vote
1 answer

Why is sum-type a disjunction in the Curry-Howard correspondence?

According to the Curry-Howard correspondence the sum-type aka tagged-union is the equivalent of disjunction, logical OR Why is this the case? Is it not closer to XOR? (a or b) implies that it could be a or b or both, whereas Either a b must be a or…
mazin
  • 395
  • 2
  • 7
1
vote
2 answers

What is a correct way to prove the next propositional logic statement using Curry–Howard correspondence?

I am studying Curry–Howard correspondence. Given propositional logic statement: (¬p -> q) -> ((¬p -> ¬q) -> p). I need to define a type (as proposition) and a function (as a proof) in OCaml. I came up with the next code and stuck: type empty = | ;;…
Oleg Dats
  • 3,933
  • 9
  • 38
  • 61
1
vote
3 answers

What is the name of the programming style enabled by dependent types (think Coq or Agda)?

There is a programming "style" (or maybe paradigm, i'm not sure what to call it) which is as follows: First, you write a specification: a formal description of what your (whole, or part of) program is to do. This is done within the programming…
1
vote
1 answer

Prove exhaustivity of print function based on a string map in Haskell

When I have an "enum" type, that is, an algebraic data type where none of the cases wrap any other data, I commonly like to project a parser/printer off of a mapping to string, to make sure the parser and printer stay in sync as I change code. For…
Keith Pinson
  • 7,835
  • 7
  • 61
  • 104
1
vote
0 answers

Curry-Howard for term synthesis in Isabelle

Say I have proven some basic proposition of intuitionistic propositional logic in Isabelle/HOL: theorem ‹(A ⟶ B) ⟶ ((B ⟶ C) ⟶ (A ⟶ C))› proof - { assume ‹A ⟶ B› { assume ‹B ⟶ C› { assume ‹A› with ‹A ⟶ B› have…
1
vote
2 answers

What's the equivalent of a bug by the Curry-Howard isomorphism?

Simply put, the Curry-Howard correspondence states that a type is a theorem and that a program returning this type is a proof of the corresponding theorem. The correspondence is based on the formalization of mathematical proofs, in languages such as…
V. Semeria
  • 3,128
  • 1
  • 10
  • 25
1
vote
1 answer

What is a "roundabout proof" in Propositions as Types by P. Wadler?

In Propositions as Types, it is written: In 1935, at the age of 25, Gentzen15 introduced not one but two new formulations of logic—natural deduction and sequent calculus—that became established as the two major systems for formulating a logic …
jhegedus
  • 20,244
  • 16
  • 99
  • 167
1
vote
1 answer

Implications as functions in Coq?

I read that implications are functions. But I have a hard time trying to understand the example given in the above mentioned page: The proof term for an implication P → Q is a function that takes evidence for P as input and produces evidence for…
thor
  • 21,418
  • 31
  • 87
  • 173
1
vote
1 answer

Using curry howard to be able to statically ensure two types aren't equal in scala

So I recently read the following blow post: http://www.chuusai.com/2011/06/09/scala-union-types-curry-howard/ And I really appreciated the approach! I am trying to make a function def neq[A,B] = ... Where neq[String, String] would not compile, but…
A Question Asker
  • 3,339
  • 7
  • 31
  • 39
1
vote
1 answer

COQ definition curry howard (A -> B -> C) -> (B -> A -> C) using sets

I've been staring this in the face for hours not understanding :( I need to solve some definitions using coq, and I am supposed to do it via the Curry Howard isomorphism. I have read up and still have no clue what I am doing. I have looked at other…
0
votes
1 answer

How to implement OCaml function with the next type?

I am studying Curry–Howard correspondence. Given propositional logic statement: ¬(p ∨ q) -> (¬p ∧ ¬q). I need to define a type (as proposition) and a function (as a proof) in OCaml. I have defined type but do not know how to implement function: type…
Oleg Dats
  • 3,933
  • 9
  • 38
  • 61
0
votes
1 answer

Curry Howard correspondence in Coq

By Curry Howard correspondence, all theorems and lemmas are types and proof objects are values. As an example: Theorem test: 0 <= 0. Proof. omega. Qed. When I do, Check test. Coq's output is: test : 0 <= 0 But when I check the type of…
Anon
  • 381
  • 1
  • 2
  • 13
0
votes
1 answer

Curry-Howard isomorphism definitions in Coq using fun

I'm having some issues with defining in Coq, more specifically when defining using the CHI. I have managed to gain the understanding of basic principals but when I try to define this" ((A -> (A -> C)) * ((A -> C) -> A)) -> C := I get nowhere due to…
1 2
3