hugr_core::extension

Module resolution

Source
Expand description

Utilities for resolving operations and types present in a HUGR, and updating the list of used extensions. The functionalities of this module can be called from the type methods crate::Hugr::resolve_extension_defs, crate::ops::OpType::used_extensions, and crate::types::Signature::used_extensions.

When listing “used extensions” we only care about definitional extension requirements, i.e., the operations and types that are required to define the HUGR nodes and wire types. This is computed from the union of all extension required across the HUGR.

This is distinct from runtime extension requirements, which are defined more granularly in each function signature by the runtime_reqs field. See the extension_inference feature and related modules for that.

Note: These procedures are only temporary until hugr-model is stabilized. Once that happens, hugrs will no longer be directly deserialized using serde but instead will be created by the methods in crate::import. As these (will) automatically resolve extensions as the operations are created, we will no longer require this post-facto resolution step.

Structs§

Enums§

Functions§