Skip to content

Commit 740d2c8

Browse files
committed
cmd/compile: adjust top-level documentation of poset
Change-Id: I29e24c734e5e0041008771c805a0285aac3e02e5 Reviewed-on: https://go-review.googlesource.com/c/go/+/196598 Reviewed-by: David Chase <[email protected]>
1 parent 1658263 commit 740d2c8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/cmd/compile/internal/ssa/poset.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,17 @@ type posetNode struct {
106106
// order so that if we know that A<B<C and later learn that A==D, Ordered will return
107107
// true for D<C.
108108
//
109+
// It is also possible to record inequality relations between nodes with SetNonEqual;
110+
// non-equality relations are not transitive, but they can still be useful: for instance
111+
// if we know that A<=B and later we learn that A!=B, we can deduce that A<B.
112+
// NonEqual can be used to check whether it is known that the nodes are different, either
113+
// because SetNonEqual was called before, or because we know that they are strictly ordered.
114+
//
109115
// poset will refuse to record new relations that contradict existing relations:
110116
// for instance if A<B<C, calling SetOrder for C<A will fail returning false; also
111117
// calling SetEqual for C==A will fail.
112118
//
113-
// It is also possible to record inequality relations between nodes with SetNonEqual;
114-
// given that non-equality is not transitive, the only effect is that a later call
115-
// to SetEqual for the same values will fail. NonEqual checks whether it is known that
116-
// the nodes are different, either because SetNonEqual was called before, or because
117-
// we know that they are strictly ordered.
118-
//
119-
// It is implemented as a forest of DAGs; in each DAG, if there is a path (directed)
119+
// poset is implemented as a forest of DAGs; in each DAG, if there is a path (directed)
120120
// from node A to B, it means that A<B (or A<=B). Equality is represented by mapping
121121
// two SSA values to the same DAG node; when a new equality relation is recorded
122122
// between two existing nodes,the nodes are merged, adjusting incoming and outgoing edges.

0 commit comments

Comments
 (0)