Skip to content

Commit d231a1e

Browse files
author
Jérôme FERET
committed
reuse the contact map or the separating transitions if already computed
1 parent 81a184a commit d231a1e

3 files changed

Lines changed: 21 additions & 5 deletions

File tree

core/KaSa_rep/export/export.ml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,12 @@ functor
659659

660660
let get_reachability_analysis =
661661
get_gen ~log_title:"Reachability analysis"
662-
Remanent_state.get_reachability_result compute_reachability_result
662+
(fun state ->
663+
if Remanent_state.is_reachability_result_available state then
664+
Remanent_state.get_reachability_result state
665+
else
666+
None)
667+
compute_reachability_result
663668

664669
let output_reachability_result state =
665670
let error = Remanent_state.get_errors state in
@@ -1373,8 +1378,7 @@ functor
13731378
(Remanent_state.get_internal_contact_map Public_data.Low)
13741379
compute_raw_internal_contact_map
13751380
1376-
let compute_intermediary_internal_contact_map show_title state =
1377-
let state, _ = compute_reachability_result show_title state in
1381+
let compute_intermediary_internal_contact_map _show_title state =
13781382
let state, _ = get_reachability_analysis state in
13791383
match
13801384
Remanent_state.get_internal_contact_map Public_data.Medium state
@@ -2057,7 +2061,6 @@ functor
20572061
Remanent_parameters.set_compute_separating_transitions parameters true
20582062
in
20592063
let state' = set_parameters parameters' state in
2060-
let state', _ = compute_reachability_result _show_title state' in
20612064
let state', _ = get_reachability_analysis state' in
20622065
let state = set_parameters parameters state' in
20632066
match Remanent_state.get_separating_transitions state with

core/KaSa_rep/remanent_state/remanent_state.ml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ type ('global_static, 'static, 'dynamic) state = {
218218
bdu_handler: Mvbdu_wrapper.Mvbdu.handler;
219219
reachability_state:
220220
('global_static, 'static, 'dynamic) reachability_result option;
221+
is_reachability_result_available: bool;
221222
subviews_info: subviews_info option;
222223
dead_rules: dead_rules option;
223224
conditionally_dead_rules: rule_deadness_conditions option;
@@ -300,6 +301,7 @@ let create_state ?errors ?env ?init_state ?reset parameters init =
300301
transition_system_length = None;
301302
patch = None;
302303
global_static_information = None;
304+
is_reachability_result_available = false;
303305
}
304306

305307
(**************)
@@ -661,7 +663,11 @@ let get_scc_decomposition accuracy accuracy' state =
661663
let get_reachability_result state = state.reachability_state
662664

663665
let set_reachability_result reachability_state state =
664-
{ state with reachability_state = Some reachability_state }
666+
{
667+
state with
668+
reachability_state = Some reachability_state;
669+
is_reachability_result_available = true;
670+
}
665671

666672
let get_dead_rules state = state.dead_rules
667673

@@ -784,8 +790,12 @@ let reset_reachability_memoized_values state =
784790
scc_decomposition = Public_data.AccuracyMap.empty;
785791
signature = None;
786792
constraint_list = None;
793+
is_reachability_result_available = false;
787794
}
788795

796+
let is_reachability_result_available state =
797+
state.is_reachability_result_available
798+
789799
let set_handler_opt h_opt state =
790800
match h_opt with
791801
| None -> state

core/KaSa_rep/remanent_state/remanent_state.mli

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,9 @@ val get_working_set_elements :
495495
val reset_reachability_memoized_values :
496496
('global, 'static, 'compile) state -> ('global, 'static, 'compile) state
497497

498+
val is_reachability_result_available :
499+
('global, 'static, 'compile) state -> bool
500+
498501
val rename_pos :
499502
( Remanent_parameters_sig.parameters,
500503
Exception.exceptions_caught_and_uncaught,

0 commit comments

Comments
 (0)