An automata representation of a TESLA assertion.
This representation can be either deterministic (for easy generation of instrumentation code) or non-deterministic (for easy creation and analysis).
An Automaton owns its consituent State objects; Transition ownership rests with the State objects.
Definition at line 74 of file Automaton.h.
#include "Automaton.h"
Public Types | |
enum | Type { Unlinked, Linked, Deterministic } |
Automata representations, in increasing order of realisability. More... | |
typedef llvm::SmallVector < State *, 10 > | StateVector |
Public Member Functions | |
virtual | ~Automaton () |
virtual bool | IsRealisable () const |
size_t | ID () const |
const AutomatonDescription & | getAssertion () const |
const Usage * | Use () const |
size_t | StateCount () const |
size_t | TransitionCount () const |
std::string | Name () const |
Short, unique name. More... | |
std::string | String () const |
Human-readable representation. More... | |
std::string | Dot () const |
GraphViz representation. More... | |
TransitionSets::const_iterator | begin () const |
Iterate over state transitions. More... | |
TransitionSets::const_iterator | end () const |
Protected Member Functions | |
Automaton (size_t id, const AutomatonDescription &, const Usage *, llvm::StringRef Name, llvm::ArrayRef< State * >, const TransitionSets &) | |
Protected Attributes | |
const size_t | id |
const AutomatonDescription & | assertion |
Automaton states. More... | |
const Usage * | use |
How the automaton is used. More... | |
const std::string | name |
StateVector | States |
TransitionSets | Transitions |
Friends | |
class | internal::DFABuilder |
typedef llvm::SmallVector<State*,10> tesla::Automaton::StateVector |
Definition at line 92 of file Automaton.h.
Automata representations, in increasing order of realisability.
Enumerator | |
---|---|
Unlinked |
An NFA representation that includes sub-automata pseudo-transitions, e.g. "transition from state 2 to state 8 via sub-automaton 'active_close'". |
Linked |
An NFA with realisable transitions. |
Deterministic |
A DFA that can actually be implemented as instrumentation. |
Definition at line 78 of file Automaton.h.
|
inlinevirtual |
Definition at line 95 of file Automaton.h.
|
protected |
Definition at line 131 of file Automaton.cpp.
References tesla::Usage::identifier, tesla::AutomatonDescription::identifier, and States.
|
inline |
string tesla::Automaton::Dot | ( | ) | const |
GraphViz representation.
Definition at line 163 of file Automaton.cpp.
References Name(), States, and Transitions.
|
inline |
|
inline |
Definition at line 99 of file Automaton.h.
References assertion.
Referenced by tesla::FieldInstrumentation::AppendInstrumentation(), tesla::FnInstrumentation::AppendInstrumentation(), and tesla::internal::DFABuilder::ConstructDFA().
|
inline |
Definition at line 98 of file Automaton.h.
References id.
Referenced by tesla::FieldInstrumentation::AppendInstrumentation(), tesla::FnInstrumentation::AppendInstrumentation(), and tesla::internal::DFABuilder::ConstructDFA().
|
virtual |
|
inline |
Short, unique name.
Definition at line 104 of file Automaton.h.
References name.
Referenced by tesla::FieldInstrumentation::AppendInstrumentation(), tesla::FnInstrumentation::AppendInstrumentation(), tesla::internal::DFABuilder::ConstructDFA(), Dot(), and String().
|
inline |
string tesla::Automaton::String | ( | ) | const |
Human-readable representation.
Definition at line 149 of file Automaton.cpp.
References Name(), and States.
Referenced by tesla::FieldInstrumentation::AppendInstrumentation(), tesla::FnInstrumentation::AppendInstrumentation(), tesla::internal::DFABuilder::ConstructDFA(), and main().
|
inline |
|
inline |
Definition at line 100 of file Automaton.h.
References use.
Referenced by tesla::internal::DFABuilder::ConstructDFA().
|
friend |
Definition at line 75 of file Automaton.h.
|
protected |
Automaton states.
Definition at line 118 of file Automaton.h.
Referenced by getAssertion(), and tesla::NFA::Link().
|
protected |
Definition at line 117 of file Automaton.h.
Referenced by ID().
|
protected |
Definition at line 120 of file Automaton.h.
Referenced by Name().
|
protected |
Definition at line 122 of file Automaton.h.
Referenced by Automaton(), tesla::internal::DFABuilder::ConstructDFA(), Dot(), StateCount(), and String().
|
protected |
Definition at line 123 of file Automaton.h.
Referenced by begin(), Dot(), end(), IsRealisable(), and TransitionCount().
|
protected |
How the automaton is used.
Definition at line 119 of file Automaton.h.
Referenced by tesla::NFA::Link(), and Use().