hydra.shredding module
Shredding: the total, injective decomposition of a typed graph’s bindings into flat, path-addressed links (edges, properties, attributes) — the link view of a graph.
- hydra.shredding.shred_graph(graph: Graph) object
The link view of a typed graph: one node per bound term, each with the edge/property/attribute links found by a complete traversal of its term. Input must be typed (binding type schemes present); an untyped binding is a precondition failure, not a degraded mode.
- hydra.shredding.shred_schema(schema: Mapping[Name, Type]) object
The link view of a schema: one node per named type. A Type.variable referencing a schema-bound name is an edge; a forall-bound variable in scope is a property; leaf types are properties.
- hydra.shredding.shred_term(graph: Graph, name: Name, ts: TypeScheme, term: Term) object
Shred one binding (name, type scheme, term) of a graph into a subterm node.
- hydra.shredding.shred_term_links(graph: Graph, scope: Set[Name], path: SubtermPath, term: Term) object
Compute the outgoing links of a term at the given path, given the local scope of names bound by lambda/let steps already taken. Leaf terms yield a property or edge; a variable is classified as an edge (bound in the graph), a property (locally bound or a primitive), or a failure (free).
- hydra.shredding.shred_type(schema: Mapping[Name, T0], name: Name, typ: Type) object
Shred one named type of a schema into a subtype node.
- hydra.shredding.shred_type_links(schema: Mapping[Name, T0], scope: Set[Name], path: SubtypePath, typ: Type) object
Compute the outgoing links of a type at the given path, given the scope of forall-bound variables. A leaf type yields a property; a variable is an edge (a named type in the schema), a property (forall-bound in scope), or a failure (free).
- hydra.shredding.term_attributes(path: SubtermPath, term: Term) Sequence[SubtermAttribute]
The attribute links contributed by a term constructor at the given path.
- hydra.shredding.type_attributes(path: SubtypePath, typ: Type) Sequence[SubtypeAttribute]
The attribute links contributed by a type constructor at the given path.