Adding like-sign bigints in Joy.

This commit is contained in:
Simon Forman 2022-10-11 11:37:38 -07:00
parent e7f4a021fe
commit 8bedb77462
2 changed files with 964 additions and 169 deletions

File diff suppressed because it is too large Load Diff

View File

@ -179,7 +179,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 4,
"metadata": {},
"outputs": [
{
@ -301,7 +301,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 1,
"metadata": {},
"outputs": [
{
@ -316,7 +316,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 2,
"metadata": {},
"outputs": [
{
@ -331,7 +331,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 5,
"metadata": {
"scrolled": false
},
@ -340,6 +340,160 @@
"name": "stdout",
"output_type": "stream",
"text": [
" 5 • range\n",
" 5 • [0 <=] [] [-- dup] [swons] hylomorphism\n",
" 5 [0 <=] • [] [-- dup] [swons] hylomorphism\n",
" 5 [0 <=] [] • [-- dup] [swons] hylomorphism\n",
" 5 [0 <=] [] [-- dup] • [swons] hylomorphism\n",
" 5 [0 <=] [] [-- dup] [swons] • hylomorphism\n",
" 5 [0 <=] [] [-- dup] [swons] • [unit [pop] swoncat] dipd [dip] swoncat genrec\n",
" 5 [0 <=] [] [-- dup] [swons] [unit [pop] swoncat] • dipd [dip] swoncat genrec\n",
" 5 [0 <=] [] • unit [pop] swoncat [-- dup] [swons] [dip] swoncat genrec\n",
" 5 [0 <=] [[]] • [pop] swoncat [-- dup] [swons] [dip] swoncat genrec\n",
" 5 [0 <=] [[]] [pop] • swoncat [-- dup] [swons] [dip] swoncat genrec\n",
" 5 [0 <=] [[]] [pop] • swap concat [-- dup] [swons] [dip] swoncat genrec\n",
" 5 [0 <=] [pop] [[]] • concat [-- dup] [swons] [dip] swoncat genrec\n",
" 5 [0 <=] [pop []] • [-- dup] [swons] [dip] swoncat genrec\n",
" 5 [0 <=] [pop []] [-- dup] • [swons] [dip] swoncat genrec\n",
" 5 [0 <=] [pop []] [-- dup] [swons] • [dip] swoncat genrec\n",
" 5 [0 <=] [pop []] [-- dup] [swons] [dip] • swoncat genrec\n",
" 5 [0 <=] [pop []] [-- dup] [swons] [dip] • swap concat genrec\n",
" 5 [0 <=] [pop []] [-- dup] [dip] [swons] • concat genrec\n",
" 5 [0 <=] [pop []] [-- dup] [dip swons] • genrec\n",
" 5 [0 <=] [pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] • ifte\n",
"5 [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] [pop []] [5] [0 <=] • infra first choice i\n",
" 5 • 0 <= [[pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] 5] swaack first choice i\n",
" 5 0 • <= [[pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] 5] swaack first choice i\n",
" 5 0 • le [[pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] 5] swaack first choice i\n",
" false • [[pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] 5] swaack first choice i\n",
" false [[pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] 5] • swaack first choice i\n",
" 5 [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] [pop []] [false] • first choice i\n",
" 5 [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] [pop []] false • choice i\n",
" 5 [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] • i\n",
" 5 • -- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons\n",
" 5 • 1 - dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons\n",
" 5 1 • - dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons\n",
" 5 1 • sub dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons\n",
" 4 • dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons\n",
" 4 4 • [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons\n",
" 4 4 [[0 <=] [pop []] [-- dup] [dip swons] genrec] • dip swons\n",
" 4 • [0 <=] [pop []] [-- dup] [dip swons] genrec 4 swons\n",
" 4 [0 <=] • [pop []] [-- dup] [dip swons] genrec 4 swons\n",
" 4 [0 <=] [pop []] • [-- dup] [dip swons] genrec 4 swons\n",
" 4 [0 <=] [pop []] [-- dup] • [dip swons] genrec 4 swons\n",
" 4 [0 <=] [pop []] [-- dup] [dip swons] • genrec 4 swons\n",
" 4 [0 <=] [pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] • ifte 4 swons\n",
"4 [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] [pop []] [4] [0 <=] • infra first choice i 4 swons\n",
" 4 • 0 <= [[pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] 4] swaack first choice i 4 swons\n",
" 4 0 • <= [[pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] 4] swaack first choice i 4 swons\n",
" 4 0 • le [[pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] 4] swaack first choice i 4 swons\n",
" false • [[pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] 4] swaack first choice i 4 swons\n",
" false [[pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] 4] • swaack first choice i 4 swons\n",
" 4 [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] [pop []] [false] • first choice i 4 swons\n",
" 4 [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] [pop []] false • choice i 4 swons\n",
" 4 [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] • i 4 swons\n",
" 4 • -- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons 4 swons\n",
" 4 • 1 - dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons 4 swons\n",
" 4 1 • - dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons 4 swons\n",
" 4 1 • sub dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons 4 swons\n",
" 3 • dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons 4 swons\n",
" 3 3 • [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons 4 swons\n",
" 3 3 [[0 <=] [pop []] [-- dup] [dip swons] genrec] • dip swons 4 swons\n",
" 3 • [0 <=] [pop []] [-- dup] [dip swons] genrec 3 swons 4 swons\n",
" 3 [0 <=] • [pop []] [-- dup] [dip swons] genrec 3 swons 4 swons\n",
" 3 [0 <=] [pop []] • [-- dup] [dip swons] genrec 3 swons 4 swons\n",
" 3 [0 <=] [pop []] [-- dup] • [dip swons] genrec 3 swons 4 swons\n",
" 3 [0 <=] [pop []] [-- dup] [dip swons] • genrec 3 swons 4 swons\n",
" 3 [0 <=] [pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] • ifte 3 swons 4 swons\n",
"3 [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] [pop []] [3] [0 <=] • infra first choice i 3 swons 4 swons\n",
" 3 • 0 <= [[pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] 3] swaack first choice i 3 swons 4 swons\n",
" 3 0 • <= [[pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] 3] swaack first choice i 3 swons 4 swons\n",
" 3 0 • le [[pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] 3] swaack first choice i 3 swons 4 swons\n",
" false • [[pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] 3] swaack first choice i 3 swons 4 swons\n",
" false [[pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] 3] • swaack first choice i 3 swons 4 swons\n",
" 3 [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] [pop []] [false] • first choice i 3 swons 4 swons\n",
" 3 [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] [pop []] false • choice i 3 swons 4 swons\n",
" 3 [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] • i 3 swons 4 swons\n",
" 3 • -- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons 3 swons 4 swons\n",
" 3 • 1 - dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons 3 swons 4 swons\n",
" 3 1 • - dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons 3 swons 4 swons\n",
" 3 1 • sub dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons 3 swons 4 swons\n",
" 2 • dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons 3 swons 4 swons\n",
" 2 2 • [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons 3 swons 4 swons\n",
" 2 2 [[0 <=] [pop []] [-- dup] [dip swons] genrec] • dip swons 3 swons 4 swons\n",
" 2 • [0 <=] [pop []] [-- dup] [dip swons] genrec 2 swons 3 swons 4 swons\n",
" 2 [0 <=] • [pop []] [-- dup] [dip swons] genrec 2 swons 3 swons 4 swons\n",
" 2 [0 <=] [pop []] • [-- dup] [dip swons] genrec 2 swons 3 swons 4 swons\n",
" 2 [0 <=] [pop []] [-- dup] • [dip swons] genrec 2 swons 3 swons 4 swons\n",
" 2 [0 <=] [pop []] [-- dup] [dip swons] • genrec 2 swons 3 swons 4 swons\n",
" 2 [0 <=] [pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] • ifte 2 swons 3 swons 4 swons\n",
"2 [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] [pop []] [2] [0 <=] • infra first choice i 2 swons 3 swons 4 swons\n",
" 2 • 0 <= [[pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] 2] swaack first choice i 2 swons 3 swons 4 swons\n",
" 2 0 • <= [[pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] 2] swaack first choice i 2 swons 3 swons 4 swons\n",
" 2 0 • le [[pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] 2] swaack first choice i 2 swons 3 swons 4 swons\n",
" false • [[pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] 2] swaack first choice i 2 swons 3 swons 4 swons\n",
" false [[pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] 2] • swaack first choice i 2 swons 3 swons 4 swons\n",
" 2 [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] [pop []] [false] • first choice i 2 swons 3 swons 4 swons\n",
" 2 [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] [pop []] false • choice i 2 swons 3 swons 4 swons\n",
" 2 [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] • i 2 swons 3 swons 4 swons\n",
" 2 • -- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons 2 swons 3 swons 4 swons\n",
" 2 • 1 - dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons 2 swons 3 swons 4 swons\n",
" 2 1 • - dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons 2 swons 3 swons 4 swons\n",
" 2 1 • sub dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons 2 swons 3 swons 4 swons\n",
" 1 • dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons 2 swons 3 swons 4 swons\n",
" 1 1 • [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons 2 swons 3 swons 4 swons\n",
" 1 1 [[0 <=] [pop []] [-- dup] [dip swons] genrec] • dip swons 2 swons 3 swons 4 swons\n",
" 1 • [0 <=] [pop []] [-- dup] [dip swons] genrec 1 swons 2 swons 3 swons 4 swons\n",
" 1 [0 <=] • [pop []] [-- dup] [dip swons] genrec 1 swons 2 swons 3 swons 4 swons\n",
" 1 [0 <=] [pop []] • [-- dup] [dip swons] genrec 1 swons 2 swons 3 swons 4 swons\n",
" 1 [0 <=] [pop []] [-- dup] • [dip swons] genrec 1 swons 2 swons 3 swons 4 swons\n",
" 1 [0 <=] [pop []] [-- dup] [dip swons] • genrec 1 swons 2 swons 3 swons 4 swons\n",
" 1 [0 <=] [pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] • ifte 1 swons 2 swons 3 swons 4 swons\n",
"1 [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] [pop []] [1] [0 <=] • infra first choice i 1 swons 2 swons 3 swons 4 swons\n",
" 1 • 0 <= [[pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] 1] swaack first choice i 1 swons 2 swons 3 swons 4 swons\n",
" 1 0 • <= [[pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] 1] swaack first choice i 1 swons 2 swons 3 swons 4 swons\n",
" 1 0 • le [[pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] 1] swaack first choice i 1 swons 2 swons 3 swons 4 swons\n",
" false • [[pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] 1] swaack first choice i 1 swons 2 swons 3 swons 4 swons\n",
" false [[pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] 1] • swaack first choice i 1 swons 2 swons 3 swons 4 swons\n",
" 1 [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] [pop []] [false] • first choice i 1 swons 2 swons 3 swons 4 swons\n",
" 1 [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] [pop []] false • choice i 1 swons 2 swons 3 swons 4 swons\n",
" 1 [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] • i 1 swons 2 swons 3 swons 4 swons\n",
" 1 • -- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons 1 swons 2 swons 3 swons 4 swons\n",
" 1 • 1 - dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons 1 swons 2 swons 3 swons 4 swons\n",
" 1 1 • - dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons 1 swons 2 swons 3 swons 4 swons\n",
" 1 1 • sub dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons 1 swons 2 swons 3 swons 4 swons\n",
" 0 • dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons 1 swons 2 swons 3 swons 4 swons\n",
" 0 0 • [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons 1 swons 2 swons 3 swons 4 swons\n",
" 0 0 [[0 <=] [pop []] [-- dup] [dip swons] genrec] • dip swons 1 swons 2 swons 3 swons 4 swons\n",
" 0 • [0 <=] [pop []] [-- dup] [dip swons] genrec 0 swons 1 swons 2 swons 3 swons 4 swons\n",
" 0 [0 <=] • [pop []] [-- dup] [dip swons] genrec 0 swons 1 swons 2 swons 3 swons 4 swons\n",
" 0 [0 <=] [pop []] • [-- dup] [dip swons] genrec 0 swons 1 swons 2 swons 3 swons 4 swons\n",
" 0 [0 <=] [pop []] [-- dup] • [dip swons] genrec 0 swons 1 swons 2 swons 3 swons 4 swons\n",
" 0 [0 <=] [pop []] [-- dup] [dip swons] • genrec 0 swons 1 swons 2 swons 3 swons 4 swons\n",
" 0 [0 <=] [pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] • ifte 0 swons 1 swons 2 swons 3 swons 4 swons\n",
"0 [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] [pop []] [0] [0 <=] • infra first choice i 0 swons 1 swons 2 swons 3 swons 4 swons\n",
" 0 • 0 <= [[pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] 0] swaack first choice i 0 swons 1 swons 2 swons 3 swons 4 swons\n",
" 0 0 • <= [[pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] 0] swaack first choice i 0 swons 1 swons 2 swons 3 swons 4 swons\n",
" 0 0 • le [[pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] 0] swaack first choice i 0 swons 1 swons 2 swons 3 swons 4 swons\n",
" true • [[pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] 0] swaack first choice i 0 swons 1 swons 2 swons 3 swons 4 swons\n",
" true [[pop []] [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] 0] • swaack first choice i 0 swons 1 swons 2 swons 3 swons 4 swons\n",
" 0 [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] [pop []] [true] • first choice i 0 swons 1 swons 2 swons 3 swons 4 swons\n",
" 0 [-- dup [[0 <=] [pop []] [-- dup] [dip swons] genrec] dip swons] [pop []] true • choice i 0 swons 1 swons 2 swons 3 swons 4 swons\n",
" 0 [pop []] • i 0 swons 1 swons 2 swons 3 swons 4 swons\n",
" 0 • pop [] 0 swons 1 swons 2 swons 3 swons 4 swons\n",
" • [] 0 swons 1 swons 2 swons 3 swons 4 swons\n",
" [] • 0 swons 1 swons 2 swons 3 swons 4 swons\n",
" [] 0 • swons 1 swons 2 swons 3 swons 4 swons\n",
" [0] • 1 swons 2 swons 3 swons 4 swons\n",
" [0] 1 • swons 2 swons 3 swons 4 swons\n",
" [1 0] • 2 swons 3 swons 4 swons\n",
" [1 0] 2 • swons 3 swons 4 swons\n",
" [2 1 0] • 3 swons 4 swons\n",
" [2 1 0] 3 • swons 4 swons\n",
" [3 2 1 0] • 4 swons\n",
" [3 2 1 0] 4 • swons\n",
" [4 3 2 1 0] • \n",
"\n",
"[4 3 2 1 0]"
]
}