libFAUDES

Sections

Index

faudes::SccFilter Class Reference
[General Purpose Functions]

Filter for strictly connected components (SCC) search/compute routines. More...

#include <cfl_graphfncts.h>

List of all members.

Public Types

enum  FMode {
  NoFilter = 0x00, FindFirst = 0x01, IgnoreTrivial = 0x02, StatesAvoid = 0x10,
  StatesRequire = 0x20, EventsAvoid = 0x40, IgnoreLiveLocks = 0x1000, LiveLocksOnly = 0x2000,
  IgnoreUnaccessible = 0x4000
}
 

Typedef for filter modes.

More...

Public Member Functions

 SccFilter (void)
 Constructor (no filter).
 SccFilter (int mode, const Generator &rGen)
 Constructor (from flags w.r.t.
 SccFilter (int mode, const StateSet &rStatesAvoidRequire)
 Constructor (from flags and state set, either avoid or require).
 SccFilter (int mode, const StateSet &rStatesAvoid, const StateSet &rStatesRequire)
 Constructor (from flags and state sets).
 SccFilter (int mode, const EventSet &rEventsAvoid)
 Constructor (from flags and event sets).
 SccFilter (int mode, const StateSet &rStatesAvoid, const StateSet &rStatesRequire, const EventSet &rEventsAvoid)
 Constructor (from flags and sets).
 ~SccFilter (void)
 Destructor.
int Mode (void) const
 Member access.

Protected Attributes

int mMode
 Flag, combining bit masks from Mode.
const StateSetpStatesAvoid
 States to avoid (if flag StatesAvoid is set).
const StateSetpStatesRequire
 States to require (if flag StatesRequire is set).
const EventSetpEventsAvoid
 Events to avoid (if flag EventssAvoid is set).
StateSetmpStatesAvoid
 Local sets (optional).
StateSetmpStatesRequire
EventSetmpEventsAvoid

Static Protected Attributes

static const StateSet msEmptyStates = StateSet()
 Static emptysets.
static const EventSet msEmptyEvents = EventSet()

Friends

void SearchScc (const Idx vState, int &vRcount, const Generator &rGen, const SccFilter &rFilter, StateSet &rTodo, std::stack< Idx > &rStack, StateSet &rStackStates, std::map< const Idx, int > &rDfn, std::map< const Idx, int > &rLowLnk, std::list< StateSet > &rSccList, StateSet &rRoots)
 Search for strongly connected components (SCC).

Detailed Description

Filter for strictly connected components (SCC) search/compute routines.

When ComputeScc()/HasScc() traverse a specified transition sytem in their search, a SccFilter parameter can mute certain transitions. The respective filter conditions are set by the constructor and consist of a flag word (mMode) and additional parameters (depending on the flags). The Flags can be combined from the following:

  • NoFilter: std textbook beheviour;
  • FindFirst: stop the search after one SCC has been found;
  • IgnoreTrivial: ignore SCCs that consist of one state without selfloop;
  • StatesAvoid: ignore SCCs that contain one or more states from specified set;
  • StatesRequire: ignore SCCs that fail to contain at least one state froma specified set;
  • EventsAvoid: mute any transitions with an event label from the specified set.

Convenience modes set up the state related filter conditions from the set of marked states:

  • IgnoreLiveLocks: set StatesRequire to the marked states of a specified Generator;
  • LiveLocksOnly: set StatesAvoid to the marked states of a specified Generator;
  • IgnoreUnaccessible: initialise todo list with accessible states only.

Technical note: SccFilters are static objects in that they can not be edited after construction; interally, they use references to condition parameters that are required to exisit during the life time of the filter object.

Technical note: currently, there is no EventsRequire filter because the implementation interprets the transition relation primarily from a directed graph perspective; while StatesRequire makes sense for marked states semantics, we are not aware of any applications for a corresponding version of EventsRequire; please let us know if you require such an extension.

Definition at line 65 of file cfl_graphfncts.h.


Member Enumeration Documentation

Typedef for filter modes.

Enumerator:
NoFilter 
FindFirst 
IgnoreTrivial 
StatesAvoid 
StatesRequire 
EventsAvoid 
IgnoreLiveLocks 
LiveLocksOnly 
IgnoreUnaccessible 

Definition at line 84 of file cfl_graphfncts.h.


Constructor & Destructor Documentation

faudes::SccFilter::SccFilter ( void   ) 

Constructor (no filter).

Definition at line 50 of file cfl_graphfncts.cpp.

faudes::SccFilter::SccFilter ( int  mode,
const Generator rGen 
)

Constructor (from flags w.r.t.

Generator)

Definition at line 102 of file cfl_graphfncts.cpp.

faudes::SccFilter::SccFilter ( int  mode,
const StateSet rStatesAvoidRequire 
)

Constructor (from flags and state set, either avoid or require).

Definition at line 61 of file cfl_graphfncts.cpp.

faudes::SccFilter::SccFilter ( int  mode,
const StateSet rStatesAvoid,
const StateSet rStatesRequire 
)

Constructor (from flags and state sets).

Definition at line 81 of file cfl_graphfncts.cpp.

faudes::SccFilter::SccFilter ( int  mode,
const EventSet rEventsAvoid 
)

Constructor (from flags and event sets).

faudes::SccFilter::SccFilter ( int  mode,
const StateSet rStatesAvoid,
const StateSet rStatesRequire,
const EventSet rEventsAvoid 
)

Constructor (from flags and sets).

faudes::SccFilter::~SccFilter ( void   ) 

Destructor.

Definition at line 43 of file cfl_graphfncts.cpp.


Member Function Documentation

int faudes::SccFilter::Mode ( void   )  const [inline]

Member access.

Definition at line 119 of file cfl_graphfncts.h.


Friends And Related Function Documentation

void SearchScc ( const Idx  vState,
int &  vRcount,
const Generator rGen,
const SccFilter rFilter,
StateSet rTodo,
std::stack< Idx > &  rStack,
StateSet rStackStates,
std::map< const Idx, int > &  rDfn,
std::map< const Idx, int > &  rLowLnk,
std::list< StateSet > &  rSccList,
StateSet rRoots 
) [friend]

Search for strongly connected components (SCC).

This function partitions the stateset of a generator into equivalent classes such that states x1 and x2 are equivalent iff there is a path from x1 to x2 AND a path from x2 to x1.

This function implements the algorithm based on a depth first search presented in:

-- Aho, Hopcroft, Ullman: The Design and Analysis of Computer Algorithms --

While the original algorithm works on a directed graph, this implementation adds some features that refer to transition systems and allow to filter SCCs on the run. The filter condition is specified by the SccFilter parameter rFilter.

Note: this version is derived from earlier implementations used in various plug-ins; in due course, this version will replace earlier versions; filter conditions are not thouroughly tested.

Parameters:
vState State, from which the current recursion is started.
vRcount Denotes the current depth of the recursion.
rGen Transition system to investigate
rFilter Filter out specified transitions
rTodo Set of states that up to now were not found by the depth first search.
rStack Stack of states to represent current path.
rStackStates Set of states that are in rStack
rDfn Map assigning to each state idx its Depth-First Number.
rLowLnk Map assigning to each state its LOWLINK Number.
rSccList Set SCCs (accumulative result).
rRoots Set of states that each are root of some SCC (accumulative result).

Member Data Documentation

int faudes::SccFilter::mMode [protected]

Flag, combining bit masks from Mode.

Definition at line 119 of file cfl_graphfncts.h.

Definition at line 135 of file cfl_graphfncts.h.

Local sets (optional).

Definition at line 133 of file cfl_graphfncts.h.

Definition at line 134 of file cfl_graphfncts.h.

const EventSet faudes::SccFilter::msEmptyEvents = EventSet() [static, protected]

Definition at line 139 of file cfl_graphfncts.h.

const StateSet faudes::SccFilter::msEmptyStates = StateSet() [static, protected]

Static emptysets.

Definition at line 138 of file cfl_graphfncts.h.

Events to avoid (if flag EventssAvoid is set).

Definition at line 130 of file cfl_graphfncts.h.

States to avoid (if flag StatesAvoid is set).

Definition at line 126 of file cfl_graphfncts.h.

States to require (if flag StatesRequire is set).

Definition at line 128 of file cfl_graphfncts.h.


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

libFAUDES 2.18b --- 2010-12-17 --- c++ source docu by doxygen 1.6.3