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

« back to all changes in this revision

Viewing changes to test-suite/success/unicode_utf8.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
(** PARSER TESTS *)
 
2
 
 
3
(** Check correct separation of identifiers followed by unicode symbols *)
 
4
Notation "x ⊕ w" := (plus x w) (at level 30).
 
5
Check fun x => x⊕x.
 
6
 
 
7
(** Check Greek letters *)
 
8
Definition test_greek : nat -> nat := fun Δ => Δ.
 
9
Parameter ℝ : Set.
 
10
Parameter π : ℝ.
 
11
 
 
12
(** Check indices *)
 
13
Definition test_indices : nat -> nat := fun x₁ => x₁.
 
14
Definition π₂ := snd.
 
15
 
 
16
(** More unicode in identifiers *)
 
17
Definition αβ_áà_אב := 0.
 
18
 
 
19
 
 
20
(** UNICODE IN STRINGS *)
 
21
 
 
22
Require Import List Ascii String.
 
23
Open Scope string_scope.
 
24
 
 
25
Definition test_string := "azertyαβ∀ééé".
 
26
Eval compute in length test_string.
 
27
 (** last six "chars" are unicode, hence represented by 2 bytes,
 
28
     except the forall which is 3 bytes *)
 
29
 
 
30
Fixpoint string_to_list s :=
 
31
  match s with
 
32
    | EmptyString => nil
 
33
    | String c s => c :: string_to_list s
 
34
  end.
 
35
 
 
36
Eval compute in (string_to_list test_string).
 
37
 (** for instance, α is \206\177 whereas ∀ is \226\136\128 *)
 
38
Close Scope string_scope.
 
39
 
 
40
 
 
41
 
 
42
(** INTERFACE TESTS *)
 
43
 
 
44
Require Import Utf8.
 
45
 
 
46
(** Printing of unicode notation, in *goals* *)
 
47
Lemma test : forall A:Prop, A -> A.
 
48
Proof.
 
49
auto.
 
50
Qed.
 
51
 
 
52
(** Parsing of unicode notation, in *goals* *)
 
53
Lemma test2 : ∀A:Prop, A → A.
 
54
Proof.
 
55
intro.
 
56
intro.
 
57
auto.
 
58
Qed.
 
59
 
 
60
(** Printing of unicode notation, in *response* *)
 
61
Check fun (X:Type)(x:X) => x.
 
62
 
 
63
(** Parsing of unicode notation, in *response* *)
 
64
Check ∀Δ, Δ → Δ.
 
65
Check ∀x, x=0 ∨ x=0 → x=0.
 
66
 
 
67
 
 
68
(** ISSUES: *)
 
69
 
 
70
Notation "x ≠ y" := (x<>y) (at level 70).
 
71
 
 
72
Notation "x ≤ y" := (x<=y) (at level 70, no associativity).
 
73
 
 
74
(** First Issue : ≤ is attached to "le" of nat, not to notation <= *)
 
75
 
 
76
Require Import ZArith.
 
77
Open Scope Z_scope.
 
78
Locate "≤". (* still le, not Zle *)
 
79
Notation "x ≤ y" := (x<=y) (at level 70, no associativity).
 
80
Locate "≤".
 
81
Close Scope Z_scope.
 
82
 
 
83
(** ==> How to proceed modularly ? *)
 
84
 
 
85
 
 
86
(** Second Issue : notation for -> generates useless parenthesis
 
87
   if followed by a binder *)
 
88
 
 
89
Check 0≠0 → ∀x:nat,x=x.
 
90
 
 
91
(** Example of real situation : *)
 
92
 
 
93
Definition pred : ∀x, x≠0 → ∃y, x = S y.
 
94
Proof.
 
95
destruct x.
 
96
destruct 1; auto.
 
97
intros _.
 
98
exists x; auto.
 
99
Defined.
 
100
 
 
101
Print pred.
 
102
 
 
103
 
 
104