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

« back to all changes in this revision

Viewing changes to test-suite/success/Case9.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
Inductive List (A : Set) : Set :=
 
2
  | Nil : List A
 
3
  | Cons : A -> List A -> List A.
 
4
 
 
5
Inductive eqlong : List nat -> List nat -> Prop :=
 
6
  | eql_cons :
 
7
      forall (n m : nat) (x y : List nat),
 
8
      eqlong x y -> eqlong (Cons nat n x) (Cons nat m y)
 
9
  | eql_nil : eqlong (Nil nat) (Nil nat).
 
10
 
 
11
 
 
12
Parameter V1 : eqlong (Nil nat) (Nil nat) \/ ~ eqlong (Nil nat) (Nil nat).
 
13
Parameter
 
14
  V2 :
 
15
    forall (a : nat) (x : List nat),
 
16
    eqlong (Nil nat) (Cons nat a x) \/ ~ eqlong (Nil nat) (Cons nat a x).
 
17
Parameter
 
18
  V3 :
 
19
    forall (a : nat) (x : List nat),
 
20
    eqlong (Cons nat a x) (Nil nat) \/ ~ eqlong (Cons nat a x) (Nil nat).
 
21
Parameter
 
22
  V4 :
 
23
    forall (a : nat) (x : List nat) (b : nat) (y : List nat),
 
24
    eqlong (Cons nat a x) (Cons nat b y) \/
 
25
    ~ eqlong (Cons nat a x) (Cons nat b y).
 
26
 
 
27
Parameter
 
28
  nff :
 
29
    forall (n m : nat) (x y : List nat),
 
30
    ~ eqlong x y -> ~ eqlong (Cons nat n x) (Cons nat m y).
 
31
Parameter
 
32
  inv_r : forall (n : nat) (x : List nat), ~ eqlong (Nil nat) (Cons nat n x).
 
33
Parameter
 
34
  inv_l : forall (n : nat) (x : List nat), ~ eqlong (Cons nat n x) (Nil nat).
 
35
 
 
36
Fixpoint eqlongdec (x y : List nat) {struct x} :
 
37
 eqlong x y \/ ~ eqlong x y :=
 
38
  match x, y return (eqlong x y \/ ~ eqlong x y) with
 
39
  | Nil, Nil => or_introl (~ eqlong (Nil nat) (Nil nat)) eql_nil
 
40
  | Nil, Cons a x as L => or_intror (eqlong (Nil nat) L) (inv_r a x)
 
41
  | Cons a x as L, Nil => or_intror (eqlong L (Nil nat)) (inv_l a x)
 
42
  | Cons a x as L1, Cons b y as L2 =>
 
43
      match eqlongdec x y return (eqlong L1 L2 \/ ~ eqlong L1 L2) with
 
44
      | or_introl h => or_introl (~ eqlong L1 L2) (eql_cons a b x y h)
 
45
      | or_intror h => or_intror (eqlong L1 L2) (nff a b x y h)
 
46
      end
 
47
  end.
 
48
 
 
49
 
 
50
Type
 
51
  match Nil nat as x, Nil nat as y return (eqlong x y \/ ~ eqlong x y) with
 
52
  | Nil, Nil => or_introl (~ eqlong (Nil nat) (Nil nat)) eql_nil
 
53
  | Nil, Cons a x as L => or_intror (eqlong (Nil nat) L) (inv_r a x)
 
54
  | Cons a x as L, Nil => or_intror (eqlong L (Nil nat)) (inv_l a x)
 
55
  | Cons a x as L1, Cons b y as L2 =>
 
56
      match eqlongdec x y return (eqlong L1 L2 \/ ~ eqlong L1 L2) with
 
57
      | or_introl h => or_introl (~ eqlong L1 L2) (eql_cons a b x y h)
 
58
      | or_intror h => or_intror (eqlong L1 L2) (nff a b x y h)
 
59
      end
 
60
  end.
 
61