@@ -20,7 +20,7 @@ use crate::{
20
20
types:: EdgeKind ,
21
21
} ;
22
22
23
- use crate :: extension:: { ExtensionRegistry , ExtensionSet , TO_BE_INFERRED } ;
23
+ use crate :: extension:: ExtensionRegistry ;
24
24
use crate :: types:: { PolyFuncType , Signature , Type , TypeArg , TypeRow } ;
25
25
26
26
use itertools:: Itertools ;
@@ -319,18 +319,14 @@ pub trait Dataflow: Container {
319
319
inputs : impl IntoIterator < Item = ( Type , Wire ) > ,
320
320
) -> Result < DFGBuilder < & mut Hugr > , BuildError > {
321
321
let ( types, input_wires) : ( Vec < Type > , Vec < Wire > ) = inputs. into_iter ( ) . unzip ( ) ;
322
- self . dfg_builder (
323
- Signature :: new_endo ( types) . with_extension_delta ( TO_BE_INFERRED ) ,
324
- input_wires,
325
- )
322
+ self . dfg_builder ( Signature :: new_endo ( types) , input_wires)
326
323
}
327
324
328
325
/// Return a builder for a [`crate::ops::CFG`] node,
329
326
/// i.e. a nested controlflow subgraph.
330
327
/// The `inputs` must be an iterable over pairs of the type of the input and
331
328
/// the corresponding wire.
332
329
/// The `output_types` are the types of the outputs.
333
- /// The Extension delta will be inferred.
334
330
///
335
331
/// # Errors
336
332
///
@@ -340,27 +336,6 @@ pub trait Dataflow: Container {
340
336
& mut self ,
341
337
inputs : impl IntoIterator < Item = ( Type , Wire ) > ,
342
338
output_types : TypeRow ,
343
- ) -> Result < CFGBuilder < & mut Hugr > , BuildError > {
344
- self . cfg_builder_exts ( inputs, output_types, TO_BE_INFERRED )
345
- }
346
-
347
- /// Return a builder for a [`crate::ops::CFG`] node,
348
- /// i.e. a nested controlflow subgraph.
349
- /// The `inputs` must be an iterable over pairs of the type of the input and
350
- /// the corresponding wire.
351
- /// The `output_types` are the types of the outputs.
352
- /// `extension_delta` is explicitly specified. Alternatively
353
- /// [cfg_builder](Self::cfg_builder) may be used to infer it.
354
- ///
355
- /// # Errors
356
- ///
357
- /// This function will return an error if there is an error when building
358
- /// the CFG node.
359
- fn cfg_builder_exts (
360
- & mut self ,
361
- inputs : impl IntoIterator < Item = ( Type , Wire ) > ,
362
- output_types : TypeRow ,
363
- extension_delta : impl Into < ExtensionSet > ,
364
339
) -> Result < CFGBuilder < & mut Hugr > , BuildError > {
365
340
let ( input_types, input_wires) : ( Vec < Type > , Vec < Wire > ) = inputs. into_iter ( ) . unzip ( ) ;
366
341
@@ -369,8 +344,7 @@ pub trait Dataflow: Container {
369
344
let ( cfg_node, _) = add_node_with_wires (
370
345
self ,
371
346
ops:: CFG {
372
- signature : Signature :: new ( inputs. clone ( ) , output_types. clone ( ) )
373
- . with_extension_delta ( extension_delta) ,
347
+ signature : Signature :: new ( inputs. clone ( ) , output_types. clone ( ) ) ,
374
348
} ,
375
349
input_wires,
376
350
) ?;
@@ -449,7 +423,6 @@ pub trait Dataflow: Container {
449
423
/// The `inputs` must be an iterable over pairs of the type of the input and
450
424
/// the corresponding wire.
451
425
/// The `output_types` are the types of the outputs.
452
- /// The extension delta will be inferred.
453
426
///
454
427
/// # Errors
455
428
///
@@ -461,27 +434,6 @@ pub trait Dataflow: Container {
461
434
just_inputs : impl IntoIterator < Item = ( Type , Wire ) > ,
462
435
inputs_outputs : impl IntoIterator < Item = ( Type , Wire ) > ,
463
436
just_out_types : TypeRow ,
464
- ) -> Result < TailLoopBuilder < & mut Hugr > , BuildError > {
465
- self . tail_loop_builder_exts ( just_inputs, inputs_outputs, just_out_types, TO_BE_INFERRED )
466
- }
467
-
468
- /// Return a builder for a [`crate::ops::TailLoop`] node.
469
- /// The `inputs` must be an iterable over pairs of the type of the input and
470
- /// the corresponding wire.
471
- /// The `output_types` are the types of the outputs.
472
- /// `extension_delta` explicitly specified. Alternatively
473
- /// [tail_loop_builder](Self::tail_loop_builder) may be used to infer it.
474
- ///
475
- /// # Errors
476
- ///
477
- /// This function will return an error if there is an error when building
478
- /// the [`ops::TailLoop`] node.
479
- fn tail_loop_builder_exts (
480
- & mut self ,
481
- just_inputs : impl IntoIterator < Item = ( Type , Wire ) > ,
482
- inputs_outputs : impl IntoIterator < Item = ( Type , Wire ) > ,
483
- just_out_types : TypeRow ,
484
- extension_delta : impl Into < ExtensionSet > ,
485
437
) -> Result < TailLoopBuilder < & mut Hugr > , BuildError > {
486
438
let ( input_types, mut input_wires) : ( Vec < Type > , Vec < Wire > ) =
487
439
just_inputs. into_iter ( ) . unzip ( ) ;
@@ -493,7 +445,6 @@ pub trait Dataflow: Container {
493
445
just_inputs : input_types. into ( ) ,
494
446
just_outputs : just_out_types,
495
447
rest : rest_types. into ( ) ,
496
- extension_delta : extension_delta. into ( ) ,
497
448
} ;
498
449
// TODO: Make input extensions a parameter
499
450
let ( loop_node, _) = add_node_with_wires ( self , tail_loop. clone ( ) , input_wires) ?;
@@ -507,41 +458,17 @@ pub trait Dataflow: Container {
507
458
///
508
459
/// The `other_inputs` must be an iterable over pairs of the type of the input and
509
460
/// the corresponding wire.
510
- /// The `output_types` are the types of the outputs. Extension delta will be inferred.
511
- ///
512
- /// # Errors
513
- ///
514
- /// This function will return an error if there is an error when building
515
- /// the Conditional node.
516
- fn conditional_builder (
517
- & mut self ,
518
- sum_input : ( impl IntoIterator < Item = TypeRow > , Wire ) ,
519
- other_inputs : impl IntoIterator < Item = ( Type , Wire ) > ,
520
- output_types : TypeRow ,
521
- ) -> Result < ConditionalBuilder < & mut Hugr > , BuildError > {
522
- self . conditional_builder_exts ( sum_input, other_inputs, output_types, TO_BE_INFERRED )
523
- }
524
-
525
- /// Return a builder for a [`crate::ops::Conditional`] node.
526
- /// `sum_rows` and `sum_wire` define the type of the Sum
527
- /// variants and the wire carrying the Sum respectively.
528
- ///
529
- /// The `other_inputs` must be an iterable over pairs of the type of the input and
530
- /// the corresponding wire.
531
461
/// The `output_types` are the types of the outputs.
532
- /// `extension_delta` is explicitly specified. Alternatively
533
- /// [conditional_builder](Self::conditional_builder) may be used to infer it.
534
462
///
535
463
/// # Errors
536
464
///
537
465
/// This function will return an error if there is an error when building
538
466
/// the Conditional node.
539
- fn conditional_builder_exts (
467
+ fn conditional_builder (
540
468
& mut self ,
541
469
( sum_rows, sum_wire) : ( impl IntoIterator < Item = TypeRow > , Wire ) ,
542
470
other_inputs : impl IntoIterator < Item = ( Type , Wire ) > ,
543
471
output_types : TypeRow ,
544
- extension_delta : impl Into < ExtensionSet > ,
545
472
) -> Result < ConditionalBuilder < & mut Hugr > , BuildError > {
546
473
let mut input_wires = vec ! [ sum_wire] ;
547
474
let ( input_types, rest_input_wires) : ( Vec < Type > , Vec < Wire > ) =
@@ -558,7 +485,6 @@ pub trait Dataflow: Container {
558
485
sum_rows,
559
486
other_inputs : inputs,
560
487
outputs : output_types,
561
- extension_delta : extension_delta. into ( ) ,
562
488
} ,
563
489
input_wires,
564
490
) ?;
0 commit comments