From f6b3f93b831255fee63ddc763fd6e0dbcbf34c07 Mon Sep 17 00:00:00 2001
From: Valentin Perrelle <valentin.perrelle@cea.fr>
Date: Thu, 3 Jan 2019 15:40:25 +0100
Subject: [PATCH] [aorai] use Path_analysis to retrieve init states

---
 src/plugins/aorai/data_for_aorai.ml | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/plugins/aorai/data_for_aorai.ml b/src/plugins/aorai/data_for_aorai.ml
index cf5032895a3..7e4985c8414 100644
--- a/src/plugins/aorai/data_for_aorai.ml
+++ b/src/plugins/aorai/data_for_aorai.ml
@@ -2018,14 +2018,8 @@ let removeUnusedTransitionsAndStates () =
       (Aorai_state.Set.add state set)
   in
   let reached _ state set = Aorai_state.Map.fold treat_one_state state set in
-  let init =
-    List.fold_left
-      (fun acc x ->
-         if x.init = Bool3.True then Aorai_state.Set.add x acc else acc)
-      Aorai_state.Set.empty
-      (fst (getAutomata()))
-  in
-  let reached_states = Pre_state.fold reached init in
+  let init = Path_analysis.get_init_states (getAutomata ()) in
+  let reached_states = Pre_state.fold reached (Aorai_state.Set.of_list init) in
   let reached_states = Post_state.fold reached reached_states in
   let reached_states = Loop_init_state.fold reached reached_states in
   let reached_states = Loop_invariant_state.fold reached reached_states in
-- 
GitLab