~ubuntu-branches/ubuntu/wily/coq-doc/wily

« back to all changes in this revision

Viewing changes to contrib/subtac/test/id.v

  • Committer: Bazaar Package Importer
  • Author(s): Stéphane Glondu, Stéphane Glondu, Samuel Mimram
  • Date: 2010-01-07 22:50:39 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100107225039-n3cq82589u0qt0s2
Tags: 8.2pl1-1
[ Stéphane Glondu ]
* New upstream release (Closes: #563669)
  - remove patches
* Packaging overhaul:
  - use git, advertise it in Vcs-* fields of debian/control
  - use debhelper 7 and dh with override
  - use source format 3.0 (quilt)
* debian/control:
  - set Maintainer to d-o-m, set Uploaders to Sam and myself
  - add Homepage field
  - bump Standards-Version to 3.8.3
* Register PDF documentation into doc-base
* Add debian/watch
* Update debian/copyright

[ Samuel Mimram ]
* Change coq-doc's description to mention that it provides documentation in
  pdf format, not postscript, closes: #543545.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Require Coq.Arith.Arith.
 
2
 
 
3
Require Import Coq.subtac.Utils.
 
4
Program Fixpoint id (n : nat) : { x : nat | x = n } :=
 
5
  match n with
 
6
  | O => O
 
7
  | S p => S (id p)
 
8
  end.
 
9
intros ; auto.
 
10
 
 
11
pose (subset_simpl (id p)).
 
12
simpl in e.
 
13
unfold p0.
 
14
rewrite e.
 
15
auto.
 
16
Defined.
 
17
 
 
18
Check id.
 
19
Print id.
 
20
Extraction id.
 
21
 
 
22
Axiom le_gt_dec : forall n m, { n <= m } + { n > m }.
 
23
Require Import Omega.
 
24
 
 
25
Program Fixpoint id_if (n : nat) { wf n lt }: { x : nat | x = n } :=
 
26
  if le_gt_dec n 0 then 0
 
27
  else S (id_if (pred n)).
 
28
intros.
 
29
auto with arith.
 
30
intros.
 
31
pose (subset_simpl (id_if (pred n))).
 
32
simpl in e.
 
33
rewrite e.
 
34
induction n ; auto with arith.
 
35
Defined.
 
36
 
 
37
Print id_if_instance.
 
38
Extraction id_if_instance.
 
39
 
 
40
Notation "( x & y )" := (@existS _ _ x y) : core_scope.
 
41
 
 
42
Program Definition testsig ( a : nat ) : { x : nat & { y : nat | x = y }} :=
 
43
  (a & a).
 
44
intros.
 
45
auto.
 
46
Qed.