File: NNumberSyntax.v

package info (click to toggle)
rocq-stdlib 9.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 11,828 kB
  • sloc: python: 2,928; sh: 444; makefile: 319; javascript: 24; ml: 2
file content (50 lines) | stat: -rw-r--r-- 988 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From Stdlib Require Import NArith.
Check 32%N.
Check (eq_refl : 0x2a%N = 42%N).
Check (fun f : nat -> N => (f 0%nat + 0)%N).
Check (fun x : positive => Npos (xO x)).
Check (fun x : positive => (Npos x + 1)%N).
Check (fun x : positive => Npos x).
Check (fun x : positive => Npos (xI x)).
Check (fun x : positive => (Npos (xO x) + 0)%N).
Check (N.of_nat 0 + 1)%N.
Check (0 + N.of_nat (0 + 0))%N.
Check (N.of_nat 0 = 0%N).
Check 0x00%N.
Check 0x01%N.
Check 0x02%N.
Check 0xff%N.
Check 0xFF%N.
Check 0x00%xN.
Check 0x01%xN.
Check 0x02%xN.
Check 0xff%xN.
Check 0xFF%xN.

(* Check hexadecimal printing *)
Open Scope hex_N_scope.
Check 42%N.
Check 0%N.
Check 42%xN.
Check 0%xN.
Check 0x00%N.
Check 0x01%N.
Check 0x02%N.
Check 0xff%N.
Check 0xFF%N.
Check 0x0%xN.
Check 0x00%xN.
Check 0x01%xN.
Check 0x02%xN.
Check 0xff%xN.
Check 0xFF%xN.
Check 0x0.
Check 0x00.
Check 0x01.
Check 0x02.
Check 0xff.
Check 0xFF.
Close Scope hex_N_scope.

From Stdlib Require Import Arith.
Check (0 + N.of_nat 11)%N.