fn mk_inst_mem_quant_opt<F>(
        &self,
        kind: QuantKind,
        mem: &QualifiedInstId<StructId>,
        f: &mut F,
    ) -> Option<Exp>
    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_ty = Type::Struct(mem.module_id, mem.id, mem.inst.clone());
        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, Some(mem.inst.clone()));
            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,
                )
                .into_exp(),
            )
        } else {
            None
        }
    }
/// Creates a quantifier over the content of instantiated 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 instantiated 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 instantiated 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_inst_mem_quant_opt<F>(
        &self,
        kind: QuantKind,
        mem: &QualifiedInstId<StructId>,
        f: &mut F,
    ) -> Option<Exp>
    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_ty = Type::Struct(mem.module_id, mem.id, mem.inst.clone());
        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, Some(mem.inst.clone()));
            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,
                )
                .into_exp(),
            )
        } else {
            None
        }
    }
fn mk_inst_mem_quant_opt < F > ( & self , kind : QuantKind , mem : & QualifiedInstId < StructId > , f : & mut F , ) -> Option < Exp > 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_ty = Type :: Struct ( mem . module_id , mem . id , mem . inst . clone ( ) ) ; 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 , Some ( mem . inst . clone ( ) ) ) ; 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 , ) . into_exp ( ) , ) } else { None } }
Creates a quantifier over the content of instantiated memory.
Creates a quantifier over the content of instantiated memory .
&self
kind
QuantKind
mem
&QualifiedInstId<StructId>
f
&mut F