Expand description

Framework for modeling and computing derived attributes for QGM graphs.

A derived attribute is a value that is associated with a specific QGM box and can be derived from a QGM graph and other derived attributes.

To implement a new attribute, define a new type to represent that attribute and implement the Attribute and AttributeKey for that type.

Note that the current implementation does not support parameterized Attribute instances, so MyAttr is OK, but MyAttr(i32) isn’t.

Structs

AsKey 🔒
Helper struct to derive a TypeMapKey from an Attribute.
A container for derived attributes associated with a specific QGM box.
A struct that represents an Attribute set that needs to be present for some follow-up logic (most likely transformation, but can also be pretty-printing or something else).

Traits

Attribute 🔒
A trait that defines the logic for deriving an attribute.
A trait sets an attribute Value type.

Functions

Consumes a set of attributes and produces a topologically sorted version of the elements in that set based on the dependency information provided by the Attribute::requires results.
Compute the attributes required to derive the given set of attributes that are not already in that set.
Compute the transitive closure of the given set of attributes.