Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club]automatically entering proof mode and inlining proofs

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club]automatically entering proof mode and inlining proofs


chronological Thread 
  • From: Thery Laurent <thery AT ns.di.univaq.it>
  • To: "Ryan J Wisnesky." <ryan AT eecs.harvard.edu>
  • Cc: coq-club AT pauillac.inria.fr
  • Subject: Re: [Coq-Club]automatically entering proof mode and inlining proofs
  • Date: Tue, 27 Feb 2007 10:37:38 +0100 (CET)
  • List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>

Here it is

Require Import List.
Require Import Le.
Require Import Compare_dec.

Definition hd (A:Set) (l : list A) :=
   match l return (length l > 0 -> A) with
   | nil    => fun H : length nil > 0 => False_rec A (le_Sn_O 0 H)
   | a :: _ => fun _ => a
   end.


Definition f (l2: list nat) : option nat.
intros l2.
refine(
  if zerop (length l2) then None else
  Some (hd nat l2 _)
  );
auto.
Defined.






Archive powered by MhonArc 2.6.16.

Top of Page