@turing-machine-js/library-binary-numbers-bare 6.4.0 → 7.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/states.md +32 -24
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turing-machine-js/library-binary-numbers-bare",
3
- "version": "6.4.0",
3
+ "version": "7.0.0-alpha.2",
4
4
  "description": "Single-number binary arithmetic on a 3-symbol alphabet (blank, 0, 1) — same operations as @turing-machine-js/library-binary-numbers but without ^/$ markers. Side-by-side with the marker-based library for learning the trade-off.",
5
5
  "engines": {
6
6
  "npm": ">=7.0.0"
@@ -28,7 +28,7 @@
28
28
  "teaching"
29
29
  ],
30
30
  "peerDependencies": {
31
- "@turing-machine-js/machine": "^6.0.0"
31
+ "@turing-machine-js/machine": "^7.0.0-alpha.2"
32
32
  },
33
33
  "scripts": {
34
34
  "build": "tsc --build --verbose tsconfig.build.json && node ../../scripts/build-node-entries.mjs --package=@turing-machine-js/library-binary-numbers-bare",
@@ -45,5 +45,5 @@
45
45
  "default": "./dist/index.mjs"
46
46
  }
47
47
  },
48
- "gitHead": "a8228b8a5f7f9acd1f6219af80db86368848cdbc"
48
+ "gitHead": "163c0f818365241bac2c2de5e489124056703d8b"
49
49
  }
package/states.md CHANGED
@@ -2,62 +2,70 @@
2
2
 
3
3
  ## plusOne
4
4
 
5
- *3 states (including `haltState`)*
5
+ *3 states; 5 transitions; has cycles*
6
6
 
7
7
  ```mermaid
8
8
  flowchart TD
9
9
  %% alphabets: [[" ","0","1"]]
10
10
  s0(((halt)))
11
11
  s1["plusOneCarry"]
12
- s2(("plusOne"))
13
- s1 -- "1 → 0/L" --> s1
14
- s1 -- "0 1/S" --> s0
15
- s1 -- "-1/S" --> s0
16
- s2 -- "0|1·/R" --> s2
17
- s2 -- "-·/L" --> s1
12
+ s2["plusOne"]
13
+ idle([idle])
14
+ idle -. enter .-> s2
15
+ s1 -- "['1']['0']/[L]" --> s1
16
+ s1 -- "['0']['1']/[S]" --> s0
17
+ s1 -- "[B]['1']/[S]" --> s0
18
+ s2 -- "['0']|['1'] → [K]/[R]" --> s2
19
+ s2 -- "[B] → [K]/[L]" --> s1
18
20
  ```
19
21
 
20
22
  ## minusOne
21
23
 
22
- *3 states (including `haltState`)*
24
+ *3 states; 5 transitions; has cycles*
23
25
 
24
26
  ```mermaid
25
27
  flowchart TD
26
28
  %% alphabets: [[" ","0","1"]]
27
29
  s0(((halt)))
28
30
  s3["minusOneBorrow"]
29
- s4(("minusOne"))
30
- s3 -- "0 → 1/L" --> s3
31
- s3 -- "1 0/S" --> s0
32
- s3 -- "-·/S" --> s0
33
- s4 -- "0|1 → ·/R" --> s4
34
- s4 -- "-·/L" --> s3
31
+ s4["minusOne"]
32
+ idle([idle])
33
+ idle -. enter .-> s4
34
+ s3 -- "['0']['1']/[L]" --> s3
35
+ s3 -- "['1']['0']/[S]" --> s0
36
+ s3 -- "[B][K]/[S]" --> s0
37
+ s4 -- "['0']|['1'] → [K]/[R]" --> s4
38
+ s4 -- "[B] → [K]/[L]" --> s3
35
39
  ```
36
40
 
37
41
  ## invertNumber
38
42
 
39
- *2 states (including `haltState`)*
43
+ *2 states; 3 transitions; has cycles*
40
44
 
41
45
  ```mermaid
42
46
  flowchart TD
43
47
  %% alphabets: [[" ","0","1"]]
44
48
  s0(((halt)))
45
- s5(("invertNumber"))
46
- s5 -- "0 → 1/R" --> s5
47
- s5 -- "1 0/R" --> s5
48
- s5 -- "-·/S" --> s0
49
+ s5["invertNumber"]
50
+ idle([idle])
51
+ idle -. enter .-> s5
52
+ s5 -- "['0']['1']/[R]" --> s5
53
+ s5 -- "['1'] → ['0']/[R]" --> s5
54
+ s5 -- "[B] → [K]/[S]" --> s0
49
55
  ```
50
56
 
51
57
  ## normalizeNumber
52
58
 
53
- *2 states (including `haltState`)*
59
+ *2 states; 3 transitions; has cycles*
54
60
 
55
61
  ```mermaid
56
62
  flowchart TD
57
63
  %% alphabets: [[" ","0","1"]]
58
64
  s0(((halt)))
59
- s6(("normalizeNumber"))
60
- s6 -- "0 → ⌫/R" --> s6
61
- s6 -- "1 ·/S" --> s0
62
- s6 -- "-0/S" --> s0
65
+ s6["normalizeNumber"]
66
+ idle([idle])
67
+ idle -. enter .-> s6
68
+ s6 -- "['0'][E]/[R]" --> s6
69
+ s6 -- "['1'] → [K]/[S]" --> s0
70
+ s6 -- "[B] → ['0']/[S]" --> s0
63
71
  ```