libutap  0.93
Uppaal Timed Automata Parser
UTAP::DistanceCalculator Class Reference

DistanceCalculator is used in TargetFirst heuristic search order of Uppaal. More...

#include <signalflow.h>

Inheritance diagram for UTAP::DistanceCalculator:
Collaboration diagram for UTAP::DistanceCalculator:

Public Member Functions

 DistanceCalculator (const char *_title, TimedAutomataSystem &ta)
 
virtual ~DistanceCalculator ()
 
void addVariableNeedle (const char *var)
 adds a variable needle to I/O map More...
 
void addProcessNeedle (const char *proc)
 adds a variable needle to I/O map More...
 
void updateDistances ()
 Recalculates the distances to needles. More...
 
uint32_t getDistance (const char *element)
 Finds a distance measure for given element. More...
 
void printForDot (std::ostream &os, bool ranked, bool erd, bool cEdged) override
 Print I/O information in DOT format into given output stream. More...
 
- Public Member Functions inherited from UTAP::SignalFlow
 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) override
 System visitor pattern extracts read/write information from UCode. More...
 
int32_t visitExprStatement (ExprStatement *stat) override
 
int32_t visitForStatement (ForStatement *stat) override
 
int32_t visitIterationStatement (IterationStatement *stat) override
 
int32_t visitWhileStatement (WhileStatement *stat) override
 
int32_t visitDoWhileStatement (DoWhileStatement *stat) override
 
int32_t visitBlockStatement (BlockStatement *stat) override
 
int32_t visitSwitchStatement (SwitchStatement *stat) override
 
int32_t visitCaseStatement (CaseStatement *stat) override
 
int32_t visitDefaultStatement (DefaultStatement *stat) override
 
int32_t visitIfStatement (IfStatement *stat) override
 
int32_t visitBreakStatement (BreakStatement *stat) override
 
int32_t visitContinueStatement (ContinueStatement *stat) override
 
int32_t visitReturnStatement (ReturnStatement *stat) override
 
int32_t visitAssertStatement (UTAP::AssertStatement *stat) override
 
- Public Member Functions inherited from UTAP::StatementVisitor
virtual ~StatementVisitor ()
 

Protected Member Functions

void printProcsForDot (std::ostream &os, bool erd) override
 
void printVarsForDot (std::ostream &os, bool ranked, bool erd) override
 
- Protected Member Functions inherited from UTAP::SignalFlow
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 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

TimedAutomataSystemtaSystem
 
- Protected Attributes inherited from UTAP::SignalFlow
int verbosity
 
const char * title
 
procs_t procs
 
str2procs_t receivers
 
str2procs_t transmitters
 
strs_t processes
 
strs_t channels
 
strs_t variables
 
proc_tcTA
 
instance_tcP
 
const char * cChan
 
std::string chanString
 
bool inp
 
bool out
 
bool sync
 
bool paramsExpanded
 
std::stack< std::pair< bool, bool > > ioStack
 
std::stack< exprref_trefparams
 
std::stack< exprref_tvalparams
 

Additional Inherited Members

- Public Types inherited from UTAP::SignalFlow
typedef std::set< const char *, const less_strstrs_t
 
typedef std::map< const proc_t *, strs_tproc2strs_t
 
typedef std::map< const char *, strs_tstr2strs_t
 
typedef std::set< proc_t * > procs_t
 
typedef std::map< const char *, procs_t, less_strstr2procs_t
 
typedef std::map< const symbol_t, expression_texprref_t
 

Detailed Description

DistanceCalculator is used in TargetFirst heuristic search order of Uppaal.

Current implementation calculates complexity distances from a process to the given set of "needles" (e.g. variables or process location mentioned in query). In the future this can be refined to take the process-local information into account (e.g. calculate distance for individual edges within the process rather than just process).

Definition at line 266 of file signalflow.h.

Constructor & Destructor Documentation

◆ DistanceCalculator()

UTAP::DistanceCalculator::DistanceCalculator ( const char *  _title,
TimedAutomataSystem ta 
)
inline

Definition at line 299 of file signalflow.h.

References UTAP::SignalFlow::printForDot().

Here is the call graph for this function:

◆ ~DistanceCalculator()

DistanceCalculator::~DistanceCalculator ( )
virtual

Definition at line 1761 of file signalflow.cpp.

Member Function Documentation

◆ addProcessNeedle()

void DistanceCalculator::addProcessNeedle ( const char *  proc)

adds a variable needle to I/O map

Definition at line 1553 of file signalflow.cpp.

References UTAP::template_t::edges, UTAP::SignalFlow::processes, UTAP::SignalFlow::procs, UTAP::instance_t::templ, and UTAP::SignalFlow::transmitters.

Referenced by main().

Here is the caller graph for this function:

◆ addVariableNeedle()

void DistanceCalculator::addVariableNeedle ( const char *  var)

adds a variable needle to I/O map

Definition at line 1520 of file signalflow.cpp.

References UTAP::SignalFlow::variables.

◆ getDistance()

uint32_t DistanceCalculator::getDistance ( const char *  element)

Finds a distance measure for given element.

Definition at line 1772 of file signalflow.cpp.

◆ printForDot()

void DistanceCalculator::printForDot ( std::ostream &  os,
bool  ranked,
bool  erd,
bool  cEdged 
)
overridevirtual

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.

Definition at line 1784 of file signalflow.cpp.

References UTAP::SignalFlow::printForDot().

Here is the call graph for this function:

◆ printProcsForDot()

void DistanceCalculator::printProcsForDot ( std::ostream &  os,
bool  erd 
)
overrideprotectedvirtual

Reimplemented from UTAP::SignalFlow.

Definition at line 1699 of file signalflow.cpp.

References UTAP::SignalFlow::procs.

◆ printVarsForDot()

void DistanceCalculator::printVarsForDot ( std::ostream &  os,
bool  ranked,
bool  erd 
)
overrideprotectedvirtual

Reimplemented from UTAP::SignalFlow.

Definition at line 1726 of file signalflow.cpp.

References UTAP::SignalFlow::transmitters, and UTAP::SignalFlow::variables.

◆ updateDistances()

void DistanceCalculator::updateDistances ( )

Recalculates the distances to needles.

Definition at line 1792 of file signalflow.cpp.

Member Data Documentation

◆ taSystem

TimedAutomataSystem& UTAP::DistanceCalculator::taSystem
protected

Definition at line 292 of file signalflow.h.


The documentation for this class was generated from the following files: