Module Indexes


module Indexes: sig .. end
Indexes.

e.g. "i+1" in "P_i+1", also used for bounds as "1" and "n" in "/\i=1..n ..."

The only authorized expressions are the ones of the form "d.n+k" where:


Author(s): Vincent Aravantinos

type t 
The type of indexes

Constructors

val of_num : int -> t
An index which is just a number.
val of_var : Variable.t -> t
An index which is just a variable.
val add : t -> int -> t
The sum of an index and a number.

Selectors

val get_var : t -> Variable.t option
Returns Some v if the index contains a variable, None otherwise
val get_shift : t -> int

Printing

val to_string : t -> string
val to_tex : t -> string

Comparisons

val max : t -> t -> t
Computes the maximum of two terms w.r.t. the partial ordering on expressions. e.g. n < n+1, n-1 < n, 1 < 2 but 1 < n is not comparable (n may very well equal 0,1,2 or any other integer)
val min : t -> t -> t
val equal : t -> t -> bool
val total_compare : t -> t -> int

Substitutions

val compute_term : t -> int -> int
Computes the integer obtained from the substitution of the only variable of t (if any) by the input integer
include Substitution.Substituable
module LoopingMap: Looping.LoopingMap  with type loopable = t
Looping
val inverse : t -> t
Others