Commit 944cb66
committed
HOL-Light: Simplify proof of poly_tobytes
The precondition in the HOL-Light proof for mlkem_poly_tobytes
abstracts the memory contents at the source pointer as a list
of 16-bit words. However, it is only in the post-condition that
the length of this list is constrained to be 256.
This does not seem to increase the expressivity of the spec
but complicates the proof; in particular, it adds the need for
another tactic currently fed the total number of instructions
in the function, and which is not readily amenable to wrapping
by the recently introduced MAP_UNTIL_TARGET_PC function.
This commit moves the length constraints on the abstract list
of 16-bit values to the precondition, simplifying the proof
and thereby making it agnostic to the total number of instructions.
Note that in general there can be value to pushing preconditions
into premises of the post-condition: For example, in the NTT or
invNTT, one can shove the constraint that the provided twiddle
table should contain the right twiddles into a premise of the
post-condition. This strictly increases expressivity, because even
for wrong twiddle tables, one still gets safety properties from
the proof. However, in the case of poly_tobytes, there does not
seem to be such gain from moving the length constraint into the
post-condition.
Signed-off-by: Hanno Becker <beckphan@amazon.co.uk>1 parent adb7160 commit 944cb66
1 file changed
+7
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| 206 | + | |
206 | 207 | | |
207 | 208 | | |
208 | | - | |
209 | | - | |
210 | | - | |
| 209 | + | |
| 210 | + | |
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
| 219 | + | |
225 | 220 | | |
226 | 221 | | |
227 | 222 | | |
| |||
283 | 278 | | |
284 | 279 | | |
285 | 280 | | |
| 281 | + | |
286 | 282 | | |
287 | 283 | | |
288 | | - | |
289 | | - | |
290 | | - | |
| 284 | + | |
| 285 | + | |
291 | 286 | | |
292 | 287 | | |
293 | 288 | | |
| |||
0 commit comments