mCRL2
Loading...
Searching...
No Matches
typecheck.h
Go to the documentation of this file.
1// Author(s): Wieger Wesselink
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/modal_formula/typecheck.h
10/// \brief add your file description here.
11
12#ifndef MCRL2_MODAL_FORMULA_TYPECHECK_H
13#define MCRL2_MODAL_FORMULA_TYPECHECK_H
14
15#include "mcrl2/lps/typecheck.h"
16#include "mcrl2/modal_formula/detail/state_variable_context.h"
17#include "mcrl2/modal_formula/is_monotonous.h"
18#include "mcrl2/modal_formula/normalize_sorts.h"
19
20namespace mcrl2
21{
22
23namespace action_formulas
24{
25
26namespace detail
27{
28
30{
32 using super::apply;
33
37
39 const data::detail::variable_context& variable_context,
40 const process::detail::action_context& action_context
41 )
42 : m_data_type_checker(data_typechecker),
44 m_action_context(action_context)
45 {}
46
48 {
49 return process::typecheck_action(name, parameters, m_data_type_checker, m_variable_context, m_action_context);
50 }
51
52 template <class T>
53 void apply(T& result, const data::data_expression& x)
54 {
55 result = m_data_type_checker.typecheck_data_expression(x, data::sort_bool::bool_(), m_variable_context);
56 }
57
58 template <class T>
59 void apply(T& result, const action_formulas::at& x)
60 {
61 data::data_expression new_time = m_data_type_checker.typecheck_data_expression(x.time_stamp(), data::sort_real::real_(), m_variable_context);
62 make_at(result, [&](action_formula& r){ (*this).apply(r, x.operand()); }, new_time);
63 }
64
65 template <class T>
66 void apply(T& result, const process::untyped_multi_action& x)
67 {
68 // If x has size 1, first try to type check it as a data expression.
69 if (x.actions().size() == 1)
70 {
71 const data::untyped_data_parameter& y = x.actions().front();
72 try
73 {
74 result = data::typecheck_untyped_data_parameter(m_data_type_checker, y.name(), y.arguments(), data::sort_bool::bool_(), m_variable_context);
75 return;
76 }
77 catch (mcrl2::runtime_error& )
78 {
79 // skip
80 }
81 }
82 // Type check it as a multi action
83 process::action_list new_arguments;
84 for (const data::untyped_data_parameter& a: x.actions())
85 {
86 new_arguments.push_front(typecheck_action(a.name(), a.arguments()));
87 }
88 new_arguments = atermpp::reverse(new_arguments);
89 result = action_formulas::multi_action(new_arguments);
90 }
91
92 template <class T>
93 void apply(T& result, const action_formulas::forall& x)
94 {
95 try
96 {
97 auto m_variable_context_copy = m_variable_context;
98 m_variable_context.add_context_variables(x.variables(), m_data_type_checker);
99 action_formula body;
100 (*this).apply(body, x.body());
101 m_variable_context = m_variable_context_copy;
102 result = forall(x.variables(), body);
103 }
104 catch (mcrl2::runtime_error& e)
105 {
106 throw mcrl2::runtime_error(std::string(e.what()) + "\nwhile typechecking " + action_formulas::pp(x));
107 }
108 }
109
110 template <class T>
111 void apply(T& result, const action_formulas::exists& x)
112 {
113 try
114 {
115 auto m_variable_context_copy = m_variable_context;
116 m_variable_context.add_context_variables(x.variables(), m_data_type_checker);
117 action_formula body;
118 (*this).apply(body, x.body());
119 m_variable_context = m_variable_context_copy;
120 result = exists(x.variables(), body);
121 }
122 catch (mcrl2::runtime_error& e)
123 {
124 throw mcrl2::runtime_error(std::string(e.what()) + "\nwhile typechecking " + action_formulas::pp(x));
125 }
126 }
127};
128
129inline
131 data::data_type_checker& data_typechecker,
132 const data::detail::variable_context& variables,
133 const process::detail::action_context& actions
134 )
135{
136 return typecheck_builder(data_typechecker, variables, actions);
137}
138
139} // namespace detail
140
141template <typename ActionLabelContainer = std::vector<state_formulas::variable>, typename VariableContainer = std::vector<data::variable> >
143 const data::data_specification& dataspec,
144 const VariableContainer& variables,
145 const ActionLabelContainer& actions
146 )
147{
148 data::data_type_checker data_typechecker(dataspec);
149 data::detail::variable_context variable_context;
150 variable_context.add_context_variables(variables, data_typechecker);
151 process::detail::action_context action_context;
152 action_context.add_context_action_labels(actions, data_typechecker);
153 action_formula result;
154 detail::make_typecheck_builder(data_typechecker, variable_context, action_context).
155 apply(result, action_formulas::normalize_sorts(x, data_typechecker.typechecked_data_specification()));
156 return result;
157}
158
159inline
161{
162 return typecheck_action_formula(x, lpsspec.data(), lpsspec.global_variables(), lpsspec.action_labels());
163}
164
165} // namespace action_formulas
166
167namespace regular_formulas
168{
169
170namespace detail
171{
172
174{
176 using super::apply;
177
181
183 const data::detail::variable_context& variables,
184 const process::detail::action_context& actions
185 )
186 : m_data_type_checker(data_typechecker),
187 m_variable_context(variables),
188 m_action_context(actions)
189 {}
190
192 {
193 const data::sort_expression& s = atermpp::down_cast<data::application>(left).head().sort();
194 const data::container_sort& cs = atermpp::down_cast<data::container_sort>(s);
196 }
197
199 {
200 const data::sort_expression& s = atermpp::down_cast<data::application>(left).head().sort();
201 const data::container_sort& cs = atermpp::down_cast<data::container_sort>(s);
203 }
204
206 {
207 const data::sort_expression& s = atermpp::down_cast<data::application>(left).head().sort();
208 const data::container_sort& cs = atermpp::down_cast<data::container_sort>(s);
210 }
211
213 {
214 const data::sort_expression& s = atermpp::down_cast<data::application>(left).head().sort();
215 const data::container_sort& cs = atermpp::down_cast<data::container_sort>(s);
217 }
218
220 {
222 {
223 return data::sort_real::plus(left, right);
224 }
226 {
227 return data::sort_int::plus(left, right);
228 }
230 {
231 return data::sort_nat::plus(left, right);
232 }
234 {
235 return data::sort_pos::plus(left, right);
236 }
238 {
239 return make_bag_union(left, right);
240 }
242 {
243 return make_fbag_union(left, right);
244 }
246 {
247 return make_set_union(left, right);
248 }
250 {
251 return make_fset_union(left, right);
252 }
253 throw mcrl2::runtime_error("could not typecheck " + data::pp(left) + " + " + data::pp(right));
254 }
255
257 {
258 const data::sort_expression& s = atermpp::down_cast<data::application>(left).head().sort();
259 const data::container_sort& cs = atermpp::down_cast<data::container_sort>(s);
261 }
262
263 template <class T>
265 {
266 regular_formula left;
267 (*this).apply(left, x.left());
268 regular_formula right;
269 (*this).apply(right, x.right());
271 {
272 if (x.name() == core::identifier_string("."))
273 {
274 result = make_element_at(atermpp::down_cast<data::data_expression>(left), atermpp::down_cast<data::data_expression>(right));
275 }
276 else
277 {
278 result = make_plus(atermpp::down_cast<data::data_expression>(left), atermpp::down_cast<data::data_expression>(right));
279 }
280 }
281 else
282 {
283 if (x.name() == core::identifier_string("."))
284 {
285 result = seq(left, right);
286 }
287 else
288 {
289 result = alt(left, right);
290 }
291 }
292 }
293
294 /* Has to be a regular formula as result.... */
295 // template <class T>A
297 {
299 }
300};
301
302inline
304 data::data_type_checker& data_typechecker,
305 const data::detail::variable_context& variables,
306 const process::detail::action_context& actions
307 )
308{
309 return typecheck_builder(data_typechecker, variables, actions);
310}
311
312} // namespace detail
313
314template <typename ActionLabelContainer = std::vector<state_formulas::variable>, typename VariableContainer = std::vector<data::variable> >
316 const data::data_specification& dataspec,
317 const VariableContainer& variables,
318 const ActionLabelContainer& actions
319 )
320{
321 data::data_type_checker data_typechecker(dataspec);
322 data::detail::variable_context variable_context;
323 variable_context.add_context_variables(variables, data_typechecker);
324 process::detail::action_context action_context;
325 action_context.add_context_action_labels(actions, data_typechecker);
326 regular_formula result;
327 detail::make_typecheck_builder(data_typechecker, variable_context, action_context).
328 apply(result, regular_formulas::normalize_sorts(x, data_typechecker.typechecked_data_specification()));
329 return result;
330}
331
332inline
334{
335 return typecheck_regular_formula(x, lpsspec.data(), lpsspec.global_variables(), lpsspec.action_labels());
336}
337
338} // namespace regular_formulas
339
340namespace state_formulas
341{
342
343namespace detail
344{
345
347{
349 using super::apply;
350
355 const bool m_formula_is_quantitative; // If true, allow real values, otherwise restrict to a boolean formula.
356
358 const data::detail::variable_context& variable_context,
359 const process::detail::action_context& action_context,
360 const detail::state_variable_context& state_variable_context,
361 const bool formula_is_quantitative
362 )
363 : m_data_type_checker(data_typechecker),
365 m_action_context(action_context),
367 m_formula_is_quantitative(formula_is_quantitative)
368 {}
369
370 template <class T>
371 void apply(T& result, const data::data_expression& x)
372 {
374 {
375 try
376 {
377 result = m_data_type_checker.typecheck_data_expression(x, data::sort_real::real_(), m_variable_context);
378 }
379 catch (mcrl2::runtime_error& e1)
380 {
381 try
382 {
383 result = m_data_type_checker.typecheck_data_expression(x, data::sort_bool::bool_(), m_variable_context);
384 }
385 catch (mcrl2::runtime_error& e2)
386 {
387 throw mcrl2::runtime_error("Fail to type data expression as bool or real: " + pp(x) + ".\n" +
388 e1.what() + "\n" +
389 e2.what());
390 }
391 }
392 }
393 else
394 {
395 result = m_data_type_checker.typecheck_data_expression(x, data::sort_bool::bool_(), m_variable_context);
396 }
397 }
398
399 template <class T>
400 void apply(T& result, const state_formulas::forall& x)
401 {
403 {
404 throw mcrl2::runtime_error("Forall is not allowed to capture values in a quantitative modal formula " + state_formulas::pp(x) + ". Use inf for infimum instead. ");
405 }
406 else
407 {
408 try
409 {
410 auto m_variable_context_copy = m_variable_context;
411 m_variable_context.add_context_variables(x.variables(), m_data_type_checker);
412 state_formula body;
413 (*this).apply(body, x.body());
414 m_variable_context = m_variable_context_copy;
415 result = forall(x.variables(), body);
416 }
417 catch (mcrl2::runtime_error& e)
418 {
419 throw mcrl2::runtime_error(std::string(e.what()) + "\nwhile typechecking " + state_formulas::pp(x));
420 }
421 }
422 }
423
424 template <class T>
425 void apply(T& result, const state_formulas::exists& x)
426 {
428 {
429 throw mcrl2::runtime_error("Exists is not allowed to capture values in a quantitative modal formula " + state_formulas::pp(x) + ". Use sup for supremum instead. ");
430 }
431 else
432 {
433 try
434 {
435 auto m_variable_context_copy = m_variable_context;
436 m_variable_context.add_context_variables(x.variables(), m_data_type_checker);
437 state_formula body;
438 (*this).apply(body, x.body());
439 m_variable_context = m_variable_context_copy;
440 result = exists(x.variables(), body);
441 }
442 catch (mcrl2::runtime_error& e)
443 {
444 throw mcrl2::runtime_error(std::string(e.what()) + "\nwhile typechecking " + state_formulas::pp(x));
445 }
446 }
447 }
448
449 template <class T>
450 void apply(T& result, const state_formulas::infimum& x)
451 {
453 {
454 throw mcrl2::runtime_error("Infimum is not allowed in an ordinary, non quantitative modal formula " + state_formulas::pp(x) + ". Use forall instead. ");
455 }
456 else
457 {
458 try
459 {
460 auto m_variable_context_copy = m_variable_context;
461 m_variable_context.add_context_variables(x.variables(), m_data_type_checker);
462 state_formula body;
463 (*this).apply(body, x.body());
464 m_variable_context = m_variable_context_copy;
465 result = infimum(x.variables(), body);
466 }
467 catch (mcrl2::runtime_error& e)
468 {
469 throw mcrl2::runtime_error(std::string(e.what()) + "\nwhile typechecking " + state_formulas::pp(x));
470 }
471 }
472 }
473
474 template <class T>
475 void apply(T& result, const state_formulas::supremum& x)
476 {
478 {
479 throw mcrl2::runtime_error("Supremum is not allowed in an ordinary, non quantitative modal formula " + state_formulas::pp(x) + ". Use exists instead. ");
480 }
481 else
482 {
483 try
484 {
485 auto m_variable_context_copy = m_variable_context;
486 m_variable_context.add_context_variables(x.variables(), m_data_type_checker);
487 state_formula body;
488 (*this).apply(body, x.body());
489 m_variable_context = m_variable_context_copy;
490 result = supremum(x.variables(), body);
491 }
492 catch (mcrl2::runtime_error& e)
493 {
494 throw mcrl2::runtime_error(std::string(e.what()) + "\nwhile typechecking " + state_formulas::pp(x));
495 }
496 }
497 }
498
499 template <class T>
500 void apply(T& result, const state_formulas::sum& x)
501 {
503 {
504 throw mcrl2::runtime_error("Sum is not allowed in an ordinary, non quantitative modal formula " + state_formulas::pp(x) + ". ");
505 }
506 else
507 {
508 try
509 {
510 auto m_variable_context_copy = m_variable_context;
511 m_variable_context.add_context_variables(x.variables(), m_data_type_checker);
512 state_formula body;
513 (*this).apply(body, x.body());
514 m_variable_context = m_variable_context_copy;
515 result = sum(x.variables(), body);
516 }
517 catch (mcrl2::runtime_error& e)
518 {
519 throw mcrl2::runtime_error(std::string(e.what()) + "\nwhile typechecking " + state_formulas::pp(x));
520 }
521 }
522 }
523
524 template <class T>
525 void apply(T& result, const state_formulas::may& x)
526 {
528 regular_formulas::detail::make_typecheck_builder(m_data_type_checker, m_variable_context, m_action_context).apply(formula, x.formula());
529 state_formula operand;
530 (*this).apply(operand, x.operand());
531 make_may(result, formula, operand);
532 }
533
534 template <class T>
535 void apply(T& result, const state_formulas::must& x)
536 {
538 regular_formulas::detail::make_typecheck_builder(m_data_type_checker, m_variable_context, m_action_context).apply(formula, x.formula());
539 state_formula operand;
540 (*this).apply(operand, x.operand());
541 make_must(result, formula, operand);
542 }
543
544 template <class T>
545 void apply(T& result, const state_formulas::delay_timed& x)
546 {
547 data::data_expression new_time = m_data_type_checker.typecheck_data_expression(x.time_stamp(), data::sort_real::real_(), m_variable_context);
548 make_delay_timed(result, new_time);
549 }
550
551 template <class T>
552 void apply(T& result, const state_formulas::yaled_timed& x)
553 {
554 data::data_expression new_time = m_data_type_checker.typecheck_data_expression(x.time_stamp(), data::sort_real::real_(), m_variable_context);
555 make_yaled_timed(result, new_time);
556 }
557
559 {
560 data::sort_expression_list expected_sorts = m_state_variable_context.matching_state_variable_sorts(name, arguments);
561 data::data_expression_list new_arguments;
562 auto q1 = expected_sorts.begin();
563 auto q2 = arguments.begin();
564 for (; q1 != expected_sorts.end(); ++q1, ++q2)
565 {
566 new_arguments.push_front(m_data_type_checker.typecheck_data_expression(*q2, *q1, m_variable_context));
567 }
568 new_arguments = atermpp::reverse(new_arguments);
569 return state_formulas::variable(name, new_arguments);
570 }
571
572 template <class T>
573 void apply(T& result, const state_formulas::variable& x)
574 {
576 }
577
578 template <class T>
579 void apply(T& result, const data::untyped_data_parameter& x)
580 {
582 }
583
585 {
586 std::vector<data::variable> result;
587 for (const data::assignment& a: x)
588 {
589 result.push_back(a.lhs());
590 }
591 return data::variable_list(result.begin(), result.end());
592 }
593
594 template <typename MuNuFormula>
595 state_formula apply_mu_nu(const MuNuFormula& x, bool is_mu)
596 {
597 data::assignment_list new_assignments = m_data_type_checker.typecheck_assignment_list(x.assignments(), m_variable_context);
598
599 // add the assignment variables to the context
600 auto m_variable_context_copy = m_variable_context;
601 data::variable_list x_variables = assignment_variables(x.assignments());
602 m_variable_context.add_context_variables(x_variables, m_data_type_checker);
603
604 // add x to the state variable context
605 auto m_state_variable_context_copy = m_state_variable_context;
606 m_state_variable_context.add_state_variable(x.name(), x_variables, m_data_type_checker);
607
608 // typecheck the operand
609 state_formula new_operand;
610 (*this).apply(new_operand, x.operand());
611
612 // restore the context
613 m_variable_context = m_variable_context_copy;
614 m_state_variable_context = m_state_variable_context_copy;
615
616 if (is_mu)
617 {
618 return mu(x.name(), new_assignments, new_operand);
619 }
620 else
621 {
622 return nu(x.name(), new_assignments, new_operand);
623 }
624 }
625
626 template <class T>
627 void apply(T& result, const state_formulas::nu& x)
628 {
629 result = apply_mu_nu(x, false);
630 }
631
632 template <class T>
633 void apply(T& result, const state_formulas::mu& x)
634 {
635 result = apply_mu_nu(x, true);
636 }
637
638 template <class T>
639 void apply(T& result, const state_formulas::not_& x)
640 {
642 {
643 throw mcrl2::runtime_error("No ! allowed in a quantitative modal formula " + state_formulas::pp(x) + ".");
644 }
645 else
646 {
647 apply(result, static_cast<not_>(x).operand());
648 make_not_(result, result);
649 }
650 }
651
652 template <class T>
653 void apply(T& result, const state_formulas::minus& x)
654 {
656 {
657 throw mcrl2::runtime_error("No unary minus (-) allowed in a boolean modal formula " + state_formulas::pp(x) + ".");
658 }
659 else
660 {
661 apply(result, static_cast<minus>(x).operand());
662 make_minus(result, result);
663 }
664 }
665
666 template <class T>
667 void apply(T& result, const state_formulas::plus& x)
668 {
670 {
671 throw mcrl2::runtime_error("No addition (+) allowed in a boolean modal formula " + state_formulas::pp(x) + ".");
672 }
673 else
674 {
675 apply(result, static_cast<plus>(x).left());
676 state_formula rhs;
677 apply(rhs, static_cast<plus>(x).right());
678 make_plus(result, result, rhs);
679 }
680 }
681
682 template <class T>
683 void apply(T& result, const state_formulas::const_multiply& x)
684 {
686 {
687 throw mcrl2::runtime_error("No multiplication with a constant allowed in a boolean modal formula " + state_formulas::pp(x) + ".");
688 }
689 else
690 {
691 data::data_expression constant = m_data_type_checker.typecheck_data_expression(static_cast<const_multiply>(x).left(), data::sort_real::real_(), m_variable_context);
692 state_formula rhs;
693 apply(rhs, static_cast<const_multiply>(x).right());
694 make_const_multiply(result, constant, rhs);
695 }
696 }
697
698 template <class T>
699 void apply(T& result, const state_formulas::const_multiply_alt& x)
700 {
702 {
703 throw mcrl2::runtime_error("No multiplication with a constant allowed in a boolean modal formula " + state_formulas::pp(x) + ".");
704 }
705 else
706 {
707 state_formula lhs;
708 apply(lhs, static_cast<const_multiply_alt>(x).left());
709 data::data_expression constant = m_data_type_checker.typecheck_data_expression(static_cast<const_multiply_alt>(x).right(), data::sort_real::real_(), m_variable_context);
710 make_const_multiply_alt(result, lhs, constant);
711 }
712 }
713};
714
715inline
717 data::data_type_checker& data_typechecker,
718 const data::detail::variable_context& variable_context,
719 const process::detail::action_context& action_context,
720 const detail::state_variable_context& state_variable_context,
721 const bool formula_is_quantitative
722 )
723{
724 return typecheck_builder(data_typechecker, variable_context, action_context, state_variable_context, formula_is_quantitative);
725}
726
727} // namespace detail
728
730{
731 protected:
737
738 public:
739 /** \brief Constructor for a state_formula type checker.
740 * \param[in] dataspec The data specification against which state formulas are checked.
741 * \param[in] action_labels The data labels that can occur in a state formula.
742 * \param[in] variables A container containing variables that can occur in state formulas.
743 **/
744 template <typename ActionLabelContainer = std::vector<state_formulas::variable>, typename VariableContainer = std::vector<data::variable> >
746 const bool formula_is_quantitative,
747 const ActionLabelContainer& action_labels = ActionLabelContainer(),
748 const VariableContainer& variables = VariableContainer()
749 )
751 m_formula_is_quantitative(formula_is_quantitative)
752 {
753 m_variable_context.add_context_variables(variables, m_data_type_checker);
754 m_action_context.add_context_action_labels(action_labels, m_data_type_checker);
755 }
756
757 //check correctness of the state formula as follows:
758 //1) determine the types of actions according to the definitions
759 // in spec
760 //2) determine the types of data expressions according to the
761 // definitions in spec
762 //3) check for name conflicts of data variable declarations in
763 // forall, exists, mu and nu quantifiers
764 //4) check for monotonicity of fixpoint variables
766 {
767 mCRL2log(log::verbose) << "type checking state formula..." << std::endl;
768 state_formula result;
769 detail::make_typecheck_builder(m_data_type_checker, m_variable_context, m_action_context, m_state_variable_context, m_formula_is_quantitative).
770 apply(result, state_formulas::normalize_sorts(x, m_data_type_checker.typechecked_data_specification()));
771 return result;
772 }
773};
774
775/** \brief Type check a state formula.
776 * Throws an exception if something went wrong.
777 * \param[in] x A state formula that has not been type checked.
778 * \param[in] dataspec The data specification against which the formulas is checked.
779 * \param[in] action_labels A declaration of action labels that can be used in the state formulas.
780 * \param[in] variables A container with global data variables.
781 * \post formula is type checked.
782 **/
783template <typename VariableContainer, typename ActionLabelContainer>
785 const bool formula_is_quantitative,
787 const ActionLabelContainer& action_labels = ActionLabelContainer(),
788 const VariableContainer& variables = VariableContainer()
789 )
790{
791 try
792 {
793 state_formula_type_checker type_checker(dataspec, formula_is_quantitative, action_labels, variables);
794 return type_checker.typecheck_state_formula(x);
795 }
796 catch (mcrl2::runtime_error& e)
797 {
798 throw mcrl2::runtime_error(std::string(e.what()) + "\ncould not type check modal formula " + state_formulas::pp(x));
799 }
800}
801
802/** \brief Type check a state formula.
803 * Throws an exception if something went wrong.
804 * \param[in] x A state formula that has not been type checked.
805 * \param[in] lpsspec A linear process specifications containing data, action and global variable declarations
806 * to be used when typechecking the formula.
807 * \post formula is type checked.
808 **/
809inline
811 const lps::stochastic_specification& lpsspec,
812 const bool formula_is_quantitative
813 )
814{
815 return typecheck_state_formula(x, formula_is_quantitative, lpsspec.data(), lpsspec.action_labels(), lpsspec.global_variables());
816}
817
818/// \brief Typecheck the state formula specification formspec. It is assumed that the formula is self contained,
819/// i.e. all actions and sorts must be declared.
820inline
821void typecheck_state_formula_specification(state_formula_specification& formspec, const bool formula_is_quantitative)
822{
823 try
824 {
825 data::data_type_checker checker(formspec.data());
827 state_formulas::normalize_sorts(formspec, dataspec);
828 state_formula_type_checker type_checker(dataspec, formula_is_quantitative, formspec.action_labels(), std::vector<data::variable>());
829 formspec.formula() = type_checker.typecheck_state_formula(formspec.formula());
830 formspec.data() = checker.typechecked_data_specification();
831 formspec.data().translate_user_notation();
832 }
833 catch (mcrl2::runtime_error& e)
834 {
835 throw mcrl2::runtime_error(std::string(e.what()) + "\ncould not type check modal formula specification " + state_formulas::pp(formspec));
836 }
837}
838
839/// \brief Typecheck the state formula specification formspec. It is assumed that the formula is not self contained,
840/// i.e. some of the actions and sorts may be declared in lpsspec.
841inline
842void typecheck_state_formula_specification(state_formula_specification& formspec, const lps::stochastic_specification& lpsspec, const bool formula_is_quantitative)
843{
844 try
845 {
846 data::data_type_checker checker(formspec.data());
848 state_formulas::normalize_sorts(formspec, dataspec);
849 state_formula_type_checker type_checker(dataspec, formula_is_quantitative, lpsspec.action_labels() + formspec.action_labels(), lpsspec.global_variables());
850 formspec.formula() = type_checker.typecheck_state_formula(formspec.formula());
851 formspec.data() = checker.typechecked_data_specification();
852 formspec.data().translate_user_notation();
853 }
854 catch (mcrl2::runtime_error& e)
855 {
856 throw mcrl2::runtime_error(std::string(e.what()) + "\ncould not type check modal formula specification " + state_formulas::pp(formspec));
857 }
858}
859
860} // namespace state_formulas
861
862} // namespace mcrl2
863
864#endif // MCRL2_MODAL_FORMULA_TYPECHECK_H
aterm_string(const aterm_string &t) noexcept=default
aterm()
Default constructor.
Definition aterm.h:48
bool operator==(const unprotected_aterm_core &t) const
Comparison operator.
Definition aterm_core.h:83
\brief The and operator for action formulas
const action_formula & left() const
const action_formula & right() const
\brief The at operator for action formulas
const data::data_expression & time_stamp() const
const action_formula & operand() const
\brief The existential quantification operator for action formulas
const data::variable_list & variables() const
const action_formula & body() const
exists(const data::variable_list &variables, const action_formula &body)
\brief Constructor Z14.
\brief The value false for action formulas
\brief The universal quantification operator for action formulas
const action_formula & body() const
const data::variable_list & variables() const
forall(const data::variable_list &variables, const action_formula &body)
\brief Constructor Z14.
\brief The implication operator for action formulas
const action_formula & left() const
const action_formula & right() const
\brief The multi action for action formulas
const process::action_list & actions() const
\brief The not operator for action formulas
const action_formula & operand() const
\brief The or operator for action formulas
const action_formula & right() const
const action_formula & left() const
\brief The value true for action formulas
\brief A container sort
const sort_expression & element_sort() const
sort_expression sort() const
Returns the sort of the data expression.
Definition data.cpp:108
void translate_user_notation()
Translate user notation within the equations of the data specification.
data_equation_vector & user_defined_equations()
data_specification()
Default constructor. Generate a data specification that contains only booleans and positive numbers.
const data_specification operator()() const
Yields a type checked data specification, provided typechecking was successful. If not successful an ...
void operator()(data_equation_vector &eqns)
Yields a type checked equation list, and sets the types in the equations right. If not successful an ...
data_type_checker(const data_specification &data_spec)
make a data type checker. Throws a mcrl2::runtime_error exception if the data_specification is not we...
const data_specification & typechecked_data_specification() const
Definition typecheck.h:120
Identifier generator that stores the identifiers of the context in a set. Using the operator()() and ...
\brief A sort expression
const core::identifier_string & name() const
const data_expression_list & arguments() const
\brief A data variable
Definition variable.h:28
logger(const log_level_t l)
Default constructor.
Definition logger.h:164
Linear process specification.
stochastic_specification(const specification &other)
Constructor. This constructor is explicit as implicit conversions of this kind is a source of bugs.
\brief An untyped multi action or data application
\brief The alt operator for regular formulas
const regular_formula & right() const
alt(const regular_formula &left, const regular_formula &right)
\brief Constructor Z14.
const regular_formula & left() const
\brief The seq operator for regular formulas
seq(const regular_formula &left, const regular_formula &right)
\brief Constructor Z14.
const regular_formula & right() const
const regular_formula & left() const
\brief The 'trans or nil' operator for regular formulas
const regular_formula & operand() const
\brief The trans operator for regular formulas
const regular_formula & operand() const
\brief An untyped regular formula or action formula
const core::identifier_string & name() const
Standard exception class for reporting runtime errors.
Definition exception.h:27
\brief The and operator for state formulas
const state_formula & right() const
const state_formula & left() const
\brief The multiply operator for state formulas with values
const state_formula & left() const
const_multiply_alt(const const_multiply_alt &) noexcept=default
Move semantics.
const data::data_expression & right() const
\brief The multiply operator for state formulas with values
const data::data_expression & left() const
const_multiply(const const_multiply &) noexcept=default
Move semantics.
const state_formula & right() const
\brief The timed delay operator for state formulas
const data::data_expression & time_stamp() const
\brief The delay operator for state formulas
delay()
\brief Default constructor X3.
Traverser that checks for name clashes in parameters of nested mu's/nu's and forall/exists.
state_formulas::state_formula_traverser< state_formula_data_variable_name_clash_checker > super
void insert(const core::identifier_string &name, const state_formula &x)
state_formulas::data_expression_builder< state_formula_data_variable_name_clash_resolver > super
std::map< data::variable, std::vector< data::variable > > substitutions
data::assignment_list apply_assignments(const data::assignment_list &x)
state_formula_data_variable_name_clash_resolver(data::set_identifier_generator &generator_)
Traverser that checks for name clashes in nested mu's/nu's.
void push(const core::identifier_string &name)
Pushes name on the stack.
state_formulas::state_formula_traverser< state_variable_name_clash_checker > super
std::vector< core::identifier_string > m_name_stack
The stack of names.
utilities::number_postfix_generator m_generator
Generator for fresh variable names.
std::map< core::identifier_string, std::vector< core::identifier_string > > name_map
state_formulas::state_formula_builder< Derived > super
void pop(const core::identifier_string &name)
Pops the name of the stack.
void push(const core::identifier_string &name)
Pushes name on the stack.
\brief The existential quantification operator for state formulas
exists(const data::variable_list &variables, const state_formula &body)
\brief Constructor Z14.
const state_formula & body() const
const data::variable_list & variables() const
\brief The value false for state formulas
false_()
\brief Default constructor X3.
\brief The universal quantification operator for state formulas
const state_formula & body() const
const data::variable_list & variables() const
forall(const data::variable_list &variables, const state_formula &body)
\brief Constructor Z14.
\brief The implication operator for state formulas
const state_formula & left() const
const state_formula & right() const
\brief The infimum over a data type for state formulas
infimum(const data::variable_list &variables, const state_formula &body)
\brief Constructor Z14.
const data::variable_list & variables() const
const state_formula & body() const
\brief The may operator for state formulas
const state_formula & operand() const
const regular_formulas::regular_formula & formula() const
\brief The minus operator for state formulas
minus(const minus &) noexcept=default
Move semantics.
minus(const state_formula &operand)
\brief Constructor Z14.
const state_formula & operand() const
\brief The mu operator for state formulas
const core::identifier_string & name() const
const data::assignment_list & assignments() const
mu(const core::identifier_string &name, const data::assignment_list &assignments, const state_formula &operand)
\brief Constructor Z14.
const state_formula & operand() const
\brief The must operator for state formulas
const regular_formulas::regular_formula & formula() const
const state_formula & operand() const
\brief The not operator for state formulas
not_(const not_ &) noexcept=default
Move semantics.
const state_formula & operand() const
not_(const state_formula &operand)
\brief Constructor Z14.
\brief The nu operator for state formulas
nu(const core::identifier_string &name, const data::assignment_list &assignments, const state_formula &operand)
\brief Constructor Z14.
const core::identifier_string & name() const
const state_formula & operand() const
const data::assignment_list & assignments() const
\brief The or operator for state formulas
or_(const state_formula &left, const state_formula &right)
\brief Constructor Z14.
const state_formula & right() const
const state_formula & left() const
\brief The plus operator for state formulas with values
plus(const plus &) noexcept=default
Move semantics.
const state_formula & left() const
const state_formula & right() const
process::action_label_list m_action_labels
The action specification of the specification.
const state_formula & formula() const
Returns the formula of the state formula specification.
state_formula_specification(const state_formula &formula, const data::data_specification &data=data::data_specification(), const process::action_label_list &action_labels={})
Constructor of a state formula specification.
state_formula m_formula
The formula of the specification.
data::data_specification m_data
The data specification of the specification.
state_formula & formula()
Returns the formula of the state formula specification.
const process::action_label_list & action_labels() const
Returns the action label specification.
process::action_label_list & action_labels()
Returns the action label specification.
detail::state_variable_context m_state_variable_context
Definition typecheck.h:735
data::detail::variable_context m_variable_context
Definition typecheck.h:733
process::detail::action_context m_action_context
Definition typecheck.h:734
state_formula_type_checker(const data::data_specification &dataspec, const bool formula_is_quantitative, const ActionLabelContainer &action_labels=ActionLabelContainer(), const VariableContainer &variables=VariableContainer())
Constructor for a state_formula type checker.
Definition typecheck.h:745
state_formula typecheck_state_formula(const state_formula &x)
Definition typecheck.h:765
state_formula(const state_formula &) noexcept=default
Move semantics.
state_formula & operator=(state_formula &&) noexcept=default
state_formula(const atermpp::aterm &term)
state_formula & operator=(const state_formula &) noexcept=default
\brief The sum over a data type for state formulas
sum(const data::variable_list &variables, const state_formula &body)
\brief Constructor Z14.
const data::variable_list & variables() const
const state_formula & body() const
\brief The supremum over a data type for state formulas
const state_formula & body() const
const data::variable_list & variables() const
supremum(const data::variable_list &variables, const state_formula &body)
\brief Constructor Z14.
\brief The value true for state formulas
true_()
\brief Default constructor X3.
\brief The state formula variable
const core::identifier_string & name() const
const data::data_expression_list & arguments() const
\brief The timed yaled operator for state formulas
const data::data_expression & time_stamp() const
\brief The yaled operator for state formulas
yaled()
\brief Default constructor X3.
Identifier generator that generates names consisting of a prefix followed by a number....
D_ParserTables parser_tables_mcrl2
Definition dparser.cpp:20
#define mCRL2log(LEVEL)
mCRL2log(LEVEL) provides the stream used to log.
Definition logger.h:391
The main namespace for the aterm++ library.
Definition algorithm.h:21
action_formula parse_action_formula(const std::string &text)
typecheck_builder make_typecheck_builder(data::data_type_checker &data_typechecker, const data::detail::variable_context &variables, const process::detail::action_context &actions)
Definition typecheck.h:130
void translate_user_notation(T &x, typename std::enable_if< !std::is_base_of< atermpp::aterm, T >::value >::type *=0)
bool is_at(const atermpp::aterm &x)
std::string pp(const action_formulas::action_formula &x)
std::string pp(const action_formulas::exists &x)
action_formula typecheck_action_formula(const action_formula &x, const data::data_specification &dataspec, const VariableContainer &variables, const ActionLabelContainer &actions)
Definition typecheck.h:142
std::string pp(const action_formulas::and_ &x)
std::set< data::variable > find_all_variables(const action_formulas::action_formula &x)
action_formula parse_action_formula(const std::string &text, const data::data_specification &dataspec, const VariableContainer &variables, const ActionLabelContainer &actions)
Definition parse.h:37
std::string pp(const action_formulas::at &x)
bool is_or(const atermpp::aterm &x)
bool is_true(const atermpp::aterm &x)
bool is_forall(const atermpp::aterm &x)
std::string pp(const action_formulas::imp &x)
bool is_false(const atermpp::aterm &x)
action_formula typecheck_action_formula(const action_formula &x, const lps::stochastic_specification &lpsspec)
Definition typecheck.h:160
bool is_not(const atermpp::aterm &x)
std::string pp(const action_formulas::multi_action &x)
std::string pp(const action_formulas::or_ &x)
std::string pp(const action_formulas::forall &x)
bool is_imp(const atermpp::aterm &x)
bool is_and(const atermpp::aterm &x)
T translate_user_notation(const T &x, typename std::enable_if< std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
std::string pp(const action_formulas::not_ &x)
std::string pp(const action_formulas::false_ &x)
action_formula parse_action_formula(const std::string &text, const lps::stochastic_specification &lpsspec)
Definition parse.h:50
bool is_multi_action(const atermpp::aterm &x)
std::string pp(const action_formulas::true_ &x)
bool is_exists(const atermpp::aterm &x)
bool is_action_formula(const atermpp::aterm &x)
void syntax_error_fn(struct D_Parser *ap)
Custom syntax error function that prints both the line number and the column.
Definition dparser.cpp:463
D_ParseNode * ambiguity_fn(struct D_Parser *, int n, struct D_ParseNode **v)
Function for resolving parser ambiguities.
Definition dparser.cpp:332
void warn_left_merge_merge(const parse_node &)
Prints a warning for each occurrence of 'x ||_ y || z' in the parse tree.
atermpp::aterm_string identifier_string
String type of the LPS library. Identifier strings are represented internally as ATerms.
void warn_and_or(const parse_node &)
Prints a warning for each occurrence of 'x && y || z' in the parse tree.
Namespace for system defined sort bag.
Definition bag1.h:38
bool is_union_application(const atermpp::aterm &e)
Recogniser for application of +.
Definition bag1.h:495
application union_(const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Application of function symbol +.
Definition bag1.h:474
Namespace for system defined sort bool_.
Definition bool.h:32
const basic_sort & bool_()
Constructor for sort expression Bool.
Definition bool.h:44
application not_(const data_expression &arg0)
Application of function symbol !.
Definition bool.h:197
Namespace for system defined sort fbag.
Definition fbag1.h:37
application union_(const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Application of function symbol +.
Definition fbag1.h:558
bool is_union_application(const atermpp::aterm &e)
Recogniser for application of +.
Definition fbag1.h:579
Namespace for system defined sort fset.
Definition fset1.h:35
application union_(const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Application of function symbol +.
Definition fset1.h:490
bool is_union_application(const atermpp::aterm &e)
Recogniser for application of +.
Definition fset1.h:511
Namespace for system defined sort int_.
application plus(const data_expression &arg0, const data_expression &arg1)
Application of function symbol +.
Definition int1.h:1002
bool is_int(const sort_expression &e)
Recogniser for sort expression Int.
Definition int1.h:57
Namespace for system defined sort list.
Definition list1.h:36
application element_at(const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Application of function symbol ..
Definition list1.h:487
Namespace for system defined sort nat.
bool is_nat(const sort_expression &e)
Recogniser for sort expression Nat.
Definition nat1.h:56
application plus(const data_expression &arg0, const data_expression &arg1)
Application of function symbol +.
Definition nat1.h:882
Namespace for system defined sort pos.
bool is_pos(const sort_expression &e)
Recogniser for sort expression Pos.
Definition pos1.h:55
application plus(const data_expression &arg0, const data_expression &arg1)
Application of function symbol +.
Definition pos1.h:483
Namespace for system defined sort real_.
application negate(const data_expression &arg0)
Application of function symbol -.
Definition real1.h:857
bool is_real(const sort_expression &e)
Recogniser for sort expression Real.
Definition real1.h:58
application plus(const data_expression &arg0, const data_expression &arg1)
Application of function symbol +.
Definition real1.h:1115
Namespace for system defined sort set_.
Definition set1.h:36
bool is_union_application(const atermpp::aterm &e)
Recogniser for application of +.
Definition set1.h:483
application union_(const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Application of function symbol +.
Definition set1.h:462
Namespace for all data library functionality.
Definition data.cpp:22
bool is_data_expression(const atermpp::aterm &x)
Test for a data_expression expression.
data_specification merge_data_specifications(const data_specification &dataspec1, const data_specification &dataspec2)
Merges two data specifications. Throws an exception if conflicts are detected.
atermpp::term_list< sort_expression > sort_expression_list
\brief list of sort_expressions
atermpp::term_list< data_expression > data_expression_list
\brief list of data_expressions
bool is_untyped_data_parameter(const atermpp::aterm &x)
atermpp::term_list< variable > variable_list
\brief list of variables
atermpp::term_list< assignment > assignment_list
\brief list of assignments
Definition assignment.h:146
std::string pp(const data::data_expression &x)
Definition data.cpp:52
@ verbose
Definition logger.h:37
The main namespace for the LPS library.
Definition constelm.h:21
specification remove_stochastic_operators(const stochastic_specification &spec)
Converts a stochastic specification to a specification. Throws an exception if non-empty distribution...
The main namespace for the Process library.
atermpp::term_list< action_label > action_label_list
\brief list of action_labels
atermpp::term_list< action > action_list
\brief list of actions
bool is_untyped_multi_action(const atermpp::aterm &x)
state_formula translate_reg_frms(const state_formula &state_frm)
Translate regular formulas in terms of state and action formulas.
typecheck_builder make_typecheck_builder(data::data_type_checker &data_typechecker, const data::detail::variable_context &variables, const process::detail::action_context &actions)
Definition typecheck.h:303
regular_formula parse_regular_formula(const std::string &text)
std::string pp(const regular_formulas::regular_formula &x)
bool is_alt(const atermpp::aterm &x)
bool is_untyped_regular_formula(const atermpp::aterm &x)
regular_formula parse_regular_formula(const std::string &text, const data::data_specification &dataspec, const VariableContainer &variables, const ActionLabelContainer &actions)
Definition parse.h:68
bool is_trans(const atermpp::aterm &x)
regular_formula parse_regular_formula(const std::string &text, const lps::stochastic_specification &lpsspec)
Definition parse.h:81
regular_formula typecheck_regular_formula(const regular_formula &x, const lps::stochastic_specification &lpsspec)
Definition typecheck.h:333
std::string pp(const regular_formulas::seq &x)
T translate_user_notation(const T &x, typename std::enable_if< std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
bool is_trans_or_nil(const atermpp::aterm &x)
bool is_seq(const atermpp::aterm &x)
std::string pp(const regular_formulas::alt &x)
std::string pp(const regular_formulas::untyped_regular_formula &x)
std::string pp(const regular_formulas::trans_or_nil &x)
void translate_user_notation(T &x, typename std::enable_if< !std::is_base_of< atermpp::aterm, T >::value >::type *=0)
std::string pp(const regular_formulas::trans &x)
regular_formula typecheck_regular_formula(const regular_formula &x, const data::data_specification &dataspec, const VariableContainer &variables, const ActionLabelContainer &actions)
Definition typecheck.h:315
state_formula normalize(const state_formula &x)
Normalizes a state formula, i.e. removes any occurrences of ! or =>.
bool is_normalized(const state_formula &x)
Checks if a state formula is normalized.
state_formula normalize(const state_formula &x, bool quantitative=false, bool negated=false)
state_formula_specification parse_state_formula_specification(std::istream &in, const bool formula_is_quantitative)
Parses a state formula specification from an input stream.
bool is_monotonous(const state_formula &f)
Returns true if the state formula is monotonous.
state_formula parse_state_formula(std::istream &in, lps::stochastic_specification &lpsspec, const bool formula_is_quantitative)
Parses a state formula from an input stream.
state_formula_specification parse_state_formula_specification(const std::string &text, const bool formula_is_quantitative)
Parses a state formula specification from text.
state_formula parse_state_formula(const std::string &text, lps::stochastic_specification &lpsspec, const bool formula_is_quantitative)
Parses a state formula from text.
state_formula_specification parse_state_formula_specification(const std::string &text, lps::stochastic_specification &lpsspec, const bool formula_is_quantitative)
Parses a state formula specification from text.
bool is_timed(const state_formula &x)
std::set< core::identifier_string > find_state_variable_names(const state_formula &x)
Returns the names of the state variables that occur in x.
state_formula_specification parse_state_formula_specification(std::istream &in, lps::stochastic_specification &lpsspec, const bool formula_is_quantitative)
Parses a state formula specification from an input stream.
state_formula_specification parse_state_formula_specification(const std::string &text)
typecheck_builder make_typecheck_builder(data::data_type_checker &data_typechecker, const data::detail::variable_context &variable_context, const process::detail::action_context &action_context, const detail::state_variable_context &state_variable_context, const bool formula_is_quantitative)
Definition typecheck.h:716
state_formula parse_state_formula(const std::string &text)
void check_data_variable_name_clashes(const state_formula &x)
Throws an exception if the formula contains name clashes in the parameters of mu/nu/exists/forall.
bool is_infimum(const atermpp::aterm &x)
std::string pp(const state_formulas::or_ &x)
std::string pp(const state_formulas::plus &x)
bool is_and(const atermpp::aterm &x)
std::string pp(const state_formulas::yaled_timed &x)
std::string pp(const state_formulas::may &x)
state_formula_specification parse_state_formula_specification(std::istream &in, const bool formula_is_quantitative, parse_state_formula_options options=parse_state_formula_options())
Parses a state formula specification from an input stream.
Definition parse.h:241
state_formula_specification parse_state_formula_specification(std::istream &in, lps::specification &lpsspec, const bool formula_is_quantitative, parse_state_formula_options options=parse_state_formula_options())
Parses a state formula specification from an input stream.
Definition parse.h:327
bool is_delay_timed(const atermpp::aterm &x)
T translate_user_notation(const T &x, typename std::enable_if< std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
state_formula resolve_state_formula_data_variable_name_clashes(const state_formula &x, const std::set< core::identifier_string > &context_ids=std::set< core::identifier_string >())
Resolves name clashes in data variables of formula x.
bool is_const_multiply(const atermpp::aterm &x)
std::string pp(const state_formulas::must &x)
bool is_minus(const atermpp::aterm &x)
std::string pp(const state_formulas::not_ &x)
state_formula_specification parse_state_formula_specification(const std::string &text, lps::specification &lpsspec, const bool formula_is_quantitative, parse_state_formula_options options=parse_state_formula_options())
Parses a state formula specification from a string.
Definition parse.h:291
state_formula typecheck_state_formula(const state_formula &x, const lps::stochastic_specification &lpsspec, const bool formula_is_quantitative)
Type check a state formula. Throws an exception if something went wrong.
Definition typecheck.h:810
bool is_exists(const atermpp::aterm &x)
void typecheck_state_formula_specification(state_formula_specification &formspec, const lps::stochastic_specification &lpsspec, const bool formula_is_quantitative)
Typecheck the state formula specification formspec. It is assumed that the formula is not self contai...
Definition typecheck.h:842
std::string pp(const state_formulas::delay &x)
bool is_not(const atermpp::aterm &x)
state_formula parse_state_formula(std::istream &in, lps::stochastic_specification &lpsspec, const bool formula_is_quantitative, parse_state_formula_options options=parse_state_formula_options())
Parses a state formula from an input stream.
Definition parse.h:185
state_formula post_process_state_formula(const state_formula &formula, parse_state_formula_options options=parse_state_formula_options())
Definition parse.h:108
bool is_supremum(const atermpp::aterm &x)
state_formula parse_state_formula(const std::string &text, lps::stochastic_specification &lpsspec, const bool formula_is_quantitative, parse_state_formula_options options=parse_state_formula_options())
Parses a state formula from an input stream.
Definition parse.h:144
bool is_must(const atermpp::aterm &x)
std::set< data::variable > find_all_variables(const state_formulas::state_formula &x)
bool is_yaled(const atermpp::aterm &x)
std::string pp(const state_formulas::const_multiply &x)
std::string pp(const state_formulas::exists &x)
bool has_data_variable_name_clashes(const state_formula &x)
Returns true if the formula contains parameter name clashes.
std::string pp(const state_formulas::const_multiply_alt &x)
bool is_normalized(const T &x)
Checks if a state formula is normalized.
Definition normalize.h:411
std::set< data::variable > find_free_variables(const state_formulas::state_formula &x)
bool is_true(const atermpp::aterm &x)
std::string pp(const state_formulas::and_ &x)
state_formula_specification parse_state_formula_specification(const std::string &text, lps::stochastic_specification &lpsspec, const bool formula_is_quantitative, parse_state_formula_options options=parse_state_formula_options())
Parses a state formula specification from a string.
Definition parse.h:258
void check_state_variable_name_clashes(const state_formula &x)
Throws an exception if the formula contains name clashes.
std::string pp(const state_formulas::state_formula &x)
std::string pp(const state_formulas::infimum &x)
std::string pp(const state_formulas::minus &x)
state_formula parse_state_formula(std::istream &in, lps::specification &lpsspec, const bool formula_is_quantitative, parse_state_formula_options options=parse_state_formula_options())
Parses a state formula from an input stream.
Definition parse.h:202
bool is_variable(const atermpp::aterm &x)
bool is_may(const atermpp::aterm &x)
bool is_yaled_timed(const atermpp::aterm &x)
bool is_imp(const atermpp::aterm &x)
bool is_timed(const state_formula &x)
Checks if a state formula is timed.
Definition is_timed.h:60
std::string pp(const state_formulas::forall &x)
std::string pp(const state_formulas::imp &x)
state_formula translate_regular_formulas(const state_formula &x)
Translates regular formulas appearing in f into action formulas.
bool has_state_variable_name_clashes(const state_formula &x)
Returns true if the formula contains name clashes.
std::string pp(const state_formulas::yaled &x)
std::string pp(const state_formulas::sum &x)
std::string pp(const state_formulas::state_formula_specification &x)
bool is_monotonous(const state_formula &f)
Returns true if the state formula is monotonous.
state_formula parse_state_formula(const std::string &text, lps::specification &lpsspec, const bool formula_is_quantitative, parse_state_formula_options options=parse_state_formula_options())
Parses a state formula from an input stream.
Definition parse.h:166
bool is_sum(const atermpp::aterm &x)
std::string pp(const state_formulas::delay_timed &x)
state_formulas::state_formula translate_user_notation(const state_formulas::state_formula &x)
state_formulas::state_formula normalize_sorts(const state_formulas::state_formula &x, const data::sort_specification &sortspec)
void typecheck_state_formula_specification(state_formula_specification &formspec, const bool formula_is_quantitative)
Typecheck the state formula specification formspec. It is assumed that the formula is self contained,...
Definition typecheck.h:821
std::string pp(const state_formulas::false_ &x)
bool is_nu(const atermpp::aterm &x)
state_formula typecheck_state_formula(const state_formula &x, const bool formula_is_quantitative, const data::data_specification &dataspec=data::data_specification(), const ActionLabelContainer &action_labels=ActionLabelContainer(), const VariableContainer &variables=VariableContainer())
Type check a state formula. Throws an exception if something went wrong.
Definition typecheck.h:784
void translate_user_notation(T &x, typename std::enable_if< !std::is_base_of< atermpp::aterm, T >::value >::type *=0)
bool is_delay(const atermpp::aterm &x)
std::string pp(const state_formulas::true_ &x)
std::string pp(const state_formulas::mu &x)
std::string pp(const state_formulas::supremum &x)
bool is_false(const atermpp::aterm &x)
state_formula negate_variables(const core::identifier_string &name, bool quantitative, const state_formula &x)
Negates variable instantiations in a state formula with a given name.
bool is_plus(const atermpp::aterm &x)
state_formula_specification parse_state_formula_specification(const std::string &text, const bool formula_is_quantitative, parse_state_formula_options options=parse_state_formula_options())
Parses a state formula specification from a string.
Definition parse.h:220
T normalize(const T &x, bool quantitative=false, bool negated=false, typename std::enable_if< std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
The function normalize brings (embedded) state formulas into positive normal form,...
Definition normalize.h:436
state_formula resolve_state_variable_name_clashes(const state_formula &x)
Resolves name clashes in state variables of formula x.
bool is_mu(const atermpp::aterm &x)
bool is_forall(const atermpp::aterm &x)
std::string pp(const state_formulas::nu &x)
bool is_const_multiply_alt(const atermpp::aterm &x)
state_formula_specification parse_state_formula_specification(std::istream &in, lps::stochastic_specification &lpsspec, const bool formula_is_quantitative, parse_state_formula_options options=parse_state_formula_options())
Parses a state formula specification from an input stream.
Definition parse.h:310
bool is_or(const atermpp::aterm &x)
std::string pp(const state_formulas::variable &x)
std::set< data::sort_expression > find_sort_expressions(const state_formulas::state_formula &x)
void normalize(T &x, bool quantitative=false, bool negated=false, typename std::enable_if< !std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
The function normalize brings (embedded) state formulas into positive normal form,...
Definition normalize.h:424
std::set< process::action_label > find_action_labels(const state_formulas::state_formula &x)
std::set< core::identifier_string > find_identifiers(const state_formulas::state_formula &x)
std::string read_text(std::istream &in)
Read text from a stream.
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Base class for action_formula_builder.
Definition builder.h:27
void apply(T &result, const data::data_expression &x)
Definition builder.h:32
Base class for action_formula_traverser.
Definition traverser.h:27
void apply(const data::data_expression &x)
Definition traverser.h:33
void apply(T &result, const action_formulas::forall &x)
Definition builder.h:629
void apply(T &result, const action_formulas::not_ &x)
Definition builder.h:593
void apply(T &result, const action_formulas::at &x)
Definition builder.h:647
void apply(T &result, const action_formulas::multi_action &x)
Definition builder.h:656
void apply(T &result, const action_formulas::and_ &x)
Definition builder.h:602
void apply(T &result, const action_formulas::exists &x)
Definition builder.h:638
void apply(T &result, const action_formulas::imp &x)
Definition builder.h:620
void apply(T &result, const action_formulas::action_formula &x)
Definition builder.h:667
void apply(T &result, const action_formulas::true_ &x)
Definition builder.h:571
void apply(T &result, const action_formulas::or_ &x)
Definition builder.h:611
void apply(T &result, const action_formulas::false_ &x)
Definition builder.h:582
void apply(T &result, const action_formulas::action_formula &x)
Definition builder.h:319
void apply(T &result, const action_formulas::and_ &x)
Definition builder.h:256
void apply(T &result, const action_formulas::exists &x)
Definition builder.h:292
void apply(T &result, const action_formulas::false_ &x)
Definition builder.h:236
void apply(T &result, const action_formulas::at &x)
Definition builder.h:301
void apply(T &result, const action_formulas::or_ &x)
Definition builder.h:265
void apply(T &result, const action_formulas::multi_action &x)
Definition builder.h:310
void apply(T &result, const action_formulas::true_ &x)
Definition builder.h:225
void apply(T &result, const action_formulas::not_ &x)
Definition builder.h:247
void apply(T &result, const action_formulas::imp &x)
Definition builder.h:274
void apply(T &result, const action_formulas::forall &x)
Definition builder.h:283
void apply(T &result, const action_formulas::exists &x)
Definition builder.h:119
void apply(T &result, const action_formulas::forall &x)
Definition builder.h:110
void apply(T &result, const action_formulas::true_ &x)
Definition builder.h:52
void apply(T &result, const action_formulas::or_ &x)
Definition builder.h:92
void apply(T &result, const action_formulas::false_ &x)
Definition builder.h:63
void apply(T &result, const action_formulas::at &x)
Definition builder.h:128
void apply(T &result, const action_formulas::and_ &x)
Definition builder.h:83
void apply(T &result, const action_formulas::imp &x)
Definition builder.h:101
void apply(T &result, const action_formulas::not_ &x)
Definition builder.h:74
void apply(T &result, const action_formulas::action_formula &x)
Definition builder.h:146
void apply(T &result, const action_formulas::multi_action &x)
Definition builder.h:137
void apply(const action_formulas::action_formula &x)
Definition traverser.h:425
void apply(const action_formulas::multi_action &x)
Definition traverser.h:418
void apply(const action_formulas::forall &x)
Definition traverser.h:850
void apply(const action_formulas::false_ &x)
Definition traverser.h:812
void apply(const action_formulas::true_ &x)
Definition traverser.h:805
void apply(const action_formulas::not_ &x)
Definition traverser.h:819
void apply(const action_formulas::at &x)
Definition traverser.h:864
void apply(const action_formulas::action_formula &x)
Definition traverser.h:878
void apply(const action_formulas::multi_action &x)
Definition traverser.h:871
void apply(const action_formulas::exists &x)
Definition traverser.h:857
void apply(const action_formulas::imp &x)
Definition traverser.h:842
void apply(const action_formulas::and_ &x)
Definition traverser.h:826
void apply(const action_formulas::or_ &x)
Definition traverser.h:834
void apply(const action_formulas::multi_action &x)
Definition traverser.h:269
void apply(const action_formulas::at &x)
Definition traverser.h:261
void apply(const action_formulas::exists &x)
Definition traverser.h:254
void apply(const action_formulas::action_formula &x)
Definition traverser.h:276
void apply(const action_formulas::forall &x)
Definition traverser.h:247
void apply(const action_formulas::not_ &x)
Definition traverser.h:216
void apply(const action_formulas::false_ &x)
Definition traverser.h:209
void apply(const action_formulas::or_ &x)
Definition traverser.h:231
void apply(const action_formulas::true_ &x)
Definition traverser.h:202
void apply(const action_formulas::and_ &x)
Definition traverser.h:223
void apply(const action_formulas::imp &x)
Definition traverser.h:239
void apply(const action_formulas::forall &x)
Definition traverser.h:698
void apply(const action_formulas::or_ &x)
Definition traverser.h:682
void apply(const action_formulas::false_ &x)
Definition traverser.h:660
void apply(const action_formulas::and_ &x)
Definition traverser.h:674
void apply(const action_formulas::action_formula &x)
Definition traverser.h:729
void apply(const action_formulas::multi_action &x)
Definition traverser.h:722
void apply(const action_formulas::true_ &x)
Definition traverser.h:653
void apply(const action_formulas::imp &x)
Definition traverser.h:690
void apply(const action_formulas::not_ &x)
Definition traverser.h:667
void apply(const action_formulas::exists &x)
Definition traverser.h:706
void apply(const action_formulas::action_formula &x)
Definition traverser.h:126
void apply(const action_formulas::true_ &x)
Definition traverser.h:50
void apply(const action_formulas::or_ &x)
Definition traverser.h:79
void apply(const action_formulas::multi_action &x)
Definition traverser.h:119
void apply(const action_formulas::forall &x)
Definition traverser.h:95
void apply(const action_formulas::and_ &x)
Definition traverser.h:71
void apply(const action_formulas::false_ &x)
Definition traverser.h:57
void apply(const action_formulas::at &x)
Definition traverser.h:111
void apply(const action_formulas::not_ &x)
Definition traverser.h:64
void apply(const action_formulas::imp &x)
Definition traverser.h:87
void apply(const action_formulas::exists &x)
Definition traverser.h:103
void apply(const action_formulas::imp &x)
Definition traverser.h:538
void apply(const action_formulas::and_ &x)
Definition traverser.h:522
void apply(const action_formulas::or_ &x)
Definition traverser.h:530
void apply(const action_formulas::forall &x)
Definition traverser.h:546
void apply(const action_formulas::at &x)
Definition traverser.h:562
void apply(const action_formulas::multi_action &x)
Definition traverser.h:570
void apply(const action_formulas::true_ &x)
Definition traverser.h:501
void apply(const action_formulas::action_formula &x)
Definition traverser.h:577
void apply(const action_formulas::exists &x)
Definition traverser.h:554
void apply(const action_formulas::not_ &x)
Definition traverser.h:515
void apply(const action_formulas::false_ &x)
Definition traverser.h:508
void apply(T &result, const action_formulas::action_formula &x)
Definition builder.h:492
void apply(T &result, const action_formulas::not_ &x)
Definition builder.h:420
void apply(T &result, const action_formulas::true_ &x)
Definition builder.h:398
void apply(T &result, const action_formulas::or_ &x)
Definition builder.h:438
void apply(T &result, const action_formulas::exists &x)
Definition builder.h:465
void apply(T &result, const action_formulas::and_ &x)
Definition builder.h:429
void apply(T &result, const action_formulas::imp &x)
Definition builder.h:447
void apply(T &result, const action_formulas::at &x)
Definition builder.h:474
void apply(T &result, const action_formulas::false_ &x)
Definition builder.h:409
void apply(T &result, const action_formulas::forall &x)
Definition builder.h:456
void apply(T &result, const action_formulas::multi_action &x)
Definition builder.h:483
action_formula_actions(const core::parser &parser_)
Definition parse_impl.h:30
action_formulas::action_formula parse_ActFrm(const core::parse_node &node) const
Definition parse_impl.h:34
void apply(T &result, const process::untyped_multi_action &x)
Definition typecheck.h:66
typecheck_builder(data::data_type_checker &data_typechecker, const data::detail::variable_context &variable_context, const process::detail::action_context &action_context)
Definition typecheck.h:38
process::action typecheck_action(const core::identifier_string &name, const data::data_expression_list &parameters)
Definition typecheck.h:47
data::data_type_checker & m_data_type_checker
Definition typecheck.h:34
data::detail::variable_context m_variable_context
Definition typecheck.h:35
void apply(T &result, const action_formulas::exists &x)
Definition typecheck.h:111
const process::detail::action_context & m_action_context
Definition typecheck.h:36
action_formula_builder< typecheck_builder > super
Definition typecheck.h:31
void apply(T &result, const action_formulas::at &x)
Definition typecheck.h:59
void apply(T &result, const data::data_expression &x)
Definition typecheck.h:53
void apply(T &result, const action_formulas::forall &x)
Definition typecheck.h:93
expression builder that visits all sub expressions
Definition builder.h:42
Wrapper for D_ParseNode.
Definition dparser.h:86
Wrapper for D_Parser and its corresponding D_ParserTables.
Definition dparser.h:148
parse_node parse(const std::string &text, unsigned int start_symbol_index=0, bool partial_parses=false)
Parses a string. N.B. The user is responsible for destruction of the returned value by calling destro...
Definition dparser.cpp:209
parser(D_ParserTables &tables, D_AmbiguityFn ambiguity_fn=nullptr, D_SyntaxErrorFn syntax_error_fn=nullptr, std::size_t max_error_message_count=1)
Definition dparser.cpp:174
unsigned int start_symbol_index(const std::string &name) const
Definition dparser.cpp:204
expression traverser that visits all sub expressions
Definition traverser.h:32
void apply(T &result, const regular_formulas::trans &x)
Definition builder.h:897
void apply(T &result, const regular_formulas::trans_or_nil &x)
Definition builder.h:906
void apply(T &result, const regular_formulas::seq &x)
Definition builder.h:879
void apply(T &result, const regular_formulas::regular_formula &x)
Definition builder.h:924
void apply(T &result, const regular_formulas::alt &x)
Definition builder.h:888
void apply(T &result, const regular_formulas::untyped_regular_formula &x)
Definition builder.h:915
void apply(T &result, const regular_formulas::trans_or_nil &x)
Definition builder.h:1106
void apply(T &result, const regular_formulas::seq &x)
Definition builder.h:1079
void apply(T &result, const regular_formulas::regular_formula &x)
Definition builder.h:1124
void apply(T &result, const regular_formulas::untyped_regular_formula &x)
Definition builder.h:1115
void apply(T &result, const regular_formulas::trans &x)
Definition builder.h:1097
void apply(T &result, const regular_formulas::alt &x)
Definition builder.h:1088
void apply(T &result, const regular_formulas::trans &x)
Definition builder.h:797
void apply(T &result, const regular_formulas::seq &x)
Definition builder.h:779
void apply(T &result, const regular_formulas::regular_formula &x)
Definition builder.h:824
void apply(T &result, const regular_formulas::untyped_regular_formula &x)
Definition builder.h:815
void apply(T &result, const regular_formulas::alt &x)
Definition builder.h:788
void apply(T &result, const regular_formulas::trans_or_nil &x)
Definition builder.h:806
void apply(const regular_formulas::alt &x)
Definition traverser.h:1442
void apply(const regular_formulas::trans_or_nil &x)
Definition traverser.h:1457
void apply(const regular_formulas::untyped_regular_formula &x)
Definition traverser.h:1464
void apply(const regular_formulas::trans &x)
Definition traverser.h:1450
void apply(const regular_formulas::seq &x)
Definition traverser.h:1434
void apply(const regular_formulas::regular_formula &x)
Definition traverser.h:1472
void apply(const regular_formulas::trans_or_nil &x)
Definition traverser.h:1096
void apply(const regular_formulas::regular_formula &x)
Definition traverser.h:1111
void apply(const regular_formulas::seq &x)
Definition traverser.h:1073
void apply(const regular_formulas::alt &x)
Definition traverser.h:1081
void apply(const regular_formulas::untyped_regular_formula &x)
Definition traverser.h:1103
void apply(const regular_formulas::trans &x)
Definition traverser.h:1089
void apply(const regular_formulas::untyped_regular_formula &x)
Definition traverser.h:1373
void apply(const regular_formulas::regular_formula &x)
Definition traverser.h:1382
void apply(const regular_formulas::trans &x)
Definition traverser.h:1359
void apply(const regular_formulas::trans_or_nil &x)
Definition traverser.h:1366
void apply(const regular_formulas::untyped_regular_formula &x)
Definition traverser.h:1193
void apply(const regular_formulas::regular_formula &x)
Definition traverser.h:1201
void apply(const regular_formulas::trans_or_nil &x)
Definition traverser.h:1186
void apply(const regular_formulas::trans &x)
Definition traverser.h:999
void apply(const regular_formulas::alt &x)
Definition traverser.h:991
void apply(const regular_formulas::untyped_regular_formula &x)
Definition traverser.h:1013
void apply(const regular_formulas::trans_or_nil &x)
Definition traverser.h:1006
void apply(const regular_formulas::regular_formula &x)
Definition traverser.h:1021
void apply(const regular_formulas::seq &x)
Definition traverser.h:983
void apply(const regular_formulas::trans_or_nil &x)
Definition traverser.h:1276
void apply(const regular_formulas::regular_formula &x)
Definition traverser.h:1291
void apply(const regular_formulas::alt &x)
Definition traverser.h:1261
void apply(const regular_formulas::untyped_regular_formula &x)
Definition traverser.h:1283
void apply(const regular_formulas::seq &x)
Definition traverser.h:1253
void apply(const regular_formulas::trans &x)
Definition traverser.h:1269
void apply(T &result, const regular_formulas::untyped_regular_formula &x)
Definition builder.h:1015
void apply(T &result, const regular_formulas::trans_or_nil &x)
Definition builder.h:1006
void apply(T &result, const regular_formulas::seq &x)
Definition builder.h:979
void apply(T &result, const regular_formulas::trans &x)
Definition builder.h:997
void apply(T &result, const regular_formulas::alt &x)
Definition builder.h:988
void apply(T &result, const regular_formulas::regular_formula &x)
Definition builder.h:1024
regular_formulas::regular_formula parse_RegFrm(const core::parse_node &node) const
Definition parse_impl.h:69
const data::detail::variable_context & m_variable_context
Definition typecheck.h:179
data::data_expression make_element_at(const data::data_expression &left, const data::data_expression &right) const
Definition typecheck.h:256
void apply(regular_formula &result, const action_formulas::action_formula &x)
Definition typecheck.h:296
data::data_expression make_plus(const data::data_expression &left, const data::data_expression &right)
Definition typecheck.h:219
void apply(T &result, const regular_formulas::untyped_regular_formula &x)
Definition typecheck.h:264
regular_formula_builder< typecheck_builder > super
Definition typecheck.h:175
typecheck_builder(data::data_type_checker &data_typechecker, const data::detail::variable_context &variables, const process::detail::action_context &actions)
Definition typecheck.h:182
data::data_expression make_fset_union(const data::data_expression &left, const data::data_expression &right)
Definition typecheck.h:205
data::data_expression make_set_union(const data::data_expression &left, const data::data_expression &right)
Definition typecheck.h:212
data::data_expression make_fbag_union(const data::data_expression &left, const data::data_expression &right)
Definition typecheck.h:191
data::data_expression make_bag_union(const data::data_expression &left, const data::data_expression &right)
Definition typecheck.h:198
const process::detail::action_context & m_action_context
Definition typecheck.h:180
Builder class for regular_formula_builder. Used as a base class for pbes_expression_builder.
Definition builder.h:743
void apply(T &result, const data::data_expression &x)
Definition builder.h:748
void apply(T &result, const action_formulas::action_formula &x)
Definition builder.h:758
Traversal class for regular_formula_traverser. Used as a base class for pbes_expression_traverser.
Definition traverser.h:953
void apply(const action_formulas::action_formula &x)
Definition traverser.h:966
void apply(const data::data_expression &x)
Definition traverser.h:959
void apply(T &result, const state_formulas::nu &x)
Definition builder.h:1775
void apply(T &result, const state_formulas::supremum &x)
Definition builder.h:1690
void apply(T &result, const state_formulas::imp &x)
Definition builder.h:1627
void apply(T &result, const state_formulas::state_formula &x)
Definition builder.h:1802
void apply(T &result, const state_formulas::plus &x)
Definition builder.h:1636
void apply(T &result, const state_formulas::yaled &x)
Definition builder.h:1726
void apply(T &result, const state_formulas::false_ &x)
Definition builder.h:1580
void apply(T &result, const state_formulas::yaled_timed &x)
Definition builder.h:1737
void apply(T &result, const state_formulas::const_multiply &x)
Definition builder.h:1645
void apply(T &result, const state_formulas::and_ &x)
Definition builder.h:1609
void apply(T &result, const state_formulas::exists &x)
Definition builder.h:1672
void apply(T &result, const state_formulas::may &x)
Definition builder.h:1717
void apply(T &result, const state_formulas::minus &x)
Definition builder.h:1600
void apply(T &result, const state_formulas::infimum &x)
Definition builder.h:1681
void apply(T &result, const state_formulas::or_ &x)
Definition builder.h:1618
void apply(T &result, const state_formulas::sum &x)
Definition builder.h:1699
void apply(T &result, const state_formulas::mu &x)
Definition builder.h:1784
void apply(T &result, const state_formulas::must &x)
Definition builder.h:1708
void apply(T &result, const state_formulas::variable &x)
Definition builder.h:1766
void apply(T &result, const state_formulas::not_ &x)
Definition builder.h:1591
void update(state_formulas::state_formula_specification &x)
Definition builder.h:1792
void apply(T &result, const state_formulas::delay &x)
Definition builder.h:1746
void apply(T &result, const state_formulas::true_ &x)
Definition builder.h:1569
void apply(T &result, const state_formulas::const_multiply_alt &x)
Definition builder.h:1654
void apply(T &result, const state_formulas::forall &x)
Definition builder.h:1663
void apply(T &result, const state_formulas::delay_timed &x)
Definition builder.h:1757
void apply(T &result, const state_formulas::supremum &x)
Definition builder.h:1323
void apply(T &result, const state_formulas::yaled &x)
Definition builder.h:1359
void apply(T &result, const state_formulas::true_ &x)
Definition builder.h:1202
void apply(T &result, const state_formulas::const_multiply &x)
Definition builder.h:1278
void apply(T &result, const state_formulas::false_ &x)
Definition builder.h:1213
void apply(T &result, const state_formulas::const_multiply_alt &x)
Definition builder.h:1287
void apply(T &result, const state_formulas::sum &x)
Definition builder.h:1332
void apply(T &result, const state_formulas::not_ &x)
Definition builder.h:1224
void apply(T &result, const state_formulas::may &x)
Definition builder.h:1350
void apply(T &result, const state_formulas::forall &x)
Definition builder.h:1296
void apply(T &result, const state_formulas::exists &x)
Definition builder.h:1305
void apply(T &result, const state_formulas::delay_timed &x)
Definition builder.h:1390
void apply(T &result, const state_formulas::yaled_timed &x)
Definition builder.h:1370
void apply(T &result, const state_formulas::mu &x)
Definition builder.h:1417
void apply(T &result, const state_formulas::delay &x)
Definition builder.h:1379
void apply(T &result, const state_formulas::must &x)
Definition builder.h:1341
void apply(T &result, const state_formulas::infimum &x)
Definition builder.h:1314
void apply(T &result, const state_formulas::imp &x)
Definition builder.h:1260
void update(state_formulas::state_formula_specification &x)
Definition builder.h:1425
void apply(T &result, const state_formulas::state_formula &x)
Definition builder.h:1438
void apply(T &result, const state_formulas::nu &x)
Definition builder.h:1408
void apply(T &result, const state_formulas::and_ &x)
Definition builder.h:1242
void apply(T &result, const state_formulas::minus &x)
Definition builder.h:1233
void apply(T &result, const state_formulas::variable &x)
Definition builder.h:1399
void apply(T &result, const state_formulas::plus &x)
Definition builder.h:1269
void apply(T &result, const state_formulas::or_ &x)
Definition builder.h:1251
void apply(T &result, const state_formulas::exists &x)
Definition builder.h:2400
void apply(T &result, const state_formulas::yaled &x)
Definition builder.h:2454
void apply(T &result, const state_formulas::plus &x)
Definition builder.h:2364
void apply(T &result, const state_formulas::delay_timed &x)
Definition builder.h:2487
void apply(T &result, const state_formulas::must &x)
Definition builder.h:2436
void apply(T &result, const state_formulas::sum &x)
Definition builder.h:2427
void apply(T &result, const state_formulas::infimum &x)
Definition builder.h:2409
void apply(T &result, const state_formulas::const_multiply &x)
Definition builder.h:2373
void update(state_formulas::state_formula_specification &x)
Definition builder.h:2526
void apply(T &result, const state_formulas::may &x)
Definition builder.h:2445
void apply(T &result, const state_formulas::false_ &x)
Definition builder.h:2308
void apply(T &result, const state_formulas::or_ &x)
Definition builder.h:2346
void apply(T &result, const state_formulas::imp &x)
Definition builder.h:2355
void apply(T &result, const state_formulas::not_ &x)
Definition builder.h:2319
void apply(T &result, const state_formulas::variable &x)
Definition builder.h:2498
void apply(T &result, const state_formulas::forall &x)
Definition builder.h:2391
void apply(T &result, const state_formulas::delay &x)
Definition builder.h:2476
void apply(T &result, const state_formulas::yaled_timed &x)
Definition builder.h:2465
void apply(T &result, const state_formulas::supremum &x)
Definition builder.h:2418
void apply(T &result, const state_formulas::const_multiply_alt &x)
Definition builder.h:2382
void apply(T &result, const state_formulas::nu &x)
Definition builder.h:2509
void apply(T &result, const state_formulas::and_ &x)
Definition builder.h:2337
void apply(T &result, const state_formulas::minus &x)
Definition builder.h:2328
void apply(T &result, const state_formulas::mu &x)
Definition builder.h:2518
void apply(T &result, const state_formulas::true_ &x)
Definition builder.h:2297
void apply(T &result, const state_formulas::state_formula &x)
Definition builder.h:2536
void apply(const state_formulas::mu &x)
Definition traverser.h:3908
void apply(const state_formulas::state_formula &x)
Definition traverser.h:3923
void apply(const state_formulas::delay &x)
Definition traverser.h:3880
void apply(const state_formulas::variable &x)
Definition traverser.h:3894
void apply(const state_formulas::infimum &x)
Definition traverser.h:3829
void apply(const state_formulas::minus &x)
Definition traverser.h:3762
void apply(const state_formulas::false_ &x)
Definition traverser.h:3748
void apply(const state_formulas::sum &x)
Definition traverser.h:3843
void apply(const state_formulas::const_multiply &x)
Definition traverser.h:3801
void apply(const state_formulas::delay_timed &x)
Definition traverser.h:3887
void apply(const state_formulas::must &x)
Definition traverser.h:3850
void apply(const state_formulas::plus &x)
Definition traverser.h:3793
void apply(const state_formulas::imp &x)
Definition traverser.h:3785
void apply(const state_formulas::yaled_timed &x)
Definition traverser.h:3873
void apply(const state_formulas::nu &x)
Definition traverser.h:3901
void apply(const state_formulas::exists &x)
Definition traverser.h:3822
void apply(const state_formulas::supremum &x)
Definition traverser.h:3836
void apply(const state_formulas::true_ &x)
Definition traverser.h:3741
void apply(const state_formulas::not_ &x)
Definition traverser.h:3755
void apply(const state_formulas::const_multiply_alt &x)
Definition traverser.h:3808
void apply(const state_formulas::state_formula_specification &x)
Definition traverser.h:3915
void apply(const state_formulas::and_ &x)
Definition traverser.h:3769
void apply(const state_formulas::or_ &x)
Definition traverser.h:3777
void apply(const state_formulas::may &x)
Definition traverser.h:3858
void apply(const state_formulas::yaled &x)
Definition traverser.h:3866
void apply(const state_formulas::forall &x)
Definition traverser.h:3815
void apply(const state_formulas::plus &x)
Definition traverser.h:1917
void apply(const state_formulas::supremum &x)
Definition traverser.h:1962
void apply(const state_formulas::and_ &x)
Definition traverser.h:1893
void apply(const state_formulas::sum &x)
Definition traverser.h:1969
void apply(const state_formulas::variable &x)
Definition traverser.h:2020
void apply(const state_formulas::not_ &x)
Definition traverser.h:1879
void apply(const state_formulas::state_formula_specification &x)
Definition traverser.h:2043
void apply(const state_formulas::may &x)
Definition traverser.h:1984
void apply(const state_formulas::forall &x)
Definition traverser.h:1941
void apply(const state_formulas::or_ &x)
Definition traverser.h:1901
void apply(const state_formulas::exists &x)
Definition traverser.h:1948
void apply(const state_formulas::false_ &x)
Definition traverser.h:1872
void apply(const state_formulas::yaled_timed &x)
Definition traverser.h:1999
void apply(const state_formulas::true_ &x)
Definition traverser.h:1865
void apply(const state_formulas::delay_timed &x)
Definition traverser.h:2013
void apply(const state_formulas::must &x)
Definition traverser.h:1976
void apply(const state_formulas::yaled &x)
Definition traverser.h:1992
void apply(const state_formulas::state_formula &x)
Definition traverser.h:2050
void apply(const state_formulas::imp &x)
Definition traverser.h:1909
void apply(const state_formulas::delay &x)
Definition traverser.h:2006
void apply(const state_formulas::const_multiply_alt &x)
Definition traverser.h:1933
void apply(const state_formulas::minus &x)
Definition traverser.h:1886
void apply(const state_formulas::const_multiply &x)
Definition traverser.h:1925
void apply(const state_formulas::infimum &x)
Definition traverser.h:1955
void apply(const state_formulas::plus &x)
Definition traverser.h:3162
void apply(const state_formulas::variable &x)
Definition traverser.h:3270
void apply(const state_formulas::supremum &x)
Definition traverser.h:3210
void apply(const state_formulas::const_multiply &x)
Definition traverser.h:3170
void apply(const state_formulas::delay &x)
Definition traverser.h:3256
void apply(const state_formulas::exists &x)
Definition traverser.h:3194
void apply(const state_formulas::yaled &x)
Definition traverser.h:3242
void apply(const state_formulas::yaled_timed &x)
Definition traverser.h:3249
void apply(const state_formulas::false_ &x)
Definition traverser.h:3117
void apply(const state_formulas::state_formula &x)
Definition traverser.h:3304
void apply(const state_formulas::and_ &x)
Definition traverser.h:3138
void apply(const state_formulas::const_multiply_alt &x)
Definition traverser.h:3178
void apply(const state_formulas::state_formula_specification &x)
Definition traverser.h:3296
void apply(const state_formulas::minus &x)
Definition traverser.h:3131
void apply(const state_formulas::must &x)
Definition traverser.h:3226
void apply(const state_formulas::delay_timed &x)
Definition traverser.h:3263
void apply(const state_formulas::forall &x)
Definition traverser.h:3186
void apply(const state_formulas::infimum &x)
Definition traverser.h:3202
void apply(const state_formulas::not_ &x)
Definition traverser.h:3124
void apply(const state_formulas::true_ &x)
Definition traverser.h:3110
void apply(const state_formulas::state_formula_specification &x)
Definition traverser.h:3606
void apply(const state_formulas::yaled_timed &x)
Definition traverser.h:3564
void apply(const state_formulas::const_multiply &x)
Definition traverser.h:3492
void apply(const state_formulas::delay_timed &x)
Definition traverser.h:3578
void apply(const state_formulas::state_formula &x)
Definition traverser.h:3613
void apply(const state_formulas::const_multiply_alt &x)
Definition traverser.h:3499
void apply(const state_formulas::yaled &x)
Definition traverser.h:1678
void apply(const state_formulas::const_multiply &x)
Definition traverser.h:1606
void apply(const state_formulas::variable &x)
Definition traverser.h:1706
void apply(const state_formulas::state_formula &x)
Definition traverser.h:1737
void apply(const state_formulas::delay_timed &x)
Definition traverser.h:1699
void apply(const state_formulas::plus &x)
Definition traverser.h:1598
void apply(const state_formulas::supremum &x)
Definition traverser.h:1646
void apply(const state_formulas::and_ &x)
Definition traverser.h:1574
void apply(const state_formulas::must &x)
Definition traverser.h:1662
void apply(const state_formulas::exists &x)
Definition traverser.h:1630
void apply(const state_formulas::false_ &x)
Definition traverser.h:1553
void apply(const state_formulas::delay &x)
Definition traverser.h:1692
void apply(const state_formulas::not_ &x)
Definition traverser.h:1560
void apply(const state_formulas::const_multiply_alt &x)
Definition traverser.h:1614
void apply(const state_formulas::may &x)
Definition traverser.h:1670
void apply(const state_formulas::forall &x)
Definition traverser.h:1622
void apply(const state_formulas::yaled_timed &x)
Definition traverser.h:1685
void apply(const state_formulas::infimum &x)
Definition traverser.h:1638
void apply(const state_formulas::or_ &x)
Definition traverser.h:1582
void apply(const state_formulas::true_ &x)
Definition traverser.h:1546
void apply(const state_formulas::state_formula_specification &x)
Definition traverser.h:1729
void apply(const state_formulas::imp &x)
Definition traverser.h:1590
void apply(const state_formulas::minus &x)
Definition traverser.h:1567
void apply(const state_formulas::sum &x)
Definition traverser.h:1654
void apply(const state_formulas::const_multiply &x)
Definition traverser.h:2238
void apply(const state_formulas::yaled_timed &x)
Definition traverser.h:2308
void apply(const state_formulas::const_multiply_alt &x)
Definition traverser.h:2245
void apply(const state_formulas::state_formula &x)
Definition traverser.h:2357
void apply(const state_formulas::delay_timed &x)
Definition traverser.h:2322
void apply(const state_formulas::state_formula_specification &x)
Definition traverser.h:2350
void apply(const state_formulas::delay &x)
Definition traverser.h:2940
void apply(const state_formulas::variable &x)
Definition traverser.h:2954
void apply(const state_formulas::may &x)
Definition traverser.h:2919
void apply(const state_formulas::infimum &x)
Definition traverser.h:2891
void apply(const state_formulas::and_ &x)
Definition traverser.h:2831
void apply(const state_formulas::state_formula &x)
Definition traverser.h:2982
void apply(const state_formulas::exists &x)
Definition traverser.h:2884
void apply(const state_formulas::mu &x)
Definition traverser.h:2968
void apply(const state_formulas::false_ &x)
Definition traverser.h:2810
void apply(const state_formulas::or_ &x)
Definition traverser.h:2839
void apply(const state_formulas::const_multiply &x)
Definition traverser.h:2863
void apply(const state_formulas::yaled_timed &x)
Definition traverser.h:2933
void apply(const state_formulas::not_ &x)
Definition traverser.h:2817
void apply(const state_formulas::true_ &x)
Definition traverser.h:2803
void apply(const state_formulas::imp &x)
Definition traverser.h:2847
void apply(const state_formulas::sum &x)
Definition traverser.h:2905
void apply(const state_formulas::plus &x)
Definition traverser.h:2855
void apply(const state_formulas::state_formula_specification &x)
Definition traverser.h:2975
void apply(const state_formulas::must &x)
Definition traverser.h:2912
void apply(const state_formulas::yaled &x)
Definition traverser.h:2926
void apply(const state_formulas::forall &x)
Definition traverser.h:2877
void apply(const state_formulas::const_multiply_alt &x)
Definition traverser.h:2870
void apply(const state_formulas::minus &x)
Definition traverser.h:2824
void apply(const state_formulas::delay_timed &x)
Definition traverser.h:2947
void apply(const state_formulas::nu &x)
Definition traverser.h:2961
void apply(const state_formulas::supremum &x)
Definition traverser.h:2898
void apply(const state_formulas::false_ &x)
Definition traverser.h:2492
void apply(const state_formulas::const_multiply_alt &x)
Definition traverser.h:2553
void apply(const state_formulas::true_ &x)
Definition traverser.h:2485
void apply(const state_formulas::and_ &x)
Definition traverser.h:2513
void apply(const state_formulas::exists &x)
Definition traverser.h:2569
void apply(const state_formulas::or_ &x)
Definition traverser.h:2521
void apply(const state_formulas::infimum &x)
Definition traverser.h:2577
void apply(const state_formulas::yaled &x)
Definition traverser.h:2617
void apply(const state_formulas::yaled_timed &x)
Definition traverser.h:2624
void apply(const state_formulas::plus &x)
Definition traverser.h:2537
void apply(const state_formulas::sum &x)
Definition traverser.h:2593
void apply(const state_formulas::delay_timed &x)
Definition traverser.h:2638
void apply(const state_formulas::must &x)
Definition traverser.h:2601
void apply(const state_formulas::forall &x)
Definition traverser.h:2561
void apply(const state_formulas::mu &x)
Definition traverser.h:2660
void apply(const state_formulas::delay &x)
Definition traverser.h:2631
void apply(const state_formulas::state_formula_specification &x)
Definition traverser.h:2668
void apply(const state_formulas::const_multiply &x)
Definition traverser.h:2545
void apply(const state_formulas::variable &x)
Definition traverser.h:2645
void apply(const state_formulas::supremum &x)
Definition traverser.h:2585
void apply(const state_formulas::may &x)
Definition traverser.h:2609
void apply(const state_formulas::state_formula &x)
Definition traverser.h:2675
void apply(const state_formulas::nu &x)
Definition traverser.h:2652
void apply(const state_formulas::imp &x)
Definition traverser.h:2529
void apply(const state_formulas::minus &x)
Definition traverser.h:2506
void apply(const state_formulas::not_ &x)
Definition traverser.h:2499
void apply(T &result, const state_formulas::true_ &x)
Definition builder.h:1933
void apply(T &result, const state_formulas::may &x)
Definition builder.h:2081
void apply(T &result, const state_formulas::not_ &x)
Definition builder.h:1955
void apply(T &result, const state_formulas::and_ &x)
Definition builder.h:1973
void apply(T &result, const state_formulas::minus &x)
Definition builder.h:1964
void apply(T &result, const state_formulas::delay &x)
Definition builder.h:2110
void apply(T &result, const state_formulas::plus &x)
Definition builder.h:2000
void apply(T &result, const state_formulas::yaled &x)
Definition builder.h:2090
void apply(T &result, const state_formulas::exists &x)
Definition builder.h:2036
void apply(T &result, const state_formulas::variable &x)
Definition builder.h:2130
void apply(T &result, const state_formulas::sum &x)
Definition builder.h:2063
void apply(T &result, const state_formulas::forall &x)
Definition builder.h:2027
void apply(T &result, const state_formulas::infimum &x)
Definition builder.h:2045
void apply(T &result, const state_formulas::mu &x)
Definition builder.h:2148
void apply(T &result, const state_formulas::yaled_timed &x)
Definition builder.h:2101
void apply(T &result, const state_formulas::supremum &x)
Definition builder.h:2054
void apply(T &result, const state_formulas::false_ &x)
Definition builder.h:1944
void apply(T &result, const state_formulas::or_ &x)
Definition builder.h:1982
void apply(T &result, const state_formulas::delay_timed &x)
Definition builder.h:2121
void apply(T &result, const state_formulas::const_multiply &x)
Definition builder.h:2009
void apply(T &result, const state_formulas::state_formula &x)
Definition builder.h:2166
void update(state_formulas::state_formula_specification &x)
Definition builder.h:2156
void apply(T &result, const state_formulas::must &x)
Definition builder.h:2072
void apply(T &result, const state_formulas::imp &x)
Definition builder.h:1991
void apply(T &result, const state_formulas::const_multiply_alt &x)
Definition builder.h:2018
void apply(T &result, const state_formulas::nu &x)
Definition builder.h:2139
Function that determines if a state formula is time dependent.
Definition is_timed.h:26
void enter(const action_formulas::at &)
Definition is_timed.h:48
state_formula_traverser< is_timed_traverser > super
Definition is_timed.h:27
untyped_state_formula_specification parse_StateFrmSpec(const core::parse_node &node) const
Definition parse_impl.h:217
state_formula_actions(const core::parser &parser_)
Definition parse_impl.h:108
state_formulas::state_formula parse_StateFrm(const core::parse_node &node) const
Definition parse_impl.h:146
Visitor that negates propositional variable instantiations with a given name.
state_variable_negator(const core::identifier_string &name, bool quantitative)
state_formulas::state_formula_builder< Derived > super
void apply(T &result, const variable &x)
Visit variable node.
state_formula apply_untyped_parameter(const core::identifier_string &name, const data::data_expression_list &arguments)
Definition typecheck.h:558
void apply(T &result, const state_formulas::mu &x)
Definition typecheck.h:633
void apply(T &result, const state_formulas::exists &x)
Definition typecheck.h:425
void apply(T &result, const state_formulas::const_multiply_alt &x)
Definition typecheck.h:699
state_formula apply_mu_nu(const MuNuFormula &x, bool is_mu)
Definition typecheck.h:595
void apply(T &result, const state_formulas::must &x)
Definition typecheck.h:535
void apply(T &result, const state_formulas::delay_timed &x)
Definition typecheck.h:545
void apply(T &result, const state_formulas::not_ &x)
Definition typecheck.h:639
void apply(T &result, const state_formulas::infimum &x)
Definition typecheck.h:450
const process::detail::action_context & m_action_context
Definition typecheck.h:353
void apply(T &result, const state_formulas::forall &x)
Definition typecheck.h:400
void apply(T &result, const state_formulas::supremum &x)
Definition typecheck.h:475
void apply(T &result, const data::untyped_data_parameter &x)
Definition typecheck.h:579
state_formula_builder< typecheck_builder > super
Definition typecheck.h:348
typecheck_builder(data::data_type_checker &data_typechecker, const data::detail::variable_context &variable_context, const process::detail::action_context &action_context, const detail::state_variable_context &state_variable_context, const bool formula_is_quantitative)
Definition typecheck.h:357
void apply(T &result, const state_formulas::may &x)
Definition typecheck.h:525
data::detail::variable_context m_variable_context
Definition typecheck.h:352
void apply(T &result, const state_formulas::const_multiply &x)
Definition typecheck.h:683
void apply(T &result, const state_formulas::plus &x)
Definition typecheck.h:667
void apply(T &result, const state_formulas::sum &x)
Definition typecheck.h:500
void apply(T &result, const state_formulas::nu &x)
Definition typecheck.h:627
void apply(T &result, const state_formulas::variable &x)
Definition typecheck.h:573
void apply(T &result, const state_formulas::yaled_timed &x)
Definition typecheck.h:552
data::data_type_checker & m_data_type_checker
Definition typecheck.h:351
void apply(T &result, const state_formulas::minus &x)
Definition typecheck.h:653
void apply(T &result, const data::data_expression &x)
Definition typecheck.h:371
detail::state_variable_context m_state_variable_context
Definition typecheck.h:354
data::variable_list assignment_variables(const data::assignment_list &x) const
Definition typecheck.h:584
Builder class for pbes_expressions. Used as a base class for pbes_expression_builder.
Definition builder.h:1176
void apply(T &result, const data::data_expression &x)
Definition builder.h:1181
Traversal class for pbes_expressions. Used as a base class for pbes_expression_traverser.
Definition traverser.h:1523
void apply(const data::data_expression &x)
Definition traverser.h:1529
std::size_t operator()(const atermpp::detail::reference_aterm< T > &t) const