fn def_ana_schema_inclusion_outside_schema(
        &mut self,
        loc: &Loc,
        context: &SpecBlockContext,
        alt_context_type_params: Option<&[(Symbol, Type)]>,
        context_properties: PropertyBag,
        exp: &EA::Exp,
    ) {
        // Compute the type parameters and variables this spec block uses. We do this by constructing
        // an expression translator and immediately extracting  from it. Depending on whether in
        // function or struct context, we use a condition kind which defines the maximum
        // of available symbols. We need to potentially revise this to only declare variables which
        // have a proper use in a condition/invariant, depending on what is actually included in
        // the block.
        let (mut vars, context_type_params) = match context {
            SpecBlockContext::Function(..) | SpecBlockContext::FunctionCode(..) => {
                let et = self.exp_translator_for_context(
                    loc,
                    context,
                    Some(&ConditionKind::Ensures),
                    false,
                );
                (et.extract_var_map(), et.get_type_params_with_name())
            }
            SpecBlockContext::Struct(..) => {
                let et = self.exp_translator_for_context(
                    loc,
                    context,
                    Some(&ConditionKind::InvariantUpdate),
                    false,
                );
                (et.extract_var_map(), et.get_type_params_with_name())
            }
            SpecBlockContext::Module => (BTreeMap::new(), vec![]),
            SpecBlockContext::Schema { .. } => panic!("unexpected schema context"),
        };
        let mut spec = Spec::default();

        // Analyze the schema inclusion. This will instantiate conditions for
        // this block.
        self.def_ana_schema_exp(
            if let Some(type_params) = alt_context_type_params {
                type_params
            } else {
                &context_type_params
            },
            &mut vars,
            &mut spec,
            false,
            &PropertyBag::default(),
            exp,
        );

        // Write the conditions to the context item.
        self.add_conditions_to_context(
            context,
            loc,
            spec.conditions,
            context_properties,
            "(included from schema)",
        );
    }
/// Analyze schema inclusion in the spec block for a function, struct or module. This
/// instantiates the schema and adds all conditions and invariants it contains to the context.
///
/// The `alt_context_type_params` allows to use different type parameter names as would
/// otherwise be inferred from the SchemaBlockContext. This is used for the apply weaving
/// operator which allows to use different type parameter names than the function declarations
/// to which it is applied to.
Analyze schema inclusion in the spec block for a function, struct or module. This
instantiates the schema and adds all conditions and invariants it contains to the context.

The `alt_context_type_params` allows to use different type parameter names as would
otherwise be inferred from the SchemaBlockContext. This is used for the apply weaving
operator which allows to use different type parameter names than the function declarations
to which it is applied to.
Analyze schema inclusion in the spec block for a function struct or module . This instantiates the schema and adds all conditions and invariants it contains to the context . The ` alt_context_type_params ` allows to use different type parameter names as would otherwise be inferred from the SchemaBlockContext . This is used for the apply weaving operator which allows to use different type parameter names than the function declarations to which it is applied to .
fn def_ana_schema_inclusion_outside_schema(
        &mut self,
        loc: &Loc,
        context: &SpecBlockContext,
        alt_context_type_params: Option<&[(Symbol, Type)]>,
        context_properties: PropertyBag,
        exp: &EA::Exp,
    ) {
        // Compute the type parameters and variables this spec block uses. We do this by constructing
        // an expression translator and immediately extracting  from it. Depending on whether in
        // function or struct context, we use a condition kind which defines the maximum
        // of available symbols. We need to potentially revise this to only declare variables which
        // have a proper use in a condition/invariant, depending on what is actually included in
        // the block.
        let (mut vars, context_type_params) = match context {
            SpecBlockContext::Function(..) | SpecBlockContext::FunctionCode(..) => {
                let et = self.exp_translator_for_context(
                    loc,
                    context,
                    Some(&ConditionKind::Ensures),
                    false,
                );
                (et.extract_var_map(), et.get_type_params_with_name())
            }
            SpecBlockContext::Struct(..) => {
                let et = self.exp_translator_for_context(
                    loc,
                    context,
                    Some(&ConditionKind::InvariantUpdate),
                    false,
                );
                (et.extract_var_map(), et.get_type_params_with_name())
            }
            SpecBlockContext::Module => (BTreeMap::new(), vec![]),
            SpecBlockContext::Schema { .. } => panic!("unexpected schema context"),
        };
        let mut spec = Spec::default();
        // Analyze the schema inclusion. This will instantiate conditions for
        // this block.
        self.def_ana_schema_exp(
            if let Some(type_params) = alt_context_type_params {
                type_params
            } else {
                &context_type_params
            },
            &mut vars,
            &mut spec,
            false,
            &PropertyBag::default(),
            exp,
        );
        // Write the conditions to the context item.
        self.add_conditions_to_context(
            context,
            loc,
            spec.conditions,
            context_properties,
            "(included from schema)",
        );
    }
fn def_ana_schema_inclusion_outside_schema ( & mut self , loc : & Loc , context : & SpecBlockContext , alt_context_type_params : Option < & [ ( Symbol , Type ) ] > , context_properties : PropertyBag , exp : & EA :: Exp , ) { // Compute the type parameters and variables this spec block uses. We do this by constructing // an expression translator and immediately extracting  from it. Depending on whether in // function or struct context, we use a condition kind which defines the maximum // of available symbols. We need to potentially revise this to only declare variables which // have a proper use in a condition/invariant, depending on what is actually included in // the block. let ( mut vars , context_type_params ) = match context { SpecBlockContext :: Function ( .. ) | SpecBlockContext :: FunctionCode ( .. ) => { let et = self . exp_translator_for_context ( loc , context , Some ( & ConditionKind :: Ensures ) , false , ) ; ( et . extract_var_map ( ) , et . get_type_params_with_name ( ) ) } SpecBlockContext :: Struct ( .. ) => { let et = self . exp_translator_for_context ( loc , context , Some ( & ConditionKind :: InvariantUpdate ) , false , ) ; ( et . extract_var_map ( ) , et . get_type_params_with_name ( ) ) } SpecBlockContext :: Module => ( BTreeMap :: new ( ) , vec ! [ ] ) , SpecBlockContext :: Schema { .. } => panic ! ( " " ) , } ; let mut spec = Spec :: default ( ) ; // Analyze the schema inclusion. This will instantiate conditions for // this block. self . def_ana_schema_exp ( if let Some ( type_params ) = alt_context_type_params { type_params } else { & context_type_params } , & mut vars , & mut spec , false , & PropertyBag :: default ( ) , exp , ) ; // Write the conditions to the context item. self . add_conditions_to_context ( context , loc , spec . conditions , context_properties , " " , ) ; }
Analyze schema inclusion in the spec block for a function, struct or module.
Analyze schema inclusion in the spec block for a function struct or module .
&mut self
loc
&Loc
context
&SpecBlockContext
alt_context_type_params
Option<&[(Symbol, Type)]>
context_properties
PropertyBag
exp
&EA::Exp
&mut self
loc
&Loc
context
&SpecBlockContext
alt_context_type_params
Option<&[(Symbol, Type)]>
context_properties
PropertyBag
exp
&EA::Exp