3.2.11.4. dg/GraphInterface.hpp

This header contains the definitions for the hypergraph interface for dg::DG.

3.2.11.4.1. Class dg::DG::Vertex

class dg::DG::Vertex

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

3.2.11.4.1.1. Synopsis

Vertex()
explicit operator bool() const
bool isNull() const
std::size_t getId() const
std::shared_ptr<DG> getDG() const
std::size_t inDegree() const
InEdgeRange inEdges() const
std::size_t getOutDegree() const
OutEdgeRange outEdges() const
std::shared_ptr<graph::Graph> &getGraph() const

3.2.11.4.1.2. Details

Vertex()

Constructs a null descriptor.

explicit operator bool() const
Returns:

!isNull()

bool isNull() const
Returns:

whether this is a null descriptor or not.

std::size_t getId() const
Returns:

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

Throws:

LogicError if it is a null descriptor.

std::shared_ptr<DG> getDG() const
Returns:

the derivation graph the vertex belongs to.

Throws:

LogicError if it is a null descriptor.

std::size_t inDegree() const
Returns:

the in-degree of the vertex, including multiplicity of target multisets.

Throws:

LogicError if it is a null descriptor.

InEdgeRange inEdges() const
Returns:

a range of in-hyperedges for this vertex.

Throws:

LogicError if it is a null descriptor.

std::size_t getOutDegree() const
Returns:

the out-degree of the vertex, including multiplicity of source multisets.

Throws:

LogicError if it is a null descriptor.

OutEdgeRange outEdges() const
Returns:

a range of out-hyperedges for this vertex.

Throws:

LogicError if it is a null descriptor.

std::shared_ptr<graph::Graph> &getGraph() const
Returns:

the graph label of the vertex.

Throws:

LogicError if it is a null descriptor.

3.2.11.4.2. Class dg::DG::HyperEdge

class dg::DG::HyperEdge

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

3.2.11.4.2.1. Synopsis

HyperEdge()
explicit operator bool() const
bool isNull() const
std::size_t getId() const
std::shared_ptr<DG> getDG() const
std::size_t numSources() const
SourceRange sources() const
std::size_t numTargets() const
TargetRange targets() const
RuleRange rules() const
HyperEdge getInverse() const
std::vector<std::pair<std::string, std::string>> print(const graph::Printer &printer, const std::string &nomatchColour, const std::string &matchColour, int verbosity) const

3.2.11.4.2.2. Details

HyperEdge()

Constructs a null descriptor.

explicit operator bool() const
Returns:

!isNull()

bool isNull() const
Returns:

whether this is a null descriptor or not.

std::size_t getId() const
Returns:

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

Throws:

LogicError if it is a null descriptor.

std::shared_ptr<DG> getDG() const
Returns:

the derivation graph the hyperedge belongs to.

Throws:

LogicError if it is a null descriptor.

std::size_t numSources() const
Returns:

the number of sources of the hyperedge.

Throws:

LogicError if it is a null descriptor.

SourceRange sources() const
Returns:

the sources of the hyperedge.

Throws:

LogicError if it is a null descriptor.

std::size_t numTargets() const
Returns:

the number of targets of the hyperedge.

Throws:

LogicError if it is a null descriptor.

TargetRange targets() const
Returns:

the targets of the hyperedge.

Throws:

LogicError if it is a null descriptor.

RuleRange rules() const
Returns:

a range of the rules associated with the hyperedge.

Throws:

LogicError if it is a null descriptor.

HyperEdge getInverse() const
Returns:

a descriptor for the inverse hyperedge of this one, if it exists. Otherwise a null descriptor is returned.

Throws:

LogicError if it is a null descriptor.

Throws:

LogicError if not getDG()->isLocked().

std::vector<std::pair<std::string, std::string>> print(const graph::Printer &printer, const std::string &nomatchColour, const std::string &matchColour, int verbosity) const

Print the derivations represented by the hyperedge. All possible Double-Pushout diagrams are printed. The matchColour must be a valid colour for TikZ, which is applied to the rule and its image in the bottom span.

