mCRL2
Loading...
Searching...
No Matches
bqnf_visitor.h
Go to the documentation of this file.
1// Author(s): Gijs Kant
2// Copyright: see the accompanying file COPYING or copy at
3// https://github.com/mCRL2org/mCRL2/blob/master/COPYING
4//
5// Distributed under the Boost Software License, Version 1.0.
6// (See accompanying file LICENSE_1_0.txt or copy at
7// http://www.boost.org/LICENSE_1_0.txt)
8//
9/// \file mcrl2/pbes/detail/bqnf_visitor.h
10/// \brief Visitor class for PBESs in Bounded Quantifier Normal Form (BQNF):
11/// BQNF :== forall d: D . b => BQNF | exists d: D . b && BQNF | CONJ
12/// CONJ :== And_{k: K} f_k && And_{i: I} forall v: D_I . g_i => DISJ^i
13/// DISJ^i :== Or_{l: L_i} f_{il} || Or_{j: J_i} exists w: D_{ij} . g_{ij} && X_{ij}(e_{ij})
14///
15/// DEPRECATED
16#ifndef MCRL2_PBES_DETAIL_BQNF_VISITOR_H
17#define MCRL2_PBES_DETAIL_BQNF_VISITOR_H
18
19#include "mcrl2/pbes/pbes_functions.h"
20
21
22
23
24
25namespace mcrl2::pbes_system::detail {
26
27/// \brief The current indent level. Used for debug output.
28static int indent_count = 0;
29/// \brief Increases the current indent level.
30static void inc_indent()
31{
33}
34/// \brief Decreases the current indent level.
35static void dec_indent()
36{
38}
39
40/// \brief Indents according to the current indent level.
41static void indent()
42{
43 for(int i=0;i<indent_count;i++)
44 {
45 std::clog << " ";
46 }
47}
48
49/// \brief A visitor class for PBES equations in BQNF. There is a visit_<node>
50/// function for each type of node. By default these functions do nothing, but check
51/// that the PBES equations are indeed in BQNF, so they
52/// must be overridden in order to add behaviour.
54{
55 /// \brief flag that indicates if debug output should be printed.
56 bool debug = false;
57
58 /// \brief Returns a string representation of the type of the root node of the expression.
59 /// \param e a PBES expression
60 /// \return a string representation of the type of the root node of the expression.
62 {
64 return std::string("PropVar ") + std::string(atermpp::down_cast<propositional_variable_instantiation>(e).name());
65 } else if (is_simple_expression(e, false)) {
66 return "SimpleExpr";
67 } else if (is_and(e)) {
68 return "And";
69 } else if (is_or(e)) {
70 return "Or";
71 } else if (is_imp(e)) {
72 return "Imp";
73 } else if (is_forall(e)) {
74 return std::string("ForAll(")+core::pp(atermpp::down_cast<forall>(e).variables())+std::string(")");
75 } else if (is_exists(e)) {
76 return std::string("Exists(")+core::pp(atermpp::down_cast<exists>(e).variables())+std::string(")");
77 } else {
78 return "Unknown type";
79 }
80 }
81
82 /// \brief Determines if an expression if of the form
83 /// phi /\ psi where phi is a simple expression
84 /// and psi is an arbitrary expression.
85 /// \param e an expression
86 /// \return true if e is of the form phi /\ psi.
87 static bool is_inner_and(const pbes_expression& e)
88 {
89 bool result = true;
90 if (!(is_propositional_variable_instantiation(e) || is_simple_expression(e, false))) {
91 if (is_and(e)) {
94 if (is_simple_expression(l, false)) {
95 result = is_inner_and(r);
96 } else {
97 result = false;
98 }
99 } else {
100 result = false;
101 }
102 }
103 return result;
104 }
105
106 /// \brief Determines if an expression if of the form
107 /// phi => psi or of the form phi \/ psi where phi is a simple expression
108 /// and psi is an arbitrary expression.
109 /// \param e an expression
110 /// \return true if e is of the form phi => psi or phi \/ psi.
111 static bool is_inner_implies(const pbes_expression& e)
112 {
113 bool result = true;
114 if (!(is_propositional_variable_instantiation(e) || is_simple_expression(e, false))) {
115 if (is_or(e) || is_imp(e)) {
118 if (is_simple_expression(l, false)) {
119 result = is_inner_implies(r);
120 } else {
121 result = false;
122 }
123 } else {
124 result = false;
125 }
126 }
127 return result;
128 }
129
130 /// \brief Destructor.
131 virtual ~bqnf_visitor() = default;
132
133 /// \brief Visits a simple expression.
134 /// An expression is simple if it does not contain propositional variables.
135 /// \param sigma fixpoint symbol (unused in this class)
136 /// \param var propositional variable (unused in this class)
137 /// \param e a PBES expression
138 /// \return true if the expression e is a simple expression.
139 virtual bool visit_simple_expression(const fixpoint_symbol& sigma, const propositional_variable& var, const pbes_expression& e)
140 {
141 bool result = true;
142 if (is_data(e) || is_true(e) || is_false(e)) {
143 result = true;
144 } else if (is_not(e)) {
146 result &= visit_simple_expression(sigma, var, n);
147 } else if (is_and(e) || is_or(e) || is_imp(e)) {
150 result &= visit_simple_expression(sigma, var, l);
151 result &= visit_simple_expression(sigma, var, r);
152 } else if (is_forall(e) || is_exists(e)) {
154 result &= visit_simple_expression(sigma, var, a);
156 if (debug) {
157 indent(); std::clog << "Not a simple expression!" << std::endl;
158 } else {
159 throw(std::runtime_error("Not a simple expression!"));
160 }
161 } else {
162 throw(std::runtime_error("Unknown type of expression!"));
163 }
164 if (debug) {
165 indent(); std::clog << "visit_simple_expression: " << pp(e) << ": " << (result?"true":"false") << std::endl;
166 }
167 return result;
168 }
169
170 /// \brief Visits a propositional variable expression.
171 /// \param sigma fixpoint symbol (unused in this class)
172 /// \param var propositional variable (unused in this class)
173 /// \param e PBES expression
174 /// \return true if the expression is a propositional variable or a simple expression.
175 virtual bool visit_propositional_variable(const fixpoint_symbol& /*sigma*/, const propositional_variable& /*var*/, const pbes_expression& e)
176 {
178 bool result = true;
179 if (is_propositional_variable_instantiation(e) || is_simple_expression(e, false)) {
180 } else {
181 result = false;
182 if (debug) {
183 indent(); std::clog << "Not a propositional variable or simple expression:" << core::pp(e) << std::endl;
184 } else {
185 throw(std::runtime_error("Not a propositional variable or simple expression!"));
186 }
187 }
188 if (debug) {
189 indent(); std::clog << " visit_propositional_variable: " << print_brief(e) << ": " << (result?"true":"false") << std::endl;
190 }
192 return result;
193 }
194
195 /// \brief Visits a conjunctive expression within an inner existential quantifier expression.
196 /// \param sigma fixpoint symbol (unused in this class)
197 /// \param var propositional variable (unused in this class)
198 /// \param e a PBES expression
199 /// \return true if the expression e conforms to BQNF.
200 virtual bool visit_inner_and(const fixpoint_symbol& sigma, const propositional_variable& var, const pbes_expression& e)
201 {
203 bool result = true;
204 if (is_and(e)) {
207 if (is_simple_expression(l, false)) {
208 result &= visit_simple_expression(sigma, var, l);
209 result &= visit_inner_and(sigma, var, r);
210 } else {
211 result &= visit_propositional_variable(sigma, var, e);
212 }
213 } else {
214 result &= visit_propositional_variable(sigma, var, e);
215 }
216 if (debug) {
217 indent(); std::clog << " visit_inner_and: " << print_brief(e) << ": " << (result?"true":"false") << std::endl;
218 }
220 return result;
221 }
222
223 /// \brief Visits a bounded existential quantifier expression within a disjunctive expression.
224 /// \param sigma fixpoint symbol (unused in this class)
225 /// \param var propositional variable (unused in this class)
226 /// \param e a PBES expression
227 /// \return true if the expression e conforms to BQNF.
229 {
231 pbes_expression qexpr = e;
232 data::variable_list qvars;
233 while (is_exists(qexpr)) {
234 qvars = qvars + atermpp::down_cast<exists>(qexpr).variables();
236 }
237 bool result = visit_inner_and(sigma, var, qexpr);
238 if (debug) {
239 indent(); std::clog << "visit_inner_bounded_exists: " << print_brief(e) << ": " << (result?"true":"false") << std::endl;
240 }
242 return result;
243 }
244
245 /// \brief Visits a disjunctive expression.
246 /// \param sigma fixpoint symbol (unused in this class)
247 /// \param var propositional variable (unused in this class)
248 /// \param e a PBES expression
249 /// \return true if the expression e conforms to BQNF.
250 virtual bool visit_or(const fixpoint_symbol& sigma, const propositional_variable& var, const pbes_expression& e)
251 {
253 bool result = true;
254 if (is_or(e) || is_imp(e)) {
257 result &= visit_or(sigma, var, l);
258 result &= visit_or(sigma, var, r);
259 } else {
260 result &= visit_inner_bounded_exists(sigma, var, e);
261 }
262 if (debug) {
263 indent(); std::clog << "visit_or: " << print_brief(e) << ": " << (result?"true":"false") << std::endl;
264 }
266 return result;
267 }
268
269 /// \brief Visits a bounded universal quantifier expression within a conjunctive expression.
270 /// \param sigma fixpoint symbol (unused in this class)
271 /// \param var propositional variable (unused in this class)
272 /// \param e a PBES expression
273 /// \return true if the expression e conforms to BQNF.
275 {
277 pbes_expression qexpr = e;
278 data::variable_list qvars;
279 while (is_forall(qexpr)) {
280 qvars = qvars + atermpp::down_cast<forall>(qexpr).variables();
282 }
283 bool result = true;
284 if (is_or(qexpr) || is_imp(qexpr)) {
287 if (is_simple_expression(l, false)) {
288 result &= visit_simple_expression(sigma, var, l);
289 result &= visit_or(sigma, var, r);
290 } else {
291 result &= visit_or(sigma, var, qexpr);
292 }
293 } else {
294 result &= visit_or(sigma, var, qexpr);
295 }
296 if (debug) {
297 indent(); std::clog << "visit_inner_bounded_forall: " << print_brief(e) << ": " << (result?"true":"false") << std::endl;
298 }
300 return result;
301 }
302
303 /// \brief Visits a conjunctive expression.
304 /// \param sigma fixpoint symbol (unused in this class)
305 /// \param var propositional variable (unused in this class)
306 /// \param e a PBES expression
307 /// \return true if the expression e conforms to BQNF.
308 virtual bool visit_and(const fixpoint_symbol& sigma, const propositional_variable& var, const pbes_expression& e)
309 {
311 bool result = true;
312 if (is_and(e)) {
315 result &= visit_and(sigma, var, l);
316 result &= visit_and(sigma, var, r);
317 } else {
318 result &= visit_inner_bounded_forall(sigma, var, e);
319 }
320 if (debug) {
321 indent(); std::clog << "visit_and: " << print_brief(e) << ": " << (result?"true":"false") << std::endl;
322 }
324 return result;
325 }
326
327 /// \brief Visits a bounded universal quantifier expression.
328 /// \param sigma fixpoint symbol (unused in this class)
329 /// \param var propositional variable (unused in this class)
330 /// \param e a PBES expression
331 /// \return true if the expression e conforms to BQNF.
332 virtual bool visit_bounded_forall(const fixpoint_symbol& sigma, const propositional_variable& var, const pbes_expression& e)
333 {
335 assert(is_forall(e));
336 pbes_expression qexpr = e;
337 data::variable_list qvars;
338 while (is_forall(qexpr)) {
339 qvars = qvars + atermpp::down_cast<forall>(qexpr).variables();
341 }
342 bool result = true;
343 if (is_or(qexpr) || is_imp(qexpr)) {
346 if (is_simple_expression(l, false)) {
347 result &= visit_simple_expression(sigma, var, l);
348 result &= visit_bqnf_expression(sigma, var, r);
349 } else {
350 result &= visit_bqnf_expression(sigma, var, qexpr);
351 }
352 } else {
353 result &= visit_bqnf_expression(sigma, var, qexpr);
354 }
355 if (debug) {
356 indent(); std::clog << "visit_bounded_forall: " << print_brief(e) << ": " << (result?"true":"false") << std::endl;
357 }
359 return result;
360 }
361
362 /// \brief Visits a bounded existential quantifier expression.
363 /// \param sigma fixpoint symbol (unused in this class)
364 /// \param var propositional variable (unused in this class)
365 /// \param e a PBES expression
366 /// \return true if the expression e conforms to BQNF.
367 virtual bool visit_bounded_exists(const fixpoint_symbol& sigma, const propositional_variable& var, const pbes_expression& e)
368 {
370 assert(is_exists(e));
371 pbes_expression qexpr = e;
372 data::variable_list qvars;
373 while (is_exists(qexpr)) {
374 qvars = qvars + atermpp::down_cast<exists>(qexpr).variables();
376 }
377 bool result = true;
378 if (is_and(qexpr)) {
381 if (is_simple_expression(l, false)) {
382 result &= visit_simple_expression(sigma, var, l);
383 result &= visit_bqnf_expression(sigma, var, r);
384 } else {
385 result &= visit_bqnf_expression(sigma, var, qexpr);
386 }
387 } else {
388 result &= visit_bqnf_expression(sigma, var, qexpr);
389 }
390 if (debug) {
391 indent(); std::clog << "visit_bounded_exists: " << print_brief(e) << ": " << (result?"true":"false") << std::endl;
392 }
394 return result;
395 }
396
397 /// \brief Visits a bounded quantifier expression.
398 /// \param sigma fixpoint symbol (unused in this class)
399 /// \param var propositional variable (unused in this class)
400 /// \param e a PBES expression
401 /// \return true if the expression e conforms to BQNF.
403 {
405 bool result = true;
406 if (is_forall(e)) {
407 result &= visit_bounded_forall(sigma, var, e);
408 } else if (is_exists(e)) {
409 result &= visit_bounded_exists(sigma, var, e);
410 } else {
411 // should not be possible
412 throw(std::runtime_error("Not a quantifier expression!"));
413 }
414 if (debug) {
415 indent(); std::clog << "visit_bounded_quantifier: " << print_brief(e) << ": " << (result?"true":"false") << std::endl;
416 }
418 return result;
419 }
420
421 /// \brief Visits a BQNF expression.
422 /// \param sigma fixpoint symbol (unused in this class)
423 /// \param var propositional variable (unused in this class)
424 /// \param e a PBES expression
425 /// \return true if the expression e is in BQNF.
426 virtual bool visit_bqnf_expression(const fixpoint_symbol& sigma, const propositional_variable& var, const pbes_expression& e)
427 {
429 bool result = true;
430 if (is_simple_expression(e, false)) {
431 result = true;
432 } else if (is_forall(e) || is_exists(e)) {
433 result &= visit_bounded_quantifier(sigma, var, e);
434 } else {
435 result &= visit_and(sigma, var, e);
436 }
437 if (debug) {
438 indent(); std::clog << "visit_bqnf_expression: " << print_brief(e) << ": " << (result?"true":"false") << std::endl;
439 }
441 return result;
442 }
443
444 /// \brief Visits a BQNF expression.
445 /// In the current BQNF visitor sigma and var parameters are added for use in bqnf2ppg_rewriter.
446 /// This functions adds dummy values for sigma and var.
447 /// \param e a PBES expression
448 /// \return true if the expression e is in BQNF.
450 {
451 bool result = visit_bqnf_expression(fixpoint_symbol::nu(), propositional_variable(core::identifier_string("X"), data::variable_list()), e);
452 return result;
453 }
454
455 /// \brief Visits a BQNF equation.
456 /// \param eqn a PBES equation
457 /// \return true if the right hand side of the equation is in BQNF.
458 virtual bool visit_bqnf_equation(const pbes_equation& eqn)
459 {
460 if (debug)
461 {
462 std::clog << "visit_bqnf_equation." << std::endl;
463 }
464 const fixpoint_symbol& sigma = eqn.symbol();
465 const propositional_variable& var = eqn.variable();
466 const pbes_expression& e = eqn.formula();
467 bool result = visit_bqnf_expression(sigma, var, e);
468 if (debug)
469 {
470 std::clog << "visit_bqnf_equation: equation " << var.name() << " is " << (result ? "" : "NOT ") << "in BQNF."
471 << std::endl;
472 }
473 return result;
474 }
475
476 /// \brief Visits a BQNF equation in debug mode.
477 /// \param eqn a PBES equation
478 /// \return true if the right hand side of the equation is in BQNF.
480 {
481 debug = true;
482 return visit_bqnf_equation(eqn);
483 }
484
485};
486
487} // namespace mcrl2::pbes_system::detail
488
489
490
491
492
493#endif // MCRL2_PBES_DETAIL_BQNF_VISITOR_H
A unordered_map class in which aterms can be stored.
Components for generating an arbitrary element of a sort.
representative_generator(const data_specification &specification)
Constructor with data specification as context.
propositional_variable_instantiation get_initial_state() override
Returns the initial state, rewritten and simplified.
pbes_expression rewrite_and_simplify_expression(const pbes_expression &e, const bool=true)
Rewrites and simplifies an expression.
virtual bool visit_inner_bounded_exists(const pbes_expression &e)
Visits a bounded existential quantifier expression within a disjunctive expression.
Definition ppg_visitor.h:88
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.
Definition ppg_visitor.h:38
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.
Definition ppg_visitor.h:56
virtual bool visit_inner_and(const pbes_expression &e)
Visits a conjunctive expression within an inner existential quantifier expression.
Definition ppg_visitor.h:68
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.
Definition ppg_visitor.h:47
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...
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....
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.
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....
detail::pbes_greybox_interface * pgg
the PBES greybox interface
static fixpoint_symbol nu()
Returns the nu symbol.
fixpoint_symbol & operator=(fixpoint_symbol &&) noexcept=default
static fixpoint_symbol mu()
Returns the mu symbol.
bool is_write_dependent_propvar(int group)
Determines if group is write dependent on the propositional variable. Returns true if propositional v...
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 &params)
Converts a variable_sequence_type into a sequence of indices of parameter signatures in the list of p...
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
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.
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...
detail::pbes_greybox_interface * pgg
bool is_read_dependent_propvar(int group)
Determines if group is read dependent on the propositional variable. Returns true,...
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.
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...
int get_number_of_groups() const
Returns the number of transition groups.
std::map< int, int > get_param_index_positions(const data::variable_list &params)
Converts a variable_sequence_type into a map from indices of parameter signatures (in the list of par...
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::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.
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.
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::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.
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.
const std::vector< std::string > & get_state_label_types() const
Returns the sequence of state label types.
std::size_t get_number_of_edge_labels() const
Returns the number of edge labels.
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::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.
Class for generating a BES from a PBES. This BES can be interpreted as a graph corresponding to a par...
operation_type
The operation type of the vertices.
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=(const pbes_expression &) noexcept=default
parameterized boolean equation system
Definition pbes.h:54
propositional_variable_instantiation & initial_state()
Returns the initial state.
Definition pbes.h:194
\brief A propositional variable instantiation
const data::data_expression_list & parameters() const
\brief A propositional variable declaration
propositional_variable(const core::identifier_string &name, const data::variable_list &parameters)
\brief Constructor Z12.
#define mCRL2log(LEVEL)
mCRL2log(LEVEL) provides the stream used to log.
Definition logger.h:435
atermpp::aterm remove_index(const atermpp::aterm &x)
Definition io.h:50
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.
static void inc_indent()
Increases the current indent level.
static void indent()
Indents according to the current indent level.
static void dec_indent()
Decreases the current indent level.
static int indent_count
The current indent level. Used for debug output.
MapContainer::mapped_type map_at(const MapContainer &m, typename MapContainer::key_type key)
bool is_data(const pbes_expression &t)
Returns true if the term t is a data expression.
const pbes_expression & true_()
bool is_not(const atermpp::aterm &x)
bool is_exists(const atermpp::aterm &x)
bool is_or(const atermpp::aterm &x)
bool is_forall(const atermpp::aterm &x)
bool is_false(const pbes_expression &t)
Test for the value false.
bool is_propositional_variable_instantiation(const atermpp::aterm &x)
bool is_and(const atermpp::aterm &x)
bool is_imp(const atermpp::aterm &x)
bool is_true(const pbes_expression &t)
Test for the value true.
const pbes_expression & false_()
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.