mod laws¶
- module laws¶
Law-witness helpers and the
LawViolationdiagnostic type. Runtime witnesses + theLawViolationerror returned bySaVariant::checkedwhen a tuple of components fails one of the four IISE-manuscript composition laws.SaVariant::checked_with_sweepexercises the executable behavior of each law onn_samplesrandom inputs rather than trusting Boolean witness methods alone.Functions
- fn sweep_accept_monotone_in_temp<A: AcceptRule<f64>>(accept: &A, n_samples: usize, seed: u64) -> Result<(), LawViolation>¶
Witnesses L4 by sampling uphill moves at paired temperatures and checking that acceptance probability is non-decreasing in temperature.
- fn sweep_cooling_monotone<C: Cooling<f64>>(cool: &C, n_epochs: usize) -> Result<(), LawViolation>¶
Witnesses L4 (cooling non-increasing in epoch) on a Cooling<f64> by computing
T(0), T(1), ..., T(n_epochs - 1)and checking each successive pair.
- fn sweep_downhill_accepts<A: AcceptRule<f64>>(accept: &A, n_samples: usize, seed: u64) -> Result<(), LawViolation>¶
Witnesses L3 (downhill always accepts) on an AcceptRule<f64> by sampling
n_samplesrandom (delta_e <= 0, temp > 0) pairs and checkingaccept_prob == 1.0for each. Usesseedfor reproducibility.
-
fn sweep_move_support<M, N>(mover: &M, neigh: &N, dim: usize, bound: f64, n_samples: usize, seed: u64) -> Result<(), LawViolation>¶
where
M: MoveKernel<f64>,
N: Neighborhood<f64>
¶ Witnesses L2 by drawing proposals from sampled feasible states and checking membership before any objective evaluation. The bounding cube is a validation domain supplied by the caller, not a proof over all states.
- fn sweep_neighborhood_symmetric<N: crate::neigh::Neighborhood<f64>>(neigh: &N, dim: usize, bound: f64, n_samples: usize, seed: u64) -> Result<(), LawViolation>¶
Witnesses L1 (neighborhood symmetry) on a Neighborhood<f64>` by sampling
n_samplesrandom(i, j)` position pairs in the supplied bounding box and checking ``contains(i, j) == contains(j, i).
Enums
- enum LawViolation¶
A law-violation diagnostic surfaced by
SaVariant::checked/SaVariant::checked_with_sweep.- EmptySweep¶
Sampled validation requires at least one sample per executable law.
- Symmetry¶
L1:
is_symmetric()returned false on the suppliedNeighborhood.
- SymmetrySweep¶
L1 (sweep): proptest sampler caught a non-symmetric pair.
- i: Vec<f64>¶
First witness point.
- j: Vec<f64>¶
Second witness point.
- SupportEscape¶
L2:
MoveKernel::supports_in(neigh)returned false.
- SupportEscapeSweep¶
L2 (sweep): a sampled proposal escaped the neighborhood.
- from: Vec<f64>¶
Feasible state from which the proposal was drawn.
- to: Vec<f64>¶
Proposal outside the declared neighborhood.
- temp: f64¶
Positive proposal temperature.
- NoFeasibleSweepState¶
The supplied validation cube contained no sampled feasible state.
- DownhillNotAccepted¶
L3 (sweep):
accept_prob(delta, T) != 1for some delta <= 0.- delta_e: f64¶
Witness energy delta (<= 0).
- temp: f64¶
Witness temperature.
- p: f64¶
Reported acceptance probability (should be 1).
- NonMonotoneCooling¶
L4:
Cooling::is_monotone()returned false.