zenna / Arrows.jl

14 stars 2 forks source link

Dirty CompArrow after updating inner CompArrow #23

Open zenna opened 6 years ago

zenna commented 6 years ago

If you add a port to a CompArrow and it is referenced by a SubArrow within one or more other CompArrows, (even itself) they may be dirty in that

This makes the currently way to do invert for example, problematic

zenna commented 6 years ago

This problem was avoided in invert because it replaces the arrow with replace_sub_arr! which adds the necessary things

zenna commented 6 years ago

Could alternatively, in outer, iterate through subarrows again and update parent with new edges accordingly

zenna commented 6 years ago

Alternatively have a function which cleans a composite arrow by removing broken links, adding necessary ports.

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.

zenna commented 6 years ago

Keep parents updated by construction

Pros:

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