4 "cell_type": "markdown",
7 "# Traversing Datastructures with Zippers\n",
8 "This notebook is about using the \"zipper\" with joy datastructures. See the [Zipper wikipedia entry](https://en.wikipedia.org/wiki/Zipper_%28data_structure%29) or the original paper: [\"FUNCTIONAL PEARL The Zipper\" by Gérard Huet](https://www.st.cs.uni-saarland.de/edu/seminare/2005/advanced-fp/docs/huet-zipper.pdf)\n",
11 "Given a datastructure on the stack we can navigate through it, modify it, and rebuild it using the \"zipper\" technique."
15 "cell_type": "markdown",
19 "In Joypy there aren't any complex datastructures, just ints, floats, strings, Symbols (strings that are names of functions) and sequences (aka lists, aka quoted literals, aka aggregates, etc...), but we can build [trees](https://en.wikipedia.org/wiki/Tree_%28data_structure%29) out of sequences."
29 "output_type": "stream",
31 "[1 [2 [3 4 25 6] 7] 8]"
36 "[1 [2 [3 4 25 6] 7] 8]"
40 "cell_type": "markdown",
44 "Zippers work by keeping track of the current item, the already-seen items, and the yet-to-be seen items as you traverse a datastructure (the datastructure used to keep track of these items is the zipper.)\n",
46 "In Joy we can do this with the following words:\n",
48 " z-down == [] swap uncons swap\n",
49 " z-up == swons swap shunt\n",
50 " z-right == [swons] cons dip uncons swap\n",
51 " z-left == swons [uncons swap] dip swap\n",
53 "Let's use them to change 25 into 625. The first time a word is used I show the trace so you can see how it works. If we were going to use these a lot it would make sense to write Python versions for efficiency, but see below."
63 "output_type": "stream",
65 "[1 [2 [3 4 25 6] 7] 8]"
70 "[z-down [] swap uncons swap] inscribe\n",
71 "[z-up swons swap shunt] inscribe\n",
72 "[z-right [swons] cons dip uncons swap] inscribe\n",
73 "[z-left swons [uncons swap] dip swap] inscribe"
83 "output_type": "stream",
85 " [1 [2 [3 4 25 6] 7] 8] • z-down\n",
86 " [1 [2 [3 4 25 6] 7] 8] • [] swap uncons swap\n",
87 "[1 [2 [3 4 25 6] 7] 8] [] • swap uncons swap\n",
88 "[] [1 [2 [3 4 25 6] 7] 8] • uncons swap\n",
89 "[] 1 [[2 [3 4 25 6] 7] 8] • swap\n",
90 "[] [[2 [3 4 25 6] 7] 8] 1 • \n",
92 "[] [[2 [3 4 25 6] 7] 8] 1"
102 "execution_count": 4,
107 "output_type": "stream",
109 " [] [[2 [3 4 25 6] 7] 8] 1 • z-right\n",
110 " [] [[2 [3 4 25 6] 7] 8] 1 • [swons] cons dip uncons swap\n",
111 "[] [[2 [3 4 25 6] 7] 8] 1 [swons] • cons dip uncons swap\n",
112 "[] [[2 [3 4 25 6] 7] 8] [1 swons] • dip uncons swap\n",
113 " [] • 1 swons [[2 [3 4 25 6] 7] 8] uncons swap\n",
114 " [] 1 • swons [[2 [3 4 25 6] 7] 8] uncons swap\n",
115 " [1] • [[2 [3 4 25 6] 7] 8] uncons swap\n",
116 " [1] [[2 [3 4 25 6] 7] 8] • uncons swap\n",
117 " [1] [2 [3 4 25 6] 7] [8] • swap\n",
118 " [1] [8] [2 [3 4 25 6] 7] • \n",
120 "[1] [8] [2 [3 4 25 6] 7]"
130 "execution_count": 5,
135 "output_type": "stream",
137 "[1] [8] [] [[3 4 25 6] 7] 2"
147 "execution_count": 6,
152 "output_type": "stream",
154 "[1] [8] [2] [7] [3 4 25 6]"
164 "execution_count": 7,
169 "output_type": "stream",
171 "[1] [8] [2] [7] [] [4 25 6] 3"
181 "execution_count": 8,
186 "output_type": "stream",
188 "[1] [8] [2] [7] [3] [25 6] 4"
198 "execution_count": 9,
203 "output_type": "stream",
205 "[1] [8] [2] [7] [4 3] [6] 25"
215 "execution_count": 10,
220 "output_type": "stream",
222 "[1] [8] [2] [7] [4 3] [6] 625"
232 "execution_count": 11,
237 "output_type": "stream",
239 "[1] [8] [2] [7] [4 3] [6] 625 • z-up\n",
240 "[1] [8] [2] [7] [4 3] [6] 625 • swons swap shunt\n",
241 "[1] [8] [2] [7] [4 3] [625 6] • swap shunt\n",
242 "[1] [8] [2] [7] [625 6] [4 3] • shunt\n",
243 " [1] [8] [2] [7] [3 4 625 6] • \n",
245 "[1] [8] [2] [7] [3 4 625 6]"
255 "execution_count": 12,
260 "output_type": "stream",
262 "[1] [8] [2 [3 4 625 6] 7]"
272 "execution_count": 13,
277 "output_type": "stream",
279 "[1 [2 [3 4 625 6] 7] 8]"
288 "cell_type": "markdown",
291 "## `dip` and `infra`\n",
292 "In Joy we have the `dip` and `infra` combinators which can \"target\" or \"address\" any particular item in a Joy tree structure."
297 "execution_count": 14,
302 "output_type": "stream",
304 "[1 [2 [3 4 625 6] 7] 8] [[[[[[sqr] dipd] infra] dip] infra] dip] • infra\n",
305 " 8 [2 [3 4 625 6] 7] 1 • [[[[[sqr] dipd] infra] dip] infra] dip [] swaack\n",
306 " 8 [2 [3 4 625 6] 7] 1 [[[[[sqr] dipd] infra] dip] infra] • dip [] swaack\n",
307 " 8 [2 [3 4 625 6] 7] • [[[[sqr] dipd] infra] dip] infra 1 [] swaack\n",
308 " 8 [2 [3 4 625 6] 7] [[[[sqr] dipd] infra] dip] • infra 1 [] swaack\n",
309 " 7 [3 4 625 6] 2 • [[[sqr] dipd] infra] dip [8] swaack 1 [] swaack\n",
310 " 7 [3 4 625 6] 2 [[[sqr] dipd] infra] • dip [8] swaack 1 [] swaack\n",
311 " 7 [3 4 625 6] • [[sqr] dipd] infra 2 [8] swaack 1 [] swaack\n",
312 " 7 [3 4 625 6] [[sqr] dipd] • infra 2 [8] swaack 1 [] swaack\n",
313 " 6 625 4 3 • [sqr] dipd [7] swaack 2 [8] swaack 1 [] swaack\n",
314 " 6 625 4 3 [sqr] • dipd [7] swaack 2 [8] swaack 1 [] swaack\n",
315 " 6 625 • sqr 4 3 [7] swaack 2 [8] swaack 1 [] swaack\n",
316 " 6 625 • dup * 4 3 [7] swaack 2 [8] swaack 1 [] swaack\n",
317 " 6 625 625 • * 4 3 [7] swaack 2 [8] swaack 1 [] swaack\n",
318 " 6 390625 • 4 3 [7] swaack 2 [8] swaack 1 [] swaack\n",
319 " 6 390625 4 • 3 [7] swaack 2 [8] swaack 1 [] swaack\n",
320 " 6 390625 4 3 • [7] swaack 2 [8] swaack 1 [] swaack\n",
321 " 6 390625 4 3 [7] • swaack 2 [8] swaack 1 [] swaack\n",
322 " 7 [3 4 390625 6] • 2 [8] swaack 1 [] swaack\n",
323 " 7 [3 4 390625 6] 2 • [8] swaack 1 [] swaack\n",
324 " 7 [3 4 390625 6] 2 [8] • swaack 1 [] swaack\n",
325 " 8 [2 [3 4 390625 6] 7] • 1 [] swaack\n",
326 " 8 [2 [3 4 390625 6] 7] 1 • [] swaack\n",
327 " 8 [2 [3 4 390625 6] 7] 1 [] • swaack\n",
328 " [1 [2 [3 4 390625 6] 7] 8] • \n",
330 "[1 [2 [3 4 390625 6] 7] 8]"
335 "[[[[[[sqr] dipd] infra] dip] infra] dip] [infra] trace"
339 "cell_type": "markdown",
342 "If you read the trace carefully you'll see that about half of it is the `dip` and `infra` combinators de-quoting programs and \"digging\" into the subject datastructure. Instead of maintaining temporary results on the stack they are pushed into the pending expression (continuation). When `sqr` has run the rest of the pending expression rebuilds the datastructure.\n",
345 "Imagine a function `Z` that accepts a sequence of `dip` and `infra` combinators, a quoted program `[Q]`, and a datastructure to work on. It would effectively execute the quoted program as if it had been embedded in a nested series of quoted programs, e.g.:\n",
347 " [...] [Q] [dip dip infra dip infra dip infra] Z\n",
348 " -------------------------------------------------------------\n",
349 " [...] [[[[[[[Q] dip] dip] infra] dip] infra] dip] infra\n",
351 "The `Z` function isn't hard to make."
356 "execution_count": 4,
361 "output_type": "stream",
371 "execution_count": 2,
376 "output_type": "stream",
378 "[Q] [dip dip infra dip infra dip infra]"
383 "[Q] [dip dip infra dip infra dip infra]"
388 "execution_count": null,
396 "cell_type": "markdown",
399 "So that's broken with the current definition of `step` but this works:"
404 "execution_count": 6,
409 "output_type": "stream",
419 "execution_count": 7,
424 "output_type": "stream",
426 "[Q] [[dip] [dip] [infra] [dip] [infra] [dip] [infra]]"
431 "[Q] [[dip] [dip] [infra] [dip] [infra] [dip] [infra]]"
436 "execution_count": 8,
441 "output_type": "stream",
443 "[[[[[[[[Q] dip] dip] infra] dip] infra] dip] infra]"
452 "cell_type": "markdown",
455 "Do I want to revisit `step` def? Insist that `Z` use `[[A][B][C]...]` rather than `[A B C ...]`? Seems clunky, special-cased, and not in the spirit of the thing, eh?\n",
459 " [dip dip infra dip infra dip infra] [unit cons] step\n",
461 "*should* work, yes?\n",
464 " ... [] [Q] . step\n",
465 " -----------------------\n",
469 " ... [a] [Q] . step\n",
470 " ------------------------\n",
474 " ... [a b c] [Q] . step\n",
475 " ----------------------------------------\n",
476 " ... a . Q [b c] [Q] step\n",
482 "execution_count": 9,
487 "output_type": "stream",
497 "execution_count": 10,
502 "output_type": "stream",
504 "[dip dip infra dip infra dip infra]"
509 "[dip dip infra dip infra dip infra]"
514 "execution_count": 11,
519 "output_type": "stream",
521 "[[dip] dip infra dip infra dip infra]"
531 "execution_count": null,
538 "execution_count": null,
544 "cell_type": "markdown",
547 "Argh! It is inside `uncons` itself, isn't it!?"
552 "execution_count": 1,
557 "output_type": "stream",
567 "execution_count": 2,
572 "output_type": "stream",
574 "[Q] [dip dip infra dip infra dip infra]"
579 "[Q] [dip dip infra dip infra dip infra]"
584 "execution_count": null,
593 "execution_count": null,
600 "execution_count": 4,
605 "output_type": "stream",
607 "[Q] [dip dip infra dip infra dip infra]"
612 "[popdd roll< pop] inscribe"
617 "execution_count": 5,
622 "output_type": "stream",
632 "execution_count": 6,
637 "output_type": "stream",
639 "[Q] [dip dip infra dip infra dip infra]"
644 "[Q] [dip dip infra dip infra dip infra]"
649 "execution_count": 7,
654 "output_type": "stream",
656 "[Q] dip [dip infra dip infra dip infra]"
666 "execution_count": null,
673 "execution_count": null,
680 "execution_count": null,
687 "execution_count": null,
694 "execution_count": 6,
699 "output_type": "stream",
704 "[Z [[] ccons] step i] inscribe"
708 "cell_type": "markdown",
711 "Here it is in action in a simplified scenario."
716 "execution_count": 7,
721 "output_type": "stream",
724 " 1 [2 3 4] • [[] ccons] step i\n",
725 " 1 [2 3 4] [[] ccons] • step i\n",
726 " 1 [2 3 4] [[] ccons] • [_step0] x i\n",
727 " 1 [2 3 4] [[] ccons] [_step0] • x i\n",
728 " 1 [2 3 4] [[] ccons] [_step0] • dup i i\n",
729 " 1 [2 3 4] [[] ccons] [_step0] [_step0] • i i\n",
730 " 1 [2 3 4] [[] ccons] [_step0] • _step0 i\n",
731 " 1 [2 3 4] [[] ccons] [_step0] • _step1 [popopop] [_stept] branch i\n",
732 " 1 [2 3 4] [[] ccons] [_step0] • [?] dipd roll< [popopop] [_stept] branch i\n",
733 " 1 [2 3 4] [[] ccons] [_step0] [?] • dipd roll< [popopop] [_stept] branch i\n",
734 " 1 [2 3 4] [[] ccons] [_step0] [?] • [dip] codi roll< [popopop] [_stept] branch i\n",
735 " 1 [2 3 4] [[] ccons] [_step0] [?] [dip] • codi roll< [popopop] [_stept] branch i\n",
736 " 1 [2 3 4] [[] ccons] [_step0] [?] [dip] • cons dip roll< [popopop] [_stept] branch i\n",
737 " 1 [2 3 4] [[] ccons] [_step0] [[?] dip] • dip roll< [popopop] [_stept] branch i\n",
738 " 1 [2 3 4] [[] ccons] • [?] dip [_step0] roll< [popopop] [_stept] branch i\n",
739 " 1 [2 3 4] [[] ccons] [?] • dip [_step0] roll< [popopop] [_stept] branch i\n",
740 " 1 [2 3 4] • ? [[] ccons] [_step0] roll< [popopop] [_stept] branch i\n",
741 " 1 [2 3 4] • dup bool [[] ccons] [_step0] roll< [popopop] [_stept] branch i\n",
742 " 1 [2 3 4] [2 3 4] • bool [[] ccons] [_step0] roll< [popopop] [_stept] branch i\n",
743 " 1 [2 3 4] true • [[] ccons] [_step0] roll< [popopop] [_stept] branch i\n",
744 " 1 [2 3 4] true [[] ccons] • [_step0] roll< [popopop] [_stept] branch i\n",
745 " 1 [2 3 4] true [[] ccons] [_step0] • roll< [popopop] [_stept] branch i\n",
746 " 1 [2 3 4] true [[] ccons] [_step0] • swapd swap [popopop] [_stept] branch i\n",
747 " 1 [2 3 4] true [[] ccons] [_step0] • [swap] dip swap [popopop] [_stept] branch i\n",
748 " 1 [2 3 4] true [[] ccons] [_step0] [swap] • dip swap [popopop] [_stept] branch i\n",
749 " 1 [2 3 4] true [[] ccons] • swap [_step0] swap [popopop] [_stept] branch i\n",
750 " 1 [2 3 4] [[] ccons] true • [_step0] swap [popopop] [_stept] branch i\n",
751 " 1 [2 3 4] [[] ccons] true [_step0] • swap [popopop] [_stept] branch i\n",
752 " 1 [2 3 4] [[] ccons] [_step0] true • [popopop] [_stept] branch i\n",
753 " 1 [2 3 4] [[] ccons] [_step0] true [popopop] • [_stept] branch i\n",
754 " 1 [2 3 4] [[] ccons] [_step0] true [popopop] [_stept] • branch i\n",
755 " 1 [2 3 4] [[] ccons] [_step0] • _stept i\n",
756 " 1 [2 3 4] [[] ccons] [_step0] • [uncons] dipd [dupdipd] dip x i\n",
757 " 1 [2 3 4] [[] ccons] [_step0] [uncons] • dipd [dupdipd] dip x i\n",
758 " 1 [2 3 4] [[] ccons] [_step0] [uncons] • [dip] codi [dupdipd] dip x i\n",
759 " 1 [2 3 4] [[] ccons] [_step0] [uncons] [dip] • codi [dupdipd] dip x i\n",
760 " 1 [2 3 4] [[] ccons] [_step0] [uncons] [dip] • cons dip [dupdipd] dip x i\n",
761 " 1 [2 3 4] [[] ccons] [_step0] [[uncons] dip] • dip [dupdipd] dip x i\n",
762 " 1 [2 3 4] [[] ccons] • [uncons] dip [_step0] [dupdipd] dip x i\n",
763 " 1 [2 3 4] [[] ccons] [uncons] • dip [_step0] [dupdipd] dip x i\n",
764 " 1 [2 3 4] • uncons [[] ccons] [_step0] [dupdipd] dip x i\n",
765 " 1 [2 3 4] • [first] [rest] cleave [[] ccons] [_step0] [dupdipd] dip x i\n",
766 " 1 [2 3 4] [first] • [rest] cleave [[] ccons] [_step0] [dupdipd] dip x i\n",
767 " 1 [2 3 4] [first] [rest] • cleave [[] ccons] [_step0] [dupdipd] dip x i\n",
768 " 1 [2 3 4] [first] [rest] • fork popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
769 " 1 [2 3 4] [first] [rest] • [i] app2 popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
770 " 1 [2 3 4] [first] [rest] [i] • app2 popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
771 " 1 [2 3 4] [first] [rest] [i] • [grba swap grba swap] dip [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
772 " 1 [2 3 4] [first] [rest] [i] [grba swap grba swap] • dip [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
773 " 1 [2 3 4] [first] [rest] • grba swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
774 " 1 [2 3 4] [first] [rest] • [stack popd] dip swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
775 " 1 [2 3 4] [first] [rest] [stack popd] • dip swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
776 " 1 [2 3 4] [first] • stack popd [rest] swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
777 " 1 [2 3 4] [first] [[first] [2 3 4] 1] • popd [rest] swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
778 " 1 [2 3 4] [first] [[first] [2 3 4] 1] • [pop] dip [rest] swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
779 " 1 [2 3 4] [first] [[first] [2 3 4] 1] [pop] • dip [rest] swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
780 " 1 [2 3 4] [first] • pop [[first] [2 3 4] 1] [rest] swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
781 " 1 [2 3 4] • [[first] [2 3 4] 1] [rest] swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
782 " 1 [2 3 4] [[first] [2 3 4] 1] • [rest] swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
783 " 1 [2 3 4] [[first] [2 3 4] 1] [rest] • swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
784 " 1 [2 3 4] [rest] [[first] [2 3 4] 1] • grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
785 " 1 [2 3 4] [rest] [[first] [2 3 4] 1] • [stack popd] dip swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
786 " 1 [2 3 4] [rest] [[first] [2 3 4] 1] [stack popd] • dip swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
787 " 1 [2 3 4] [rest] • stack popd [[first] [2 3 4] 1] swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
788 " 1 [2 3 4] [rest] [[rest] [2 3 4] 1] • popd [[first] [2 3 4] 1] swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
789 " 1 [2 3 4] [rest] [[rest] [2 3 4] 1] • [pop] dip [[first] [2 3 4] 1] swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
790 " 1 [2 3 4] [rest] [[rest] [2 3 4] 1] [pop] • dip [[first] [2 3 4] 1] swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
791 " 1 [2 3 4] [rest] • pop [[rest] [2 3 4] 1] [[first] [2 3 4] 1] swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
792 " 1 [2 3 4] • [[rest] [2 3 4] 1] [[first] [2 3 4] 1] swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
793 " 1 [2 3 4] [[rest] [2 3 4] 1] • [[first] [2 3 4] 1] swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
794 " 1 [2 3 4] [[rest] [2 3 4] 1] [[first] [2 3 4] 1] • swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
795 " 1 [2 3 4] [[first] [2 3 4] 1] [[rest] [2 3 4] 1] • [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
796 " 1 [2 3 4] [[first] [2 3 4] 1] [[rest] [2 3 4] 1] [i] • [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
797 " 1 [2 3 4] [[first] [2 3 4] 1] [[rest] [2 3 4] 1] [i] [infrst] • cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
798 " 1 [2 3 4] [[first] [2 3 4] 1] [[rest] [2 3 4] 1] [[i] infrst] • ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
799 " 1 [2 3 4] [[first] [2 3 4] 1] [[rest] [2 3 4] 1] [[i] infrst] • [dip] dupdip i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
800 " 1 [2 3 4] [[first] [2 3 4] 1] [[rest] [2 3 4] 1] [[i] infrst] [dip] • dupdip i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
801 " 1 [2 3 4] [[first] [2 3 4] 1] [[rest] [2 3 4] 1] [[i] infrst] [dip] • dupd dip i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
802 " 1 [2 3 4] [[first] [2 3 4] 1] [[rest] [2 3 4] 1] [[i] infrst] [dip] • [dup] dip dip i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
803 " 1 [2 3 4] [[first] [2 3 4] 1] [[rest] [2 3 4] 1] [[i] infrst] [dip] [dup] • dip dip i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
804 " 1 [2 3 4] [[first] [2 3 4] 1] [[rest] [2 3 4] 1] [[i] infrst] • dup [dip] dip i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
805 " 1 [2 3 4] [[first] [2 3 4] 1] [[rest] [2 3 4] 1] [[i] infrst] [[i] infrst] • [dip] dip i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
806 " 1 [2 3 4] [[first] [2 3 4] 1] [[rest] [2 3 4] 1] [[i] infrst] [[i] infrst] [dip] • dip i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
807 " 1 [2 3 4] [[first] [2 3 4] 1] [[rest] [2 3 4] 1] [[i] infrst] • dip [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
808 " 1 [2 3 4] [[first] [2 3 4] 1] • [i] infrst [[rest] [2 3 4] 1] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
809 " 1 [2 3 4] [[first] [2 3 4] 1] [i] • infrst [[rest] [2 3 4] 1] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
810 " 1 [2 3 4] [[first] [2 3 4] 1] [i] • infra first [[rest] [2 3 4] 1] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
811 " 1 [2 3 4] [[first] [2 3 4] 1] [i] • swons swaack [i] dip swaack first [[rest] [2 3 4] 1] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
812 " 1 [2 3 4] [[first] [2 3 4] 1] [i] • swap cons swaack [i] dip swaack first [[rest] [2 3 4] 1] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
813 " 1 [2 3 4] [i] [[first] [2 3 4] 1] • cons swaack [i] dip swaack first [[rest] [2 3 4] 1] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
814 " 1 [2 3 4] [[i] [first] [2 3 4] 1] • swaack [i] dip swaack first [[rest] [2 3 4] 1] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
815 " 1 [2 3 4] [first] [i] [[2 3 4] 1] • [i] dip swaack first [[rest] [2 3 4] 1] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
816 " 1 [2 3 4] [first] [i] [[2 3 4] 1] [i] • dip swaack first [[rest] [2 3 4] 1] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
817 " 1 [2 3 4] [first] [i] • i [[2 3 4] 1] swaack first [[rest] [2 3 4] 1] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
818 " 1 [2 3 4] [first] • i [[2 3 4] 1] swaack first [[rest] [2 3 4] 1] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
819 " 1 [2 3 4] • first [[2 3 4] 1] swaack first [[rest] [2 3 4] 1] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
820 " 1 2 • [[2 3 4] 1] swaack first [[rest] [2 3 4] 1] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
821 " 1 2 [[2 3 4] 1] • swaack first [[rest] [2 3 4] 1] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
822 " 1 [2 3 4] [2 1] • first [[rest] [2 3 4] 1] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
823 " 1 [2 3 4] 2 • [[rest] [2 3 4] 1] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
824 " 1 [2 3 4] 2 [[rest] [2 3 4] 1] • [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
825 " 1 [2 3 4] 2 [[rest] [2 3 4] 1] [[i] infrst] • i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
826 " 1 [2 3 4] 2 [[rest] [2 3 4] 1] • [i] infrst popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
827 " 1 [2 3 4] 2 [[rest] [2 3 4] 1] [i] • infrst popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
828 " 1 [2 3 4] 2 [[rest] [2 3 4] 1] [i] • infra first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
829 " 1 [2 3 4] 2 [[rest] [2 3 4] 1] [i] • swons swaack [i] dip swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
830 " 1 [2 3 4] 2 [[rest] [2 3 4] 1] [i] • swap cons swaack [i] dip swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
831 " 1 [2 3 4] 2 [i] [[rest] [2 3 4] 1] • cons swaack [i] dip swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
832 " 1 [2 3 4] 2 [[i] [rest] [2 3 4] 1] • swaack [i] dip swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
833 " 1 [2 3 4] [rest] [i] [2 [2 3 4] 1] • [i] dip swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
834 " 1 [2 3 4] [rest] [i] [2 [2 3 4] 1] [i] • dip swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
835 " 1 [2 3 4] [rest] [i] • i [2 [2 3 4] 1] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
836 " 1 [2 3 4] [rest] • i [2 [2 3 4] 1] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
837 " 1 [2 3 4] • rest [2 [2 3 4] 1] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
838 " 1 [2 3 4] • [pop] infra [2 [2 3 4] 1] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
839 " 1 [2 3 4] [pop] • infra [2 [2 3 4] 1] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
840 " 1 [2 3 4] [pop] • swons swaack [i] dip swaack [2 [2 3 4] 1] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
841 " 1 [2 3 4] [pop] • swap cons swaack [i] dip swaack [2 [2 3 4] 1] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
842 " 1 [pop] [2 3 4] • cons swaack [i] dip swaack [2 [2 3 4] 1] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
843 " 1 [[pop] 2 3 4] • swaack [i] dip swaack [2 [2 3 4] 1] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
844 " 4 3 2 [pop] [1] • [i] dip swaack [2 [2 3 4] 1] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
845 " 4 3 2 [pop] [1] [i] • dip swaack [2 [2 3 4] 1] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
846 " 4 3 2 [pop] • i [1] swaack [2 [2 3 4] 1] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
847 " 4 3 2 • pop [1] swaack [2 [2 3 4] 1] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
848 " 4 3 • [1] swaack [2 [2 3 4] 1] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
849 " 4 3 [1] • swaack [2 [2 3 4] 1] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
850 " 1 [3 4] • [2 [2 3 4] 1] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
851 " 1 [3 4] [2 [2 3 4] 1] • swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
852 " 1 [2 3 4] 2 [[3 4] 1] • first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
853 " 1 [2 3 4] 2 [3 4] • popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
854 " 1 [2 3 4] 2 [3 4] • [pop] dipd [[] ccons] [_step0] [dupdipd] dip x i\n",
855 " 1 [2 3 4] 2 [3 4] [pop] • dipd [[] ccons] [_step0] [dupdipd] dip x i\n",
856 " 1 [2 3 4] 2 [3 4] [pop] • [dip] codi [[] ccons] [_step0] [dupdipd] dip x i\n",
857 " 1 [2 3 4] 2 [3 4] [pop] [dip] • codi [[] ccons] [_step0] [dupdipd] dip x i\n",
858 " 1 [2 3 4] 2 [3 4] [pop] [dip] • cons dip [[] ccons] [_step0] [dupdipd] dip x i\n",
859 " 1 [2 3 4] 2 [3 4] [[pop] dip] • dip [[] ccons] [_step0] [dupdipd] dip x i\n",
860 " 1 [2 3 4] 2 • [pop] dip [3 4] [[] ccons] [_step0] [dupdipd] dip x i\n",
861 " 1 [2 3 4] 2 [pop] • dip [3 4] [[] ccons] [_step0] [dupdipd] dip x i\n",
862 " 1 [2 3 4] • pop 2 [3 4] [[] ccons] [_step0] [dupdipd] dip x i\n",
863 " 1 • 2 [3 4] [[] ccons] [_step0] [dupdipd] dip x i\n",
864 " 1 2 • [3 4] [[] ccons] [_step0] [dupdipd] dip x i\n",
865 " 1 2 [3 4] • [[] ccons] [_step0] [dupdipd] dip x i\n",
866 " 1 2 [3 4] [[] ccons] • [_step0] [dupdipd] dip x i\n",
867 " 1 2 [3 4] [[] ccons] [_step0] • [dupdipd] dip x i\n",
868 " 1 2 [3 4] [[] ccons] [_step0] [dupdipd] • dip x i\n",
869 " 1 2 [3 4] [[] ccons] • dupdipd [_step0] x i\n",
870 " 1 2 [3 4] [[] ccons] • dup dipd [_step0] x i\n",
871 " 1 2 [3 4] [[] ccons] [[] ccons] • dipd [_step0] x i\n",
872 " 1 2 [3 4] [[] ccons] [[] ccons] • [dip] codi [_step0] x i\n",
873 " 1 2 [3 4] [[] ccons] [[] ccons] [dip] • codi [_step0] x i\n",
874 " 1 2 [3 4] [[] ccons] [[] ccons] [dip] • cons dip [_step0] x i\n",
875 " 1 2 [3 4] [[] ccons] [[[] ccons] dip] • dip [_step0] x i\n",
876 " 1 2 [3 4] • [[] ccons] dip [[] ccons] [_step0] x i\n",
877 " 1 2 [3 4] [[] ccons] • dip [[] ccons] [_step0] x i\n",
878 " 1 2 • [] ccons [3 4] [[] ccons] [_step0] x i\n",
879 " 1 2 [] • ccons [3 4] [[] ccons] [_step0] x i\n",
880 " 1 2 [] • cons cons [3 4] [[] ccons] [_step0] x i\n",
881 " 1 [2] • cons [3 4] [[] ccons] [_step0] x i\n",
882 " [1 2] • [3 4] [[] ccons] [_step0] x i\n",
883 " [1 2] [3 4] • [[] ccons] [_step0] x i\n",
884 " [1 2] [3 4] [[] ccons] • [_step0] x i\n",
885 " [1 2] [3 4] [[] ccons] [_step0] • x i\n",
886 " [1 2] [3 4] [[] ccons] [_step0] • dup i i\n",
887 " [1 2] [3 4] [[] ccons] [_step0] [_step0] • i i\n",
888 " [1 2] [3 4] [[] ccons] [_step0] • _step0 i\n",
889 " [1 2] [3 4] [[] ccons] [_step0] • _step1 [popopop] [_stept] branch i\n",
890 " [1 2] [3 4] [[] ccons] [_step0] • [?] dipd roll< [popopop] [_stept] branch i\n",
891 " [1 2] [3 4] [[] ccons] [_step0] [?] • dipd roll< [popopop] [_stept] branch i\n",
892 " [1 2] [3 4] [[] ccons] [_step0] [?] • [dip] codi roll< [popopop] [_stept] branch i\n",
893 " [1 2] [3 4] [[] ccons] [_step0] [?] [dip] • codi roll< [popopop] [_stept] branch i\n",
894 " [1 2] [3 4] [[] ccons] [_step0] [?] [dip] • cons dip roll< [popopop] [_stept] branch i\n",
895 " [1 2] [3 4] [[] ccons] [_step0] [[?] dip] • dip roll< [popopop] [_stept] branch i\n",
896 " [1 2] [3 4] [[] ccons] • [?] dip [_step0] roll< [popopop] [_stept] branch i\n",
897 " [1 2] [3 4] [[] ccons] [?] • dip [_step0] roll< [popopop] [_stept] branch i\n",
898 " [1 2] [3 4] • ? [[] ccons] [_step0] roll< [popopop] [_stept] branch i\n",
899 " [1 2] [3 4] • dup bool [[] ccons] [_step0] roll< [popopop] [_stept] branch i\n",
900 " [1 2] [3 4] [3 4] • bool [[] ccons] [_step0] roll< [popopop] [_stept] branch i\n",
901 " [1 2] [3 4] true • [[] ccons] [_step0] roll< [popopop] [_stept] branch i\n",
902 " [1 2] [3 4] true [[] ccons] • [_step0] roll< [popopop] [_stept] branch i\n",
903 " [1 2] [3 4] true [[] ccons] [_step0] • roll< [popopop] [_stept] branch i\n",
904 " [1 2] [3 4] true [[] ccons] [_step0] • swapd swap [popopop] [_stept] branch i\n",
905 " [1 2] [3 4] true [[] ccons] [_step0] • [swap] dip swap [popopop] [_stept] branch i\n",
906 " [1 2] [3 4] true [[] ccons] [_step0] [swap] • dip swap [popopop] [_stept] branch i\n",
907 " [1 2] [3 4] true [[] ccons] • swap [_step0] swap [popopop] [_stept] branch i\n",
908 " [1 2] [3 4] [[] ccons] true • [_step0] swap [popopop] [_stept] branch i\n",
909 " [1 2] [3 4] [[] ccons] true [_step0] • swap [popopop] [_stept] branch i\n",
910 " [1 2] [3 4] [[] ccons] [_step0] true • [popopop] [_stept] branch i\n",
911 " [1 2] [3 4] [[] ccons] [_step0] true [popopop] • [_stept] branch i\n",
912 " [1 2] [3 4] [[] ccons] [_step0] true [popopop] [_stept] • branch i\n",
913 " [1 2] [3 4] [[] ccons] [_step0] • _stept i\n",
914 " [1 2] [3 4] [[] ccons] [_step0] • [uncons] dipd [dupdipd] dip x i\n",
915 " [1 2] [3 4] [[] ccons] [_step0] [uncons] • dipd [dupdipd] dip x i\n",
916 " [1 2] [3 4] [[] ccons] [_step0] [uncons] • [dip] codi [dupdipd] dip x i\n",
917 " [1 2] [3 4] [[] ccons] [_step0] [uncons] [dip] • codi [dupdipd] dip x i\n",
918 " [1 2] [3 4] [[] ccons] [_step0] [uncons] [dip] • cons dip [dupdipd] dip x i\n",
919 " [1 2] [3 4] [[] ccons] [_step0] [[uncons] dip] • dip [dupdipd] dip x i\n",
920 " [1 2] [3 4] [[] ccons] • [uncons] dip [_step0] [dupdipd] dip x i\n",
921 " [1 2] [3 4] [[] ccons] [uncons] • dip [_step0] [dupdipd] dip x i\n",
922 " [1 2] [3 4] • uncons [[] ccons] [_step0] [dupdipd] dip x i\n",
923 " [1 2] [3 4] • [first] [rest] cleave [[] ccons] [_step0] [dupdipd] dip x i\n",
924 " [1 2] [3 4] [first] • [rest] cleave [[] ccons] [_step0] [dupdipd] dip x i\n",
925 " [1 2] [3 4] [first] [rest] • cleave [[] ccons] [_step0] [dupdipd] dip x i\n",
926 " [1 2] [3 4] [first] [rest] • fork popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
927 " [1 2] [3 4] [first] [rest] • [i] app2 popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
928 " [1 2] [3 4] [first] [rest] [i] • app2 popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
929 " [1 2] [3 4] [first] [rest] [i] • [grba swap grba swap] dip [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
930 " [1 2] [3 4] [first] [rest] [i] [grba swap grba swap] • dip [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
931 " [1 2] [3 4] [first] [rest] • grba swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
932 " [1 2] [3 4] [first] [rest] • [stack popd] dip swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
933 " [1 2] [3 4] [first] [rest] [stack popd] • dip swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
934 " [1 2] [3 4] [first] • stack popd [rest] swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
935 " [1 2] [3 4] [first] [[first] [3 4] [1 2]] • popd [rest] swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
936 " [1 2] [3 4] [first] [[first] [3 4] [1 2]] • [pop] dip [rest] swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
937 " [1 2] [3 4] [first] [[first] [3 4] [1 2]] [pop] • dip [rest] swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
938 " [1 2] [3 4] [first] • pop [[first] [3 4] [1 2]] [rest] swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
939 " [1 2] [3 4] • [[first] [3 4] [1 2]] [rest] swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
940 " [1 2] [3 4] [[first] [3 4] [1 2]] • [rest] swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
941 " [1 2] [3 4] [[first] [3 4] [1 2]] [rest] • swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
942 " [1 2] [3 4] [rest] [[first] [3 4] [1 2]] • grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
943 " [1 2] [3 4] [rest] [[first] [3 4] [1 2]] • [stack popd] dip swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
944 " [1 2] [3 4] [rest] [[first] [3 4] [1 2]] [stack popd] • dip swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
945 " [1 2] [3 4] [rest] • stack popd [[first] [3 4] [1 2]] swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
946 " [1 2] [3 4] [rest] [[rest] [3 4] [1 2]] • popd [[first] [3 4] [1 2]] swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
947 " [1 2] [3 4] [rest] [[rest] [3 4] [1 2]] • [pop] dip [[first] [3 4] [1 2]] swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
948 " [1 2] [3 4] [rest] [[rest] [3 4] [1 2]] [pop] • dip [[first] [3 4] [1 2]] swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
949 " [1 2] [3 4] [rest] • pop [[rest] [3 4] [1 2]] [[first] [3 4] [1 2]] swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
950 " [1 2] [3 4] • [[rest] [3 4] [1 2]] [[first] [3 4] [1 2]] swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
951 " [1 2] [3 4] [[rest] [3 4] [1 2]] • [[first] [3 4] [1 2]] swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
952 " [1 2] [3 4] [[rest] [3 4] [1 2]] [[first] [3 4] [1 2]] • swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
953 " [1 2] [3 4] [[first] [3 4] [1 2]] [[rest] [3 4] [1 2]] • [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
954 " [1 2] [3 4] [[first] [3 4] [1 2]] [[rest] [3 4] [1 2]] [i] • [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
955 " [1 2] [3 4] [[first] [3 4] [1 2]] [[rest] [3 4] [1 2]] [i] [infrst] • cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
956 " [1 2] [3 4] [[first] [3 4] [1 2]] [[rest] [3 4] [1 2]] [[i] infrst] • ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
957 " [1 2] [3 4] [[first] [3 4] [1 2]] [[rest] [3 4] [1 2]] [[i] infrst] • [dip] dupdip i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
958 " [1 2] [3 4] [[first] [3 4] [1 2]] [[rest] [3 4] [1 2]] [[i] infrst] [dip] • dupdip i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
959 " [1 2] [3 4] [[first] [3 4] [1 2]] [[rest] [3 4] [1 2]] [[i] infrst] [dip] • dupd dip i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
960 " [1 2] [3 4] [[first] [3 4] [1 2]] [[rest] [3 4] [1 2]] [[i] infrst] [dip] • [dup] dip dip i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
961 " [1 2] [3 4] [[first] [3 4] [1 2]] [[rest] [3 4] [1 2]] [[i] infrst] [dip] [dup] • dip dip i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
962 " [1 2] [3 4] [[first] [3 4] [1 2]] [[rest] [3 4] [1 2]] [[i] infrst] • dup [dip] dip i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
963 " [1 2] [3 4] [[first] [3 4] [1 2]] [[rest] [3 4] [1 2]] [[i] infrst] [[i] infrst] • [dip] dip i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
964 " [1 2] [3 4] [[first] [3 4] [1 2]] [[rest] [3 4] [1 2]] [[i] infrst] [[i] infrst] [dip] • dip i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
965 " [1 2] [3 4] [[first] [3 4] [1 2]] [[rest] [3 4] [1 2]] [[i] infrst] • dip [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
966 " [1 2] [3 4] [[first] [3 4] [1 2]] • [i] infrst [[rest] [3 4] [1 2]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
967 " [1 2] [3 4] [[first] [3 4] [1 2]] [i] • infrst [[rest] [3 4] [1 2]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
968 " [1 2] [3 4] [[first] [3 4] [1 2]] [i] • infra first [[rest] [3 4] [1 2]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
969 " [1 2] [3 4] [[first] [3 4] [1 2]] [i] • swons swaack [i] dip swaack first [[rest] [3 4] [1 2]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
970 " [1 2] [3 4] [[first] [3 4] [1 2]] [i] • swap cons swaack [i] dip swaack first [[rest] [3 4] [1 2]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
971 " [1 2] [3 4] [i] [[first] [3 4] [1 2]] • cons swaack [i] dip swaack first [[rest] [3 4] [1 2]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
972 " [1 2] [3 4] [[i] [first] [3 4] [1 2]] • swaack [i] dip swaack first [[rest] [3 4] [1 2]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
973 " [1 2] [3 4] [first] [i] [[3 4] [1 2]] • [i] dip swaack first [[rest] [3 4] [1 2]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
974 " [1 2] [3 4] [first] [i] [[3 4] [1 2]] [i] • dip swaack first [[rest] [3 4] [1 2]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
975 " [1 2] [3 4] [first] [i] • i [[3 4] [1 2]] swaack first [[rest] [3 4] [1 2]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
976 " [1 2] [3 4] [first] • i [[3 4] [1 2]] swaack first [[rest] [3 4] [1 2]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
977 " [1 2] [3 4] • first [[3 4] [1 2]] swaack first [[rest] [3 4] [1 2]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
978 " [1 2] 3 • [[3 4] [1 2]] swaack first [[rest] [3 4] [1 2]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
979 " [1 2] 3 [[3 4] [1 2]] • swaack first [[rest] [3 4] [1 2]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
980 " [1 2] [3 4] [3 [1 2]] • first [[rest] [3 4] [1 2]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
981 " [1 2] [3 4] 3 • [[rest] [3 4] [1 2]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
982 " [1 2] [3 4] 3 [[rest] [3 4] [1 2]] • [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
983 " [1 2] [3 4] 3 [[rest] [3 4] [1 2]] [[i] infrst] • i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
984 " [1 2] [3 4] 3 [[rest] [3 4] [1 2]] • [i] infrst popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
985 " [1 2] [3 4] 3 [[rest] [3 4] [1 2]] [i] • infrst popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
986 " [1 2] [3 4] 3 [[rest] [3 4] [1 2]] [i] • infra first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
987 " [1 2] [3 4] 3 [[rest] [3 4] [1 2]] [i] • swons swaack [i] dip swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
988 " [1 2] [3 4] 3 [[rest] [3 4] [1 2]] [i] • swap cons swaack [i] dip swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
989 " [1 2] [3 4] 3 [i] [[rest] [3 4] [1 2]] • cons swaack [i] dip swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
990 " [1 2] [3 4] 3 [[i] [rest] [3 4] [1 2]] • swaack [i] dip swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
991 " [1 2] [3 4] [rest] [i] [3 [3 4] [1 2]] • [i] dip swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
992 " [1 2] [3 4] [rest] [i] [3 [3 4] [1 2]] [i] • dip swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
993 " [1 2] [3 4] [rest] [i] • i [3 [3 4] [1 2]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
994 " [1 2] [3 4] [rest] • i [3 [3 4] [1 2]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
995 " [1 2] [3 4] • rest [3 [3 4] [1 2]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
996 " [1 2] [3 4] • [pop] infra [3 [3 4] [1 2]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
997 " [1 2] [3 4] [pop] • infra [3 [3 4] [1 2]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
998 " [1 2] [3 4] [pop] • swons swaack [i] dip swaack [3 [3 4] [1 2]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
999 " [1 2] [3 4] [pop] • swap cons swaack [i] dip swaack [3 [3 4] [1 2]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1000 " [1 2] [pop] [3 4] • cons swaack [i] dip swaack [3 [3 4] [1 2]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1001 " [1 2] [[pop] 3 4] • swaack [i] dip swaack [3 [3 4] [1 2]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1002 " 4 3 [pop] [[1 2]] • [i] dip swaack [3 [3 4] [1 2]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1003 " 4 3 [pop] [[1 2]] [i] • dip swaack [3 [3 4] [1 2]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1004 " 4 3 [pop] • i [[1 2]] swaack [3 [3 4] [1 2]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1005 " 4 3 • pop [[1 2]] swaack [3 [3 4] [1 2]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1006 " 4 • [[1 2]] swaack [3 [3 4] [1 2]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1007 " 4 [[1 2]] • swaack [3 [3 4] [1 2]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1008 " [1 2] [4] • [3 [3 4] [1 2]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1009 " [1 2] [4] [3 [3 4] [1 2]] • swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1010 " [1 2] [3 4] 3 [[4] [1 2]] • first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1011 " [1 2] [3 4] 3 [4] • popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1012 " [1 2] [3 4] 3 [4] • [pop] dipd [[] ccons] [_step0] [dupdipd] dip x i\n",
1013 " [1 2] [3 4] 3 [4] [pop] • dipd [[] ccons] [_step0] [dupdipd] dip x i\n",
1014 " [1 2] [3 4] 3 [4] [pop] • [dip] codi [[] ccons] [_step0] [dupdipd] dip x i\n",
1015 " [1 2] [3 4] 3 [4] [pop] [dip] • codi [[] ccons] [_step0] [dupdipd] dip x i\n",
1016 " [1 2] [3 4] 3 [4] [pop] [dip] • cons dip [[] ccons] [_step0] [dupdipd] dip x i\n",
1017 " [1 2] [3 4] 3 [4] [[pop] dip] • dip [[] ccons] [_step0] [dupdipd] dip x i\n",
1018 " [1 2] [3 4] 3 • [pop] dip [4] [[] ccons] [_step0] [dupdipd] dip x i\n",
1019 " [1 2] [3 4] 3 [pop] • dip [4] [[] ccons] [_step0] [dupdipd] dip x i\n",
1020 " [1 2] [3 4] • pop 3 [4] [[] ccons] [_step0] [dupdipd] dip x i\n",
1021 " [1 2] • 3 [4] [[] ccons] [_step0] [dupdipd] dip x i\n",
1022 " [1 2] 3 • [4] [[] ccons] [_step0] [dupdipd] dip x i\n",
1023 " [1 2] 3 [4] • [[] ccons] [_step0] [dupdipd] dip x i\n",
1024 " [1 2] 3 [4] [[] ccons] • [_step0] [dupdipd] dip x i\n",
1025 " [1 2] 3 [4] [[] ccons] [_step0] • [dupdipd] dip x i\n",
1026 " [1 2] 3 [4] [[] ccons] [_step0] [dupdipd] • dip x i\n",
1027 " [1 2] 3 [4] [[] ccons] • dupdipd [_step0] x i\n",
1028 " [1 2] 3 [4] [[] ccons] • dup dipd [_step0] x i\n",
1029 " [1 2] 3 [4] [[] ccons] [[] ccons] • dipd [_step0] x i\n",
1030 " [1 2] 3 [4] [[] ccons] [[] ccons] • [dip] codi [_step0] x i\n",
1031 " [1 2] 3 [4] [[] ccons] [[] ccons] [dip] • codi [_step0] x i\n",
1032 " [1 2] 3 [4] [[] ccons] [[] ccons] [dip] • cons dip [_step0] x i\n",
1033 " [1 2] 3 [4] [[] ccons] [[[] ccons] dip] • dip [_step0] x i\n",
1034 " [1 2] 3 [4] • [[] ccons] dip [[] ccons] [_step0] x i\n",
1035 " [1 2] 3 [4] [[] ccons] • dip [[] ccons] [_step0] x i\n",
1036 " [1 2] 3 • [] ccons [4] [[] ccons] [_step0] x i\n",
1037 " [1 2] 3 [] • ccons [4] [[] ccons] [_step0] x i\n",
1038 " [1 2] 3 [] • cons cons [4] [[] ccons] [_step0] x i\n",
1039 " [1 2] [3] • cons [4] [[] ccons] [_step0] x i\n",
1040 " [[1 2] 3] • [4] [[] ccons] [_step0] x i\n",
1041 " [[1 2] 3] [4] • [[] ccons] [_step0] x i\n",
1042 " [[1 2] 3] [4] [[] ccons] • [_step0] x i\n",
1043 " [[1 2] 3] [4] [[] ccons] [_step0] • x i\n",
1044 " [[1 2] 3] [4] [[] ccons] [_step0] • dup i i\n",
1045 " [[1 2] 3] [4] [[] ccons] [_step0] [_step0] • i i\n",
1046 " [[1 2] 3] [4] [[] ccons] [_step0] • _step0 i\n",
1047 " [[1 2] 3] [4] [[] ccons] [_step0] • _step1 [popopop] [_stept] branch i\n",
1048 " [[1 2] 3] [4] [[] ccons] [_step0] • [?] dipd roll< [popopop] [_stept] branch i\n",
1049 " [[1 2] 3] [4] [[] ccons] [_step0] [?] • dipd roll< [popopop] [_stept] branch i\n",
1050 " [[1 2] 3] [4] [[] ccons] [_step0] [?] • [dip] codi roll< [popopop] [_stept] branch i\n",
1051 " [[1 2] 3] [4] [[] ccons] [_step0] [?] [dip] • codi roll< [popopop] [_stept] branch i\n",
1052 " [[1 2] 3] [4] [[] ccons] [_step0] [?] [dip] • cons dip roll< [popopop] [_stept] branch i\n",
1053 " [[1 2] 3] [4] [[] ccons] [_step0] [[?] dip] • dip roll< [popopop] [_stept] branch i\n",
1054 " [[1 2] 3] [4] [[] ccons] • [?] dip [_step0] roll< [popopop] [_stept] branch i\n",
1055 " [[1 2] 3] [4] [[] ccons] [?] • dip [_step0] roll< [popopop] [_stept] branch i\n",
1056 " [[1 2] 3] [4] • ? [[] ccons] [_step0] roll< [popopop] [_stept] branch i\n",
1057 " [[1 2] 3] [4] • dup bool [[] ccons] [_step0] roll< [popopop] [_stept] branch i\n",
1058 " [[1 2] 3] [4] [4] • bool [[] ccons] [_step0] roll< [popopop] [_stept] branch i\n",
1059 " [[1 2] 3] [4] true • [[] ccons] [_step0] roll< [popopop] [_stept] branch i\n",
1060 " [[1 2] 3] [4] true [[] ccons] • [_step0] roll< [popopop] [_stept] branch i\n",
1061 " [[1 2] 3] [4] true [[] ccons] [_step0] • roll< [popopop] [_stept] branch i\n",
1062 " [[1 2] 3] [4] true [[] ccons] [_step0] • swapd swap [popopop] [_stept] branch i\n",
1063 " [[1 2] 3] [4] true [[] ccons] [_step0] • [swap] dip swap [popopop] [_stept] branch i\n",
1064 " [[1 2] 3] [4] true [[] ccons] [_step0] [swap] • dip swap [popopop] [_stept] branch i\n",
1065 " [[1 2] 3] [4] true [[] ccons] • swap [_step0] swap [popopop] [_stept] branch i\n",
1066 " [[1 2] 3] [4] [[] ccons] true • [_step0] swap [popopop] [_stept] branch i\n",
1067 " [[1 2] 3] [4] [[] ccons] true [_step0] • swap [popopop] [_stept] branch i\n",
1068 " [[1 2] 3] [4] [[] ccons] [_step0] true • [popopop] [_stept] branch i\n",
1069 " [[1 2] 3] [4] [[] ccons] [_step0] true [popopop] • [_stept] branch i\n",
1070 " [[1 2] 3] [4] [[] ccons] [_step0] true [popopop] [_stept] • branch i\n",
1071 " [[1 2] 3] [4] [[] ccons] [_step0] • _stept i\n",
1072 " [[1 2] 3] [4] [[] ccons] [_step0] • [uncons] dipd [dupdipd] dip x i\n",
1073 " [[1 2] 3] [4] [[] ccons] [_step0] [uncons] • dipd [dupdipd] dip x i\n",
1074 " [[1 2] 3] [4] [[] ccons] [_step0] [uncons] • [dip] codi [dupdipd] dip x i\n",
1075 " [[1 2] 3] [4] [[] ccons] [_step0] [uncons] [dip] • codi [dupdipd] dip x i\n",
1076 " [[1 2] 3] [4] [[] ccons] [_step0] [uncons] [dip] • cons dip [dupdipd] dip x i\n",
1077 " [[1 2] 3] [4] [[] ccons] [_step0] [[uncons] dip] • dip [dupdipd] dip x i\n",
1078 " [[1 2] 3] [4] [[] ccons] • [uncons] dip [_step0] [dupdipd] dip x i\n",
1079 " [[1 2] 3] [4] [[] ccons] [uncons] • dip [_step0] [dupdipd] dip x i\n",
1080 " [[1 2] 3] [4] • uncons [[] ccons] [_step0] [dupdipd] dip x i\n",
1081 " [[1 2] 3] [4] • [first] [rest] cleave [[] ccons] [_step0] [dupdipd] dip x i\n",
1082 " [[1 2] 3] [4] [first] • [rest] cleave [[] ccons] [_step0] [dupdipd] dip x i\n",
1083 " [[1 2] 3] [4] [first] [rest] • cleave [[] ccons] [_step0] [dupdipd] dip x i\n",
1084 " [[1 2] 3] [4] [first] [rest] • fork popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1085 " [[1 2] 3] [4] [first] [rest] • [i] app2 popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1086 " [[1 2] 3] [4] [first] [rest] [i] • app2 popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1087 " [[1 2] 3] [4] [first] [rest] [i] • [grba swap grba swap] dip [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1088 " [[1 2] 3] [4] [first] [rest] [i] [grba swap grba swap] • dip [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1089 " [[1 2] 3] [4] [first] [rest] • grba swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1090 " [[1 2] 3] [4] [first] [rest] • [stack popd] dip swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1091 " [[1 2] 3] [4] [first] [rest] [stack popd] • dip swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1092 " [[1 2] 3] [4] [first] • stack popd [rest] swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1093 " [[1 2] 3] [4] [first] [[first] [4] [[1 2] 3]] • popd [rest] swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1094 " [[1 2] 3] [4] [first] [[first] [4] [[1 2] 3]] • [pop] dip [rest] swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1095 " [[1 2] 3] [4] [first] [[first] [4] [[1 2] 3]] [pop] • dip [rest] swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1096 " [[1 2] 3] [4] [first] • pop [[first] [4] [[1 2] 3]] [rest] swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1097 " [[1 2] 3] [4] • [[first] [4] [[1 2] 3]] [rest] swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1098 " [[1 2] 3] [4] [[first] [4] [[1 2] 3]] • [rest] swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1099 " [[1 2] 3] [4] [[first] [4] [[1 2] 3]] [rest] • swap grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1100 " [[1 2] 3] [4] [rest] [[first] [4] [[1 2] 3]] • grba swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1101 " [[1 2] 3] [4] [rest] [[first] [4] [[1 2] 3]] • [stack popd] dip swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1102 " [[1 2] 3] [4] [rest] [[first] [4] [[1 2] 3]] [stack popd] • dip swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1103 " [[1 2] 3] [4] [rest] • stack popd [[first] [4] [[1 2] 3]] swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1104 " [[1 2] 3] [4] [rest] [[rest] [4] [[1 2] 3]] • popd [[first] [4] [[1 2] 3]] swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1105 " [[1 2] 3] [4] [rest] [[rest] [4] [[1 2] 3]] • [pop] dip [[first] [4] [[1 2] 3]] swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1106 " [[1 2] 3] [4] [rest] [[rest] [4] [[1 2] 3]] [pop] • dip [[first] [4] [[1 2] 3]] swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1107 " [[1 2] 3] [4] [rest] • pop [[rest] [4] [[1 2] 3]] [[first] [4] [[1 2] 3]] swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1108 " [[1 2] 3] [4] • [[rest] [4] [[1 2] 3]] [[first] [4] [[1 2] 3]] swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1109 " [[1 2] 3] [4] [[rest] [4] [[1 2] 3]] • [[first] [4] [[1 2] 3]] swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1110 " [[1 2] 3] [4] [[rest] [4] [[1 2] 3]] [[first] [4] [[1 2] 3]] • swap [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1111 " [[1 2] 3] [4] [[first] [4] [[1 2] 3]] [[rest] [4] [[1 2] 3]] • [i] [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1112 " [[1 2] 3] [4] [[first] [4] [[1 2] 3]] [[rest] [4] [[1 2] 3]] [i] • [infrst] cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1113 " [[1 2] 3] [4] [[first] [4] [[1 2] 3]] [[rest] [4] [[1 2] 3]] [i] [infrst] • cons ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1114 " [[1 2] 3] [4] [[first] [4] [[1 2] 3]] [[rest] [4] [[1 2] 3]] [[i] infrst] • ii popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1115 " [[1 2] 3] [4] [[first] [4] [[1 2] 3]] [[rest] [4] [[1 2] 3]] [[i] infrst] • [dip] dupdip i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1116 " [[1 2] 3] [4] [[first] [4] [[1 2] 3]] [[rest] [4] [[1 2] 3]] [[i] infrst] [dip] • dupdip i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1117 " [[1 2] 3] [4] [[first] [4] [[1 2] 3]] [[rest] [4] [[1 2] 3]] [[i] infrst] [dip] • dupd dip i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1118 " [[1 2] 3] [4] [[first] [4] [[1 2] 3]] [[rest] [4] [[1 2] 3]] [[i] infrst] [dip] • [dup] dip dip i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1119 " [[1 2] 3] [4] [[first] [4] [[1 2] 3]] [[rest] [4] [[1 2] 3]] [[i] infrst] [dip] [dup] • dip dip i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1120 " [[1 2] 3] [4] [[first] [4] [[1 2] 3]] [[rest] [4] [[1 2] 3]] [[i] infrst] • dup [dip] dip i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1121 " [[1 2] 3] [4] [[first] [4] [[1 2] 3]] [[rest] [4] [[1 2] 3]] [[i] infrst] [[i] infrst] • [dip] dip i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1122 "[[1 2] 3] [4] [[first] [4] [[1 2] 3]] [[rest] [4] [[1 2] 3]] [[i] infrst] [[i] infrst] [dip] • dip i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1123 " [[1 2] 3] [4] [[first] [4] [[1 2] 3]] [[rest] [4] [[1 2] 3]] [[i] infrst] • dip [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1124 " [[1 2] 3] [4] [[first] [4] [[1 2] 3]] • [i] infrst [[rest] [4] [[1 2] 3]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1125 " [[1 2] 3] [4] [[first] [4] [[1 2] 3]] [i] • infrst [[rest] [4] [[1 2] 3]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1126 " [[1 2] 3] [4] [[first] [4] [[1 2] 3]] [i] • infra first [[rest] [4] [[1 2] 3]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1127 " [[1 2] 3] [4] [[first] [4] [[1 2] 3]] [i] • swons swaack [i] dip swaack first [[rest] [4] [[1 2] 3]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1128 " [[1 2] 3] [4] [[first] [4] [[1 2] 3]] [i] • swap cons swaack [i] dip swaack first [[rest] [4] [[1 2] 3]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1129 " [[1 2] 3] [4] [i] [[first] [4] [[1 2] 3]] • cons swaack [i] dip swaack first [[rest] [4] [[1 2] 3]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1130 " [[1 2] 3] [4] [[i] [first] [4] [[1 2] 3]] • swaack [i] dip swaack first [[rest] [4] [[1 2] 3]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1131 " [[1 2] 3] [4] [first] [i] [[4] [[1 2] 3]] • [i] dip swaack first [[rest] [4] [[1 2] 3]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1132 " [[1 2] 3] [4] [first] [i] [[4] [[1 2] 3]] [i] • dip swaack first [[rest] [4] [[1 2] 3]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1133 " [[1 2] 3] [4] [first] [i] • i [[4] [[1 2] 3]] swaack first [[rest] [4] [[1 2] 3]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1134 " [[1 2] 3] [4] [first] • i [[4] [[1 2] 3]] swaack first [[rest] [4] [[1 2] 3]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1135 " [[1 2] 3] [4] • first [[4] [[1 2] 3]] swaack first [[rest] [4] [[1 2] 3]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1136 " [[1 2] 3] 4 • [[4] [[1 2] 3]] swaack first [[rest] [4] [[1 2] 3]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1137 " [[1 2] 3] 4 [[4] [[1 2] 3]] • swaack first [[rest] [4] [[1 2] 3]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1138 " [[1 2] 3] [4] [4 [[1 2] 3]] • first [[rest] [4] [[1 2] 3]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1139 " [[1 2] 3] [4] 4 • [[rest] [4] [[1 2] 3]] [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1140 " [[1 2] 3] [4] 4 [[rest] [4] [[1 2] 3]] • [[i] infrst] i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1141 " [[1 2] 3] [4] 4 [[rest] [4] [[1 2] 3]] [[i] infrst] • i popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1142 " [[1 2] 3] [4] 4 [[rest] [4] [[1 2] 3]] • [i] infrst popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1143 " [[1 2] 3] [4] 4 [[rest] [4] [[1 2] 3]] [i] • infrst popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1144 " [[1 2] 3] [4] 4 [[rest] [4] [[1 2] 3]] [i] • infra first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1145 " [[1 2] 3] [4] 4 [[rest] [4] [[1 2] 3]] [i] • swons swaack [i] dip swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1146 " [[1 2] 3] [4] 4 [[rest] [4] [[1 2] 3]] [i] • swap cons swaack [i] dip swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1147 " [[1 2] 3] [4] 4 [i] [[rest] [4] [[1 2] 3]] • cons swaack [i] dip swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1148 " [[1 2] 3] [4] 4 [[i] [rest] [4] [[1 2] 3]] • swaack [i] dip swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1149 " [[1 2] 3] [4] [rest] [i] [4 [4] [[1 2] 3]] • [i] dip swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1150 " [[1 2] 3] [4] [rest] [i] [4 [4] [[1 2] 3]] [i] • dip swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1151 " [[1 2] 3] [4] [rest] [i] • i [4 [4] [[1 2] 3]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1152 " [[1 2] 3] [4] [rest] • i [4 [4] [[1 2] 3]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1153 " [[1 2] 3] [4] • rest [4 [4] [[1 2] 3]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1154 " [[1 2] 3] [4] • [pop] infra [4 [4] [[1 2] 3]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1155 " [[1 2] 3] [4] [pop] • infra [4 [4] [[1 2] 3]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1156 " [[1 2] 3] [4] [pop] • swons swaack [i] dip swaack [4 [4] [[1 2] 3]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1157 " [[1 2] 3] [4] [pop] • swap cons swaack [i] dip swaack [4 [4] [[1 2] 3]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1158 " [[1 2] 3] [pop] [4] • cons swaack [i] dip swaack [4 [4] [[1 2] 3]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1159 " [[1 2] 3] [[pop] 4] • swaack [i] dip swaack [4 [4] [[1 2] 3]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1160 " 4 [pop] [[[1 2] 3]] • [i] dip swaack [4 [4] [[1 2] 3]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1161 " 4 [pop] [[[1 2] 3]] [i] • dip swaack [4 [4] [[1 2] 3]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1162 " 4 [pop] • i [[[1 2] 3]] swaack [4 [4] [[1 2] 3]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1163 " 4 • pop [[[1 2] 3]] swaack [4 [4] [[1 2] 3]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1164 " • [[[1 2] 3]] swaack [4 [4] [[1 2] 3]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1165 " [[[1 2] 3]] • swaack [4 [4] [[1 2] 3]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1166 " [[1 2] 3] [] • [4 [4] [[1 2] 3]] swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1167 " [[1 2] 3] [] [4 [4] [[1 2] 3]] • swaack first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1168 " [[1 2] 3] [4] 4 [[] [[1 2] 3]] • first popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1169 " [[1 2] 3] [4] 4 [] • popdd [[] ccons] [_step0] [dupdipd] dip x i\n",
1170 " [[1 2] 3] [4] 4 [] • [pop] dipd [[] ccons] [_step0] [dupdipd] dip x i\n",
1171 " [[1 2] 3] [4] 4 [] [pop] • dipd [[] ccons] [_step0] [dupdipd] dip x i\n",
1172 " [[1 2] 3] [4] 4 [] [pop] • [dip] codi [[] ccons] [_step0] [dupdipd] dip x i\n",
1173 " [[1 2] 3] [4] 4 [] [pop] [dip] • codi [[] ccons] [_step0] [dupdipd] dip x i\n",
1174 " [[1 2] 3] [4] 4 [] [pop] [dip] • cons dip [[] ccons] [_step0] [dupdipd] dip x i\n",
1175 " [[1 2] 3] [4] 4 [] [[pop] dip] • dip [[] ccons] [_step0] [dupdipd] dip x i\n",
1176 " [[1 2] 3] [4] 4 • [pop] dip [] [[] ccons] [_step0] [dupdipd] dip x i\n",
1177 " [[1 2] 3] [4] 4 [pop] • dip [] [[] ccons] [_step0] [dupdipd] dip x i\n",
1178 " [[1 2] 3] [4] • pop 4 [] [[] ccons] [_step0] [dupdipd] dip x i\n",
1179 " [[1 2] 3] • 4 [] [[] ccons] [_step0] [dupdipd] dip x i\n",
1180 " [[1 2] 3] 4 • [] [[] ccons] [_step0] [dupdipd] dip x i\n",
1181 " [[1 2] 3] 4 [] • [[] ccons] [_step0] [dupdipd] dip x i\n",
1182 " [[1 2] 3] 4 [] [[] ccons] • [_step0] [dupdipd] dip x i\n",
1183 " [[1 2] 3] 4 [] [[] ccons] [_step0] • [dupdipd] dip x i\n",
1184 " [[1 2] 3] 4 [] [[] ccons] [_step0] [dupdipd] • dip x i\n",
1185 " [[1 2] 3] 4 [] [[] ccons] • dupdipd [_step0] x i\n",
1186 " [[1 2] 3] 4 [] [[] ccons] • dup dipd [_step0] x i\n",
1187 " [[1 2] 3] 4 [] [[] ccons] [[] ccons] • dipd [_step0] x i\n",
1188 " [[1 2] 3] 4 [] [[] ccons] [[] ccons] • [dip] codi [_step0] x i\n",
1189 " [[1 2] 3] 4 [] [[] ccons] [[] ccons] [dip] • codi [_step0] x i\n",
1190 " [[1 2] 3] 4 [] [[] ccons] [[] ccons] [dip] • cons dip [_step0] x i\n",
1191 " [[1 2] 3] 4 [] [[] ccons] [[[] ccons] dip] • dip [_step0] x i\n",
1192 " [[1 2] 3] 4 [] • [[] ccons] dip [[] ccons] [_step0] x i\n",
1193 " [[1 2] 3] 4 [] [[] ccons] • dip [[] ccons] [_step0] x i\n",
1194 " [[1 2] 3] 4 • [] ccons [] [[] ccons] [_step0] x i\n",
1195 " [[1 2] 3] 4 [] • ccons [] [[] ccons] [_step0] x i\n",
1196 " [[1 2] 3] 4 [] • cons cons [] [[] ccons] [_step0] x i\n",
1197 " [[1 2] 3] [4] • cons [] [[] ccons] [_step0] x i\n",
1198 " [[[1 2] 3] 4] • [] [[] ccons] [_step0] x i\n",
1199 " [[[1 2] 3] 4] [] • [[] ccons] [_step0] x i\n",
1200 " [[[1 2] 3] 4] [] [[] ccons] • [_step0] x i\n",
1201 " [[[1 2] 3] 4] [] [[] ccons] [_step0] • x i\n",
1202 " [[[1 2] 3] 4] [] [[] ccons] [_step0] • dup i i\n",
1203 " [[[1 2] 3] 4] [] [[] ccons] [_step0] [_step0] • i i\n",
1204 " [[[1 2] 3] 4] [] [[] ccons] [_step0] • _step0 i\n",
1205 " [[[1 2] 3] 4] [] [[] ccons] [_step0] • _step1 [popopop] [_stept] branch i\n",
1206 " [[[1 2] 3] 4] [] [[] ccons] [_step0] • [?] dipd roll< [popopop] [_stept] branch i\n",
1207 " [[[1 2] 3] 4] [] [[] ccons] [_step0] [?] • dipd roll< [popopop] [_stept] branch i\n",
1208 " [[[1 2] 3] 4] [] [[] ccons] [_step0] [?] • [dip] codi roll< [popopop] [_stept] branch i\n",
1209 " [[[1 2] 3] 4] [] [[] ccons] [_step0] [?] [dip] • codi roll< [popopop] [_stept] branch i\n",
1210 " [[[1 2] 3] 4] [] [[] ccons] [_step0] [?] [dip] • cons dip roll< [popopop] [_stept] branch i\n",
1211 " [[[1 2] 3] 4] [] [[] ccons] [_step0] [[?] dip] • dip roll< [popopop] [_stept] branch i\n",
1212 " [[[1 2] 3] 4] [] [[] ccons] • [?] dip [_step0] roll< [popopop] [_stept] branch i\n",
1213 " [[[1 2] 3] 4] [] [[] ccons] [?] • dip [_step0] roll< [popopop] [_stept] branch i\n",
1214 " [[[1 2] 3] 4] [] • ? [[] ccons] [_step0] roll< [popopop] [_stept] branch i\n",
1215 " [[[1 2] 3] 4] [] • dup bool [[] ccons] [_step0] roll< [popopop] [_stept] branch i\n",
1216 " [[[1 2] 3] 4] [] [] • bool [[] ccons] [_step0] roll< [popopop] [_stept] branch i\n",
1217 " [[[1 2] 3] 4] [] false • [[] ccons] [_step0] roll< [popopop] [_stept] branch i\n",
1218 " [[[1 2] 3] 4] [] false [[] ccons] • [_step0] roll< [popopop] [_stept] branch i\n",
1219 " [[[1 2] 3] 4] [] false [[] ccons] [_step0] • roll< [popopop] [_stept] branch i\n",
1220 " [[[1 2] 3] 4] [] false [[] ccons] [_step0] • swapd swap [popopop] [_stept] branch i\n",
1221 " [[[1 2] 3] 4] [] false [[] ccons] [_step0] • [swap] dip swap [popopop] [_stept] branch i\n",
1222 " [[[1 2] 3] 4] [] false [[] ccons] [_step0] [swap] • dip swap [popopop] [_stept] branch i\n",
1223 " [[[1 2] 3] 4] [] false [[] ccons] • swap [_step0] swap [popopop] [_stept] branch i\n",
1224 " [[[1 2] 3] 4] [] [[] ccons] false • [_step0] swap [popopop] [_stept] branch i\n",
1225 " [[[1 2] 3] 4] [] [[] ccons] false [_step0] • swap [popopop] [_stept] branch i\n",
1226 " [[[1 2] 3] 4] [] [[] ccons] [_step0] false • [popopop] [_stept] branch i\n",
1227 " [[[1 2] 3] 4] [] [[] ccons] [_step0] false [popopop] • [_stept] branch i\n",
1228 " [[[1 2] 3] 4] [] [[] ccons] [_step0] false [popopop] [_stept] • branch i\n",
1229 " [[[1 2] 3] 4] [] [[] ccons] [_step0] • popopop i\n",
1230 " [[[1 2] 3] 4] [] [[] ccons] [_step0] • pop popop i\n",
1231 " [[[1 2] 3] 4] [] [[] ccons] • popop i\n",
1232 " [[[1 2] 3] 4] [] [[] ccons] • pop pop i\n",
1233 " [[[1 2] 3] 4] [] • pop i\n",
1234 " [[[1 2] 3] 4] • i\n",
1237 " [[1 2] 3] 4 • \n",
1244 "1 [2 3 4] [Z] trace"
1248 "cell_type": "code",
1249 "execution_count": 19,
1254 "output_type": "stream",
1263 "cell_type": "markdown",
1266 "And here it is doing the thing."
1270 "cell_type": "code",
1271 "execution_count": 20,
1276 "output_type": "stream",
1278 "[1 [2 [3 4 25 6] 7] 8] [sqr] [dip dip infra dip infra dip infra]"
1283 "[1 [2 [3 4 25 6] 7] 8] [sqr] [dip dip infra dip infra dip infra]"
1287 "cell_type": "code",
1288 "execution_count": null,
1292 " [[[] ccons] step i] trace"
1296 "cell_type": "markdown",
1300 "Because we are only using two combinators we could replace the list with a string made from only two characters.\n",
1302 " [...] [Q] 'ddididi' Zstr\n",
1303 " -------------------------------------------------------------\n",
1304 " [...] [[[[[[[Q] dip] dip] infra] dip] infra] dip] infra\n",
1306 "The string can be considered a name or address for an item in the subject datastructure.\n",
1308 "## Determining the right \"path\" for an item in a tree.\n",
1309 "It's easy to read off (in reverse) the right sequence of \"d\" and \"i\" from the subject datastructure:\n",
1311 " [ n [ n [ n n x ...\n",
1312 " i d i d i d d Bingo!"
1318 "display_name": "Joypy",
1323 "file_extension": ".joy",
1324 "mimetype": "text/plain",