12#ifndef MCRL2_LPS_LTSMIN_H
13#define MCRL2_LPS_LTSMIN_H
15constexpr int MCRL2_GUARDS = 1;
19#include "mcrl2/data/join.h"
20#include "mcrl2/lps/find.h"
21#include "mcrl2/lps/io.h"
22#include "mcrl2/lps/explorer.h"
23#include "mcrl2/lps/parse.h"
26using mcrl2_log_level_t = mcrl2::log::log_level_t;
27using mcrl2::log::logger;
30 using mcrl2_logger = mcrl2::log::logger;
33#ifdef MCRL2_ENABLE_JITTYC
34#define MCRL2_JITTYC_AVAILABLE
44 using enumerator_element = data::enumerator_list_element_with_substitution<>;
46 std::vector<std::string> result;
47 std::size_t max_iterations = 10000;
50 bool accept_solutions_with_variables =
false;
52 data::mutable_indexed_substitution<> sigma;
54 data::variable_list v_list{x};
56 E.enumerate(enumerator_element(v_list, data::sort_bool::true_()),
58 [&](
const enumerator_element& p)
60 p.add_assignments(v_list, sigma, rewr);
61 result.push_back(data::pp(sigma(x)));
62 return result.size() >= max_size;
89 friend class boost::iterator_core_access;
98 return this->m_index == other.m_index;
108 return static_cast<std::ptrdiff_t>(other.m_index) -
static_cast<std::ptrdiff_t>(
this->m_index);
116 const process::action_label_list& action_labels,
117 bool is_bounded =
false)
165 return m_indexed_set.size();
171 return index_iterator(0);
177 return index_iterator(size());
183 return m_indexed_set.insert(x).first;
189 return m_indexed_set.at(i);
195 return m_indexed_set;
201 return m_indexed_set;
214 return m_indexed_set.insert(x).first;
219 return static_cast<data::data_expression>(m_indexed_set.at(i));
224 const process::action_label_list& action_labels,
231 m_name = data::pp(m_sort);
244 atermpp::
aterm t = data::detail::add_index(atermpp::read_term_from_string(s));
245 return expression2index(atermpp::down_cast<data::data_expression>(t));
250 return data::pp(index2expression(i));
255 return expression2index(data::parse_data_expression(s, m_data));
265 return lps::generate_values(m_data, m_sort, max_size);
279 m_name =
"action_labels";
284 return pp(m_indexed_set.at(i));
289 return m_indexed_set.insert(atermpp::read_term_from_string(s)).first;
294 return lps::pp(lps::multi_action(m_indexed_set.at(i)));
299 lps::
multi_action m = lps::parse_multi_action(s, m_action_labels, m_data);
300 return m_indexed_set.insert(m).first;
311 return std::vector<std::string>();
318 using ltsmin_state_type =
int*;
366 return *m_data_types.back();
372 return *m_data_types.back();
378 return *m_data_types[i];
384 return *m_data_types[i];
390 return m_specification.process();
397 return m_specification_reduced.process();
403 return m_specification.data();
406 template <
typename Iter>
409 std::ostringstream out;
411 for (Iter i = first; i != last; ++i)
423 template <
typename Container>
426 return print_vector(c.begin(), c.end());
431 std::set<data::variable> parameters(process().process_parameters().begin(), process().process_parameters().end());
435 m_group_count = proc.action_summands().size();
436 m_state_length = proc.process_parameters().size();
438 m_read_group.resize(m_group_count);
439 m_write_group.resize(m_group_count);
444 for (
const auto & summand : proc.action_summands())
446 std::set<data::variable> used_read_variables;
447 std::set<data::variable> used_write_variables;
449 data::find_free_variables(summand.condition(), std::inserter(used_read_variables, used_read_variables.end()));
450 lps::find_free_variables(summand.multi_action(), std::inserter(used_read_variables, used_read_variables.end()));
452 for (
const auto & assignment : summand.assignments())
454 if (assignment.lhs() != assignment.rhs())
456 data::find_all_variables(assignment.lhs(), std::inserter(used_write_variables, used_write_variables.end()));
457 data::find_all_variables(assignment.rhs(), std::inserter(used_read_variables, used_read_variables.end()));
462 std::set<data::variable> used_read_parameters;
463 std::set<data::variable> used_write_parameters;
465 std::set_intersection(used_read_variables.begin(),
466 used_read_variables.end(),
469 std::inserter(used_read_parameters,
470 used_read_parameters.begin()));
471 std::set_intersection(used_write_variables.begin(),
472 used_write_variables.end(),
475 std::inserter(used_write_parameters,
476 used_write_parameters.begin()));
479 for (
auto & param : m_parameters_list)
481 if (used_read_parameters.find(param) != used_read_parameters.end())
483 m_read_group[i].push_back(j);
485 if (used_write_parameters.find(param) != used_write_parameters.end())
487 m_write_group[i].push_back(j);
495 m_update_group.resize(m_group_count);
500 for (
const auto & reduced_summand : process_reduced().action_summands())
502 std::set<data::variable> used_update_variables;
504 data::find_free_variables(reduced_summand.condition(), std::inserter(used_update_variables, used_update_variables.end()));
505 lps::find_free_variables(reduced_summand.multi_action(), std::inserter(used_update_variables, used_update_variables.end()));
507 for (
const auto & assignment : reduced_summand.assignments())
509 if (assignment.lhs() != assignment.rhs())
511 data::find_all_variables(assignment.rhs(), std::inserter(used_update_variables, used_update_variables.end()));
516 std::set<data::variable> used_update_parameters;
518 std::set_intersection(used_update_variables.begin(),
519 used_update_variables.end(),
522 std::inserter(used_update_parameters,
523 used_update_parameters.begin()));
526 for (
auto & param : m_parameters_list)
528 if (used_update_parameters.find(param) != used_update_parameters.end())
530 m_update_group[i].push_back(j);
545 return m_specification.process().process_parameters().size();
551 return m_specification.process().action_summands().size();
557 load_lps(specification, filename);
558 return specification;
565 std::vector<lps::action_summand> reduced_summands;
566 for (
const auto & summand : spec.process().action_summands())
569 std::vector<std::size_t> guard_info;
573 data::data_expression reduced_condition = data::sort_bool::true_();
576 std::set<data::data_expression> conjuncts = data::split_and(summand.condition());
577 std::set<data::variable> summation_variables(summand.summation_variables().begin(), summand.summation_variables().end());
579 for (
const auto & conjunct : conjuncts)
582 std::size_t at = m_guards.index(conjunct);
583 bool is_new = (at == utilities::indexed_set<atermpp::aterm>::npos);
584 bool use_conjunct_as_guard =
true;
587 std::set<data::variable> conjunct_variables;
588 data::find_free_variables(conjunct, std::inserter(conjunct_variables, conjunct_variables.end()));
590 if (!summand.summation_variables().empty())
594 std::set<data::variable> summation_variables_in_conjunct;
595 std::set_intersection(conjunct_variables.begin(),
596 conjunct_variables.end(),
597 summation_variables.begin(),
598 summation_variables.end(),
599 std::inserter(summation_variables_in_conjunct, summation_variables_in_conjunct.begin()));
601 if (!summation_variables_in_conjunct.empty()) {
603 use_conjunct_as_guard =
false;
605 std::string printed_guard(data::pp(conjunct).substr(0, 80));
607 <<
"Guard '" << printed_guard + (printed_guard.size() > 80?
"...":
"") <<
"' in summand "
608 << reduced_summands.size()
609 <<
" introduces local variables. To remove the guard from the condition, try instantiating the summand with 'lpssuminst'."
613 if (reduced_condition == data::sort_bool::true_()) {
614 reduced_condition = conjunct;
616 reduced_condition = data::sort_bool::and_(reduced_condition, conjunct);
620 if (use_conjunct_as_guard) {
622 std::vector<std::size_t> guard_parameters;
623 if (!conjunct_variables.empty())
627 for (
auto & param : m_parameters_list)
629 if (conjunct_variables.find(param) != conjunct_variables.end())
631 guard_parameters.push_back(p);
637 at = m_guards.insert(conjunct).first;
638 m_guard_names.push_back(data::pp(conjunct));
639 guard_parameters_list.push_back(guard_parameters);
642 if (use_conjunct_as_guard) {
644 guard_info.push_back(at);
649 m_guard_info.push_back(guard_info);
652 reduced_summands.emplace_back(summand.summation_variables(),
654 summand.multi_action(),
655 summand.assignments());
659 lps::
linear_process lps_reduced(process().process_parameters(), process().deadlock_summands(), reduced_summands);
662 lps::
specification specification_reduced(m_specification.data(), m_specification.action_labels(), m_specification.global_variables(), lps_reduced, m_specification.initial_process());
663 return specification_reduced;
669 pins(
const std::string& filename,
const std::string& rewriter_strategy)
681 data::variable_list params = m_specification.process().process_parameters();
682 for (
const auto & param : params)
684 m_process_parameter_names.push_back(param.name());
689 std::map<data::sort_expression, pins_data_type*> existing_type_maps;
690 std::vector<data::variable> parameters(process().process_parameters().begin(),process().process_parameters().end());
691 for (std::size_t i = 0; i < params.size(); i++)
693 data::sort_expression s = parameters[i].sort();
694 std::map<data::sort_expression, pins_data_type*>::const_iterator j = existing_type_maps.find(s);
695 if (j == existing_type_maps.end())
697 m_unique_data_types.push_back(std::make_unique<state_data_type>(m_specification.data(), m_specification.action_labels(), s, m_specification.data().is_certainly_finite(s)));
698 pins_data_type* dt = m_unique_data_types.back().get();
699 m_data_types.push_back(dt);
700 existing_type_maps[s] = dt;
704 m_data_types.push_back(j->second);
707 m_unique_data_types.push_back(std::make_unique<action_label_data_type>(m_specification.data(), m_specification.action_labels()));
708 m_data_types.push_back(m_unique_data_types.back().get());
710 for (pins_data_type* data_type : m_data_types)
712 auto j = std::find_if(m_unique_data_types.begin(), m_unique_data_types.end(),
713 [&](
const std::unique_ptr<pins_data_type>& unique_data_type) {
return unique_data_type.get() == data_type; });
714 assert(j != m_unique_data_types.end());
715 m_unique_data_type_index.push_back(j - m_unique_data_types.begin());
723 return m_unique_data_types.size();
730 assert (i < m_data_types.size());
731 return *m_unique_data_types[i];
740 return m_read_group[index];
749 return m_write_group[index];
758 return m_update_group[index];
763 return guard_parameters_list[index];
768 return m_guard_info[index];
773 return m_guards.size();
777 return m_guard_names[index];
783 return m_process_parameter_names[i];
790 return m_unique_data_type_index[i];
803 return m_unique_data_types.size() - 1;
816 state initial_state(m_generator.initial_state().begin(),
static_cast<
int>(m_generator.initial_state().size()));
817 for (std::size_t i = 0; i < m_state_length; i++)
819 s[i] =
static_cast<
int>(state_type_map(i)[initial_state[i]]);
827 std::set<std::string> result;
828 auto const l = process().action_summands()[i].multi_action().actions();
830 for (
const auto & i : l)
832 result.insert(std::string(i.label().name()));
850 template <
typename StateFunction>
851 void next_state_all(ltsmin_state_type
const& src, StateFunction& f, ltsmin_state_type
const& dest,
int*
const& labels)
853 std::size_t nparams = process_parameter_count();
854 data::data_expression_vector state_arguments(nparams);
855 for (std::size_t i = 0; i < nparams; i++)
857 state_arguments[i] =
static_cast<data::data_expression>(state_type_map(i).get(src[i]));
859 state source(state_arguments.begin(),
static_cast<
int>(nparams));
861 std::list<generator_type::transition> transitions = m_generator.out_edges(source);
862 for (
const generator_type::transition& t: transitions)
864 state destination = t.state;
865 for (std::size_t j = 0; j < nparams; j++)
867 dest[j] =
static_cast<
int>(state_type_map(j)[destination[j]]);
869 labels[0] =
static_cast<
int>(action_label_type_map()[t.action]);
874 template <
typename StateFunction>
875 void next_state_long(ltsmin_state_type
const& src, std::size_t group, StateFunction& f, ltsmin_state_type
const& dest,
int*
const& labels)
877 _long(src, group, f, dest, labels, &m_generator);
880 template <
typename StateFunction>
881 void update_long(ltsmin_state_type
const& src, std::size_t group, StateFunction& f, ltsmin_state_type
const& dest,
int*
const& labels)
883 _long(src, group, f, dest, labels, &m_generator_reduced);
905 template <
typename StateFunction>
906 void _long(ltsmin_state_type
const& src,
909 const ltsmin_state_type& dest,
911 generator_type* generator)
913 std::size_t nparams = process_parameter_count();
914 data::data_expression_vector state_arguments(nparams);
915 for (std::size_t i = 0; i < nparams; i++)
917 state_arguments[i] =
static_cast<data::data_expression>(state_type_map(i).get(src[i]));
919 state source(state_arguments.begin(),
static_cast<
int>(nparams));
921 std::list<generator_type::transition> transitions = generator->out_edges(source, group);
923 for (
const generator_type::transition& t: transitions)
925 state destination = t.state;
926 for (std::size_t j = 0; j < nparams; j++)
928 dest[j] =
static_cast<
int>(state_type_map(j)[destination[j]]);
930 labels[0] =
static_cast<
int>(action_label_type_map()[t.action]);
936 std::size_t nparams = process_parameter_count();
937 substitution_t substitution;
938 for (std::size_t i = 0; i < nparams; i++)
940 data::data_expression value(
static_cast<data::data_expression>(state_type_map(i).get(src[i])));
941 substitution[m_parameters_list[i]] = value;
946 static_cast<data::data_expression>(m_guards.at(guard)),
961 std::ostringstream out;
963 out <<
"\n--- EDGE LABELS ---\n";
964 out <<
"edge_label_count() = " << edge_label_count() << std::endl;
965 for (std::size_t i = 0; i < edge_label_count(); i++)
968 out <<
"edge_label_name(" << i <<
") = " << edge_label_name(i) << std::endl;
969 out <<
"edge_label_type(" << i <<
") = " << edge_label_type(i) << std::endl;
972 out <<
"\n--- PROCESS PARAMETERS ---\n";
973 out <<
"process_parameter_count() = " << process_parameter_count() << std::endl;
974 for (std::size_t i = 0; i < process_parameter_count(); i++)
977 out <<
"process_parameter_name(" << i <<
") = " << process_parameter_name(i) << std::endl;
978 out <<
"process_parameter_type(" << i <<
") = " << process_parameter_type(i) << std::endl;
981 out <<
"\n--- SUMMANDS ---\n";
982 out <<
"group_count() = " << group_count() << std::endl;
983 for (std::size_t i = 0; i < group_count(); i++)
986 out <<
" read_group(" << i <<
") = " << print_vector(read_group(i)) << std::endl;
987 out <<
" write_group(" << i <<
") = " << print_vector(write_group(i)) << std::endl;
988 out <<
"update_group(" << i <<
") = " << print_vector(update_group(i)) << std::endl;
991 out <<
"\n--- GUARDS ---\n";
992 out <<
"guard_count() = " << guard_count() << std::endl;
993 for (std::size_t i = 0; i < guard_count(); i++)
995 out <<
"guard(" << i <<
") = " << print_vector(guard_parameters(i)) << std::endl;
998 out <<
"\n--- INITIAL STATE ---\n";
999 std::vector<
int> init(process_parameter_count());
1000 ltsmin_state_type init_state = init.data();
1002 out <<
"initial state = " << print_vector(init.data(), init.data() + process_parameter_count()) << std::endl;
1004 out <<
"\n--- DATA TYPE MAPS ---\n";
1005 out <<
"datatype_count() = " << datatype_count() << std::endl;
1006 for (std::size_t i = 0; i < datatype_count(); i++)
1008 const pins_data_type& type = data_type(i);
1010 out <<
"datatype " << i <<
"\n"
1011 <<
" name = " << type.name() <<
"\n"
1012 <<
" size = " << type.size() <<
"\n"
1013 <<
" bounded = " << std::boolalpha << type.is_bounded() <<
"\n";
1014 if (type.is_bounded())
1016 out <<
" possible values: " << core::detail::print_set(type.generate_values(10)) << std::endl;
A unordered_map class in which aterms can be stored.
const data_expression & body() const
data_expression & operator=(const data_expression &) noexcept=default
An enumerator algorithm that generates solutions of a condition.
The default element for the todo list of the enumerator.
existential quantification.
universal quantification.
Components for generating an arbitrary element of a sort.
representative_generator(const data_specification &specification)
Constructor with data specification as context.
Rewriter that operates on data expressions.
sort_expression(const sort_expression &) noexcept=default
Move semantics.
Models the mapping of mCRL2 action labels to integers.
const std::string & name() const override
Returns the name of the data type.
std::size_t parse(const std::string &s) override
Parses a string to a data value, and returns the corresponding index. If the value is not in the mapp...
std::string print(int i) const override
Returns a human readable representation of the value with index i. N.B. It is not guaranteed that par...
action_label_data_type(const data::data_specification &data, const process::action_label_list &action_labels)
std::string serialize(int i) const override
Serializes the i-th value of the data type to a binary string. It is guaranteed that serialize(deseri...
std::vector< std::string > generate_values(std::size_t) const override
Generates possible values of the data type (at most max_size).
std::size_t deserialize(const std::string &s) override
Deserializes a string to a data value, and returns the corresponding index. If the value is not in th...
\brief A timed multi-action
Forward iterator used for iterating over indices.
std::ptrdiff_t distance_to(const index_iterator &other) const
const std::size_t & dereference() const
bool equal(const index_iterator &other) const
index_iterator(std::size_t index=0)
Models a pins data type. A pins data type maintains a mapping between known values of a data type and...
utilities::indexed_set< atermpp::aterm > & indexed_set()
Returns the indexed_set holding the values.
utilities::indexed_set< atermpp::aterm > m_indexed_set
const utilities::indexed_set< atermpp::aterm > & indexed_set() const
Returns the indexed_set holding the values.
virtual std::vector< std::string > generate_values(std::size_t max_size) const =0
Generates possible values of the data type (at most max_size).
bool is_bounded() const
Returns true if the number of elements is bounded. If this property can not be computed for a data ty...
virtual const std::string & name() const =0
Returns the name of the data type.
const data::data_specification & m_data
virtual std::size_t parse(const std::string &s)=0
Parses a string to a data value, and returns the corresponding index. If the value is not in the mapp...
virtual std::string serialize(int i) const =0
Serializes the i-th value of the data type to a binary string. It is guaranteed that serialize(deseri...
std::size_t size() const
Returns the number of values that are stored in the map.
virtual std::size_t deserialize(const std::string &s)=0
Deserializes a string to a data value, and returns the corresponding index. If the value is not in th...
pins_data_type(const data::data_specification &data, const process::action_label_list &action_labels, bool is_bounded=false)
Constructor.
virtual std::string print(int i) const =0
Returns a human readable representation of the value with index i. N.B. It is not guaranteed that par...
index_iterator index_begin() const
Returns an iterator to the beginning of the indices.
virtual ~pins_data_type()=default
Destructor.
index_iterator index_end() const
Returns an iterator to the end of the indices.
atermpp::aterm get(std::size_t i)
Returns the value at index i.
std::size_t operator[](const atermpp::aterm &x)
Returns the index of the value x.
const process::action_label_list & m_action_labels
generator_type m_generator
const std::vector< std::size_t > & guard_parameters(std::size_t index) const
guard_evaluation_t
guard evaluations have ternary logic. A guard may not always rewrite to true or false
const linear_process & process() const
Returns the process of the LPS specification.
const std::vector< std::size_t > & write_group(std::size_t index) const
Indices of process parameters that influence event or next state of a summand by being written.
void get_initial_state(ltsmin_state_type &s)
Assigns the initial state to s.
datatype_index edge_label_type(std::size_t) const
Returns the datatype map index corresponding to edge label i.
std::string process_parameter_name(std::size_t i) const
Returns a human-readable, unique name for process parameter i.
std::size_t m_group_count
std::size_t process_parameter_count() const
Returns the number of process parameters of the LPS.
pins(const std::string &filename, const std::string &rewriter_strategy)
Constructor.
void next_state_long(ltsmin_state_type const &src, std::size_t group, StateFunction &f, ltsmin_state_type const &dest, int *const &labels)
lps::specification m_specification_reduced
generator_type m_generator_reduced
std::size_t edge_label_count() const
Returns the number of labels per edge.
std::size_t m_state_length
std::string print_vector(Iter first, Iter last) const
std::string print_vector(const Container &c) const
std::size_t datatype_count() const
Returns the number of unique datatype maps. Note that the datatype map for action labels is included,...
utilities::indexed_set< atermpp::aterm > m_guards
void update_long(ltsmin_state_type const &src, std::size_t group, StateFunction &f, ltsmin_state_type const &dest, int *const &labels)
std::set< std::string > summand_action_names(std::size_t i) const
Returns the names of the actions that appear in the summand with index i, with 0 <= i < group_count()...
lps::specification reduce_specification(const lps::specification &spec)
extracts all guards from the original specification and returns a new one with the guards removed.
std::size_t guard_count() const
void next_state_all(ltsmin_state_type const &src, StateFunction &f, ltsmin_state_type const &dest, int *const &labels)
Iterates over the 'next states' of state src, and invokes a callback function for each discovered sta...
std::string info()
Prints an overview of several relevant attributes.
static lps::specification load_specification(const std::string &filename)
guard_evaluation_t eval_guard_long(ltsmin_state_type const &src, std::size_t guard)
pins_data_type & action_label_type_map()
Returns the action data type.
const linear_process & process_reduced() const
Returns the reduced process of the LPS specification, i.e. with conditions with guards removed.
std::vector< std::size_t > m_unique_data_type_index
pins_data_type & data_type(std::size_t i)
Returns a reference to the datatype map with index i.
std::vector< std::string > m_guard_names
const std::vector< std::size_t > & guard_info(std::size_t index) const
data::rewriter m_rewriter_reduced
const pins_data_type & action_label_type_map() const
Returns the action data type.
std::vector< pins_data_type * > m_data_types
data::rewriter m_rewriter
std::vector< data::variable > m_parameters_list
const pins_data_type & state_type_map(std::size_t i) const
Returns the data type of the i-th state parameter.
pins_data_type & state_type_map(std::size_t i)
Returns the data type of the i-th state parameter.
datatype_index process_parameter_type(std::size_t i) const
Returns the datatype map index corresponding to process parameter i.
const std::vector< std::size_t > & read_group(std::size_t index) const
Indices of process parameters that influence event or next state of a summand by being read.
std::string edge_label_name(std::size_t) const
Returns the name of the i-th action label (always "action").
void initialize_read_write_groups()
const std::string & guard_name(std::size_t index)
const std::vector< std::size_t > & update_group(std::size_t index) const
Indices of process parameters that influence event or next state of a summand by being read except fr...
void _long(ltsmin_state_type const &src, std::size_t group, StateFunction &f, const ltsmin_state_type &dest, int *const &labels, generator_type *generator)
Iterates over the 'next states' of a particular summand of state src that are generated by a group of...
std::vector< std::string > m_process_parameter_names
std::size_t group_count() const
Returns the number of available groups. This equals the number of action summands of the LPS.
lps::specification m_specification
Linear process specification.
Models the mapping of mCRL2 state values to integers.
std::size_t expression2index(const data::data_expression &x)
data::data_expression index2expression(std::size_t i) const
std::size_t parse(const std::string &s) override
Parses a string to a data value, and returns the corresponding index. If the value is not in the mapp...
std::string print(int i) const override
Returns a human readable representation of the value with index i. N.B. It is not guaranteed that par...
data::sort_expression m_sort
std::size_t deserialize(const std::string &s) override
Deserializes a string to a data value, and returns the corresponding index. If the value is not in th...
std::string serialize(int i) const override
Serializes the i-th value of the data type to a binary string. It is guaranteed that serialize(deseri...
std::vector< std::string > generate_values(std::size_t max_size) const override
Generates possible values of the data type (at most max_size).
const std::string & name() const override
Returns the name of the data type.
state_data_type(const data::data_specification &data, const process::action_label_list &action_labels, const data::sort_expression &sort, bool sort_is_finite)
\brief The and operator for pbes expressions
and_(const pbes_expression &left, const pbes_expression &right)
\brief Constructor Z14.
const pbes_expression & left() const
const pbes_expression & right() const
std::set< pbes_expression > get_successors(const pbes_expression &phi)
Returns the successors of a state, which is a instantiated propositional variable....
pbes_greybox_interface(pbes &p, bool true_false_dependencies=false, bool is_min_parity=true, data::rewriter::strategy rewrite_strategy=data::rewrite_strategy::jitty)
Constructor.
~pbes_greybox_interface() override=default
propositional_variable_instantiation get_initial_state() override
Returns the initial state, rewritten and simplified.
virtual std::string print_successors(const std::set< pbes_expression > &successors)
Prints the set of successors states.
pbes_system::enumerate_quantifiers_rewriter pbes_rewriter
pbes_equation get_pbes_equation(const core::identifier_string &s)
Returns the equation for variable s.
pbes_expression rewrite_and_simplify_expression(const pbes_expression &e, const bool=true)
Rewrites and simplifies an expression.
std::set< pbes_expression > get_successors(const pbes_expression &phi, const std::string &var, const pbes_expression &expr)
Returns the successors of a state, which is a instantiated propositional variable,...
virtual pbes_expression expand_group(const pbes_expression &psi, const pbes_expression &expr)
Expands a formula expr for a instantiated state variable psi, which means substituting the variables ...
virtual bool visit_inner_bounded_exists(const pbes_expression &e)
Visits a bounded existential quantifier expression within a disjunctive expression.
ppg_visitor()=default
Constructor.
virtual ~ppg_visitor()=default
Destructor.
virtual bool visit_inner_implies(const pbes_expression &e)
Visits a disjunctive expression within an inner universal quantifier expression.
virtual bool visit_or(const pbes_expression &e)
Visits a disjunctive expression.
static std::string print_brief(const pbes_expression &e)
Returns a string representation of the type of the root node of the expression.
virtual bool visit_and(const pbes_expression &e)
Visits a conjunctive expression.
virtual bool visit_propositional_variable(const pbes_expression &e)
Visits a propositional variable expression.
virtual bool visit_inner_and(const pbes_expression &e)
Visits a conjunctive expression within an inner existential quantifier expression.
virtual bool visit_ppg_expression(const pbes_expression &e)
Visits a PPG expression.
virtual bool visit_inner_bounded_forall(const pbes_expression &e)
Visits a bounded universal quantifier expression within a conjunctive expression.
virtual bool visit_simple_expression(const pbes_expression &e)
Visits a simple expression. An expression is simple if it does not contain propositional variables.
\brief The existential quantification operator for pbes expressions
const data::variable_list & variables() const
const pbes_expression & body() const
static ltsmin_state false_state()
Returns the state representing false.
ltsmin_state get_state(const propositional_variable_instantiation &expr) const
Returns a PBES_State object for expr.
std::vector< ltsmin_state > get_successors(const ltsmin_state &state, int group)
Computes successor states for a state as defined in transition group group. Serves as a wrapper aroun...
std::string data_to_string(const data::data_expression &e)
Returns a string representation for the data expression e.
int get_index(int type_no, const std::string &s)
Returns the index of value in the local store for the data type with number type_no....
std::vector< std::string > localmap_int2string
ltsmin_state get_initial_state() const
Returns the initial state.
static ltsmin_state true_state()
Returns the state representing true.
void to_state_vector(const ltsmin_state &dst_state, int *dst, const ltsmin_state &src_state, int *const &src)
Transforms a PBES state to a state vector, represented by an array of integers.
std::string get_value(int type_no, int index)
Returns the value at position index in the local store for the data type with number type_no....
int get_value_index(int type_no, const data_expression &value)
Returns the index of value in the local store for the data type with number type_no....
explorer(const std::string &filename, const std::string &rewrite_strategy, bool reset_flag, bool always_split_flag)
Constructor.
std::map< std::string, int > localmap_string2int
void next_state_long(int *const &src, int group, callback &cb)
Iterates over the successors of a state for a certain transition group and invokes a callback functio...
explorer(const pbes &p_, const std::string &rewrite_strategy, bool reset_flag, bool always_split_flag)
Constructor.
ltsmin_state from_state_vector(int *const &src)
Transforms a state vector src into a PBES_State object object containing the variable and parameter v...
int get_string_index(const std::string &s)
Returns the index of s in the local store for string values. This store is reserved for the string re...
const std::string & get_string_value(int index)
Returns the string at position index in the local store for string values. An exception is thrown if ...
std::vector< ltsmin_state > get_successors(const ltsmin_state &state)
Computes successor states for a state. Serves as a wrapper around the get_successors function of the ...
data::data_expression string_to_data(const std::string &s)
Returns a data expression for the string representation s.
lts_info * get_info() const
Returns the PBES_Info object.
const data_expression & get_data_value(int type_no, int index)
Returns the value at position index in the local store for the data type with number type_no....
void next_state_all(int *const &src, callback &cb)
Iterates over the successors of a state and invokes a callback function for each successor state.
detail::pbes_greybox_interface * pgg
the PBES greybox interface
void initial_state(int *state)
static fixpoint_symbol nu()
Returns the nu symbol.
fixpoint_symbol & operator=(fixpoint_symbol &&) noexcept=default
static fixpoint_symbol mu()
Returns the mu symbol.
\brief The universal quantification operator for pbes expressions
const pbes_expression & body() const
const data::variable_list & variables() const
\brief The implication operator for pbes expressions
const pbes_expression & left() const
const pbes_expression & right() const
bool is_write_dependent_propvar(int group)
Determines if group is write dependent on the propositional variable. Returns true if propositional v...
std::map< std::string, int > variable_priority
static std::vector< std::string > get_param_sequence(const data::variable_list ¶ms)
Converts a variable_sequence_type into a sequence of parameter signatures.
bool is_read_dependent_parameter(int group, int part)
Determines if group is read dependent on part part of the state vector. Returns true if the parameter...
std::vector< int > get_param_indices(const data::variable_list ¶ms)
Converts a variable_sequence_type into a sequence of indices of parameter signatures in the list of p...
std::vector< std::string > transition_variable_name
bool is_pass_through_state(const propositional_variable_instantiation &propvar)
Determines if the propositional variable instantiation is one that only copies parameters from the cu...
const std::map< std::string, fixpoint_symbol > & get_variable_symbols() const
Returns the map from variable names to the fixpoint operator of the equation for the variable.
static std::map< variable, std::string > variable_signatures
std::map< std::string, fixpoint_symbol > variable_symbol
const std::map< std::string, data::variable_list > & get_variable_parameters() const
Returns the map from variable names to the sequence of parameters for the variable.
const std::map< std::string, propositional_variable > & get_variables() const
Returns the map from variable names to the variable object for the variable.
int get_index(const std::string &signature)
Returns the index for a parameter signature in the list of parameter signatures for the system.
const lts_type & get_lts_type() const
Returns the LTS Type.
std::map< std::string, int > param_index
bool get_reset_option() const
Returns if the reset option is set.
std::set< std::string > copied(const pbes_expression &expr, const std::set< std::string > &L)
Computes the free variables which are copied/passed through (to a recursive variable) in an expressio...
const std::vector< pbes_expression > & get_transition_expressions() const
Returns the map from transition group number to the expression of the transition group.
std::set< std::string > copied(const pbes_expression &expr)
Computes the free variables which are copied/passed through (to a recursive variable) in an expressio...
std::vector< data_expression > param_default_values
detail::pbes_greybox_interface * pgg
bool is_read_dependent_propvar(int group)
Determines if group is read dependent on the propositional variable. Returns true,...
std::vector< pbes_expression > transition_expression
const std::vector< operation_type > & get_transition_types() const
Returns the map from transition group number to the type of the right hand side of the equation to wh...
std::set< std::string > used(const pbes_expression &expr, const std::set< std::string > &L)
Computes the free variables actually used, not only passed through, in an expression.
std::set< std::string > used(const pbes_expression &expr)
Computes the free variables actually used, not only passed through, in an expression.
static std::string get_param_signature(const variable ¶m)
Returns a signature for parameter param.
const std::map< std::string, operation_type > & get_variable_types() const
Returns the map from variable names to the type of the right hand side of the equation for the variab...
void compute_dependency_matrix()
Computes dependency matrix from PBES.
lts_info(pbes &p, detail::pbes_greybox_interface *pgg, bool reset, bool always_split)
Constructor.
static bool tf(const pbes_expression &phi)
Determines if the term phi contains a branch that directly results in true or false (not a variable).
std::vector< pbes_expression > split_expression_and_substitute_variables(const pbes_expression &e, int current_priority, operation_type current_type, std::set< std::string > vars_stack)
Splits the expression into parts (disjuncts or conjuncts) and recursively tries to substitute the pro...
std::map< std::string, propositional_variable > variables
int get_number_of_groups() const
Returns the number of transition groups.
static std::set< std::string > get_param_set(const data::variable_list ¶ms)
Converts a variable_sequence_type into a set of parameter signatures.
std::map< int, int > get_param_index_positions(const data::variable_list ¶ms)
Converts a variable_sequence_type into a map from indices of parameter signatures (in the list of par...
static std::set< std::string > occ(const pbes_expression &expr)
Computes the propositional variables used in an expression.
std::map< std::string, operation_type > variable_type
int count_variables(const pbes_expression &e)
Counts the number of propositional variables in an expression.
void compute_lts_type()
Computes LTS Type from PBES.
std::vector< operation_type > transition_type
std::set< std::string > changed(const pbes_expression &phi, const std::set< std::string > &L)
Computes the set of parameters changed in the expression.
std::string state_to_string(const ltsmin_state &state)
Returns a string representation for state state.
const std::map< std::string, int > & get_variable_priorities() const
Returns the map from variable names to the priority of the equation for the variable.
std::map< std::string, data::variable_list > variable_parameters
const data_expression & get_default_value(int index)
Returns a default value for the sort of a parameter signature.
const std::vector< std::string > & get_transition_variable_names() const
Returns the map from transition group number to the variable name of the equation to which the transi...
std::set< std::string > reset(const pbes_expression &phi, const std::set< std::string > &d)
Computes the set of parameters reset in the expression.
static std::string get_param_signature(const std::string ¶mname, const std::string ¶mtype)
Returns a signature using name and type of a parameter.
static std::set< std::string > free(const pbes_expression &expr)
Computes the free variables read in an expression.
std::vector< pbes_expression > transition_expression_plain
bool is_write_dependent_parameter(int group, int part)
Determines if group is read dependent on part part of the state vector. Returns true if the parameter...
std::map< std::string, pbes_expression > variable_expression
std::set< std::string > changed(const pbes_expression &phi)
Computes the set of parameters changed in the expression.
void compute_transition_groups()
Computes transition groups from PBES.
const std::vector< std::string > & get_edge_label_types() const
Returns the sequence of edge label types.
std::size_t get_number_of_state_types() const
Returns the number of state types.
const std::vector< std::string > & get_edge_labels() const
Returns the sequence of edge labels.
int get_state_type_no(int part) const
Returns the state type index for the state part part.
std::vector< std::string > state_type_list
std::vector< std::string > state_label_types
std::vector< std::string > state_names
std::vector< int > state_type_no
void add_state(const std::string &name, const std::string &type)
Adds a state part of type type with name name.
void add_state_label(const std::string &name, const std::string &type)
Adds a state label of type type with name name.
lts_type(int state_length)
Contructor.
std::string get_state_type_name(int type_no) const
Returns the name of the state type with number type_no.
int get_state_length() const
Returns the state length.
std::map< std::string, int > state_type_index
std::vector< std::string > edge_label_names
const std::vector< std::string > & get_state_label_types() const
Returns the sequence of state label types.
std::vector< std::string > edge_label_types
std::vector< std::string > state_types
std::size_t get_number_of_edge_labels() const
Returns the number of edge labels.
std::vector< std::string > state_label_names
const std::vector< std::string > & get_state_types() const
Returns the sequence of state part types.
void add_edge_label(const std::string &name, const std::string &type)
Adds an edge label of type type with name name.
const std::vector< std::string > & get_state_labels() const
Returns the sequence of state labels.
const std::vector< std::string > & get_state_names() const
Returns the sequence of state part names.
std::size_t get_number_of_state_labels() const
Returns the number of state labels.
void add_parameter_value(const data_expression &)
Adds a parameter value to the list of parameter values.
pbes_expression to_pbes_expression() const
Returns a PBES expression representing the state.
std::vector< data_expression > param_values
std::string state_to_string() const
Returns a string representation of the state.
bool operator<(const ltsmin_state &other) const
Compares two PBES_State objects. Uses lexicographical ordering on priority, type, variable and parame...
ltsmin_state(const std::string &varname)
Constructor.
bool operator==(const ltsmin_state &other) const
Checks if two PBES_State objects are equal.
ltsmin_state(const std::string &varname, const pbes_expression &e)
Constructor.
std::string get_variable() const
Returns a string representation of the propositional variable of the state.
const std::vector< data_expression > & get_parameter_values() const
Returns the list of parameter values.
\brief The not operator for pbes expressions
const pbes_expression & operand() const
\brief The or operator for pbes expressions
const pbes_expression & left() const
or_(const pbes_expression &left, const pbes_expression &right)
\brief Constructor Z14.
const pbes_expression & right() const
Class for generating a BES from a PBES. This BES can be interpreted as a graph corresponding to a par...
void compute_priorities(const std::vector< pbes_equation > &equations)
Compute priorities of PBES propositional variables.
virtual operation_type get_expression_operation(const pbes_expression &phi)
Returns the vertex type.
virtual void print_variable_mapping()
Prints the mapping from BES variables to the corresponding PBES expressions.
std::map< core::identifier_string, std::size_t > m_priorities
Maps propositional variables to corresponding priorities.
void compute_equation_index_map()
Compute equation index map.
pbes_expression expand_rhs(const pbes_expression &psi)
parity_game_generator(pbes &p, bool true_false_dependencies=false, bool is_min_parity=true, data::rewriter::strategy rewrite_strategy=data::rewrite_strategy::jitty)
Constructor.
virtual operation_type get_operation(std::size_t index)
Returns the vertex type.
bool m_true_false_dependencies
Determines what kind of BES equations are generated for true and false.
virtual propositional_variable_instantiation get_initial_state()
Returns the (rewritten) initial state.
std::string print_equation_count(std::size_t size, std::size_t step=1000) const
Prints a log message for every step-th equation.
std::map< pbes_expression, std::size_t > m_pbes_expression_index
Maps PBES closed expressions to corresponding BES variables.
virtual void initialize_generation()
std::size_t m_max_priority
The maximum priority value of the game.
pbes_system::enumerate_quantifiers_rewriter R
PBES rewriter.
void make_substitution(const data::variable_list &v, const data::data_expression_list &e, substitution_function &sigma) const
Generates a substitution function for the pbesinst rewriter.
pbes & m_pbes
The PBES that is being solved.
virtual std::size_t get_priority(std::size_t index)
Returns the priority of a vertex. The priority of the first equation is 0 if it is a maximal fixpoint...
virtual std::set< std::size_t > get_initial_values()
Returns the vertices for which a solution is requested. By default a set containing the values 0,...
virtual ~parity_game_generator()=default
virtual std::string print_bes_equation(std::size_t index, const std::set< std::size_t > &rhs)
data::rewriter datar
Data rewriter.
operation_type
The operation type of the vertices.
bool m_is_min_parity_game
True if it is a min-parity game.
std::size_t add_bes_equation(pbes_expression t, std::size_t priority)
Adds a BES equation for a given PBES expression, if it not already exists.
bool m_initialized
Mark whether initialization has been initialized. Needed to properly cope with virtual inheritance!
virtual std::set< std::size_t > get_dependencies(std::size_t index)
Returns the successors of a vertex in the graph.
const pbes_expression & formula() const
Returns the predicate formula on the right hand side of the equation.
const fixpoint_symbol & symbol() const
Returns the fixpoint symbol of the equation.
const propositional_variable & variable() const
Returns the pbes variable of the equation.
pbes_expression & operator=(pbes_expression &&) noexcept=default
pbes_expression & operator=(const pbes_expression &) noexcept=default
parameterized boolean equation system
propositional_variable_instantiation & initial_state()
Returns the initial state.
\brief A propositional variable instantiation
const data::data_expression_list & parameters() const
const core::identifier_string & name() const
\brief A propositional variable declaration
const core::identifier_string & name() const
propositional_variable(const core::identifier_string &name, const data::variable_list ¶meters)
\brief Constructor Z12.
#define mCRL2log(LEVEL)
mCRL2log(LEVEL) provides the stream used to log.
atermpp::aterm remove_index(const atermpp::aterm &x)
void split_finite_variables(data::variable_list variables, const data::data_specification &data, data::variable_list &finite_variables, data::variable_list &infinite_variables, data::variable_list &unused, const FILTER filter)
Splits the variables in a subset with finite sort, with infinite sort and those that are not used acc...
void split_enumerable_variables(data::variable_list variables, const data::data_specification &data, const Rewriter &rewr, data::variable_list &enumerable_variables, data::variable_list &non_enumerable_variables, data::variable_list &unused, const FILTER filter)
Splits a list of variables in those that are enumerable, non enumerable and not used,...
Namespace for system defined sort bool_.
const function_symbol & false_()
Constructor for function symbol false.
const function_symbol & true_()
Constructor for function symbol true.
bool is_data_expression(const atermpp::aterm &x)
Test for a data_expression expression.
std::ostream & operator<<(std::ostream &out, const no_substitution &)
The main namespace for the LPS library.
std::vector< std::string > generate_values(const data::data_specification &dataspec, const data::sort_expression &s, std::size_t max_size=1000)
Generates possible values of the data type (at most max_size).
The namespace for accessor functions on pbes expressions.
const pbes_expression & arg(const pbes_expression &t)
Returns the pbes expression argument of expressions of type not, exists and forall.
const pbes_expression & left(const pbes_expression &t)
Returns the left hand side of an expression of type and, or or imp.
const pbes_expression & right(const pbes_expression &t)
Returns the right hand side of an expression of type and, or or imp.
std::set< data::variable > significant_variables(const pbes_expression &x)
Returns the significant variables of a pbes expression.
void remove_parameters(pbes &x, const std::set< data::variable > &to_be_removed)
Removes parameters from propositional variable instantiations in a pbes expression.
void remove_parameters(pbes &x, const std::map< core::identifier_string, std::vector< std::size_t > > &to_be_removed)
Removes parameters from propositional variable instantiations in a pbes expression.
void pbesinst_finite(pbes &p, data::rewrite_strategy rewrite_strategy, const std::string &finite_parameter_selection)
Apply finite instantiation to the given PBES.
void instantiate_global_variables(pbes &p)
Attempts to eliminate the free variables of a PBES, by substituting a constant value for them....
bool is_normalized(const pbes &x)
Checks if a PBEs is normalized.
std::vector< propositional_variable > remove_unreachable_variables(pbes &p)
Removes equations that are not (syntactically) reachable from the initial state of a PBES.
bool is_bes(const pbes &x)
Returns true if a PBES is in BES form.
std::string print_removed_equations(const std::vector< propositional_variable > &removed)
Print removed equations.
void normalize(pbes &x)
The function normalize brings (embedded) pbes expressions into positive normal form,...
apply_enumerate_builder< Builder, DataRewriter, MutableSubstitution, no_substitution > make_apply_enumerate_builder(const DataRewriter &R, MutableSubstitution &sigma, const data::data_specification &dataspec, data::enumerator_identifier_generator &id_generator, bool enumerate_infinite_sorts)
static void inc_indent()
Increases the current indent level.
bool is_counter_example_equation(const pbes_equation &equation)
Guesses if the PBES equation is a counter example equation.
bool is_counter_example_positive(const core::identifier_string &name)
Returns true iff the name is Zpos, name must be a counter example name.
apply_data_rewriter_with_pbes_substitution_builder< Builder, DataRewriter, MutableSubstitution, PbesSubstitution > make_apply_data_rewriter_with_pbes_substitution_builder(const DataRewriter &R, MutableSubstitution &sigma, const PbesSubstitution &sigma_pbes)
mcrl2::pbes_system::pbes remove_counterexample_info(const pbes_system::pbes &pbes, bool remove_Lplus=true, bool remove_Lminus=true, bool remove_Lequations=true)
Removes all equations and expressions related to counter examples from the input PBES.
void data_rewrite(data::data_expression &result, const data::data_expression &x, const DataRewriter &R, SubstitutionFunction &sigma)
bool is_counter_example_instantiation(const propositional_variable_instantiation &inst)
Guesses if the PBES variable instantiation is for counter example equation.
void data_rewrite(data::data_expression &result, const data::data_expression &x, const DataRewriter &R, data::no_substitution &)
bool has_counter_example_information(const pbes &pbesspec)
Guesses if a pbes has counter example information.
bool counter_example_index(const core::identifier_string &name, std::size_t &index)
Extracts the index embedded in a Zpos_<index>_.../Zneg_<index>_... counter example name.
static void indent()
Indents according to the current indent level.
static void dec_indent()
Decreases the current indent level.
bool is_counter_example_variable(const propositional_variable &X)
static int indent_count
The current indent level. Used for debug output.
apply_rewriter_builder< Builder, DataRewriter, SubstitutionFunction > make_apply_rewriter_builder(const DataRewriter &datar, SubstitutionFunction &sigma)
bool is_counter_example_name(const core::identifier_string &name)
apply_data_rewriter_with_pbes_substitution_builder< Builder, DataRewriter, MutableSubstitution, no_substitution > make_apply_data_rewriter_with_pbes_substitution_builder(const DataRewriter &R, MutableSubstitution &sigma)
MapContainer::mapped_type map_at(const MapContainer &m, typename MapContainer::key_type key)
apply_enumerate_builder< Builder, DataRewriter, MutableSubstitution, PbesSubstitution > make_apply_enumerate_builder(const DataRewriter &R, MutableSubstitution &sigma, const PbesSubstitution &sigma_pbes, const data::data_specification &dataspec, data::enumerator_identifier_generator &id_generator, bool enumerate_infinite_sorts)
The main namespace for the PBES library.
bool is_pbes_file_format(const utilities::file_format &format)
pbes_expression join_or(FwdIt first, FwdIt last)
Returns or applied to the sequence of pbes expressions [first, last)
bool is_data(const pbes_expression &t)
Returns true if the term t is a data expression.
pbes_expression optimized_or(const pbes_expression &p, const pbes_expression &q)
Make a disjunction.
void load_pbes(pbes &pbes, std::istream &stream, utilities::file_format format, const std::string &)
Load a PBES from file.
std::set< pbes_expression > split_and(const pbes_expression &expr, bool split_data_expressions=false)
Splits a conjunction into a sequence of operands Given a pbes expression of the form p1 && p2 && ....
void save_pbes(const pbes &pbes, const std::string &filename, utilities::file_format format, bool welltypedness_check)
save_pbes Saves a PBES to a file.
const pbes_expression & true_()
bool is_not(const atermpp::aterm &x)
const utilities::file_format & pbes_format_internal_bes()
pbes_expression optimized_join_and(FwdIt first, FwdIt last)
Returns and applied to the sequence of pbes expressions [first, last)
pbes_expression optimized_join_or(FwdIt first, FwdIt last)
Returns or applied to the sequence of pbes expressions [first, last)
pbes_expression join_and(FwdIt first, FwdIt last)
Returns and applied to the sequence of pbes expressions [first, last)
void load_pbes(pbes &pbes, const std::string &filename, utilities::file_format format)
Load pbes from file.
const utilities::file_format & pbes_format_pgsolver()
bool is_exists(const atermpp::aterm &x)
utilities::file_format guess_format(const std::string &filename)
bool is_or(const atermpp::aterm &x)
void make_optimized_forall(pbes_expression &result, const data::variable_list &l, const pbes_expression &p, bool remove_variables=false)
Make a universal quantification If l is empty, p is returned.
bool is_non_simple_conjunct(const pbes_expression &t)
Test for a conjunction.
bool is_simple_expression(const T &x, bool allow_counter_example_propvar)
Determines if an expression is a simple expression. An expression is simple if it is free of proposit...
bool is_forall(const atermpp::aterm &x)
pbes_expression optimized_and(const pbes_expression &p, const pbes_expression &q)
Make a conjunction.
const std::vector< utilities::file_format > & pbes_file_formats()
void save_bes_pgsolver(const pbes &bes, std::ostream &stream, bool maxpg)
bool is_pbes_or(const pbes_expression &t)
Returns true if the term t is an or expression.
bool is_false(const pbes_expression &t)
Test for the value false.
std::vector< pbes_expression > split_disjuncts(const pbes_expression &expr, bool split_simple_expr=false)
Splits a disjunction into a sequence of operands. Given a pbes expression of the form p1 || p2 || ....
bool is_pbes_and(const pbes_expression &t)
Returns true if the term t is an and expression.
void save_pbes(const pbes &pbes, std::ostream &stream, utilities::file_format format)
Save a PBES in the format specified.
void make_optimized_exists(pbes_expression &result, const data::variable_list &l, const pbes_expression &p, bool remove_variables=false)
Make an optimized existential quantification. If l is empty, p is returned.
bool is_simple_expression_with_cache(const T &x, bool allow_counter_example_propvar, std::map< pbes_expression, bool > &cache_true, std::map< pbes_expression, bool > &cache_false)
Determines if an expression is a simple expression using a cache. An expression is simple if it is fr...
std::vector< pbes_expression > split_conjuncts(const pbes_expression &expr, bool split_simple_expr=false)
Splits a conjunction into a sequence of operands Given a pbes expression of the form p1 && p2 && ....
const utilities::file_format & pbes_format_internal()
bool is_propositional_variable_instantiation(const atermpp::aterm &x)
const utilities::file_format & pbes_format_text()
bool is_and(const atermpp::aterm &x)
std::string print_brief(const T &x)
Returns a string representation of the root node of a PBES.
std::set< pbes_expression > split_or(const pbes_expression &expr, bool split_data_expressions=false)
Splits a disjunction into a sequence of operands Given a pbes expression of the form p1 || p2 || ....
bool is_non_simple_disjunct(const pbes_expression &t)
Test for a disjunction.
bool is_imp(const atermpp::aterm &x)
bool is_true(const pbes_expression &t)
Test for the value true.
const pbes_expression & false_()
The main namespace for the Process library.
void apply(T &result, const data::variable &x)
void apply(T &result, const data::lambda &x)
void enumerate_exists(data_expression &result, const data::variable_list &v, const data_expression &phi)
void operator()(data_expression &result, const data_expression &x, MutableSubstitution &sigma)
data::enumerator_algorithm< self > E
The enumerator.
void apply(T &result, const forall &x)
atermpp::vector< data::data_expression > undo_substitution(const data::variable_list &variables)
enumerate_quantifiers_builder(const DataRewriter &R, MutableSubstitution &sigma, const data::data_specification &dataspec, data::enumerator_identifier_generator &id_generator, bool enumerate_infinite_sorts=true)
Constructor.
void enumerate_forall(data_expression &result, const data::variable_list &v, const data_expression &phi)
bool m_enumerate_infinite_sorts
If false, only quantifier variables over finite sort are enumerated.
void redo_substitution(const data::variable_list &v, const atermpp::vector< data::data_expression > &undo)
void apply(T &result, const data::exists &x)
const data::data_specification & m_dataspec
MutableSubstitution & m_sigma
const data::rewriter & m_rewriter
A data rewriter.
data_expression operator()(const data_expression &x, Substitution &sigma) const
data::enumerator_identifier_generator & m_id_generator
bool m_enumerate_infinite_sorts
If true, quantifier variables of infinite sort are enumerated.
enumerate_quantifiers_rewriter(const data::rewriter &R, const data::data_specification &dataspec, data::enumerator_identifier_generator &id_generator, bool enumerate_infinite_sorts=true)
const data::data_specification & m_dataspec
A data specification.
void operator()(data_expression &result, const data_expression &x, Substitution &sigma) const
An empty struct that is used to denote the absence of a substitution. Used for rewriters.
const variable & operator()(const variable &v) const
static constexpr bool is_identity_substitution
A rewriter that applies a data rewriter to data expressions in a term.
pbes_expression operator()(const pbes_expression &x, SubstitutionFunction &sigma) const
pbes_expression operator()(const pbes_expression &x) const
data_rewriter(const DataRewriter &R_)
SubstitutionFunction & sigma
void apply(T &result, const data::data_expression &x)
add_data_rewriter(const DataRewriter &R_, SubstitutionFunction &sigma_)
void apply(T &result, const propositional_variable_instantiation &x)
void apply(T &result, const forall &x)
void apply(T &result, const imp &x)
void apply(T &result, const exists &x)
void apply(T &result, const or_ &x)
void apply(T &result, const not_ &x)
void apply(T &result, const and_ &x)
apply_data_rewriter_with_pbes_substitution_builder(const DataRewriter &R, MutableSubstitution &sigma)
apply_data_rewriter_with_pbes_substitution_builder(const DataRewriter &R, MutableSubstitution &sigma, const PbesSubstitution &sigma_pbes)
apply_enumerate_builder(const DataRewriter &R, MutableSubstitution &sigma, const PbesSubstitution &sigma_pbes, const data::data_specification &dataspec, data::enumerator_identifier_generator &id_generator, const enumerate_quantifiers_mode enum_mode)
apply_rewriter_builder(const DataRewriter &datar, SubstitutionFunction &sigma)
A visitor class for PBES equations in BQNF. There is a visit_<node> function for each type of node....
bool debug
flag that indicates if debug output should be printed.
virtual bool visit_bqnf_equation(const pbes_equation &eqn)
Visits a BQNF equation.
virtual bool visit_inner_bounded_exists(const fixpoint_symbol &sigma, const propositional_variable &var, const pbes_expression &e)
Visits a bounded existential quantifier expression within a disjunctive expression.
static std::string print_brief(const pbes_expression &e)
Returns a string representation of the type of the root node of the expression.
virtual bool visit_bounded_forall(const fixpoint_symbol &sigma, const propositional_variable &var, const pbes_expression &e)
Visits a bounded universal quantifier expression.
virtual bool visit_bounded_quantifier(const fixpoint_symbol &sigma, const propositional_variable &var, const pbes_expression &e)
Visits a bounded quantifier expression.
virtual bool visit_inner_and(const fixpoint_symbol &sigma, const propositional_variable &var, const pbes_expression &e)
Visits a conjunctive expression within an inner existential quantifier expression.
virtual bool visit_propositional_variable(const fixpoint_symbol &, const propositional_variable &, const pbes_expression &e)
Visits a propositional variable expression.
static bool is_inner_implies(const pbes_expression &e)
Determines if an expression if of the form phi => psi or of the form phi \/ psi where phi is a simple...
virtual bool visit_simple_expression(const fixpoint_symbol &sigma, const propositional_variable &var, const pbes_expression &e)
Visits a simple expression. An expression is simple if it does not contain propositional variables.
virtual bool visit_bqnf_expression(const pbes_expression &e)
Visits a BQNF expression. In the current BQNF visitor sigma and var parameters are added for use in b...
virtual bool visit_and(const fixpoint_symbol &sigma, const propositional_variable &var, const pbes_expression &e)
Visits a conjunctive expression.
virtual bool visit_bqnf_expression(const fixpoint_symbol &sigma, const propositional_variable &var, const pbes_expression &e)
Visits a BQNF expression.
static bool is_inner_and(const pbes_expression &e)
Determines if an expression if of the form phi /\ psi where phi is a simple expression and psi is an ...
virtual ~bqnf_visitor()=default
Destructor.
virtual bool visit_or(const fixpoint_symbol &sigma, const propositional_variable &var, const pbes_expression &e)
Visits a disjunctive expression.
virtual bool visit_bqnf_equation_debug(const pbes_equation &eqn)
Visits a BQNF equation in debug mode.
virtual bool visit_bounded_exists(const fixpoint_symbol &sigma, const propositional_variable &var, const pbes_expression &e)
Visits a bounded existential quantifier expression.
virtual bool visit_inner_bounded_forall(const fixpoint_symbol &sigma, const propositional_variable &var, const pbes_expression &e)
Visits a bounded universal quantifier expression within a conjunctive expression.
data_rewriter_builder(const DataRewriter &R, SubstitutionFunction &sigma)
enumerate_quantifiers_mode m_enum_mode
If false, only quantifier variables over finite sorts are enumerated.
void operator()(pbes_expression &result, const pbes_expression &x, MutableSubstitution &)
void enumerate_exists(pbes_expression &result, const data::variable_list &v, const pbes_expression &phi)
data::enumerator_identifier_generator & m_id_generator
identifier generator
void redo_substitution(const data::variable_list &v, const atermpp::vector< data::data_expression > &undo)
void apply(T &result, const exists &x)
const data::data_specification & m_dataspec
pbes_expression operator()(const pbes_expression &x, MutableSubstitution &)
void apply(T &result, const forall &x)
void enumerate_forall(pbes_expression &result, const data::variable_list &v, const pbes_expression &phi)
atermpp::vector< data::data_expression > undo_substitution(const data::variable_list &variables)
void apply(T &result, const data::data_expression &x)
enumerate_quantifiers_builder(const DataRewriter &R, MutableSubstitution &sigma, const PbesSubstitution &sigma_pbes, const data::data_specification &dataspec, data::enumerator_identifier_generator &id_generator, enumerate_quantifiers_mode enum_mode=enumerate_quantifiers_mode::expand_infinite_sorts_and_use_data_rewriter)
Constructor.
data::enumerator_algorithm< self > E
The enumerator.
void apply(T &result, const exists &x)
void apply_substitution(T &result, const propositional_variable_instantiation &x, const SubstitutionType &sigma)
MutableSubstitution & substitution()
const PbesSubstitution & m_sigma_pbes
simplify_data_rewriter_builder(const DataRewriter &R, MutableSubstitution &sigma)
void apply_substitution(T &, const propositional_variable_instantiation &, const no_substitution &)
Overload to have a trivial function in case the substitution is no_substitution.
substitution_administration_type substitution_administration
void apply(T &result, const forall &x)
simplify_data_rewriter_builder(const DataRewriter &R, MutableSubstitution &sigma, const PbesSubstitution &sigma_pbes)
void apply(T &result, const propositional_variable_instantiation &x)
void apply(T &result, const propositional_variable_instantiation &x)
subsitute_counterexample(bool replace_Lplus, bool replace_Lminus)
An attempt for improving the efficiency.
void clear_identifier_generator()
void operator()(pbes_expression &result, const pbes_expression &x, MutableSubstitution &sigma) const
void thread_initialise()
Initialises this rewriter with thread dependent information.
pbes_expression operator()(const pbes_expression &x, MutableSubstitution &sigma, const PbesSubstitution &sigma_pbes) const
enumerate_quantifiers_mode m_enum_mode
If true, quantifier variables of infinite sort are enumerated.
enumerate_quantifiers_rewriter clone()
Create a clone of the rewriter in which the underlying rewriter is copied, and not passed as a shared...
data::data_specification m_dataspec
A data specification.
void operator()(pbes_expression &result, const pbes_expression &x, MutableSubstitution &sigma, const PbesSubstitution &sigma_pbes) const
data::enumerator_identifier_generator m_id_generator
pbes_expression operator()(const pbes_expression &x) const
enumerate_quantifiers_rewriter(const data::rewriter &R, const data::data_specification &dataspec, const enumerate_quantifiers_mode enum_mode=enumerate_quantifiers_mode::expand_infinite_sorts_and_use_data_rewriter)
data::rewriter m_rewriter
A data rewriter.
pbes_expression operator()(const pbes_expression &x, MutableSubstitution &sigma) const
bool operator()(const pbes_expression &x) const
bool operator()(const pbes_expression &x) const
An empty struct that can be used to indicate that there is no substitution that should be applied to ...
Visitor for printing the root node of a PBES.
void apply(const pbes_equation &x)
void apply(const propositional_variable_instantiation &x)
void apply(const forall &)
void apply(const exists &)
A rewriter that simplifies boolean expressions in a term, and rewrites data expressions using DataRew...
pbes_expression operator()(const pbes_expression &x) const
pbes_expression operator()(const pbes_expression &x, Substitution &sigma, const PbesSubstitution &sigma_pbes) const
simplify_data_rewriter(const DataRewriter &R_)
void operator()(pbes_expression &result, const pbes_expression &x, Substitution &sigma, const PbesSubstitution &sigma_pbes) const
void operator()(pbes_expression &result, const pbes_expression &x, Substitution &sigma) const
pbes_expression operator()(const pbes_expression &x, Substitution &sigma) const
A rewriter that simplifies boolean expressions in a term.
void operator()(pbes_expression &result, const pbes_expression &x) const
pbes_expression operator()(const pbes_expression &x, const PbesSubstitution &sigma) const
pbes_expression operator()(const pbes_expression &x) const
void operator()(pbes_expression &result, const pbes_expression &x, const PbesSubstitution &sigma) const