RE: https://tech.lgbt/@monoidmusician/115685033457854645
@monoidmusician looking at this post, i'm (with my small and finite knowledge) noticing that you've effectively rediscovered vector clocks for representing posets, see https://en.wikipedia.org/wiki/Vector_clock
if i was asked to write an algorithm for this, i'd immediately think of topological orders and topological sorting algorithms, but adapting that for non-strict constraints, as well as for making it an *incremental* algorithm might still be a challenge.
what might also make any algorithm for this costly is if we collect all constraints across the entire program, and prove that "big" relation consistant; ideally, we would want to use something like module boundaries to prove each module internally/locally consistant, discard everything not visible outside of the module, and then ensure module interdependencies don't introduce inconsistancies.
i'm making a mental note to more closely examine the algorithms you've come up with when i get around to it (could take a long time).