From 49c7c3a389a9b97da8eaa06caab0a4df40015454 Mon Sep 17 00:00:00 2001 From: Lilith Orion Hafner Date: Mon, 23 Jan 2023 13:00:30 -0600 Subject: [PATCH] Change "partial" to "weak" (part of PR #48363) Thanks @knuesel --- doc/src/base/sort.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/src/base/sort.md b/doc/src/base/sort.md index 2cf7a74849684e..2b737d81998f7b 100644 --- a/doc/src/base/sort.md +++ b/doc/src/base/sort.md @@ -102,7 +102,7 @@ julia> sort(v, alg=InsertionSort) ``` All the sorting and order related functions rely on a "less than" relation defining a -[strict partial order](https://en.wikipedia.org/wiki/Partially_ordered_set#Strict_partial_order) +[strict weak order](https://en.wikipedia.org/wiki/Weak_ordering#Strict_weak_orderings) on the values to be manipulated. The `isless` function is invoked by default, but the relation can be specified via the `lt` keyword, a function that takes two array elements and returns true if and only if the first argument is "less than" the second. See [Alternate orderings](@ref) for @@ -171,12 +171,12 @@ By default, `sort`, `searchsorted`, and related functions use [`isless`](@ref) t two elements in order to determine which should come first. The [`Base.Order.Ordering`](@ref) abstract type provides a mechanism for defining alternate orderings on the same set of elements. Instances of `Ordering` define a -[strict partial order](https://en.wikipedia.org/wiki/Partially_ordered_set#Strict_partial_order). -To be a strict partial order, for any elements `a`, `b`, `c` the following hold: +[strict weak order](https://en.wikipedia.org/wiki/Weak_ordering#Strict_weak_orderings). +To be a strict weak order, for any elements `a`, `b`, `c` the following hold: -* if `a == b`, then `lt(a, b) == false`; -* `lt(a, b) && lt(b, a) == false`; and -* if `lt(a, b) && lt(b, c) == true`, then `lt(a, c) == true` +* `lt(a, b) && lt(b, a) === false`; +* if `lt(a, b) && lt(b, c)`, then `lt(a, c)`; and +* if `!lt(a, b) && !lt(b, c)`, then `!lt(a, c)` The [`Base.Order.lt`](@ref) function works as a generalization of `isless` to test whether `a` is less than `b` according to a given order.