A class that takes a linear process specification and checks all tau-summands of that LPS for confluence.
More...
|
| allow_list_cache | make_allow_list_cache (const process::action_name_multiset_list &allowlist) |
| |
| core::identifier_string_list | names (const process::action_list &multi_action) |
| | Calculate the list of action names that appear in a multi-action.
|
| |
| std::vector< core::identifier_string > | get_actions (const process::action_name_multiset_list &allowlist) |
| |
| void | addActionCondition (const process::action &a, const data::data_expression &c, tuple_list &&L, tuple_list &S) |
| |
| ultimate_delay | combine_ultimate_delays (const ultimate_delay &delay1, const ultimate_delay &delay2) |
| | Returns the conjunction of the two delay conditions and the join of the variables, where the variables in delay2 are renamed to avoid conflict with those in delay1.
|
| |
| process::untyped_multi_action | parse_multi_action_new (const std::string &text) |
| |
| multi_action | complete_multi_action (process::untyped_multi_action &x, multi_action_type_checker &typechecker, const data::data_specification &data_spec=data::detail::default_specification()) |
| |
| multi_action | complete_multi_action (process::untyped_multi_action &x, const process::action_label_list &action_decls, const data::data_specification &data_spec=data::detail::default_specification()) |
| |
| action_rename_specification | parse_action_rename_specification_new (const std::string &text) |
| |
| void | complete_action_rename_specification (action_rename_specification &x, const lps::stochastic_specification &spec) |
| |
| template<typename T > |
| bool | is_well_typed (const T &x) |
| | Checks well typedness of an LPS object.
|
| |
| template<typename T > |
| bool | check_well_typedness (const T &x) |
| | Checks well typedness of an LPS object, and will print error messages to stderr.
|
| |
| data::data_expression | unfold_pattern_matching (const data::data_expression &x, pattern_match_unfolder &unfolder) |
| |
| process::action_label | rename_action_label (const process::action_label &act, const std::regex &matching_regex, const std::string &replacing_fmt) |
| |
| data::data_expression | make_and (const data::data_expression &x1, const data::data_expression &x2, const data::data_expression &x3) |
| |
| data::data_expression | make_and (const data::data_expression &x1, const data::data_expression &x2, const data::data_expression &x3, const data::data_expression &x4) |
| |
| data::data_expression | equal_to (const data::data_expression_list &x, const data::data_expression_list &y) |
| |
| std::pair< std::size_t, std::size_t > | make_sorted_pair (std::size_t i, std::size_t j) |
| |
| data::data_expression | make_forall_ (const data::data_expression &x) |
| |
| process::action_label | make_ctau_act_id () |
| | Creates an identifier for the for the ctau action.
|
| |
| process::action | make_ctau_action () |
| | Creates the ctau action.
|
| |
| static data::mutable_map_substitution | get_substitutions_from_assignments (const data::assignment_list &a_assignments) |
| |
| static data::data_expression | get_subst_equation_from_assignments (const data::variable_list &a_variables, data::assignment_list a_assignments_1, data::assignment_list a_assignments_2, data::mutable_map_substitution<> &a_substitutions_1, data::mutable_map_substitution<> &a_substitutions_2) |
| |
| static data::data_expression | get_equation_from_assignments (const data::variable_list &a_variables, data::assignment_list a_assignments_1, data::assignment_list a_assignments_2) |
| |
| data::data_expression | get_subst_equation_from_actions (const process::action_list &a_actions, data::mutable_map_substitution<> &a_substitutions) |
| |
| static data::assignment_list | get_full_assignment_list (data::assignment_list a_assignment_list, const data::variable_list &a_variables) |
| |
| template<typename ActionSummand > |
| data::data_expression | get_confluence_condition (const data::data_expression &a_invariant, const ActionSummand &a_summand_1, const ActionSummand &a_summand_2, const data::variable_list &a_variables, const char condition_type) |
| |
| template<typename Specification > |
| bool | has_ctau_action (const Specification &a_lps) |
| |
| bool | check_action_sorts (const process::action_list &actions, const std::set< data::sort_expression > &sorts) |
| | Returns true if the sorts of the given actions are contained in sorts.
|
| |
| bool | check_action_labels (const process::action_list &actions, const std::set< process::action_label > &labels) |
| | Returns true if the labels of the given actions are contained in labels.
|
| |
| bool | check_action_label_sorts (const process::action_label_list &action_labels, const std::set< data::sort_expression > &sorts) |
| | Returns true if the sorts of the given action labels are contained in sorts.
|
| |
| template<typename Specification > |
| void | replace_global_variables (Specification &lpsspec, const data::mutable_map_substitution<> &sigma) |
| | Applies a global variable substitution to an LPS.
|
| |
| template<typename Specification > |
| data::mutable_map_substitution | instantiate_global_variables (Specification &lpsspec) |
| | Eliminates the global variables of an LPS, by substituting a constant value for them. If no constant value is found for one of the variables, an exception is thrown.
|
| |
template<class LINEAR_PROCESS >
requires (std::is_same_v<LINEAR_PROCESS, linear_process> || std::is_same_v<LINEAR_PROCESS, stochastic_linear_process>) |
| void | make_timed_lps (LINEAR_PROCESS &lps, const std::set< core::identifier_string > &context) |
| | Adds time parameters to the lps if needed and returns the result. The times are chosen such that they don't appear in context.
|
| |
| bool | match_selection (const data::variable &v, const std::string &name, const std::string &type, const data::data_specification &data_spec) |
| | Returns true if the selection name:type matches with the variable v.
|
| |
| template<typename OutputIterator > |
| std::vector< data::variable > | find_matching_parameters (const data::variable_list ¶ms, const data::data_specification &dataspec, const std::vector< std::pair< std::string, std::string > > &selections, OutputIterator o) |
| | Find parameter declarations that match a given string.
|
| |
| std::vector< data::variable > | parse_lps_parameter_selection (const data::variable_list ¶ms, const data::data_specification &dataspec, const std::string &text) |
| | Parses parameter selection for finite pbesinst algorithm.
|
| |
| template<typename Specification > |
| void | replace_global_variables (Specification &lpsspec) |
| | Replaces assignments of global variables to parameters in the LPS by an assignment of itself.
|
| |
| std::string | ABP_SPECIFICATION () |
| |
| std::string | DINING3_SPECIFICATION () |
| |
| std::string | ONE_BIT_SLIDING_WINDOW_SPECIFICATION () |
| |
| std::string | LINEAR_ABP_SPECIFICATION () |
| |
| template<typename Summand > |
| Summand | make_action_summand (const data::variable_list &, const data::data_expression &, const multi_action &, const data::assignment_list &, const stochastic_distribution &) |
| |
| template<> |
| action_summand | make_action_summand< action_summand > (const data::variable_list &summation_variables, const data::data_expression &condition, const multi_action &a, const data::assignment_list &assignments, const stochastic_distribution &distribution) |
| |
| void | collect_transition_variables (const action_summand &s, std::set< data::variable > &result) |
| |
| void | collect_transition_variables (const stochastic_action_summand &s, std::set< data::variable > &result) |
| |
| void | collect_transition_variables (const deadlock_summand &s, std::set< data::variable > &result) |
| |
| std::size_t | greatest_common_divisor (std::size_t x, std::size_t y) |
| |
| void | remove_common_divisor (std::size_t &enumerator, std::size_t &denominator) |
| |
| template<typename VariableContainer > |
| std::set< core::identifier_string > | variable_names (const VariableContainer &vars) |
| |
| template<typename VariableContainer > |
| std::set< core::identifier_string > | variable_name_clashes (const VariableContainer &vars, const std::set< core::identifier_string > &w) |
| |
| void | resolve_summand_variable_name_clashes (action_summand &summand, const std::set< core::identifier_string > &process_parameter_names, data::set_identifier_generator &generator) |
| |
| void | resolve_summand_variable_name_clashes (deadlock_summand &summand, const std::set< core::identifier_string > &process_parameter_names, data::set_identifier_generator &generator) |
| |
| void | resolve_summand_variable_name_clashes (stochastic_action_summand &summand, const std::set< core::identifier_string > &process_parameter_names, data::set_identifier_generator &generator) |
| |
| void | find_equality_conjuncts (const data::data_expression &x, std::map< data::variable, data::data_expression > &result) |
| |
| template<> |
| stochastic_action_summand | make_action_summand< stochastic_action_summand > (const data::variable_list &summation_variables, const data::data_expression &condition, const multi_action &a, const data::assignment_list &assignments, const stochastic_distribution &distribution) |
| |
| stochastic_action_summand_vector | convert_action_summands (const action_summand_vector &action_summands) |
| |
| template<class INITIALIZER > |
| INITIALIZER | make_process_initializer (const data::data_expression_list &expressions, const INITIALIZER &init) |
| |
| template<> |
| process_initializer | make_process_initializer (const data::data_expression_list &expressions, const process_initializer &) |
| |
| template<> |
| stochastic_process_initializer | make_process_initializer (const data::data_expression_list &expressions, const stochastic_process_initializer &init) |
| |
| std::string | NO_DEADLOCK () |
| |
| std::string | NO_LIVELOCK () |
| |
A class that takes a linear process specification and checks all tau-summands of that LPS for confluence.
Class that can determine if two summands are syntactically disjoint. Two summands are syntactically disjoint if the following conditions hold:
The tau actions of all confluent tau-summands are renamed to ctau.
Given an LPS,
P(d: D) = ...
- sum ei: Ei. ci(d, ei) -> ai(fi(d, ei)) . P(gi(d, ei))
- ...
- sum ej: Ej. cj(d, ej) -> tau . P(gj(d, ej))
- ...;
tau-summand j is confluent with summand i if the following condition holds for all d: D, for all ei: Ei and for all ej: Ej:
(inv(d) /\ ci(d, ei) /\ cj(d, ej)) => ( ci(gj(d, ej), ei) /\ cj(gi(d, ei), ej) /\ fi(d, ei) == fi(gj(d, ej), ei) /\ gi(gj(d, ej), ei) == gj(gi(d, ei), ej) )
where inv() is the invariant specified using the parameter a_invariant of the function Confluence_Checker::check_confluence_and_mark. In case ai is also a tau-action, the formula above can be weakened to the following:
(inv(d) /\ ci(d, ei) /\ cj(d, ej)) => ( gi(d, ei) == gj(d, ej) \/ ( ci(gj(d, ej), ei) /\ cj(gi(d, ei), ej) /\ gi(gj(d, ej), ei) == gj(gi(d, ei), ej) ) )
The class Confluence_Checker can determine whether two summands are confluent in three ways and will indicate which of the methods was used while proving confluence. The three ways of determining confluence are as follows:
If summand number 1 has been proven confluent with summand number 2, summand number 2 is obviously confluent
with summand number 1. This method of checking confluence is called checking confluence by symmetry. If two summands are confluent by symmetry, the class Confluence_Checker indicates this by printing a dot ('.').
Another way of checking the confluence of two summands is determining whether the two summands are
syntactically disjoint. Two summands are syntactically disjoint if the following holds:
- The set of variables used by one summand is disjoint from the set of variables changed by the other summand and vice versa.
The set of variables changed by one summand is disjoint from the set of variables changed by the other summand. If two summands are confluent because of syntactic disjointness, the class Confluence_Checker indicates this by printing a colon (':').
The most time consuming way of checking the confluence of two summands is generating the confluence condition and then checking if this condition is a tautology using a prover for expressions of sort Bool. If two summands are proven confluent using the prover, the class Confluence_Checker indicates this by printing a plus sign ('+'). If the parameter a_generate_invariants is set to true, the class Confluence_Checker will try to prove that the reduced confluence condition is an invariant of the LPS, in case the confluence condition is not a tautology. If the reduced confluence condition is indeed an invariant, the two summands are proven confluent. The class Confluence_Checker indicates this by printing an 'i'.
The class Confluence_Checker uses an instance of the class BDD_Prover, an instance of the class Disjointness_Checker and an instance of the class Invariant_Checker to determine which tau-summands of an mCRL2 LPS are confluent. Confluent tau-summands will be marked by renaming their tau-actions to ctau. The constructor Confluence_Checker::Confluence_Checker initializes the BDD based prover with the parameters a_rewrite_strategy, a_time_limit, a_path_eliminator, a_solver_type, a_apply_induction and a_lps. The parameter a_rewrite_strategy specifies which rewrite strategy is used by the prover's rewriter. It can be set to either GS_REWR_JITTY or GS_REWR_JITTYC. The parameter a_time_limit specifies the maximum amount of time in seconds to be spent by the prover on proving a single expression. If a_time_limit is set to 0, no time limit will be enforced. The parameter a_path_eliminator specifies whether or not path elimination is applied. When path elimination is applied, the prover uses an SMT solver to remove inconsistent paths from BDDs. The parameter a_solver_type specifies which SMT solver is used for path elimination. Either the SMT solver ario (http://www.eecs.umich.edu/~ario/) or cvc-lite (http://www.cs.nyu.edu/acsys/cvcl/) can be used. To use one of these solvers, the directory containing the corresponding executable must be in the path. If the parameter a_path_eliminator is set to false, the parameter a_solver_type is ignored. The parameter a_apply_induction indicates whether or not induction on list will be applied.
The parameter a_dot_file_name specifies whether a file in dot format of the resulting BDD is saved each time the prover cannot determine whether an expression of sort Bool is a contradiction or a tautology. If the parameter is set to 0, no .dot files are saved. If a string is passed as parameter a_dot_file_name, this string will be used as the prefix of the filenames. An instance of the class BDD2Dot is used to save these files in dot format.
If the parameter a_counter_example is set to true, a so called counter example is printed to stderr each time the prover indicates that two summands are not confluent. A counter example is a valuation for which the confluence condition to be proven does not hold.
If the parameter a_check_all is set to true, the confluence of the tau-summands regarding all other summands will be checked. If the parameter is set to false, Confluence_Checker continues with the next tau-summand as soon as a summand is encountered that is not confluent with the current tau-summand.
If the parameter a_generate_invariants is set, an invariant checker is used to check if the reduced confluence condition is an invariant of the LPS passed as parameter a_lps. If the reduced confluence condition is an invariant, the two summands are confluent.
The function Confluence_Checker::check_confluence_and_mark returns an LPS with all tau-actions of confluent tau-summands renamed to ctau, unless the parameter a_no_marking is set to true. In case the parameter a_no_marking was set to true, the confluent tau-summands will not be marked, only the results of the confluence checking will be displayed.
If there already is an action named ctau present in the LPS passed as parameter a_lps, an error will be reported.
- The set of variables used by one summand is disjoint from the set of variables changed by the other summand and vice versa.
- The set of variables changed by one summand is disjoint from the set of variables changed by the other summand.
An instance of the class Disjointness_Checker is created using the constructor Disjointness_Checker::Disjointness_Checker. The parameter a_process_equations is used to pass the summands to be checked for disjointness. The function Disjointness_Checker::disjoint indicates whether the two summands with numbers n_1 and n_2 are syntactically disjoint.
The class Invariant_Checker is initialized with an LPS using the constructor Invariant_Checker::Invariant_Checker. After initialization, the function Invariant_Checker::check_invariant can be called any number of times to check whether an expression of sort Bool passed as argument a_invariant is an invariant of this LPS. A new instance of the class Invariant_Checker has to be created for each new LPS that has to be checked.
The class Invariant_Checker uses an instance of the class BDD_Prover to check whether a formula is a valid invariant of an mCRL2 LPS. The constructor Invariant_Checker::Invariant_Checker initializes the BDD based prover with the parameters a_rewrite_strategy, a_time_limit, a_path_eliminator, a_solver_type and the data specification of the LPS passed as parameter a_lps. The parameter a_rewrite_strategy specifies which rewrite strategy is used by the prover's rewriter. It can be set to either GS_REWR_JITTY or GS_REWR_JITTYC. The parameter a_time_limit specifies the maximum amount of time in seconds to be spent by the prover on proving a single expression. If a_time_limit is set to 0, no time limit will be enforced. The parameter a_path_eliminator specifies whether or not path elimination is applied. When path elimination is applied, the prover uses an SMT solver to remove inconsistent paths from BDDs. The parameter a_solver_type specifies which SMT solver is used for path elimination. Either the SMT solver ario (http://www.eecs.umich.edu/~ario/) or cvc-lite (http://www.cs.nyu.edu/acsys/cvcl/) can be used. To use one of these solvers, the directory containing the corresponding executable must be in the path. If the parameter a_path_eliminator is set to false, the parameter a_solver_type is ignored. The parameter a_apply_induction indicates whether or not induction on list will be applied.
The parameter a_dot_file_name specifies whether a file in dot format of the resulting BDD is saved each time the prover cannot determine whether an expression is a contradiction or a tautology. If the parameter is set to 0, no .dot files are saved. If a string is passed as parameter a_dot_file_name, this string will be used as the prefix of the filenames. An instance of the class BDD2Dot is used to save these files in dot format.
If the parameter a_counter_example is set to true, a so called counter example will be printed to stderr each time a summand is encountered that violates the invariant. A counter example is a valuation for which the expression to be proven does not hold. If the parameter a_all_violations is set to true, the invariant checker will not stop as soon as a violation of the invariant is found, but will report all violations instead.
Given an LPS,
P(d: D) = ...
- sum ei: Ei. ci(d, ei) -> ai(fi(d, ei)) . P(gi(d, ei))
- ...;
an instance of the class Invariant_Checker will generate a formula of the form
inv(d) /\ ci(d, ei) => inv(gi(d, ei))
for each of the summands, where inv() is the expression passed as parameter a_invariant. If this expression passed as parameter a_invariant holds for the initial state and all the generated formulas are tautologies according to the prover, it is an invariant.