-
Notifications
You must be signed in to change notification settings - Fork 423
Computation models for polynomials and finitely supported functions
Eric Wieser edited this page Aug 3, 2023
·
19 revisions
Today, MvPolynomial
and Polynomial
are both implemented in terms of Finsupp
. As a result, all of:
Finsupp
Polynomial
MvPolynomial
are largely noncomputable
.
Possible designs include:
- De-classicalized
Finsupp
: promote anyClassical.decEq
terms to typeclass parameters. As a reminder, this stores the exactFinset
of non-zero values. -
DFinsupp
: we already have a working model here. This stores aMultiset
that is a superset of all the non-zero values - Quotient of generators: an approach similar to
FreeAlgebra
. This could represent1 + 3x^2
asadd (monomial 0 1) (monomial 2 3)
and quotient by algebraic rules (which is whatFreeAlgebra
does)
The following outlines the computational behavior that ι →₀ R
could have under these strategies
Operation | De-classicalized Finsupp
|
DFinsupp |
Quotient of inductive type |
---|---|---|---|
f i (aka p.coeff i ) |
✓ | ✓ | DecidableEq ι |
single i r (aka X ) |
DecidableEq ι DecidableEq R
|
DecidableEq ι |
✓ |
support |
✓ | DecidableEq R |
DecidableEq ι DecidableEq R
|
+ |
DecidableEq ι DecidableEq R
|
✓ | ✓ |