-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Provide+implement Replace API #613
Merged
Merged
Changes from 73 commits
Commits
Show all changes
75 commits
Select commit
Hold shift + click to select a range
2467729
Add Replacement struct, NewEdgeSpec/NewEdgeKind, verify, invalidation…
acl-cqc 8e531d4
WIP Implement
acl-cqc e9f4ba8
Allow returning HugrError or Msg
acl-cqc 886fba6
Check edges
acl-cqc ccf5200
Allow replacing edges from any node in S*; update spec
acl-cqc 50abda1
xxx_edges => mu_xxx (xxx = out, new, in -> inp)
acl-cqc 366209c
Make NewEdgeSpec+Replacement fields pub; run SimpleReplacement tests …
acl-cqc 2b8c86f
fmt
acl-cqc de14f04
fix - new_node already in `h`, no need to translate
acl-cqc a996f47
Convert ReplaceError::Msg into cases
acl-cqc d78cbf2
clippy
acl-cqc e6c3d8c
Rewrite incoming-edge check
acl-cqc d70444e
Shorter 'descends'
acl-cqc 6e94467
Check parent in apply
acl-cqc dcccde9
insertion shouldn't fail?? Drop HugrError
acl-cqc 7366aa7
v1 verify checks port kind
acl-cqc 46d2f48
BadEdgeKind stores Direction (temp remove check on adding Order edges)
acl-cqc 1d15e72
Break out check_existing_edge; transfer_edge does checks too
acl-cqc e371fc3
BadEdgeSpec: str -> Direction, Node -> Edge
acl-cqc 16b52b4
apply fails w/BadEdgeSpec for replacement nodes
acl-cqc 3701d50
Note what checks required
acl-cqc 677692a
Factor out get_removed_nodes
acl-cqc b2a7f00
transfer_edges: translation func returns Result<Node, WhichHugr>
acl-cqc 86d6f39
Use get_removed in apply
acl-cqc 4738710
Add missing docs; move 'impl NewEdgeSpec' after struct def for Replac…
acl-cqc 94f0586
fixup! Use get_removed
acl-cqc c4d5996
WIP test - failing in extension inference?!
acl-cqc c23b798
Directly build Hugr rather than using Builder
acl-cqc 476f0a3
Fix initial Hugr building (using Lift!)
acl-cqc 52c7c54
Fix root type of replacement, fmt
acl-cqc 50b7b5c
Fix: translate transfer-keys using node_map
acl-cqc 1bef633
Check transfer keys too
acl-cqc 72f9bf2
WIP debug
acl-cqc be28f21
Revert "WIP debug"
acl-cqc 3ae6d10
Removal a list not a set, order matters
acl-cqc d41300a
Rename variables in test
acl-cqc 1c96bbd
Update_validate, open_extensions, fix ports+wiring for predicate
acl-cqc d383856
Merge commit 'origin/main^' into new/replace
acl-cqc 5eaf13a
Update renamed predicate->tuple/unit_sum
acl-cqc 3fec96a
Remove lift nodes, use open_extensions for Const + load-constant
acl-cqc 51164a0
CI fmt
acl-cqc 5aeedb2
Merge remote-tracking branch 'origin/main' into HEAD
acl-cqc 0ce6900
Update re. port directions
acl-cqc 002e89a
CI fmt more
acl-cqc b35eb86
Rewrite test using builder again; no lift nodes, Const has singleton-…
acl-cqc 7a3029d
clippy
acl-cqc b463fd3
Spec tweaks courtesy of Alec
acl-cqc 31a743d
Yes PartialEq, no Eq
acl-cqc 8ace22b
transfers->adoptions, fix doclinks, spec names
acl-cqc 0014577
Note non-signature equality
acl-cqc 5436256
WrongRootNodeTag: expected->removed, actual->replacement
acl-cqc 154b298
Merge remote-tracking branch 'origin/main' into new/replace
acl-cqc da568ca
no open_extensions
acl-cqc f1c2114
TransfersNotSeparateDescendants is a general case of ConflictingTrans…
acl-cqc a5cca09
Assert about the Hugr
acl-cqc 961026f
Start on test - build conditional Hugr
acl-cqc b8180d7
Test duplicate 'adoptions' rhs
acl-cqc e5c426d
Rename {case,r}_t/f to {case,r}1/2
acl-cqc 326365f
Test wrong root node type
acl-cqc 2d6a7b6
Functional style using `..r.clone()`, test CantReplaceRoot
acl-cqc 8b5ed23
MultipleParents
acl-cqc 71786a9
InvalidTransferTarget
acl-cqc 65abd61
Invalid(TransferTarget=>AdoptingParent), (Transfers=>Adoptees)NotSepa…
acl-cqc 804a005
Comments, one BadEdgeSpec
acl-cqc ed440b6
Another BadEdgeSpec test
acl-cqc c502018
NotSeparateDescendants - comment nodes are best-effort
acl-cqc b1dbfc4
BadEdgeKind
acl-cqc fcf8827
Run tests on both verify + apply, include one on mu_new
acl-cqc eb3c519
WIP test NoRemovedEdge...failing
acl-cqc 17b1618
Fix for both
acl-cqc 8788dc7
refactor: move descends_any inside check_existing_edge
acl-cqc aba2f41
Merge remote-tracking branch 'origin/main' into new/replace
acl-cqc 1b39df7
Generalize Container::add_constant, pass None
acl-cqc ce9311a
Merge 'origin/main' into new/replace, update add_{op=>node}_...
acl-cqc bbb172d
Simplify invalidation_set
acl-cqc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slight generalization here @ss2165 if you are happy with that? All existing calls remain legal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can do something slightly odd in this PR (i.e. explicitly specify an ExtensionSet that is...not what you might expect) if we'd rather keep like this, 'coz either way we should probably at least try to make another PR where we remove this (and use None/open-extensions) everywhere