Commit 891ed45
authored
proof(SafeNetwork): annotate 5 bodyless decls as OWED (Refs standards#158) (#49)
## Summary
Applies the estate's OWED-with-justification convention (set 2026-05-20
by SafeChecksum/Buffer/CryptoAccel/HKDF/Bloom/FPGA; live examples in
sibling PRs #37 / #41 / #46) to the 5 remaining bodyless declarations
in `src/Proven/SafeNetwork/Proofs.idr`.
Form per decl: triple-pipe doc stating the claim + the specific Idris2
0.8.0 blocker + a "Discharge once …" condition, followed by
`public export` + `0 ` erased-multiplicity bare signature. No
`postulate` keyword (consistent with the other Proofs.idr in the repo).
No semantic change to the postulated claims; only the annotation form
and visibility (`export` -> `public export` + `0 `) change.
Refs hyperpolymath/standards#158.
## Per-decl OWED reasons
| Decl | Claim | Blocker | Discharge path |
|------|-------|---------|----------------|
| `mkPortSucceeds` | `LTE n 65535 -> IsJust (mkPort n)` | `mkPort`
branches on `checkPort`, which runs the opaque primitive Nat `<=`; the
resulting `Bool` does not type-level reduce to the `LTE` premise. | Nat
decidability bridge `lteReflectsLTE` in `Data.Nat`, or refactor `mkPort`
to consume `LTE` directly. |
| `networkInOwnCIDR` | `contains cidr (networkAddress cidr) = True` |
`contains` uses `ipToNat ... >= ipToNat ...`; primitive Nat `>=` is
opaque when `cidr` is a free variable. | `ipToNat` monotonicity lemmas +
a `>=`-to-`GTE` reflective bridge. |
| `broadcastInOwnCIDR` | `contains cidr (broadcastAddress cidr) = True`
| Same family as above. | Same as above. |
| `systemPortBound` | `isSystemPort p = True -> LTE (portValue p) 1023`
| `isSystemPort` is a runtime Bool over `classify`; the `True` arm does
not type-level reduce to `LTE` (opaque primitive Nat comparison). |
Reformulate `classify` to return a dependent witness carrying the `LTE`,
or land a primitive-Nat reflective bridge. |
| `portBounded` | `LTE (portValue p) 65535` | `Port` is constructed with
an erased `IsPort` witness (`data IsPort : Nat -> Type where ItIsPort :
IsPort n`) — bound enforced dynamically by `checkPort`/`mkPort`, not
constructively. | Refine `IsPort n := LTE n 65535`, or rebuild `Port` to
carry the `LTE` proof. |
## Test plan
- [ ] Local idris2 0.8.0 type-check the file (environment-blocked in
this worktree by a `base` library install mismatch — convention
pattern is identical to the already-built sibling files
`Proven/SafeChecksum/Proofs.idr`, `Proven/SafeBuffer/Proofs.idr`,
`Proven/SafeHKDF/Proofs.idr` etc., which use the same
`public export` + `0 ` form on identical claim shapes).
- [ ] Draft until CI un-jams estate-wide; do not merge yet.
## Notes
- DRAFT because CI is jammed estate-wide.
- Touches only `src/Proven/SafeNetwork/Proofs.idr`.
- Does not introduce any `postulate` keyword, `believe_me`, or
`idris_crash`. The OWED witnesses are erased (`0 `) so they cannot
affect runtime semantics.
Refs hyperpolymath/standards#1581 parent b1bdd6b commit 891ed45
1 file changed
Lines changed: 48 additions & 36 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
39 | 42 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
47 | 52 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
53 | 60 | | |
54 | 61 | | |
55 | 62 | | |
| |||
59 | 66 | | |
60 | 67 | | |
61 | 68 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
69 | 79 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
79 | 91 | | |
80 | 92 | | |
81 | 93 | | |
| |||
0 commit comments