Commit 81b191b
committed
feat(L9): outlives preorder laws + loadSafe theorem (A4)
Closes PROOF-NEEDS §P0.3. The Outlives relation already had a full
case-analysis transitivity proof (`outlivesTransitive`, seven-case
pattern match over constructor combinations). This change names the
two preorder laws explicitly and lands the Level 9 load-safety
theorem.
Preorder laws:
outlivesRefl : (l : Lifetime) -> Outlives l l
— reflexivity; thin wrapper over `OutlivesSelf`.
outlivesTrans : Outlives a b -> Outlives b c -> Outlives a c
— alias of the pre-existing `outlivesTransitive`
under the PROOF-NEEDS §P0.3 naming.
Load-safety theorem:
loadSafe : (ref : LiveRef refLife a) ->
Outlives refLife scopeLife ->
Nat
— the L9 guarantee in proof-term form: you
cannot dereference without first producing
an outlives witness. Operational counterpart
is the existing `useRef` packaged via
`ValidIn`; `loadSafe` is the propositional
form asked for by PROOF-NEEDS.
loadSafeOffset : loadSafe ref p = refOffset ref
— behavioural lemma: load-safety returns the
stored offset and nothing more.
loadSafeIrrelevant : loadSafe ref p = loadSafe ref q
— proof irrelevance at the value level; the
outlives witness can be erased without
changing the load result.
idris2 --check clean (Lifetime + downstream Linear).
panic-attack assail: 0 weak points.
Zero dangerous patterns. %default total throughout.1 parent cbf2a43 commit 81b191b
2 files changed
Lines changed: 73 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
96 | 117 | | |
97 | 118 | | |
98 | 119 | | |
| |||
190 | 211 | | |
191 | 212 | | |
192 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
0 commit comments