Slice-Subtraction Algorithm Overview
- Slice-Subtraction Algorithm is a family of methods that exploits ordered locality to efficiently propagate winning (N) and losing (P) positions in subtraction games.
- It encompasses techniques like the PTFN forward marking, divide-and-conquer interval slicing with Boolean convolution, and coloring automata in higher-dimensional settings.
- The approach extends beyond combinatorial game theory to applications in big-integer arithmetic and proteomic baseline subtraction by partitioning data into manageable slices.
“Slice-Subtraction Algorithm” is not a standard algorithmic name in the arXiv literature. In the literature on subtraction games, the phrase most closely matches algorithms that process positions in ordered slices or intervals, especially the PTFN algorithm—short for “-position To Find -position”—for one-pile subtraction games (He et al., 2012), and a later divide-and-conquer interval method that propagates hot/cold information between contiguous heap-size slices by Boolean convolution (Eppstein, 2018). In higher-dimensional vector subtraction games, the same interpretive label also fits segment-based methods that propagate -positions through semi-infinite slices by translation rules or a coloring automaton (Larsson et al., 2023). Outside combinatorial game theory, similar wording can also describe blockwise big-integer subtraction and sliding-window baseline subtraction, but those are distinct algorithmic traditions rather than a single unified method (Bassil et al., 2012).
1. Terminology, formal setting, and scope
In its most developed mathematical use, a slice-subtraction algorithm operates on a subtraction game. For the standard one-pile normal-play case, the data consist of a finite subtraction set
a position given by a pile size , and legal moves for with . The terminal position is $0$, and the last player to move wins (He et al., 2012). The standard recursive dichotomy is:
0
1
The later fast-evaluation literature uses equivalent hot/cold terminology. For a single heap,
2
with 3 cold in the ordinary subtraction game. For multi-heap subtraction games, the relevant invariant is the nim-value
4
and cold positions are exactly those with nim-value 5 (Eppstein, 2018).
In higher dimensions, a position becomes a vector
6
with finite subtraction set
7
and legal moves 8 whenever 9 componentwise (Larsson et al., 2023). In that setting, “slice” usually refers not to a literal one-dimensional heap interval, but to rows, columns, wedge-shaped regions, or semi-infinite outcome segments.
A persistent source of confusion is that “Slice-Subtraction Algorithm” is an interpretive label rather than the title used by the cited papers. The principal named algorithms are PTFN in the 2012 one-pile paper (He et al., 2012), a divide-and-conquer Boolean convolution method for interval slices (Eppstein, 2018), and a coloring automaton for segmented higher-dimensional boards (Larsson et al., 2023).
2. PTFN as a forward slice algorithm for one-pile subtraction games
The 2012 paper “A New Algorithm for the Subtraction Games” introduces the PTFN algorithm, whose defining idea is to start from known losing positions and mark all positions reachable from them in one move as winning positions (He et al., 2012). Operationally, with an array 0, the intended interpretation is:
- 1: treated as a 2-position unless later marked otherwise,
- 3: an 4-position.
The procedure is:
- initialize 5 to 6;
- regard 7 as terminal and therefore a 8-position;
- scan 9;
- whenever 0, treat 1 as a 2-position and, for each 3 with 4, set
5
In cleaned form, the paper’s pseudocode is 49 This is a forward procedure: known 6-positions generate nearby 7-positions, and anything left unmarked when reached becomes the next 8-position. That is why the paper calls it PTFN: use 9-positions to find 0-positions (He et al., 2012).
The algorithm is naturally “slice-like” because it scans positions in increasing order and repeatedly applies the same local propagation rule on the integer line of heap sizes. The paper does not define formal slices, but the forward neighborhood of a newly discovered 1-position 2,
3
functions exactly as a local slice of newly classified 4-positions.
The paper’s worked example uses
5
up to heap size 6. Under PTFN, the 7-positions are
8
and the remaining positions up to 9 are 0-positions (He et al., 2012). The paper’s comparison with Sprague–Grundy theory is also explicit: if 1, then 2 is a 3-position; if 4, then 5 is an 6-position. PTFN avoids computing mex values and computes only the 7 classification.
This restriction is also its main limitation. The paper states that for sums of subtraction games, “Sprague-Grundy theory is better than PTFN algorithm, but for one pile subtraction games, PTFN has certain advantages” (He et al., 2012). A plausible implication is that PTFN is best viewed as a direct outcome-classification method rather than a full replacement for nim-value computation.
3. Divide-and-conquer interval slicing and Boolean convolution
The 2018 paper “Faster Evaluation of Subtraction Games” develops a more literal slice-based algorithm: it recursively decomposes the heap-size range into contiguous intervals and propagates hot/winning information from one interval into the next using Boolean convolution (Eppstein, 2018). In that setting, “slice” means an interval such as 8 or 9, and the computational gain comes from batching many predecessor checks.
The paper first introduces subtraction games with hotspots. Besides the subtraction set 0, one specifies a set 1 of heap sizes called hotspots; if a move leaves a heap in 2, the mover immediately loses. Then
3
If some set 4 of positions is already known to be cold, then every position that can move to 5 is hot. That set is
6
which the paper writes as
7
Representing 8 and 9 as bitvectors turns this into a Boolean convolution, computable in
0
time by FFT-based numerical convolution followed by thresholding (Eppstein, 2018).
The divide-and-conquer algorithm for hot/cold status on an interval 1 is:
- recurse on the lower half 2, where 3;
- compute the set 4 of upper-half positions made hot by lower-half cold positions, using Boolean convolution;
- recurse on the upper half 5 with hotspot set enlarged by 6.
The runtime satisfies
7
hence
8
The paper states this as:
We can determine which positions are hot and which are cold, in a range of 9 positions of a subtraction game with hotspots, in time $0$0 (Eppstein, 2018).
The same framework yields nim-values by repeated hotspot solves. If
$0$1
then the positions with nim-value $0$2 are exactly the cold positions of the hotspot game with hotspot set $0$3. If the maximum nim-value among $0$4 is $0$5, the total cost is
$0$6
and the paper emphasizes that
$0$7
This algorithm is significantly closer to a canonical “slice-subtraction algorithm” than PTFN, because it explicitly partitions the heap-size range into interval slices and uses a batched propagation step between them. The paper also discusses a simpler sieve-like cold-position algorithm:
- initialize a Boolean array of hot marks to false;
- for $0$8 to $0$9, if 0 is unmarked, output 1 as cold and mark 2 hot for every 3.
That sieve runs in
4
where 5 is the set of cold positions up to 6, and for subtract-a-square it was faster than convolution in the tested range (Eppstein, 2018). This shows that “slice-subtraction” in subtraction games spans both asymptotically fast interval methods and simpler forward sieves.
4. Segments, slices, and coloring automata in higher-dimensional subtraction games
The 2023 paper “Subtraction games in more than one dimension” generalizes the slice viewpoint from one-dimensional heap intervals to geometric regions in 7 and higher (Larsson et al., 2023). For a two-move ruleset 8, the paper proves the 9-to-00 principle
01
In vector form, for 02,
03
This gives a complete reduction mechanism: repeatedly subtract 04 until reaching a smallest representative, then decide that representative locally.
In two dimensions, the paper makes the geometric structure explicit. For one-move games 05, the 06-positions are repeated 07-shapes
08
and
09
For two-move rulesets 10, the paper defines a slope
11
and partitions the board into regions 12, 13, 14, and mirrored counterparts; all further 15-positions are then generated by translations
16
For three or more moves, a single translation vector is usually insufficient. The paper therefore introduces a coloring automaton on a segment
17
A legal coloring scheme 18 consists of an initial colored set 19, a finite color set 20, and a finite update set 21. Each update rule takes a colored position 22 and outputs
23
When the colored positions are exactly the 24-positions of the ruleset inside 25, the segment is an outcome segment.
This framework yields explicit segmented solutions for some three-move rulesets. The paper proves a perfect outcome segmentation into three segments for
26
and gives a segmentwise construction for symmetric additive rulesets
27
with update vectors
28
The paper also proves that every finite two-dimensional subtraction ruleset has row/column eventually periodic outcomes, via a finite-window argument on
29
where 30 for 31 (Larsson et al., 2023).
The paper’s computational visualizations go further and report a five-move ruleset with an outcome segmentation into six semi-infinite slices. That observation is empirical rather than a general theorem, but it places the term “slice-subtraction algorithm” on firm geometric ground: in higher dimensions, the slice is a region of the game board with a finite propagation law, not merely an interval of heap sizes.
5. Periodicity, empirical rules, and the PTFN-based period literature
The paper “The Period of the subtraction games” uses PTFN to study periodic behavior in finite subtraction games and argues that it is “more suitable than Sprague-Grundy Theory” for that task (Qin et al., 2012). Its role in the history of slice-subtraction methods is methodological: PTFN is used to generate binary outcome sequences and to observe repeating blocks.
The paper presents four families of period formulas, including
32
for 33-games, and
34
for a family of rulesets of the form
35
with 36 or 37 (Qin et al., 2012). The practical procedure is to compute the 38 sequence of 39-positions until a repeated block appears, then read off the period.
However, the paper also illustrates an important caution. Its theorem statements for 40 and 41 conflict with their own tables, and the text itself later describes Theorems 1–3 as “assumptions” (Qin et al., 2012). This makes the article better read as a computational note on pattern discovery than as a complete proved theory. It remains relevant because it demonstrates a distinctive use of PTFN: not merely solving a bounded subtraction game, but using forward marking to expose eventually periodic structure.
A common misconception is that these period papers replace Sprague–Grundy theory. They do not. They replace full mex-valued computation by binary 42 propagation when the object of study is the period of the win/loss pattern rather than the full nim-sequence. That distinction is central to understanding both the strengths and the limits of slice-based subtraction-game algorithms.
6. Broader uses of the phrase and domain-specific ambiguity
Outside subtraction games, the expression can describe unrelated “slice” or “block” subtraction procedures. The paper “Sequential & Parallel Algorithms for Big-Integer Numbers Subtraction” proposes a blockwise decimal subtraction method in which large operands are partitioned into tokens of at most 18 decimal digits, corresponding to about 60 bits, and subtraction is performed tokenwise with borrow propagation (Bassil et al., 2012). In that setting, the slice is a fixed-size decimal token, the radix is
43
and the method has both sequential and parallel variants. This is a slice-based subtraction algorithm in arithmetic, but not in combinatorial game theory.
The paper “Informed baseline subtraction of proteomic mass spectrometry data aided by a novel sliding window algorithm” uses a different local-slice idea. Its baseline estimate is a morphological opening
44
and the baseline-subtracted signal is the top-hat
45
Its novelty is a continuous line segment algorithm (CLSA) for rolling minima and maxima on an irregularly spaced transformed axis (Stanford et al., 2016). Here the slice is a sliding window
46
not a game-state interval or arithmetic token.
These uses matter because they show that “Slice-Subtraction Algorithm” is best understood as a nonstandard umbrella label. In subtraction games, it denotes forward or interval-based propagation schemes such as PTFN, Boolean-convolution interval decomposition, or segment-coloring automata (He et al., 2012). In big-integer arithmetic, it denotes tokenwise borrow-resolving subtraction (Bassil et al., 2012). In signal processing, it denotes sliding-window baseline estimation (Stanford et al., 2016). A plausible implication is that the phrase has descriptive value, but only when its domain is specified.
Taken in the most coherent technical sense, the slice-subtraction algorithm is therefore a family of methods that exploit ordered locality—positions, intervals, tokens, or geometric segments—to replace naïve pointwise subtraction-state evaluation by structured propagation. In subtraction games, that family begins with forward 47-to-48 marking, becomes explicitly interval-recursive with Boolean convolution, and extends to geometric segmentation and coloring in higher dimensions (Eppstein, 2018).