Package tulip :: Package transys :: Module labeled_graphs
[frames] | no frames]

Module labeled_graphs

Base classes for labeled directed graphs

Classes
  States
Methods to manage states and initial states.
  Transitions
Methods for handling labeled transitions.
  LabeledDiGraph
Directed multi-graph with constrained labeling.
Functions
 
label_is_desired(attr_dict, desired_dict)
Return True if all labels match.
 
test_common_bug(value, desired_value)
 
str2singleton(ap_label)
If string, convert to set(string).
 
prepend_with(states, prepend_str)
Prepend items with given string.
Variables
  logger = logging.getLogger(__name__)
  __package__ = None
hash(x)
Function Details

label_is_desired(attr_dict, desired_dict)

 

Return True if all labels match.

Supports symbolic evaluation, if label type is callable.

str2singleton(ap_label)

 

If string, convert to set(string).

Convention: singleton str {'*'} can be passed as str '*' instead.

prepend_with(states, prepend_str)

 

Prepend items with given string.

Example

>>> states = [0, 1]
>>> prepend_str = 's'
>>> states = prepend_with(states, prepend_str)
>>> assert(states == ['s0', 's1'] )

See Also

tuple2ba, tuple2fts

Parameters:
  • states (iterable) - items prepended with string prepend_str
  • prepend_str (str or None) - text prepended to states. If None, then states is returned without modification