12#ifndef MCRL2_LPS_UNTIME_H
13#define MCRL2_LPS_UNTIME_H
27template <
class INITIALIZER>
44template <
typename Specification>
82 std::vector <bool> time_variable_candidates(
m_spec.process().process_parameters().size(),
true);
83 std::vector <bool>::iterator j=time_variable_candidates.begin() ;
84 mCRL2log(
log::verbose) <<
"For untiming to function optimally, it is assumed that the input lps is rewritten to normal form" << std::endl;
95 assert(j == time_variable_candidates.end());
97 auto const& summands =
m_spec.process().action_summands();
98 for (
auto i = summands.begin(); i != summands.end(); ++i)
101 std::vector <bool>::iterator j = time_variable_candidates.
begin();
104 k!=summand_arguments.
end(); ++j, ++k, l++)
106 if ((*k!=real_zero)&&(*k!=*l)&&(*k!=i->multi_action().time()))
111 assert(j==time_variable_candidates.end());
115 j=time_variable_candidates.begin();
117 k!=
m_spec.process().process_parameters().end() ; ++j, ++k)
128 assert(j==time_variable_candidates.end());
130 return time_invariant;
140 s.condition() = lazy::and_(s.condition(),
142 greater(s.multi_action().time(), sort_real::real_(0))));
148 s.multi_action() =
multi_action(s.multi_action().actions());
156 for(
const variable& v: s.summation_variables())
158 if (variables_in_action.count(v)>0 || variables_in_assignments.count(v)>0)
179 fourier_motzkin(s.condition(), do_not_occur, new_condition, remaining_variables,
m_rewriter);
180 s.condition() = new_condition;
181 s.summation_variables() = do_occur + remaining_variables;
188 mCRL2log(
log::debug) <<
"Application of Fourier Motzkin failed with the message\n" << e.what() << std::endl;
197 s.summation_variables().push_front(time_var);
200 s.condition() = lazy::and_(s.condition(),
202 greater(time_var, sort_real::real_(0))));
229 m_spec.process().deadlock_summands().push_back(
232 if (
m_spec.process().has_time())
const_iterator end() const
Returns a const_iterator pointing to the end of the term_list.
const_iterator begin() const
Returns a const_iterator pointing to the beginning of the term_list.
void push_front(const Term &el)
Inserts a new element at the beginning of the current list.
\brief Assignment of a data expression to a variable
void add_identifiers(const std::set< core::identifier_string > &ids)
Add a set of identifiers to the context.
Rewriter that operates on data expressions.
Identifier generator that stores the identifiers of the context in a set. Using the operator()() and ...
LPS summand containing a deadlock.
Algorithm class for algorithms on linear process specifications. It can be instantiated with lps::spe...
lps_algorithm(Specification &spec)
Constructor.
Specification & m_spec
The specification that is processed by the algorithm.
\brief A timed multi-action
A stochastic process initializer.
data::data_expression m_time_invariant
Data expression expressing the invariant for variables relating to time.
data::set_identifier_generator m_identifier_generator
Identifier generator, for generating fresh identifiers.
data::data_expression calculate_time_invariant()
Data expression expressing the invariant for variables relating to time.
void untime(action_summand_type &s)
Apply untime to an action summand.
detail::lps_algorithm< Specification > super
Specification::process_type process_type
process_type::action_summand_type action_summand_type
const data::rewriter & m_rewriter
untime_algorithm(Specification &spec, bool add_invariants, bool apply_fourier_motzkin, const data::rewriter &r)
data::variable m_last_action_time
Variable denoting the time at which the last action occurred.
Standard exception class for reporting runtime errors.
Contains functions to apply Fourier-Motzkin on linear inequalities and data expressions.
MCRL2_EXPORT bool init(rewriter_interface *i, RewriterCompilingJitty *this_rewriter)
#define mCRL2log(LEVEL)
mCRL2log(LEVEL) provides the stream used to log.
Add your file description here.
data_expression and_(data_expression const &p, data_expression const &q)
Returns an expression equivalent to p or q.
const function_symbol & true_()
Constructor for function symbol true.
const basic_sort & real_()
Constructor for sort expression Real.
Namespace for all data library functionality.
function_symbol less_equal(const sort_expression &s)
Constructor for function symbol <=.
std::string pp(const abstraction &x)
std::set< core::identifier_string > function_and_mapping_identifiers(const data_specification &dataspec)
Returns the names of functions and mappings that occur in a data specification.
INITIALIZER make_process_initializer(const data::data_expression_list &expressions, const INITIALIZER &init)
std::vector< deadlock_summand > deadlock_summand_vector
\brief vector of deadlock_summands
void find_identifiers(const T &x, OutputIterator o)
void find_all_variables(const T &x, OutputIterator o)
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...