/// Generate preconditions to make sure procedure parameters are well formed
Generate preconditions to make sure procedure parameters are well formed
Generate preconditions to make sure procedure parameters are well formed
fn generate_function_args_well_formed(&self, func_target: &FunctionTarget<'_>) {
        let num_args = func_target.get_parameter_count();
        let mode = if func_target.is_public() {
            // For public functions, we always include invariants in type assumptions for parameters,
            // even for mutable references.
            WellFormedMode::WithInvariant
        } else {
            WellFormedMode::Default
        };
        for i in 0..num_args {
            let local_name = func_target.get_local_name(i);
            let local_str = format!("{}", local_name.display(func_target.symbol_pool()));
            let local_type = func_target.get_local_type(i);
            let type_check = boogie_requires_well_formed(
                self.module_env.env,
                &local_str,
                local_type,
                mode,
                &self.options.backend.type_requires,
            );
            if !type_check.is_empty() {
                emitln!(self.writer, &type_check);
            }
        }
    }
fn generate_function_args_well_formed ( & self , func_target : & FunctionTarget < ' _ > ) { let num_args = func_target . get_parameter_count ( ) ; let mode = if func_target . is_public ( ) { // For public functions, we always include invariants in type assumptions for parameters, // even for mutable references. WellFormedMode :: WithInvariant } else { WellFormedMode :: Default } ; for i in 0 .. num_args { let local_name = func_target . get_local_name ( i ) ; let local_str = format ! ( " " local_name display ( func_target symbol_pool ( ) ) ) ; let local_type = func_target . get_local_type ( i ) ; let type_check = boogie_requires_well_formed ( self . module_env . env , & local_str , local_type , mode , & self . options . backend . type_requires , ) ; if ! type_check . is_empty ( ) { emitln ! ( self writer type_check ) ; } } }
Generate preconditions to make sure procedure parameters are well formed
Generate preconditions to make sure procedure parameters are well formed
&self
func_target
&FunctionTarget<'_>