fn mk_mem_quant_opt<F>(
        &self,
        kind: QuantKind,
        mem: QualifiedId<StructId>,
        f: &mut F,
    ) -> Option<ExpData>
    where
        F: FnMut(Exp) -> Option<Exp>,
    {
        // We generate `forall $val in resources<R>: INV[$val]`. The `resources<R>`
        // quantifier domain is currently only available in the internal expression language,
        // not on user level.
        let struct_env = self
            .global_env()
            .get_module(mem.module_id)
            .into_struct(mem.id);
        let type_inst = (0..struct_env.get_type_parameters().len())
            .map(|i| Type::TypeParameter(i as u16))
            .collect_vec();
        let struct_ty = Type::Struct(mem.module_id, mem.id, type_inst);
        let value = self.mk_local("$rsc", struct_ty.clone());

        if let Some(body) = f(value) {
            let resource_domain_ty = Type::ResourceDomain(mem.module_id, mem.id, None);
            let resource_domain_node_id =
                self.new_node(resource_domain_ty, Some(vec![struct_ty.clone()]));
            let resource_domain =
                ExpData::Call(resource_domain_node_id, Operation::ResourceDomain, vec![])
                    .into_exp();
            let resource_decl = self.mk_decl(self.mk_symbol("$rsc"), struct_ty, None);
            let quant_node_id = self.new_node(BOOL_TYPE.clone(), None);
            Some(ExpData::Quant(
                quant_node_id,
                kind,
                vec![(resource_decl, resource_domain)],
                vec![],
                None,
                body,
            ))
        } else {
            None
        }
    }
/// Creates a quantifier over the content of memory. The passed function `f` receives
//  an expression representing a value in memory and returns the quantifiers predicate;
//  if it returns None, this function will also return None.
Creates a quantifier over the content of memory. The passed function `f` receives
an expression representing a value in memory and returns the quantifiers predicate;
if it returns None, this function will also return None.
Creates a quantifier over the content of memory . The passed function ` f ` receives an expression representing a value in memory and returns the quantifiers predicate ; if it returns None this function will also return None .
fn mk_mem_quant_opt<F>(
        &self,
        kind: QuantKind,
        mem: QualifiedId<StructId>,
        f: &mut F,
    ) -> Option<ExpData>
    where
        F: FnMut(Exp) -> Option<Exp>,
    {
        // We generate `forall $val in resources<R>: INV[$val]`. The `resources<R>`
        // quantifier domain is currently only available in the internal expression language,
        // not on user level.
        let struct_env = self
            .global_env()
            .get_module(mem.module_id)
            .into_struct(mem.id);
        let type_inst = (0..struct_env.get_type_parameters().len())
            .map(|i| Type::TypeParameter(i as u16))
            .collect_vec();
        let struct_ty = Type::Struct(mem.module_id, mem.id, type_inst);
        let value = self.mk_local("$rsc", struct_ty.clone());
        if let Some(body) = f(value) {
            let resource_domain_ty = Type::ResourceDomain(mem.module_id, mem.id, None);
            let resource_domain_node_id =
                self.new_node(resource_domain_ty, Some(vec![struct_ty.clone()]));
            let resource_domain =
                ExpData::Call(resource_domain_node_id, Operation::ResourceDomain, vec![])
                    .into_exp();
            let resource_decl = self.mk_decl(self.mk_symbol("$rsc"), struct_ty, None);
            let quant_node_id = self.new_node(BOOL_TYPE.clone(), None);
            Some(ExpData::Quant(
                quant_node_id,
                kind,
                vec![(resource_decl, resource_domain)],
                vec![],
                None,
                body,
            ))
        } else {
            None
        }
    }
fn mk_mem_quant_opt < F > ( & self , kind : QuantKind , mem : QualifiedId < StructId > , f : & mut F , ) -> Option < ExpData > where F : FnMut ( Exp ) -> Option < Exp > , { // We generate `forall $val in resources<R>: INV[$val]`. The `resources<R>` // quantifier domain is currently only available in the internal expression language, // not on user level. let struct_env = self . global_env ( ) . get_module ( mem . module_id ) . into_struct ( mem . id ) ; let type_inst = ( 0 .. struct_env . get_type_parameters ( ) . len ( ) ) . map ( | i | Type :: TypeParameter ( i as u16 ) ) . collect_vec ( ) ; let struct_ty = Type :: Struct ( mem . module_id , mem . id , type_inst ) ; let value = self . mk_local ( " " , struct_ty . clone ( ) ) ; if let Some ( body ) = f ( value ) { let resource_domain_ty = Type :: ResourceDomain ( mem . module_id , mem . id , None ) ; let resource_domain_node_id = self . new_node ( resource_domain_ty , Some ( vec ! [ struct_ty clone ( ) ] ) ) ; let resource_domain = ExpData :: Call ( resource_domain_node_id , Operation :: ResourceDomain , vec ! [ ] ) . into_exp ( ) ; let resource_decl = self . mk_decl ( self . mk_symbol ( " " ) , struct_ty , None ) ; let quant_node_id = self . new_node ( BOOL_TYPE . clone ( ) , None ) ; Some ( ExpData :: Quant ( quant_node_id , kind , vec ! [ ( resource_decl resource_domain ) ] , vec ! [ ] , None , body , ) ) } else { None } }
Creates a quantifier over the content of memory.
Creates a quantifier over the content of memory .
&self
kind
QuantKind
mem
QualifiedId<StructId>
f
&mut F