Skip to content
Snippets Groups Projects
Commit e1a55cba authored by David Bühler's avatar David Bühler
Browse files

[Eva] Lattice_bounds: implements [join] and [narrow] for the Top module.

parent 96cc44f0
No related branches found
No related tags found
No related merge requests found
...@@ -250,6 +250,18 @@ struct ...@@ -250,6 +250,18 @@ struct
| `Value v -> v | `Value v -> v
| `Top -> top | `Top -> top
(** Lattice *)
let join join_value x y =
match x, y with
| `Top, _ | _, `Top -> `Top
| `Value vx, `Value vy -> join_value vx vy
let narrow narrow_value x y =
match x, y with
| `Top, v | v, `Top -> v
| `Value vx, `Value vy -> `Value (narrow_value vx vy)
(** Combination *) (** Combination *)
let zip x y = let zip x y =
......
...@@ -131,6 +131,10 @@ module Top : sig ...@@ -131,6 +131,10 @@ module Top : sig
(Format.formatter -> 'a -> unit) -> (Format.formatter -> 'a -> unit) ->
Format.formatter -> 'a t -> unit Format.formatter -> 'a t -> unit
(** Lattice operators *)
val join: ('a -> 'a -> 'a t) -> 'a t -> 'a t -> 'a t
val narrow: ('a -> 'a -> 'a) -> 'a t -> 'a t -> 'a t
(** Combination *) (** Combination *)
val zip: 'a t -> 'b t -> ('a * 'b) t (* `Top if any is `Top *) val zip: 'a t -> 'b t -> ('a * 'b) t (* `Top if any is `Top *)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment