Module Polynomial.Monomial

type t

A monomial is represented by a multiset of variables

val fold : (var -> int -> 'a -> 'a) -> t -> 'a -> 'a

fold f m acc folds over the variables with multiplicities

val degree : t -> int

degree m is the sum of the degrees of each variable

val const : t

const

returns

the empty monomial i.e. without any variable

val is_const : t -> bool
val var : var -> t

var x

returns

the monomial x^1

val prod : t -> t -> t

prod n m

returns

the monomial n*m

val sqrt : t -> t option

sqrt m

returns

Some r iff r^2 = m

val is_var : t -> bool

is_var m

returns

true iff m = x^1 for some variable x

val get_var : t -> var option

get_var m

returns

x iff m = x^1 for variable x

val div : t -> t -> t * int

div m1 m2

returns

a pair mr,n such that mr * (m2)^n = m1 where n is maximum

val compare : t -> t -> int

compare m1 m2 provides a total order over monomials

val variables : t -> Micromega_plugin.Mutils.ISet.t

variables m

returns

the set of variables with (strictly) positive multiplicities