Module Logtk.Monome
Polynomes of order 1, over several variables
.
type term
= Term.t
type 'a t
A monome over terms, with coefficient of type 'a
type 'a monome
= 'a t
val equal : 'n t -> 'n t -> bool
val compare : 'n t -> 'n t -> int
val hash : _ t -> int
val ty : _ t -> Type.t
type of the monome (int or rat)
val const : 'a t -> 'a
constant
val add_const : 'a t -> 'a -> 'a t
Add term with coefficient. Sums coeffs.
Add given number to constant
val add_list : 'a t -> ('a * term) list -> 'a t
val map : (term -> term) -> 'a t -> 'a t
val map_num : ('a -> 'a) -> 'a t -> 'a t
module Seq : sig ... end
val is_const : _ t -> bool
Returns
true
if the monome is only a constant
val is_zero : _ t -> bool
return
true
if the monome is the constant 0
val sign : _ t -> int
Assuming
is_constant m
,sign m
returns the sign ofm
.- raises Invalid_argument
if the monome is not a constant
val size : _ t -> int
Number of distinct terms. 0 means that the monome is a constant
val sum : 'a t -> 'a t -> 'a t
val difference : 'a t -> 'a t -> 'a t
val uminus : 'a t -> 'a t
val product : 'a t -> 'a -> 'a t
Product with constant
val comparison : 'a t -> 'a t -> Comparison.t
Try 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 -> bool
dominates ~strict m1 m2
is true ifm1
is 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 t
Normalize 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 t
split m
splits into a monome with positive coefficients, and one with negative coefficients.- returns
m1, m2
such thatm = m1 - m2
andm1,m2
both have positive coefficients
val apply_subst : Subst.Renaming.t -> Subst.t -> 'a t Scoped.t -> 'a t
Apply 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 t
Apply 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.t
val unify : ?subst:Unif_subst.t -> 'a t Scoped.t -> 'a t Scoped.t -> Unif_subst.t Sequence.t
val is_ground : _ t -> bool
Are there no variables in the monome?
val fold_max : ord:Ordering.t -> ('a -> int -> 'b -> term -> 'a) -> 'a -> 'b t -> 'a
Fold over terms that are maximal in the given ordering.
module Focus : sig ... end
Focus on a specific term
val pp : _ t CCFormat.printer
val to_string : _ t -> string
val pp_tstp : _ t CCFormat.printer
val pp_zf : _ t CCFormat.printer
module Int : sig ... end
module Rat : sig ... end