symbolic-base-0.1.0.0: ZkFold Symbolic compiler and zero-knowledge proof protocols
Safe HaskellSafe-Inferred
LanguageHaskell2010

ZkFold.Base.Algebra.Polynomials.Multivariate.Polynomial

Synopsis

Documentation

type Polynomial c i j = (Eq c, Field c, Monomial i j) Source #

A class for polynomials. c is the coefficient type, i is the variable type, j is the power type.

newtype Poly c i j Source #

Polynomial type

Constructors

P [(c, Mono i j)] 

Instances

Instances details
FromConstant c' c => FromConstant c' (Poly c i j) Source # 
Instance details

Defined in ZkFold.Base.Algebra.Polynomials.Multivariate.Polynomial

Methods

fromConstant :: c' -> Poly c i j Source #

Scale c' c => Scale c' (Poly c i j) Source # 
Instance details

Defined in ZkFold.Base.Algebra.Polynomials.Multivariate.Polynomial

Methods

scale :: c' -> Poly c i j -> Poly c i j Source #

(Arbitrary c, Arbitrary (Mono i j)) => Arbitrary (Poly c i j) Source # 
Instance details

Defined in ZkFold.Base.Algebra.Polynomials.Multivariate.Polynomial

Methods

arbitrary :: Gen (Poly c i j) #

shrink :: Poly c i j -> [Poly c i j] #

(FromJSONKey i, Ord i, FromJSON c, FromJSON j) => FromJSON (Poly c i j) Source # 
Instance details

Defined in ZkFold.Base.Algebra.Polynomials.Multivariate.Polynomial

Methods

parseJSON :: Value -> Parser (Poly c i j) #

parseJSONList :: Value -> Parser [Poly c i j] #

(ToJSON c, ToJSON j, ToJSONKey i) => ToJSON (Poly c i j) Source # 
Instance details

Defined in ZkFold.Base.Algebra.Polynomials.Multivariate.Polynomial

Methods

toJSON :: Poly c i j -> Value #

toEncoding :: Poly c i j -> Encoding #

toJSONList :: [Poly c i j] -> Value #

toEncodingList :: [Poly c i j] -> Encoding #

Generic (Poly c i j) Source # 
Instance details

Defined in ZkFold.Base.Algebra.Polynomials.Multivariate.Polynomial

Associated Types

type Rep (Poly c i j) :: Type -> Type #

Methods

from :: Poly c i j -> Rep (Poly c i j) x #

to :: Rep (Poly c i j) x -> Poly c i j #

Polynomial c i j => IsList (Poly c i j) Source # 
Instance details

Defined in ZkFold.Base.Algebra.Polynomials.Multivariate.Polynomial

Associated Types

type Item (Poly c i j) #

Methods

fromList :: [Item (Poly c i j)] -> Poly c i j #

fromListN :: Int -> [Item (Poly c i j)] -> Poly c i j #

toList :: Poly c i j -> [Item (Poly c i j)] #

(Show c, Show i, Show j, Monomial i j) => Show (Poly c i j) Source # 
Instance details

Defined in ZkFold.Base.Algebra.Polynomials.Multivariate.Polynomial

Methods

showsPrec :: Int -> Poly c i j -> ShowS #

show :: Poly c i j -> String #

showList :: [Poly c i j] -> ShowS #

(NFData c, NFData i, NFData j) => NFData (Poly c i j) Source # 
Instance details

Defined in ZkFold.Base.Algebra.Polynomials.Multivariate.Polynomial

Methods

rnf :: Poly c i j -> () #

Polynomial c i j => Eq (Poly c i j) Source # 
Instance details

Defined in ZkFold.Base.Algebra.Polynomials.Multivariate.Polynomial

Methods

(==) :: Poly c i j -> Poly c i j -> Bool #

(/=) :: Poly c i j -> Poly c i j -> Bool #

Polynomial c i j => Ord (Poly c i j) Source # 
Instance details

Defined in ZkFold.Base.Algebra.Polynomials.Multivariate.Polynomial

Methods

compare :: Poly c i j -> Poly c i j -> Ordering #

(<) :: Poly c i j -> Poly c i j -> Bool #

(<=) :: Poly c i j -> Poly c i j -> Bool #

(>) :: Poly c i j -> Poly c i j -> Bool #

(>=) :: Poly c i j -> Poly c i j -> Bool #

