See also an alternative solution. Theorem Minimal strict partial order containing a given irreflexive relation is equal to transitive closure of this relation if such strict partial order exists. It exists iff the given relation is acyclic. Proof That it exists if the given relation is acyclic, is obvious. Accordingly Wikipedia, transitive closure of a directed acyclic graph is a strict partial order. Evidently there is no strict partial order containing the given relation which is less than it. So it the minimal. Let us denote C {\displaystyle C} the strict partial order for subclass relation (of precedences) (can be calculated by the above theorem). Let us denote h {\displaystyle h} the directed acyclic (remove the loops if any) graph of specified "higher than" precedences. Let us denote H {\displaystyle H} the strict partial order of precedences (to be calculated). Theorem H {\displaystyle H} can be calculated by the following algorithm: [FIXME: When does H {\displaystyle H} exist?] Let E {\displaystyle E} be the transitive closure of h {\displaystyle h} . Let F {\displaystyle F} = E {\displaystyle E} . Start loop. Let G = E ∪ ( C − 1 ∘ E ∘ C ) {\displaystyle G=E\cup (C^{-1}\circ E\circ C)} . If G = E {\displaystyle G=E} then it is the answer. [TODO: do one rather than two multiplications at a time. FIXME: Should it be instead: G = E ∪ ( E ∪ C − 1 ∘ E ) ∘ C {\displaystyle G=E\cup (E\cup C^{-1}\circ E)\circ C} ?] Let F = G ∪ ( E ∘ G ) {\displaystyle F=G\cup (E\circ G)} . If F = G {\displaystyle F=G} then it is the answer. End loop. Proof ? ?
{'wiki_source': 'wikiversity', 'other_info': "{'content_model': 'wikitext', 'language': 'en', 'title': 'Automatic transformation of XML namespaces/Implementation/Precedences', 'type': 'text'}"}