This command is part of the experimental refinement editor.
The introduce variable command refines a specification statement to introduce a new local scope around it. It applies the following inference rule of the refinement calculus.
![]() ![]() |
where D | C is the new local scope.
The code that is implicitly generated by this refinement rule is the following block statement.
[| var D | C |
![]() ![]() ![]() ![]() |
![]() ![]() ![]() ![]() |
|] |
The introduce variable command is applicable
when any specification statement F[P,I,Q] in a goal is inspected.
The local scope D | C is entered into a dialogue box
using the syntax of a Z schema text,
e.g. n : | n < 42.
The default response is the previous response.
Alternatively, if a suitable schema text is
displayed in the same window, that can have been selected first (crossed).
The local scope is typechecked in the environment of
the inspected specification statement.
"introduce variable" "D | C" p
This example applies the introduce variable command to specification statement p using the local scope D | C.
A tactic that applies the introduce variable command must be executed by play tactic; it is not applicable under apply tactic as the resulting code would not be accessible to the code command.