diff options
Diffstat (limited to 'abstract')
-rw-r--r-- | abstract/abs_domain.ml | 21 | ||||
-rw-r--r-- | abstract/abs_interp.ml | 8 |
2 files changed, 21 insertions, 8 deletions
diff --git a/abstract/abs_domain.ml b/abstract/abs_domain.ml index a30713a..64eefc7 100644 --- a/abstract/abs_domain.ml +++ b/abstract/abs_domain.ml @@ -223,8 +223,23 @@ module D (ND : NUMERICAL_ENVIRONMENT_DOMAIN) : ENVIRONMENT_DOMAIN = struct let var_itv x id = if List.mem_assoc id x.nvars - then IN (VMap.map (fun v -> ND.var_itv v id) x.value) - else not_implemented "var_itv for enum variable" + then + let x = List.fold_left + (fun x (v, _) -> + if v.[0] = 'N' || (String.length v > 3 && String.sub v 0 3 = "pre") + then forgetvar x v else x) + x x.evars in + IN (VMap.map (fun v -> ND.var_itv v id) x.value) + else + let all = List.fold_left (fun a b -> SSet.add b a) SSet.empty + (List.assoc id x.evars) in + IE + (VMap.fold + (fun enum _ s -> + try SSet.add (VarMap.find id enum) s + with Not_found -> all) + x.value + SSet.empty) let set_disjunct x id p = { x with @@ -356,7 +371,7 @@ module D (ND : NUMERICAL_ENVIRONMENT_DOMAIN) : ENVIRONMENT_DOMAIN = struct { x with value = VMap.empty } let print_all fmt x = - Format.fprintf fmt "@[<v 0>"; + Format.fprintf fmt "@[<v>"; VMap.iter (fun enum num -> Format.fprintf fmt "@[<hv 2>{ %a ∧@ %a }@]@ " diff --git a/abstract/abs_interp.ml b/abstract/abs_interp.ml index 7a53134..e55f199 100644 --- a/abstract/abs_interp.ml +++ b/abstract/abs_interp.ml @@ -127,14 +127,12 @@ end = struct let do_prog widen_delay rp = let st = init_state widen_delay rp in - let final, final_c = loop st st.env in + let final_nc, final = loop st st.env in Format.printf "@[<hov>F %a@]@.@." - E.print_all final; - (* + E.print_all final_nc; Format.printf "@[<hov>F' %a@]@.@." - E.print_all final_c; - *) + E.print_all final; let check_guarantee (id, f) = let cl = Formula.conslist_of_f f in |