{
"cell_type": "code",
"execution_count": 9,
- "metadata": {
- "collapsed": true
- },
+ "metadata": {},
"outputs": [
{
"name": "stdout",
},
{
"cell_type": "code",
- "execution_count": 8,
+ "execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
},
{
"cell_type": "code",
- "execution_count": 9,
+ "execution_count": 11,
"metadata": {},
"outputs": [
{
},
{
"cell_type": "code",
- "execution_count": 10,
+ "execution_count": 12,
"metadata": {},
"outputs": [
{
},
{
"cell_type": "code",
- "execution_count": 11,
- "metadata": {
- "collapsed": true
- },
+ "execution_count": 13,
+ "metadata": {},
"outputs": [
{
"name": "stdout",
},
{
"cell_type": "code",
- "execution_count": 12,
- "metadata": {
- "collapsed": true
- },
+ "execution_count": 14,
+ "metadata": {},
"outputs": [
{
"name": "stdout",
{
"cell_type": "code",
"execution_count": 26,
- "metadata": {
- "collapsed": true
- },
+ "metadata": {},
"outputs": [
{
"name": "stdout",
{
"cell_type": "code",
"execution_count": 27,
- "metadata": {
- "collapsed": true
- },
+ "metadata": {},
"outputs": [
{
"name": "stdout",
{
"cell_type": "code",
"execution_count": 28,
- "metadata": {
- "collapsed": true
- },
+ "metadata": {},
"outputs": [
{
"name": "stdout",
{
"cell_type": "code",
"execution_count": 29,
- "metadata": {
- "collapsed": true
- },
+ "metadata": {},
"outputs": [
{
"name": "stdout",
"\n",
"\"Too much is always better than not enough.\""
]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "# Tree with node and list of trees.\n",
- "\n",
- " tree = [] | [node [tree*]]"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### `treestep`\n",
- "\n",
- " tree z [C] [N] treestep\n",
- "\n",
- "\n",
- " [] z [C] [N] treestep\n",
- " ---------------------------\n",
- " z\n",
- "\n",
- "\n",
- " [node [tree*]] z [C] [N] treestep\n",
- " --------------------------------------- w/ K == z [C] [N] treestep\n",
- " node N [tree*] [K] map C"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Derive the recursive form.\n",
- " K == [not] [pop z] [J] ifte\n",
- "\n",
- "\n",
- " [node [tree*]] J\n",
- " ------------------------------\n",
- " node N [tree*] [K] map C\n",
- "\n",
- "\n",
- " J == .. [N] .. [K] .. [C] ..\n",
- "\n",
- " [node [tree*]] uncons [N] dip\n",
- " node [[tree*]] [N] dip\n",
- " node N [[tree*]]\n",
- "\n",
- " node N [[tree*]] i [K] map\n",
- " node N [tree*] [K] map\n",
- " node N [K.tree*]\n",
- "\n",
- " J == uncons [N] dip i [K] map [C] i\n",
- "\n",
- " K == [not] [pop z] [uncons [N] dip i [K] map [C] i] ifte\n",
- " K == [not] [pop z] [uncons [N] dip i] [map [C] i] genrec"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "### Extract the givens to parameterize the program.\n",
- " [not] [pop z] [uncons [N] dip unquote] [map [C] i] genrec\n",
- " [not] [z] [pop] swoncat [uncons [N] dip unquote] [map [C] i] genrec\n",
- " [not] z unit [pop] swoncat [uncons [N] dip unquote] [map [C] i] genrec\n",
- " z [not] swap unit [pop] swoncat [uncons [N] dip unquote] [map [C] i] genrec\n",
- " \\............TS0............/\n",
- " z TS0 [uncons [N] dip unquote] [map [C] i] genrec\n",
- " z [uncons [N] dip unquote] [TS0] dip [map [C] i] genrec\n",
- " z [[N] dip unquote] [uncons] swoncat [TS0] dip [map [C] i] genrec\n",
- " z [N] [dip unquote] cons [uncons] swoncat [TS0] dip [map [C] i] genrec\n",
- " \\...........TS1.................../\n",
- " z [N] TS1 [TS0] dip [map [C] i] genrec\n",
- " z [N] [map [C] i] [TS1 [TS0] dip] dip genrec\n",
- " z [N] [map C ] [TS1 [TS0] dip] dip genrec\n",
- " z [N] [C] [map] swoncat [TS1 [TS0] dip] dip genrec\n",
- " z [C] [N] swap [map] swoncat [TS1 [TS0] dip] dip genrec"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- " TS0 == [not] swap unit [pop] swoncat\n",
- " TS1 == [dip i] cons [uncons] swoncat\n",
- " treestep == swap [map] swoncat [TS1 [TS0] dip] dip genrec"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- " [] 0 [C] [N] treestep\n",
- " ---------------------------\n",
- " 0\n",
- "\n",
- "\n",
- " [n [tree*]] 0 [sum +] [] treestep\n",
- " --------------------------------------------------\n",
- " n [tree*] [0 [sum +] [] treestep] map sum +"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 40,
- "metadata": {},
- "outputs": [],
- "source": [
- "DefinitionWrapper.add_definitions('''\n",
- "\n",
- " TS0 == [not] swap unit [pop] swoncat\n",
- " TS1 == [dip i] cons [uncons] swoncat\n",
- "treestep == swap [map] swoncat [TS1 [TS0] dip] dip genrec\n",
- "\n",
- "''', D)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 31,
- "metadata": {
- "collapsed": true
- },
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- " . [] 0 [sum +] [] treestep\n",
- " [] . 0 [sum +] [] treestep\n",
- " [] 0 . [sum +] [] treestep\n",
- " [] 0 [sum +] . [] treestep\n",
- " [] 0 [sum +] [] . treestep\n",
- " [] 0 [sum +] [] . swap [map] swoncat [TS1 [TS0] dip] dip genrec\n",
- " [] 0 [] [sum +] . [map] swoncat [TS1 [TS0] dip] dip genrec\n",
- " [] 0 [] [sum +] [map] . swoncat [TS1 [TS0] dip] dip genrec\n",
- " [] 0 [] [sum +] [map] . swap concat [TS1 [TS0] dip] dip genrec\n",
- " [] 0 [] [map] [sum +] . concat [TS1 [TS0] dip] dip genrec\n",
- " [] 0 [] [map sum +] . [TS1 [TS0] dip] dip genrec\n",
- " [] 0 [] [map sum +] [TS1 [TS0] dip] . dip genrec\n",
- " [] 0 [] . TS1 [TS0] dip [map sum +] genrec\n",
- " [] 0 [] . [dip i] cons [uncons] swoncat [TS0] dip [map sum +] genrec\n",
- " [] 0 [] [dip i] . cons [uncons] swoncat [TS0] dip [map sum +] genrec\n",
- " [] 0 [[] dip i] . [uncons] swoncat [TS0] dip [map sum +] genrec\n",
- " [] 0 [[] dip i] [uncons] . swoncat [TS0] dip [map sum +] genrec\n",
- " [] 0 [[] dip i] [uncons] . swap concat [TS0] dip [map sum +] genrec\n",
- " [] 0 [uncons] [[] dip i] . concat [TS0] dip [map sum +] genrec\n",
- " [] 0 [uncons [] dip i] . [TS0] dip [map sum +] genrec\n",
- " [] 0 [uncons [] dip i] [TS0] . dip [map sum +] genrec\n",
- " [] 0 . TS0 [uncons [] dip i] [map sum +] genrec\n",
- " [] 0 . [not] swap unit [pop] swoncat [uncons [] dip i] [map sum +] genrec\n",
- " [] 0 [not] . swap unit [pop] swoncat [uncons [] dip i] [map sum +] genrec\n",
- " [] [not] 0 . unit [pop] swoncat [uncons [] dip i] [map sum +] genrec\n",
- " [] [not] 0 . [] cons [pop] swoncat [uncons [] dip i] [map sum +] genrec\n",
- " [] [not] 0 [] . cons [pop] swoncat [uncons [] dip i] [map sum +] genrec\n",
- " [] [not] [0] . [pop] swoncat [uncons [] dip i] [map sum +] genrec\n",
- " [] [not] [0] [pop] . swoncat [uncons [] dip i] [map sum +] genrec\n",
- " [] [not] [0] [pop] . swap concat [uncons [] dip i] [map sum +] genrec\n",
- " [] [not] [pop] [0] . concat [uncons [] dip i] [map sum +] genrec\n",
- " [] [not] [pop 0] . [uncons [] dip i] [map sum +] genrec\n",
- " [] [not] [pop 0] [uncons [] dip i] . [map sum +] genrec\n",
- " [] [not] [pop 0] [uncons [] dip i] [map sum +] . genrec\n",
- " [] [not] [pop 0] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] . ifte\n",
- "[] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] [pop 0] [[]] [not] . infra first choice i\n",
- " [] . not [[pop 0] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] []] swaack first choice i\n",
- " True . [[pop 0] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] []] swaack first choice i\n",
- " True [[pop 0] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] []] . swaack first choice i\n",
- " [] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] [pop 0] [True] . first choice i\n",
- " [] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] [pop 0] True . choice i\n",
- " [] [pop 0] . i\n",
- " [] . pop 0\n",
- " . 0\n",
- " 0 . \n"
- ]
- }
- ],
- "source": [
- "V('[] 0 [sum +] [] treestep')"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 32,
- "metadata": {
- "collapsed": true
- },
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- " . [23 []] 0 [sum +] [] treestep\n",
- " [23 []] . 0 [sum +] [] treestep\n",
- " [23 []] 0 . [sum +] [] treestep\n",
- " [23 []] 0 [sum +] . [] treestep\n",
- " [23 []] 0 [sum +] [] . treestep\n",
- " [23 []] 0 [sum +] [] . swap [map] swoncat [TS1 [TS0] dip] dip genrec\n",
- " [23 []] 0 [] [sum +] . [map] swoncat [TS1 [TS0] dip] dip genrec\n",
- " [23 []] 0 [] [sum +] [map] . swoncat [TS1 [TS0] dip] dip genrec\n",
- " [23 []] 0 [] [sum +] [map] . swap concat [TS1 [TS0] dip] dip genrec\n",
- " [23 []] 0 [] [map] [sum +] . concat [TS1 [TS0] dip] dip genrec\n",
- " [23 []] 0 [] [map sum +] . [TS1 [TS0] dip] dip genrec\n",
- " [23 []] 0 [] [map sum +] [TS1 [TS0] dip] . dip genrec\n",
- " [23 []] 0 [] . TS1 [TS0] dip [map sum +] genrec\n",
- " [23 []] 0 [] . [dip i] cons [uncons] swoncat [TS0] dip [map sum +] genrec\n",
- " [23 []] 0 [] [dip i] . cons [uncons] swoncat [TS0] dip [map sum +] genrec\n",
- " [23 []] 0 [[] dip i] . [uncons] swoncat [TS0] dip [map sum +] genrec\n",
- " [23 []] 0 [[] dip i] [uncons] . swoncat [TS0] dip [map sum +] genrec\n",
- " [23 []] 0 [[] dip i] [uncons] . swap concat [TS0] dip [map sum +] genrec\n",
- " [23 []] 0 [uncons] [[] dip i] . concat [TS0] dip [map sum +] genrec\n",
- " [23 []] 0 [uncons [] dip i] . [TS0] dip [map sum +] genrec\n",
- " [23 []] 0 [uncons [] dip i] [TS0] . dip [map sum +] genrec\n",
- " [23 []] 0 . TS0 [uncons [] dip i] [map sum +] genrec\n",
- " [23 []] 0 . [not] swap unit [pop] swoncat [uncons [] dip i] [map sum +] genrec\n",
- " [23 []] 0 [not] . swap unit [pop] swoncat [uncons [] dip i] [map sum +] genrec\n",
- " [23 []] [not] 0 . unit [pop] swoncat [uncons [] dip i] [map sum +] genrec\n",
- " [23 []] [not] 0 . [] cons [pop] swoncat [uncons [] dip i] [map sum +] genrec\n",
- " [23 []] [not] 0 [] . cons [pop] swoncat [uncons [] dip i] [map sum +] genrec\n",
- " [23 []] [not] [0] . [pop] swoncat [uncons [] dip i] [map sum +] genrec\n",
- " [23 []] [not] [0] [pop] . swoncat [uncons [] dip i] [map sum +] genrec\n",
- " [23 []] [not] [0] [pop] . swap concat [uncons [] dip i] [map sum +] genrec\n",
- " [23 []] [not] [pop] [0] . concat [uncons [] dip i] [map sum +] genrec\n",
- " [23 []] [not] [pop 0] . [uncons [] dip i] [map sum +] genrec\n",
- " [23 []] [not] [pop 0] [uncons [] dip i] . [map sum +] genrec\n",
- " [23 []] [not] [pop 0] [uncons [] dip i] [map sum +] . genrec\n",
- " [23 []] [not] [pop 0] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] . ifte\n",
- "[23 []] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] [pop 0] [[23 []]] [not] . infra first choice i\n",
- " [23 []] . not [[pop 0] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] [23 []]] swaack first choice i\n",
- " False . [[pop 0] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] [23 []]] swaack first choice i\n",
- " False [[pop 0] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] [23 []]] . swaack first choice i\n",
- " [23 []] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] [pop 0] [False] . first choice i\n",
- " [23 []] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] [pop 0] False . choice i\n",
- " [23 []] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] . i\n",
- " [23 []] . uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +\n",
- " 23 [[]] . [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +\n",
- " 23 [[]] [] . dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +\n",
- " 23 . [[]] i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +\n",
- " 23 [[]] . i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +\n",
- " 23 . [] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +\n",
- " 23 [] . [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +\n",
- " 23 [] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] . map sum +\n",
- " 23 [] . sum +\n",
- " 23 [] . 0 [+] catamorphism +\n",
- " 23 [] 0 . [+] catamorphism +\n",
- " 23 [] 0 [+] . catamorphism +\n",
- " 23 [] 0 [+] . [[] =] roll> [uncons swap] swap hylomorphism +\n",
- " 23 [] 0 [+] [[] =] . roll> [uncons swap] swap hylomorphism +\n",
- " 23 [] [[] =] 0 [+] . [uncons swap] swap hylomorphism +\n",
- " 23 [] [[] =] 0 [+] [uncons swap] . swap hylomorphism +\n",
- " 23 [] [[] =] 0 [uncons swap] [+] . hylomorphism +\n",
- " 23 [] [[] =] 0 [uncons swap] [+] . [unit [pop] swoncat] dipd [dip] swoncat genrec +\n",
- " 23 [] [[] =] 0 [uncons swap] [+] [unit [pop] swoncat] . dipd [dip] swoncat genrec +\n",
- " 23 [] [[] =] 0 . unit [pop] swoncat [uncons swap] [+] [dip] swoncat genrec +\n",
- " 23 [] [[] =] 0 . [] cons [pop] swoncat [uncons swap] [+] [dip] swoncat genrec +\n",
- " 23 [] [[] =] 0 [] . cons [pop] swoncat [uncons swap] [+] [dip] swoncat genrec +\n",
- " 23 [] [[] =] [0] . [pop] swoncat [uncons swap] [+] [dip] swoncat genrec +\n",
- " 23 [] [[] =] [0] [pop] . swoncat [uncons swap] [+] [dip] swoncat genrec +\n",
- " 23 [] [[] =] [0] [pop] . swap concat [uncons swap] [+] [dip] swoncat genrec +\n",
- " 23 [] [[] =] [pop] [0] . concat [uncons swap] [+] [dip] swoncat genrec +\n",
- " 23 [] [[] =] [pop 0] . [uncons swap] [+] [dip] swoncat genrec +\n",
- " 23 [] [[] =] [pop 0] [uncons swap] . [+] [dip] swoncat genrec +\n",
- " 23 [] [[] =] [pop 0] [uncons swap] [+] . [dip] swoncat genrec +\n",
- " 23 [] [[] =] [pop 0] [uncons swap] [+] [dip] . swoncat genrec +\n",
- " 23 [] [[] =] [pop 0] [uncons swap] [+] [dip] . swap concat genrec +\n",
- " 23 [] [[] =] [pop 0] [uncons swap] [dip] [+] . concat genrec +\n",
- " 23 [] [[] =] [pop 0] [uncons swap] [dip +] . genrec +\n",
- " 23 [] [[] =] [pop 0] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] . ifte +\n",
- " 23 [] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [pop 0] [[] 23] [[] =] . infra first choice i +\n",
- " 23 [] . [] = [[pop 0] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [] 23] swaack first choice i +\n",
- " 23 [] [] . = [[pop 0] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [] 23] swaack first choice i +\n",
- " 23 True . [[pop 0] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [] 23] swaack first choice i +\n",
- " 23 True [[pop 0] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [] 23] . swaack first choice i +\n",
- " 23 [] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [pop 0] [True 23] . first choice i +\n",
- " 23 [] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [pop 0] True . choice i +\n",
- " 23 [] [pop 0] . i +\n",
- " 23 [] . pop 0 +\n",
- " 23 . 0 +\n",
- " 23 0 . +\n",
- " 23 . \n"
- ]
- }
- ],
- "source": [
- "V('[23 []] 0 [sum +] [] treestep')"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 33,
- "metadata": {
- "collapsed": true
- },
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- " . [23 [[2 []] [3 []]]] 0 [sum +] [] treestep\n",
- " [23 [[2 []] [3 []]]] . 0 [sum +] [] treestep\n",
- " [23 [[2 []] [3 []]]] 0 . [sum +] [] treestep\n",
- " [23 [[2 []] [3 []]]] 0 [sum +] . [] treestep\n",
- " [23 [[2 []] [3 []]]] 0 [sum +] [] . treestep\n",
- " [23 [[2 []] [3 []]]] 0 [sum +] [] . swap [map] swoncat [TS1 [TS0] dip] dip genrec\n",
- " [23 [[2 []] [3 []]]] 0 [] [sum +] . [map] swoncat [TS1 [TS0] dip] dip genrec\n",
- " [23 [[2 []] [3 []]]] 0 [] [sum +] [map] . swoncat [TS1 [TS0] dip] dip genrec\n",
- " [23 [[2 []] [3 []]]] 0 [] [sum +] [map] . swap concat [TS1 [TS0] dip] dip genrec\n",
- " [23 [[2 []] [3 []]]] 0 [] [map] [sum +] . concat [TS1 [TS0] dip] dip genrec\n",
- " [23 [[2 []] [3 []]]] 0 [] [map sum +] . [TS1 [TS0] dip] dip genrec\n",
- " [23 [[2 []] [3 []]]] 0 [] [map sum +] [TS1 [TS0] dip] . dip genrec\n",
- " [23 [[2 []] [3 []]]] 0 [] . TS1 [TS0] dip [map sum +] genrec\n",
- " [23 [[2 []] [3 []]]] 0 [] . [dip i] cons [uncons] swoncat [TS0] dip [map sum +] genrec\n",
- " [23 [[2 []] [3 []]]] 0 [] [dip i] . cons [uncons] swoncat [TS0] dip [map sum +] genrec\n",
- " [23 [[2 []] [3 []]]] 0 [[] dip i] . [uncons] swoncat [TS0] dip [map sum +] genrec\n",
- " [23 [[2 []] [3 []]]] 0 [[] dip i] [uncons] . swoncat [TS0] dip [map sum +] genrec\n",
- " [23 [[2 []] [3 []]]] 0 [[] dip i] [uncons] . swap concat [TS0] dip [map sum +] genrec\n",
- " [23 [[2 []] [3 []]]] 0 [uncons] [[] dip i] . concat [TS0] dip [map sum +] genrec\n",
- " [23 [[2 []] [3 []]]] 0 [uncons [] dip i] . [TS0] dip [map sum +] genrec\n",
- " [23 [[2 []] [3 []]]] 0 [uncons [] dip i] [TS0] . dip [map sum +] genrec\n",
- " [23 [[2 []] [3 []]]] 0 . TS0 [uncons [] dip i] [map sum +] genrec\n",
- " [23 [[2 []] [3 []]]] 0 . [not] swap unit [pop] swoncat [uncons [] dip i] [map sum +] genrec\n",
- " [23 [[2 []] [3 []]]] 0 [not] . swap unit [pop] swoncat [uncons [] dip i] [map sum +] genrec\n",
- " [23 [[2 []] [3 []]]] [not] 0 . unit [pop] swoncat [uncons [] dip i] [map sum +] genrec\n",
- " [23 [[2 []] [3 []]]] [not] 0 . [] cons [pop] swoncat [uncons [] dip i] [map sum +] genrec\n",
- " [23 [[2 []] [3 []]]] [not] 0 [] . cons [pop] swoncat [uncons [] dip i] [map sum +] genrec\n",
- " [23 [[2 []] [3 []]]] [not] [0] . [pop] swoncat [uncons [] dip i] [map sum +] genrec\n",
- " [23 [[2 []] [3 []]]] [not] [0] [pop] . swoncat [uncons [] dip i] [map sum +] genrec\n",
- " [23 [[2 []] [3 []]]] [not] [0] [pop] . swap concat [uncons [] dip i] [map sum +] genrec\n",
- " [23 [[2 []] [3 []]]] [not] [pop] [0] . concat [uncons [] dip i] [map sum +] genrec\n",
- " [23 [[2 []] [3 []]]] [not] [pop 0] . [uncons [] dip i] [map sum +] genrec\n",
- " [23 [[2 []] [3 []]]] [not] [pop 0] [uncons [] dip i] . [map sum +] genrec\n",
- " [23 [[2 []] [3 []]]] [not] [pop 0] [uncons [] dip i] [map sum +] . genrec\n",
- " [23 [[2 []] [3 []]]] [not] [pop 0] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] . ifte\n",
- " [23 [[2 []] [3 []]]] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] [pop 0] [[23 [[2 []] [3 []]]]] [not] . infra first choice i\n",
- " [23 [[2 []] [3 []]]] . not [[pop 0] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] [23 [[2 []] [3 []]]]] swaack first choice i\n",
- " False . [[pop 0] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] [23 [[2 []] [3 []]]]] swaack first choice i\n",
- " False [[pop 0] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] [23 [[2 []] [3 []]]]] . swaack first choice i\n",
- " [23 [[2 []] [3 []]]] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] [pop 0] [False] . first choice i\n",
- " [23 [[2 []] [3 []]]] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] [pop 0] False . choice i\n",
- " [23 [[2 []] [3 []]]] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] . i\n",
- " [23 [[2 []] [3 []]]] . uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +\n",
- " 23 [[[2 []] [3 []]]] . [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +\n",
- " 23 [[[2 []] [3 []]]] [] . dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +\n",
- " 23 . [[[2 []] [3 []]]] i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +\n",
- " 23 [[[2 []] [3 []]]] . i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +\n",
- " 23 . [[2 []] [3 []]] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +\n",
- " 23 [[2 []] [3 []]] . [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +\n",
- " 23 [[2 []] [3 []]] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] . map sum +\n",
- "23 [] [[[3 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first] . infra sum +\n",
- " . [[3 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " [[3 []] 23] . [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " [[3 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] . infra first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 [3 []] . [not] [pop 0] [uncons [] dip i] [map sum +] genrec [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 [3 []] [not] . [pop 0] [uncons [] dip i] [map sum +] genrec [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 [3 []] [not] [pop 0] . [uncons [] dip i] [map sum +] genrec [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 [3 []] [not] [pop 0] [uncons [] dip i] . [map sum +] genrec [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 [3 []] [not] [pop 0] [uncons [] dip i] [map sum +] . genrec [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 [3 []] [not] [pop 0] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] . ifte [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 [3 []] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] [pop 0] [[3 []] 23] [not] . infra first choice i [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 [3 []] . not [[pop 0] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] [3 []] 23] swaack first choice i [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 False . [[pop 0] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] [3 []] 23] swaack first choice i [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 False [[pop 0] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] [3 []] 23] . swaack first choice i [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 [3 []] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] [pop 0] [False 23] . first choice i [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 [3 []] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] [pop 0] False . choice i [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 [3 []] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] . i [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 [3 []] . uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [[]] . [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [[]] [] . dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 . [[]] i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [[]] . i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 . [] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] . [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] . map sum + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] . sum + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] . 0 [+] catamorphism + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] 0 . [+] catamorphism + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] 0 [+] . catamorphism + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] 0 [+] . [[] =] roll> [uncons swap] swap hylomorphism + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] 0 [+] [[] =] . roll> [uncons swap] swap hylomorphism + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] [[] =] 0 [+] . [uncons swap] swap hylomorphism + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] [[] =] 0 [+] [uncons swap] . swap hylomorphism + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] [[] =] 0 [uncons swap] [+] . hylomorphism + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] [[] =] 0 [uncons swap] [+] . [unit [pop] swoncat] dipd [dip] swoncat genrec + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] [[] =] 0 [uncons swap] [+] [unit [pop] swoncat] . dipd [dip] swoncat genrec + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] [[] =] 0 . unit [pop] swoncat [uncons swap] [+] [dip] swoncat genrec + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] [[] =] 0 . [] cons [pop] swoncat [uncons swap] [+] [dip] swoncat genrec + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] [[] =] 0 [] . cons [pop] swoncat [uncons swap] [+] [dip] swoncat genrec + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] [[] =] [0] . [pop] swoncat [uncons swap] [+] [dip] swoncat genrec + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] [[] =] [0] [pop] . swoncat [uncons swap] [+] [dip] swoncat genrec + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] [[] =] [0] [pop] . swap concat [uncons swap] [+] [dip] swoncat genrec + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] [[] =] [pop] [0] . concat [uncons swap] [+] [dip] swoncat genrec + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] [[] =] [pop 0] . [uncons swap] [+] [dip] swoncat genrec + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] [[] =] [pop 0] [uncons swap] . [+] [dip] swoncat genrec + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] [[] =] [pop 0] [uncons swap] [+] . [dip] swoncat genrec + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] [[] =] [pop 0] [uncons swap] [+] [dip] . swoncat genrec + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] [[] =] [pop 0] [uncons swap] [+] [dip] . swap concat genrec + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] [[] =] [pop 0] [uncons swap] [dip] [+] . concat genrec + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] [[] =] [pop 0] [uncons swap] [dip +] . genrec + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] [[] =] [pop 0] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] . ifte + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [pop 0] [[] 3 23] [[] =] . infra first choice i + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] . [] = [[pop 0] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [] 3 23] swaack first choice i + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] [] . = [[pop 0] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [] 3 23] swaack first choice i + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 True . [[pop 0] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [] 3 23] swaack first choice i + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 True [[pop 0] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [] 3 23] . swaack first choice i + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [pop 0] [True 3 23] . first choice i + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [pop 0] True . choice i + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] [pop 0] . i + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] . pop 0 + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 . 0 + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 0 . + [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 . [] swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 23 3 [] . swaack first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " [3 23] . first [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 3 . [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 3 [[2 []] 23] . [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] infra first [23] swaack sum +\n",
- " 3 [[2 []] 23] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] . infra first [23] swaack sum +\n",
- " 23 [2 []] . [not] [pop 0] [uncons [] dip i] [map sum +] genrec [3] swaack first [23] swaack sum +\n",
- " 23 [2 []] [not] . [pop 0] [uncons [] dip i] [map sum +] genrec [3] swaack first [23] swaack sum +\n",
- " 23 [2 []] [not] [pop 0] . [uncons [] dip i] [map sum +] genrec [3] swaack first [23] swaack sum +\n",
- " 23 [2 []] [not] [pop 0] [uncons [] dip i] . [map sum +] genrec [3] swaack first [23] swaack sum +\n",
- " 23 [2 []] [not] [pop 0] [uncons [] dip i] [map sum +] . genrec [3] swaack first [23] swaack sum +\n",
- " 23 [2 []] [not] [pop 0] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] . ifte [3] swaack first [23] swaack sum +\n",
- " 23 [2 []] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] [pop 0] [[2 []] 23] [not] . infra first choice i [3] swaack first [23] swaack sum +\n",
- " 23 [2 []] . not [[pop 0] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] [2 []] 23] swaack first choice i [3] swaack first [23] swaack sum +\n",
- " 23 False . [[pop 0] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] [2 []] 23] swaack first choice i [3] swaack first [23] swaack sum +\n",
- " 23 False [[pop 0] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] [2 []] 23] . swaack first choice i [3] swaack first [23] swaack sum +\n",
- " 23 [2 []] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] [pop 0] [False 23] . first choice i [3] swaack first [23] swaack sum +\n",
- " 23 [2 []] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] [pop 0] False . choice i [3] swaack first [23] swaack sum +\n",
- " 23 [2 []] [uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum +] . i [3] swaack first [23] swaack sum +\n",
- " 23 [2 []] . uncons [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum + [3] swaack first [23] swaack sum +\n",
- " 23 2 [[]] . [] dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum + [3] swaack first [23] swaack sum +\n",
- " 23 2 [[]] [] . dip i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum + [3] swaack first [23] swaack sum +\n",
- " 23 2 . [[]] i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum + [3] swaack first [23] swaack sum +\n",
- " 23 2 [[]] . i [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum + [3] swaack first [23] swaack sum +\n",
- " 23 2 . [] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] . [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] map sum + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] [[not] [pop 0] [uncons [] dip i] [map sum +] genrec] . map sum + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] . sum + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] . 0 [+] catamorphism + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] 0 . [+] catamorphism + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] 0 [+] . catamorphism + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] 0 [+] . [[] =] roll> [uncons swap] swap hylomorphism + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] 0 [+] [[] =] . roll> [uncons swap] swap hylomorphism + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] [[] =] 0 [+] . [uncons swap] swap hylomorphism + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] [[] =] 0 [+] [uncons swap] . swap hylomorphism + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] [[] =] 0 [uncons swap] [+] . hylomorphism + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] [[] =] 0 [uncons swap] [+] . [unit [pop] swoncat] dipd [dip] swoncat genrec + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] [[] =] 0 [uncons swap] [+] [unit [pop] swoncat] . dipd [dip] swoncat genrec + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] [[] =] 0 . unit [pop] swoncat [uncons swap] [+] [dip] swoncat genrec + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] [[] =] 0 . [] cons [pop] swoncat [uncons swap] [+] [dip] swoncat genrec + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] [[] =] 0 [] . cons [pop] swoncat [uncons swap] [+] [dip] swoncat genrec + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] [[] =] [0] . [pop] swoncat [uncons swap] [+] [dip] swoncat genrec + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] [[] =] [0] [pop] . swoncat [uncons swap] [+] [dip] swoncat genrec + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] [[] =] [0] [pop] . swap concat [uncons swap] [+] [dip] swoncat genrec + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] [[] =] [pop] [0] . concat [uncons swap] [+] [dip] swoncat genrec + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] [[] =] [pop 0] . [uncons swap] [+] [dip] swoncat genrec + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] [[] =] [pop 0] [uncons swap] . [+] [dip] swoncat genrec + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] [[] =] [pop 0] [uncons swap] [+] . [dip] swoncat genrec + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] [[] =] [pop 0] [uncons swap] [+] [dip] . swoncat genrec + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] [[] =] [pop 0] [uncons swap] [+] [dip] . swap concat genrec + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] [[] =] [pop 0] [uncons swap] [dip] [+] . concat genrec + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] [[] =] [pop 0] [uncons swap] [dip +] . genrec + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] [[] =] [pop 0] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] . ifte + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [pop 0] [[] 2 23] [[] =] . infra first choice i + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] . [] = [[pop 0] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [] 2 23] swaack first choice i + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] [] . = [[pop 0] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [] 2 23] swaack first choice i + [3] swaack first [23] swaack sum +\n",
- " 23 2 True . [[pop 0] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [] 2 23] swaack first choice i + [3] swaack first [23] swaack sum +\n",
- " 23 2 True [[pop 0] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [] 2 23] . swaack first choice i + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [pop 0] [True 2 23] . first choice i + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [pop 0] True . choice i + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] [pop 0] . i + [3] swaack first [23] swaack sum +\n",
- " 23 2 [] . pop 0 + [3] swaack first [23] swaack sum +\n",
- " 23 2 . 0 + [3] swaack first [23] swaack sum +\n",
- " 23 2 0 . + [3] swaack first [23] swaack sum +\n",
- " 23 2 . [3] swaack first [23] swaack sum +\n",
- " 23 2 [3] . swaack first [23] swaack sum +\n",
- " 3 [2 23] . first [23] swaack sum +\n",
- " 3 2 . [23] swaack sum +\n",
- " 3 2 [23] . swaack sum +\n",
- " 23 [2 3] . sum +\n",
- " 23 [2 3] . 0 [+] catamorphism +\n",
- " 23 [2 3] 0 . [+] catamorphism +\n",
- " 23 [2 3] 0 [+] . catamorphism +\n",
- " 23 [2 3] 0 [+] . [[] =] roll> [uncons swap] swap hylomorphism +\n",
- " 23 [2 3] 0 [+] [[] =] . roll> [uncons swap] swap hylomorphism +\n",
- " 23 [2 3] [[] =] 0 [+] . [uncons swap] swap hylomorphism +\n",
- " 23 [2 3] [[] =] 0 [+] [uncons swap] . swap hylomorphism +\n",
- " 23 [2 3] [[] =] 0 [uncons swap] [+] . hylomorphism +\n",
- " 23 [2 3] [[] =] 0 [uncons swap] [+] . [unit [pop] swoncat] dipd [dip] swoncat genrec +\n",
- " 23 [2 3] [[] =] 0 [uncons swap] [+] [unit [pop] swoncat] . dipd [dip] swoncat genrec +\n",
- " 23 [2 3] [[] =] 0 . unit [pop] swoncat [uncons swap] [+] [dip] swoncat genrec +\n",
- " 23 [2 3] [[] =] 0 . [] cons [pop] swoncat [uncons swap] [+] [dip] swoncat genrec +\n",
- " 23 [2 3] [[] =] 0 [] . cons [pop] swoncat [uncons swap] [+] [dip] swoncat genrec +\n",
- " 23 [2 3] [[] =] [0] . [pop] swoncat [uncons swap] [+] [dip] swoncat genrec +\n",
- " 23 [2 3] [[] =] [0] [pop] . swoncat [uncons swap] [+] [dip] swoncat genrec +\n",
- " 23 [2 3] [[] =] [0] [pop] . swap concat [uncons swap] [+] [dip] swoncat genrec +\n",
- " 23 [2 3] [[] =] [pop] [0] . concat [uncons swap] [+] [dip] swoncat genrec +\n",
- " 23 [2 3] [[] =] [pop 0] . [uncons swap] [+] [dip] swoncat genrec +\n",
- " 23 [2 3] [[] =] [pop 0] [uncons swap] . [+] [dip] swoncat genrec +\n",
- " 23 [2 3] [[] =] [pop 0] [uncons swap] [+] . [dip] swoncat genrec +\n",
- " 23 [2 3] [[] =] [pop 0] [uncons swap] [+] [dip] . swoncat genrec +\n",
- " 23 [2 3] [[] =] [pop 0] [uncons swap] [+] [dip] . swap concat genrec +\n",
- " 23 [2 3] [[] =] [pop 0] [uncons swap] [dip] [+] . concat genrec +\n",
- " 23 [2 3] [[] =] [pop 0] [uncons swap] [dip +] . genrec +\n",
- " 23 [2 3] [[] =] [pop 0] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] . ifte +\n",
- " 23 [2 3] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [pop 0] [[2 3] 23] [[] =] . infra first choice i +\n",
- " 23 [2 3] . [] = [[pop 0] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [2 3] 23] swaack first choice i +\n",
- " 23 [2 3] [] . = [[pop 0] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [2 3] 23] swaack first choice i +\n",
- " 23 False . [[pop 0] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [2 3] 23] swaack first choice i +\n",
- " 23 False [[pop 0] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [2 3] 23] . swaack first choice i +\n",
- " 23 [2 3] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [pop 0] [False 23] . first choice i +\n",
- " 23 [2 3] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [pop 0] False . choice i +\n",
- " 23 [2 3] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] . i +\n",
- " 23 [2 3] . uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip + +\n",
- " 23 2 [3] . swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip + +\n",
- " 23 [3] 2 . [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip + +\n",
- " 23 [3] 2 [[[] =] [pop 0] [uncons swap] [dip +] genrec] . dip + +\n",
- " 23 [3] . [[] =] [pop 0] [uncons swap] [dip +] genrec 2 + +\n",
- " 23 [3] [[] =] . [pop 0] [uncons swap] [dip +] genrec 2 + +\n",
- " 23 [3] [[] =] [pop 0] . [uncons swap] [dip +] genrec 2 + +\n",
- " 23 [3] [[] =] [pop 0] [uncons swap] . [dip +] genrec 2 + +\n",
- " 23 [3] [[] =] [pop 0] [uncons swap] [dip +] . genrec 2 + +\n",
- " 23 [3] [[] =] [pop 0] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] . ifte 2 + +\n",
- " 23 [3] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [pop 0] [[3] 23] [[] =] . infra first choice i 2 + +\n",
- " 23 [3] . [] = [[pop 0] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [3] 23] swaack first choice i 2 + +\n",
- " 23 [3] [] . = [[pop 0] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [3] 23] swaack first choice i 2 + +\n",
- " 23 False . [[pop 0] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [3] 23] swaack first choice i 2 + +\n",
- " 23 False [[pop 0] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [3] 23] . swaack first choice i 2 + +\n",
- " 23 [3] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [pop 0] [False 23] . first choice i 2 + +\n",
- " 23 [3] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [pop 0] False . choice i 2 + +\n",
- " 23 [3] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] . i 2 + +\n",
- " 23 [3] . uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip + 2 + +\n",
- " 23 3 [] . swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip + 2 + +\n",
- " 23 [] 3 . [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip + 2 + +\n",
- " 23 [] 3 [[[] =] [pop 0] [uncons swap] [dip +] genrec] . dip + 2 + +\n",
- " 23 [] . [[] =] [pop 0] [uncons swap] [dip +] genrec 3 + 2 + +\n",
- " 23 [] [[] =] . [pop 0] [uncons swap] [dip +] genrec 3 + 2 + +\n",
- " 23 [] [[] =] [pop 0] . [uncons swap] [dip +] genrec 3 + 2 + +\n",
- " 23 [] [[] =] [pop 0] [uncons swap] . [dip +] genrec 3 + 2 + +\n",
- " 23 [] [[] =] [pop 0] [uncons swap] [dip +] . genrec 3 + 2 + +\n",
- " 23 [] [[] =] [pop 0] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] . ifte 3 + 2 + +\n",
- " 23 [] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [pop 0] [[] 23] [[] =] . infra first choice i 3 + 2 + +\n",
- " 23 [] . [] = [[pop 0] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [] 23] swaack first choice i 3 + 2 + +\n",
- " 23 [] [] . = [[pop 0] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [] 23] swaack first choice i 3 + 2 + +\n",
- " 23 True . [[pop 0] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [] 23] swaack first choice i 3 + 2 + +\n",
- " 23 True [[pop 0] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [] 23] . swaack first choice i 3 + 2 + +\n",
- " 23 [] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [pop 0] [True 23] . first choice i 3 + 2 + +\n",
- " 23 [] [uncons swap [[[] =] [pop 0] [uncons swap] [dip +] genrec] dip +] [pop 0] True . choice i 3 + 2 + +\n",
- " 23 [] [pop 0] . i 3 + 2 + +\n",
- " 23 [] . pop 0 3 + 2 + +\n",
- " 23 . 0 3 + 2 + +\n",
- " 23 0 . 3 + 2 + +\n",
- " 23 0 3 . + 2 + +\n",
- " 23 3 . 2 + +\n",
- " 23 3 2 . + +\n",
- " 23 5 . +\n",
- " 28 . \n"
- ]
- }
- ],
- "source": [
- "V('[23 [[2 []] [3 []]]] 0 [sum +] [] treestep')"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 34,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "140\n"
- ]
- }
- ],
- "source": [
- "J('[23 [[2 [[23 [[2 []] [3 []]]][23 [[2 []] [3 []]]]]] [3 [[23 [[2 []] [3 []]]][23 [[2 []] [3 []]]]]]]] 0 [sum +] [] treestep')"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
- },
- {
- "cell_type": "code",
- "execution_count": 35,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "[]\n"
- ]
- }
- ],
- "source": [
- "J('[] [] [unit cons] [23 +] treestep')"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 36,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "[46 []]\n"
- ]
- }
- ],
- "source": [
- "J('[23 []] [] [unit cons] [23 +] treestep')"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 37,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "[46 [[25 []] [26 []]]]\n"
- ]
- }
- ],
- "source": [
- "J('[23 [[2 []] [3 []]]] [] [unit cons] [23 +] treestep')"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 38,
- "metadata": {},
- "outputs": [],
- "source": [
- "define('treemap == [] [unit cons] roll< treestep')"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 39,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "[46 [[25 []] [26 []]]]\n"
- ]
- }
- ],
- "source": [
- "J('[23 [[2 []] [3 []]]] [23 +] treemap')"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
}
],
"metadata": {