Expand description
Extensions
TODO: YAML declaration and parsing. This should be similar to a plugin
system (outside the types
module), which also parses nested OpDef
s.
Modules§
- prelude
- Prelude extension - available in all contexts, defining common types, operations and constants.
- resolution
- Utilities for resolving operations and types present in a HUGR, and updating the list of used extensions.
- simple_
op - A trait that enum for op definitions that gathers up some shared functionality.
Structs§
- Custom
Validator - Encode a signature as
PolyFuncTypeRV
but with additional validation of type arguments via a custom binary. The binary cannot be serialized so will be lost over a serialization round-trip. - Extension
- A extension is a set of capabilities required to execute a graph.
- Extension
Registry - Extension Registries store extensions to be looked up e.g. during validation.
- Extension
Set - A set of extensions identified by their unique
ExtensionId
. - Folder
- Type holding a boxed const-folding function.
- OpDef
- Serializable definition for dynamically loaded operations.
- PRELUDE
- Prelude extension, containing common types and operations.
- PRELUDE_
REGISTRY - An extension registry containing only the prelude
- TypeDef
- A declaration of an opaque type. Note this does not provide any way to create instances
- Version
- SemVer version as defined by https://semver.org.
Enums§
- Extension
Build Error - An error that can occur in building a new extension.
- Extension
Registry Error - An error that can occur in defining an extension registry.
- Extension
Registry Load Error - An error that can occur while loading an extension registry.
- Lower
Func - Different ways that an OpDef can lower operation nodes i.e. provide a Hugr that implements the operation using a set of other extensions.
- Signature
Error - An error that can occur in computing the signature of a node. TODO: decide on failure modes
- Signature
Func - The ways in which an
OpDef
may compute the Signature of each operation node. - Type
DefBound - The type bound of a
TypeDef
Statics§
- EMPTY_
REG - An Extension Registry containing no extensions.
Traits§
- Const
Fold - Trait implemented by extension operations that can perform constant folding.
- Custom
Signature Func - Trait necessary for binary computations of
OpDef
signature - Signature
From Args - Compute signature of
OpDef
given type arguments. - Validate
Just Args - Trait for validating type arguments to a
PolyFuncTypeRV
beyond conformation to declared type parameter (which should have been checked beforehand), given just the arguments. - Validate
Type Args - Trait for validating type arguments to a
PolyFuncTypeRV
beyond conformation to declared type parameter (which should have been checked beforehand).
Functions§
- deserialize_
lower_ funcs - A function for deserializing sequences of
LowerFunc::FixedHugr
. - fold_
out_ row - Tag some output constants with
OutgoingPort
inferred from the ordering.
Type Aliases§
- Const
Fold Result - Output of constant folding an operation, None indicates folding was either not possible or unsuccessful. An empty vector indicates folding was successful and no values are output.
- Extension
Id - A unique identifier for a extension.