use crate::proof::algebra::checker::support::{
boundary_grid_u32, call_binary, engine_failure_violation, simple_rng, violation,
ZERO_PRODUCT_COUNTEREXAMPLES,
};
use crate::spec::law::{AlgebraicLaw, LawViolation};
use super::witnessed::*;
fn check_idempotent_exhaustive(
op_id: &str,
f: fn(&[u8]) -> Vec<u8>,
) -> Result<(u64, Option<LawViolation>), LawViolation> {
let mut cases = 0u64;
for a in 0u32..256 {
let aa = call_binary(f, a, a).map_err(|e| engine_failure_violation(op_id, e))?;
cases += 1;
if aa != a {
return Ok((cases, Some(violation(op_id, "idempotent", a, a, 0, aa, a))));
}
}
Ok((cases, None))
}