The call step
Library · Source module
The call step
wp_call h is one step of a program proof at a call: h says that the operation called satisfies its contract (h : I.Satisfies md o (R.spec adm), or h : I.IsFn .total o f adm for a functional operation). The tactic
* applies the sequence rule if the call is followed by something; * applies the call rule for the shape of the outputs (NLAlib.Ops.wp_call_rel and its corollaries for one cell, one block, two blocks): one rule for relational and functional contracts and for contracts with a window; * evaluates the dimensions and the operands in the environment; * finds the blocks and cells that the call reads from the facts in the context; * discharges the side goals (the operands are admitted, their handles are buffers of the store, the inputs are in the domain, there is room for the outputs) with store_simp and store_side; * introduces the outputs and their relation to the inputs, in reduced form.
What is left is the continuation, with the mathematical content of the contract as a hypothesis.
wp_call h [facts] with v hv passes facts to the side goals (typically hH.eq_iff for an injective family of handles H) and names what the continuation receives: a cell and its relation for an output of one cell; a block, its length and its relation for an output of one block; two blocks, their lengths and the relation for two blocks. Without with, a call under a functional contract with one output cell introduces nothing: the value is computed, and the memory after the call is m.upd z (g a b).
A side goal that the tactic cannot discharge is left, after the continuation, under its name (hadm: admitted operands; hlive: live handles; hr: the blocks read; hdom: the domain; hz: room for the output), to be closed by case hadm => ….
Main results
* wp_call: the call step. * wp_adm, wp_side, wp_read, wp_shape, wp_dom: the kinds of side goals, usable on their own.