@@ -2545,39 +2545,39 @@ functor
25452545 let state = set_errors errors state in
25462546 state, id_opt
25472547
2548- let permanently_disable_rule_c_id_list list state =
2549- let state, l =
2548+ let permanently_disable_rule_c_id_list list state acc =
2549+ let state, l, l' =
25502550 List. fold_left
2551- (fun (state , l ) index ->
2551+ (fun (state , l , l' ) index ->
25522552 let state, id_opt = working_set_id_of_rule_id index state in
25532553 match id_opt with
2554- | None -> state, l
2555- | Some i -> state, i :: l)
2556- (state, [] ) (List. rev list )
2554+ | None -> state, l, l'
2555+ | Some i -> state, i :: l, i::l' )
2556+ (state, acc, [] ) (List. rev list )
25572557 in
25582558 let error = get_errors state in
25592559 let error, state, _ =
2560- toggle_working_set_boolean_parameters_in_compilation error false state l
2560+ toggle_working_set_boolean_parameters_in_compilation error false state l'
25612561 true
25622562 in
2563- set_errors error state
2563+ set_errors error state, l
25642564
2565- let permanently_disable_init_c_id_list list state =
2566- let state, l =
2565+ let permanently_disable_init_c_id_list list state acc =
2566+ let state, l, l' =
25672567 List. fold_left
2568- (fun (state , l ) index ->
2568+ (fun (state , l , l' ) index ->
25692569 let state, id_opt = working_set_id_of_init_id index state in
25702570 match id_opt with
2571- | None -> state, l
2572- | Some i -> state, i :: l)
2573- (state, [] ) (List. rev list )
2571+ | None -> state, l, l'
2572+ | Some i -> state, i :: l, i::l' )
2573+ (state, acc, [] ) (List. rev list )
25742574 in
25752575 let error = get_errors state in
25762576 let error, state, _ =
2577- toggle_working_set_boolean_parameters_in_compilation error false state l
2577+ toggle_working_set_boolean_parameters_in_compilation error false state l'
25782578 true
25792579 in
2580- set_errors error state
2580+ set_errors error state, l
25812581
25822582 (* Incremental analysis *)
25832583 let summarize_from_ast state =
@@ -2622,6 +2622,118 @@ functor
26222622 (Remanent_state. set_handler handler state),
26232623 state' )
26242624
2625+
2626+ (* let state, c_compil = get_c_compilation state in
2627+ let rec toggle_parameters = function
2628+ | [] ->
2629+ ( error,
2630+ compilation.Ast.working_set_values,
2631+ c_compil.Cckappa_sig.working_set_valuations,
2632+ false )
2633+ | working_set_index :: indexes ->
2634+ let error, working_set_values, working_set_valuations, changed =
2635+ toggle_parameters indexes
2636+ in
2637+ let guard_int =
2638+ Ckappa_sig.int_of_working_set_index working_set_index
2639+ in
2640+ (match Mods.IntMap.find_option guard_int working_set_values with
2641+ | None ->
2642+ if permanently_disable then
2643+ error, working_set_values, working_set_valuations, changed
2644+ else (
2645+ let error, () =
2646+ Exception.warn parameters error __POS__
2647+ ~message:
2648+ ("Index out of bounds: there is no rule with index "
2649+ ^ Ckappa_sig.string_of_working_set_index working_set_index
2650+ ^ " in the working set. Or it may already have been \
2651+ permanently disabled.")
2652+ Exit ()
2653+ in
2654+ error, working_set_values, working_set_valuations, false
2655+ )
2656+ | Some old_bool ->
2657+ if old_bool = bool && not permanently_disable then
2658+ error, working_set_values, working_set_valuations, changed
2659+ else (
2660+ let working_set_values =
2661+ if permanently_disable then
2662+ Mods.IntMap.add guard_int None working_set_values
2663+ else
2664+ Mods.IntMap.add guard_int bool working_set_values
2665+ in
2666+ let error, (guard_id, _) =
2667+ Ckappa_sig.Ws_index_map_and_set.Map.find_default parameters
2668+ error
2669+ (Ckappa_sig.guard_parameter_of_int (-1), Some false)
2670+ working_set_index working_set_valuations
2671+ in
2672+ let error, working_set_valuations =
2673+ Ckappa_sig.Ws_index_map_and_set.Map.add_or_overwrite parameters
2674+ error working_set_index (guard_id, bool)
2675+ working_set_valuations
2676+ in
2677+ error, working_set_values, working_set_valuations, true
2678+ ))
2679+ in
2680+ *)
2681+ let permanently_remove l state =
2682+ let state, c_compil = get_c_compilation state in
2683+ let errors = get_errors state in
2684+ let parameters = get_parameters state in
2685+ let state, kappa_handler = get_handler state in
2686+ let map = c_compil.Cckappa_sig. working_set_valuations in
2687+ let errors, l = List. fold_left
2688+ (fun (errors , l ) elt ->
2689+ let errors, (id,_) = Ckappa_sig.Ws_index_map_and_set.Map. find_default parameters
2690+ errors
2691+ (Ckappa_sig. guard_parameter_of_int (- 1 ), Some false )
2692+ elt map in
2693+ errors, (Ckappa_sig. mvbdu_var_of_guard id (Handler. get_nsites kappa_handler))::l)
2694+ (errors, [] ) l
2695+ in
2696+ let l = List. sort compare l in
2697+ let state = set_errors errors state in
2698+ let state =
2699+ match Remanent_state. get_reachability_result state with
2700+ | None -> state
2701+ | Some x ->
2702+ let bdu_handler = Remanent_state. get_bdu_handler state in
2703+ let errors = get_errors state in
2704+ let errors, bdu_handler, l = Ckappa_sig.Views_bdu. build_variables_list parameters bdu_handler errors l in
2705+ let state = Remanent_state. set_bdu_handler bdu_handler state in
2706+ let state = set_errors errors state in
2707+ let errors, (a,b) = Reachability. map_mvbdu
2708+ (fun parameters errors bdu_handler mvbdu -> Ckappa_sig.Views_bdu. mvbdu_definitely_remove parameters bdu_handler errors mvbdu l ) errors (snd (fst x)) (snd x) in
2709+ let state = Remanent_state. set_reachability_result ((fst (fst x),a),b) state in
2710+ set_errors errors state in
2711+ state
2712+
2713+ (* contact_map_int: Contact_map.t option option;
2714+ init_state: initial_state option;
2715+ quark_map: quark_map option;
2716+ reachability_state:
2717+ ('global_static, 'static, 'dynamic) reachability_result option;
2718+ is_reachability_result_available: bool;
2719+ subviews_info: subviews_info option;
2720+ dead_rules: dead_rules option;
2721+ conditionally_dead_rules: rule_deadness_conditions option;
2722+ dead_agents: dead_agents option;
2723+ conditionally_dead_agents: agent_deadness_conditions option;
2724+ ode_flow: Ode_fragmentation_type.ode_frag option;
2725+ ctmc_flow: flow option;
2726+ errors: Exception.exceptions_caught_and_uncaught;
2727+ internal_constraint_list: internal_constraint_list option;
2728+ constraint_list: constraint_list option;
2729+ symmetric_sites: symmetric_sites Public_data.AccuracyMap.t;
2730+ separating_transitions: separating_transitions option;
2731+ transition_system_length: int list option;
2732+ global_static_information: 'global_static option;
2733+ patch: Cckappa_sig.compil option;*)
2734+
2735+
2736+
26252737 let patch ?debug ?do_not_restart_fixpoint_computation ?do_we_show_title
26262738 ~called_from ?compil ?patch_file_name ~old_file_name ~summary state =
26272739 let parameters = get_parameters state in
@@ -2689,15 +2801,16 @@ functor
26892801 let state = set_errors errors state in
26902802 let state = Remanent_state. set_handler kappa_handler state in
26912803 let state = rename_pos (Diff. renaming_of_diff diff) state in
2692- let state =
2804+ let state, acc =
26932805 permanently_disable_rule_c_id_list
26942806 (List. rev_map Ckappa_sig. rule_id_of_int
26952807 (List. rev diff.Diff. diff_rules.removed_elt))
2696- state
2808+ state []
26972809 in
2698- let state =
2699- permanently_disable_init_c_id_list diff.Diff. diff_init.removed_elt state
2810+ let state, acc =
2811+ permanently_disable_init_c_id_list diff.Diff. diff_init.removed_elt state acc
27002812 in
2813+ let state = permanently_remove acc state in
27012814 let state, handler = get_handler state in
27022815 let state, cc_compil = get_c_compilation state in
27032816 let errors = get_errors state in
0 commit comments