Fix incorrect properties in verifier classes

This commit is contained in:
Iaroslav Postovalov 2020-12-20 20:48:38 +07:00
parent b8e9a7d327
commit 9fbca45235
No known key found for this signature in database
GPG Key ID: 46E15E4A31B3BCD7
3 changed files with 3 additions and 2 deletions

View File

@ -12,6 +12,8 @@ internal class FieldVerifier<T>(override val algebra: Field<T>, a: T, b: T, c: T
super.verify()
algebra {
assertEquals(a + b, b + a, "Addition in $algebra is not commutative.")
assertEquals(a * b, b * a, "Multiplication in $algebra is not commutative.")
assertNotEquals(a / b, b / a, "Division in $algebra is not anti-commutative.")
assertNotEquals((a / b) / c, a / (b / c), "Division in $algebra is associative.")
assertEquals((a + b) / c, (a / c) + (b / c), "Division in $algebra is not right-distributive.")

View File

@ -10,7 +10,7 @@ internal open class RingVerifier<T>(override val algebra: Ring<T>, a: T, b: T, c
super.verify()
algebra {
assertEquals(a * b, a * b, "Multiplication in $algebra is not commutative.")
assertEquals(a + b, b + a, "Addition in $algebra is not commutative.")
assertEquals(a * b * c, a * (b * c), "Multiplication in $algebra is not associative.")
assertEquals(c * (a + b), (c * a) + (c * b), "Multiplication in $algebra is not distributive.")
assertEquals(a * one, one * a, "$one in $algebra is not a neutral multiplication element.")

View File

@ -15,7 +15,6 @@ internal open class SpaceVerifier<T>(
AlgebraicVerifier<T, Space<T>> {
override fun verify() {
algebra {
assertEquals(a + b, b + a, "Addition in $algebra is not commutative.")
assertEquals(a + b + c, a + (b + c), "Addition in $algebra is not associative.")
assertEquals(x * (a + b), x * a + x * b, "Addition in $algebra is not distributive.")
assertEquals((a + b) * x, a * x + b * x, "Addition in $algebra is not distributive.")