summaryrefslogtreecommitdiff
path: root/abstract/abs_interp.ml
diff options
context:
space:
mode:
Diffstat (limited to 'abstract/abs_interp.ml')
-rw-r--r--abstract/abs_interp.ml15
1 files changed, 5 insertions, 10 deletions
diff --git a/abstract/abs_interp.ml b/abstract/abs_interp.ml
index bed2f2c..a612976 100644
--- a/abstract/abs_interp.ml
+++ b/abstract/abs_interp.ml
@@ -328,16 +328,11 @@ end = struct
pass_cycle : st -> case_v -> case_v
*)
let pass_cycle st (enum, num) =
- let assign_e =
- List.map (fun (a, b, _) -> a, b)
- (List.filter
- (fun (_, _, t) -> match t with TEnum _ -> true | _ -> false)
- st.cycle) in
- let assign_n =
- List.map (fun (a, b, _) -> a, NIdent b)
- (List.filter
- (fun (_, _, t) -> match t with TInt | TReal -> true | _ -> false)
- st.cycle) in
+ let assign_e, assign_n = List.fold_left
+ (fun (ae, an) (a, b, t) -> match t with
+ | TEnum _ -> (a, b)::ae, an
+ | TInt | TReal -> ae, (a, NIdent b)::an)
+ ([], []) st.cycle in
let enum = ED.assign enum assign_e in
let num = ND.assign num assign_n in