aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-07-15 08:35:30 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-07-15 08:35:30 -0400
commit85878912035fd3fb3582db60ef1fc06b459fe67a (patch)
treeebc9984a9d7446184131c3042281c683966f250d /doc
parent8d58eafa341b5a65bed1a267bc34653e46bbc6e8 (diff)
Rename self-comparison to self-search
Diffstat (limited to 'doc')
-rw-r--r--doc/README.md2
-rw-r--r--doc/indices.md2
-rw-r--r--doc/leading.md2
-rw-r--r--doc/match.md2
-rw-r--r--doc/selfcmp.md14
5 files changed, 11 insertions, 11 deletions
diff --git a/doc/README.md b/doc/README.md
index e3736ac2..fc8e7000 100644
--- a/doc/README.md
+++ b/doc/README.md
@@ -51,7 +51,7 @@ Primitives:
- [Scan](scan.md) (`` ` ``)
- [Search functions](search.md) (`⊐⊒∊`)
- [Select](select.md) (`⊏`)
-- [Self-comparison functions](selfcmp.md) (`⊐⊒∊⍷`)
+- [Self-search functions](selfcmp.md) (`⊐⊒∊⍷`)
- [Shift functions](shift.md) (`»«`)
- [Solo, Couple, and Merge](couple.md) (`≍>`)
- [Transpose](transpose.md) (`⍉`)
diff --git a/doc/indices.md b/doc/indices.md
index 62122175..30a0157a 100644
--- a/doc/indices.md
+++ b/doc/indices.md
@@ -34,7 +34,7 @@ Unlike `/` and `⊔`, `↕` and `⊑` do use list element indices. For `↕` thi
One of the successes of the [leading axis model](https://aplwiki.com/wiki/Leading_axis_theory) is to introduce a kind of index for multidimensional arrays that is easier to work with than list indices. The model introduces [cells](https://aplwiki.com/wiki/Cell), where a cell index is a list of any length up to the containing array's rank. General cell indices are discussed in the next section; first we introduce a special case, indices into major cells or ¯1-cells. These cells naturally form a list, so the index of a major cell is a single number. Such an index can also be considered to select along the first axis, since an index along any axis is a single number.
-[Ordering](order.md) functions `⍋⍒` and [search](search.md)/[self-comparison](selfcmp.md) functions `⊐⊒` that depend on cell ordering only really make sense with major cell indices: while other indices have an ordering, it's not very natural. Note that `⊐` only uses the ordering in an incidental way, because it's defined to return the *first* index where a cell in `𝕩` is found. A mathematician would be more interested in a "pre-image" function that returns the set of all indices where a particular value appears. However, programming usefulness and consistency with the other search functions makes searching for the first index a reasonable choice.
+[Ordering](order.md) functions `⍋⍒` and [search](search.md)/[self-search](selfcmp.md) functions `⊐⊒` that depend on cell ordering only really make sense with major cell indices: while other indices have an ordering, it's not very natural. Note that `⊐` only uses the ordering in an incidental way, because it's defined to return the *first* index where a cell in `𝕩` is found. A mathematician would be more interested in a "pre-image" function that returns the set of all indices where a particular value appears. However, programming usefulness and consistency with the other search functions makes searching for the first index a reasonable choice.
Only one other function—but an important one!—deals with cells rather than elements: [Select](select.md) (`⊏`). Select [allows](leading.md#multiple-axes) either a simple first-axis case where `𝕨` has depth 1 or less (a depth-0 argument is automatically enclosed), and a multi-axis case where it is a list of depth-1 elements. In each case the depth-1 arrays index along a single axis.
diff --git a/doc/leading.md b/doc/leading.md
index 2f75ee3d..b2f1f1b5 100644
--- a/doc/leading.md
+++ b/doc/leading.md
@@ -37,7 +37,7 @@ In these three cases above, the results are the same as you would get from [tran
### Comparing cells
-The functions in the last section manipulate cells in the same way regardless of what data they contain. Other functions compare cells to each other, either testing whether they match or how they are ordered relative to one another. The two [Grade](order.md) functions `⍋⍒`, and the [self-comparison](selfcmp.md) functions Classify (`⊐`), Mark Firsts (`∊`), and Occurrence Count (`⊒`), each give a list result, with one number for each cell. We can see below that Occurrence Count returns the same results even as we make the argument cells more complicated, because the changes made preserve the matching of cells.
+The functions in the last section manipulate cells in the same way regardless of what data they contain. Other functions compare cells to each other, either testing whether they match or how they are ordered relative to one another. The two [Grade](order.md) functions `⍋⍒`, and the [self-search](selfcmp.md) functions Classify (`⊐`), Mark Firsts (`∊`), and Occurrence Count (`⊒`), each give a list result, with one number for each cell. We can see below that Occurrence Count returns the same results even as we make the argument cells more complicated, because the changes made preserve the matching of cells.
s ← "abracadabra"
⊒ s
diff --git a/doc/match.md b/doc/match.md
index fdd2e6cc..5912b292 100644
--- a/doc/match.md
+++ b/doc/match.md
@@ -7,7 +7,7 @@ The primitive Match (`≡`) tests whether its two argument arrays are considered
"abc" ≡ 'a'‿'b'‿'c'
4 ≢ <4
-Match always gives the same result as [Equals](arithmetic.md#comparisons) (`=`) when both arguments are atoms, but the two functions are extended to arrays differently: while the pervasive Equals maps over array arguments to return an array of results, Match compares them in totality and always returns one boolean (it never gives an error). Match is the basis for BQN's [search](search.md) and [self-comparison](selfcmp.md) functions.
+Match always gives the same result as [Equals](arithmetic.md#comparisons) (`=`) when both arguments are atoms, but the two functions are extended to arrays differently: while the pervasive Equals maps over array arguments to return an array of results, Match compares them in totality and always returns one boolean (it never gives an error). Match is the basis for BQN's [search](search.md) and [self-search](selfcmp.md) functions.
"abc" = "acc"
"abc" ≡ "acc"
diff --git a/doc/selfcmp.md b/doc/selfcmp.md
index fdb43090..e4f1616c 100644
--- a/doc/selfcmp.md
+++ b/doc/selfcmp.md
@@ -1,6 +1,6 @@
*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/doc/selfcmp.html).*
-# Self-comparison functions
+# Self-search functions
<!--GEN
d ← 48‿22
@@ -39,20 +39,20 @@ defs ← "defs" Enc ("mask"At"id=m") Enc ⟨
-->
-BQN has four self-comparison functions, Classify (`⊐`), Occurrence Count (`⊒`), Mark Firsts (`∊`), and Deduplicate (`⍷`). Each of these is a monadic function that obtains its result by comparing each major cell of the argument (which must have rank at least 1) to the earlier major cells with [match](match.md). For example, Mark Firsts indicates the cells that don't match any earlier cell, making them the first of their kind.
+BQN has four self-search functions, Classify (`⊐`), Occurrence Count (`⊒`), Mark Firsts (`∊`), and Deduplicate (`⍷`). Each of these is a monadic function that obtains its result by comparing each major cell of the argument (which must have rank at least 1) to the earlier major cells with [match](match.md). For example, Mark Firsts indicates the cells that don't match any earlier cell, making them the first of their kind.
∊ "abaacb"
-When the argument is a list, its major cells are units and thus contain one element each, so it's just as valid to say that a self-comparison function compares elements of its argument. Only with a higher-rank argument does the major cell nature become apparent.
+When the argument is a list, its major cells are units and thus contain one element each, so it's just as valid to say that a self-search function compares elements of its argument. Only with a higher-rank argument does the major cell nature become apparent.
⊢ arr ← >"abc"‿"dcb"‿"abc"‿"bcd"‿"dcb"
∊ arr
-The result has one number for each major cell, or in other words is a list with the same length as its argument. Three self-comparison functions follow this pattern, but Deduplicate (`⍷`) is different: it returns an array of the same rank but possibly a shorter length than the argument.
+The result has one number for each major cell, or in other words is a list with the same length as its argument. Three self-search functions follow this pattern, but Deduplicate (`⍷`) is different: it returns an array of the same rank but possibly a shorter length than the argument.
## Classify
-Classify is the universal self-comparison function, in that it preserves all the self-comparison information in its argument. It gives each different cell value a natural number, ordered by first appearance.
+Classify is the universal self-search function, in that it preserves all the self-search information in its argument. It gives each different cell value a natural number, ordered by first appearance.
⊐ 5‿6‿2‿2‿5‿1
@@ -60,7 +60,7 @@ Classify is the universal self-comparison function, in that it preserves all the
≍⟜⊐ 5‿6‿2‿2‿5‿1
-Applying Classify before another self-comparison function will never change the result, except in the case of Deduplicate (`⍷`), which constructs its result from cells in the argument. In particular, Classify is [idempotent](https://en.wikipedia.org/wiki/Idempotent), meaning that applying it twice is the same as applying it once.
+Applying Classify before another self-search function will never change the result, except in the case of Deduplicate (`⍷`), which constructs its result from cells in the argument. In particular, Classify is [idempotent](https://en.wikipedia.org/wiki/Idempotent), meaning that applying it twice is the same as applying it once.
∊ "dbaedcbcecbcd"
∊ ⊐ "dbaedcbcecbcd"
@@ -89,7 +89,7 @@ Applying both Classify and Deduplicate gives an array that has both properties (
*See the [APL Wiki page](https://aplwiki.com/wiki/Unique_Mask) on this function as well.*
-Mark Firsts (`∊`) is the simplest self-comparison function: it returns `0` for any major cell of the argument that is a duplicate of an earlier cell and `1` for a major cell that's the first with its value. To implement [Deduplicate](#deduplicate) in terms of Mark Firsts, just filter out the duplicates with `∊⊸/`.
+Mark Firsts (`∊`) is the simplest self-search function: it returns `0` for any major cell of the argument that is a duplicate of an earlier cell and `1` for a major cell that's the first with its value. To implement [Deduplicate](#deduplicate) in terms of Mark Firsts, just filter out the duplicates with `∊⊸/`.
∊ 3‿1‿4‿1‿5‿9‿2‿6‿5