Skip to content

Commit 56144fe

Browse files
committed
Add a fallback for is_known(characteristic, ::NCRing)
... to force ring implementations to provide at least one of characteristic(R) and is_known(characteristic, R) if they want to pass the conformance tests. This is the only way I can see to stop rings from implementing characteristic for their ring type but forgetting to also provide a matching is_known(characteristic, R).
1 parent 7d760b2 commit 56144fe

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/NCRings.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,13 @@ function characteristic(R::NCRing)
213213
error("Characteristic not known")
214214
end
215215

216+
# All rings are supposed to implement characteristic if they can. If they
217+
# can not, or only can do it with an expensive computation (e.g. a Groebner
218+
# basis), then instead they should implement an `is_known` method indicating
219+
# this. To enforce this via the ring conformance tests, we add this default
220+
# method for `is_known(characteristic, ::NCRing)`
221+
is_known(::typeof(characteristic), ::NCRing) = true
222+
216223
###############################################################################
217224
#
218225
# One and zero

0 commit comments

Comments
 (0)