|
|
|
@ -12,8 +12,12 @@ open! Utils
|
|
|
|
|
(** Single abstraction for all the kinds of variables in SIL *)
|
|
|
|
|
|
|
|
|
|
type t =
|
|
|
|
|
| ProgramVar of Pvar.t
|
|
|
|
|
| LogicalVar of Ident.t
|
|
|
|
|
| ProgramVar of Pvar.t
|
|
|
|
|
[@@deriving compare]
|
|
|
|
|
|
|
|
|
|
let equal v1 v2 =
|
|
|
|
|
compare v1 v2 = 0
|
|
|
|
|
|
|
|
|
|
let of_id id =
|
|
|
|
|
LogicalVar id
|
|
|
|
@ -25,15 +29,6 @@ let to_exp = function
|
|
|
|
|
| ProgramVar pvar -> Exp.Lvar pvar
|
|
|
|
|
| LogicalVar id -> Exp.Var id
|
|
|
|
|
|
|
|
|
|
let compare v1 v2 = match v1, v2 with
|
|
|
|
|
| ProgramVar pv1, ProgramVar pv2 -> Pvar.compare pv1 pv2
|
|
|
|
|
| LogicalVar sv1, LogicalVar sv2 -> Ident.compare sv1 sv2
|
|
|
|
|
| ProgramVar _, _ -> 1
|
|
|
|
|
| LogicalVar _, _ -> -1
|
|
|
|
|
|
|
|
|
|
let equal v1 v2 =
|
|
|
|
|
compare v1 v2 = 0
|
|
|
|
|
|
|
|
|
|
let pp fmt = function
|
|
|
|
|
| ProgramVar pv -> (Pvar.pp pe_text) fmt pv
|
|
|
|
|
| LogicalVar id -> (Ident.pp pe_text) fmt id
|
|
|
|
|