%DEF k _k ← {𝔽○•internal.Keep} %DEF tcc %USE k ⋄ _tcc ← { ! ∧´ (<𝕨 𝔽_k˘⎊'e' 𝕩) ≡¨ (𝕨 𝔽˘⎊'e'•internal.Variation⟜𝕩)¨ "i"•internal.ListVariations 𝕩} 1‿2 1⎉0 1 %% 1‿1 1 1⎉0 1‿2 %% 1‿1 ! 20‿1200≡≢⥊˘a←20‿30‿40⥊↕24 ⋄ ! 20‿30‿40 ≡ ≢a ! (2⊸-⎉1 ≡ {2-𝕩}⎉1) 10‿10⥊↕100 ! (-⟜2⎉1 ≡ {𝕩-2}⎉1) 10‿10⥊↕100 %USE k ⋄ n←1 ⋄ ≠{𝕊: (•Repr a) ! (≡⎉n ≡ ≡_k⎉n)´ a←(⊏⟜(3‿2‿2⥊'a'+↕26))¨ <˘ 2‿2‿2‿2•rand.Range 3}¨ ↕1000 %USE k ⋄ n←2 ⋄ ≠{𝕊: (•Repr a) ! (≡⎉n ≡ ≡_k⎉n)´ a←(⊏⟜(3‿2‿2⥊'a'+↕26))¨ <˘ 2‿2‿2‿2•rand.Range 3}¨ ↕1000 %USE k ⋄ n←3 ⋄ ≠{𝕊: (•Repr a) ! (≡⎉n ≡ ≡_k⎉n)´ a←(⊏⟜(3‿2‿2⥊'a'+↕26))¨ <˘ 2‿2‿2‿2•rand.Range 3}¨ ↕1000 ≠{𝕊k: ! (3⊸↑⎉k ≡ {3↑𝕩}⎉k) 2‿2‿2‿2⥊↕16}¨ ¯2+↕10 ≠{𝕊k: ! (1⊸↓⎉k ≡ {1↓𝕩}⎉k) 3‿3‿3‿3⥊↕81}¨ ¯2+↕10 !"˘: Result rank too large" % (0∾254⥊2)⊸⥊∘1˘ 0‿2⥊1 !"⎉: Result rank too large" % (0∾254⥊2)⊸⥊∘1⎉¯1 0‿2⥊1 !"⎉: Result rank too large" % (1⥊˜ 0∾204⥊2)⎉50 1⥊˜ 0∾100⥊2 !"⎉: Result rank too large (204 ≡ =𝕩, 200 ≡ =𝔽v)" % {𝕊:(200⥊1)⥊1}⎉1 (205⥊1)⥊1 !"⎉: Argument frames don't agree (⟨3⟩ ≡ ≢𝕨, ⟨2⟩ ≡ ≢𝕩, common frame of 1 axes)" % "abc" ⊢⎉0 "ab" !"˘: Argument frames don't agree (⟨3⟩ ≡ ≢𝕨, ⟨2⟩ ≡ ≢𝕩, common frame of 1 axes)" % "abc" ⊢˘ "ab" ! ∧´{𝕊: ! (∾≡{𝕨∾𝕩}´) (<•rand.Range∘≠⊸⊑ ⟨"ab",1‿2,⟨⟩,↕0,""⟩) ∾˜ (4•rand.Range≠)⊸⊏ ⟨1, {⇐}, 'a', <'a', <{⇐}, "ab", ↕0, ""⟩}¨↕10000 %USE tcc ⋄ ⟨2, 20, ¯2, ¯20, 0⟩ {𝕨 ↑_tcc 𝕩 ⋄ 𝕨 ↓_tcc 𝕩}⌜ ⟨<4, ↕5, 4‿5⥊↕20, 4‿5‿6⥊↕120⟩ %USE tcc ⋄ ⟨<, ≍, ⊏, ⥊⟩ {𝕎 _tcc 𝕩}⌜ ⟨<4, ↕5, 4‿5⥊↕20, 4‿5‿6⥊↕120, 2‿3‿4‿5⥊↕120⟩ %USE tcc ⋄ ⟨<, ≍, ⥊⟩ {𝕎 _tcc 𝕩}⌜ ⟨<4, ↕5, 4‿5⥊↕20, 4‿5‿6⥊↕120, 2‿3‿4‿5⥊↕120⟩ %USE tcc ⋄ ⟨⊏⟩ {𝕎 _tcc 𝕩}⌜ ⟨4‿5⥊↕20, 4‿5‿6⥊↕120, 2‿3‿4‿5⥊↕120⟩ %USE tcc ⋄ ⊏_tcc 4‿2⥊↕8 ⋄ 1⊏_tcc 4‿2⥊↕8 ⋄ ⊏_tcc ↕4‿2 ⋄ 1⊏_tcc ↕4‿2 %USE tcc ⋄ ⊑_tcc 4‿2⥊↕8 ⋄ 1⊑_tcc 4‿2⥊↕8 ⋄ ⊑_tcc ↕4‿2 ⋄ 1⊑_tcc ↕4‿2 ( # big ˝˘ & `˘ tester _basicArgs ← { Test _𝕣 ranks: {𝕊f: {{! f Test 0‿1⥊˜ 𝕩⊏0‿2‿4‿8‿32}¨ ↕𝕩⥊3 ⋄ 1}¨ ranks}¨ +‿∧‿∨‿=‿≠‿⊣‿⊢ } # TODO replace ○⊢ with some pureness-preserving •internal.Keep # w F _thing x tests F _thing⎉w x _testFoldCells ← {∨´𝕗=⊢‿⊣? 0=×´𝕨↓≢𝕩? 1; (𝔽˝⎉𝕨 ≡ 𝔽˝○⊢⎉𝕨) 𝕩} _testScanCells ← { (𝔽`⎉𝕨 ≡ 𝔽`○⊢⎉𝕨) 𝕩} {1 𝕨 _testFoldCells 𝕩} _basicArgs 2‿3‿4 {1 𝕨 _testScanCells 𝕩} _basicArgs 2‿3‿4 {2 𝕨 _testScanCells 𝕩} _basicArgs 3‿4 {2 𝕨 _testScanCells 𝕩} _basicArgs 3‿4 ⟨0, 0‿1, 1‿0, 1, 10, 10‿1, 1‿10, 100⟩ { 𝕨‿𝕩 ⥊¨↩ sh ← 𝕨∾𝕩 cr ← ≠𝕩 +‿∧‿∨‿=‿≠‿⊣‿⊢ { cr 𝕎 _testFoldCells 𝕩 cr 𝕎 _testScanCells 𝕩 }⌜ {0=×´sh? 𝕩; ∾⟨𝕩, ¬⌾⊑¨ 𝕩, ¬⌾(¯1⊑⥊)¨ 𝕩⟩} sh⊸⥊¨ 0‿1 }⌜ ⟨0, 1, 2, 8, 8‿1, 4‿8, 4‿2, 59, 60, 63, 80, 81, 200⟩ )