Skip to content
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

Reimplement substitution and encapsulation of wiring diagrams to preserve box order #56

Merged
merged 8 commits into from
Nov 21, 2019

Conversation

epatters
Copy link
Member

Resolves #39 and #55 by reimplementing substitute! (now non-mutating and called substitute) and encapsulate! (now non-mutating and called encapsulate). Also exposes encapsulated_subdiagram as an exported function and adds induced_subdiagram as a non-mutating alternative to rem_boxes!.

Towards #39. Not working! Breaks on instantaneous wires.
Also, rename internal data structures `PortEdgeData` to `PortData` and
`WireEdgeData` to `WireData`.
The encapsulation procedure has been completely rewritten, in what I hope is
better style than before. Closes #55.
These functions are not actually mutating anymore. Although they might
be included for backwards compatibility, I think it better to just remove
them.
Provides a non-mutating, box order-preserving alternative to `rem_boxes!`.
@epatters epatters merged commit d08bd20 into master Nov 21, 2019
@epatters epatters deleted the substitute-encapsulate-order branch November 21, 2019 07:20
epatters referenced this pull request in epatters/flowgraphs Nov 21, 2019
https://github.com/epatters/Catlab.jl/pull/56
IBM/semanticflowgraph@04649fc

Due to these changes, semantic enrichment now preserves the order of boxes,
making the tests easier to write and understand.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Preserve order of box IDs when substituting
1 participant