3
(** Check correct separation of identifiers followed by unicode symbols *)
4
Notation "x ⊕ w" := (plus x w) (at level 30).
7
(** Check Greek letters *)
8
Definition test_greek : nat -> nat := fun Δ => Δ.
13
Definition test_indices : nat -> nat := fun x₁ => x₁.
16
(** More unicode in identifiers *)
17
Definition αβ_áà_אב := 0.
20
(** UNICODE IN STRINGS *)
22
Require Import List Ascii String.
23
Open Scope string_scope.
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 *)
30
Fixpoint string_to_list s :=
33
| String c s => c :: string_to_list s
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.
42
(** INTERFACE TESTS *)
46
(** Printing of unicode notation, in *goals* *)
47
Lemma test : forall A:Prop, A -> A.
52
(** Parsing of unicode notation, in *goals* *)
53
Lemma test2 : ∀A:Prop, A → A.
60
(** Printing of unicode notation, in *response* *)
61
Check fun (X:Type)(x:X) => x.
63
(** Parsing of unicode notation, in *response* *)
65
Check ∀x, x=0 ∨ x=0 → x=0.
70
Notation "x ≠ y" := (x<>y) (at level 70).
72
Notation "x ≤ y" := (x<=y) (at level 70, no associativity).
74
(** First Issue : ≤ is attached to "le" of nat, not to notation <= *)
76
Require Import ZArith.
78
Locate "≤". (* still le, not Zle *)
79
Notation "x ≤ y" := (x<=y) (at level 70, no associativity).
83
(** ==> How to proceed modularly ? *)
86
(** Second Issue : notation for -> generates useless parenthesis
87
if followed by a binder *)
89
Check 0≠0 → ∀x:nat,x=x.
91
(** Example of real situation : *)
93
Definition pred : ∀x, x≠0 → ∃y, x = S y.