Skip to main content

Module fn_simulator

Module fn_simulator 

Source
Expand description

Function simulation: API behaviour modelling when MIR is unavailable.

Each recognised standard-library API is described by a single table row: a name matcher, argument dependency, and effect builder. The public entry points lookup_dependency and lookup_effect scan the table linearly (first match wins) and convert the matched row into the concrete summaries consumed by the backward/forward visitors.

Two layers, both visible in one place:

  1. Matcher functions โ€” cheap name-pattern checks (hot-path is_* helpers for classification queries).
  2. Effect functions โ€” produce the Vec<CallEffect> for a single API.

Macrosยง

E ๐Ÿ”’
dep0 ๐Ÿ”’
dep01 ๐Ÿ”’
none ๐Ÿ”’

Structsยง

EffCtx
Entry ๐Ÿ”’

Constantsยง

ALL ๐Ÿ”’

Staticsยง

REGISTRY ๐Ÿ”’

Functionsยง

align_to_local ๐Ÿ”’
allocator_allocate ๐Ÿ”’
bit_preserving_nz ๐Ÿ”’
Bit-preserving integer operations: rotations, byte/bit reversals, endianness conversions, popcount, integer square root and saturating power all map 0 to 0 and non-zero to non-zero, so the result is non-zero iff the operand is (ReturnNonZeroIff).
checked_pow_nz ๐Ÿ”’
checked_pow returns Option<T> whose Some payload is non-zero iff the base is non-zero (ReturnOptionSomeNonZeroIff).
cmp_min ๐Ÿ”’
eff_alias_arg0 ๐Ÿ”’
eff_alias_nonnull ๐Ÿ”’
eff_alias_ptr ๐Ÿ”’
eff_align_offset ๐Ÿ”’
eff_align_to ๐Ÿ”’
eff_allocator_allocate ๐Ÿ”’
eff_box_from_vec ๐Ÿ”’
eff_cmp_min ๐Ÿ”’
eff_forget ๐Ÿ”’
eff_from_raw_parts ๐Ÿ”’
eff_from_trait ๐Ÿ”’
eff_is_empty ๐Ÿ”’
eff_layout_align ๐Ÿ”’
eff_layout_const ๐Ÿ”’
eff_len ๐Ÿ”’
eff_new_allocation ๐Ÿ”’
eff_new_allocation_from_cap ๐Ÿ”’
eff_none ๐Ÿ”’
eff_offset_from_unsigned ๐Ÿ”’
eff_option_scan_index ๐Ÿ”’
eff_overflowing_nz ๐Ÿ”’
eff_ownership_recon ๐Ÿ”’
eff_ptr_add ๐Ÿ”’
eff_ptr_sub ๐Ÿ”’
eff_read_mem ๐Ÿ”’
eff_return_abs ๐Ÿ”’
eff_return_add ๐Ÿ”’
eff_return_clamp ๐Ÿ”’
eff_return_iter ๐Ÿ”’
eff_return_max ๐Ÿ”’
eff_return_mul ๐Ÿ”’
eff_return_neg ๐Ÿ”’
eff_return_nonzero_iff ๐Ÿ”’
eff_return_option_some_add ๐Ÿ”’
eff_return_option_some_mul ๐Ÿ”’
eff_return_option_some_nonzero_iff ๐Ÿ”’
eff_return_sub ๐Ÿ”’
eff_scan_length ๐Ÿ”’
eff_split_at ๐Ÿ”’
eff_vec_from_box ๐Ÿ”’
eff_write_mem ๐Ÿ”’
from_trait_call ๐Ÿ”’
int_abs ๐Ÿ”’
int_add ๐Ÿ”’
int_checked_add ๐Ÿ”’
int_checked_mul ๐Ÿ”’
int_clamp ๐Ÿ”’
int_max ๐Ÿ”’
Comparison / absolute-value / negation / saturating & unchecked arithmetic operations. Each is modelled with a precise expression over its operands (see the eff_return_* builders) so non-zero-ness is discharged conditionally โ€” only when the operands are actually non-zero.
int_mul ๐Ÿ”’
int_neg ๐Ÿ”’
into_iter_local ๐Ÿ”’
is_empty ๐Ÿ”’
is_nonnull_dest ๐Ÿ”’
is_slice_get_unchecked ๐Ÿ”’
is_strlen ๐Ÿ”’
iter_position ๐Ÿ”’
layout_align ๐Ÿ”’
layout_call_ty ๐Ÿ”’
layout_constant_effect ๐Ÿ”’
lookup_dependency
lookup_effect
mem_forget ๐Ÿ”’
nonnull_as_mut ๐Ÿ”’
nonnull_as_ref ๐Ÿ”’
nonnull_from ๐Ÿ”’
nonnull_new ๐Ÿ”’
nonnull_new_unchecked ๐Ÿ”’
nonnull_pointee_alignment ๐Ÿ”’
overflowing_nz ๐Ÿ”’
overflowing_abs / overflowing_neg return (result, overflow) where the result field (0) is non-zero whenever the operand is non-zero. Model the field 0 as non-zero (ReturnTupleFieldNonZero { field: 0 }).
ptr_read ๐Ÿ”’
saturating_sub ๐Ÿ”’
slice_index ๐Ÿ”’
split_at ๐Ÿ”’
transmute ๐Ÿ”’