zkFold / zkfold-base

ZkFold's Base library
https://zkfold.io
MIT License
17 stars 7 forks source link

Refactor multivariate polynomials to map-of-maps #323

Open echatav opened 4 weeks ago

echatav commented 4 weeks ago

This definition is demonstrated in #177 . A (multivariate) polynomial is a linear combination of (multivariate) monomials. (Ord var, Ring coeff) => Poly var Natural coeff is the free commutative algebra generated by var over coeff.

newtype Mono var pow = UnsafeMono {fromMono :: Map var pow}

newtype Combo var coef = UnsafeCombo {fromCombo :: Map var coef}

type Poly var pow = Combo (Mono var pow)