☰

*ON THIS PAGE*# Graphs

**Author(s):** Francisco Bueno.## Usage and interface

## Documentation on exports

`dgraph(Graph)`
`dlgraph(Graph)`
## Documentation on internals

## Documentation on imports

This module has the following direct dependencies:

This module implements utilities for work with graphs

**Library usage:**`:- use_module(library(graphs)).`**Exports:***Predicates:*`dgraph_to_ugraph/2`,`dlgraph_to_lgraph/2`,`edges_to_ugraph/2`,`edges_to_lgraph/2`.*Regular Types:*`dgraph/1`,`dlgraph/1`.

REGTYPEdgraph/1

A directed graph is a term `graph(V,E)` where `V` is a list of vertices and `E` is a list of edges (none necessarily sorted). Edges are pairs of vertices which are directed, i.e., `(a,b)` represents `a->b`. Two vertices `a` and `b` are equal only if `a==b`.

Usage:`dgraph(Graph)`

Graph is a directed graph.

REGTYPEdlgraph/1

A labeled directed graph is a directed graph where edges are triples of the form `(a,l,b)` where `l` is the label of the edge `(a,b)`.

Usage:`dlgraph(Graph)`

Graph is a directed labeled graph.

PREDICATEdgraph_to_ugraph/2

Usage:`dgraph_to_ugraph(Graph,UGraph)`

Converts Graph to UGraph.

*The following properties should hold at call time:*

(`term_typing:nonvar/1`)Graph is currently a term which is not a free variable.

(`term_typing:var/1`)UGraph is a free variable.

(`graphs:dgraph/1`)Graph is a directed graph.

(`term_typing:var/1`)UGraph is a free variable.*The following properties should hold upon exit:*

(`graphs:dgraph/1`)Graph is a directed graph.

(`ugraphs:ugraph/1`)UGraph is an ugraph.

PREDICATEdlgraph_to_lgraph/2

Usage:`dlgraph_to_lgraph(Graph,LGraph)`

Converts Edges to LGraph.

*The following properties should hold at call time:*

(`term_typing:nonvar/1`)Graph is currently a term which is not a free variable.

(`term_typing:var/1`)LGraph is a free variable.

(`graphs:dlgraph/1`)Graph is a directed labeled graph.

(`term_typing:var/1`)LGraph is a free variable.*The following properties should hold upon exit:*

(`graphs:dlgraph/1`)Graph is a directed labeled graph.

(`lgraphs:lgraph/2`)LGraph is a labeled graph of term terms.

PREDICATEedges_to_ugraph/2

Usage:`edges_to_ugraph(Edges,UGraph)`

Converts Graph to UGraph.

*The following properties should hold at call time:*

(`term_typing:nonvar/1`)Edges is currently a term which is not a free variable.

(`term_typing:var/1`)UGraph is a free variable.

(`basic_props:list/2`)Edges is a list of pairs.

(`term_typing:var/1`)UGraph is a free variable.*The following properties should hold upon exit:*

(`basic_props:list/2`)Edges is a list of pairs.

(`ugraphs:ugraph/1`)UGraph is an ugraph.

PREDICATEedges_to_lgraph/2

Usage:`edges_to_lgraph(Edges,LGraph)`

Converts Edges to LGraph.

*The following properties should hold at call time:*

(`term_typing:nonvar/1`)Edges is currently a term which is not a free variable.

(`term_typing:var/1`)LGraph is a free variable.

(`basic_props:list/2`)Edges is a list of triples.

(`term_typing:var/1`)LGraph is a free variable.*The following properties should hold upon exit:*

(`basic_props:list/2`)Edges is a list of triples.

(`lgraphs:lgraph/2`)LGraph is a labeled graph of term terms.

REGTYPEpair/1

Usage:`pair(P)`

P is a pair `(_,_)`.

REGTYPEtriple/1

Usage:`triple(P)`

P is a triple `(_,_,_)`.

*System library modules:*`sort`,`ugraphs`,`lgraphs`.*Packages:*`prelude`,`initial`,`condcomp`,`assertions`,`assertions/assertions_basic`,`basicmodes`,`regtypes`.

Generated with LPdoc using Ciao