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

« back to all changes in this revision

Viewing changes to contrib/subtac/test/euclid.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 Import Coq.Program.Program.
 
2
Require Import Coq.Arith.Compare_dec.
 
3
Notation "( x & y )" := (existS _ x y) : core_scope.
 
4
  
 
5
Require Import Omega.
 
6
 
 
7
Program Fixpoint euclid (a : nat) (b : { b : nat | b <> O }) {wf lt a}  :
 
8
  { q : nat & { r : nat | a = b * q + r /\ r < b } } :=
 
9
  if le_lt_dec b a then let (q', r) := euclid (a - b) b in 
 
10
  (S q' & r)
 
11
  else (O & a).
 
12
 
 
13
Next Obligation.
 
14
  assert(b * S q' = b * q' + b) by auto with arith ; omega.
 
15
Defined.
 
16
 
 
17
Program Definition test_euclid : (prod nat nat) := let (q, r) := euclid 4 2 in (q, q).
 
18
 
 
19
Eval lazy beta zeta delta iota in test_euclid.
 
20
 
 
21
Program Definition testsig (a : nat) : { x : nat & { y : nat | x < y } } :=
 
22
  (a & S a).
 
23
 
 
24
Check testsig.