From 5f5bce4805897d5b0fa70af69fddc039f7a8d8ab Mon Sep 17 00:00:00 2001 From: Seyon Sivarajah Date: Thu, 12 Dec 2024 14:31:24 +0000 Subject: [PATCH] feat!: rename `extension_reqs` to `runtime_reqs` (#1776) Closes #1734 CustomConst::extension_reqs not renamed because they still refer to the extensions where they are defined. this should be updated to references to match ops and types https://github.com/CQCL/hugr/issues/1775 BREAKING CHANGE: `extension_reqs` field in FunctionType and Extension renamed to `runtime_reqs` --- hugr-core/README.md | 4 +- hugr-core/src/builder/cfg.rs | 2 +- hugr-core/src/builder/conditional.rs | 2 +- hugr-core/src/export.rs | 8 +- hugr-core/src/extension.rs | 17 ++-- .../src/extension/declarative/signature.rs | 2 +- hugr-core/src/extension/op_def.rs | 2 +- hugr-core/src/extension/resolution/types.rs | 5 +- .../src/extension/resolution/types_mut.rs | 4 +- hugr-core/src/hugr.rs | 6 +- hugr-core/src/hugr/rewrite/outline_cfg.rs | 2 +- hugr-core/src/hugr/rewrite/replace.rs | 2 +- .../upgrade/testcases/hugr_with_named_op.json | 4 +- hugr-core/src/hugr/validate.rs | 2 +- hugr-core/src/ops/controlflow.rs | 2 +- hugr-core/src/ops/dataflow.rs | 2 +- hugr-core/src/types/signature.rs | 24 ++--- hugr-passes/README.md | 4 +- hugr-py/src/hugr/_serialization/extension.py | 6 +- hugr-py/src/hugr/_serialization/ops.py | 8 +- hugr-py/src/hugr/_serialization/tys.py | 6 +- hugr-py/src/hugr/ext.py | 8 +- hugr-py/src/hugr/ops.py | 8 +- .../_json_defs/arithmetic/conversions.json | 22 ++--- .../hugr/std/_json_defs/arithmetic/float.json | 40 ++++---- .../_json_defs/arithmetic/float/types.json | 2 +- .../hugr/std/_json_defs/arithmetic/int.json | 94 +++++++++---------- .../std/_json_defs/arithmetic/int/types.json | 2 +- .../std/_json_defs/collections/array.json | 18 ++-- .../hugr/std/_json_defs/collections/list.json | 14 +-- hugr-py/src/hugr/std/_json_defs/logic.json | 10 +- hugr-py/src/hugr/std/_json_defs/prelude.json | 16 ++-- hugr-py/src/hugr/std/_json_defs/ptr.json | 8 +- hugr-py/src/hugr/std/int.py | 2 +- hugr-py/src/hugr/tys.py | 22 ++--- hugr-py/tests/serialization/test_extension.py | 8 +- hugr-py/tests/test_custom.py | 2 +- hugr/README.md | 4 +- resources/test/issue-1189.json | 2 +- specification/schema/hugr_schema_live.json | 10 +- .../schema/hugr_schema_strict_live.json | 10 +- .../schema/testing_hugr_schema_live.json | 10 +- .../testing_hugr_schema_strict_live.json | 10 +- .../arithmetic/conversions.json | 22 ++--- .../std_extensions/arithmetic/float.json | 40 ++++---- .../arithmetic/float/types.json | 2 +- .../std_extensions/arithmetic/int.json | 94 +++++++++---------- .../std_extensions/arithmetic/int/types.json | 2 +- .../std_extensions/collections/array.json | 18 ++-- .../std_extensions/collections/list.json | 14 +-- specification/std_extensions/logic.json | 10 +- specification/std_extensions/prelude.json | 16 ++-- specification/std_extensions/ptr.json | 8 +- 53 files changed, 326 insertions(+), 336 deletions(-) diff --git a/hugr-core/README.md b/hugr-core/README.md index 9bebc638f..46cafe16f 100644 --- a/hugr-core/README.md +++ b/hugr-core/README.md @@ -16,8 +16,8 @@ Please read the [API documentation here][]. ## Experimental Features - `extension_inference`: - Experimental feature which allows automatic inference of extension usages and - requirements in a HUGR and validation that extensions are correctly specified. + Experimental feature which allows automatic inference of which extra extensions + are required at runtime by a HUGR when validating it. Not enabled by default. - `declarative`: Experimental support for declaring extensions in YAML files, support is limited. diff --git a/hugr-core/src/builder/cfg.rs b/hugr-core/src/builder/cfg.rs index acf7e3af9..81c7d7269 100644 --- a/hugr-core/src/builder/cfg.rs +++ b/hugr-core/src/builder/cfg.rs @@ -273,7 +273,7 @@ impl + AsRef> CFGBuilder { signature.input, vec![type_row![]; n_cases], signature.output, - signature.extension_reqs, + signature.runtime_reqs, ) } diff --git a/hugr-core/src/builder/conditional.rs b/hugr-core/src/builder/conditional.rs index 0f4f6963d..0404abaf3 100644 --- a/hugr-core/src/builder/conditional.rs +++ b/hugr-core/src/builder/conditional.rs @@ -107,7 +107,7 @@ impl + AsRef> ConditionalBuilder { .clone() .try_into() .expect("Parent node does not have Conditional optype."); - let extension_delta = cond.signature().extension_reqs.clone(); + let extension_delta = cond.signature().runtime_reqs.clone(); let inputs = cond .case_input_row(case) .ok_or(ConditionalBuildError::NotCase { conditional, case })?; diff --git a/hugr-core/src/export.rs b/hugr-core/src/export.rs index 06be24fa9..0892822e9 100644 --- a/hugr-core/src/export.rs +++ b/hugr-core/src/export.rs @@ -218,7 +218,7 @@ impl<'a> Context<'a> { } OpType::DFG(dfg) => { - let extensions = self.export_ext_set(&dfg.signature.extension_reqs); + let extensions = self.export_ext_set(&dfg.signature.runtime_reqs); regions = self .bump .alloc_slice_copy(&[self.export_dfg(node, extensions)]); @@ -255,7 +255,7 @@ impl<'a> Context<'a> { constraints, signature, }); - let extensions = this.export_ext_set(&func.signature.body().extension_reqs); + let extensions = this.export_ext_set(&func.signature.body().runtime_reqs); regions = this .bump .alloc_slice_copy(&[this.export_dfg(node, extensions)]); @@ -659,7 +659,7 @@ impl<'a> Context<'a> { panic!("expected a `Case` node as a child of a `Conditional` node"); }; - let extensions = self.export_ext_set(&case_op.signature.extension_reqs); + let extensions = self.export_ext_set(&case_op.signature.runtime_reqs); regions.push(self.export_dfg(child, extensions)); } @@ -723,7 +723,7 @@ impl<'a> Context<'a> { pub fn export_func_type(&mut self, t: &FuncTypeBase) -> model::TermId { let inputs = self.export_type_row(t.input()); let outputs = self.export_type_row(t.output()); - let extensions = self.export_ext_set(&t.extension_reqs); + let extensions = self.export_ext_set(&t.runtime_reqs); self.make_term(model::Term::FuncType { inputs, outputs, diff --git a/hugr-core/src/extension.rs b/hugr-core/src/extension.rs index e1674afac..e644407f9 100644 --- a/hugr-core/src/extension.rs +++ b/hugr-core/src/extension.rs @@ -483,11 +483,8 @@ pub struct Extension { pub version: Version, /// Unique identifier for the extension. pub name: ExtensionId, - /// Other extensions defining types used by this extension. - /// That is, an upper-bound on the types that can be returned by - /// computing the signature of any operation in this extension, - /// for any possible [TypeArg]. - pub extension_reqs: ExtensionSet, + /// Runtime dependencies this extension has on other extensions. + pub runtime_reqs: ExtensionSet, /// Types defined by this extension. types: BTreeMap, /// Static values defined by this extension. @@ -513,7 +510,7 @@ impl Extension { Self { name, version, - extension_reqs: Default::default(), + runtime_reqs: Default::default(), types: Default::default(), values: Default::default(), operations: Default::default(), @@ -571,10 +568,10 @@ impl Extension { } } - /// Extend the requirements of this extension with another set of extensions. - pub fn add_requirements(&mut self, extension_reqs: impl Into) { - let reqs = mem::take(&mut self.extension_reqs); - self.extension_reqs = reqs.union(extension_reqs.into()); + /// Extend the runtime requirements of this extension with another set of extensions. + pub fn add_requirements(&mut self, runtime_reqs: impl Into) { + let reqs = mem::take(&mut self.runtime_reqs); + self.runtime_reqs = reqs.union(runtime_reqs.into()); } /// Allows read-only access to the operations in this Extension diff --git a/hugr-core/src/extension/declarative/signature.rs b/hugr-core/src/extension/declarative/signature.rs index d1479ae13..b84d56853 100644 --- a/hugr-core/src/extension/declarative/signature.rs +++ b/hugr-core/src/extension/declarative/signature.rs @@ -53,7 +53,7 @@ impl SignatureDeclaration { let body = FuncValueType { input: make_type_row(&self.inputs)?, output: make_type_row(&self.outputs)?, - extension_reqs: self.extensions.clone(), + runtime_reqs: self.extensions.clone(), }; let poly_func = PolyFuncTypeRV::new(op_params, body); diff --git a/hugr-core/src/extension/op_def.rs b/hugr-core/src/extension/op_def.rs index a40415be1..f9f77b412 100644 --- a/hugr-core/src/extension/op_def.rs +++ b/hugr-core/src/extension/op_def.rs @@ -245,7 +245,7 @@ impl SignatureFunc { SignatureFunc::MissingValidateFunc(ts) => (ts, args), }; let mut res = pf.instantiate(args, exts)?; - res.extension_reqs.insert(def.extension.clone()); + res.runtime_reqs.insert(def.extension.clone()); // If there are any row variables left, this will fail with an error: res.try_into() diff --git a/hugr-core/src/extension/resolution/types.rs b/hugr-core/src/extension/resolution/types.rs index 05997eb1b..3f9af94c5 100644 --- a/hugr-core/src/extension/resolution/types.rs +++ b/hugr-core/src/extension/resolution/types.rs @@ -125,11 +125,8 @@ pub(crate) fn collect_signature_exts( used_extensions: &mut ExtensionRegistry, missing_extensions: &mut ExtensionSet, ) { - // Note that we do not include the signature's `extension_reqs` here, as those refer + // Note that we do not include the signature's `runtime_reqs` here, as those refer // to _runtime_ requirements that we do not be require to be defined. - // - // See https://github.com/CQCL/hugr/issues/1734 - // TODO: Update comment once that issue gets implemented. collect_type_row_exts(&signature.input, used_extensions, missing_extensions); collect_type_row_exts(&signature.output, used_extensions, missing_extensions); } diff --git a/hugr-core/src/extension/resolution/types_mut.rs b/hugr-core/src/extension/resolution/types_mut.rs index a45862042..54c3db474 100644 --- a/hugr-core/src/extension/resolution/types_mut.rs +++ b/hugr-core/src/extension/resolution/types_mut.rs @@ -128,10 +128,8 @@ fn resolve_signature_exts( extensions: &ExtensionRegistry, used_extensions: &mut ExtensionRegistry, ) -> Result<(), ExtensionResolutionError> { - // Note that we do not include the signature's `extension_reqs` here, as those refer + // Note that we do not include the signature's `runtime_reqs` here, as those refer // to _runtime_ requirements that may not be currently present. - // See https://github.com/CQCL/hugr/issues/1734 - // TODO: Update comment once that issue gets implemented. resolve_type_row_exts(node, &mut signature.input, extensions, used_extensions)?; resolve_type_row_exts(node, &mut signature.output, extensions, used_extensions)?; Ok(()) diff --git a/hugr-core/src/hugr.rs b/hugr-core/src/hugr.rs index 99accb9ac..e3392b601 100644 --- a/hugr-core/src/hugr.rs +++ b/hugr-core/src/hugr.rs @@ -134,12 +134,12 @@ impl Hugr { pub fn infer_extensions(&mut self, remove: bool) -> Result<(), ExtensionError> { fn delta_mut(optype: &mut OpType) -> Option<&mut ExtensionSet> { match optype { - OpType::DFG(dfg) => Some(&mut dfg.signature.extension_reqs), + OpType::DFG(dfg) => Some(&mut dfg.signature.runtime_reqs), OpType::DataflowBlock(dfb) => Some(&mut dfb.extension_delta), OpType::TailLoop(tl) => Some(&mut tl.extension_delta), - OpType::CFG(cfg) => Some(&mut cfg.signature.extension_reqs), + OpType::CFG(cfg) => Some(&mut cfg.signature.runtime_reqs), OpType::Conditional(c) => Some(&mut c.extension_delta), - OpType::Case(c) => Some(&mut c.signature.extension_reqs), + OpType::Case(c) => Some(&mut c.signature.runtime_reqs), //OpType::Lift(_) // Not ATM: only a single element, and we expect Lift to be removed //OpType::FuncDefn(_) // Not at present due to the possibility of recursion _ => None, diff --git a/hugr-core/src/hugr/rewrite/outline_cfg.rs b/hugr-core/src/hugr/rewrite/outline_cfg.rs index 932d41ff4..b928367a1 100644 --- a/hugr-core/src/hugr/rewrite/outline_cfg.rs +++ b/hugr-core/src/hugr/rewrite/outline_cfg.rs @@ -71,7 +71,7 @@ impl OutlineCfg { } } } - extension_delta = extension_delta.union(o.signature().extension_reqs.clone()); + extension_delta = extension_delta.union(o.signature().runtime_reqs.clone()); let external_succs = h.output_neighbours(n).filter(|s| !self.blocks.contains(s)); match external_succs.at_most_one() { Ok(None) => (), // No external successors diff --git a/hugr-core/src/hugr/rewrite/replace.rs b/hugr-core/src/hugr/rewrite/replace.rs index 2f3a82c04..3e9558533 100644 --- a/hugr-core/src/hugr/rewrite/replace.rs +++ b/hugr-core/src/hugr/rewrite/replace.rs @@ -615,7 +615,7 @@ mod test { }, op_sig.input() ); - h.simple_entry_builder_exts(op_sig.output.clone(), 1, op_sig.extension_reqs.clone())? + h.simple_entry_builder_exts(op_sig.output.clone(), 1, op_sig.runtime_reqs.clone())? } else { h.simple_block_builder(op_sig.into_owned(), 1)? }; diff --git a/hugr-core/src/hugr/serialize/upgrade/testcases/hugr_with_named_op.json b/hugr-core/src/hugr/serialize/upgrade/testcases/hugr_with_named_op.json index b933a5cd7..fafbaeee9 100644 --- a/hugr-core/src/hugr/serialize/upgrade/testcases/hugr_with_named_op.json +++ b/hugr-core/src/hugr/serialize/upgrade/testcases/hugr_with_named_op.json @@ -24,7 +24,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, { @@ -81,7 +81,7 @@ "size": 2 } ], - "extension_reqs": [ + "runtime_reqs": [ "logic" ] } diff --git a/hugr-core/src/hugr/validate.rs b/hugr-core/src/hugr/validate.rs index e48e47ede..beefd2c96 100644 --- a/hugr-core/src/hugr/validate.rs +++ b/hugr-core/src/hugr/validate.rs @@ -61,7 +61,7 @@ impl Hugr { return Err(ValidationError::ExtensionsNotInferred { node: parent }); } let parent_extensions = match parent_op.inner_function_type() { - Some(s) => s.extension_reqs.clone(), + Some(s) => s.runtime_reqs.clone(), None => match parent_op.tag() { OpTag::Cfg | OpTag::Conditional => parent_op.extension_delta(), // ModuleRoot holds but does not execute its children, so allow any extensions diff --git a/hugr-core/src/ops/controlflow.rs b/hugr-core/src/ops/controlflow.rs index 44c78eae3..41dae59a6 100644 --- a/hugr-core/src/ops/controlflow.rs +++ b/hugr-core/src/ops/controlflow.rs @@ -344,7 +344,7 @@ impl OpTrait for Case { } fn extension_delta(&self) -> ExtensionSet { - self.signature.extension_reqs.clone() + self.signature.runtime_reqs.clone() } fn tag(&self) -> OpTag { diff --git a/hugr-core/src/ops/dataflow.rs b/hugr-core/src/ops/dataflow.rs index 9e6208b65..7f9ae9c22 100644 --- a/hugr-core/src/ops/dataflow.rs +++ b/hugr-core/src/ops/dataflow.rs @@ -158,7 +158,7 @@ impl OpTrait for T { Some(DataflowOpTrait::signature(self)) } fn extension_delta(&self) -> ExtensionSet { - DataflowOpTrait::signature(self).extension_reqs.clone() + DataflowOpTrait::signature(self).runtime_reqs.clone() } fn other_input(&self) -> Option { DataflowOpTrait::other_input(self) diff --git a/hugr-core/src/types/signature.rs b/hugr-core/src/types/signature.rs index 7578554ce..506869331 100644 --- a/hugr-core/src/types/signature.rs +++ b/hugr-core/src/types/signature.rs @@ -33,8 +33,8 @@ pub struct FuncTypeBase { /// Value outputs of the function. #[cfg_attr(test, proptest(strategy = "any_with::>(params)"))] pub output: TypeRowBase, - /// The extension requirements which are added by the operation - pub extension_reqs: ExtensionSet, + /// The extensions the function specifies as required at runtime. + pub runtime_reqs: ExtensionSet, } /// The concept of "signature" in the spec - the edges required to/from a node @@ -51,9 +51,9 @@ pub type Signature = FuncTypeBase; pub type FuncValueType = FuncTypeBase; impl FuncTypeBase { - /// Builder method, add extension_reqs to a FunctionType + /// Builder method, add runtime_reqs to a FunctionType pub fn with_extension_delta(mut self, rs: impl Into) -> Self { - self.extension_reqs = self.extension_reqs.union(rs.into()); + self.runtime_reqs = self.runtime_reqs.union(rs.into()); self } @@ -66,7 +66,7 @@ impl FuncTypeBase { Self { input: self.input.substitute(tr), output: self.output.substitute(tr), - extension_reqs: self.extension_reqs.substitute(tr), + runtime_reqs: self.runtime_reqs.substitute(tr), } } @@ -75,7 +75,7 @@ impl FuncTypeBase { Self { input: input.into(), output: output.into(), - extension_reqs: ExtensionSet::new(), + runtime_reqs: ExtensionSet::new(), } } @@ -118,7 +118,7 @@ impl FuncTypeBase { ) -> Result<(), SignatureError> { self.input.validate(extension_registry, var_decls)?; self.output.validate(extension_registry, var_decls)?; - self.extension_reqs.validate(var_decls) + self.runtime_reqs.validate(var_decls) } /// Returns a registry with the concrete extensions used by this signature. @@ -160,7 +160,7 @@ impl Default for FuncTypeBase { Self { input: Default::default(), output: Default::default(), - extension_reqs: Default::default(), + runtime_reqs: Default::default(), } } } @@ -286,7 +286,7 @@ impl Display for FuncTypeBase { f.write_str(" -> ")?; } f.write_char('[')?; - self.extension_reqs.fmt(f)?; + self.runtime_reqs.fmt(f)?; f.write_char(']')?; self.output.fmt(f) } @@ -298,7 +298,7 @@ impl TryFrom for Signature { fn try_from(value: FuncValueType) -> Result { let input: TypeRow = value.input.try_into()?; let output: TypeRow = value.output.try_into()?; - Ok(Self::new(input, output).with_extension_delta(value.extension_reqs)) + Ok(Self::new(input, output).with_extension_delta(value.runtime_reqs)) } } @@ -307,7 +307,7 @@ impl From for FuncValueType { Self { input: value.input.into(), output: value.output.into(), - extension_reqs: value.extension_reqs, + runtime_reqs: value.runtime_reqs, } } } @@ -316,7 +316,7 @@ impl PartialEq> for FuncTypeBase) -> bool { self.input == other.input && self.output == other.output - && self.extension_reqs == other.extension_reqs + && self.runtime_reqs == other.runtime_reqs } } diff --git a/hugr-passes/README.md b/hugr-passes/README.md index bdb566181..b9552fe75 100644 --- a/hugr-passes/README.md +++ b/hugr-passes/README.md @@ -32,8 +32,8 @@ Please read the [API documentation here][]. ## Experimental Features - `extension_inference`: - Experimental feature which allows automatic inference of extension usages and - requirements in a HUGR and validation that extensions are correctly specified. + Experimental feature which allows automatic inference of which extra extensions + are required at runtime by a HUGR when validating it. Not enabled by default. ## Recent Changes diff --git a/hugr-py/src/hugr/_serialization/extension.py b/hugr-py/src/hugr/_serialization/extension.py index 3017bd6f8..429bdd785 100644 --- a/hugr-py/src/hugr/_serialization/extension.py +++ b/hugr-py/src/hugr/_serialization/extension.py @@ -102,7 +102,7 @@ class OpDef(ConfiguredBaseModel, populate_by_name=True): def deserialize(self, extension: ext.Extension) -> ext.OpDef: signature = ext.OpDefSig( - self.signature.deserialize().with_extension_reqs([extension.name]) + self.signature.deserialize().with_runtime_reqs([extension.name]) if self.signature else None, self.binary, @@ -122,7 +122,7 @@ def deserialize(self, extension: ext.Extension) -> ext.OpDef: class Extension(ConfiguredBaseModel): version: SemanticVersion name: ExtensionId - extension_reqs: set[ExtensionId] + runtime_reqs: set[ExtensionId] types: dict[str, TypeDef] values: dict[str, ExtensionValue] operations: dict[str, OpDef] @@ -135,7 +135,7 @@ def deserialize(self) -> ext.Extension: e = ext.Extension( version=self.version, # type: ignore[arg-type] name=self.name, - extension_reqs=self.extension_reqs, + runtime_reqs=self.runtime_reqs, ) for k, t in self.types.items(): diff --git a/hugr-py/src/hugr/_serialization/ops.py b/hugr-py/src/hugr/_serialization/ops.py index b0e15f1c9..48b4e6b87 100644 --- a/hugr-py/src/hugr/_serialization/ops.py +++ b/hugr-py/src/hugr/_serialization/ops.py @@ -385,12 +385,12 @@ class DFG(DataflowOp): def insert_child_dfg_signature(self, inputs: TypeRow, outputs: TypeRow) -> None: self.signature = FunctionType( - input=list(inputs), output=list(outputs), extension_reqs=ExtensionSet([]) + input=list(inputs), output=list(outputs), runtime_reqs=ExtensionSet([]) ) def deserialize(self) -> ops.DFG: sig = self.signature.deserialize() - return ops.DFG(sig.input, sig.output, sig.extension_reqs) + return ops.DFG(sig.input, sig.output, sig.runtime_reqs) # ------------------------------------------------ @@ -443,7 +443,7 @@ class Case(BaseOp): def insert_child_dfg_signature(self, inputs: TypeRow, outputs: TypeRow) -> None: self.signature = stys.FunctionType( - input=list(inputs), output=list(outputs), extension_reqs=ExtensionSet([]) + input=list(inputs), output=list(outputs), runtime_reqs=ExtensionSet([]) ) def deserialize(self) -> ops.Case: @@ -484,7 +484,7 @@ class CFG(DataflowOp): def insert_port_types(self, inputs: TypeRow, outputs: TypeRow) -> None: self.signature = FunctionType( - input=list(inputs), output=list(outputs), extension_reqs=ExtensionSet([]) + input=list(inputs), output=list(outputs), runtime_reqs=ExtensionSet([]) ) def deserialize(self) -> ops.CFG: diff --git a/hugr-py/src/hugr/_serialization/tys.py b/hugr-py/src/hugr/_serialization/tys.py index 943e0f9d2..4a0a0e75b 100644 --- a/hugr-py/src/hugr/_serialization/tys.py +++ b/hugr-py/src/hugr/_serialization/tys.py @@ -308,17 +308,17 @@ class FunctionType(BaseType): input: TypeRow # Value inputs of the function. output: TypeRow # Value outputs of the function. # The extension requirements which are added by the operation - extension_reqs: ExtensionSet = Field(default_factory=ExtensionSet) + runtime_reqs: ExtensionSet = Field(default_factory=ExtensionSet) @classmethod def empty(cls) -> FunctionType: - return FunctionType(input=[], output=[], extension_reqs=[]) + return FunctionType(input=[], output=[], runtime_reqs=[]) def deserialize(self) -> tys.FunctionType: return tys.FunctionType( input=deser_it(self.input), output=deser_it(self.output), - extension_reqs=self.extension_reqs, + runtime_reqs=self.runtime_reqs, ) model_config = ConfigDict( diff --git a/hugr-py/src/hugr/ext.py b/hugr-py/src/hugr/ext.py index 165ba89fe..c22ef32df 100644 --- a/hugr-py/src/hugr/ext.py +++ b/hugr-py/src/hugr/ext.py @@ -267,8 +267,8 @@ class Extension: name: ExtensionId #: The version of the extension. version: Version - #: Extensions required by this extension, identified by name. - extension_reqs: set[ExtensionId] = field(default_factory=set) + #: Extensions required by this extension at runtime, identified by name. + runtime_reqs: set[ExtensionId] = field(default_factory=set) #: Type definitions in the extension. types: dict[str, TypeDef] = field(default_factory=dict) #: Values defined in the extension. @@ -286,7 +286,7 @@ def _to_serial(self) -> ext_s.Extension: return ext_s.Extension( name=self.name, version=self.version, # type: ignore[arg-type] - extension_reqs=self.extension_reqs, + runtime_reqs=self.runtime_reqs, types={k: v._to_serial() for k, v in self.types.items()}, values={k: v._to_serial() for k, v in self.values.items()}, operations={k: v._to_serial() for k, v in self.operations.items()}, @@ -319,7 +319,7 @@ def add_op_def(self, op_def: OpDef) -> OpDef: """ if op_def.signature.poly_func is not None: # Ensure the op def signature has the extension as a requirement - op_def.signature.poly_func = op_def.signature.poly_func.with_extension_reqs( + op_def.signature.poly_func = op_def.signature.poly_func.with_runtime_reqs( [self.name] ) diff --git a/hugr-py/src/hugr/ops.py b/hugr-py/src/hugr/ops.py index 682b2afb7..eb2471e14 100644 --- a/hugr-py/src/hugr/ops.py +++ b/hugr-py/src/hugr/ops.py @@ -456,7 +456,7 @@ def cached_signature(self) -> tys.FunctionType | None: return tys.FunctionType( input=self.types, output=[tys.Tuple(*self.types)], - extension_reqs=["prelude"], + runtime_reqs=["prelude"], ) def type_args(self) -> list[tys.TypeArg]: @@ -499,7 +499,7 @@ def cached_signature(self) -> tys.FunctionType | None: return tys.FunctionType( input=[tys.Tuple(*self.types)], output=self.types, - extension_reqs=["prelude"], + runtime_reqs=["prelude"], ) def type_args(self) -> list[tys.TypeArg]: @@ -1276,13 +1276,13 @@ def op_def(self) -> ext.OpDef: def cached_signature(self) -> tys.FunctionType | None: return tys.FunctionType.endo( [self.type_], - extension_reqs=["prelude"], + runtime_reqs=["prelude"], ) def outer_signature(self) -> tys.FunctionType: return tys.FunctionType.endo( [self.type_], - extension_reqs=["prelude"], + runtime_reqs=["prelude"], ) def _set_in_types(self, types: tys.TypeRow) -> None: diff --git a/hugr-py/src/hugr/std/_json_defs/arithmetic/conversions.json b/hugr-py/src/hugr/std/_json_defs/arithmetic/conversions.json index 5a2e20496..a01b4c30b 100644 --- a/hugr-py/src/hugr/std/_json_defs/arithmetic/conversions.json +++ b/hugr-py/src/hugr/std/_json_defs/arithmetic/conversions.json @@ -1,7 +1,7 @@ { "version": "0.1.0", "name": "arithmetic.conversions", - "extension_reqs": [ + "runtime_reqs": [ "arithmetic.float.types", "arithmetic.int.types" ], @@ -47,7 +47,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -91,7 +91,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -124,7 +124,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -155,7 +155,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -188,7 +188,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -232,7 +232,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -276,7 +276,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -307,7 +307,7 @@ "t": "I" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -368,7 +368,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -429,7 +429,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false diff --git a/hugr-py/src/hugr/std/_json_defs/arithmetic/float.json b/hugr-py/src/hugr/std/_json_defs/arithmetic/float.json index 8bd9f3268..31ccaaa59 100644 --- a/hugr-py/src/hugr/std/_json_defs/arithmetic/float.json +++ b/hugr-py/src/hugr/std/_json_defs/arithmetic/float.json @@ -1,7 +1,7 @@ { "version": "0.1.0", "name": "arithmetic.float", - "extension_reqs": [ + "runtime_reqs": [ "arithmetic.int.types" ], "types": {}, @@ -32,7 +32,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -69,7 +69,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -99,7 +99,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -136,7 +136,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -171,7 +171,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -201,7 +201,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -236,7 +236,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -271,7 +271,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -306,7 +306,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -341,7 +341,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -378,7 +378,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -415,7 +415,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -452,7 +452,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -487,7 +487,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -517,7 +517,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -554,7 +554,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -584,7 +584,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -621,7 +621,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -651,7 +651,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false diff --git a/hugr-py/src/hugr/std/_json_defs/arithmetic/float/types.json b/hugr-py/src/hugr/std/_json_defs/arithmetic/float/types.json index d590a83f4..56e35c50b 100644 --- a/hugr-py/src/hugr/std/_json_defs/arithmetic/float/types.json +++ b/hugr-py/src/hugr/std/_json_defs/arithmetic/float/types.json @@ -1,7 +1,7 @@ { "version": "0.1.0", "name": "arithmetic.float.types", - "extension_reqs": [], + "runtime_reqs": [], "types": { "float64": { "extension": "arithmetic.float.types", diff --git a/hugr-py/src/hugr/std/_json_defs/arithmetic/int.json b/hugr-py/src/hugr/std/_json_defs/arithmetic/int.json index e86337f4e..a1dcd21f9 100644 --- a/hugr-py/src/hugr/std/_json_defs/arithmetic/int.json +++ b/hugr-py/src/hugr/std/_json_defs/arithmetic/int.json @@ -1,7 +1,7 @@ { "version": "0.1.0", "name": "arithmetic.int", - "extension_reqs": [ + "runtime_reqs": [ "arithmetic.int.types" ], "types": {}, @@ -55,7 +55,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -124,7 +124,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -193,7 +193,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -279,7 +279,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -365,7 +365,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -434,7 +434,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -503,7 +503,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -613,7 +613,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -723,7 +723,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -808,7 +808,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -893,7 +893,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -951,7 +951,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -1009,7 +1009,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -1067,7 +1067,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -1125,7 +1125,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -1183,7 +1183,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -1241,7 +1241,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -1299,7 +1299,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -1357,7 +1357,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -1415,7 +1415,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -1484,7 +1484,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -1553,7 +1553,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -1622,7 +1622,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -1691,7 +1691,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -1777,7 +1777,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -1863,7 +1863,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -1932,7 +1932,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -2001,7 +2001,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -2070,7 +2070,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -2144,7 +2144,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": true @@ -2218,7 +2218,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": true @@ -2276,7 +2276,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -2329,7 +2329,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -2382,7 +2382,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -2451,7 +2451,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -2520,7 +2520,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -2589,7 +2589,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -2658,7 +2658,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -2711,7 +2711,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -2780,7 +2780,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -2849,7 +2849,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -2918,7 +2918,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -2971,7 +2971,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -3028,7 +3028,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": true @@ -3085,7 +3085,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": true @@ -3154,7 +3154,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false diff --git a/hugr-py/src/hugr/std/_json_defs/arithmetic/int/types.json b/hugr-py/src/hugr/std/_json_defs/arithmetic/int/types.json index 99ccc4026..60cf69f63 100644 --- a/hugr-py/src/hugr/std/_json_defs/arithmetic/int/types.json +++ b/hugr-py/src/hugr/std/_json_defs/arithmetic/int/types.json @@ -1,7 +1,7 @@ { "version": "0.1.0", "name": "arithmetic.int.types", - "extension_reqs": [], + "runtime_reqs": [], "types": { "int": { "extension": "arithmetic.int.types", diff --git a/hugr-py/src/hugr/std/_json_defs/collections/array.json b/hugr-py/src/hugr/std/_json_defs/collections/array.json index 36b426d4c..21e405151 100644 --- a/hugr-py/src/hugr/std/_json_defs/collections/array.json +++ b/hugr-py/src/hugr/std/_json_defs/collections/array.json @@ -1,7 +1,7 @@ { "version": "0.1.0", "name": "collections.array", - "extension_reqs": [], + "runtime_reqs": [], "types": { "array": { "extension": "collections.array", @@ -62,7 +62,7 @@ } ], "output": [], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -128,7 +128,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -184,7 +184,7 @@ "b": "A" } ], - "extension_reqs": [ + "runtime_reqs": [ "2" ] } @@ -215,7 +215,7 @@ "bound": "A" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -301,7 +301,7 @@ "b": "A" } ], - "extension_reqs": [ + "runtime_reqs": [ "4" ] }, @@ -342,7 +342,7 @@ "b": "A" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -467,7 +467,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -580,7 +580,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false diff --git a/hugr-py/src/hugr/std/_json_defs/collections/list.json b/hugr-py/src/hugr/std/_json_defs/collections/list.json index b5f905add..0fbafc638 100644 --- a/hugr-py/src/hugr/std/_json_defs/collections/list.json +++ b/hugr-py/src/hugr/std/_json_defs/collections/list.json @@ -1,7 +1,7 @@ { "version": "0.1.0", "name": "collections.list", - "extension_reqs": [], + "runtime_reqs": [], "types": { "List": { "extension": "collections.list", @@ -72,7 +72,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -153,7 +153,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -209,7 +209,7 @@ "t": "I" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -276,7 +276,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -334,7 +334,7 @@ "bound": "A" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -415,7 +415,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false diff --git a/hugr-py/src/hugr/std/_json_defs/logic.json b/hugr-py/src/hugr/std/_json_defs/logic.json index a5f0b3e41..7f90392ff 100644 --- a/hugr-py/src/hugr/std/_json_defs/logic.json +++ b/hugr-py/src/hugr/std/_json_defs/logic.json @@ -1,7 +1,7 @@ { "version": "0.1.0", "name": "logic", - "extension_reqs": [], + "runtime_reqs": [], "types": {}, "values": { "FALSE": { @@ -58,7 +58,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -89,7 +89,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -115,7 +115,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -146,7 +146,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false diff --git a/hugr-py/src/hugr/std/_json_defs/prelude.json b/hugr-py/src/hugr/std/_json_defs/prelude.json index 5aff50947..846394a32 100644 --- a/hugr-py/src/hugr/std/_json_defs/prelude.json +++ b/hugr-py/src/hugr/std/_json_defs/prelude.json @@ -1,7 +1,7 @@ { "version": "0.1.0", "name": "prelude", - "extension_reqs": [], + "runtime_reqs": [], "types": { "error": { "extension": "prelude", @@ -78,7 +78,7 @@ "b": "A" } ], - "extension_reqs": [ + "runtime_reqs": [ "0" ] } @@ -122,7 +122,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -153,7 +153,7 @@ "b": "A" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -195,7 +195,7 @@ "b": "A" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -218,7 +218,7 @@ "t": "I" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -266,7 +266,7 @@ "b": "A" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -288,7 +288,7 @@ } ], "output": [], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false diff --git a/hugr-py/src/hugr/std/_json_defs/ptr.json b/hugr-py/src/hugr/std/_json_defs/ptr.json index 6c2592485..18b1f26b6 100644 --- a/hugr-py/src/hugr/std/_json_defs/ptr.json +++ b/hugr-py/src/hugr/std/_json_defs/ptr.json @@ -1,7 +1,7 @@ { "version": "0.1.0", "name": "ptr", - "extension_reqs": [], + "runtime_reqs": [], "types": { "ptr": { "extension": "ptr", @@ -58,7 +58,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -100,7 +100,7 @@ "b": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -141,7 +141,7 @@ } ], "output": [], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false diff --git a/hugr-py/src/hugr/std/int.py b/hugr-py/src/hugr/std/int.py index 35985305f..8652cc135 100644 --- a/hugr-py/src/hugr/std/int.py +++ b/hugr-py/src/hugr/std/int.py @@ -87,7 +87,7 @@ def type_args(self) -> list[tys.TypeArg]: def cached_signature(self) -> tys.FunctionType | None: row: list[tys.Type] = [int_t(self.width)] * 2 - return tys.FunctionType.endo(row, extension_reqs=[INT_OPS_EXTENSION.name]) + return tys.FunctionType.endo(row, runtime_reqs=[INT_OPS_EXTENSION.name]) @classmethod def from_ext(cls, custom: ExtOp) -> Self | None: diff --git a/hugr-py/src/hugr/tys.py b/hugr-py/src/hugr/tys.py index b7a916b75..7494f4b14 100644 --- a/hugr-py/src/hugr/tys.py +++ b/hugr-py/src/hugr/tys.py @@ -443,7 +443,7 @@ class FunctionType(Type): input: TypeRow output: TypeRow - extension_reqs: ExtensionSet = field(default_factory=ExtensionSet) + runtime_reqs: ExtensionSet = field(default_factory=ExtensionSet) def type_bound(self) -> TypeBound: return TypeBound.Copyable @@ -452,7 +452,7 @@ def _to_serial(self) -> stys.FunctionType: return stys.FunctionType( input=ser_it(self.input), output=ser_it(self.output), - extension_reqs=self.extension_reqs, + runtime_reqs=self.runtime_reqs, ) @classmethod @@ -467,7 +467,7 @@ def empty(cls) -> FunctionType: @classmethod def endo( - cls, tys: TypeRow, extension_reqs: ExtensionSet | None = None + cls, tys: TypeRow, runtime_reqs: ExtensionSet | None = None ) -> FunctionType: """Function type with the same input and output types. @@ -475,9 +475,7 @@ def endo( >>> FunctionType.endo([Qubit]) FunctionType([Qubit], [Qubit]) """ - return cls( - input=tys, output=tys, extension_reqs=extension_reqs or ExtensionSet() - ) + return cls(input=tys, output=tys, runtime_reqs=runtime_reqs or ExtensionSet()) def flip(self) -> FunctionType: """Return a new function type with input and output types swapped. @@ -496,15 +494,15 @@ def resolve(self, registry: ext.ExtensionRegistry) -> FunctionType: return FunctionType( input=[ty.resolve(registry) for ty in self.input], output=[ty.resolve(registry) for ty in self.output], - extension_reqs=self.extension_reqs, + runtime_reqs=self.runtime_reqs, ) - def with_extension_reqs(self, extension_reqs: ExtensionSet) -> FunctionType: + def with_runtime_reqs(self, runtime_reqs: ExtensionSet) -> FunctionType: """Adds a list of extension requirements to the function type, and returns the new signature. """ - exts = set(self.extension_reqs) - exts = exts.union(extension_reqs) + exts = set(self.runtime_reqs) + exts = exts.union(runtime_reqs) return FunctionType(self.input, self.output, [*exts]) def __str__(self) -> str: @@ -536,13 +534,13 @@ def resolve(self, registry: ext.ExtensionRegistry) -> PolyFuncType: body=self.body.resolve(registry), ) - def with_extension_reqs(self, extension_reqs: ExtensionSet) -> PolyFuncType: + def with_runtime_reqs(self, runtime_reqs: ExtensionSet) -> PolyFuncType: """Adds a list of extension requirements to the function type, and returns the new signature. """ return PolyFuncType( params=self.params, - body=self.body.with_extension_reqs(extension_reqs), + body=self.body.with_runtime_reqs(runtime_reqs), ) def __str__(self) -> str: diff --git a/hugr-py/tests/serialization/test_extension.py b/hugr-py/tests/serialization/test_extension.py index 4b105c393..59c8d4e0b 100644 --- a/hugr-py/tests/serialization/test_extension.py +++ b/hugr-py/tests/serialization/test_extension.py @@ -24,7 +24,7 @@ { "version": "0.1.0", "name": "ext", - "extension_reqs": [], + "runtime_reqs": [], "types": { "foo": { "extension": "ext", @@ -64,7 +64,7 @@ } ], "output": [], - "extension_reqs": [] + "runtime_reqs": [] } }, "lower_funcs": [] @@ -98,7 +98,7 @@ def test_extension(): ext = Extension( version=Version(0, 1, 0), name="ext", - extension_reqs=set(), + runtime_reqs=set(), types={"foo": type_def}, values={}, operations={"New": op_def}, @@ -120,7 +120,7 @@ def test_package(): ext = Extension( version=Version(0, 1, 0), name="ext", - extension_reqs=set(), + runtime_reqs=set(), types={}, values={}, operations={}, diff --git a/hugr-py/tests/test_custom.py b/hugr-py/tests/test_custom.py index b6865b6ab..3018bf863 100644 --- a/hugr-py/tests/test_custom.py +++ b/hugr-py/tests/test_custom.py @@ -37,7 +37,7 @@ def type_args(self) -> list[tys.TypeArg]: return [tys.StringArg(self.tag)] def cached_signature(self) -> tys.FunctionType | None: - return tys.FunctionType.endo([], extension_reqs=[STRINGLY_EXT.name]) + return tys.FunctionType.endo([], runtime_reqs=[STRINGLY_EXT.name]) @classmethod def from_ext(cls, custom: ops.ExtOp) -> "StringlyOp": diff --git a/hugr/README.md b/hugr/README.md index d69091a2c..6ecfc405b 100644 --- a/hugr/README.md +++ b/hugr/README.md @@ -30,8 +30,8 @@ Please read the [API documentation here][]. ## Experimental Features - `extension_inference`: - Experimental feature which allows automatic inference of extension usages and - requirements in a HUGR and validation that extensions are correctly specified. + Experimental feature which allows automatic inference of which extra extensions + are required at runtime by a HUGR when validating it. Not enabled by default. - `declarative`: Experimental support for declaring extensions in YAML files, support is limited. diff --git a/resources/test/issue-1189.json b/resources/test/issue-1189.json index 318c53a14..e403238df 100644 --- a/resources/test/issue-1189.json +++ b/resources/test/issue-1189.json @@ -25,7 +25,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, { diff --git a/specification/schema/hugr_schema_live.json b/specification/schema/hugr_schema_live.json index 8037e513d..2929ff62b 100644 --- a/specification/schema/hugr_schema_live.json +++ b/specification/schema/hugr_schema_live.json @@ -549,11 +549,11 @@ "title": "Name", "type": "string" }, - "extension_reqs": { + "runtime_reqs": { "items": { "type": "string" }, - "title": "Extension Reqs", + "title": "Runtime Reqs", "type": "array", "uniqueItems": true }, @@ -582,7 +582,7 @@ "required": [ "version", "name", - "extension_reqs", + "runtime_reqs", "types", "values", "operations" @@ -841,11 +841,11 @@ "title": "Output", "type": "array" }, - "extension_reqs": { + "runtime_reqs": { "items": { "type": "string" }, - "title": "Extension Reqs", + "title": "Runtime Reqs", "type": "array" } }, diff --git a/specification/schema/hugr_schema_strict_live.json b/specification/schema/hugr_schema_strict_live.json index 7d7b1342a..69ee3e0ff 100644 --- a/specification/schema/hugr_schema_strict_live.json +++ b/specification/schema/hugr_schema_strict_live.json @@ -549,11 +549,11 @@ "title": "Name", "type": "string" }, - "extension_reqs": { + "runtime_reqs": { "items": { "type": "string" }, - "title": "Extension Reqs", + "title": "Runtime Reqs", "type": "array", "uniqueItems": true }, @@ -582,7 +582,7 @@ "required": [ "version", "name", - "extension_reqs", + "runtime_reqs", "types", "values", "operations" @@ -841,11 +841,11 @@ "title": "Output", "type": "array" }, - "extension_reqs": { + "runtime_reqs": { "items": { "type": "string" }, - "title": "Extension Reqs", + "title": "Runtime Reqs", "type": "array" } }, diff --git a/specification/schema/testing_hugr_schema_live.json b/specification/schema/testing_hugr_schema_live.json index 9e86bff7c..77784eea4 100644 --- a/specification/schema/testing_hugr_schema_live.json +++ b/specification/schema/testing_hugr_schema_live.json @@ -549,11 +549,11 @@ "title": "Name", "type": "string" }, - "extension_reqs": { + "runtime_reqs": { "items": { "type": "string" }, - "title": "Extension Reqs", + "title": "Runtime Reqs", "type": "array", "uniqueItems": true }, @@ -582,7 +582,7 @@ "required": [ "version", "name", - "extension_reqs", + "runtime_reqs", "types", "values", "operations" @@ -841,11 +841,11 @@ "title": "Output", "type": "array" }, - "extension_reqs": { + "runtime_reqs": { "items": { "type": "string" }, - "title": "Extension Reqs", + "title": "Runtime Reqs", "type": "array" } }, diff --git a/specification/schema/testing_hugr_schema_strict_live.json b/specification/schema/testing_hugr_schema_strict_live.json index 88ee9d4dd..dae24b76e 100644 --- a/specification/schema/testing_hugr_schema_strict_live.json +++ b/specification/schema/testing_hugr_schema_strict_live.json @@ -549,11 +549,11 @@ "title": "Name", "type": "string" }, - "extension_reqs": { + "runtime_reqs": { "items": { "type": "string" }, - "title": "Extension Reqs", + "title": "Runtime Reqs", "type": "array", "uniqueItems": true }, @@ -582,7 +582,7 @@ "required": [ "version", "name", - "extension_reqs", + "runtime_reqs", "types", "values", "operations" @@ -841,11 +841,11 @@ "title": "Output", "type": "array" }, - "extension_reqs": { + "runtime_reqs": { "items": { "type": "string" }, - "title": "Extension Reqs", + "title": "Runtime Reqs", "type": "array" } }, diff --git a/specification/std_extensions/arithmetic/conversions.json b/specification/std_extensions/arithmetic/conversions.json index 5a2e20496..a01b4c30b 100644 --- a/specification/std_extensions/arithmetic/conversions.json +++ b/specification/std_extensions/arithmetic/conversions.json @@ -1,7 +1,7 @@ { "version": "0.1.0", "name": "arithmetic.conversions", - "extension_reqs": [ + "runtime_reqs": [ "arithmetic.float.types", "arithmetic.int.types" ], @@ -47,7 +47,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -91,7 +91,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -124,7 +124,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -155,7 +155,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -188,7 +188,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -232,7 +232,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -276,7 +276,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -307,7 +307,7 @@ "t": "I" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -368,7 +368,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -429,7 +429,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false diff --git a/specification/std_extensions/arithmetic/float.json b/specification/std_extensions/arithmetic/float.json index 8bd9f3268..31ccaaa59 100644 --- a/specification/std_extensions/arithmetic/float.json +++ b/specification/std_extensions/arithmetic/float.json @@ -1,7 +1,7 @@ { "version": "0.1.0", "name": "arithmetic.float", - "extension_reqs": [ + "runtime_reqs": [ "arithmetic.int.types" ], "types": {}, @@ -32,7 +32,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -69,7 +69,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -99,7 +99,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -136,7 +136,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -171,7 +171,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -201,7 +201,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -236,7 +236,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -271,7 +271,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -306,7 +306,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -341,7 +341,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -378,7 +378,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -415,7 +415,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -452,7 +452,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -487,7 +487,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -517,7 +517,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -554,7 +554,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -584,7 +584,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -621,7 +621,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -651,7 +651,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false diff --git a/specification/std_extensions/arithmetic/float/types.json b/specification/std_extensions/arithmetic/float/types.json index d590a83f4..56e35c50b 100644 --- a/specification/std_extensions/arithmetic/float/types.json +++ b/specification/std_extensions/arithmetic/float/types.json @@ -1,7 +1,7 @@ { "version": "0.1.0", "name": "arithmetic.float.types", - "extension_reqs": [], + "runtime_reqs": [], "types": { "float64": { "extension": "arithmetic.float.types", diff --git a/specification/std_extensions/arithmetic/int.json b/specification/std_extensions/arithmetic/int.json index e86337f4e..a1dcd21f9 100644 --- a/specification/std_extensions/arithmetic/int.json +++ b/specification/std_extensions/arithmetic/int.json @@ -1,7 +1,7 @@ { "version": "0.1.0", "name": "arithmetic.int", - "extension_reqs": [ + "runtime_reqs": [ "arithmetic.int.types" ], "types": {}, @@ -55,7 +55,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -124,7 +124,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -193,7 +193,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -279,7 +279,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -365,7 +365,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -434,7 +434,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -503,7 +503,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -613,7 +613,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -723,7 +723,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -808,7 +808,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -893,7 +893,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -951,7 +951,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -1009,7 +1009,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -1067,7 +1067,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -1125,7 +1125,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -1183,7 +1183,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -1241,7 +1241,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -1299,7 +1299,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -1357,7 +1357,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -1415,7 +1415,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -1484,7 +1484,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -1553,7 +1553,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -1622,7 +1622,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -1691,7 +1691,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -1777,7 +1777,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -1863,7 +1863,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -1932,7 +1932,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -2001,7 +2001,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -2070,7 +2070,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -2144,7 +2144,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": true @@ -2218,7 +2218,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": true @@ -2276,7 +2276,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -2329,7 +2329,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -2382,7 +2382,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -2451,7 +2451,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -2520,7 +2520,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -2589,7 +2589,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -2658,7 +2658,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -2711,7 +2711,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -2780,7 +2780,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -2849,7 +2849,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -2918,7 +2918,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -2971,7 +2971,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -3028,7 +3028,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": true @@ -3085,7 +3085,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": true @@ -3154,7 +3154,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false diff --git a/specification/std_extensions/arithmetic/int/types.json b/specification/std_extensions/arithmetic/int/types.json index 99ccc4026..60cf69f63 100644 --- a/specification/std_extensions/arithmetic/int/types.json +++ b/specification/std_extensions/arithmetic/int/types.json @@ -1,7 +1,7 @@ { "version": "0.1.0", "name": "arithmetic.int.types", - "extension_reqs": [], + "runtime_reqs": [], "types": { "int": { "extension": "arithmetic.int.types", diff --git a/specification/std_extensions/collections/array.json b/specification/std_extensions/collections/array.json index 36b426d4c..21e405151 100644 --- a/specification/std_extensions/collections/array.json +++ b/specification/std_extensions/collections/array.json @@ -1,7 +1,7 @@ { "version": "0.1.0", "name": "collections.array", - "extension_reqs": [], + "runtime_reqs": [], "types": { "array": { "extension": "collections.array", @@ -62,7 +62,7 @@ } ], "output": [], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -128,7 +128,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -184,7 +184,7 @@ "b": "A" } ], - "extension_reqs": [ + "runtime_reqs": [ "2" ] } @@ -215,7 +215,7 @@ "bound": "A" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -301,7 +301,7 @@ "b": "A" } ], - "extension_reqs": [ + "runtime_reqs": [ "4" ] }, @@ -342,7 +342,7 @@ "b": "A" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -467,7 +467,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -580,7 +580,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false diff --git a/specification/std_extensions/collections/list.json b/specification/std_extensions/collections/list.json index b5f905add..0fbafc638 100644 --- a/specification/std_extensions/collections/list.json +++ b/specification/std_extensions/collections/list.json @@ -1,7 +1,7 @@ { "version": "0.1.0", "name": "collections.list", - "extension_reqs": [], + "runtime_reqs": [], "types": { "List": { "extension": "collections.list", @@ -72,7 +72,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -153,7 +153,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -209,7 +209,7 @@ "t": "I" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -276,7 +276,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -334,7 +334,7 @@ "bound": "A" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -415,7 +415,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false diff --git a/specification/std_extensions/logic.json b/specification/std_extensions/logic.json index a5f0b3e41..7f90392ff 100644 --- a/specification/std_extensions/logic.json +++ b/specification/std_extensions/logic.json @@ -1,7 +1,7 @@ { "version": "0.1.0", "name": "logic", - "extension_reqs": [], + "runtime_reqs": [], "types": {}, "values": { "FALSE": { @@ -58,7 +58,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -89,7 +89,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -115,7 +115,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -146,7 +146,7 @@ "size": 2 } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false diff --git a/specification/std_extensions/prelude.json b/specification/std_extensions/prelude.json index 5aff50947..846394a32 100644 --- a/specification/std_extensions/prelude.json +++ b/specification/std_extensions/prelude.json @@ -1,7 +1,7 @@ { "version": "0.1.0", "name": "prelude", - "extension_reqs": [], + "runtime_reqs": [], "types": { "error": { "extension": "prelude", @@ -78,7 +78,7 @@ "b": "A" } ], - "extension_reqs": [ + "runtime_reqs": [ "0" ] } @@ -122,7 +122,7 @@ ] } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -153,7 +153,7 @@ "b": "A" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -195,7 +195,7 @@ "b": "A" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -218,7 +218,7 @@ "t": "I" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -266,7 +266,7 @@ "b": "A" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -288,7 +288,7 @@ } ], "output": [], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false diff --git a/specification/std_extensions/ptr.json b/specification/std_extensions/ptr.json index 6c2592485..18b1f26b6 100644 --- a/specification/std_extensions/ptr.json +++ b/specification/std_extensions/ptr.json @@ -1,7 +1,7 @@ { "version": "0.1.0", "name": "ptr", - "extension_reqs": [], + "runtime_reqs": [], "types": { "ptr": { "extension": "ptr", @@ -58,7 +58,7 @@ "bound": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -100,7 +100,7 @@ "b": "C" } ], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false @@ -141,7 +141,7 @@ } ], "output": [], - "extension_reqs": [] + "runtime_reqs": [] } }, "binary": false