coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: fr�d�ric BESSON <fbesson AT irisa.fr>
- 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 11:54:46 +0100
- List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>
Hello,
As already shown by Laurent Thery, refine does the job.
Personnaly, I have just discovered Program and like it very much!
I cannot resist; here is the script.
(Note that Program does not require a dependant match to accept hd - very nice.)
Program Definition hd (A:Set) (l : list A) : forall (H : (length l > 0)%nat), A :=
fun H =>
match l with
| nil => _ (* Here a proof that it cannot happen *)
| a :: _ => a
end.
Next Obligation.
apply False_rec.
compute in H ; omega.
Qed.
Program Definition head (l: list nat) : option nat :=
if zerop (length l) then None else
Some (hd nat l _).
(* Trivial proof obligation discharged by auto *)
--
Frédéric Besson
- [Coq-Club]automatically entering proof mode and inlining proofs, Ryan J. Wisnesky
- Re: [Coq-Club]automatically entering proof mode and inlining proofs,
Pierre Courtieu
- Re: [Coq-Club]automatically entering proof mode and inlining proofs,
Ryan J Wisnesky.
- Re: [Coq-Club]automatically entering proof mode and inlining proofs, Pierre Courtieu
- Re: [Coq-Club]automatically entering proof mode and inlining proofs, Thery Laurent
- Re: [Coq-Club]automatically entering proof mode and inlining proofs, frédéric BESSON
- Re: [Coq-Club]automatically entering proof mode and inlining proofs, Matthieu Sozeau
- Re: [Coq-Club]automatically entering proof mode and inlining proofs, Ryan J. Wisnesky
- Re: [Coq-Club]automatically entering proof mode and inlining proofs,
Ryan J Wisnesky.
- Re: [Coq-Club]automatically entering proof mode and inlining proofs, Matthieu Sozeau
- Re: [Coq-Club]automatically entering proof mode and inlining proofs, Thery Laurent
- Re: [Coq-Club]automatically entering proof mode and inlining proofs,
Pierre Courtieu
Archive powered by MhonArc 2.6.16.