Skip to content

Commit 499c6e5

Browse files
add Zmod, including Bits and minimal Zstar (#144)
1 parent 94590a1 commit 499c6e5

File tree

14 files changed

+2894
-1
lines changed

14 files changed

+2894
-1
lines changed

.nix/rocq-overlays/stdlib-subcomponents/default.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ let
2525
"strings" = [ "arith" ];
2626
"lia" = [ "arith" "narith" ];
2727
"zarith" = [ "lia" ];
28+
"zmod" = [ "zarith" "sorting" "field" ];
2829
"qarith-base" = [ "ring" ];
2930
"field" = [ "zarith" ];
3031
"lqa" = [ "field" "qarith-base" ];
@@ -47,7 +48,7 @@ let
4748
"wellfounded" = [ "lists" ];
4849
"streams" = [ "logic" ];
4950
"rtauto" = [ "positive" "lists" ];
50-
"compat" = [ "rtauto" "fmaps-fsets-msets" "funind" "extraction" "reals" "wellfounded" "streams" ];
51+
"compat" = [ "rtauto" "fmaps-fsets-msets" "funind" "extraction" "reals" "zmod" "wellfounded" "streams" ];
5152
"all" = [ "compat" ];
5253
};
5354

doc/changelog/02-added/144-Zmod.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
- in `Zmod.v`
2+
3+
+ Added theory of modular integer arithmetic, including machine words /
4+
bitvectors and the multiplicative group of integers modulo another integer.
5+
About 450 lemmas are provided
6+
(`#144 <https://github.com/coq/stdlib/pull/144>`_,
7+
by Andres Erbsen).
8+

doc/stdlib/depends.dot

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ digraph stdlib_deps {
1919
reals -> nsatz;
2020
"arith-base" -> structures;
2121
zarith -> lia;
22+
zmod -> zarith;
23+
zmod -> sorting;
24+
zmod -> field;
2225
qarith -> lqa;
2326
positive -> "arith-base";
2427
narith -> ring;
@@ -62,6 +65,7 @@ digraph stdlib_deps {
6265
funind -> "arith-base";
6366
rtauto -> positive;
6467
rtauto -> lists;
68+
compat -> zmod;
6569
compat -> reals;
6670
compat -> "fmaps-fsets-msets";
6771
compat -> wellfounded;

doc/stdlib/index-list.html.template

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,22 @@ through the <tt>From Stdlib Require Import</tt> command.</p>
307307
theories/Numbers/HexadecimalZ.v
308308
</dd>
309309

310+
<dt> <a name="zmod"></a><b>Zmod and Zstar</b>:
311+
Modular arithmetic -- integers modulo another integer -- including machine
312+
words (bitvectors) and the multiplicative group of integers modulo another
313+
integer.
314+
</dt>
315+
<dd>
316+
theories/Zmod/Zmod.v
317+
theories/Zmod/Bits.v
318+
theories/Zmod/Zstar.v
319+
(theories/Zmod/ZmodDef.v)
320+
(theories/Zmod/ZstarDef.v)
321+
(theories/Zmod/ZmodBase.v)
322+
(theories/Zmod/ZstarBase.v)
323+
(theories/Zmod/ZmodInv.v)
324+
</dd>
325+
310326
<dt> <a name="unicode"></a><b>Unicode</b>:
311327
Unicode-based alternative notations
312328
</dt>

theories/All/All.v

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,3 +567,11 @@ From Stdlib Require Export Arith.PeanoNat.
567567
From Stdlib Require Export Arith.Peano_dec.
568568
From Stdlib Require Export Arith.Wf_nat.
569569
From Stdlib Require Export Arith.Zerob.
570+
From Stdlib Require Export Zmod.Zmod.
571+
From Stdlib Require Export Zmod.ZmodDef.
572+
From Stdlib Require Export Zmod.ZmodBase.
573+
From Stdlib Require Export Zmod.ZmodInv.
574+
From Stdlib Require Export Zmod.Zstar.
575+
From Stdlib Require Export Zmod.ZstarDef.
576+
From Stdlib Require Export Zmod.ZstarBase.
577+
From Stdlib Require Export Zmod.Bits.

theories/Make.zmod

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Zmod/Bits.v
2+
Zmod/Zmod.v
3+
Zmod/ZmodBase.v
4+
Zmod/ZmodDef.v
5+
Zmod/ZmodInv.v
6+
Zmod/Zstar.v
7+
Zmod/ZstarBase.v
8+
Zmod/ZstarDef.v
9+
10+
-Q Zmod Stdlib.Zmod

0 commit comments

Comments
 (0)