dag
packagestandard libraryThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package dag implements a language for expressing directed acyclicgraphs.
The general syntax of a rule is:
a, b < c, d;
which means c and d come after a and b in the partial order(that is, there are edges from c and d to a and b),but doesn't provide a relative order between a vs b or c vs d.
The rules can chain together, as in:
e < f, g < h;
which is equivalent to
e < f, g;f, g < h;
Except for the special bottom element "NONE", each namemust appear exactly once on the right-hand side of any rule.That rule serves as the definition of the allowed successorfor that name. The definition must appear before any usesof the name on the left-hand side of a rule. (That is, therules themselves must be ordered according to the partialorder, for easier reading by people.)
Negative assertions double-check the partial order:
i !< j
means that it must NOT be the case that i < j.Negative assertions may appear anywhere in the rules,even before i and j have been defined.
Comments begin with #.
Index¶
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
This section is empty.
Types¶
typeGraph¶
type Graph struct {Nodes []string// contains filtered or unexported fields}funcParse¶
Parse parses the DAG language and returns the transitive closure ofthe described graph. In the returned graph, there is an edge from "b"to "a" if b < a (or a > b) in the partial order.
func (*Graph)TransitiveReduction¶
func (g *Graph) TransitiveReduction()
TransitiveReduction removes edges from g that are transitivelyreachable. g must be transitively closed.