Skip to content

checkRingLaws

checkRingLaws<T>(ring, samples): LawViolation<T>[]

Defined in: laws.ts:21

Checks the ring axioms against samples by exhaustive substitution.

O(n³) in the sample count — associativity and distributivity are ternary. Intended for property tests with a handful of hand-picked edge values, not for large sample sets.

T

The carrier set.

Ring<T>

Ring evidence for T.

readonly T[]

Values to substitute into the axioms.

LawViolation<T>[]

Every violation found, empty when the axioms hold.