From a9a38f20ec157ebc0b16e26f4c26265815adc5e6 Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Tue, 9 Aug 2016 03:37:47 -0700 Subject: [PATCH] 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 --- infer/src/backend/Attribute.ml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/infer/src/backend/Attribute.ml b/infer/src/backend/Attribute.ml index 93a575311..80126fbb0 100644 --- a/infer/src/backend/Attribute.ml +++ b/infer/src/backend/Attribute.ml @@ -133,14 +133,12 @@ let filter_atoms ~f prop = Prop.normalize (Prop.replace_pi pi1 prop) let remove prop atom = - match atom with - | Sil.Apred (_, exps) | Anpred (_, exps) -> - let nexps = IList.map (fun e -> Prop.exp_normalize_prop prop e) exps in - let natom = Sil.atom_replace_exp (IList.combine exps nexps) atom in - let f a = not (Sil.atom_equal natom a) in - filter_atoms ~f prop - | _ -> - prop + if is_pred atom then + let natom = Prop.atom_normalize_prop prop atom in + let f a = not (Sil.atom_equal natom a) in + filter_atoms ~f prop + else + prop (** Remove an attribute from all the atoms in the heap *) let remove_for_attr prop att0 =