AStat/domains/domain.ml

67 lines
1.4 KiB
OCaml
Raw Normal View History

2024-05-29 11:47:47 +02:00
(*
Cours "Sémantique et Application à la Vérification de programmes"
Antoine Miné 2015
Marc Chevalier 2018
Josselin Giet 2021
Ecole normale supérieure, Paris, France / CNRS / INRIA
*)
open! Cfg
(* Signature for the variables *)
module type VARS = sig
val support: var list
end
(*
Signature of abstract domains representing sets of envrionments
(for instance: a map from variable to their bounds).
*)
module type DOMAIN =
sig
(* type of abstract elements *)
(* an element of type t abstracts a set of mappings from variables
to integers
*)
type t
(* initial environment, with all variables initialized to 0 *)
val init: t
(* empty set of environments *)
val bottom: t
(* assign an integer expression to a variable *)
val assign: t -> var -> int_expr -> t
(* filter environments to keep only those satisfying the boolean expression *)
val guard: t -> bool_expr -> t
(* abstract join *)
val join: t -> t -> t
(* abstract meet *)
val meet: t -> t -> t
(* widening *)
val widen: t -> t -> t
(* narrowing *)
val narrow: t -> t -> t
(* whether an abstract element is included in another one *)
val subset: t -> t -> bool
(* whether the abstract element represents the empty set *)
val is_bottom: t -> bool
(* prints *)
val print: Format.formatter -> t -> unit
end