package apronext

  1. Overview
  2. Docs
type t = Apron.Texpr1.t = {
  1. mutable texpr0 : Apron.Texpr0.t;
  2. mutable env : Apron.Environment.t;
}

APRON Expressions of level 1

type unop = Apron.Texpr0.unop =
  1. | Neg
  2. | Cast
  3. | Sqrt

Unary operators

type binop = Apron.Texpr0.binop =
  1. | Add
  2. | Sub
  3. | Mul
  4. | Div
  5. | Mod
  6. | Pow

Binary operators

type typ = Apron.Texpr0.typ =
  1. | Real
  2. | Int
  3. | Single
  4. | Double
  5. | Extended
  6. | Quad

Destination type for rounding

type round = Apron.Texpr0.round =
  1. | Near
  2. | Zero
  3. | Up
  4. | Down
  5. | Rnd

Rounding direction

type expr = Apron.Texpr1.expr =
  1. | Cst of Apron.Coeff.t
  2. | Var of Apron.Var.t
  3. | Unop of unop * expr * typ * round
  4. | Binop of binop * expr * expr * typ * round

User type for tree expressions

Constructors and Destructor

val of_expr : Apron.Environment.t -> expr -> t

General constructor (actually the most efficient)

val copy : t -> t

Copy

val of_linexpr : Apron.Linexpr1.t -> t

Conversion

val to_expr : t -> expr

General destructor

Incremental constructors

Tests

val is_interval_cst : t -> bool
val is_interval_linear : t -> bool
val is_interval_polynomial : t -> bool
val is_interval_polyfrac : t -> bool
val is_scalar : t -> bool

Operations

val extend_environment : t -> Apron.Environment.t -> t

Change the environment of the expression for a super-environment. Raise Failure if it is not the case

val extend_environment_with : t -> Apron.Environment.t -> unit

Side-effet version of the previous function

val get_texpr0 : t -> Apron.Texpr0.t

Get the underlying expression of level 0 (which is not a copy).

val get_env : t -> Apron.Environment.t

Get the environment of the expression

Printing

val string_of_unop : unop -> string
val string_of_binop : binop -> string
val string_of_typ : typ -> string
val string_of_round : round -> string
val print_unop : Format.formatter -> unop -> unit
val print_binop : Format.formatter -> binop -> unit
val print_typ : Format.formatter -> typ -> unit
val print_round : Format.formatter -> round -> unit
val print_expr : Format.formatter -> expr -> unit

Print a tree expression

val print : Format.formatter -> t -> unit

Print an abstract tree expression

Extensions

val cst_f : float -> expr

constructors

val cst_i : int -> expr
val var_s : string -> expr
val unary : ?typ:typ -> ?round:round -> unop -> t -> t
val neg : ?typ:typ -> ?round:round -> t -> t
val cast : ?typ:typ -> ?round:round -> t -> t
val sqrt : ?typ:typ -> ?round:round -> t -> t
val binary : ?typ:typ -> ?round:round -> binop -> t -> t -> t
val sub : ?typ:typ -> ?round:round -> t -> t -> t
val add : ?typ:typ -> ?round:round -> t -> t -> t
val mul : ?typ:typ -> ?round:round -> t -> t -> t
val div : ?typ:typ -> ?round:round -> t -> t -> t
val pow : ?typ:typ -> ?round:round -> t -> t -> t
val modulo : ?typ:typ -> ?round:round -> t -> t -> t
OCaml

Innovation. Community. Security.