File size: 655 Bytes
a6a5d8e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# SPDX-License-Identifier: Apache-2.0
"""Tests for a11oy.formulas.reidemeister (knot moves). thesis_v22.pdf §2."""
from a11oy.formulas import reidemeister as r


def test_r2_poke_cancels():
    assert r.reduced_word([1, -1]) == ()


def test_r1_kink_cancels():
    assert r.reduced_word([2, 2]) == ()


def test_nested_reduction():
    assert r.reduced_word([3, 1, -1, -3]) == ()


def test_unknot_detection():
    out = r.is_unknot([1, -1, 2, 2])
    assert out["value"] is True


def test_distinct_words_not_certified():
    out = r.equivalent([1, 2, 3], [1, 2])
    assert out["equivalent"] is False
    assert out["citation"] == "thesis_v22.pdf §2"