Simplify normalization in Attribute.remove

Summary:
Attribute.remove was performing an ad hoc form of normalization on
atoms, replace with the standard normalization from Prop.

Reviewed By: cristianoc

Differential Revision: D3686041

fbshipit-source-id: b89e59e
master
Josh Berdine 9 years ago committed by Facebook Github Bot 5
parent 3896b10265
commit a9a38f20ec

@ -133,14 +133,12 @@ let filter_atoms ~f prop =
Prop.normalize (Prop.replace_pi pi1 prop) Prop.normalize (Prop.replace_pi pi1 prop)
let remove prop atom = let remove prop atom =
match atom with if is_pred atom then
| Sil.Apred (_, exps) | Anpred (_, exps) -> let natom = Prop.atom_normalize_prop prop atom in
let nexps = IList.map (fun e -> Prop.exp_normalize_prop prop e) exps in let f a = not (Sil.atom_equal natom a) in
let natom = Sil.atom_replace_exp (IList.combine exps nexps) atom in filter_atoms ~f prop
let f a = not (Sil.atom_equal natom a) in else
filter_atoms ~f prop prop
| _ ->
prop
(** Remove an attribute from all the atoms in the heap *) (** Remove an attribute from all the atoms in the heap *)
let remove_for_attr prop att0 = let remove_for_attr prop att0 =

Loading…
Cancel
Save