Home | Trees | Indices | Help |
|
---|
|
Game graph with labeled states.
Its contraction is a Kripke structure. Given a Kripke structure and a partition of propositions, then the corresponding labeled game graph can be obtained by graph expansion.
Instance Methods | |||
|
|||
Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from |
Properties | |
Inherited from Inherited from |
Method Details |
Initialize the types of labelings on states and edges. Label types by exampleUse a >>> types = [ {'name': 'drink', 'values': {'tea', 'coffee'}, 'setter': True, 'default': 'tea'}, ] This will create a label type named Assuming this label type applies to nodes, you can now label a new node as: >>> g = LabeledDiGraph(types) >>> g.add_node(1, drink='coffee') If you omit the label when adding a new node, it gets the default value: >>> g.add_node(2) >>> g.node[2] {'drink': 'tea'} The main difference with vanilla >>> type(g.node[2]) tulip.transys.mathset.TypedDict The This allows us to add more values after creating the graph: >>> g.drink {'coffee', 'tea'} >>> g.drink.add('water') {'coffee', 'tea', 'water'} Finally, the graph will prevent us from accidentally using an
untyped label name, by raising an >>> g.add_node(3, day='Jan') AttributeError: ... To add untyped labels, do so explicitly: >>> g.add_node(3, day='Jan', check=False) >>> g.node[3] {'day': 'Jan', 'drink': 'tea'} Details on label typesEach label type is defined by a
and optionally the keys:
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue May 12 18:21:44 2015 | http://epydoc.sourceforge.net |