| 1 |
Declare Scope A. |
| 2 |
Declare Scope B. |
| 3 |
Delimit Scope A with A. |
| 4 |
Delimit Scope B with B. |
| 5 |
Definition to_unit (v : Number.uint) : option unit |
| 6 |
:= match Nat.of_num_uint v with O => Some tt | _ => None end. |
| 7 |
Definition of_unit (v : unit) : Number.uint := Nat.to_num_uint 0. |
| 8 |
Definition of_unit' (v : unit) : Number.uint := Nat.to_num_uint 1. |
| 9 |
Number Notation unit to_unit of_unit : A. |
| 10 |
Number Notation unit to_unit of_unit' : B. |
| 11 |
Definition f x : unit := x. |
| 12 |
Check f tt. |
| 13 |
Arguments f x%_A. |
| 14 |
Check f tt. |
| 15 |
Check tt. |
| 16 |
Open Scope A. |
| 17 |
Check tt. |
| 18 |
Close Scope A. |
| 19 |
Check tt. |
| 20 |
Open Scope B. |
| 21 |
Check tt. |
| 22 |
Undelimit Scope B. |
| 23 |
Check tt. |
| 24 |
Open Scope A. |
| 25 |
Check tt. |
| 26 |
Close Scope A. |
| 27 |
Check tt. |
| 28 |
Close Scope B. |
| 29 |
Check tt. |
| 30 |
Open Scope B. |
| 31 |
Check tt. |
| 32 |
Notation "1" := true. |
| 33 |
Check tt. |
| 34 |
Open Scope A. |
| 35 |
Check tt. |
| 36 |
Declare Scope C. |
| 37 |
Notation "0" := false : C. |
| 38 |
Open Scope C. |
| 39 |
Check tt. (* gives 0 but should now be 0%A *) |