Open zenna opened 6 years ago
This problem was avoided in invert because it replaces the arrow with replace_sub_arr!
which adds the necessary things
Could alternatively, in outer
, iterate through subarrows again and update parent with new edges accordingly
Alternatively have a function which clean
s a composite arrow by removing broken links, adding necessary ports.
src(sprt)
but !should_src
, how to clean? Delete the edge? Reverse it?It might then be better to decompose this into a set of different cleaning regimines, e.g. one which reverses bad edges
, one which removes broken links
, and the apply the necessary cleans.
Keep parents updated by construction
Pros:
CompArrow
might be used in multiple different places.(SubArrow, PortId) => (SubArrow, PortId)
, if I added a new port I wouldn't have to update a parent perhaps, but if I deleted one then it would still be dirty.I can't see any way around having to update parents fundamentally, short of storing one single large graph for everything, which would probably be more problematic in many more ways.
For these transforms, invert, and pgf, etc I am really constructing a new arrow; I just happen to be doing it in this mutative way. So I think it's fine that a parent is invalid if I've changed it's child.
On the other hand suppose I have a parametric inverse with redundant parameters, and I figure out a simplification. I don't want to have to fix all the parent subarrows
If you add a port to a
CompArrow
and it is referenced by aSubArrow
within one or more otherCompArrow
s, (even itself) they may be dirty in thatThis makes the currently way to do
invert
for example, problematic