Skip to content

Commit

Permalink
Fix rebasing artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
iokasimov committed Apr 13, 2024
1 parent 4c193f6 commit 6fdc71b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 24 deletions.
10 changes: 1 addition & 9 deletions src/ZkFold/Base/Algebra/Basic/Field.hs
Original file line number Diff line number Diff line change
Expand Up @@ -266,19 +266,11 @@ instance Field (Ext3 f e) => Exponent (Ext3 f e) Integer where
instance (Field f, Eq f, IrreduciblePoly f e) => Field (Ext3 f e) where
finv (Ext3 a b c) =
let (g, s) = eea (toPoly [a, b, c]) (irreduciblePoly @f @e)
<<<<<<< HEAD
in case scaleP (one // lt g) 0 s of
P [] -> Ext3 zero zero zero
P [x] -> Ext3 x zero zero
P [x, y] -> Ext3 x y zero
P v -> Ext3 (v V.! 0) (v V.! 1) (v V.! 2)
=======
in case fromPoly $ scaleP (one / lt g) 0 s of
in case fromPoly $ scaleP (one // lt g) 0 s of
[] -> Ext3 zero zero zero
[x] -> Ext3 x zero zero
[x, y] -> Ext3 x y zero
v -> Ext3 (v V.! 0) (v V.! 1) (v V.! 2)
>>>>>>> 60f8d34 (Hide `P`/`PV` constructors for polymonials)

rootOfUnity n = (\r -> Ext3 r zero zero) <$> rootOfUnity n

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Data.Aeson (FromJSON, ToJSON)
import Data.List (intercalate)
import Data.Map (Map, toList, unionWith, differenceWith, empty, fromListWith)
import qualified Data.Map as Map
import Numeric.Natural (Natural)
import GHC.Generics (Generic)
import Prelude hiding (Num(..), (/), (!!), lcm, length, sum, take, drop)
import Test.QuickCheck (Arbitrary (..))
Expand Down
16 changes: 1 addition & 15 deletions src/ZkFold/Base/Algebra/Polynomials/Multivariate/Polynomial.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import Data.Functor ((<&>))
import Data.Bifunctor (Bifunctor(..))
import Data.List (intercalate, foldl')
import Data.Map (Map, empty)
import Numeric.Natural (Natural)
import GHC.Generics (Generic)
import Prelude hiding (Num(..), (/), (!!), lcm, length, sum, take, drop)
import Test.QuickCheck (Arbitrary (..))
Expand Down Expand Up @@ -77,14 +78,10 @@ instance (Polynomial c i j, m ~ Map i j, p ~ [(c, M i j m)]) => AdditiveSemigrou
| ml > mr = (cl, ml) : go ls ((cr, mr):rs)
| otherwise = (cr, mr) : go ((cl, ml):ls) rs

<<<<<<< HEAD
instance (Scale c' c, m ~ Map i j, p ~ [(c, M i j m)]) => Scale c' (P c i j m p) where
scale c' (P p) = P $ map (first (scale c')) p

instance forall c i j m p . (Polynomial c i j, m ~ Map i j, p ~ [(c, M i j m)]) => AdditiveMonoid (P c i j m p) where
=======
instance (Polynomial c i j, m ~ Map i j, p ~ [(c, M i j m)]) => AdditiveMonoid (P c i j m p) where
>>>>>>> 5de0359 (Remove `Monomial.Class`/`Polynomial.Class` modules)
zero = P []

instance (Polynomial c i j, m ~ Map i j, p ~ [(c, M i j m)]) => AdditiveGroup (P c i j m p) where
Expand All @@ -94,26 +91,15 @@ instance (Polynomial c i j, m ~ Map i j, p ~ [(c, M i j m)]) => MultiplicativeSe
P l * r = foldl' (+) (P []) $ map (f r) l
where f (P p) (c, m) = P $ map (bimap (* c) (* m)) p

<<<<<<< HEAD
instance MultiplicativeMonoid (P c i j m p) => Exponent (P c i j m p) Natural where
(^) = natPow

instance forall c i j m p . (Polynomial c i j, m ~ Map i j, p ~ [(c, M i j m)]) => MultiplicativeMonoid (P c i j m p) where
=======
instance (Polynomial c i j, m ~ Map i j, p ~ [(c, M i j m)]) => MultiplicativeMonoid (P c i j m p) where
>>>>>>> 5de0359 (Remove `Monomial.Class`/`Polynomial.Class` modules)
one = P [(one, M empty)]

instance (FromConstant c' c, m ~ Map i j, p ~ [(c, M i j m)]) => FromConstant c' (P c i j m p) where
fromConstant x = P [(fromConstant x, M empty)]

instance (Polynomial c i j, m ~ Map i j, p ~ [(c, M i j m)]) => Semiring (P c i j m p)

<<<<<<< HEAD
instance forall c i j m p . (Polynomial c i j, m ~ Map i j, p ~ [(c, M i j m)]) => Ring (P c i j m p)
=======
instance (Polynomial c i j, m ~ Map i j, p ~ [(c, M i j m)]) => Ring (P c i j m p)

instance (Polynomial c i j, m ~ Map i j, p ~ [(c, M i j m)]) => Scale (P c i j m p) c where
scale c (P p) = P $ map (first (*c)) p
>>>>>>> 5de0359 (Remove `Monomial.Class`/`Polynomial.Class` modules)
1 change: 1 addition & 0 deletions src/ZkFold/Base/Algebra/Polynomials/Univariate.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module ZkFold.Base.Algebra.Polynomials.Univariate
, evalPolyVec
, scalePV
, polyVecZero
, polyVecDiv
, polyVecLinear
, polyVecLagrange
, polyVecGrandProduct
Expand Down

0 comments on commit 6fdc71b

Please sign in to comment.