12#ifndef MCRL2_MODAL_FORMULA_PARSE_H
13#define MCRL2_MODAL_FORMULA_PARSE_H
15#include "mcrl2/data/merge_data_specifications.h"
16#include "mcrl2/lps/parse.h"
17#include "mcrl2/modal_formula/has_name_clashes.h"
18#include "mcrl2/modal_formula/resolve_name_clashes.h"
19#include "mcrl2/modal_formula/translate_regular_formulas.h"
20#include "mcrl2/modal_formula/translate_user_notation.h"
21#include "mcrl2/modal_formula/typecheck.h"
22#include "mcrl2/process/merge_action_specifications.h"
39 const VariableContainer& variables,
40 const ActionLabelContainer& actions
44 x =
action_formulas::typecheck_action_formula(x, dataspec, variables, actions);
45 x = action_formulas::translate_user_notation(x);
52 return parse_action_formula(text, lpsspec.data(), lpsspec.global_variables(), lpsspec.action_labels());
70 const VariableContainer& variables,
71 const ActionLabelContainer& actions
75 x =
regular_formulas::typecheck_regular_formula(x, dataspec, variables, actions);
76 x = regular_formulas::translate_user_notation(x);
83 return parse_regular_formula(text, lpsspec.data(), lpsspec.global_variables(), lpsspec.action_labels());
116 mCRL2log(log::log_level_t::debug) <<
"formula before translating regular formulas: " << x << std::endl;
118 mCRL2log(log::log_level_t::debug) <<
"formula after translating regular formulas: " << x << std::endl;
126 throw mcrl2::runtime_error(
"state formula is not monotonic: " + state_formulas::pp(x));
130 mCRL2log(log::log_level_t::debug) <<
"formula before resolving name clashes: " << x << std::endl;
132 mCRL2log(log::log_level_t::debug) <<
"formula after resolving name clashes: " << x << std::endl;
146 const bool formula_is_quantitative,
155 lpsspec.data().add_context_sorts(state_formulas::find_sort_expressions(x));
168 const bool formula_is_quantitative,
173 state_formula phi = parse_state_formula(text, stoch_lps_spec, formula_is_quantitative, options);
187 const bool formula_is_quantitative,
191 std::string text = utilities::read_text(in);
192 return parse_state_formula(text, lpsspec, formula_is_quantitative, options);
204 const bool formula_is_quantitative,
209 state_formula phi = parse_state_formula(in, stoch_lps_spec, formula_is_quantitative, options);
221 const std::string& text,
222 const bool formula_is_quantitative,
243 const bool formula_is_quantitative,
247 std::string text = utilities::read_text(in);
248 return parse_state_formula_specification(text, formula_is_quantitative, options);
260 const bool formula_is_quantitative,
267 process::action_label_list actspec = process::merge_action_specifications(lpsspec.action_labels(), result.action_labels());
273 type_checker(result.data().user_defined_equations());
276 result.formula() = state_formulas::typecheck_state_formula(result.formula(), formula_is_quantitative, dataspec, actspec, lpsspec.global_variables());
293 const bool formula_is_quantitative,
312 const bool formula_is_quantitative,
316 return parse_state_formula_specification(utilities::read_text(in), lpsspec, formula_is_quantitative, options);
329 const bool formula_is_quantitative,
aterm_string(const aterm_string &t) noexcept=default
sort_expression sort() const
Returns the sort of the data expression.
data_specification()=default
Default constructor. Generate a data specification that contains only booleans and positive numbers.
data_type_checker(const data_specification &data_spec)
make a data type checker. Throws a mcrl2::runtime_error exception if the data_specification is not we...
\brief An untyped parameter
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.
\brief An untyped multi action or data application
D_ParserTables parser_tables_mcrl2
#define mCRL2log(LEVEL)
mCRL2log(LEVEL) provides the stream used to log.
void warn_left_merge_merge(const parse_node &)
Prints a warning for each occurrence of 'x ||_ y || z' in the parse tree.
void warn_and_or(const parse_node &)
Prints a warning for each occurrence of 'x && y || z' in the parse tree.
Namespace for system defined sort bool_.
const basic_sort & bool_()
Constructor for sort expression Bool.
bool is_data_expression(const atermpp::aterm &x)
Test for a data_expression expression.
data_specification merge_data_specifications(const data_specification &dataspec1, const data_specification &dataspec2)
Merges two data specifications. Throws an exception if conflicts are detected.
bool is_untyped_data_parameter(const atermpp::aterm &x)
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...
The main namespace for the Process library.
bool is_untyped_multi_action(const atermpp::aterm &x)
expression builder that visits all sub expressions
expression traverser that visits all sub expressions