Parameters:

verbosity

the level of debug information to print. Defaults to 0.

  • 0 (or less): print no information.

  • 1: print debug information within the outer printing algorithm, but not debug information related to rule composition.

  • 10: also print information for morphism generation for rule composition.

  • 20: also print rule composition information.

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.

Throws:

LogicError if it is a null descriptor.

Throws:

LogicError if it has no rules.

3.2.11.4.3. Class dg::DG::VertexIterator

class dg::DG::VertexIterator

An iterator for traversing all vertices in a derivation graph. It models a forward iterator.

3.2.11.4.3.1. Synopsis

VertexIterator()

3.2.11.4.3.2. Details

VertexIterator()

Construct a past-the-end iterator.

3.2.11.4.4. Class dg::DG::VertexRange

class dg::DG::VertexRange

A range of all vertices in a derivation graph.

3.2.11.4.4.1. Synopsis

3.2.11.4.5. Class dg::DG::EdgeIterator

class dg::DG::EdgeIterator

An iterator for traversing all edges in a graph. It models a forward iterator.

3.2.11.4.5.1. Synopsis

EdgeIterator()

3.2.11.4.5.2. Details

EdgeIterator()

Construct a past-the-end iterator.

3.2.11.4.6. Class dg::DG::EdgeRange

class dg::DG::EdgeRange

A range of all edges in a derivation graph.

3.2.11.4.6.1. Synopsis

3.2.11.4.7. Class dg::DG::InEdgeIterator

class dg::DG::InEdgeIterator

An iterator for enumerating all in-edges of a vertex. It models a forward iterator.

3.2.11.4.7.1. Synopsis

InEdgeIterator()

3.2.11.4.7.2. Details

InEdgeIterator()

Construct a past-the-end iterator.

3.2.11.4.8. Class dg::DG::InEdgeRange

class dg::DG::InEdgeRange

A range of all in-edges of a vertex.

3.2.11.4.8.1. Synopsis

3.2.11.4.9. Class dg::DG::OutEdgeIterator

class dg::DG::OutEdgeIterator

An iterator for enumerating all out-edges of a vertex. It models a forward iterator.

3.2.11.4.9.1. Synopsis

OutEdgeIterator()

3.2.11.4.9.2. Details

OutEdgeIterator()

Construct a past-the-end iterator.

3.2.11.4.10. Class dg::DG::OutEdgeRange

class dg::DG::OutEdgeRange

A range of all out-edges of a vertex.

3.2.11.4.10.1. Synopsis

3.2.11.4.11. Class dg::DG::SourceIterator

class dg::DG::SourceIterator

An iterator for enumerating all sources of a hyperedge. It models a forward iterator.

3.2.11.4.11.1. Synopsis

SourceIterator()

3.2.11.4.11.2. Details

SourceIterator()

Construct a past-the-end iterator.

3.2.11.4.12. Class dg::DG::SourceRange

class dg::DG::SourceRange

A range of all sources of a hyperedge.

3.2.11.4.12.1. Synopsis

3.2.11.4.13. Class dg::DG::TargetIterator

class dg::DG::TargetIterator

An iterator for enumerating all targets of a hyperedge. It models a forward iterator.

3.2.11.4.13.1. Synopsis

TargetIterator()

3.2.11.4.13.2. Details

TargetIterator()

Construct a past-the-end iterator.

3.2.11.4.14. Class dg::DG::TargetRange

class dg::DG::TargetRange

A range of all sources of a hyperedge.

3.2.11.4.14.1. Synopsis

3.2.11.4.15. Class dg::DG::RuleIterator

class dg::DG::RuleIterator

An iterator for enumerating all rules of a hyperedge. It models a forward iterator.

3.2.11.4.15.1. Synopsis

RuleIterator()

3.2.11.4.15.2. Details

RuleIterator()

Construct a past-the-end iterator.

3.2.11.4.16. Class dg::DG::RuleRange

class dg::DG::RuleRange

A range of all rules of a hyperedge.

3.2.11.4.16.1. Synopsis