From ea5213d4b3a42a86c637d709c48cad007eae1f9e Mon Sep 17 00:00:00 2001 From: Alan Lawrence Date: Wed, 12 Jun 2024 14:09:41 +0100 Subject: [PATCH] refactor!: Remove NodeType and input_extensions (#1183) Following #1142 the `input_extensions` are unused, so remove the storage for them BREAKING CHANGE: * `add_child_op`(`_with_parent`), etc., gone; use `add_child_node`(`_with_parent`) with an (impl Into-)OpType. * `get_nodetype` gone - use `get_optype`. * `NodeType` gone - use `OpType` directly. * Various (Into<)Option params removed from builder methods especially {cfg_,dfg_}builder. * `input_extensions` removed from serialization schema. --- hugr-core/src/builder.rs | 6 +- hugr-core/src/builder/build_traits.rs | 76 +--- hugr-core/src/builder/cfg.rs | 18 +- hugr-core/src/builder/conditional.rs | 16 +- hugr-core/src/builder/dataflow.rs | 84 ++-- hugr-core/src/builder/module.rs | 19 +- hugr-core/src/builder/tail_loop.rs | 7 +- hugr-core/src/hugr.rs | 121 +----- hugr-core/src/hugr/hugrmut.rs | 21 +- hugr-core/src/hugr/internal.rs | 10 +- hugr-core/src/hugr/rewrite/inline_dfg.rs | 8 +- hugr-core/src/hugr/rewrite/outline_cfg.rs | 4 +- hugr-core/src/hugr/rewrite/replace.rs | 10 +- hugr-core/src/hugr/rewrite/simple_replace.rs | 1 - hugr-core/src/hugr/serialize.rs | 21 +- hugr-core/src/hugr/serialize/test.rs | 15 +- hugr-core/src/hugr/validate.rs | 9 +- hugr-core/src/hugr/validate/test.rs | 105 ++--- hugr-core/src/hugr/views.rs | 19 +- hugr-core/src/hugr/views/descendants.rs | 7 +- hugr-core/src/hugr/views/root_checked.rs | 20 +- hugr-core/src/hugr/views/sibling.rs | 14 +- hugr-core/src/ops/constant.rs | 2 +- hugr-core/src/ops/custom.rs | 7 +- hugr-passes/src/const_fold/test.rs | 3 +- hugr-py/src/hugr/serialization/ops.py | 1 - hugr/src/hugr.rs | 4 +- .../schema/hugr_schema_strict_v1.json | 375 ------------------ specification/schema/hugr_schema_v1.json | 375 ------------------ .../schema/testing_hugr_schema_strict_v1.json | 375 ------------------ .../schema/testing_hugr_schema_v1.json | 375 ------------------ 31 files changed, 196 insertions(+), 1932 deletions(-) diff --git a/hugr-core/src/builder.rs b/hugr-core/src/builder.rs index 787decc07..56ded9129 100644 --- a/hugr-core/src/builder.rs +++ b/hugr-core/src/builder.rs @@ -220,7 +220,7 @@ pub enum BuilderWiringError { pub(crate) mod test { use rstest::fixture; - use crate::hugr::{views::HugrView, HugrMut, NodeType}; + use crate::hugr::{views::HugrView, HugrMut}; use crate::ops; use crate::std_extensions::arithmetic::float_ops::FLOAT_OPS_REGISTRY; use crate::types::{FunctionType, PolyFuncType, Type}; @@ -278,9 +278,9 @@ pub(crate) mod test { /// inference. Using DFGBuilder will default to a root node with an open /// extension variable pub(crate) fn closed_dfg_root_hugr(signature: FunctionType) -> Hugr { - let mut hugr = Hugr::new(NodeType::new_pure(ops::DFG { + let mut hugr = Hugr::new(ops::DFG { signature: signature.clone(), - })); + }); hugr.add_node_with_parent( hugr.root(), ops::Input { diff --git a/hugr-core/src/builder/build_traits.rs b/hugr-core/src/builder/build_traits.rs index 9279a6ba5..1b4945afc 100644 --- a/hugr-core/src/builder/build_traits.rs +++ b/hugr-core/src/builder/build_traits.rs @@ -14,7 +14,6 @@ use super::{ use super::{BuilderWiringError, FunctionBuilder}; use crate::{ - hugr::NodeType, ops::handle::{ConstID, DataflowOpID, FuncID, NodeHandle}, types::EdgeKind, }; @@ -45,12 +44,7 @@ pub trait Container { /// Immutable reference to HUGR being built fn hugr(&self) -> &Hugr; /// Add an [`OpType`] as the final child of the container. - fn add_child_op(&mut self, op: impl Into) -> Node { - let parent = self.container_node(); - self.hugr_mut().add_node_with_parent(parent, op) - } - /// Add a [`NodeType`] as the final child of the container. - fn add_child_node(&mut self, node: NodeType) -> Node { + fn add_child_node(&mut self, node: impl Into) -> Node { let parent = self.container_node(); self.hugr_mut().add_node_with_parent(parent, node) } @@ -71,8 +65,7 @@ pub trait Container { /// This function will return an error if there is an error in adding the /// [`OpType::Const`] node. fn add_constant(&mut self, constant: impl Into) -> ConstID { - self.add_child_node(NodeType::new_pure(constant.into())) - .into() + self.add_child_node(constant.into()).into() } /// Add a [`ops::FuncDefn`] node and returns a builder to define the function @@ -88,13 +81,12 @@ pub trait Container { signature: PolyFuncType, ) -> Result, BuildError> { let body = signature.body().clone(); - let f_node = self.add_child_node(NodeType::new_pure(ops::FuncDefn { + let f_node = self.add_child_node(ops::FuncDefn { name: name.into(), signature, - })); + }); - let db = - DFGBuilder::create_with_io(self.hugr_mut(), f_node, body, Some(ExtensionSet::new()))?; + let db = DFGBuilder::create_with_io(self.hugr_mut(), f_node, body)?; Ok(FunctionBuilder::from_dfg_builder(db)) } @@ -182,7 +174,7 @@ pub trait Dataflow: Container { fn input_wires(&self) -> Outputs { self.input().outputs() } - /// Add a dataflow op to the sibling graph, wiring up the `input_wires` to the + /// Add a dataflow [`OpType`] to the sibling graph, wiring up the `input_wires` to the /// incoming ports of the resulting node. /// /// # Errors @@ -190,21 +182,7 @@ pub trait Dataflow: Container { /// Returns a [`BuildError::OperationWiring`] error if the `input_wires` cannot be connected. fn add_dataflow_op( &mut self, - op: impl Into, - input_wires: impl IntoIterator, - ) -> Result, BuildError> { - self.add_dataflow_node(NodeType::new_auto(op), input_wires) - } - - /// Add a dataflow [`NodeType`] to the sibling graph, wiring up the `input_wires` to the - /// incoming ports of the resulting node. - /// - /// # Errors - /// - /// Returns a [`BuildError::OperationWiring`] error if the `input_wires` cannot be connected. - fn add_dataflow_node( - &mut self, - nodetype: NodeType, + nodetype: impl Into, input_wires: impl IntoIterator, ) -> Result, BuildError> { let outs = add_node_with_wires(self, nodetype, input_wires)?; @@ -297,16 +275,14 @@ pub trait Dataflow: Container { fn dfg_builder( &mut self, signature: FunctionType, - input_extensions: Option, input_wires: impl IntoIterator, ) -> Result, BuildError> { let op = ops::DFG { signature: signature.clone(), }; - let nodetype = NodeType::new(op, input_extensions.clone()); - let (dfg_n, _) = add_node_with_wires(self, nodetype, input_wires)?; + let (dfg_n, _) = add_node_with_wires(self, op, input_wires)?; - DFGBuilder::create_with_io(self.hugr_mut(), dfg_n, signature, input_extensions) + DFGBuilder::create_with_io(self.hugr_mut(), dfg_n, signature) } /// Return a builder for a [`crate::ops::CFG`] node, @@ -322,7 +298,6 @@ pub trait Dataflow: Container { fn cfg_builder( &mut self, inputs: impl IntoIterator, - input_extensions: impl Into>, output_types: TypeRow, extension_delta: ExtensionSet, ) -> Result, BuildError> { @@ -332,13 +307,10 @@ pub trait Dataflow: Container { let (cfg_node, _) = add_node_with_wires( self, - NodeType::new( - ops::CFG { - signature: FunctionType::new(inputs.clone(), output_types.clone()) - .with_extension_delta(extension_delta), - }, - input_extensions.into(), - ), + ops::CFG { + signature: FunctionType::new(inputs.clone(), output_types.clone()) + .with_extension_delta(extension_delta), + }, input_wires, )?; CFGBuilder::create(self.hugr_mut(), cfg_node, inputs, output_types) @@ -348,9 +320,8 @@ pub trait Dataflow: Container { /// Adds a [`OpType::LoadConstant`] node. fn load_const(&mut self, cid: &ConstID) -> Wire { let const_node = cid.node(); - let nodetype = self.hugr().get_nodetype(const_node); + let nodetype = self.hugr().get_optype(const_node); let op: ops::Const = nodetype - .op() .clone() .try_into() .expect("ConstID does not refer to Const op."); @@ -394,7 +365,7 @@ pub trait Dataflow: Container { exts: &ExtensionRegistry, ) -> Result { let func_node = fid.node(); - let func_op = self.hugr().get_nodetype(func_node).op(); + let func_op = self.hugr().get_optype(func_node); let func_sig = match func_op { OpType::FuncDefn(ops::FuncDefn { signature, .. }) | OpType::FuncDecl(ops::FuncDecl { signature, .. }) => signature.clone(), @@ -643,26 +614,23 @@ pub trait Dataflow: Container { /// invalid edge. fn add_node_with_wires( data_builder: &mut T, - nodetype: impl Into, + nodetype: impl Into, inputs: impl IntoIterator, ) -> Result<(Node, usize), BuildError> { - let nodetype: NodeType = nodetype.into(); + let op = nodetype.into(); // Check there are no row variables, as that would prevent us // from indexing into the node's ports in order to wire up - nodetype - .op_signature() + op.dataflow_signature() .as_ref() .and_then(FunctionType::find_rowvar) .map_or(Ok(()), |(idx, _)| { Err(SignatureError::RowVarWhereTypeExpected { idx }) })?; - let num_outputs = nodetype.op().value_output_count(); - let op_node = data_builder.add_child_node(nodetype.clone()); + let num_outputs = op.value_output_count(); + let op_node = data_builder.add_child_node(op.clone()); - wire_up_inputs(inputs, op_node, data_builder).map_err(|error| BuildError::OperationWiring { - op: nodetype.into_op(), - error, - })?; + wire_up_inputs(inputs, op_node, data_builder) + .map_err(|error| BuildError::OperationWiring { op, error })?; Ok((op_node, num_outputs)) } diff --git a/hugr-core/src/builder/cfg.rs b/hugr-core/src/builder/cfg.rs index 1ac852b45..c7ae975ae 100644 --- a/hugr-core/src/builder/cfg.rs +++ b/hugr-core/src/builder/cfg.rs @@ -13,10 +13,7 @@ use crate::{ use crate::{hugr::views::HugrView, types::TypeRow}; use crate::Node; -use crate::{ - hugr::{HugrMut, NodeType}, - type_row, Hugr, -}; +use crate::{hugr::HugrMut, type_row, Hugr}; /// Builder for a [`crate::ops::CFG`] child control /// flow graph. @@ -158,7 +155,7 @@ impl CFGBuilder { signature: signature.clone(), }; - let base = Hugr::new(NodeType::new_open(cfg_op)); + let base = Hugr::new(cfg_op); let cfg_node = base.root(); CFGBuilder::create(base, cfg_node, signature.input, signature.output) } @@ -336,12 +333,7 @@ impl + AsRef> BlockBuilder { fn create(base: B, block_n: Node) -> Result { let block_op = base.get_optype(block_n).as_dataflow_block().unwrap(); let signature = block_op.inner_signature(); - let inp_ex = base - .as_ref() - .get_nodetype(block_n) - .input_extensions() - .cloned(); - let db = DFGBuilder::create_with_io(base, block_n, signature, inp_ex)?; + let db = DFGBuilder::create_with_io(base, block_n, signature)?; Ok(BlockBuilder::from_dfg_builder(db)) } @@ -363,7 +355,6 @@ impl BlockBuilder { /// Initialize a [`DataflowBlock`] rooted HUGR builder pub fn new( inputs: impl Into, - input_extensions: impl Into>, sum_rows: impl IntoIterator, other_outputs: impl Into, extension_delta: ExtensionSet, @@ -378,7 +369,7 @@ impl BlockBuilder { extension_delta, }; - let base = Hugr::new(NodeType::new(op, input_extensions)); + let base = Hugr::new(op); let root = base.root(); Self::create(base, root) } @@ -418,7 +409,6 @@ pub(crate) mod test { let cfg_id = { let mut cfg_builder = func_builder.cfg_builder( vec![(NAT, int)], - None, type_row![NAT], ExtensionSet::new(), )?; diff --git a/hugr-core/src/builder/conditional.rs b/hugr-core/src/builder/conditional.rs index e39c88451..ec9566f5f 100644 --- a/hugr-core/src/builder/conditional.rs +++ b/hugr-core/src/builder/conditional.rs @@ -16,11 +16,7 @@ use super::{ }; use crate::Node; -use crate::{ - extension::ExtensionSet, - hugr::{HugrMut, NodeType}, - Hugr, -}; +use crate::{extension::ExtensionSet, hugr::HugrMut, Hugr}; use std::collections::HashSet; @@ -130,7 +126,7 @@ impl + AsRef> ConditionalBuilder { if let Some(&sibling_node) = self.case_nodes[case + 1..].iter().flatten().next() { self.hugr_mut().add_node_before(sibling_node, case_op) } else { - self.add_child_op(case_op) + self.add_child_node(case_op) }; self.case_nodes[case] = Some(case_node); @@ -139,7 +135,6 @@ impl + AsRef> ConditionalBuilder { self.hugr_mut(), case_node, FunctionType::new(inputs, outputs).with_extension_delta(extension_delta), - None, )?; Ok(CaseBuilder::from_dfg_builder(dfg_builder)) @@ -177,8 +172,7 @@ impl ConditionalBuilder { outputs, extension_delta, }; - // TODO: Allow input extensions to be specified - let base = Hugr::new(NodeType::new_open(op)); + let base = Hugr::new(op); let conditional_node = base.root(); Ok(ConditionalBuilder { @@ -196,9 +190,9 @@ impl CaseBuilder { let op = ops::Case { signature: signature.clone(), }; - let base = Hugr::new(NodeType::new_open(op)); + let base = Hugr::new(op); let root = base.root(); - let dfg_builder = DFGBuilder::create_with_io(base, root, signature, None)?; + let dfg_builder = DFGBuilder::create_with_io(base, root, signature)?; Ok(CaseBuilder::from_dfg_builder(dfg_builder)) } diff --git a/hugr-core/src/builder/dataflow.rs b/hugr-core/src/builder/dataflow.rs index 67865e13a..f5c8db00f 100644 --- a/hugr-core/src/builder/dataflow.rs +++ b/hugr-core/src/builder/dataflow.rs @@ -4,12 +4,12 @@ use super::{BuildError, Container, Dataflow, DfgID, FuncID}; use std::marker::PhantomData; -use crate::hugr::{HugrView, NodeType, ValidationError}; +use crate::hugr::{HugrView, ValidationError}; use crate::ops; use crate::types::{FunctionType, PolyFuncType}; -use crate::extension::{ExtensionRegistry, ExtensionSet}; +use crate::extension::ExtensionRegistry; use crate::Node; use crate::{hugr::HugrMut, Hugr}; @@ -27,7 +27,6 @@ impl + AsRef> DFGBuilder { mut base: T, parent: Node, signature: FunctionType, - input_extensions: Option, ) -> Result { let num_in_wires = signature.input().len(); let num_out_wires = signature.output().len(); @@ -49,15 +48,8 @@ impl + AsRef> DFGBuilder { let output = ops::Output { types: signature.output().clone(), }; - base.as_mut() - .add_node_with_parent(parent, NodeType::new(input, input_extensions.clone())); - base.as_mut().add_node_with_parent( - parent, - NodeType::new( - output, - input_extensions.map(|inp| inp.union(signature.extension_reqs)), - ), - ); + base.as_mut().add_node_with_parent(parent, input); + base.as_mut().add_node_with_parent(parent, output); Ok(Self { base, @@ -79,9 +71,9 @@ impl DFGBuilder { let dfg_op = ops::DFG { signature: signature.clone(), }; - let base = Hugr::new(NodeType::new_open(dfg_op)); + let base = Hugr::new(dfg_op); let root = base.root(); - DFGBuilder::create_with_io(base, root, signature, None) + DFGBuilder::create_with_io(base, root, signature) } } @@ -153,10 +145,10 @@ impl FunctionBuilder { name: name.into(), }; - let base = Hugr::new(NodeType::new_pure(op)); + let base = Hugr::new(op); let root = base.root(); - let db = DFGBuilder::create_with_io(base, root, body, Some(ExtensionSet::new()))?; + let db = DFGBuilder::create_with_io(base, root, body)?; Ok(Self::from_dfg_builder(db)) } } @@ -209,8 +201,11 @@ pub(crate) mod test { use crate::builder::build_traits::DataflowHugr; use crate::builder::{BuilderWiringError, DataflowSubContainer, ModuleBuilder}; use crate::extension::prelude::{BOOL_T, USIZE_T}; - use crate::extension::{ExtensionId, SignatureError, EMPTY_REG, PRELUDE_REGISTRY}; + use crate::extension::{ + ExtensionId, ExtensionSet, SignatureError, EMPTY_REG, PRELUDE_REGISTRY, + }; use crate::hugr::validate::InterGraphEdgeError; + use crate::ops::OpTrait; use crate::ops::{handle::NodeHandle, Lift, Noop, OpTag}; use crate::std_extensions::logic::test::and_op; @@ -239,11 +234,8 @@ pub(crate) mod test { let q_out = func_builder.add_dataflow_op(h_gate(), vec![qb])?; - let inner_builder = func_builder.dfg_builder( - FunctionType::new(type_row![NAT], type_row![NAT]), - None, - [int], - )?; + let inner_builder = func_builder + .dfg_builder(FunctionType::new(type_row![NAT], type_row![NAT]), [int])?; let inner_id = n_identity(inner_builder)?; func_builder.finish_with_outputs(inner_id.outputs().chain(q_out.outputs()))? @@ -348,7 +340,7 @@ pub(crate) mod test { let i1 = noop.out_wire(0); let mut nested = - f_build.dfg_builder(FunctionType::new(type_row![], type_row![BIT]), None, [])?; + f_build.dfg_builder(FunctionType::new(type_row![], type_row![BIT]), [])?; let id = nested.add_dataflow_op(Noop { ty: BIT }, [i1])?; @@ -371,8 +363,7 @@ pub(crate) mod test { let noop = f_build.add_dataflow_op(Noop { ty: QB }, [i1])?; let i1 = noop.out_wire(0); - let mut nested = - f_build.dfg_builder(FunctionType::new(type_row![], type_row![QB]), None, [])?; + let mut nested = f_build.dfg_builder(FunctionType::new(type_row![], type_row![QB]), [])?; let id_res = nested.add_dataflow_op(Noop { ty: QB }, [i1]); @@ -450,7 +441,7 @@ pub(crate) mod test { .with_extension_delta(ab_extensions.clone()); // A box which adds extensions A and B, via child Lift nodes - let mut add_ab = parent.dfg_builder(add_ab_sig, Some(ExtensionSet::new()), [w])?; + let mut add_ab = parent.dfg_builder(add_ab_sig, [w])?; let [w] = add_ab.input_wires_arr(); let lift_a = add_ab.add_dataflow_op( @@ -462,14 +453,11 @@ pub(crate) mod test { )?; let [w] = lift_a.outputs_arr(); - let lift_b = add_ab.add_dataflow_node( - NodeType::new( - Lift { - type_row: type_row![BIT], - new_extension: xb, - }, - ExtensionSet::from_iter([xa]), - ), + let lift_b = add_ab.add_dataflow_op( + Lift { + type_row: type_row![BIT], + new_extension: xb, + }, [w], )?; let [w] = lift_b.outputs_arr(); @@ -479,16 +467,13 @@ pub(crate) mod test { // Add another node (a sibling to add_ab) which adds extension C // via a child lift node - let mut add_c = parent.dfg_builder(add_c_sig, Some(ab_extensions.clone()), [w])?; + let mut add_c = parent.dfg_builder(add_c_sig, [w])?; let [w] = add_c.input_wires_arr(); - let lift_c = add_c.add_dataflow_node( - NodeType::new( - Lift { - type_row: type_row![BIT], - new_extension: xc, - }, - ab_extensions, - ), + let lift_c = add_c.add_dataflow_op( + Lift { + type_row: type_row![BIT], + new_extension: xc, + }, [w], )?; let wires: Vec = lift_c.outputs().collect(); @@ -504,10 +489,10 @@ pub(crate) mod test { fn non_cfg_ancestor() -> Result<(), BuildError> { let unit_sig = FunctionType::new(type_row![Type::UNIT], type_row![Type::UNIT]); let mut b = DFGBuilder::new(unit_sig.clone())?; - let b_child = b.dfg_builder(unit_sig.clone(), None, [b.input().out_wire(0)])?; + let b_child = b.dfg_builder(unit_sig.clone(), [b.input().out_wire(0)])?; let b_child_in_wire = b_child.input().out_wire(0); b_child.finish_with_outputs([])?; - let b_child_2 = b.dfg_builder(unit_sig.clone(), None, [])?; + let b_child_2 = b.dfg_builder(unit_sig.clone(), [])?; // DFG block has edge coming a sibling block, which is only valid for // CFGs @@ -528,17 +513,16 @@ pub(crate) mod test { fn no_relation_edge() -> Result<(), BuildError> { let unit_sig = FunctionType::new(type_row![Type::UNIT], type_row![Type::UNIT]); let mut b = DFGBuilder::new(unit_sig.clone())?; - let mut b_child = b.dfg_builder(unit_sig.clone(), None, [b.input().out_wire(0)])?; - let b_child_child = - b_child.dfg_builder(unit_sig.clone(), None, [b_child.input().out_wire(0)])?; + let mut b_child = b.dfg_builder(unit_sig.clone(), [b.input().out_wire(0)])?; + let b_child_child = b_child.dfg_builder(unit_sig.clone(), [b_child.input().out_wire(0)])?; let b_child_child_in_wire = b_child_child.input().out_wire(0); b_child_child.finish_with_outputs([])?; b_child.finish_with_outputs([])?; - let mut b_child_2 = b.dfg_builder(unit_sig.clone(), None, [])?; + let mut b_child_2 = b.dfg_builder(unit_sig.clone(), [])?; let b_child_2_child = - b_child_2.dfg_builder(unit_sig.clone(), None, [b_child_2.input().out_wire(0)])?; + b_child_2.dfg_builder(unit_sig.clone(), [b_child_2.input().out_wire(0)])?; let res = b_child_2_child.finish_with_outputs([b_child_child_in_wire]); diff --git a/hugr-core/src/builder/module.rs b/hugr-core/src/builder/module.rs index 9866ab326..d5fbf3823 100644 --- a/hugr-core/src/builder/module.rs +++ b/hugr-core/src/builder/module.rs @@ -13,11 +13,9 @@ use crate::types::{PolyFuncType, Type, TypeBound}; use crate::ops::handle::{AliasID, FuncID, NodeHandle}; -use crate::Node; +use crate::{Hugr, Node}; use smol_str::SmolStr; -use crate::{hugr::NodeType, Hugr}; - /// Builder for a HUGR module. #[derive(Debug, Clone, PartialEq)] pub struct ModuleBuilder(pub(super) T); @@ -86,13 +84,10 @@ impl + AsRef> ModuleBuilder { .clone(); let body = signature.body().clone(); self.hugr_mut() - .replace_op( - f_node, - NodeType::new_pure(ops::FuncDefn { name, signature }), - ) + .replace_op(f_node, ops::FuncDefn { name, signature }) .expect("Replacing a FuncDecl node with a FuncDefn should always be valid"); - let db = DFGBuilder::create_with_io(self.hugr_mut(), f_node, body, None)?; + let db = DFGBuilder::create_with_io(self.hugr_mut(), f_node, body)?; Ok(FunctionBuilder::from_dfg_builder(db)) } @@ -108,10 +103,10 @@ impl + AsRef> ModuleBuilder { signature: PolyFuncType, ) -> Result, BuildError> { // TODO add param names to metadata - let declare_n = self.add_child_node(NodeType::new_pure(ops::FuncDecl { + let declare_n = self.add_child_node(ops::FuncDecl { signature, name: name.into(), - })); + }); Ok(declare_n.into()) } @@ -133,7 +128,7 @@ impl + AsRef> ModuleBuilder { // every 0-input node. let name: SmolStr = name.into(); let bound = typ.least_upper_bound(); - let node = self.add_child_op(ops::AliasDefn { + let node = self.add_child_node(ops::AliasDefn { name: name.clone(), definition: typ, }); @@ -151,7 +146,7 @@ impl + AsRef> ModuleBuilder { bound: TypeBound, ) -> Result, BuildError> { let name: SmolStr = name.into(); - let node = self.add_child_op(ops::AliasDecl { + let node = self.add_child_node(ops::AliasDecl { name: name.clone(), bound, }); diff --git a/hugr-core/src/builder/tail_loop.rs b/hugr-core/src/builder/tail_loop.rs index 2bee9bcfa..fc7eeb864 100644 --- a/hugr-core/src/builder/tail_loop.rs +++ b/hugr-core/src/builder/tail_loop.rs @@ -1,7 +1,7 @@ use crate::extension::ExtensionSet; use crate::ops; -use crate::hugr::{views::HugrView, NodeType}; +use crate::hugr::views::HugrView; use crate::types::{FunctionType, TypeRow}; use crate::{Hugr, Node}; @@ -22,7 +22,7 @@ impl + AsRef> TailLoopBuilder { tail_loop: &ops::TailLoop, ) -> Result { let signature = FunctionType::new(tail_loop.body_input_row(), tail_loop.body_output_row()); - let dfg_build = DFGBuilder::create_with_io(base, loop_node, signature, None)?; + let dfg_build = DFGBuilder::create_with_io(base, loop_node, signature)?; Ok(TailLoopBuilder::from_dfg_builder(dfg_build)) } @@ -83,8 +83,7 @@ impl TailLoopBuilder { rest: inputs_outputs.into(), extension_delta, }; - // TODO: Allow input extensions to be specified - let base = Hugr::new(NodeType::new_open(tail_loop.clone())); + let base = Hugr::new(tail_loop.clone()); let root = base.root(); Self::create_with_io(base, root, &tail_loop) } diff --git a/hugr-core/src/hugr.rs b/hugr-core/src/hugr.rs index 0ab25f7ba..25aa28214 100644 --- a/hugr-core/src/hugr.rs +++ b/hugr-core/src/hugr.rs @@ -25,14 +25,12 @@ use thiserror::Error; pub use self::views::{HugrView, RootTagged}; use crate::core::NodeIndex; -use crate::extension::{ExtensionRegistry, ExtensionSet}; +use crate::extension::ExtensionRegistry; use crate::ops::custom::resolve_extension_ops; -use crate::ops::{OpTag, OpTrait, OpType, DEFAULT_OPTYPE}; -use crate::types::FunctionType; +use crate::ops::OpTag; +pub use crate::ops::{OpType, DEFAULT_OPTYPE}; use crate::{Direction, Node}; -use delegate::delegate; - /// The Hugr data structure. #[derive(Clone, Debug, PartialEq)] pub struct Hugr { @@ -46,115 +44,15 @@ pub struct Hugr { root: portgraph::NodeIndex, /// Operation types for each node. - op_types: UnmanagedDenseMap, + op_types: UnmanagedDenseMap, /// Node metadata metadata: UnmanagedDenseMap>, } -#[derive(Clone, Debug, Default, PartialEq, serde::Serialize, serde::Deserialize)] -/// The type of a node on a graph. In addition to the [`OpType`], it also -/// describes the extensions inferred to be used by the node. -pub struct NodeType { - /// The underlying OpType - op: OpType, - /// The extensions that the signature has been specialised to - input_extensions: Option, -} - -/// The default NodeType, with open extensions -pub const DEFAULT_NODETYPE: NodeType = NodeType { - op: DEFAULT_OPTYPE, - input_extensions: None, // Default for any Option -}; - -impl NodeType { - /// Create a new optype with some ExtensionSet - pub fn new(op: impl Into, input_extensions: impl Into>) -> Self { - NodeType { - op: op.into(), - input_extensions: input_extensions.into(), - } - } - - /// Instantiate an OpType with no input extensions - pub fn new_pure(op: impl Into) -> Self { - NodeType { - op: op.into(), - input_extensions: Some(ExtensionSet::new()), - } - } - - /// Instantiate an OpType with an unknown set of input extensions - /// (to be inferred later) - pub fn new_open(op: impl Into) -> Self { - NodeType { - op: op.into(), - input_extensions: None, - } - } - - /// Instantiate an [OpType] with the default set of input extensions - /// for that OpType. - pub fn new_auto(op: impl Into) -> Self { - let op = op.into(); - if OpTag::ModuleOp.is_superset(op.tag()) { - Self::new_pure(op) - } else { - Self::new_open(op) - } - } - - /// Get the function type from the embedded op - pub fn op_signature(&self) -> Option { - self.op.dataflow_signature() - } - - /// The input extensions defined for this node. - /// - /// The output extensions will correspond to the input extensions plus any - /// extension delta defined by the operation type. - /// - /// If the input extensions are not known, this will return None. - pub fn input_extensions(&self) -> Option<&ExtensionSet> { - self.input_extensions.as_ref() - } - - /// Gets the underlying [OpType] i.e. without any [input_extensions] - /// - /// [input_extensions]: NodeType::input_extensions - pub fn op(&self) -> &OpType { - &self.op - } - - /// Returns the underlying [OpType] i.e. without any [input_extensions] - /// - /// [input_extensions]: NodeType::input_extensions - pub fn into_op(self) -> OpType { - self.op - } - - delegate! { - to self.op { - /// Tag identifying the operation. - pub fn tag(&self) -> OpTag; - /// Returns the number of inputs ports for the operation. - pub fn input_count(&self) -> usize; - /// Returns the number of outputs ports for the operation. - pub fn output_count(&self) -> usize; - } - } -} - -impl> From for NodeType { - fn from(value: T) -> Self { - NodeType::new_auto(value.into()) - } -} - impl Default for Hugr { fn default() -> Self { - Self::new(NodeType::new_pure(crate::ops::Module)) + Self::new(crate::ops::Module) } } @@ -181,8 +79,8 @@ pub type NodeMetadataMap = serde_json::Map; /// Public API for HUGRs. impl Hugr { /// Create a new Hugr, with a single root node. - pub fn new(root_node: NodeType) -> Self { - Self::with_capacity(root_node, 0, 0) + pub fn new(root_node: impl Into) -> Self { + Self::with_capacity(root_node.into(), 0, 0) } /// Resolve extension ops, infer extensions used, and pass the closure into validation @@ -210,8 +108,7 @@ impl Hugr { /// Internal API for HUGRs, not intended for use by users. impl Hugr { /// Create a new Hugr, with a single root node and preallocated capacity. - // TODO: Make this take a NodeType - pub(crate) fn with_capacity(root_node: NodeType, nodes: usize, ports: usize) -> Self { + pub(crate) fn with_capacity(root_node: OpType, nodes: usize, ports: usize) -> Self { let mut graph = MultiPortGraph::with_capacity(nodes, ports); let hierarchy = Hierarchy::new(); let mut op_types = UnmanagedDenseMap::with_capacity(nodes); @@ -236,7 +133,7 @@ impl Hugr { } /// Add a node to the graph. - pub(crate) fn add_node(&mut self, nodetype: NodeType) -> Node { + pub(crate) fn add_node(&mut self, nodetype: OpType) -> Node { let node = self .graph .add_node(nodetype.input_count(), nodetype.output_count()); diff --git a/hugr-core/src/hugr/hugrmut.rs b/hugr-core/src/hugr/hugrmut.rs index c06d87fd5..08d852249 100644 --- a/hugr-core/src/hugr/hugrmut.rs +++ b/hugr-core/src/hugr/hugrmut.rs @@ -7,7 +7,7 @@ use portgraph::view::{NodeFilter, NodeFiltered}; use portgraph::{LinkMut, NodeIndex, PortMut, PortView, SecondaryMap}; use crate::hugr::views::SiblingSubgraph; -use crate::hugr::{HugrView, Node, NodeType, RootTagged}; +use crate::hugr::{HugrView, Node, OpType, RootTagged}; use crate::hugr::{NodeMetadata, Rewrite}; use crate::{Hugr, IncomingPort, OutgoingPort, Port, PortIndex}; @@ -74,7 +74,7 @@ pub trait HugrMut: HugrMutInternals { /// /// If the parent is not in the graph. #[inline] - fn add_node_with_parent(&mut self, parent: Node, op: impl Into) -> Node { + fn add_node_with_parent(&mut self, parent: Node, op: impl Into) -> Node { panic_invalid_node(self, parent); self.hugr_mut().add_node_with_parent(parent, op) } @@ -87,7 +87,7 @@ pub trait HugrMut: HugrMutInternals { /// /// If the sibling is not in the graph, or if the sibling is the root node. #[inline] - fn add_node_before(&mut self, sibling: Node, nodetype: impl Into) -> Node { + fn add_node_before(&mut self, sibling: Node, nodetype: impl Into) -> Node { panic_invalid_non_root(self, sibling); self.hugr_mut().add_node_before(sibling, nodetype) } @@ -100,7 +100,7 @@ pub trait HugrMut: HugrMutInternals { /// /// If the sibling is not in the graph, or if the sibling is the root node. #[inline] - fn add_node_after(&mut self, sibling: Node, op: impl Into) -> Node { + fn add_node_after(&mut self, sibling: Node, op: impl Into) -> Node { panic_invalid_non_root(self, sibling); self.hugr_mut().add_node_after(sibling, op) } @@ -237,7 +237,7 @@ fn translate_indices(node_map: HashMap) -> HashMap + AsMut> HugrMut for T { - fn add_node_with_parent(&mut self, parent: Node, node: impl Into) -> Node { + fn add_node_with_parent(&mut self, parent: Node, node: impl Into) -> Node { let node = self.as_mut().add_node(node.into()); self.as_mut() .hierarchy @@ -246,7 +246,7 @@ impl + AsMut> HugrMut for T { node } - fn add_node_before(&mut self, sibling: Node, nodetype: impl Into) -> Node { + fn add_node_before(&mut self, sibling: Node, nodetype: impl Into) -> Node { let node = self.as_mut().add_node(nodetype.into()); self.as_mut() .hierarchy @@ -255,7 +255,7 @@ impl + AsMut> HugrMut for T { node } - fn add_node_after(&mut self, sibling: Node, op: impl Into) -> Node { + fn add_node_after(&mut self, sibling: Node, op: impl Into) -> Node { let node = self.as_mut().add_node(op.into()); self.as_mut() .hierarchy @@ -341,7 +341,7 @@ impl + AsMut> HugrMut for T { let (new_root, node_map) = insert_hugr_internal(self.as_mut(), root, other); // Update the optypes and metadata, copying them from the other graph. for (&node, &new_node) in node_map.iter() { - let nodetype = other.get_nodetype(node.into()); + let nodetype = other.get_optype(node.into()); self.as_mut().op_types.set(new_node, nodetype.clone()); let meta = other.base_hugr().metadata.get(node); self.as_mut().metadata.set(new_node, meta.clone()); @@ -372,7 +372,7 @@ impl + AsMut> HugrMut for T { let node_map = insert_subgraph_internal(self.as_mut(), root, other, &portgraph); // Update the optypes and metadata, copying them from the other graph. for (&node, &new_node) in node_map.iter() { - let nodetype = other.get_nodetype(node.into()); + let nodetype = other.get_optype(node.into()); self.as_mut().op_types.set(new_node, nodetype.clone()); let meta = other.base_hugr().metadata.get(node); self.as_mut().metadata.set(new_node, meta.clone()); @@ -534,8 +534,7 @@ mod test { ); { - let f_in = - hugr.add_node_with_parent(f, NodeType::new_pure(ops::Input::new(type_row![NAT]))); + let f_in = hugr.add_node_with_parent(f, ops::Input::new(type_row![NAT])); let f_out = hugr.add_node_with_parent(f, ops::Output::new(type_row![NAT, NAT])); let noop = hugr.add_node_with_parent(f, Noop { ty: NAT }); diff --git a/hugr-core/src/hugr/internal.rs b/hugr-core/src/hugr/internal.rs index 3cf2b9c63..b8ac050c3 100644 --- a/hugr-core/src/hugr/internal.rs +++ b/hugr-core/src/hugr/internal.rs @@ -5,10 +5,11 @@ use std::ops::Range; use portgraph::{LinkView, MultiPortGraph, PortMut, PortView}; use crate::ops::handle::NodeHandle; +use crate::ops::OpTrait; use crate::{Direction, Hugr, Node}; use super::hugrmut::{panic_invalid_node, panic_invalid_non_root}; -use super::{HugrError, NodeType, RootTagged}; +use super::{HugrError, OpType, RootTagged}; /// Trait for accessing the internals of a Hugr(View). /// @@ -138,8 +139,9 @@ pub trait HugrMutInternals: RootTagged { /// # Panics /// /// If the node is not in the graph. - fn replace_op(&mut self, node: Node, op: NodeType) -> Result { + fn replace_op(&mut self, node: Node, op: impl Into) -> Result { panic_invalid_node(self, node); + let op = op.into(); if node == self.root() && !Self::RootHandle::TAG.is_superset(op.tag()) { return Err(HugrError::InvalidTag { required: Self::RootHandle::TAG, @@ -206,9 +208,9 @@ impl + AsMut> HugrMutInternals for T { .expect("Inserting a newly-created node into the hierarchy should never fail."); } - fn replace_op(&mut self, node: Node, op: NodeType) -> Result { + fn replace_op(&mut self, node: Node, op: impl Into) -> Result { // We know RootHandle=Node here so no need to check let cur = self.hugr_mut().op_types.get_mut(node.pg_index()); - Ok(std::mem::replace(cur, op)) + Ok(std::mem::replace(cur, op.into())) } } diff --git a/hugr-core/src/hugr/rewrite/inline_dfg.rs b/hugr-core/src/hugr/rewrite/inline_dfg.rs index adba1170f..b98e57bf5 100644 --- a/hugr-core/src/hugr/rewrite/inline_dfg.rs +++ b/hugr-core/src/hugr/rewrite/inline_dfg.rs @@ -201,7 +201,6 @@ mod test { let inner = { let mut inner = outer.dfg_builder( FunctionType::new_endo(vec![int_ty.clone()]).with_extension_delta(delta), - None, [a], )?; let [a] = inner.input_wires_arr(); @@ -261,11 +260,7 @@ mod test { .add_dataflow_op(test_quantum_extension::h_gate(), [p])? .outputs_arr(); let swap = { - let swap = h.dfg_builder( - FunctionType::new_endo(type_row![QB_T, QB_T]), - None, - [p_h, q], - )?; + let swap = h.dfg_builder(FunctionType::new_endo(type_row![QB_T, QB_T]), [p_h, q])?; let [a, b] = swap.input_wires_arr(); swap.finish_with_outputs([b, a])? }; @@ -363,7 +358,6 @@ mod test { let h_b = outer.add_dataflow_op(test_quantum_extension::h_gate(), [b])?; let mut inner = outer.dfg_builder( FunctionType::new_endo(type_row![QB_T]).with_extension_delta(float_types::EXTENSION_ID), - None, h_b.outputs(), )?; let [i] = inner.input_wires_arr(); diff --git a/hugr-core/src/hugr/rewrite/outline_cfg.rs b/hugr-core/src/hugr/rewrite/outline_cfg.rs index 335a7a44d..5880708e0 100644 --- a/hugr-core/src/hugr/rewrite/outline_cfg.rs +++ b/hugr-core/src/hugr/rewrite/outline_cfg.rs @@ -125,10 +125,8 @@ impl Rewrite for OutlineCfg { // 2. new_block contains input node, sub-cfg, exit node all connected let (new_block, cfg_node) = { - let input_extensions = h.get_nodetype(entry).input_extensions().cloned(); let mut new_block_bldr = BlockBuilder::new( inputs.clone(), - input_extensions.clone(), vec![type_row![]], outputs.clone(), extension_delta.clone(), @@ -136,7 +134,7 @@ impl Rewrite for OutlineCfg { .unwrap(); let wires_in = inputs.iter().cloned().zip(new_block_bldr.input_wires()); let cfg = new_block_bldr - .cfg_builder(wires_in, input_extensions, outputs, extension_delta) + .cfg_builder(wires_in, outputs, extension_delta) .unwrap(); let cfg = cfg.finish_sub_container().unwrap(); let unit_sum = new_block_bldr.add_constant(ops::Value::unary_unit_sum()); diff --git a/hugr-core/src/hugr/rewrite/replace.rs b/hugr-core/src/hugr/rewrite/replace.rs index 9cc028053..08bea175c 100644 --- a/hugr-core/src/hugr/rewrite/replace.rs +++ b/hugr-core/src/hugr/rewrite/replace.rs @@ -455,7 +455,7 @@ mod test { }; use crate::hugr::internal::HugrMutInternals; use crate::hugr::rewrite::replace::WhichHugr; - use crate::hugr::{HugrMut, NodeType, Rewrite}; + use crate::hugr::{HugrMut, Rewrite}; use crate::ops::custom::{CustomOp, OpaqueOp}; use crate::ops::dataflow::DataflowOpTrait; use crate::ops::handle::{BasicBlockID, ConstID, NodeHandle}; @@ -523,9 +523,9 @@ mod test { // Replacement: one BB with two DFGs inside. // Use Hugr rather than Builder because DFGs must be empty (not even Input/Output). - let mut replacement = Hugr::new(NodeType::new_open(ops::CFG { + let mut replacement = Hugr::new(ops::CFG { signature: FunctionType::new_endo(just_list.clone()), - })); + }); let r_bb = replacement.add_node_with_parent( replacement.root(), DataflowBlock { @@ -676,14 +676,14 @@ mod test { let case1 = case1.finish_with_outputs(foo.outputs())?.node(); let mut case2 = cond.case_builder(1)?; let bar = case2.add_dataflow_op(mk_op("bar"), case2.input_wires())?; - let mut baz_dfg = case2.dfg_builder(utou.clone(), None, bar.outputs())?; + let mut baz_dfg = case2.dfg_builder(utou.clone(), bar.outputs())?; let baz = baz_dfg.add_dataflow_op(mk_op("baz"), baz_dfg.input_wires())?; let baz_dfg = baz_dfg.finish_with_outputs(baz.outputs())?; let case2 = case2.finish_with_outputs(baz_dfg.outputs())?.node(); let cond = cond.finish_sub_container()?; let h = h.finish_hugr_with_outputs(cond.outputs(), &PRELUDE_REGISTRY)?; - let mut r_hugr = Hugr::new(NodeType::new_open(h.get_optype(cond.node()).clone())); + let mut r_hugr = Hugr::new(h.get_optype(cond.node()).clone()); let r1 = r_hugr.add_node_with_parent( r_hugr.root(), Case { diff --git a/hugr-core/src/hugr/rewrite/simple_replace.rs b/hugr-core/src/hugr/rewrite/simple_replace.rs index 387b97b76..a70c275aa 100644 --- a/hugr-core/src/hugr/rewrite/simple_replace.rs +++ b/hugr-core/src/hugr/rewrite/simple_replace.rs @@ -244,7 +244,6 @@ pub(in crate::hugr::rewrite) mod test { let mut inner_builder = func_builder.dfg_builder( FunctionType::new(type_row![QB, QB], type_row![QB, QB]), - None, [qb0, qb1], )?; let inner_graph = { diff --git a/hugr-core/src/hugr/serialize.rs b/hugr-core/src/hugr/serialize.rs index a93eb2070..f5554094b 100644 --- a/hugr-core/src/hugr/serialize.rs +++ b/hugr-core/src/hugr/serialize.rs @@ -5,8 +5,7 @@ use std::collections::HashMap; use thiserror::Error; use crate::core::NodeIndex; -use crate::extension::ExtensionSet; -use crate::hugr::{Hugr, NodeType}; +use crate::hugr::Hugr; use crate::ops::OpType; use crate::{Node, PortIndex}; use portgraph::hierarchy::AttachError; @@ -48,7 +47,6 @@ impl Versioned { #[derive(Clone, Serialize, Deserialize, PartialEq, Debug)] struct NodeSer { parent: Node, - input_extensions: Option, #[serde(flatten)] op: OpType, } @@ -143,12 +141,11 @@ impl TryFrom<&Hugr> for SerHugrV1 { let mut metadata = vec![None; hugr.node_count()]; for n in hugr.nodes() { let parent = node_rekey[&hugr.get_parent(n).unwrap_or(n)]; - let opt = hugr.get_nodetype(n); + let opt = hugr.get_optype(n); let new_node = node_rekey[&n].index(); nodes[new_node] = Some(NodeSer { parent, - input_extensions: opt.input_extensions.clone(), - op: opt.op.clone(), + op: opt.clone(), }); metadata[new_node].clone_from(hugr.metadata.get(n.pg_index())); } @@ -205,7 +202,6 @@ impl TryFrom for Hugr { let mut nodes = nodes.into_iter(); let NodeSer { parent: root_parent, - input_extensions, op: root_type, } = nodes.next().unwrap(); if root_parent.index() != 0 { @@ -213,17 +209,10 @@ impl TryFrom for Hugr { } // if there are any unconnected ports or copy nodes the capacity will be // an underestimate - let mut hugr = Hugr::with_capacity( - NodeType::new(root_type, input_extensions), - nodes.len(), - edges.len() * 2, - ); + let mut hugr = Hugr::with_capacity(root_type, nodes.len(), edges.len() * 2); for node_ser in nodes { - hugr.add_node_with_parent( - node_ser.parent, - NodeType::new(node_ser.op, node_ser.input_extensions), - ); + hugr.add_node_with_parent(node_ser.parent, node_ser.op); } if let Some(metadata) = metadata { diff --git a/hugr-core/src/hugr/serialize/test.rs b/hugr-core/src/hugr/serialize/test.rs index fdd58e398..712c871b4 100644 --- a/hugr-core/src/hugr/serialize/test.rs +++ b/hugr-core/src/hugr/serialize/test.rs @@ -5,7 +5,7 @@ use crate::builder::{ }; use crate::extension::prelude::{BOOL_T, PRELUDE_ID, QB_T, USIZE_T}; use crate::extension::simple_op::MakeRegisteredOp; -use crate::extension::{test::SimpleOpDef, EMPTY_REG, PRELUDE_REGISTRY}; +use crate::extension::{test::SimpleOpDef, ExtensionSet, EMPTY_REG, PRELUDE_REGISTRY}; use crate::hugr::internal::HugrMutInternals; use crate::ops::custom::{ExtensionOp, OpaqueOp}; use crate::ops::{self, dataflow::IOTrait, Input, Module, Noop, Output, Value, DFG}; @@ -226,11 +226,11 @@ fn simpleser() { let mut h = Hierarchy::new(); let mut op_types = UnmanagedDenseMap::new(); - op_types[root] = NodeType::new_open(gen_optype(&g, root)); + op_types[root] = gen_optype(&g, root); for n in [a, b, c] { h.push_child(n, root).unwrap(); - op_types[n] = NodeType::new_pure(gen_optype(&g, n)); + op_types[n] = gen_optype(&g, n); } let hugr = Hugr { @@ -469,7 +469,6 @@ fn roundtrip_polyfunctype(#[case] poly_func_type: PolyFuncType) { fn roundtrip_optype(#[case] optype: impl Into + std::fmt::Debug) { check_testing_roundtrip(NodeSer { parent: portgraph::NodeIndex::new(0).into(), - input_extensions: None, op: optype.into(), }); } @@ -477,7 +476,6 @@ fn roundtrip_optype(#[case] optype: impl Into + std::fmt::Debug) { mod proptest { use super::check_testing_roundtrip; use super::{NodeSer, SimpleOpDef}; - use crate::extension::ExtensionSet; use crate::ops::{OpType, Value}; use crate::types::{PolyFuncType, Type}; use proptest::prelude::*; @@ -488,14 +486,9 @@ mod proptest { fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy { ( (0..i32::MAX as usize).prop_map(|x| portgraph::NodeIndex::new(x).into()), - any::>(), any::(), ) - .prop_map(|(parent, input_extensions, op)| NodeSer { - parent, - input_extensions, - op, - }) + .prop_map(|(parent, op)| NodeSer { parent, op }) .boxed() } } diff --git a/hugr-core/src/hugr/validate.rs b/hugr-core/src/hugr/validate.rs index ce6532ab0..be2e06003 100644 --- a/hugr-core/src/hugr/validate.rs +++ b/hugr-core/src/hugr/validate.rs @@ -19,7 +19,6 @@ use crate::types::{EdgeKind, FunctionType}; use crate::{Direction, Hugr, Node, Port}; use super::views::{HierarchyView, HugrView, SiblingGraph}; -use super::NodeType; /// Structure keeping track of pre-computed information used in the validation /// process. @@ -152,8 +151,7 @@ impl<'a, 'b> ValidationContext<'a, 'b> { /// - Matching the number of ports with the signature /// - Dataflow ports are correct. See `validate_df_port` fn validate_node(&self, node: Node) -> Result<(), ValidationError> { - let node_type = self.hugr.get_nodetype(node); - let op_type = &node_type.op; + let op_type = self.hugr.get_optype(node); // The Hugr can have only one root node. if node == self.hugr.root() { @@ -210,7 +208,7 @@ impl<'a, 'b> ValidationContext<'a, 'b> { })?; // Thirdly that the node has correct children - self.validate_children(node, node_type)?; + self.validate_children(node, op_type)?; Ok(()) } @@ -315,8 +313,7 @@ impl<'a, 'b> ValidationContext<'a, 'b> { /// Check operation-specific constraints. /// /// These are flags defined for each operation type as an [`OpValidityFlags`] object. - fn validate_children(&self, node: Node, node_type: &NodeType) -> Result<(), ValidationError> { - let op_type = &node_type.op; + fn validate_children(&self, node: Node, op_type: &OpType) -> Result<(), ValidationError> { let flags = op_type.validity_flags(); if self.hugr.hierarchy.child_count(node.pg_index()) > 0 { diff --git a/hugr-core/src/hugr/validate/test.rs b/hugr-core/src/hugr/validate/test.rs index 47c197416..d4d311170 100644 --- a/hugr-core/src/hugr/validate/test.rs +++ b/hugr-core/src/hugr/validate/test.rs @@ -77,7 +77,7 @@ fn invalid_root() { Err(ValidationError::NoParent { node }) => assert_eq!(node, other) ); b.set_parent(other, root); - b.replace_op(other, NodeType::new_pure(declare_op)).unwrap(); + b.replace_op(other, declare_op).unwrap(); b.add_ports(other, Direction::Outgoing, 1); assert_eq!(b.validate(&EMPTY_REG), Ok(())); @@ -96,7 +96,7 @@ fn invalid_root() { fn leaf_root() { let leaf_op: OpType = Noop { ty: USIZE_T }.into(); - let b = Hugr::new(NodeType::new_pure(leaf_op)); + let b = Hugr::new(leaf_op); assert_eq!(b.validate(&EMPTY_REG), Ok(())); } @@ -107,7 +107,7 @@ fn dfg_root() { } .into(); - let mut b = Hugr::new(NodeType::new_pure(dfg_op)); + let mut b = Hugr::new(dfg_op); let root = b.root(); add_df_children(&mut b, root, 1); assert_eq!(b.update_validate(&EMPTY_REG), Ok(())); @@ -175,36 +175,26 @@ fn df_children_restrictions() { .unwrap(); // Replace the output operation of the df subgraph with a copy - b.replace_op(output, NodeType::new_pure(Noop { ty: NAT })) - .unwrap(); + b.replace_op(output, Noop { ty: NAT }).unwrap(); assert_matches!( b.validate(&EMPTY_REG), Err(ValidationError::InvalidInitialChild { parent, .. }) => assert_eq!(parent, def) ); // Revert it back to an output, but with the wrong number of ports - b.replace_op( - output, - NodeType::new_pure(ops::Output::new(type_row![BOOL_T])), - ) - .unwrap(); + b.replace_op(output, ops::Output::new(type_row![BOOL_T])) + .unwrap(); assert_matches!( b.validate(&EMPTY_REG), Err(ValidationError::InvalidChildren { parent, source: ChildrenValidationError::IOSignatureMismatch { child, .. }, .. }) => {assert_eq!(parent, def); assert_eq!(child, output.pg_index())} ); - b.replace_op( - output, - NodeType::new_pure(ops::Output::new(type_row![BOOL_T, BOOL_T])), - ) - .unwrap(); + b.replace_op(output, ops::Output::new(type_row![BOOL_T, BOOL_T])) + .unwrap(); // After fixing the output back, replace the copy with an output op - b.replace_op( - copy, - NodeType::new_pure(ops::Output::new(type_row![BOOL_T, BOOL_T])), - ) - .unwrap(); + b.replace_op(copy, ops::Output::new(type_row![BOOL_T, BOOL_T])) + .unwrap(); assert_matches!( b.validate(&EMPTY_REG), Err(ValidationError::InvalidChildren { parent, source: ChildrenValidationError::InternalIOChildren { child, .. }, .. }) @@ -265,7 +255,6 @@ fn no_ext_edge_into_func() -> Result<(), Box> { let mut dfg = h.dfg_builder( FunctionType::new(vec![], Type::new_function(b2b.clone())), - None, [], )?; let mut func = dfg.define_function("AndWithOuter", b2b.clone().into())?; @@ -694,16 +683,13 @@ fn no_outer_row_variables(#[case] connect: bool) -> Result<(), Box input, Some(new_ext) => { let lift = hugr.add_node_with_parent( case, - NodeType::new_pure(ops::Lift { + ops::Lift { type_row: type_row![USIZE_T], new_extension: new_ext, - }), + }, ); hugr.connect(input, 0, lift, 0); lift @@ -1227,7 +1204,7 @@ mod extension_tests { } fn make_bb(t: Type, es: ExtensionSet) -> DFGWrapper { - BlockBuilder::new(t.clone(), None, vec![t.into()], type_row![], es).unwrap() + BlockBuilder::new(t.clone(), vec![t.into()], type_row![], es).unwrap() } fn make_tailloop(t: Type, es: ExtensionSet) -> DFGWrapper> { diff --git a/hugr-core/src/hugr/views.rs b/hugr-core/src/hugr/views.rs index 607f88768..6371e7772 100644 --- a/hugr-core/src/hugr/views.rs +++ b/hugr-core/src/hugr/views.rs @@ -26,8 +26,7 @@ use portgraph::{multiportgraph, LinkView, PortView}; use super::internal::HugrInternals; use super::{ - Hugr, HugrError, HugrMut, NodeMetadata, NodeMetadataMap, NodeType, ValidationError, - DEFAULT_NODETYPE, + Hugr, HugrError, HugrMut, NodeMetadata, NodeMetadataMap, ValidationError, DEFAULT_OPTYPE, }; use crate::extension::ExtensionRegistry; use crate::ops::handle::NodeHandle; @@ -80,8 +79,8 @@ pub trait HugrView: HugrInternals { /// Return the type of the HUGR root node. #[inline] - fn root_type(&self) -> &NodeType { - let node_type = self.get_nodetype(self.root()); + fn root_type(&self) -> &OpType { + let node_type = self.get_optype(self.root()); // Sadly no way to do this at present // debug_assert!(Self::RootHandle::can_hold(node_type.tag())); node_type @@ -119,15 +118,9 @@ pub trait HugrView: HugrInternals { /// Returns the operation type of a node. #[inline] fn get_optype(&self, node: Node) -> &OpType { - &self.get_nodetype(node).op - } - - /// Returns the type of a node. - #[inline] - fn get_nodetype(&self, node: Node) -> &NodeType { match self.contains_node(node) { true => self.base_hugr().op_types.get(node.pg_index()), - false => &DEFAULT_NODETYPE, + false => &DEFAULT_OPTYPE, } } @@ -323,8 +316,8 @@ pub trait HugrView: HugrInternals { /// If the node isn't a dataflow parent, then return None #[inline] fn get_io(&self, node: Node) -> Option<[Node; 2]> { - let op = self.get_nodetype(node); - // Nodes outside the view have no children (and a non-DataflowParent NodeType::default()) + let op = self.get_optype(node); + // Nodes outside the view have no children (and a non-DataflowParent OpType::default()) if OpTag::DataflowParent.is_superset(op.tag()) { self.children(node).take(2).collect_vec().try_into().ok() } else { diff --git a/hugr-core/src/hugr/views/descendants.rs b/hugr-core/src/hugr/views/descendants.rs index bee6dbd26..264890a31 100644 --- a/hugr-core/src/hugr/views/descendants.rs +++ b/hugr-core/src/hugr/views/descendants.rs @@ -231,11 +231,8 @@ pub(super) mod test { let q_out = func_builder.add_dataflow_op(h_gate(), vec![qb])?; let inner_id = { - let inner_builder = func_builder.dfg_builder( - FunctionType::new(type_row![NAT], type_row![NAT]), - None, - [int], - )?; + let inner_builder = func_builder + .dfg_builder(FunctionType::new(type_row![NAT], type_row![NAT]), [int])?; let w = inner_builder.input_wires(); inner_builder.finish_with_outputs(w) }?; diff --git a/hugr-core/src/hugr/views/root_checked.rs b/hugr-core/src/hugr/views/root_checked.rs index d8d52a7ae..668fdb83d 100644 --- a/hugr-core/src/hugr/views/root_checked.rs +++ b/hugr-core/src/hugr/views/root_checked.rs @@ -72,16 +72,17 @@ mod test { use super::RootChecked; use crate::extension::ExtensionSet; use crate::hugr::internal::HugrMutInternals; - use crate::hugr::{HugrError, HugrMut, NodeType}; + use crate::hugr::{HugrError, HugrMut}; use crate::ops::handle::{BasicBlockID, CfgID, DataflowParentID, DfgID}; - use crate::ops::{DataflowBlock, MakeTuple, OpTag}; + use crate::ops::{DataflowBlock, MakeTuple, OpTag, OpType}; use crate::{ops, type_row, types::FunctionType, Hugr, HugrView}; #[test] fn root_checked() { - let root_type = NodeType::new_pure(ops::DFG { + let root_type: OpType = ops::DFG { signature: FunctionType::new(vec![], vec![]), - }); + } + .into(); let mut h = Hugr::new(root_type.clone()); let cfg_v = RootChecked::<&Hugr, CfgID>::try_new(&h); assert_eq!( @@ -94,12 +95,13 @@ mod test { let mut dfg_v = RootChecked::<&mut Hugr, DfgID>::try_new(&mut h).unwrap(); // That is a HugrMutInternal, so we can try: let root = dfg_v.root(); - let bb = NodeType::new_pure(DataflowBlock { + let bb: OpType = DataflowBlock { inputs: type_row![], other_outputs: type_row![], sum_rows: vec![type_row![]], extension_delta: ExtensionSet::new(), - }); + } + .into(); let r = dfg_v.replace_op(root, bb.clone()); assert_eq!( r, @@ -109,7 +111,7 @@ mod test { }) ); // That didn't do anything: - assert_eq!(dfg_v.get_nodetype(root), &root_type); + assert_eq!(dfg_v.get_optype(root), &root_type); // Make a RootChecked that allows any DataflowParent // We won't be able to do this by widening the bound: @@ -124,12 +126,12 @@ mod test { let mut dfp_v = RootChecked::<&mut Hugr, DataflowParentID>::try_new(&mut h).unwrap(); let r = dfp_v.replace_op(root, bb.clone()); assert_eq!(r, Ok(root_type)); - assert_eq!(dfp_v.get_nodetype(root), &bb); + assert_eq!(dfp_v.get_optype(root), &bb); // Just check we can create a nested instance (narrowing the bound) let mut bb_v = RootChecked::<_, BasicBlockID>::try_new(dfp_v).unwrap(); // And it's a HugrMut: - let nodetype = NodeType::new_pure(MakeTuple { tys: type_row![] }); + let nodetype = MakeTuple { tys: type_row![] }; bb_v.add_node_with_parent(bb_v.root(), nodetype); } } diff --git a/hugr-core/src/hugr/views/sibling.rs b/hugr-core/src/hugr/views/sibling.rs index 25bc477a4..662764e6c 100644 --- a/hugr-core/src/hugr/views/sibling.rs +++ b/hugr-core/src/hugr/views/sibling.rs @@ -381,9 +381,9 @@ mod test { use crate::builder::test::simple_dfg_hugr; use crate::builder::{Container, Dataflow, DataflowSubContainer, HugrBuilder, ModuleBuilder}; use crate::extension::PRELUDE_REGISTRY; - use crate::hugr::NodeType; use crate::ops::handle::{CfgID, DataflowParentID, DfgID, FuncID}; use crate::ops::{dataflow::IOTrait, Input, OpTag, Output}; + use crate::ops::{OpTrait, OpType}; use crate::type_row; use crate::types::{FunctionType, Type}; @@ -411,7 +411,7 @@ mod test { let mut module_builder = ModuleBuilder::new(); let fty = FunctionType::new(type_row![NAT], type_row![NAT]); let mut fbuild = module_builder.define_function("main", fty.clone().into())?; - let dfg = fbuild.dfg_builder(fty, None, fbuild.input_wires())?; + let dfg = fbuild.dfg_builder(fty, fbuild.input_wires())?; let ins = dfg.input_wires(); let sub_dfg = dfg.finish_with_outputs(ins)?; let fun = fbuild.finish_with_outputs(sub_dfg.outputs())?; @@ -455,7 +455,7 @@ mod test { ); let mut sib_mut = SiblingMut::::try_new(&mut simple_dfg_hugr, root).unwrap(); - let bad_nodetype = NodeType::new_open(crate::ops::CFG { signature }); + let bad_nodetype: OpType = crate::ops::CFG { signature }.into(); assert_eq!( sib_mut.replace_op(sib_mut.root(), bad_nodetype.clone()), Err(HugrError::InvalidTag { @@ -472,13 +472,13 @@ mod test { #[rstest] fn sibling_mut_covariance(mut simple_dfg_hugr: Hugr) { let root = simple_dfg_hugr.root(); - let case_nodetype = NodeType::new_open(crate::ops::Case { - signature: simple_dfg_hugr.root_type().op_signature().unwrap(), - }); + let case_nodetype = crate::ops::Case { + signature: simple_dfg_hugr.root_type().dataflow_signature().unwrap(), + }; let mut sib_mut = SiblingMut::::try_new(&mut simple_dfg_hugr, root).unwrap(); // As expected, we cannot replace the root with a Case assert_eq!( - sib_mut.replace_op(root, case_nodetype.clone()), + sib_mut.replace_op(root, case_nodetype), Err(HugrError::InvalidTag { required: OpTag::Dfg, actual: OpTag::Case diff --git a/hugr-core/src/ops/constant.rs b/hugr-core/src/ops/constant.rs index ea55908fa..7975c40fe 100644 --- a/hugr-core/src/ops/constant.rs +++ b/hugr-core/src/ops/constant.rs @@ -274,7 +274,7 @@ fn mono_fn_type(h: &Hugr) -> Result { } } Err(ConstTypeError::NotMonomorphicFunction { - hugr_root_type: h.root_type().op().clone(), + hugr_root_type: h.root_type().clone(), }) } diff --git a/hugr-core/src/ops/custom.rs b/hugr-core/src/ops/custom.rs index d97a8202c..8f4e3f19c 100644 --- a/hugr-core/src/ops/custom.rs +++ b/hugr-core/src/ops/custom.rs @@ -12,7 +12,7 @@ use { use crate::extension::{ConstFoldResult, ExtensionId, ExtensionRegistry, OpDef, SignatureError}; use crate::hugr::internal::HugrMutInternals; -use crate::hugr::{HugrView, NodeType}; +use crate::hugr::HugrView; use crate::types::EdgeKind; use crate::types::{type_param::TypeArg, FunctionType}; use crate::{ops, Hugr, IncomingPort, Node}; @@ -362,10 +362,9 @@ pub fn resolve_extension_ops( } // Only now can we perform the replacements as the 'for' loop was borrowing 'h' preventing use from using it mutably for (n, op) in replacements { - let node_type = NodeType::new(op, h.get_nodetype(n).input_extensions().cloned()); debug_assert_eq!(h.get_optype(n).tag(), OpTag::Leaf); - debug_assert_eq!(node_type.tag(), OpTag::Leaf); - h.replace_op(n, node_type).unwrap(); + debug_assert_eq!(op.tag(), OpTag::Leaf); + h.replace_op(n, op).unwrap(); } Ok(()) } diff --git a/hugr-passes/src/const_fold/test.rs b/hugr-passes/src/const_fold/test.rs index b5c0913bd..b116853ab 100644 --- a/hugr-passes/src/const_fold/test.rs +++ b/hugr-passes/src/const_fold/test.rs @@ -231,7 +231,6 @@ fn orphan_output() { // // We arange things so that the `or` folds away first, leaving the not // with no outputs. - use hugr_core::hugr::NodeType; use hugr_core::ops::handle::NodeHandle; let mut build = DFGBuilder::new(FunctionType::new(type_row![], vec![BOOL_T])).unwrap(); @@ -252,7 +251,7 @@ fn orphan_output() { // we delete the original Not and create a new One. This means it will be // traversed by `constant_fold_pass` after the Or. - let new_not = h.add_node_with_parent(parent, NodeType::new_auto(NotOp)); + let new_not = h.add_node_with_parent(parent, NotOp); h.connect(true_wire.node(), true_wire.source(), new_not, 0); h.disconnect(or_node, IncomingPort::from(1)); h.connect(new_not, 0, or_node, 1); diff --git a/hugr-py/src/hugr/serialization/ops.py b/hugr-py/src/hugr/serialization/ops.py index e96dfa733..60242b77d 100644 --- a/hugr-py/src/hugr/serialization/ops.py +++ b/hugr-py/src/hugr/serialization/ops.py @@ -29,7 +29,6 @@ class BaseOp(ABC, ConfiguredBaseModel): # Parent node index of node the op belongs to, used only at serialization time parent: NodeID - input_extensions: ExtensionSet | None = Field(default=None) def insert_port_types(self, in_types: TypeRow, out_types: TypeRow) -> None: """Hook to insert type information from the input and output ports into the diff --git a/hugr/src/hugr.rs b/hugr/src/hugr.rs index c2b6a70b7..cdf4fe42b 100644 --- a/hugr/src/hugr.rs +++ b/hugr/src/hugr.rs @@ -3,6 +3,6 @@ // Exports everything except the `internal` module. pub use hugr_core::hugr::{ hugrmut, rewrite, serialize, validate, views, Hugr, HugrError, HugrView, IdentList, - InvalidIdentifier, NodeMetadata, NodeMetadataMap, NodeType, Rewrite, RootTagged, - SimpleReplacement, SimpleReplacementError, ValidationError, DEFAULT_NODETYPE, + InvalidIdentifier, NodeMetadata, NodeMetadataMap, OpType, Rewrite, RootTagged, + SimpleReplacement, SimpleReplacementError, ValidationError, DEFAULT_OPTYPE, }; diff --git a/specification/schema/hugr_schema_strict_v1.json b/specification/schema/hugr_schema_strict_v1.json index 08f948996..87c29ac88 100644 --- a/specification/schema/hugr_schema_strict_v1.json +++ b/specification/schema/hugr_schema_strict_v1.json @@ -35,21 +35,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "AliasDecl", "default": "AliasDecl", @@ -82,21 +67,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "AliasDefn", "default": "AliasDefn", @@ -211,21 +181,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "CFG", "default": "CFG", @@ -253,21 +208,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Call", "default": "Call", @@ -308,21 +248,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "CallIndirect", "default": "CallIndirect", @@ -350,21 +275,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Case", "default": "Case", @@ -392,21 +302,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Conditional", "default": "Conditional", @@ -463,21 +358,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Const", "default": "Const", @@ -524,21 +404,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "CustomOp", "default": "CustomOp", @@ -588,21 +453,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "DFG", "default": "DFG", @@ -630,21 +480,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "DataflowBlock", "default": "DataflowBlock", @@ -701,21 +536,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "ExitBlock", "default": "ExitBlock", @@ -825,21 +645,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "FuncDecl", "default": "FuncDecl", @@ -873,21 +678,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "FuncDefn", "default": "FuncDefn", @@ -1025,21 +815,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Input", "default": "Input", @@ -1071,21 +846,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Lift", "default": "Lift", @@ -1145,21 +905,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "LoadConstant", "default": "LoadConstant", @@ -1188,21 +933,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "LoadFunction", "default": "LoadFunction", @@ -1243,21 +973,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "MakeTuple", "default": "MakeTuple", @@ -1289,21 +1004,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Module", "default": "Module", @@ -1328,21 +1028,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Noop", "default": "Noop", @@ -1575,21 +1260,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Output", "default": "Output", @@ -1771,21 +1441,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Tag", "default": "Tag", @@ -1826,21 +1481,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "TailLoop", "default": "TailLoop", @@ -2175,21 +1815,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "UnpackTuple", "default": "UnpackTuple", diff --git a/specification/schema/hugr_schema_v1.json b/specification/schema/hugr_schema_v1.json index 8399c4feb..24d59c149 100644 --- a/specification/schema/hugr_schema_v1.json +++ b/specification/schema/hugr_schema_v1.json @@ -35,21 +35,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "AliasDecl", "default": "AliasDecl", @@ -82,21 +67,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "AliasDefn", "default": "AliasDefn", @@ -211,21 +181,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "CFG", "default": "CFG", @@ -253,21 +208,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Call", "default": "Call", @@ -308,21 +248,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "CallIndirect", "default": "CallIndirect", @@ -350,21 +275,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Case", "default": "Case", @@ -392,21 +302,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Conditional", "default": "Conditional", @@ -463,21 +358,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Const", "default": "Const", @@ -524,21 +404,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "CustomOp", "default": "CustomOp", @@ -588,21 +453,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "DFG", "default": "DFG", @@ -630,21 +480,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "DataflowBlock", "default": "DataflowBlock", @@ -701,21 +536,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "ExitBlock", "default": "ExitBlock", @@ -825,21 +645,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "FuncDecl", "default": "FuncDecl", @@ -873,21 +678,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "FuncDefn", "default": "FuncDefn", @@ -1025,21 +815,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Input", "default": "Input", @@ -1071,21 +846,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Lift", "default": "Lift", @@ -1145,21 +905,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "LoadConstant", "default": "LoadConstant", @@ -1188,21 +933,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "LoadFunction", "default": "LoadFunction", @@ -1243,21 +973,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "MakeTuple", "default": "MakeTuple", @@ -1289,21 +1004,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Module", "default": "Module", @@ -1328,21 +1028,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Noop", "default": "Noop", @@ -1575,21 +1260,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Output", "default": "Output", @@ -1771,21 +1441,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Tag", "default": "Tag", @@ -1826,21 +1481,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "TailLoop", "default": "TailLoop", @@ -2175,21 +1815,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "UnpackTuple", "default": "UnpackTuple", diff --git a/specification/schema/testing_hugr_schema_strict_v1.json b/specification/schema/testing_hugr_schema_strict_v1.json index 567c481dd..0199ce591 100644 --- a/specification/schema/testing_hugr_schema_strict_v1.json +++ b/specification/schema/testing_hugr_schema_strict_v1.json @@ -35,21 +35,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "AliasDecl", "default": "AliasDecl", @@ -82,21 +67,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "AliasDefn", "default": "AliasDefn", @@ -211,21 +181,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "CFG", "default": "CFG", @@ -253,21 +208,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Call", "default": "Call", @@ -308,21 +248,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "CallIndirect", "default": "CallIndirect", @@ -350,21 +275,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Case", "default": "Case", @@ -392,21 +302,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Conditional", "default": "Conditional", @@ -463,21 +358,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Const", "default": "Const", @@ -524,21 +404,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "CustomOp", "default": "CustomOp", @@ -588,21 +453,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "DFG", "default": "DFG", @@ -630,21 +480,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "DataflowBlock", "default": "DataflowBlock", @@ -701,21 +536,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "ExitBlock", "default": "ExitBlock", @@ -846,21 +666,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "FuncDecl", "default": "FuncDecl", @@ -894,21 +699,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "FuncDefn", "default": "FuncDefn", @@ -1046,21 +836,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Input", "default": "Input", @@ -1092,21 +867,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Lift", "default": "Lift", @@ -1166,21 +926,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "LoadConstant", "default": "LoadConstant", @@ -1209,21 +954,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "LoadFunction", "default": "LoadFunction", @@ -1264,21 +994,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "MakeTuple", "default": "MakeTuple", @@ -1310,21 +1025,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Module", "default": "Module", @@ -1349,21 +1049,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Noop", "default": "Noop", @@ -1652,21 +1337,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Output", "default": "Output", @@ -1848,21 +1518,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Tag", "default": "Tag", @@ -1903,21 +1558,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "TailLoop", "default": "TailLoop", @@ -2252,21 +1892,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "UnpackTuple", "default": "UnpackTuple", diff --git a/specification/schema/testing_hugr_schema_v1.json b/specification/schema/testing_hugr_schema_v1.json index 47ed10526..f06ad5300 100644 --- a/specification/schema/testing_hugr_schema_v1.json +++ b/specification/schema/testing_hugr_schema_v1.json @@ -35,21 +35,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "AliasDecl", "default": "AliasDecl", @@ -82,21 +67,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "AliasDefn", "default": "AliasDefn", @@ -211,21 +181,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "CFG", "default": "CFG", @@ -253,21 +208,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Call", "default": "Call", @@ -308,21 +248,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "CallIndirect", "default": "CallIndirect", @@ -350,21 +275,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Case", "default": "Case", @@ -392,21 +302,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Conditional", "default": "Conditional", @@ -463,21 +358,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Const", "default": "Const", @@ -524,21 +404,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "CustomOp", "default": "CustomOp", @@ -588,21 +453,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "DFG", "default": "DFG", @@ -630,21 +480,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "DataflowBlock", "default": "DataflowBlock", @@ -701,21 +536,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "ExitBlock", "default": "ExitBlock", @@ -846,21 +666,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "FuncDecl", "default": "FuncDecl", @@ -894,21 +699,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "FuncDefn", "default": "FuncDefn", @@ -1046,21 +836,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Input", "default": "Input", @@ -1092,21 +867,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Lift", "default": "Lift", @@ -1166,21 +926,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "LoadConstant", "default": "LoadConstant", @@ -1209,21 +954,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "LoadFunction", "default": "LoadFunction", @@ -1264,21 +994,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "MakeTuple", "default": "MakeTuple", @@ -1310,21 +1025,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Module", "default": "Module", @@ -1349,21 +1049,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Noop", "default": "Noop", @@ -1652,21 +1337,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Output", "default": "Output", @@ -1848,21 +1518,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "Tag", "default": "Tag", @@ -1903,21 +1558,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "TailLoop", "default": "TailLoop", @@ -2252,21 +1892,6 @@ "title": "Parent", "type": "integer" }, - "input_extensions": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Input Extensions" - }, "op": { "const": "UnpackTuple", "default": "UnpackTuple",