fhelium.ir._operation_specs
Assemble dialect-owned operation specifications into one checked catalog.
DEFAULT_OPERATION_SPECS
constant View source
python
DEFAULT_OPERATION_SPECS = OperationSpecRegistry((*_DIALECT_OPERATION_SPECS, *_BRIDGE_OPERATION_SPECS))1
OperationEffect
type alias View source
python
OperationEffect = Literal['pure', 'rng-write', 'mutation', 'opaque']1
OperationSpec
class View source
python
OperationSpec(name: str, family: str, operand_arity: int | None, result_arity: int | None, operand_roles: tuple[str | None, ...] = (), result_roles: tuple[str | None, ...] = (), effect: OperationEffect = 'pure', validator: OperationValidator | None = None, operation_type: type[Operation] | None = None, dependencies: DependencyDescription = None)1
Describe one operation's family, signature, roles, and effects.
Attributes
| Name | Type | Default/value |
|---|---|---|
name | str | |
family | str | |
operand_arity | int | None | |
result_arity | int | None | |
operand_roles | tuple[str | None, ...] | () |
result_roles | tuple[str | None, ...] | () |
effect | OperationEffect | 'pure' |
validator | OperationValidator | None | None |
operation_type | type[Operation] | None | None |
dependencies | DependencyDescription | None |
resolve_dependencies
method
python
def resolve_dependencies(operation: Operation) -> OperationDependencies: ...1
Resolve fixed or instance-dependent element relationships.
diagnostics
method
python
def diagnostics(operation: Operation) -> tuple[str, ...]: ...1
Return local signature and role mismatches for operation.
OperationSpecRegistry
class View source
python
OperationSpecRegistry(specifications: Iterable[OperationSpec]=())1
Immutable lookup of uniquely named semantic operation specifications.
names
property
python
names: tuple[str, ...]1
Return registered operation names in declaration order.
get
method
python
def get(name: str) -> OperationSpec | None: ...1
Return a specification, or None for permissive unknown IR.
require
method
python
def require(name: str) -> OperationSpec: ...1
Return a specification or raise a lookup error.
OperationValidator
data View source
python
OperationValidator: TypeAlias = Callable[[Operation], tuple[str, ...]]1