Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Looking for simple examples of constructive logic and Curry-Howard isomorphism

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Looking for simple examples of constructive logic and Curry-Howard isomorphism


Chronological Thread 
  • From: Robbert Krebbers <mailinglists AT robbertkrebbers.nl>
  • To: David MENTRÉ <dmentre AT linux-france.org>
  • Cc: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Looking for simple examples of constructive logic and Curry-Howard isomorphism
  • Date: Tue, 19 Nov 2013 22:03:16 +0100

On 11/19/2013 08:27 PM, David MENTRÉ wrote:
* Curry-Howard isomorphism: a very simple Coq theorem (on Boolean or
integers) with associated proof, from which I could also generate OCaml
code and show the Coq type.
What about something simple like:

Lemma minus : forall x y : nat, y <= x -> { z | x = y + z }.
Proof.
induction x as [|x IH].
{ exists 0. omega. }
intros [|y] ?.
{ exists (S x). omega. }
destruct (IH y) as [z Hz]. omega. exists z. omega.
Defined.

Extraction minus.
(*
(** val minus : nat -> nat -> nat **)

let rec minus n y =
match n with
| O -> O
| S n0 ->
(match y with
| O -> S n0
| S y0 -> minus n0 y0)
*)



Archive powered by MHonArc 2.6.18.

Top of Page