Continuing symbolic execution through routine contracts #
The tactic wram_call consumes a routine specification at the current WP or WP.Exact goal.
Its continuation receives the returned state and complete postcondition, with the routine's
instruction allowance already added by WP.seq. Resume straight-line execution with wram_exec.
The routine's definition stays closed: correctness, safety conditions and its charge come from
the contract, not from symbolic execution of its body.
Accepted contract shapes:
- Fixed-time existential specification:
∃ y, ExecWithin w c x y T ∧ P y(orExecatWP.Exact). - Time-indexed weakest precondition:
WP w c x Q'(orWP.Exact w c x Q'atWP.Exact). - Direct deterministic execution:
ExecWithin w c x y TorExec w c x y T, optionally paired with a postcondition conjunction (ExecWithin … ∧ P/Exec … ∧ P).
wram_call uses witness-preserving rules (WP.of_spec', WP.Exact.of_spec', WP.mono',
WP.Exact.mono'), keeping a local ExecWithin / Exec witness in the continuation context so
regs_frame and mem_frame can automatically follow he.regs_eq and he.mem_eq across the call.
If the goal starts with a Code.seq, wram_call first checks whether the contract applies to the
whole sequence and otherwise automatically peels .seq via WP.seq / WP.Exact.seq.
If the contract term is a universally quantified specification (such as an induction hypothesis or
bare theorem name), wram_call instantiates its telescope against the goal and automatically
discharges its side premises (regs_frame, wram_simp, fits, omega, silent wram_omega,
decide, local assumption, and memory-equality transport along d.mem = x.mem). Any remaining
nontrivial premises are left as tagged subgoals after the continuation. Optional [h₁, h₂, …]
hints supply extra facts or simp lemmas to the discharger.
The renamed form applies ExecWithin.rename_post / Exec.rename_post and retains the caller's
outside-register frame. Its injectivity proof hf : f.Injective may be omitted when f is
provably injective from the local context, standard Fin embeddings, Fin.val arithmetic, or
decide. The word renamed is not reserved: importers may still use it as an identifier.
Main results #
WP.of_spec,WP.Exact.of_spec: continue from a fixed-time existential routine contract.WP.of_spec',WP.Exact.of_spec': witness-preserving variants retainingExecWithin/Exec.WP.mono',WP.Exact.mono': witness-preserving weakening ofWP/WP.Exact.WP.of_execWithin_eq,WP.Exact.of_exec_eq,WP.of_execWithin_wit,WP.Exact.of_exec_wit,WP.of_execWithin_and,WP.Exact.of_exec_and: continuations from directExecWithin/Execcontracts.ExecWithin.rename_post_of_exec,Exec.rename_post_of_exec: renamed existential views of direct executions.wram_call: consume a proved routine contract without unfolding its program.
Continue from a routine's complete postcondition at its given instruction allowance.
Continue from a routine's complete postcondition while retaining its ExecWithin witness
in context so regs_frame and mem_frame can use hy.regs_eq and hy.mem_eq.
Continue from a direct ExecWithin contract while retaining y' = y and the witness.
Continue from a direct ExecWithin w c x y T ∧ P pair while retaining the witness.
Continue from a routine's complete postcondition at its exact instruction count.
Continue from a routine's complete postcondition at its exact instruction count, retaining
its Exec witness so regs_frame and mem_frame can use hy.regs_eq and hy.mem_eq.
Renamed existential view of a direct ExecWithin execution.
Renamed existential view of a direct Exec execution.
WP.of_execWithin keeping h in context as an ExecWithin witness.
Apply a fixed-time, direct, or time-indexed routine contract and expose its continuation. Only bank-view projections are normalized; the callee program remains closed.
Extensions:
- Direct
wram_call hwithoutwith(for bareExecWithin/Execcontracts), optional hint lemmas[h₁, …], andrenamedbank forms.
Refine the goal with the first of tacs that succeeds and run cont; if none succeeds,
explain the failure with rules (see explain).
Introduce pats across a continuation where the witness ExecWithin/Exec sits after the
initial witAfter binders (y for of_spec', y T for mono', 0 for of_execWithin_wit).
The witness is introduced with an inaccessible name so it never shadows user variables while
staying visible to regs_frame and mem_frame.
Run attempt against the current goal, peeling leading Code.seq layers via WP.seq /
WP.Exact.seq only if the direct call fails. Restores the state on failure.
Discharge all resolvable Prop metavariables in mvars:
- Fixpoint pass binding value metavariables via register equations and direct hypotheses/hints (caching failed target expressions so unchanged premises are not re-tested).
- Single ground pass running arithmetic,
fits, andsimpdischargers once per remaining groundProppremise.
Apply a fixed-time, direct, or time-indexed routine contract and expose its continuation. Only bank-view projections are normalized; the callee program remains closed.
Extensions:
- Direct
wram_call hwithoutwith(for bareExecWithin/Execcontracts), optional hint lemmas[h₁, …], andrenamedbank forms.
Apply a fixed-time, direct, or time-indexed routine contract and expose its continuation. Only bank-view projections are normalized; the callee program remains closed.
Extensions:
- Direct
wram_call hwithoutwith(for bareExecWithin/Execcontracts), optional hint lemmas[h₁, …], andrenamedbank forms.
Apply a fixed-time, direct, or time-indexed routine contract and expose its continuation. Only bank-view projections are normalized; the callee program remains closed.
Extensions:
- Direct
wram_call hwithoutwith(for bareExecWithin/Execcontracts), optional hint lemmas[h₁, …], andrenamedbank forms.
Apply a fixed-time, direct, or time-indexed routine contract and expose its continuation. Only bank-view projections are normalized; the callee program remains closed.
Extensions:
- Direct
wram_call hwithoutwith(for bareExecWithin/Execcontracts), optional hint lemmas[h₁, …], andrenamedbank forms.