forked from caterinaurban/function
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbanal_domain.ml
101 lines (61 loc) · 1.93 KB
/
banal_domain.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
(*
Abstract domain signature.
Copyright (C) 2011 Antoine Miné
*)
open Banal_datatypes
open Banal_abstract_syntax
open Banal_typed_syntax
type assign_dst =
| STRONG of var
| WEAK of var list
type error = unit
type merge_type =
| MERGE
| WIDEN
type filter_type =
| IFTHENELSE
| LOOP
module type ABSTRACT_DOMAIN = sig
(* types *)
(* ***** *)
type t
(* management *)
(* ********** *)
(* empty element, with no variable *)
val empty: unit -> t
(* creates a _|_ element on the same variable set as its argument *)
val bot: t -> t
(* creates a top element on the same variable set as its argument *)
val top: t -> t
(* queries *)
(* ******* *)
(* true is definite, false means maybe *)
val is_bot: t -> bool
val subseteq: t -> t -> bool
val print: Format.formatter -> t -> unit
val print_svg: out_channel -> ?color:bool -> ?window:float*float*float*float -> int*int -> t -> var*var -> unit
val print_html: out_channel -> t -> unit
val print_latex: out_channel -> t -> unit
(* forward operators *)
(* ***************** *)
(* take pre as argument, return overapproximated post *)
val fwd_add_var: t -> var -> t
val fwd_del_var: t -> var -> t
val fwd_join: t -> t -> merge_type -> t
val fwd_assign: t -> assign_dst -> (expr typed) -> t * error
(* returns first an environment where the test holds, then an environment
where it does not
*)
val fwd_filter: t -> (expr typed) -> t * t * error
(* backward operators *)
(* ****************** *)
(* takes refined post and pre as arguments, return underapproximated pre *)
val bwd_add_var: t -> var -> t -> t
val bwd_del_var: t -> var -> t -> t
val bwd_meet: t -> t -> merge_type -> t
val bwd_assign: t -> error -> assign_dst -> (expr typed) -> t -> t
val bwd_filter: t -> t -> error -> (expr typed) -> filter_type -> t -> t
end
(* no error management yet *)
let join_err err1 err2 = ()
let noerr = ()