Module Logtk.Monome
Polynomes of order 1, over several variables
.
type term= Term.ttype 'a tA monome over terms, with coefficient of type 'a
type 'a monome= 'a t
val equal : 'n t -> 'n t -> boolval compare : 'n t -> 'n t -> intval hash : _ t -> intval ty : _ t -> Type.ttype of the monome (int or rat)
val const : 'a t -> 'aconstant
val add_const : 'a t -> 'a -> 'a tAdd term with coefficient. Sums coeffs.
Add given number to constant
val add_list : 'a t -> ('a * term) list -> 'a tval map : (term -> term) -> 'a t -> 'a tval map_num : ('a -> 'a) -> 'a t -> 'a t
module Seq : sig ... endval is_const : _ t -> boolReturns
trueif the monome is only a constant
val is_zero : _ t -> boolreturn
trueif the monome is the constant 0
val sign : _ t -> intAssuming
is_constant m,sign mreturns the sign ofm.- raises Invalid_argument
if the monome is not a constant
val size : _ t -> intNumber of distinct terms. 0 means that the monome is a constant
val sum : 'a t -> 'a t -> 'a tval difference : 'a t -> 'a t -> 'a tval uminus : 'a t -> 'a tval product : 'a t -> 'a -> 'a tProduct with constant
val comparison : 'a t -> 'a t -> Comparison.tTry to compare two monomes. They may not be comparable (ie on some points, or in some models, one will be bigger), but some pairs of monomes are: for instance, 2X + 1 < 2X + 4 is always true
val dominates : strict:bool -> 'a t -> 'a t -> booldominates ~strict m1 m2is true ifm1is always greater thanm2, in any model or variable valuation. ifdominates ~strict:false m1 m2 && dominates ~strict:false m2 m1, thenm1 = m2. @argument strict if true, use "greater than", else "greater or equal".
val normalize : 'a t -> 'a tNormalize the monome, which means that if some terms are rational or integer constants, they are moved to the constant part (e.g after apply X->3/4 in 2.X+1, one gets 2×3/4 +1. Normalization reduces this to 5/2).
val split : 'a t -> 'a t * 'a tsplit msplits into a monome with positive coefficients, and one with negative coefficients.- returns
m1, m2such thatm = m1 - m2andm1,m2both have positive coefficients
val apply_subst : Subst.Renaming.t -> Subst.t -> 'a t Scoped.t -> 'a tApply a substitution to the monome's terms. This does not preserve positions in the monome.
val apply_subst_no_simp : Subst.Renaming.t -> Subst.t -> 'a t Scoped.t -> 'a tApply a substitution to the monome's terms, without renormalizing. This preserves positions.
val matching : ?subst:Subst.t -> 'a t Scoped.t -> 'a t Scoped.t -> Subst.t Sequence.tval unify : ?subst:Unif_subst.t -> 'a t Scoped.t -> 'a t Scoped.t -> Unif_subst.t Sequence.tval is_ground : _ t -> boolAre there no variables in the monome?
val fold_max : ord:Ordering.t -> ('a -> int -> 'b -> term -> 'a) -> 'a -> 'b t -> 'aFold over terms that are maximal in the given ordering.
module Focus : sig ... endFocus on a specific term
val pp : _ t CCFormat.printerval to_string : _ t -> stringval pp_tstp : _ t CCFormat.printerval pp_zf : _ t CCFormat.printer
module Int : sig ... endmodule Rat : sig ... end