12#ifndef MCRL2_MODAL_FORMULA_PREPROCESS_STATE_FORMULA_H
13#define MCRL2_MODAL_FORMULA_PREPROCESS_STATE_FORMULA_H
15#include "mcrl2/data/detail/find.h"
16#include "mcrl2/data/xyz_identifier_generator.h"
17#include "mcrl2/modal_formula/has_name_clashes.h"
18#include "mcrl2/modal_formula/is_monotonous.h"
19#include "mcrl2/modal_formula/normalize.h"
20#include "mcrl2/modal_formula/resolve_name_clashes.h"
21#include "mcrl2/modal_formula/state_formula_rename.h"
50 nesting_depth.push_back(0);
55 nesting_depth.pop_back();
60 nesting_depth.back()++;
61 if (nesting_depth.back() > result)
63 result = nesting_depth.back();
69 nesting_depth.back()--;
153 fixpoints.push_back(x);
158 fixpoints.pop_back();
167 if (fixpoints.empty())
175 if (fixpoints.empty())
211template <
typename IdentifierGenerator>
232 fixpoints.push_back(x);
237 fixpoints.pop_back();
242 if (fixpoints.empty())
246 return state_formulas::is_mu(fixpoints.back());
282 make_must(result, x
.formula(), mu(X, {}, operand));
287 make_must(result, x
.formula(), nu(X, {}, operand));
305 make_may(result, x
.formula(), mu(X, {}, operand));
310 make_may(result, x
.formula(), nu(X, {}, operand));
319template <
typename IdentifierGenerator>
333 std::set<core::identifier_string> ids = state_formulas::find_identifiers(x);
334 generator.add_identifiers(ids);
336 detail::make_state_formula_preprocess_nested_modal_operators_builder(generator).apply(result, x);
351 const std::set<core::identifier_string>& context_ids,
352 bool preprocess_modal_operators,
353 bool quantitative =
false,
354 bool warn_for_modal_operator_nesting =
true
367 "Warning: detected nested modal operators. This may result in a long execution time.\n"
368 "Use the option -m (for lps2pbes/lps2pres), -p (for lts2pbes/lts2pres) or insert dummy fix \n"
369 "point operators in between manually to speed up the transformation." <<
std::endl;
375 std::set<core::identifier_string> ids = state_formulas::find_identifiers(f);
376 ids.insert(context_ids.begin(), context_ids.end());
377 f = state_formulas::rename_variables(f, ids);
381 xyz_generator.add_identifiers(
state_formulas::find_identifiers(f));
382 f
= rename_predicate_variables(f, xyz_generator);
387 if (preprocess_modal_operators)
393 mCRL2log(log::debug) <<
"Formula after inserting dummy fix points between modal operators: " << f <<
".\n";
412 mCRL2log(log::debug) <<
"Formula after wrapping the formula inside a 'nu': " << f <<
".\n";
418 f = resolve_state_formula_data_variable_name_clashes(f, context_ids);
aterm_string(const aterm_string &t) noexcept=default
bool operator!=(const unprotected_aterm_core &t) const
Inequality operator on two unprotected aterms.
data_expression & operator=(const data_expression &) noexcept=default
Identifier generator that stores the identifiers of the context in a set. Using the operator()() and ...
Identifier generator that generates names from the range X, Y, Z, X0, Y0, Z0, X1, ....
logger(const log_level_t l)
Default constructor.
LPS summand containing a multi-action.
LPS summand containing a deadlock.
bool has_time() const
Returns true if time is available.
data::data_expression & time()
Returns the time.
\brief A timed multi-action
bool has_time() const
Returns true if time is available.
const process::action_list & actions() const
multi_action & operator=(multi_action &&) noexcept=default
multi_action(const process::action_list &actions=process::action_list(), data::data_expression time=data::undefined_real())
Constructor.
Linear process specification.
Linear process specification.
stochastic_specification(const specification &other)
Constructor. This constructor is explicit as implicit conversions of this kind is a source of bugs.
Algorithm for translating a state formula and a timed specification to a pbes.
pbes run(const state_formulas::state_formula &formula, const lps::stochastic_specification &lpsspec, bool structured=false, bool unoptimized=false, bool preprocess_modal_operators=false, bool generate_counter_example=false, const data::variable &T=data::undefined_real_variable())
Runs the translation algorithm.
data::set_identifier_generator m_generator
lps2pbes_algorithm(bool check_only=false)
Constructor.
void run(const state_formulas::state_formula &f, bool structured, bool unoptimized, std::vector< pbes_equation > &equations, Parameters ¶meters)
propositional_variable & variable()
Returns the pbes variable of the equation.
parameterized boolean equation system
bool is_closed() const
True if the pbes is closed.
pbes()=default
Constructor.
\brief A propositional variable instantiation
const core::identifier_string & name() const
Standard exception class for reporting runtime errors.
#define mCRL2log(LEVEL)
mCRL2log(LEVEL) provides the stream used to log.
atermpp::aterm_string identifier_string
String type of the LPS library. Identifier strings are represented internally as ATerms.
Namespace for system defined sort real_.
const basic_sort & real_()
Constructor for sort expression Real.
Namespace for all data library functionality.
data_specification merge_data_specifications(const data_specification &dataspec1, const data_specification &dataspec2)
Merges two data specifications. Throws an exception if conflicts are detected.
atermpp::term_list< data_expression > data_expression_list
\brief list of data_expressions
const data::variable & undefined_real_variable()
Returns a data variable that corresponds to 'undefined'.
void make_timed_lps(LINEAR_PROCESS &lps, const std::set< core::identifier_string > &context, typename std::enable_if< std::is_same< LINEAR_PROCESS, linear_process >::value||std::is_same< LINEAR_PROCESS, stochastic_linear_process >::value >::type *=nullptr)
Adds time parameters to the lps if needed and returns the result. The times are chosen such that they...
The main namespace for the LPS library.
specification remove_stochastic_operators(const stochastic_specification &spec)
Converts a stochastic specification to a specification. Throws an exception if non-empty distribution...
bool is_normalized(const pbes &x)
Checks if a PBEs is normalized.
void normalize(pbes &x)
The function normalize brings (embedded) pbes expressions into positive normal form,...
const core::identifier_string & mu_name(const state_formulas::state_formula &f)
void check_lps2pbes_actions(const state_formulas::state_formula &formula, const lps::stochastic_specification &lpsspec)
Prints a warning if formula contains an action that is not used in lpsspec.
The main namespace for the PBES library.
pbes lps2pbes(const lps::stochastic_specification &lpsspec, const state_formulas::state_formula_specification &formspec, bool timed=false, bool structured=false, bool unoptimized=false, bool preprocess_modal_operators=false, bool generate_counter_example=false, bool check_only=false)
Translates a linear process specification and a state formula to a PBES. If the solution of the PBES ...
void lps2pbes(const std::string &input_filename, const std::string &output_filename, const utilities::file_format &output_format, const std::string &formula_filename, bool timed, bool structured, bool unoptimized, bool preprocess_modal_operators, bool generate_counter_example, bool check_only)
pbes lps2pbes(const lps::specification &lpsspec, const state_formulas::state_formula &formula, bool timed=false, bool structured=false, bool unoptimized=false, bool preprocess_modal_operators=false, bool generate_counter_example=false, bool check_only=false)
Translates a linear process specification and a state formula to a PBES. If the solution of the PBES ...
pbes lps2pbes(const lps::stochastic_specification &lpsspec, const state_formulas::state_formula &formula, bool timed=false, bool structured=false, bool unoptimized=false, bool preprocess_modal_operators=false, bool generate_counter_example=false, bool check_only=false)
Translates a linear process specification and a state formula to a PBES. If the solution of the PBES ...
void complete_data_specification(pbes &)
Adds all sorts that appear in the PBES p to the data specification of p.
bool is_monotonous(const pbes &p)
Returns true if the pbes is monotonous.
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Adds a time parameter t to s if needed and returns the result. The time t is chosen such that it does...
IdentifierGenerator & m_generator
void operator()(action_summand &s) const
Adds time to the summand s (either an action or a deadlock summand)
void operator()(deadlock_summand &s) const
Adds time to the summand s (either an action or a deadlock summand)
make_timed_lps_summand(IdentifierGenerator &generator)
std::size_t operator()(const atermpp::detail::reference_aterm< T > &t) const