4.1.9.3. dg/GraphInterface

class mod.DGVertex

A descriptor of either a vertex in a derivation graph, or a null vertex.

__init__()

Constructs a null descriptor.

isNull()
Returns

whether this is a null descriptor or not.

Return type

bool

id

(Read-only) The index of the vertex. It will be in the range \([0, numVertices + numEdges[\).

Type

int

Raises

LogicError if it is a null descriptor.

dg

(Read-only) The derivation graph the vertex belongs to.

Type

DG

Raises

LogicError if it is a null descriptor.

inDegree

(Read-only) The in-degree of the vertex, including multiplicity of target multisets.

Type

int

Raises

LogicError if it is a null descriptor.

inEdges

(Read-only) A range of in-hyperedges for this vertex.

Type

DGInEdgeRange

Raises

LogicError if it is a null descriptor.

outDegree

(Read-only) The out-degree of the vertex, including multiplicity of source multisets.

Type

int

Raises

LogicError if it is a null descriptor.

outEdges

(Read-only) A range of out-hyperedges for this vertex.

Type

DGOutEdgeRange

Raises

LogicError if it is a null descriptor.

graph

(Read-only) The graph label of the vertex.

Type

Graph

Raises

LogicError if it is a null descriptor.

class mod.DGHyperEdge

A descriptor of either a hyperedge in a derivation graph, or a null edge.

__init__()

Constructs a null descriptor.

isNull()
Returns

whether this is a null descriptor or not.

Return type

bool

id

(Read-only) The index of the hyperedge. It will be in the range \([0, numVertices + numEdges[\).

Type

int

Raises

LogicError if it is a null descriptor.

dg

(Read-only) The derivation graph the edge belongs to.

Type

DG

Raises

LogicError if it is a null descriptor.

numSources

(Read-only) The number of sources of the hyperedge.

Type

int

sources

(Read-only) The sources of the hyperedge.

Type

DGSourceRange

Raises

LogicError if it is a null descriptor.

numTargets

(Read-only) The number of targerts of the hyperedge.

Type

int

targets

(Read-only) The targets of the hyperedge.

Type

DGTargetRange

Raises

LogicError if it is a null descriptor.

rules

(Read-only) The rules associated with the hyperedge.

Type

DGRuleRange

Raises

LogicError if it is a null descriptor.

inverse

(Read-only) A descriptor for the inverse hyperedge of this one, if it exists. Otherwise a null descriptor is returned.

Type

DGHyperEdge

Raises

LogicError if it is a null descriptor.

Raises

LogicError if not dg.locked.

print(printer=GraphPrinter(), nomatchColour='gray', matchColour='')

Print the derivations represented by the hyperedge. All possible Double-Pushout diagrams are printed.

Parameters
  • printer (GraphPrinter) – the printer to use for the figures.

  • matchColour (str) – the TikZ colour to use for the rule and its image in the bottom span.

Returns

A list with file data for each DPO diagram printed. Each element is a pair of filename prefixes, where the first entry is completed by appending _derL, _derK, or _derR. The second entry is completed similarly by appending _derG, _derD, or _derH.

Return type

list[tuple[str, str]]

Raises

LogicError if it is a null descriptor.

Raises

LogicError if it has no rules.