Repository navigation
Commit a6daaa4
committed
Integer-indexed types
Type constructors parameterised by both type variables and
natural-number indices, with a small index language and decidable
index equality: size-carrying types like 'a vec<:n>, with index
arithmetic tracked through operators, lemmas, instances, SMT, and
cloning.
- surface: {n} binders on types/ops/preds/lemmas/notations/abbrevs
and clone overrides; type application t<:e> and op/lemma
instantiation f[:e], positional or named (partial), composable in
either order; `declare index {n}' sections; `_' inference holes;
indexed (non-refining) datatypes, records, matchfix operators
- indices are polynomials over the naturals with canonical-form
equality (hashconsing identifies vec<:8> and vec<:3+5>); solving is
restricted to a principal fragment (naked assignment + unit-
coefficient single-variable affine with non-negative residual,
with deferral); the naturals discipline is enforced at every entry
point and exposed as the single axiom Int.ge0_index
- stdlib: IArray (length-indexed arrays) and IWord (length-indexed
bit-words: bit/bit-set layers, boolean ring, Z/2^n arithmetic with
to_uint/of_int, comparisons, shifts/rotates); five generic range
facts promoted to IntDiv
- ring/field instances are named, index-parametric, and
type-polymorphic; each instance records ONE shared instantiation
(index expressions and type arguments over its binders), with a
uniformity check at declaration; oner_neq0 is no longer a ring-
instance obligation (the tactic's certificates are purely
equational, so the trivial ring is a sound carrier; fields keep
it), making the word arithmetic instance family-wide:
`instance ring [warith] with {n} word<:n>' fires at concrete
widths, word<:k+1>, bare symbolic word<:m>, and word<:0>
- SMT: sort erasure + term-level relativization (leading int
arguments on indexed ops, width observers, relativized
quantifiers, 0 <= n facts); plain-bodied indexed ops export
standard definitions; indexed datatypes are refused (sound
incompleteness), with the encoding design documented as follow-up
- hint simplify rules over indexed heads (affine index patterns,
matched without the unification engine)
- dedicated diagnostics: ground index mismatches vs unsolvable
unifications, naturals hints (negative literals, subtraction),
`>>' token, mixed positional/named argument lists1 parent ef1b407 commit a6daaa4
104 files changed
Lines changed: 6931 additions & 1203 deletions
File tree
- examples/MEE-CBC
- src
- phl
- tests
- theories
- algebra
- datatypes
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
113 | 112 | | |
114 | 113 | | |
115 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
34 | 39 | | |
35 | 40 | | |
36 | 41 | | |
| |||
39 | 44 | | |
40 | 45 | | |
41 | 46 | | |
42 | | - | |
| 47 | + | |
43 | 48 | | |
44 | 49 | | |
45 | 50 | | |
| |||
80 | 85 | | |
81 | 86 | | |
82 | 87 | | |
83 | | - | |
| 88 | + | |
84 | 89 | | |
85 | 90 | | |
86 | 91 | | |
| |||
113 | 118 | | |
114 | 119 | | |
115 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
116 | 148 | | |
117 | 149 | | |
118 | 150 | | |
| |||
121 | 153 | | |
122 | 154 | | |
123 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
124 | 162 | | |
125 | 163 | | |
126 | | - | |
127 | | - | |
| 164 | + | |
| 165 | + | |
128 | 166 | | |
129 | 167 | | |
130 | 168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
79 | 82 | | |
80 | 83 | | |
81 | 84 | | |
| |||
157 | 160 | | |
158 | 161 | | |
159 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
160 | 166 | | |
161 | 167 | | |
162 | 168 | | |
| |||
192 | 198 | | |
193 | 199 | | |
194 | 200 | | |
195 | | - | |
| 201 | + | |
196 | 202 | | |
197 | 203 | | |
| 204 | + | |
| 205 | + | |
198 | 206 | | |
199 | 207 | | |
200 | 208 | | |
| |||
255 | 263 | | |
256 | 264 | | |
257 | 265 | | |
258 | | - | |
| 266 | + | |
259 | 267 | | |
260 | 268 | | |
| 269 | + | |
| 270 | + | |
261 | 271 | | |
262 | 272 | | |
263 | 273 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
81 | | - | |
| 82 | + | |
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
| |||
0 commit comments