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

« back to all changes in this revision

Viewing changes to test-suite/success/Case17.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
(* Check the synthesis of predicate from a cast in case of matching of
 
2
   the first component (here [list bool]) of a dependent type (here [sigS])
 
3
   (Simplification of an example from file parsing2.v of the Coq'Art
 
4
    exercises) *)
 
5
 
 
6
Require Import List.
 
7
 
 
8
Variable parse_rel : list bool -> list bool -> nat -> Prop.
 
9
 
 
10
Variables (l0 : list bool)
 
11
  (rec :
 
12
     forall l' : list bool,
 
13
     length l' <= S (length l0) ->
 
14
     {l'' : list bool & 
 
15
     {t : nat | parse_rel l' l'' t /\ length l'' <= length l'}} +
 
16
     {(forall (l'' : list bool) (t : nat), ~ parse_rel l' l'' t)}).
 
17
 
 
18
Axiom HHH : forall A : Prop, A.
 
19
 
 
20
Check
 
21
  (match rec l0 (HHH _) with
 
22
   | inleft (existS (false :: l1) _) => inright _ (HHH _)
 
23
   | inleft (existS (true :: l1) (exist t1 (conj Hp Hl))) =>
 
24
       inright _ (HHH _)
 
25
   | inleft (existS _ _) => inright _ (HHH _)
 
26
   | inright Hnp => inright _ (HHH _)
 
27
   end
 
28
   :{l'' : list bool & 
 
29
    {t : nat | parse_rel (true :: l0) l'' t /\ length l'' <= S (length l0)}} +
 
30
    {(forall (l'' : list bool) (t : nat), ~ parse_rel (true :: l0) l'' t)}).
 
31
 
 
32
(* The same but with relative links to l0 and rec *)
 
33
 
 
34
Check
 
35
  (fun (l0 : list bool)
 
36
     (rec : forall l' : list bool,
 
37
            length l' <= S (length l0) ->
 
38
            {l'' : list bool & 
 
39
            {t : nat | parse_rel l' l'' t /\ length l'' <= length l'}} +
 
40
            {(forall (l'' : list bool) (t : nat), ~ parse_rel l' l'' t)}) =>
 
41
   match rec l0 (HHH _) with
 
42
   | inleft (existS (false :: l1) _) => inright _ (HHH _)
 
43
   | inleft (existS (true :: l1) (exist t1 (conj Hp Hl))) =>
 
44
       inright _ (HHH _)
 
45
   | inleft (existS _ _) => inright _ (HHH _)
 
46
   | inright Hnp => inright _ (HHH _)
 
47
   end
 
48
   :{l'' : list bool & 
 
49
    {t : nat | parse_rel (true :: l0) l'' t /\ length l'' <= S (length l0)}} +
 
50
    {(forall (l'' : list bool) (t : nat), ~ parse_rel (true :: l0) l'' t)}).