@@ -40,12 +40,22 @@ function _combine_with_gram(
4040 return MB. SubBasis {B} (keys (SA. coeffs (p)))
4141end
4242
43- _reduce_with_domain (basis:: MB.SubBasis , :: FullSpace ) = basis
43+ function _reduce_with_domain (basis:: MB.SubBasis , zero_basis, :: FullSpace )
44+ return MB. explicit_basis_covering (zero_basis, basis)
45+ end
4446
45- function _reduce_with_domain (basis:: MB.SubBasis{B} , domain) where {B}
46- if B != = MB. Monomial
47- error (" Only Monomial basis support with an equalities in domain" )
48- end
47+ function _reduce_with_domain (basis, zero_basis, domain)
48+ return __reduce_with_domain (basis, zero_basis, domain)
49+ end
50+
51+ function __reduce_with_domain (_, _, _)
52+ return error (" Only Monomial basis support with an equalities in domain" )
53+ end
54+ function __reduce_with_domain (
55+ basis:: MB.SubBasis{MB.Monomial} ,
56+ :: MB.FullBasis{MB.Monomial} ,
57+ domain,
58+ )
4959 I = ideal (domain)
5060 # set of standard monomials that are hit
5161 standard = Set {eltype(basis.monomials)} ()
@@ -60,14 +70,15 @@ function _reduce_with_domain(basis::MB.SubBasis{B}, domain) where {B}
6070end
6171
6272function zero_basis (
63- :: AbstractIdealCertificate ,
73+ cert :: AbstractIdealCertificate ,
6474 basis,
6575 domain,
6676 gram_bases,
6777 weights,
6878)
6979 return _reduce_with_domain (
7080 _combine_with_gram (basis, gram_bases, weights),
81+ _zero_basis (cert),
7182 domain,
7283 )
7384end
@@ -270,15 +281,27 @@ function _quotient_basis_type(
270281 }
271282end
272283
284+ _zero_basis (c:: SimpleIdealCertificate ) = c. zero_basis
285+
286+ function _zero_basis_type (:: Type{<:SimpleIdealCertificate{C,G,Z}} ) where {C,G,Z}
287+ return Z
288+ end
289+
290+ _zero_basis (c:: Remainder ) = _zero_basis (c. gram_certificate)
291+
292+ function _zero_basis_type (:: Type{Remainder{C}} ) where {C}
293+ return _zero_basis_type (C)
294+ end
295+
273296function MA. promote_operation (
274297 :: typeof (zero_basis),
275- :: Type{<:Union{SimpleIdealCertificate,Remainder}} ,
276- :: Type{B} ,
298+ C :: Type{<:Union{SimpleIdealCertificate,Remainder}} ,
299+ :: Type ,
277300 :: Type{SemialgebraicSets.FullSpace} ,
278301 :: Type ,
279302 :: Type ,
280- ) where {B}
281- return B
303+ )
304+ return MB . explicit_basis_type ( _zero_basis_type (C))
282305end
283306
284307function MA. promote_operation (
0 commit comments