Module Ctypes.Pred

type unop =
  1. | Extract of int * int
    (*

    start index, length

    *)
type binop =
  1. | Add
  2. | Sub
  3. | Mul
  4. | And
  5. | Or
  6. | Concat of int * int
    (*

    Size 1, size 2. First argument is the most significant

    *)
type expr =
  1. | Val of value
  2. | Self
  3. | Unop of unop * expr
  4. | Binop of binop * expr * expr
type cmpop =
  1. | Equal
  2. | NotEqual
  3. | ULt
  4. | SLt
  5. | ULeq
  6. | SLeq
  7. | UGeq
  8. | SGeq
  9. | UGt
  10. | SGt
type t =
  1. | True
  2. | Cmp of cmpop * expr * expr
  3. | And of t * t

Predicate on a structure field or array element, which is supposed to be true at all times.

val compare : t -> t -> int
val equal : t -> t -> bool
val pp : Stdlib.Format.formatter -> t -> unit
val eq : value -> t

Helpers.

val neq : value -> t
val slt : value -> t
val sleq : value -> t
val sgeq : value -> t
val sgt : value -> t
val ult : value -> t
val uleq : value -> t
val ugeq : value -> t
val ugt : value -> t
exception Undefined_symbol of string
val eval : symbols:Z.t Datatype_sig.StringMap.t -> self:Z.t -> t -> bool

Evaluate a predicate. May throw Undefined_symbol.

val conjunction : t -> t -> t

Conjoint two predicate. Ignores true (void) predicates