Skip to content

Commit e876dd0

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 9a8a43e commit e876dd0

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
@@ -212,6 +212,13 @@ function characteristic(R::NCRing)
212212
error("Characteristic not known")
213213
end
214214

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

0 commit comments

Comments
 (0)