mCRL2
Loading...
Searching...
No Matches
is_timed.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/is_timed.h
10/// \brief add your file description here.
11
12#ifndef MCRL2_MODAL_FORMULA_IS_TIMED_H
13#define MCRL2_MODAL_FORMULA_IS_TIMED_H
14
15#include "mcrl2/modal_formula/traverser.h"
16
17namespace mcrl2::state_formulas
18{
19
20namespace detail {
21
22/// \brief Function that determines if a state formula is time dependent
23// \brief Visitor for checking if a state formula is timed.
25{
27 using super::enter;
28 using super::leave;
29 using super::apply;
30
31 bool result = false;
32
33 void apply(const data::data_expression& /* x */)
34 {
35 // Do nothing.
36 }
37
38 void apply(const data::untyped_data_parameter& /* x */)
39 {
40 // Do nothing.
41 }
42
43 void apply(const process::untyped_multi_action& /* x */)
44 {
45 // Do nothing.
46 }
47
48 void enter(const delay_timed& /* x */)
49 {
50 result = true;
51 }
52
53 void enter(const yaled_timed& /* x */)
54 {
55 result = true;
56 }
57
58 void enter(const action_formulas::at& /* x */)
59 {
60 result = true;
61 }
62
63};
64
65} // namespace detail
66
67/// \brief Checks if a state formula is timed
68/// \param x A state formula
69/// \return True if a state formula is timed
70inline
71bool is_timed(const state_formula& x)
72{
74 f.apply(x);
75 return f.result;
76}
77
78} // namespace mcrl2::state_formulas
79
80#endif // MCRL2_MODAL_FORMULA_IS_TIMED_H
\brief The at operator for action formulas
data_specification()=default
Default constructor. Generate a data specification that contains only booleans and positive numbers.
\brief An untyped multi action or data application
\brief The timed delay operator for state formulas
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.
state_formula(const state_formula &) noexcept=default
Move semantics.
\brief The timed yaled operator for state formulas
D_ParserTables parser_tables_mcrl2
action_formula parse_action_formula(const std::string &text)
std::string pp(const action_formulas::exists &x, bool arg0)
std::string pp(const action_formulas::imp &x, bool arg0)
std::string pp(const action_formulas::at &x, bool arg0)
std::string pp(const action_formulas::forall &x, bool arg0)
std::string pp(const action_formulas::or_ &x, bool arg0)
std::string pp(const action_formulas::action_formula &x, bool arg0)
std::string pp(const action_formulas::true_ &x, bool arg0)
std::set< data::variable > find_all_variables(const action_formulas::action_formula &x)
std::string pp(const action_formulas::not_ &x, bool arg0)
std::string pp(const action_formulas::multi_action &x, bool arg0)
std::string pp(const action_formulas::false_ &x, bool arg0)
std::string pp(const action_formulas::and_ &x, bool arg0)
void warn_left_merge_merge(const parse_node &)
Prints a warning for each occurrence of 'x ||_ y || z' in the parse tree.
void warn_and_or(const parse_node &)
Prints a warning for each occurrence of 'x && y || z' in the parse tree.
The main namespace for the LPS library.
Definition constelm.h:18
The main namespace for the Process library.
regular_formula parse_regular_formula(const std::string &text)
std::string pp(const regular_formulas::trans &x, bool arg0)
std::string pp(const regular_formulas::alt &x, bool arg0)
std::string pp(const regular_formulas::untyped_regular_formula &x, bool arg0)
std::string pp(const regular_formulas::seq &x, bool arg0)
std::string pp(const regular_formulas::trans_or_nil &x, bool arg0)
std::string pp(const regular_formulas::regular_formula &x, bool arg0)
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 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 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 normalize(const state_formula &x, bool quantitative=false, bool negated=false)
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::stochastic_specification &lpsspec, const bool formula_is_quantitative)
Parses a state formula from text.
state_formula_specification parse_state_formula_specification(std::istream &in, 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, 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)
state_formula parse_state_formula(const std::string &text)
std::string pp(const state_formulas::nu &x, bool arg0)
std::string pp(const state_formulas::exists &x, bool arg0)
std::string pp(const state_formulas::not_ &x, bool arg0)
std::string pp(const state_formulas::supremum &x, bool arg0)
std::ostream & operator<<(std::ostream &out, const state_formula_specification &x)
std::string pp(const state_formulas::must &x, bool arg0)
std::string pp(const state_formulas::minus &x, bool arg0)
std::set< data::variable > find_all_variables(const state_formulas::state_formula &x)
std::set< data::variable > find_free_variables(const state_formulas::state_formula &x)
std::string pp(const state_formulas::true_ &x, bool arg0)
std::string pp(const state_formulas::state_formula &x, bool arg0)
std::string pp(const state_formulas::const_multiply &x, bool arg0)
std::string pp(const state_formulas::delay_timed &x, bool arg0)
bool is_timed(const state_formula &x)
Checks if a state formula is timed.
Definition is_timed.h:71
std::string pp(const state_formulas::imp &x, bool arg0)
std::string pp(const state_formulas::mu &x, bool arg0)
bool is_monotonous(const state_formula &f)
Returns true if the state formula is monotonous.
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)
std::string pp(const state_formulas::delay &x, bool arg0)
std::string pp(const state_formulas::forall &x, bool arg0)
std::string pp(const state_formulas::sum &x, bool arg0)
std::string pp(const state_formulas::yaled &x, bool arg0)
std::string pp(const state_formulas::infimum &x, bool arg0)
std::string pp(const state_formulas::or_ &x, bool arg0)
std::string pp(const state_formulas::may &x, bool arg0)
std::string pp(const state_formulas::and_ &x, bool arg0)
std::string pp(const state_formulas::false_ &x, bool arg0)
std::string pp(const state_formulas::const_multiply_alt &x, bool arg0)
std::string pp(const state_formulas::state_formula_specification &x, bool arg0)
std::string pp(const state_formulas::yaled_timed &x, bool arg0)
std::string pp(const state_formulas::plus &x, bool arg0)
std::string pp(const state_formulas::variable &x, bool arg0)
std::set< data::sort_expression > find_sort_expressions(const state_formulas::state_formula &x)
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)
action_formula_actions(const core::parser &parser_)
Definition parse_impl.h:27
action_formulas::action_formula parse_ActFrm(const core::parse_node &node) const
Definition parse_impl.h:31
regular_formulas::regular_formula parse_RegFrm(const core::parse_node &node) const
Definition parse_impl.h:61
Function that determines if a state formula is time dependent.
Definition is_timed.h:25
void apply(const process::untyped_multi_action &)
Definition is_timed.h:43
void enter(const action_formulas::at &)
Definition is_timed.h:58
void apply(const data::data_expression &)
Definition is_timed.h:33
void apply(const data::untyped_data_parameter &)
Definition is_timed.h:38
untyped_state_formula_specification parse_StateFrmSpec(const core::parse_node &node) const
Definition parse_impl.h:204
state_formula_actions(const core::parser &parser_)
Definition parse_impl.h:95
state_formulas::state_formula parse_StateFrm(const core::parse_node &node) const
Definition parse_impl.h:133