libutap
|
Partitions the system into environment and IUT according to TRON assumptions. More...
#include <signalflow.h>
Public Member Functions | |
Partitioner (const char *_title, TimedAutomataSystem &ta) | |
~Partitioner () | |
int | partition (const strs_t &inputs, const strs_t &outputs) |
int | partition (std::istream &ioinfo) |
void | printForDot (std::ostream &os, bool ranked, bool erd, bool cEdged) |
Print I/O information in DOT format into given output stream. More... | |
void | printViolation (const proc_t *process, const char *variable) |
void | fillWithEnvProcs (strs_t &procs) |
void | fillWithIUTProcs (strs_t &procs) |
![]() | |
SignalFlow (const char *_title, TimedAutomataSystem &ta) | |
Analyse the system and extract I/O information: More... | |
void | setVerbose (int verbose) |
virtual | ~SignalFlow () |
All strings are from TASystem (don't dispose TASystem before SignalFlow). More... | |
void | printForTron (std::ostream &os) |
Print I/O information in TRON format into given output stream. More... | |
int32_t | visitEmptyStatement (EmptyStatement *stat) |
System visitor pattern extracts read/write information from UCode. More... | |
int32_t | visitExprStatement (ExprStatement *stat) |
int32_t | visitForStatement (ForStatement *stat) |
int32_t | visitIterationStatement (IterationStatement *stat) |
int32_t | visitWhileStatement (WhileStatement *stat) |
int32_t | visitDoWhileStatement (DoWhileStatement *stat) |
int32_t | visitBlockStatement (BlockStatement *stat) |
int32_t | visitSwitchStatement (SwitchStatement *stat) |
int32_t | visitCaseStatement (CaseStatement *stat) |
int32_t | visitDefaultStatement (DefaultStatement *stat) |
int32_t | visitIfStatement (IfStatement *stat) |
int32_t | visitBreakStatement (BreakStatement *stat) |
int32_t | visitContinueStatement (ContinueStatement *stat) |
int32_t | visitReturnStatement (ReturnStatement *stat) |
int32_t | visitAssertStatement (UTAP::AssertStatement *stat) |
![]() | |
virtual | ~StatementVisitor () |
Protected Member Functions | |
void | addProcs (const strs_t &chans, const str2procs_t &index, procs_t &result, procs_t &exclude) |
Adds processes to the result which use the channels from chans list according to index. More... | |
void | addIntChans (const procs_t &procs, strs_t &result, strs_t &exclude) |
Takes the internal channels of each process from procs list and adds them to the result list. More... | |
void | addIntVars (const procs_t &procs, strs_t &result, strs_t &exclude) |
Takes the variables of each process from procs list and adds them to the result list. More... | |
void | addProcsByVars (const strs_t &vars, procs_t &procs, procs_t &exclude) |
Take all variables and add all accessing processes to the list. More... | |
![]() | |
bool | checkParams (const symbol_t &s) |
void | addChan (const std::string &, strs_t &, str2procs_t &) |
void | addVar (const symbol_t &, str2strs_t &, str2procs_t &) |
void | visitProcess (instance_t &) |
void | visitExpression (const expression_t &) |
void | pushIO () |
void | popIO () |
virtual void | printProcsForDot (std::ostream &os, bool erd) |
virtual void | printVarsForDot (std::ostream &os, bool ranked, bool erd) |
virtual void | printVarsWriteForDot (std::ostream &os) |
virtual void | printVarsReadForDot (std::ostream &os) |
virtual void | printChansOnEdgesForDot (std::ostream &os) |
virtual void | printChansSeparateForDot (std::ostream &os, bool ranked, bool erd) |
Protected Attributes | |
procs_t | procsEnv |
procs_t | procsIUT |
procs_t | procsBad |
strs_t | chansIntEnv |
strs_t | chansIntIUT |
strs_t | observable |
strs_t | chansBad |
strs_t | varsEnv |
strs_t | varsIUT |
strs_t | varsBad |
strs_t | chansInp |
strs_t | chansOut |
const char * | rule |
![]() | |
int | verbosity |
const char * | title |
procs_t | procs |
str2procs_t | receivers |
str2procs_t | transmitters |
strs_t | processes |
strs_t | channels |
strs_t | variables |
proc_t * | cTA |
instance_t * | cP |
const char * | cChan |
std::string | chanString |
bool | inp |
bool | out |
bool | sync |
bool | paramsExpanded |
std::stack< std::pair< bool, bool > > | ioStack |
std::stack< exprref_t > | refparams |
std::stack< exprref_t > | valparams |
Additional Inherited Members | |
![]() | |
typedef std::set< const char *, const less_str > | strs_t |
typedef std::map< const proc_t *, strs_t > | proc2strs_t |
typedef std::map< const char *, strs_t > | str2strs_t |
typedef std::set< proc_t * > | procs_t |
typedef std::map< const char *, procs_t, less_str > | str2procs_t |
typedef std::map< const symbol_t, expression_t > | exprref_t |
Partitions the system into environment and IUT according to TRON assumptions.
inputs/outputs are channel names. Environment processes shout on inputs and listens to outputs, while IUT processes shout on outputs and listen to inputs. There are additional rules to complete the partitioning (to cathegorize the internal processes): 1) channels, that are not declared as inputs/outputs, are non-observable, called internal. 2) internal channel belongs to environment (IUT) if it is used by environment (IUT) process (respectively). Model is inconsistent and cannot be partitioned if the internal channel is used by both environment and IUT. 3) process belongs to environment (IUT) if it uses the internal environment (IUT) channel (respectively). 4) variable belongs to environment (IUT) if it is accessed by environment (IUT) process without observable input/output channel synchronization. Variable is not cathegorized (can be either) if accessed consistently only during observable input/output channel synchronization. 5) process belongs to environment (IUT) if accesses environment (IUT) variable (respectively) without observable channel synchronization. Returns: 0 if partitioning was consistent and complete, 1 if partitioning was consistent but incomplete (some proc/chan is free) 2 if partitioning was inconsistent (some proc/chan/var is both Env and IUT)
|
inline |
|
protected |
Takes the internal channels of each process from procs list and adds them to the result list.
Reports inconcistency if channel is in the exclude list.
References chansBad, observable, printViolation(), rule, and UTAP::SignalFlow::verbosity.
Referenced by partition().
Takes the variables of each process from procs list and adds them to the result list.
Reports inconcistency if variable is in the exclude list.
References observable, printViolation(), rule, varsBad, and UTAP::SignalFlow::verbosity.
Referenced by partition().
|
protected |
Adds processes to the result which use the channels from chans list according to index.
Reports inconsistency if some process happens to be in exclude list.
References printViolation(), procsBad, rule, and UTAP::SignalFlow::verbosity.
Referenced by partition().
|
protected |
Take all variables and add all accessing processes to the list.
Report inconcistencies if process happens to be in exclude list.
References observable, printViolation(), procsBad, UTAP::SignalFlow::receivers, rule, UTAP::SignalFlow::transmitters, and UTAP::SignalFlow::verbosity.
Referenced by partition().
References addIntChans(), addIntVars(), addProcs(), addProcsByVars(), chansBad, chansInp, chansIntEnv, chansIntIUT, chansOut, free(), observable, UTAP::SignalFlow::procs, procsBad, procsEnv, procsIUT, UTAP::SignalFlow::receivers, rule, UTAP::SignalFlow::transmitters, varsBad, varsEnv, varsIUT, and UTAP::SignalFlow::verbosity.
Referenced by main().
int UTAP::Partitioner::partition | ( | std::istream & | ioinfo | ) |
|
virtual |
Print I/O information in DOT format into given output stream.
ranked – puts oposite "ranks" on variables and channels erd – puts boxes and diamonds rather than (compact) ellipses. cEdged – channels are printed on edges rather than separate nodes.
Reimplemented from UTAP::SignalFlow.
References BADSTYLE, ch, UTAP::SignalFlow::channels, chansBad, chansInp, chansIntEnv, chansIntIUT, chansOut, ENVSTYLE, IUTSTYLE, MEDSTYLE, UTAP::SignalFlow::processes, UTAP::SignalFlow::procs, procsBad, procsEnv, procsIUT, UTAP::SignalFlow::receivers, set_remove(), UTAP::SignalFlow::title, UTAP::SignalFlow::transmitters, UTAP::SignalFlow::variables, varsBad, varsEnv, and varsIUT.
|
inline |
References UTAP::SignalFlow::proc_t::name, rule, and UTAP::SignalFlow::verbosity.
Referenced by addIntChans(), addIntVars(), addProcs(), and addProcsByVars().
|
protected |
Referenced by addIntChans(), partition(), and printForDot().
|
protected |
Referenced by partition(), printForDot(), and ~Partitioner().
|
protected |
Referenced by partition(), and printForDot().
|
protected |
Referenced by partition(), and printForDot().
|
protected |
Referenced by partition(), printForDot(), and ~Partitioner().
|
protected |
Referenced by addIntChans(), addIntVars(), addProcsByVars(), and partition().
|
protected |
Referenced by addProcs(), addProcsByVars(), partition(), and printForDot().
|
protected |
Referenced by fillWithEnvProcs(), partition(), and printForDot().
|
protected |
Referenced by fillWithIUTProcs(), partition(), and printForDot().
|
protected |
Referenced by addIntChans(), addIntVars(), addProcs(), addProcsByVars(), partition(), and printViolation().
|
protected |
Referenced by addIntVars(), partition(), and printForDot().
|
protected |
Referenced by partition(), and printForDot().
|
protected |
Referenced by partition(), and printForDot().