libutap
0.93
Uppaal Timed Automata Parser
|
#include <system.h>
Public Member Functions | |
TimedAutomataSystem () | |
TimedAutomataSystem (const TimedAutomataSystem &) | |
virtual | ~TimedAutomataSystem () |
declarations_t & | getGlobals () |
Returns the global declarations of the system. More... | |
std::list< template_t > & | getTemplates () |
Returns the templates of the system. More... | |
std::vector< template_t * > & | getDynamicTemplates () |
template_t * | getDynamicTemplate (const std::string &name) |
std::list< instance_t > & | getProcesses () |
Returns the processes of the system. More... | |
queries_t & | getQueries () |
Returns the queries enclosed in the model. More... | |
void | addPosition (uint32_t position, uint32_t offset, uint32_t line, const std::string &path) |
const Positions::line_t & | findPosition (uint32_t position) const |
variable_t * | addVariableToFunction (function_t *, frame_t, type_t, const std::string &, expression_t initital) |
variable_t * | addVariable (declarations_t *, type_t type, const std::string &, expression_t initial) |
void | addProgressMeasure (declarations_t *, expression_t guard, expression_t measure) |
template_t & | addTemplate (const std::string &, frame_t params, const bool isTA=true, const std::string &type="", const std::string &mode="") |
Creates and returns a new template. More... | |
template_t & | addDynamicTemplate (const std::string &, frame_t params) |
instance_t & | addInstance (const std::string &name, instance_t &instance, frame_t params, const std::vector< expression_t > &arguments) |
instance_t & | addLscInstance (const std::string &name, instance_t &instance, frame_t params, const std::vector< expression_t > &arguments) |
void | removeProcess (instance_t &instance) |
void | copyVariablesFromTo (template_t *from, template_t *to) const |
void | copyFunctionsFromTo (template_t *from, template_t *to) const |
void | addProcess (instance_t &instance) |
void | addGantt (declarations_t *, gantt_t &) |
void | accept (SystemVisitor &) |
void | setBeforeUpdate (expression_t) |
expression_t | getBeforeUpdate () |
void | setAfterUpdate (expression_t) |
expression_t | getAfterUpdate () |
void | addQuery (const query_t &query) |
bool | queriesEmpty () |
void | beginChanPriority (expression_t chan) |
void | addChanPriority (char separator, expression_t chan) |
const std::list< chan_priority_t > & | getChanPriorities () const |
std::list< chan_priority_t > & | getMutableChanPriorities () |
void | setProcPriority (const char *name, int priority) |
Sets process priority for process name. More... | |
int | getProcPriority (const char *name) const |
Returns process priority for process name. More... | |
bool | hasPriorityDeclaration () const |
Returns true if system has some priority declaration. More... | |
bool | hasStrictInvariants () const |
Returns true if system has some strict invariant. More... | |
void | recordStrictInvariant () |
Record that the system has some strict invariant. More... | |
bool | hasStopWatch () const |
Returns true if the system stops any clock. More... | |
void | recordStopWatch () |
Record that the system stops a clock. More... | |
bool | hasStrictLowerBoundOnControllableEdges () const |
Returns true if the system has guards on controllable edges with strict lower bounds. More... | |
void | recordStrictLowerBoundOnControllableEdges () |
Record that the system has guards on controllable edges with strict lower bounds. More... | |
void | clockGuardRecvBroadcast () |
bool | hasClockGuardRecvBroadcast () const |
void | setSyncUsed (sync_use_t s) |
sync_use_t | getSyncUsed () const |
void | setUrgentTransition () |
bool | hasUrgentTransition () const |
bool | hasDynamicTemplates () const |
void | addError (position_t, const std::string &msg, const std::string &ctx="") |
void | addWarning (position_t, const std::string &msg, const std::string &ctx="") |
bool | hasErrors () const |
bool | hasWarnings () const |
const std::vector< error_t > & | getErrors () const |
const std::vector< error_t > & | getWarnings () const |
void | clearErrors () |
void | clearWarnings () |
bool | isModified () const |
void | setModified (bool mod) |
iodecl_t * | addIODecl () |
Public Attributes | |
std::string | obsTA |
Protected Member Functions | |
variable_t * | addVariable (std::list< variable_t > &variables, frame_t frame, type_t type, const std::string &) |
Protected Attributes | |
bool | hasUrgentTrans |
bool | hasPriorities |
bool | hasStrictInv |
bool | stopsClock |
bool | hasStrictLowControlledGuards |
bool | hasGuardOnRecvBroadcast |
int | defaultChanPriority |
std::list< chan_priority_t > | chanPriorities |
std::map< std::string, int > | procPriority |
sync_use_t | syncUsed |
std::list< template_t > | templates |
std::list< template_t > | dynamicTemplates |
std::vector< template_t * > | dynamicTemplatesVec |
std::list< instance_t > | instances |
std::list< instance_t > | lscInstances |
bool | modified |
std::list< instance_t > | processes |
declarations_t | global |
expression_t | beforeUpdate |
expression_t | afterUpdate |
queries_t | queries |
std::string | location |
TimedAutomataSystem::TimedAutomataSystem | ( | ) |
Definition at line 917 of file system.cpp.
References addVariable(), UTAP::Constants::CLOCK, UTAP::Constants::COST, UTAP::frame_t::createFrame(), UTAP::type_t::createPrimitive(), defaultChanPriority, UTAP::declarations_t::frame, global, hasGuardOnRecvBroadcast, hasPriorities, hasStrictInv, hasStrictLowControlledGuards, hasUrgentTrans, modified, stopsClock, and UTAP::unused.
TimedAutomataSystem::TimedAutomataSystem | ( | const TimedAutomataSystem & | ta | ) |
Definition at line 935 of file system.cpp.
|
virtual |
Definition at line 946 of file system.cpp.
void TimedAutomataSystem::accept | ( | SystemVisitor & | visitor | ) |
Definition at line 1239 of file system.cpp.
References dynamicTemplates, UTAP::declarations_t::frame, UTAP::declarations_t::ganttChart, UTAP::frame_t::getSize(), global, UTAP::Constants::INSTANCE, UTAP::declarations_t::iodecl, UTAP::type_t::is(), UTAP::Constants::LSCINSTANCE, UTAP::Constants::PROCESS, UTAP::Constants::PROCESSSET, UTAP::declarations_t::progress, UTAP::type_t::stripArray(), templates, visit(), UTAP::SystemVisitor::visitCondition(), UTAP::SystemVisitor::visitEdge(), UTAP::SystemVisitor::visitGanttChart(), UTAP::SystemVisitor::visitInstance(), UTAP::SystemVisitor::visitIODecl(), UTAP::SystemVisitor::visitMessage(), UTAP::SystemVisitor::visitProcess(), UTAP::SystemVisitor::visitProgressMeasure(), UTAP::SystemVisitor::visitSystemAfter(), UTAP::SystemVisitor::visitSystemBefore(), UTAP::SystemVisitor::visitTemplateAfter(), UTAP::SystemVisitor::visitTemplateBefore(), and UTAP::SystemVisitor::visitUpdate().
Referenced by main(), parseXMLBuffer(), parseXMLFile(), parseXTA(), and UTAP::TypeChecker::TypeChecker().
void TimedAutomataSystem::addChanPriority | ( | char | separator, |
expression_t | chan | ||
) |
Definition at line 1328 of file system.cpp.
References chanPriorities.
Referenced by UTAP::SystemBuilder::addChanPriority().
template_t & TimedAutomataSystem::addDynamicTemplate | ( | const std::string & | , |
frame_t | params | ||
) |
Definition at line 994 of file system.cpp.
References UTAP::frame_t::add(), UTAP::frame_t::addSymbol(), UTAP::instance_t::arguments, UTAP::frame_t::createFrame(), UTAP::type_t::createInstance(), dynamicTemplates, UTAP::declarations_t::frame, UTAP::frame_t::getSize(), global, UTAP::instance_t::parameters, UTAP::instance_t::templ, UTAP::instance_t::uid, and UTAP::instance_t::unbound.
Referenced by UTAP::SystemBuilder::declDynamicTemplate().
void TimedAutomataSystem::addError | ( | position_t | position, |
const std::string & | msg, | ||
const std::string & | ctx = "" |
||
) |
Definition at line 1403 of file system.cpp.
References UTAP::position_t::end, and UTAP::position_t::start.
Referenced by UTAP::ExpressionBuilder::handleError(), and UTAP::TypeChecker::TypeChecker().
void TimedAutomataSystem::addGantt | ( | declarations_t * | context, |
gantt_t & | g | ||
) |
Definition at line 1115 of file system.cpp.
References UTAP::declarations_t::ganttChart.
Referenced by UTAP::SystemBuilder::ganttDeclEnd().
instance_t & TimedAutomataSystem::addInstance | ( | const std::string & | name, |
instance_t & | instance, | ||
frame_t | params, | ||
const std::vector< expression_t > & | arguments | ||
) |
Definition at line 1037 of file system.cpp.
References UTAP::frame_t::add(), UTAP::frame_t::addSymbol(), UTAP::instance_t::arguments, UTAP::type_t::createInstance(), UTAP::declarations_t::frame, UTAP::frame_t::getSize(), global, instances, UTAP::instance_t::mapping, UTAP::instance_t::parameters, UTAP::instance_t::templ, UTAP::instance_t::uid, and UTAP::instance_t::unbound.
Referenced by UTAP::SystemBuilder::instantiationEnd().
iodecl_t * TimedAutomataSystem::addIODecl | ( | ) |
Definition at line 1461 of file system.cpp.
References global, and UTAP::declarations_t::iodecl.
Referenced by UTAP::SystemBuilder::exprSync().
instance_t & TimedAutomataSystem::addLscInstance | ( | const std::string & | name, |
instance_t & | instance, | ||
frame_t | params, | ||
const std::vector< expression_t > & | arguments | ||
) |
Definition at line 1061 of file system.cpp.
References UTAP::frame_t::add(), UTAP::frame_t::addSymbol(), UTAP::instance_t::arguments, UTAP::type_t::createLscInstance(), UTAP::declarations_t::frame, UTAP::frame_t::getSize(), global, lscInstances, UTAP::instance_t::mapping, UTAP::instance_t::parameters, UTAP::instance_t::templ, UTAP::instance_t::uid, and UTAP::instance_t::unbound.
Referenced by UTAP::SystemBuilder::instantiationEnd().
void TimedAutomataSystem::addPosition | ( | uint32_t | position, |
uint32_t | offset, | ||
uint32_t | line, | ||
const std::string & | path | ||
) |
Definition at line 1392 of file system.cpp.
References UTAP::Positions::add().
Referenced by UTAP::ExpressionBuilder::addPosition().
void TimedAutomataSystem::addProcess | ( | instance_t & | instance | ) |
Definition at line 1098 of file system.cpp.
References UTAP::frame_t::addSymbol(), UTAP::type_t::createProcess(), UTAP::type_t::createProcessSet(), UTAP::declarations_t::frame, UTAP::symbol_t::getName(), UTAP::symbol_t::getType(), global, processes, UTAP::instance_t::templ, UTAP::instance_t::uid, and UTAP::instance_t::unbound.
Referenced by UTAP::SystemBuilder::process().
void TimedAutomataSystem::addProgressMeasure | ( | declarations_t * | context, |
expression_t | guard, | ||
expression_t | measure | ||
) |
Definition at line 1189 of file system.cpp.
References UTAP::progress_t::guard, UTAP::progress_t::measure, and UTAP::declarations_t::progress.
Referenced by UTAP::SystemBuilder::declProgress().
void TimedAutomataSystem::addQuery | ( | const query_t & | query | ) |
Definition at line 1120 of file system.cpp.
References queries.
Referenced by UTAP::SystemBuilder::queryEnd().
template_t & TimedAutomataSystem::addTemplate | ( | const std::string & | , |
frame_t | params, | ||
const bool | isTA = true , |
||
const std::string & | type = "" , |
||
const std::string & | mode = "" |
||
) |
Creates and returns a new template.
The template is created with the given name and parameters and added to the global frame. The method does not check for duplicate declarations. An instance with the same name and parameters is added as well.
Definition at line 971 of file system.cpp.
References UTAP::frame_t::add(), UTAP::frame_t::addSymbol(), UTAP::instance_t::arguments, UTAP::frame_t::createFrame(), UTAP::type_t::createInstance(), UTAP::type_t::createLscInstance(), UTAP::declarations_t::frame, UTAP::frame_t::getSize(), global, UTAP::instance_t::parameters, UTAP::instance_t::templ, templates, UTAP::instance_t::uid, and UTAP::instance_t::unbound.
Referenced by UTAP::SystemBuilder::procBegin().
variable_t* UTAP::TimedAutomataSystem::addVariable | ( | declarations_t * | , |
type_t | type, | ||
const std::string & | , | ||
expression_t | initial | ||
) |
Referenced by UTAP::SystemBuilder::addVariable(), addVariableToFunction(), getQueries(), and TimedAutomataSystem().
|
protected |
variable_t * TimedAutomataSystem::addVariableToFunction | ( | function_t * | , |
frame_t | , | ||
type_t | , | ||
const std::string & | , | ||
expression_t | initital | ||
) |
Definition at line 1142 of file system.cpp.
References UTAP::frame_t::addSymbol(), addVariable(), UTAP::variable_t::expr, UTAP::frame_t::getIndexOf(), UTAP::variable_t::uid, and variables.
Referenced by UTAP::SystemBuilder::addVariable().
void TimedAutomataSystem::addWarning | ( | position_t | position, |
const std::string & | msg, | ||
const std::string & | ctx = "" |
||
) |
Definition at line 1411 of file system.cpp.
References UTAP::position_t::end, and UTAP::position_t::start.
Referenced by UTAP::ExpressionBuilder::handleWarning(), and UTAP::TypeChecker::TypeChecker().
void TimedAutomataSystem::beginChanPriority | ( | expression_t | chan | ) |
Definition at line 1320 of file system.cpp.
References chanPriorities, hasPriorities, and UTAP::chan_priority_t::head.
Referenced by UTAP::SystemBuilder::beginChanPriority().
void TimedAutomataSystem::clearErrors | ( | ) |
Definition at line 1441 of file system.cpp.
void TimedAutomataSystem::clearWarnings | ( | ) |
Definition at line 1446 of file system.cpp.
|
inline |
Definition at line 570 of file system.h.
Referenced by UTAP::TypeChecker::visitEdge().
void TimedAutomataSystem::copyFunctionsFromTo | ( | template_t * | from, |
template_t * | to | ||
) | const |
Definition at line 1184 of file system.cpp.
void TimedAutomataSystem::copyVariablesFromTo | ( | template_t * | from, |
template_t * | to | ||
) | const |
Definition at line 1174 of file system.cpp.
References UTAP::frame_t::add(), UTAP::declarations_t::frame, and UTAP::declarations_t::variables.
const Positions::line_t & TimedAutomataSystem::findPosition | ( | uint32_t | position | ) | const |
Definition at line 1398 of file system.cpp.
expression_t TimedAutomataSystem::getAfterUpdate | ( | ) |
Definition at line 1315 of file system.cpp.
References afterUpdate.
Referenced by UTAP::TypeChecker::TypeChecker().
expression_t TimedAutomataSystem::getBeforeUpdate | ( | ) |
Definition at line 1305 of file system.cpp.
References beforeUpdate.
Referenced by UTAP::TypeChecker::TypeChecker().
const std::list< chan_priority_t > & TimedAutomataSystem::getChanPriorities | ( | ) | const |
Definition at line 1335 of file system.cpp.
References chanPriorities.
Referenced by UTAP::XMLWriter::getChanPriority(), and UTAP::TypeChecker::visitSystemAfter().
template_t * TimedAutomataSystem::getDynamicTemplate | ( | const std::string & | name | ) |
Definition at line 1026 of file system.cpp.
References dynamicTemplates.
Referenced by UTAP::TypeChecker::checkExpression(), UTAP::ExpressionBuilder::exprExistsDynamicBegin(), UTAP::ExpressionBuilder::exprForAllDynamicBegin(), UTAP::ExpressionBuilder::exprForeachDynamicBegin(), UTAP::ExpressionBuilder::exprSumDynamicBegin(), and UTAP::SystemBuilder::procBegin().
std::vector< template_t * > & TimedAutomataSystem::getDynamicTemplates | ( | ) |
Definition at line 1014 of file system.cpp.
References dynamicTemplates, and dynamicTemplatesVec.
const vector< UTAP::error_t > & TimedAutomataSystem::getErrors | ( | ) | const |
Definition at line 1420 of file system.cpp.
Referenced by main().
declarations_t & TimedAutomataSystem::getGlobals | ( | ) |
Returns the global declarations of the system.
Definition at line 961 of file system.cpp.
References global.
Referenced by UTAP::XMLWriter::declaration(), UTAP::ExpressionBuilder::ExpressionBuilder(), UTAP::SystemBuilder::getCurrentDeclarationBlock(), and removeProcess().
std::list< chan_priority_t > & TimedAutomataSystem::getMutableChanPriorities | ( | ) |
Definition at line 1340 of file system.cpp.
References chanPriorities.
list< instance_t > & TimedAutomataSystem::getProcesses | ( | ) |
Returns the processes of the system.
Definition at line 956 of file system.cpp.
References processes.
Referenced by UTAP::SignalFlow::SignalFlow(), and UTAP::XMLWriter::system_instantiation().
int TimedAutomataSystem::getProcPriority | ( | const char * | name | ) | const |
Returns process priority for process name.
Definition at line 1351 of file system.cpp.
References procPriority.
queries_t & TimedAutomataSystem::getQueries | ( | ) |
Returns the queries enclosed in the model.
Definition at line 1128 of file system.cpp.
References addVariable(), UTAP::variable_t::expr, UTAP::declarations_t::frame, queries, and UTAP::declarations_t::variables.
|
inline |
list< template_t > & TimedAutomataSystem::getTemplates | ( | ) |
Returns the templates of the system.
Definition at line 951 of file system.cpp.
References templates.
Referenced by UTAP::XMLWriter::project().
const vector< UTAP::error_t > & TimedAutomataSystem::getWarnings | ( | ) | const |
Definition at line 1426 of file system.cpp.
Referenced by main().
|
inline |
|
inline |
bool TimedAutomataSystem::hasErrors | ( | ) | const |
Definition at line 1431 of file system.cpp.
Referenced by parseExpression(), parseXMLBuffer(), parseXMLFile(), and parseXTA().
bool TimedAutomataSystem::hasPriorityDeclaration | ( | ) | const |
Returns true if system has some priority declaration.
Definition at line 1357 of file system.cpp.
References hasPriorities.
bool TimedAutomataSystem::hasStopWatch | ( | ) | const |
Returns true if the system stops any clock.
Definition at line 1377 of file system.cpp.
References stopsClock.
bool TimedAutomataSystem::hasStrictInvariants | ( | ) | const |
Returns true if system has some strict invariant.
Definition at line 1367 of file system.cpp.
References hasStrictInv.
bool TimedAutomataSystem::hasStrictLowerBoundOnControllableEdges | ( | ) | const |
Returns true if the system has guards on controllable edges with strict lower bounds.
Definition at line 1382 of file system.cpp.
References hasStrictLowControlledGuards.
|
inline |
bool TimedAutomataSystem::hasWarnings | ( | ) | const |
Definition at line 1436 of file system.cpp.
bool TimedAutomataSystem::isModified | ( | ) | const |
Definition at line 1451 of file system.cpp.
References modified.
bool TimedAutomataSystem::queriesEmpty | ( | ) |
Definition at line 1124 of file system.cpp.
References queries.
void TimedAutomataSystem::recordStopWatch | ( | ) |
Record that the system stops a clock.
Definition at line 1372 of file system.cpp.
References stopsClock.
Referenced by UTAP::TypeChecker::visitState().
void TimedAutomataSystem::recordStrictInvariant | ( | ) |
Record that the system has some strict invariant.
Definition at line 1362 of file system.cpp.
References hasStrictInv.
Referenced by UTAP::TypeChecker::visitState().
void TimedAutomataSystem::recordStrictLowerBoundOnControllableEdges | ( | ) |
Record that the system has guards on controllable edges with strict lower bounds.
Definition at line 1387 of file system.cpp.
References hasStrictLowControlledGuards.
Referenced by UTAP::TypeChecker::visitEdge().
void TimedAutomataSystem::removeProcess | ( | instance_t & | instance | ) |
Definition at line 1085 of file system.cpp.
References UTAP::declarations_t::frame, getGlobals(), processes, UTAP::frame_t::remove(), and UTAP::instance_t::uid.
void TimedAutomataSystem::setAfterUpdate | ( | expression_t | e | ) |
Definition at line 1310 of file system.cpp.
References afterUpdate.
Referenced by UTAP::SystemBuilder::afterUpdate().
void TimedAutomataSystem::setBeforeUpdate | ( | expression_t | e | ) |
Definition at line 1300 of file system.cpp.
References beforeUpdate.
Referenced by UTAP::SystemBuilder::beforeUpdate().
void TimedAutomataSystem::setModified | ( | bool | mod | ) |
Definition at line 1456 of file system.cpp.
References modified.
void TimedAutomataSystem::setProcPriority | ( | const char * | name, |
int | priority | ||
) |
Sets process priority for process name.
Definition at line 1345 of file system.cpp.
References hasPriorities, and procPriority.
Referenced by UTAP::SystemBuilder::procPriority().
|
inline |
Definition at line 572 of file system.h.
Referenced by UTAP::TypeChecker::visitIODecl().
|
inline |
Definition at line 575 of file system.h.
Referenced by UTAP::TypeChecker::visitEdge().
|
protected |
Definition at line 611 of file system.h.
Referenced by getAfterUpdate(), and setAfterUpdate().
|
protected |
Definition at line 610 of file system.h.
Referenced by getBeforeUpdate(), and setBeforeUpdate().
|
protected |
Definition at line 588 of file system.h.
Referenced by addChanPriority(), beginChanPriority(), getChanPriorities(), and getMutableChanPriorities().
|
protected |
Definition at line 587 of file system.h.
Referenced by TimedAutomataSystem().
|
protected |
Definition at line 595 of file system.h.
Referenced by accept(), addDynamicTemplate(), getDynamicTemplate(), and getDynamicTemplates().
|
protected |
Definition at line 596 of file system.h.
Referenced by getDynamicTemplates().
|
protected |
Definition at line 608 of file system.h.
Referenced by accept(), addDynamicTemplate(), addInstance(), addIODecl(), addLscInstance(), addProcess(), addTemplate(), getGlobals(), and TimedAutomataSystem().
|
protected |
Definition at line 586 of file system.h.
Referenced by TimedAutomataSystem().
|
protected |
Definition at line 582 of file system.h.
Referenced by beginChanPriority(), hasPriorityDeclaration(), setProcPriority(), and TimedAutomataSystem().
|
protected |
Definition at line 583 of file system.h.
Referenced by hasStrictInvariants(), recordStrictInvariant(), and TimedAutomataSystem().
|
protected |
Definition at line 585 of file system.h.
Referenced by hasStrictLowerBoundOnControllableEdges(), recordStrictLowerBoundOnControllableEdges(), and TimedAutomataSystem().
|
protected |
Definition at line 581 of file system.h.
Referenced by TimedAutomataSystem().
|
protected |
Definition at line 599 of file system.h.
Referenced by addInstance().
|
protected |
Definition at line 601 of file system.h.
Referenced by addLscInstance().
|
protected |
Definition at line 602 of file system.h.
Referenced by isModified(), setModified(), and TimedAutomataSystem().
std::string UTAP::TimedAutomataSystem::obsTA |
Definition at line 521 of file system.h.
Referenced by UTAP::ExpressionBuilder::exprScenario().
|
protected |
Definition at line 605 of file system.h.
Referenced by addProcess(), getProcesses(), and removeProcess().
|
protected |
Definition at line 589 of file system.h.
Referenced by getProcPriority(), and setProcPriority().
|
protected |
Definition at line 612 of file system.h.
Referenced by addQuery(), getQueries(), and queriesEmpty().
|
protected |
Definition at line 584 of file system.h.
Referenced by hasStopWatch(), recordStopWatch(), and TimedAutomataSystem().
|
protected |
|
protected |
Definition at line 593 of file system.h.
Referenced by accept(), addTemplate(), and getTemplates().