max :: Poly c i j -> Poly c i j -> Poly c i j #

min :: Poly c i j -> Poly c i j -> Poly c i j #

Polynomial c i j => AdditiveGroup (Poly c i j) Source # 
Instance details

Defined in ZkFold.Base.Algebra.Polynomials.Multivariate.Polynomial

Methods

(-) :: Poly c i j -> Poly c i j -> Poly c i j Source #

negate :: Poly c i j -> Poly c i j Source #

Polynomial c i j => AdditiveMonoid (Poly c i j) Source # 
Instance details

Defined in ZkFold.Base.Algebra.Polynomials.Multivariate.Polynomial

Methods

zero :: Poly c i j Source #

Polynomial c i j => AdditiveSemigroup (Poly c i j) Source # 
Instance details

Defined in ZkFold.Base.Algebra.Polynomials.Multivariate.Polynomial

Methods

(+) :: Poly c i j -> Poly c i j -> Poly c i j Source #

Polynomial c i j => MultiplicativeMonoid (Poly c i j) Source # 
Instance details

Defined in ZkFold.Base.Algebra.Polynomials.Multivariate.Polynomial

Methods

one :: Poly c i j Source #

Polynomial c i j => MultiplicativeSemigroup (Poly c i j) Source # 
Instance details

Defined in ZkFold.Base.Algebra.Polynomials.Multivariate.Polynomial

Methods

(*) :: Poly c i j -> Poly c i j -> Poly c i j Source #

Polynomial c i j => Ring (Poly c i j) Source # 
Instance details

Defined in ZkFold.Base.Algebra.Polynomials.Multivariate.Polynomial

Polynomial c i j => Semiring (Poly c i j) Source # 
Instance details

Defined in ZkFold.Base.Algebra.Polynomials.Multivariate.Polynomial

Polynomial c i j => Exponent (Poly c i j) Natural Source # 
Instance details

Defined in ZkFold.Base.Algebra.Polynomials.Multivariate.Polynomial

Methods

(^) :: Poly c i j -> Natural -> Poly c i j Source #

FromConstant (Poly c i j) (Poly c i j) Source # 
Instance details

Defined in ZkFold.Base.Algebra.Polynomials.Multivariate.Polynomial

Methods

fromConstant :: Poly c i j -> Poly c i j Source #

Polynomial c i j => Scale (Poly c i j) (Poly c i j) Source # 
Instance details

Defined in ZkFold.Base.Algebra.Polynomials.Multivariate.Polynomial

Methods

scale :: Poly c i j -> Poly c i j -> Poly c i j Source #

type Rep (Poly c i j) Source # 
Instance details

Defined in ZkFold.Base.Algebra.Polynomials.Multivariate.Polynomial

type Rep (Poly c i j) = D1 ('MetaData "Poly" "ZkFold.Base.Algebra.Polynomials.Multivariate.Polynomial" "symbolic-base-0.1.0.0-inplace" 'True) (C1 ('MetaCons "P" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(c, Mono i j)])))
type Item (Poly c i j) Source # 
Instance details

Defined in ZkFold.Base.Algebra.Polynomials.Multivariate.Polynomial

type Item (Poly c i j) = (c, Map i j)

polynomial :: Polynomial c i j => [(c, Mono i j)] -> Poly c i j Source #

Polynomial constructor

evalPolynomial :: forall c i j b. AdditiveMonoid b => Scale c b => ((i -> b) -> Mono i j -> b) -> (i -> b) -> Poly c i j -> b Source #

variables :: forall c v. Ord v => Poly c v Natural -> Set v Source #

mapVars :: Variable i2 => (i1 -> i2) -> Poly c i1 j -> Poly c i2 j Source #

mapVarPolynomial :: Variable i => Map i i -> Poly c i j -> Poly c i j Source #

mapCoeffs :: forall c c' i j. (c -> c') -> Poly c i j -> Poly c' i j Source #

var :: Polynomial c i j => i -> Poly c i j Source #

var i is a polynomial \(p(x) = x_i\)

constant :: Polynomial c i j => c -> Poly c i j Source #

constant i is a polynomial \(p(x) = const\)

lt :: Polynomial c i j => Poly c i j -> (c, Mono i j) Source #

zeroP :: Poly c i j -> Bool Source #

scaleM :: Polynomial c i j => (c, Mono i j) -> Poly c i j -> Poly c i j Source #