package tezos-plonk

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module MP.PolynomialSource

Polynomials are maps from monomials to their coefficient. These coefficients should be non-zero. An empty map is the zero polynomial.

Sourceval zero : t

The zero polynomial

Sourceval one : t

The unit polynomial

The "variable" polynomial

Sourceval of_monomial : Monomial.t -> t

Builds a polynomial with a single monomial

Sourceval of_list : (Monomial.t * scalar) list -> t

Builds a polynomial from a list of monomials

Returns the sorted list of variables occuring in the object

Sourceval equal : t -> t -> bool

Equality between polynomials. Assuming monomials do not contain zero exponents, and the polynomials do not contain zero coefficients, the polynomial representation is unique, so equality is the equality of the coefficients for each of their monomial.

Returns the maximum degree of the given variable in the given polynomial

Sourceval add : t -> t -> t

Adds two polynomials

Sourceval neg : t -> t

Negation of a polynomial

Sourceval sub : t -> t -> t

Substraction of two polynomials

Sourceval mul_scalar : scalar -> t -> t

Multiplies a polynomial by a scalar

Sourceval normalize : t -> scalar * t

normalize_poly p = (k,q) verifies scalar_poly k q = p and q is normalized such that its smallest monomial has coef 1. The monomial ordering makes so that the constant term is always the smallest (if it exists). Also, the scalar K.zero is returned only if p is zero, in which case q will also be equal to zero.

Sourceval mul : t -> t -> t

Polynomial multiplication

group_by p var returns a list p_0,p_1,...,p_k such that p = \sum var^i * p_i p = p_0 + var * (p_1 + var * ( ... + var * ( p_{k-1} + var * p_k ) ... ) )

substitution p x q replaces the variable x in p by q

Sourceval substitution_comp : t -> Bls12_381_polynomial.Multivariate.variable -> t -> t -> t

substitution_comp p x a b replaces the variables x and y (a fresh variable) in y^n.p(x/y) (where n = deg(x)) by a and b respectively.

Returns the leading coefficient of p in the variable x, with the degree of x

Sourceval partial_div_euclid : t -> t -> Bls12_381_polynomial.Multivariate.variable -> t * t * t * int

partial_div_euclid p1 p2 y returns (q,r,d,n) st:

  • p1 = (q/d^n) * p2 + (r/d^n)
  • if p1 and p2 are polynomials in Qx_i,y, where the x_i are other variables, then q and r are polynomials in y, with coefficients in Qx_i, and d is a polynomial in Qx_i.
  • deg_y(r) < deg_y(p2)

partial_gcd p1 p2 y returns the gcd of p1 and p2 wrt the variable y

Sourceval apply : t -> spec -> scalar

Partial application for polynomials

Sourceval fast_apply : t -> spec -> scalar
Sourceval partial_apply : t -> spec -> t

Extract the constant value of the given polynomial

Sourceval to_ascii : t -> string

Conversion to printable strings

Sourcemodule PolynomialOperators : sig ... end

Prefix and infix operators

OCaml

Innovation. Community. Security.