Module extension

Source
Expand description

Extensions

TODO: YAML declaration and parsing. This should be similar to a plugin system (outside the types module), which also parses nested OpDefs.

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§

CustomValidator
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.
ExtensionRegistry
Extension Registries store extensions to be looked up e.g. during validation.
ExtensionSet
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§

ExtensionBuildError
An error that can occur in building a new extension.
ExtensionRegistryError
An error that can occur in defining an extension registry.
ExtensionRegistryLoadError
An error that can occur while loading an extension registry.
LowerFunc
Different ways that an OpDef can lower operation nodes i.e. provide a Hugr that implements the operation using a set of other extensions.
SignatureError
An error that can occur in computing the signature of a node. TODO: decide on failure modes
SignatureFunc
The ways in which an OpDef may compute the Signature of each operation node.
TypeDefBound
The type bound of a TypeDef

Statics§

EMPTY_REG
An Extension Registry containing no extensions.

Traits§

ConstFold
Trait implemented by extension operations that can perform constant folding.
CustomSignatureFunc
Trait necessary for binary computations of OpDef signature
SignatureFromArgs
Compute signature of OpDef given type arguments.
ValidateJustArgs
Trait for validating type arguments to a PolyFuncTypeRV beyond conformation to declared type parameter (which should have been checked beforehand), given just the arguments.
ValidateTypeArgs
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§

ConstFoldResult
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.
ExtensionId
A unique identifier for a extension.