Skip to content

Commit 51f2ffb

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 36cfb14 commit 51f2ffb

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
@@ -229,6 +229,13 @@ function characteristic(R::NCRing)
229229
error("Characteristic not known")
230230
end
231231

232+
# All rings are supposed to implement characteristic if they can. If they
233+
# can not, or only can do it with an expensive computation (e.g. a Groebner
234+
# basis), then instead they should implement an `is_known` method indicating
235+
# this. To enforce this via the ring conformance tests, we add this default
236+
# method for `is_known(characteristic, ::NCRing)`
237+
is_known(::typeof(characteristic), ::NCRing) = true
238+
232239
###############################################################################
233240
#
234241
# One and zero

0 commit comments

Comments
 (0)