Struct move_model::spec_translator::SpecTranslator
source · pub struct SpecTranslator<'a, 'b, T: ExpGenerator<'a>> { /* private fields */ }
Expand description
A helper which reduces specification conditions to assume/assert statements.
Implementations§
source§impl<'a, 'b, T: ExpGenerator<'a>> SpecTranslator<'a, 'b, T>
impl<'a, 'b, T: ExpGenerator<'a>> SpecTranslator<'a, 'b, T>
sourcepub fn translate_fun_spec(
auto_trace: bool,
for_call: bool,
builder: &'b mut T,
fun_env: &'b FunctionEnv<'a>,
type_args: &[Type],
param_substitution: Option<&'b [TempIndex]>,
ret_locals: &'b [TempIndex]
) -> TranslatedSpec
pub fn translate_fun_spec( auto_trace: bool, for_call: bool, builder: &'b mut T, fun_env: &'b FunctionEnv<'a>, type_args: &[Type], param_substitution: Option<&'b [TempIndex]>, ret_locals: &'b [TempIndex] ) -> TranslatedSpec
Translates the specification of function fun_env
. This can happen for a call of the
function or for its definition (parameter for_call
). This will process all the
conditions found in the spec block of the function, dealing with references to old(..)
,
and creating respective memory/spec var saves. If for_call
is true, abort conditions
will be translated for the current state, otherwise they will be treated as in an old
.
and creating respective memory/spec var saves. It also allows to provide type arguments
with which the specifications are instantiated, as well as a substitution for temporaries.
The later two parameters are used to instantiate a function specification for a given
call context.
sourcepub fn translate_invariants(
auto_trace: bool,
builder: &'b mut T,
invariants: impl Iterator<Item = (&'b GlobalInvariant, Vec<Type>)>
) -> TranslatedSpec
pub fn translate_invariants( auto_trace: bool, builder: &'b mut T, invariants: impl Iterator<Item = (&'b GlobalInvariant, Vec<Type>)> ) -> TranslatedSpec
Translates a set of invariants with type instantiations. If there are any references to
old(...)
they will be rewritten and respective memory/spec var saves will be generated.
sourcepub fn translate_inline_property(
builder: &'b mut T,
prop: &Exp
) -> (TranslatedSpec, Exp)
pub fn translate_inline_property( builder: &'b mut T, prop: &Exp ) -> (TranslatedSpec, Exp)
Translate one inline property. If there are any references to old(...)
they
will be rewritten and respective memory/spec var saves will be generated.
pub fn translate_invariants_by_id( auto_trace: bool, builder: &'b mut T, inv_ids: impl Iterator<Item = (GlobalId, Vec<Type>)> ) -> TranslatedSpec
Trait Implementations§
source§impl<'a, 'b, T: ExpGenerator<'a>> ExpRewriterFunctions for SpecTranslator<'a, 'b, T>
impl<'a, 'b, T: ExpGenerator<'a>> ExpRewriterFunctions for SpecTranslator<'a, 'b, T>
source§fn rewrite_exp(&mut self, exp: Exp) -> Exp
fn rewrite_exp(&mut self, exp: Exp) -> Exp
do_rewrite
.