跳到正文
参考文档 / ZLIB × LEAN

InflateFastBodyOrigin.lean

此页源文件快照 · bb3ef3914538ee6e · 对应提交的原文 ↗

本页保留 Lean 源码及行号。点击行号可定位语句,点击 import 中的模块名可查看依赖。

1import ZlibF.Spec.InflateFast
2import ZlibF.Spec.InflateFastOrigin
3
4/-!
5# One actual fast body preserves the source-bit origin
6
7The safety postcondition retains scalar bounds but does not identify the
8buffer's value. This obligation threads the source suffix through actual
9refills, code drops, extra-bit drops, copying and error/end exits.
10-/
11
12namespace Zlib.Inffast.Spec.BodyOrigin
13open C Zlib.Inffast Zlib.Inffast.Proofs
14
15/-- Actual bit movement consumes a nonnegative exact prefix of the
16original fast-call input and retains the complete existing body result.
17This property alone does not assign DEFLATE meanings to the consumed bits. -/
18def Goal.actual_body_preserves_origin : Prop :=
19  ∀ (e : Env) (c : Ctx) (bytes : Array UInt8) (msg : BPtr) (mode : UInt32)
20    (l : L) (i o used : Nat),
21    StepPre e c bytes l i o → Origin.Inv e l.hold.toNat l.bits.toNat i used →
22    ∃ (l' : L) (after : Heap),
23      C.run (inflate_fast_body c l) (e.heap bytes msg mode) = .ok (l', after) ∧
24      StepPost e bytes msg mode i o l' after ∧
25      ∃ i' o' used',
26        LS e l' i' o' ∧ Origin.Inv e l'.hold.toNat l'.bits.toNat i' used' ∧ used ≤ used'
27
28end Zlib.Inffast.Spec.BodyOrigin
ZLIB × LEAN

全局目录

当前位置InflateFastBodyOrigin.lean