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

« back to all changes in this revision

Viewing changes to contrib/correctness/ProgBool.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
(************************************************************************)
 
2
(*  v      *   The Coq Proof Assistant  /  The Coq Development Team     *)
 
3
(* <O___,, * CNRS-Ecole Polytechnique-INRIA Futurs-Universite Paris Sud *)
 
4
(*   \VV/  **************************************************************)
 
5
(*    //   *      This file is distributed under the terms of the       *)
 
6
(*         *       GNU Lesser General Public License Version 2.1        *)
 
7
(************************************************************************)
 
8
 
 
9
(* Certification of Imperative Programs / Jean-Christophe Filli�tre *)
 
10
 
 
11
(* $Id: ProgBool.v 5920 2004-07-16 20:01:26Z herbelin $ *)
 
12
 
 
13
Require Import ZArith.
 
14
Require Export Bool_nat.
 
15
Require Export Sumbool.
 
16
 
 
17
Definition annot_bool :
 
18
  forall b:bool, {b' : bool | if b' then b = true else b = false}.
 
19
Proof.
 
20
intro b.
 
21
exists b. case b; trivial.
 
22
Qed.
 
23
 
 
24
 
 
25
(* Logical connectives *)
 
26
 
 
27
Definition spec_and (A B C D:Prop) (b:bool) := if b then A /\ C else B \/ D.
 
28
 
 
29
Definition prog_bool_and :
 
30
  forall Q1 Q2:bool -> Prop,
 
31
    sig Q1 ->
 
32
    sig Q2 ->
 
33
    {b : bool | if b then Q1 true /\ Q2 true else Q1 false \/ Q2 false}.
 
34
Proof.
 
35
intros Q1 Q2 H1 H2.
 
36
elim H1. intro b1. elim H2. intro b2. 
 
37
case b1; case b2; intros.
 
38
exists true; auto.
 
39
exists false; auto. exists false; auto. exists false; auto.
 
40
Qed.
 
41
 
 
42
Definition spec_or (A B C D:Prop) (b:bool) := if b then A \/ C else B /\ D.
 
43
 
 
44
Definition prog_bool_or :
 
45
  forall Q1 Q2:bool -> Prop,
 
46
    sig Q1 ->
 
47
    sig Q2 ->
 
48
    {b : bool | if b then Q1 true \/ Q2 true else Q1 false /\ Q2 false}.
 
49
Proof.
 
50
intros Q1 Q2 H1 H2.
 
51
elim H1. intro b1. elim H2. intro b2. 
 
52
case b1; case b2; intros.
 
53
exists true; auto. exists true; auto. exists true; auto.
 
54
exists false; auto.
 
55
Qed.
 
56
 
 
57
Definition spec_not (A B:Prop) (b:bool) := if b then B else A.
 
58
 
 
59
Definition prog_bool_not :
 
60
  forall Q:bool -> Prop, sig Q -> {b : bool | if b then Q false else Q true}.
 
61
Proof.
 
62
intros Q H.
 
63
elim H. intro b.
 
64
case b; intro.
 
65
exists false; auto. exists true; auto.
 
66
Qed.