[sledge] Compare logical variables by id only

Summary:
Program (and global) variables are only distinct when considering
their string names, but logical variables need only their ids.

Reviewed By: jvillard

Differential Revision: D20214528

fbshipit-source-id: f7892c3ad
master
Josh Berdine 5 years ago committed by Facebook Github Bot
parent 0f1db1bd8b
commit 9488a404ff

@ -104,6 +104,12 @@ end = struct
| Float of {data: string}
| Integer of {data: Z.t}
[@@deriving compare, equal, hash, sexp]
let compare x y =
match (x, y) with
| Var {id= i; name= _}, Var {id= j; name= _} when i > 0 && j > 0 ->
Int.compare i j
| _ -> compare x y
end
(* suppress spurious "Warning 60: unused module T0." *)

Loading…
Cancel
Save