From 33cd4b7ebf12b70893a260e873839077be543bd5 Mon Sep 17 00:00:00 2001 From: Joseph Lukasik Date: Wed, 26 Sep 2018 22:24:50 -0700 Subject: [PATCH 01/78] Disable terminal echo on passcode entry --- vere/sist.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/vere/sist.c b/vere/sist.c index acd3ac9fd..4244027fe 100644 --- a/vere/sist.c +++ b/vere/sist.c @@ -295,14 +295,28 @@ _sist_cask(c3_c* dir_c, u3_noun nun) { c3_c paw_c[60]; u3_noun key; + u3_utty* uty_u = calloc(1, sizeof(u3_utty)); + uty_u->fid_i = 0; uH; + + // disable terminal echo when typing in passcode + if ( 0 != tcgetattr(uty_u->fid_i, &uty_u->bak_u) ) { + c3_assert(!"init-tcgetattr"); + } + uty_u->raw_u = uty_u->bak_u; + uty_u->raw_u.c_lflag &= ~ECHO; + if ( 0 != tcsetattr(uty_u->fid_i, TCSADRAIN, &uty_u->raw_u) ) { + c3_assert(!"init-tcsetattr"); + } + while ( 1 ) { printf("passcode for %s%s? ~", dir_c, (c3y == nun) ? " [none]" : ""); paw_c[0] = 0; c3_fpurge(stdin); fgets(paw_c, 59, stdin); + printf("\n"); if ( '\n' == paw_c[0] ) { if ( c3y == nun ) { @@ -334,6 +348,10 @@ _sist_cask(c3_c* dir_c, u3_noun nun) break; } } + if ( 0 != tcsetattr(uty_u->fid_i, TCSADRAIN, &uty_u->bak_u) ) { + c3_assert(!"init-tcsetattr"); + } + free(uty_u); uL(0); return key; } From 1c97747e7c1b5748826ff041b355f8c5840e5286 Mon Sep 17 00:00:00 2001 From: Robert Date: Fri, 16 Nov 2018 15:40:33 -0800 Subject: [PATCH 02/78] updates boot printfs --- noun/events.c | 10 +++++----- noun/vortex.c | 1 - vere/main.c | 15 +++++++++++++-- vere/sist.c | 42 +++++++++++++++++++++--------------------- 4 files changed, 39 insertions(+), 29 deletions(-) diff --git a/noun/events.c b/noun/events.c index 002ba9616..89201e0c0 100644 --- a/noun/events.c +++ b/noun/events.c @@ -858,16 +858,16 @@ u3e_live(c3_o nuu_o, c3_c* dir_c) /* Load any patch files; apply them to images. */ if ( 0 != (pat_u = _ce_patch_open()) ) { - printf("_ce_patch_apply\r\n"); + printf("boot: _ce_patch_apply\r\n"); _ce_patch_apply(pat_u); - printf("_ce_image_sync\r\n"); + printf("boot: _ce_image_sync\r\n"); _ce_image_sync(&u3P.nor_u); _ce_image_sync(&u3P.sou_u); - printf("_ce_patch_delete\r\n"); + printf("boot: _ce_patch_delete\r\n"); _ce_patch_delete(); - printf("_ce_patch_free\r\n"); + printf("boot: _ce_patch_free\r\n"); _ce_patch_free(pat_u); } @@ -886,7 +886,7 @@ u3e_live(c3_o nuu_o, c3_c* dir_c) perror("protect"); c3_assert(0); } - printf("protected loom\r\n"); + printf("boot: protected loom\r\n"); } /* If the images were empty, we are logically booting. diff --git a/noun/vortex.c b/noun/vortex.c index faec49d42..6b8b407ee 100644 --- a/noun/vortex.c +++ b/noun/vortex.c @@ -42,7 +42,6 @@ u3v_jack(void) fprintf(stderr, "jack: kernel %x\r\n", u3r_mug(u3A->ken)); cor = u3n_nock_on(0, u3k(u3A->ken)); - fprintf(stderr, "jacked\r\n"); u3z(cor); } diff --git a/vere/main.c b/vere/main.c index c96cf8fcf..c6c9d64b8 100644 --- a/vere/main.c +++ b/vere/main.c @@ -587,11 +587,22 @@ main(c3_i argc, printf("~\n"); // printf("welcome.\n"); printf("urbit %s\n", URBIT_VERSION); - printf("urbit: home is %s\n", u3_Host.dir_c); + int mprint_i = 1000; + c3_c* abs_c = (c3_c *)malloc(mprint_i); + + // allocates more memory as needed if the path is too large + // + while ( abs_c != getcwd(abs_c, mprint_i) ) { + free(abs_c); + mprint_i *= 2; + abs_c = (c3_c *)malloc(mprint_i); + } + printf("boot: home is %s/%s\n", abs_c, u3_Host.dir_c); + free(abs_c); // printf("vere: hostname is %s\n", u3_Host.ops_u.nam_c); if ( c3y == u3_Host.ops_u.dem && c3n == u3_Host.ops_u.bat ) { - printf("urbit: running as daemon\n"); + printf("boot: running as daemon\n"); } // Seed prng. Don't panic -- just for fuzz testing. diff --git a/vere/sist.c b/vere/sist.c index 9163dcd49..a1c0635f9 100644 --- a/vere/sist.c +++ b/vere/sist.c @@ -45,17 +45,17 @@ u3_sist_pack(c3_w tem_w, c3_w typ_w, c3_w* bob_w, c3_w len_w) if ( -1 == lseek64(lug_u->fid_i, 4ULL * tar_d, SEEK_SET) ) { perror("lseek"); - uL(fprintf(uH, "sist_pack: seek failed\n")); + uL(fprintf(uH, "sist: seek failed\n")); c3_assert(0); } if ( sizeof(lar_u) != write(lug_u->fid_i, &lar_u, sizeof(lar_u)) ) { perror("write"); - uL(fprintf(uH, "sist_pack: write failed\n")); + uL(fprintf(uH, "sist: write failed\n")); c3_assert(0); } if ( -1 == lseek64(lug_u->fid_i, 4ULL * lug_u->len_d, SEEK_SET) ) { perror("lseek"); - uL(fprintf(uH, "sist_pack: seek failed\n")); + uL(fprintf(uH, "sist: seek failed\n")); c3_assert(0); } #if 0 @@ -68,7 +68,7 @@ u3_sist_pack(c3_w tem_w, c3_w typ_w, c3_w* bob_w, c3_w len_w) #endif if ( (4 * len_w) != write(lug_u->fid_i, bob_w, (4 * len_w)) ) { perror("write"); - uL(fprintf(uH, "sist_pack: write failed\n")); + uL(fprintf(uH, "sist: write failed\n")); c3_assert(0); } lug_u->len_d += (c3_d)(lar_u.len_w + c3_wiseof(lar_u)); @@ -433,8 +433,8 @@ _sist_fast(u3_noun pas, c3_l key_l) u3_noun yek = u3dc("scot", 'p', pas); c3_c* yek_c = u3r_string(yek); - printf("saving passcode in %s/.urb/code.%s\r\n", hom_c, gum_c); - printf("(for real security, write it down and delete the file...)\r\n"); + printf("boot: saving passcode in %s/.urb/code.%s\r\n", hom_c, gum_c); + printf("boot: for real security, write it down and delete the file\r\n"); { c3_i fid_i; @@ -487,7 +487,7 @@ _sist_staf(c3_l key_l) u3z(say); return 0; } - uL(fprintf(uH, "loaded passcode from %s\n", ful_c)); + uL(fprintf(uH, "boot: loaded passcode from %s\n", ful_c)); pas = u3k(u3t(u3t(u3t(say)))); u3z(say); @@ -532,7 +532,7 @@ _sist_zest() if ( ((fid_i = open(ful_c, pig_i, 0600)) < 0) || (fstat(fid_i, &buf_b) < 0) ) { - uL(fprintf(uH, "can't create record (%s)\n", ful_c)); + uL(fprintf(uH, "zest: can't create record (%s)\n", ful_c)); u3_lo_bail(); } #ifdef F_NOCACHE @@ -613,7 +613,7 @@ _sist_rest_nuu(u3_ulog* lug_u, u3_uled led_u, c3_c* old_c) c3_assert(led_u.mag_l == u3r_mug('f')); if ( -1 == lseek64(fid_i, 4ULL * end_d, SEEK_SET) ) { - uL(fprintf(uH, "rest_nuu failed (a)\n")); + uL(fprintf(uH, "rest: rest_nuu failed (a)\n")); perror("lseek64"); u3_lo_bail(); } @@ -800,7 +800,7 @@ _sist_rest() u3_uled led_u; if ( sizeof(led_u) != read(fid_i, &led_u, sizeof(led_u)) ) { - uL(fprintf(uH, "record (%s) is corrupt (a)\n", ful_c)); + uL(fprintf(uH, "rest: record (%s) is corrupt (a)\n", ful_c)); u3_lo_bail(); } @@ -850,7 +850,7 @@ _sist_rest() key = _sist_fatt(sal_l, pas); if ( u3r_mug(key) != key_l ) { - uL(fprintf(uH, "incorrect passcode\n")); + uL(fprintf(uH, "rest: incorrect passcode\n")); u3z(key); pas = 0; } @@ -875,7 +875,7 @@ _sist_rest() if ( -1 == lseek64(fid_i, 4ULL * end_d, SEEK_SET) ) { fprintf(stderr, "end_d %" PRIu64 "\n", end_d); perror("lseek"); - uL(fprintf(uH, "record (%s) is corrupt (c)\n", ful_c)); + uL(fprintf(uH, "rest: record (%s) is corrupt (c)\n", ful_c)); u3_lo_bail(); } @@ -888,17 +888,17 @@ _sist_rest() // uL(fprintf(uH, "rest: reading event at %" PRIx64 "\n", end_d)); if ( -1 == lseek64(fid_i, 4ULL * tar_d, SEEK_SET) ) { - uL(fprintf(uH, "record (%s) is corrupt (d)\n", ful_c)); + uL(fprintf(uH, "rest: record (%s) is corrupt (d)\n", ful_c)); u3_lo_bail(); } if ( sizeof(u3_ular) != read(fid_i, &lar_u, sizeof(u3_ular)) ) { - uL(fprintf(uH, "record (%s) is corrupt (e)\n", ful_c)); + uL(fprintf(uH, "rest: record (%s) is corrupt (e)\n", ful_c)); u3_lo_bail(); } if ( lar_u.syn_w != u3r_mug_d(tar_d) ) { if ( c3n == rup ) { - uL(fprintf(uH, "corruption detected; attempting to fix\n")); + uL(fprintf(uH, "rest: corruption detected; attempting to fix\n")); rup = c3y; } uL(fprintf(uH, "lar:%x mug:%x\n", lar_u.syn_w, u3r_mug_d(tar_d))); @@ -906,7 +906,7 @@ _sist_rest() continue; } else if ( c3y == rup ) { - uL(fprintf(uH, "matched at %x\n", lar_u.syn_w)); + uL(fprintf(uH, "rest: matched at %x\n", lar_u.syn_w)); rup = c3n; } @@ -927,8 +927,8 @@ _sist_rest() } else { if ( lar_u.ent_d != (ent_d - 1ULL) ) { - uL(fprintf(uH, "record (%s) is corrupt (g)\n", ful_c)); - uL(fprintf(uH, "lar_u.ent_d %" PRIx64 ", ent_d %" PRIx64 "\n", lar_u.ent_d, ent_d)); + uL(fprintf(uH, "rest: record (%s) is corrupt (g)\n", ful_c)); + uL(fprintf(uH, "rest: lar_u.ent_d %" PRIx64 ", ent_d %" PRIx64 "\n", lar_u.ent_d, ent_d)); u3_lo_bail(); } ent_d -= 1ULL; @@ -943,11 +943,11 @@ _sist_rest() img_w = c3_malloc(4 * lar_u.len_w); if ( -1 == lseek64(fid_i, 4ULL * end_d, SEEK_SET) ) { - uL(fprintf(uH, "record (%s) is corrupt (h)\n", ful_c)); + uL(fprintf(uH, "rest: record (%s) is corrupt (h)\n", ful_c)); u3_lo_bail(); } if ( (4 * lar_u.len_w) != read(fid_i, img_w, (4 * lar_u.len_w)) ) { - uL(fprintf(uH, "record (%s) is corrupt (i)\n", ful_c)); + uL(fprintf(uH, "rest: record (%s) is corrupt (i)\n", ful_c)); u3_lo_bail(); } @@ -959,7 +959,7 @@ _sist_rest() u3r_mug_both(u3r_mug(lar_u.tem_w), u3r_mug(lar_u.typ_w))) ) { - uL(fprintf(uH, "record (%s) is corrupt (j)\n", ful_c)); + uL(fprintf(uH, "rest: record (%s) is corrupt (j)\n", ful_c)); u3_lo_bail(); } From 0f0f1db51d7e24f46f11091e1e7bd137deb5ac3b Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Thu, 27 Dec 2018 02:06:09 -0500 Subject: [PATCH 03/78] updates passcode entry to handle EOF, refactors --- vere/sist.c | 57 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 23 deletions(-) diff --git a/vere/sist.c b/vere/sist.c index 6a9c57ceb..6f9bbd0fc 100644 --- a/vere/sist.c +++ b/vere/sist.c @@ -268,16 +268,18 @@ _sist_sing(u3_noun ovo) /* _sist_cask(): ask for a passcode. */ static u3_noun -_sist_cask(c3_c* dir_c, u3_noun nun) +_sist_cask(c3_c* dir_c) { - c3_c paw_c[60]; u3_noun key; - u3_utty* uty_u = calloc(1, sizeof(u3_utty)); + c3_c paw_c[60]; + + u3_utty* uty_u = c3_calloc(sizeof(u3_utty)); uty_u->fid_i = 0; uH; - // disable terminal echo when typing in passcode + // disable terminal echo when typing in passcode + // if ( 0 != tcgetattr(uty_u->fid_i, &uty_u->bak_u) ) { c3_assert(!"init-tcgetattr"); } @@ -288,50 +290,59 @@ _sist_cask(c3_c* dir_c, u3_noun nun) } while ( 1 ) { - printf("passcode for %s%s? ~", dir_c, (c3y == nun) ? " [none]" : ""); + printf("passcode for %s? ~", dir_c); paw_c[0] = 0; c3_fpurge(stdin); fgets(paw_c, 59, stdin); printf("\n"); - if ( '\n' == paw_c[0] ) { - if ( c3y == nun ) { - key = 0; break; - } - else { - continue; - } + // exit on EOF (ie, ctrl-d) + // + if ( 0 == paw_c[0]) { + u3_lo_bail(); } - else { - c3_c* say_c = c3_malloc(strlen(paw_c) + 2); + + // re-prompt on early return + // + if ( '\n' == paw_c[0] ) { + continue; + } + + { + c3_c* say_c = c3_malloc(2 + strlen(paw_c)); u3_noun say; - say_c[0] = '~'; - say_c[1] = 0; + if ( '~' == paw_c[0] ) { + say_c[0] = 0; + } + else { + say_c[0] = '~'; + say_c[1] = 0; + } + strncat(say_c, paw_c, strlen(paw_c) - 1); - say = u3do("slay", u3i_string(say_c)); + say = u3dc("slaw", 'p', u3i_string(say_c)); free(say_c); - if ( (u3_nul == say) || - (u3_blip != u3h(u3t(say))) || - ('p' != u3h(u3t(u3t(say)))) ) - { + if ( u3_nul == say ) { printf("invalid passcode\n"); continue; } - key = u3k(u3t(u3t(u3t(say)))); + key = u3k(u3t(say)); u3z(say); break; } } + if ( 0 != tcsetattr(uty_u->fid_i, TCSADRAIN, &uty_u->bak_u) ) { c3_assert(!"init-tcsetattr"); } free(uty_u); uL(0); + return key; } @@ -825,7 +836,7 @@ _sist_rest() u3_noun key; while ( 1 ) { - pas = pas ? pas : _sist_cask(u3_Host.dir_c, c3n); + pas = pas ? pas : _sist_cask(u3_Host.dir_c); key = _sist_fatt(sal_l, pas); From 86a38cbb925baab1c05a639b84f2e8bb2cfb4858 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Mon, 31 Dec 2018 16:50:44 -0500 Subject: [PATCH 04/78] fixes u3_atom/c3_w mixup in +muk jet, refactors --- jets/c/muk.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/jets/c/muk.c b/jets/c/muk.c index 6d71aed1c..6d7d47571 100644 --- a/jets/c/muk.c +++ b/jets/c/muk.c @@ -16,20 +16,27 @@ c3_y *key_y; c3_w out_w; - c3_assert(u3r_met(5, seed) <= 1); - c3_assert(u3r_met(0, len) <= 31); - c3_assert(u3r_met(3, key) <= len); + c3_assert( u3r_met(5, seed) <= 1 ); + c3_assert( u3r_met(0, len) <= 31 ); + c3_assert( u3r_met(3, key) <= len ); seed_w = u3r_word(0, seed); len_w = u3r_word(0, len); - if (len_w > 0) { /* can't u3a_calloc 0 bytes */ - key_y = u3a_calloc(sizeof(c3_y), len); - } else { + + // can't u3a_calloc 0 bytes + // + if ( 0 == len_w ) { key_y = 0; } - u3r_bytes(0, len, key_y, key); + else { + key_y = u3a_calloc(sizeof(c3_y), len_w); + } - MurmurHash3_x86_32(key_y, len, seed_w, &out_w); + u3r_bytes(0, len_w, key_y, key); + + // XX we could skip the copy and use _mur_words() instead + // + MurmurHash3_x86_32(key_y, len_w, seed_w, &out_w); u3a_free(key_y); return u3i_words(1, &out_w); From f0fdfe118f8a3e2b0537c8e8c100b727edb8ce3d Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Mon, 31 Dec 2018 16:26:53 -0500 Subject: [PATCH 05/78] uncomments/fixes/finishes u3r_mur* functions --- include/noun/retrieve.h | 75 +++++++++++++++++++++++ noun/retrieve.c | 128 ++++++++++++++++++++++++++-------------- 2 files changed, 158 insertions(+), 45 deletions(-) diff --git a/include/noun/retrieve.h b/include/noun/retrieve.h index 3c63beb72..1de897b09 100644 --- a/include/noun/retrieve.h +++ b/include/noun/retrieve.h @@ -431,3 +431,78 @@ */ c3_y* u3r_tape(u3_noun a); + + // XX temporary + // + + /* u3r_mur(): + ** + ** Compute and/or recall the mug (31-bit hash) of (a). + */ + c3_w + u3r_mur(u3_noun a); + + /* u3r_mur_string(): + ** + ** Compute the mug of `a`, LSB first. + */ + c3_w + u3r_mur_string(const c3_c *a_c); + + /* u3r_mur_words(): + ** + ** Compute the mug of `buf`, `len`, LSW first. + */ + c3_w + u3r_mur_words(const c3_w *buf_w, + c3_w len_w); + + /* u3r_mur_d(): + ** + ** Compute the mug of `num`, LSW first. + */ + c3_w + u3r_mur_d(c3_d num_d); + + /* u3r_mur_bytes(): + ** + ** Compute the mug of `buf`, `len`, LSW first. + */ + c3_w + u3r_mur_bytes(const c3_y *buf_w, + c3_w len_w); + + /* u3r_mur_cell(): + ** + ** Compute the mug of `[a b]`. + */ + c3_w + u3r_mur_cell(u3_noun a, + u3_noun b); + + /* u3r_mur_trel(): + ** + ** Compute the mug of `[a b c]`. + */ + c3_w + u3r_mur_trel(u3_noun a, + u3_noun b, + u3_noun c); + + /* u3r_mur_qual(): + ** + ** Compute the mug of `[a b c d]`. + */ + c3_w + u3r_mur_qual(u3_noun a, + u3_noun b, + u3_noun c, + u3_noun d); + + /* u3r_mur_both(): + ** + ** Join two mugs. + */ + c3_w + u3r_mur_both(c3_w a_w, + c3_w b_w); \ No newline at end of file diff --git a/noun/retrieve.c b/noun/retrieve.c index 63287154b..a82704bb1 100644 --- a/noun/retrieve.c +++ b/noun/retrieve.c @@ -2,6 +2,7 @@ ** */ #include "all.h" +#include /* _frag_word(): fast fragment/branch prediction for top word. */ @@ -1710,9 +1711,6 @@ u3r_tape(u3_noun a) return a_y; } - -#if 0 - /* Finalization mix for better avalanching. */ static c3_w @@ -1754,10 +1752,10 @@ _mur_words(c3_w syd_w, const c3_w* key_w, c3_w len_w) return goc_w; } -/* u3_mur_words(): 31-bit nonzero MurmurHash3 on raw words. +/* u3r_mur_words(): 31-bit nonzero MurmurHash3 on raw words. */ c3_w -u3_mur_words(const c3_w* key_w, c3_w len_w) +u3r_mur_words(const c3_w* key_w, c3_w len_w) { c3_w syd_w = 0xcafebabe; @@ -1770,57 +1768,99 @@ u3_mur_words(const c3_w* key_w, c3_w len_w) } } -/* u3_mur_both(): +/* u3r_mur_bytes(): +** +** Compute the mug of `buf`, `len`, LSW first. +** XX temporary, reconcile with u3r_mur_words +*/ +c3_w +u3r_mur_bytes(const c3_y *buf_y, + c3_w len_w) +{ + c3_w syd_w = 0xcafebabe; + + while ( 1 ) { + c3_w haz_w, ham_w; + + MurmurHash3_x86_32(buf_y, len_w, syd_w, &haz_w); + ham_w = (haz_w >> 31) ^ (haz_w & 0x7fffffff); + + if ( 0 != ham_w ) return ham_w; + else syd_w++; + } +} + +/* u3r_mur_d(): +** +** Compute the mug of `num`, LSW first. +*/ +c3_w +u3r_mur_d(c3_d num_d) +{ + c3_w buf_w[2]; + + buf_w[0] = (c3_w)(num_d & 0xffffffffULL); + buf_w[1] = (c3_w)(num_d >> 32ULL); + + return u3r_mur_words(buf_w, 2); +} + +/* u3r_mur_both(): ** ** Join two murs. */ c3_w -u3_mur_both(c3_w lef_w, c3_w rit_w) +u3r_mur_both(c3_w lef_w, c3_w rit_w) { c3_w ham_w = lef_w ^ (0x7fffffff ^ rit_w); - return u3_mur_words(&ham_w, (0 == ham_w) ? 0 : 1); + return u3r_mur_words(&ham_w, (0 == ham_w) ? 0 : 1); } -/* u3_mur(): MurmurHash3 on a noun. +/* u3r_mur(): MurmurHash3 on a noun. */ c3_w -u3_mur(u3_noun veb) +u3r_mur(u3_noun veb) { - if ( u3_fly_is_cat(veb) ) { - return u3_mur_words(&veb, (0 == veb) ? 0 : 1); + c3_assert(u3_none != veb); + + if ( _(u3a_is_cat(veb)) ) { + return u3r_mur_words(&veb, (0 == veb) ? 0 : 1); } else { c3_w mur_w; - if ( (mur_w=*u3_at_dog_mur(veb)) ) { - return mur_w; - } + // u3a_noun* veb_u = u3a_to_ptr(veb); - if ( u3dog_is_pom(veb) ) { - mur_w = u3_mur_both(u3_mur(u3h(veb)), u3_mur(u3t(veb))); + // if ( veb_u->mug_w ) { + // return veb_u->mug_w; + // } + + if ( _(u3a_is_cell(veb)) ) { + mur_w = u3r_mur_both(u3r_mur(u3h(veb)), u3r_mur(u3t(veb))); } else { - c3_w len_w = u3_met(5, veb); + c3_w len_w = u3r_met(5, veb); c3_w* buf_w = malloc(4 * len_w); - u3_words(0, len_w, buf_w, veb); - mur_w = u3_mur_words(buf_w, len_w); + u3r_words(0, len_w, buf_w, veb); + mur_w = u3r_mur_words(buf_w, len_w); free(buf_w); } - *u3_at_dog_mur(veb) = mur_w; + // veb_u->mug_w = mur_w; + return mur_w; } } -/* u3_mur_string(): +/* u3r_mur_string(): ** ** Compute the mur of `a`, LSB first. */ c3_w -u3_mur_string(const c3_c *a_c) +u3r_mur_string(const c3_c *a_c) { c3_w len_w = strlen(a_c); c3_w wor_w = ((len_w + 3) >> 2); @@ -1835,48 +1875,46 @@ u3_mur_string(const c3_c *a_c) buf_w[inx_w] |= (a_c[i_w] << (8 * byt_w)); } - return u3_mur_words(buf_w, wor_w); + return u3r_mur_words(buf_w, wor_w); } -/* u3_mur_cell(): +/* u3r_mur_cell(): ** ** Compute the mur of the cell `[hed tel]`. */ c3_w -u3_mur_cell(u3_noun hed, - u3_noun tel) +u3r_mur_cell(u3_noun hed, + u3_noun tel) { - c3_w lus_w = u3_mur(hed); - c3_w biq_w = u3_mur(tel); + c3_w lus_w = u3r_mur(hed); + c3_w biq_w = u3r_mur(tel); - return u3_mur_both(lus_w, biq_w); + return u3r_mur_both(lus_w, biq_w); } -/* u3_mur_trel(): +/* u3r_mur_trel(): ** ** Compute the mur of `[a b c]`. */ c3_w -u3_mur_trel(u3_noun a, - u3_noun b, - u3_noun c) +u3r_mur_trel(u3_noun a, + u3_noun b, + u3_noun c) { - return u3_mur_both(u3_mur(a), u3_mur_both(u3_mur(b), u3_mur(c))); + return u3r_mur_both(u3r_mur(a), u3r_mur_both(u3r_mur(b), u3r_mur(c))); } -/* u3_mur_qual(): +/* u3r_mur_qual(): ** ** Compute the mur of `[a b c d]`. */ c3_w -u3_mur_qual(u3_noun a, - u3_noun b, - u3_noun c, - u3_noun d) +u3r_mur_qual(u3_noun a, + u3_noun b, + u3_noun c, + u3_noun d) { - return u3_mur_both(u3_mur(a), - u3_mur_both(u3_mur(b), - u3_mur_both(u3_mur(c), u3_mur(d)))); + return u3r_mur_both(u3r_mur(a), + u3r_mur_both(u3r_mur(b), + u3r_mur_both(u3r_mur(c), u3r_mur(d)))); } -#endif - From 30c55e88ab36ba2a1fc81356d2f809af7495d566 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Mon, 7 Jan 2019 17:02:49 -0500 Subject: [PATCH 06/78] refactors non-zero hash iteration in u3r_mur* --- noun/retrieve.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/noun/retrieve.c b/noun/retrieve.c index a82704bb1..4333d1618 100644 --- a/noun/retrieve.c +++ b/noun/retrieve.c @@ -1758,14 +1758,15 @@ c3_w u3r_mur_words(const c3_w* key_w, c3_w len_w) { c3_w syd_w = 0xcafebabe; + c3_w ham_w = 0; - while ( 1 ) { + while ( 0 == ham_w ) { c3_w haz_w = _mur_words(syd_w, key_w, len_w); - c3_w ham_w = (haz_w >> 31) ^ (haz_w & 0x7fffffff); - - if ( 0 != ham_w ) return ham_w; - else syd_w++; + ham_w = (haz_w >> 31) ^ (haz_w & 0x7fffffff); + syd_w++; } + + return ham_w; } /* u3r_mur_bytes(): @@ -1778,16 +1779,16 @@ u3r_mur_bytes(const c3_y *buf_y, c3_w len_w) { c3_w syd_w = 0xcafebabe; + c3_w ham_w = 0; - while ( 1 ) { - c3_w haz_w, ham_w; - + while ( 0 == ham_w ) { + c3_w haz_w; MurmurHash3_x86_32(buf_y, len_w, syd_w, &haz_w); ham_w = (haz_w >> 31) ^ (haz_w & 0x7fffffff); - - if ( 0 != ham_w ) return ham_w; - else syd_w++; + syd_w++; } + + return ham_w; } /* u3r_mur_d(): From 1974eca51524bd766c8ae9230b1909fea92174f6 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Mon, 7 Jan 2019 22:24:42 -0500 Subject: [PATCH 07/78] uses u3r_mur_bytes in all other u3r_mur* functions --- noun/retrieve.c | 92 ++++++------------------------------------------- 1 file changed, 11 insertions(+), 81 deletions(-) diff --git a/noun/retrieve.c b/noun/retrieve.c index 4333d1618..6b65f55cc 100644 --- a/noun/retrieve.c +++ b/noun/retrieve.c @@ -1711,68 +1711,17 @@ u3r_tape(u3_noun a) return a_y; } -/* Finalization mix for better avalanching. -*/ -static c3_w -_mur_fmix(c3_w h_w) -{ - h_w ^= h_w >> 16; - h_w *= 0x85ebca6b; - h_w ^= h_w >> 13; - h_w *= 0xc2b2ae35; - h_w ^= h_w >> 16; - - return h_w; -} - -/* _mur_words(): raw MurmurHash3 on raw words. -*/ -static c3_w -_mur_words(c3_w syd_w, const c3_w* key_w, c3_w len_w) -{ - c3_w goc_w = syd_w; - c3_w lig_w = 0xcc9e2d51; - c3_w duf_w = 0x1b873593; - c3_w i_w; - - for ( i_w = 0; i_w < len_w; i_w++ ) { - c3_w kop_w = key_w[i_w]; - - kop_w *= lig_w; - kop_w = c3_rotw(15, kop_w); - kop_w *= duf_w; - - goc_w ^= kop_w; - goc_w = c3_rotw(13, goc_w); - goc_w = (goc_w * 5) + 0xe6546b64; - } - goc_w ^= len_w; - goc_w = _mur_fmix(goc_w); - - return goc_w; -} - /* u3r_mur_words(): 31-bit nonzero MurmurHash3 on raw words. */ c3_w u3r_mur_words(const c3_w* key_w, c3_w len_w) { - c3_w syd_w = 0xcafebabe; - c3_w ham_w = 0; - - while ( 0 == ham_w ) { - c3_w haz_w = _mur_words(syd_w, key_w, len_w); - ham_w = (haz_w >> 31) ^ (haz_w & 0x7fffffff); - syd_w++; - } - - return ham_w; + return u3r_mur_bytes((c3_y*)key_w, 4 * len_w); } /* u3r_mur_bytes(): ** ** Compute the mug of `buf`, `len`, LSW first. -** XX temporary, reconcile with u3r_mur_words */ c3_w u3r_mur_bytes(const c3_y *buf_y, @@ -1794,16 +1743,12 @@ u3r_mur_bytes(const c3_y *buf_y, /* u3r_mur_d(): ** ** Compute the mug of `num`, LSW first. +** XX rename to u3r_mur_chub */ c3_w u3r_mur_d(c3_d num_d) { - c3_w buf_w[2]; - - buf_w[0] = (c3_w)(num_d & 0xffffffffULL); - buf_w[1] = (c3_w)(num_d >> 32ULL); - - return u3r_mur_words(buf_w, 2); + return u3r_mur_bytes((c3_y*)&num_d, 8); } /* u3r_mur_both(): @@ -1826,28 +1771,26 @@ u3r_mur(u3_noun veb) c3_assert(u3_none != veb); if ( _(u3a_is_cat(veb)) ) { - return u3r_mur_words(&veb, (0 == veb) ? 0 : 1); + c3_w len_w = u3r_met(3, veb); + return u3r_mur_bytes((c3_y*)&veb, len_w); } else { c3_w mur_w; - // u3a_noun* veb_u = u3a_to_ptr(veb); + u3a_noun* veb_u = u3a_to_ptr(veb); // if ( veb_u->mug_w ) { // return veb_u->mug_w; // } if ( _(u3a_is_cell(veb)) ) { - mur_w = u3r_mur_both(u3r_mur(u3h(veb)), u3r_mur(u3t(veb))); + mur_w = u3r_mur_cell(u3h(veb), u3t(veb)); } else { - c3_w len_w = u3r_met(5, veb); - c3_w* buf_w = malloc(4 * len_w); + u3a_atom* vat_u = (u3a_atom*)veb_u; + c3_w len_w = u3r_met(3, veb); - u3r_words(0, len_w, buf_w, veb); - mur_w = u3r_mur_words(buf_w, len_w); - - free(buf_w); + mur_w = u3r_mur_bytes((c3_y*)vat_u->buf_w, len_w); } // veb_u->mug_w = mur_w; @@ -1863,20 +1806,7 @@ u3r_mur(u3_noun veb) c3_w u3r_mur_string(const c3_c *a_c) { - c3_w len_w = strlen(a_c); - c3_w wor_w = ((len_w + 3) >> 2); - c3_w* buf_w = alloca(4 * wor_w); - c3_w i_w; - - for ( i_w = 0; i_w < wor_w; i_w++ ) { buf_w[i_w] = 0; } - - for ( i_w = 0; i_w < len_w; i_w++ ) { - c3_w inx_w = (i_w >> 2); - c3_w byt_w = (i_w & 3); - - buf_w[inx_w] |= (a_c[i_w] << (8 * byt_w)); - } - return u3r_mur_words(buf_w, wor_w); + return u3r_mur_bytes((c3_y*)a_c, strlen(a_c)); } /* u3r_mur_cell(): From 2240edd35400116a3113e5239cf7ae46cd33125e Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Mon, 7 Jan 2019 22:25:07 -0500 Subject: [PATCH 08/78] adds basic tests for u3r_mur --- meson.build | 12 ++++++-- tests/hash_tests.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 tests/hash_tests.c diff --git a/meson.build b/meson.build index 523ac3b25..0b0c35bd8 100644 --- a/meson.build +++ b/meson.build @@ -364,8 +364,6 @@ install: false) test('test-hashtable', test_hashtable) -test_mem_sources = noun_src + jets_all_src + vere_sans_main + ['tests/test.c'] - test_mem = executable('test-mem', sources : test_sources + ['tests/test.c'], include_directories : incdir, @@ -375,3 +373,13 @@ dependencies: deps + os_deps, install: false) test('test-mem', test_mem, should_fail: true) + +test_hash = executable('test-hash', +sources : test_sources + ['tests/hash_tests.c'], +include_directories : incdir, +c_args : os_c_flags, +link_args: os_link_flags, +dependencies: deps + os_deps, +install: false) + +test('test_hash', test_hash) diff --git a/tests/hash_tests.c b/tests/hash_tests.c new file mode 100644 index 000000000..6a11795ee --- /dev/null +++ b/tests/hash_tests.c @@ -0,0 +1,68 @@ +#include "all.h" + +/* _setup(): prepare for tests. +*/ +static void +_setup(void) +{ + u3m_init(c3y); + u3m_pave(c3y, c3n); +} + +/* _test_mur(): spot check u3r_mur hashes. +*/ +static void +_test_mur(void) +{ + if ( 0x4d441035 != u3r_mur_string("Hello, world!") ) { + fprintf(stderr, "fail\r\n"); + exit(1); + } + + if ( 0x4d441035 != u3r_mur(u3i_string("Hello, world!")) ) { + fprintf(stderr, "fail\r\n"); + exit(1); + } + + if ( 0x79ff04e8 != u3r_mur_bytes(0, 0) ) { + fprintf(stderr, "fail\r\n"); + exit(1); + } + + if ( 0x64dfda5c != u3r_mur(u3i_string("xxxxxxxxxxxxxxxxxxxxxxxxxxxx")) ) { + fprintf(stderr, "fail\r\n"); + exit(1); + } + + if ( 0x389ca03a != u3r_mur_cell(0, 0) ) { + fprintf(stderr, "fail\r\n"); + exit(1); + } + + if ( 0x389ca03a != u3r_mur_cell(1, 1) ) { + fprintf(stderr, "fail\r\n"); + exit(1); + } + + if ( 0x5258a6c0 != u3r_mur_cell(0, u3qc_bex(32)) ) { + fprintf(stderr, "fail\r\n"); + exit(1); + } + + if ( 0x2ad39968 != u3r_mur_cell(u3qa_dec(u3qc_bex(128)), 1) ) { + fprintf(stderr, "fail\r\n"); + exit(1); + } +} + +/* main(): run all test cases. +*/ +int +main(int argc, char* argv[]) +{ + _setup(); + + _test_mur(); + + return 0; +} From a906af1ca432b6fe7c3bb5915410c03af3efb619 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Fri, 4 Jan 2019 01:34:18 -0500 Subject: [PATCH 09/78] adds pristine jet copies (hash-order, containers, compiler) --- jets/stage/c/gor.c | 32 ++ jets/stage/c/hor.c | 46 +++ jets/stage/c/vor.c | 31 ++ jets/stage/d/by_bif.c | 82 ++++ jets/stage/d/by_del.c | 111 +++++ jets/stage/d/by_dif.c | 86 ++++ jets/stage/d/by_gas.c | 65 +++ jets/stage/d/by_get.c | 77 ++++ jets/stage/d/by_has.c | 61 +++ jets/stage/d/by_jab.c | 56 +++ jets/stage/d/by_put.c | 117 ++++++ jets/stage/d/in_bif.c | 76 ++++ jets/stage/d/in_del.c | 105 +++++ jets/stage/d/in_dif.c | 82 ++++ jets/stage/d/in_gas.c | 58 +++ jets/stage/d/in_has.c | 58 +++ jets/stage/d/in_mer.c | 80 ++++ jets/stage/d/in_put.c | 102 +++++ jets/stage/d/in_uni.c | 104 +++++ jets/stage/f/fork.c | 78 ++++ jets/stage/f/look.c | 134 ++++++ jets/stage/f/loot.c | 133 ++++++ jets/stage/f/ut.c | 100 +++++ jets/stage/f/ut_buss.c | 93 +++++ jets/stage/f/ut_conk.c | 88 ++++ jets/stage/f/ut_crop.c | 271 ++++++++++++ jets/stage/f/ut_find.c | 914 +++++++++++++++++++++++++++++++++++++++++ jets/stage/f/ut_fire.c | 200 +++++++++ jets/stage/f/ut_fish.c | 180 ++++++++ jets/stage/f/ut_fuse.c | 215 ++++++++++ jets/stage/f/ut_gain.c | 16 + jets/stage/f/ut_lose.c | 16 + jets/stage/f/ut_mint.c | 904 ++++++++++++++++++++++++++++++++++++++++ jets/stage/f/ut_mull.c | 852 ++++++++++++++++++++++++++++++++++++++ jets/stage/f/ut_nest.c | 560 +++++++++++++++++++++++++ jets/stage/f/ut_peek.c | 232 +++++++++++ jets/stage/f/ut_peel.c | 55 +++ jets/stage/f/ut_play.c | 606 +++++++++++++++++++++++++++ jets/stage/f/ut_repo.c | 70 ++++ jets/stage/f/ut_rest.c | 114 +++++ jets/stage/f/ut_tack.c | 21 + jets/stage/f/ut_toss.c | 97 +++++ jets/stage/f/ut_wrap.c | 97 +++++ 43 files changed, 7475 insertions(+) create mode 100644 jets/stage/c/gor.c create mode 100644 jets/stage/c/hor.c create mode 100644 jets/stage/c/vor.c create mode 100644 jets/stage/d/by_bif.c create mode 100644 jets/stage/d/by_del.c create mode 100644 jets/stage/d/by_dif.c create mode 100644 jets/stage/d/by_gas.c create mode 100644 jets/stage/d/by_get.c create mode 100644 jets/stage/d/by_has.c create mode 100644 jets/stage/d/by_jab.c create mode 100644 jets/stage/d/by_put.c create mode 100644 jets/stage/d/in_bif.c create mode 100644 jets/stage/d/in_del.c create mode 100644 jets/stage/d/in_dif.c create mode 100644 jets/stage/d/in_gas.c create mode 100644 jets/stage/d/in_has.c create mode 100644 jets/stage/d/in_mer.c create mode 100644 jets/stage/d/in_put.c create mode 100644 jets/stage/d/in_uni.c create mode 100644 jets/stage/f/fork.c create mode 100644 jets/stage/f/look.c create mode 100644 jets/stage/f/loot.c create mode 100644 jets/stage/f/ut.c create mode 100644 jets/stage/f/ut_buss.c create mode 100644 jets/stage/f/ut_conk.c create mode 100644 jets/stage/f/ut_crop.c create mode 100644 jets/stage/f/ut_find.c create mode 100644 jets/stage/f/ut_fire.c create mode 100644 jets/stage/f/ut_fish.c create mode 100644 jets/stage/f/ut_fuse.c create mode 100644 jets/stage/f/ut_gain.c create mode 100644 jets/stage/f/ut_lose.c create mode 100644 jets/stage/f/ut_mint.c create mode 100644 jets/stage/f/ut_mull.c create mode 100644 jets/stage/f/ut_nest.c create mode 100644 jets/stage/f/ut_peek.c create mode 100644 jets/stage/f/ut_peel.c create mode 100644 jets/stage/f/ut_play.c create mode 100644 jets/stage/f/ut_repo.c create mode 100644 jets/stage/f/ut_rest.c create mode 100644 jets/stage/f/ut_tack.c create mode 100644 jets/stage/f/ut_toss.c create mode 100644 jets/stage/f/ut_wrap.c diff --git a/jets/stage/c/gor.c b/jets/stage/c/gor.c new file mode 100644 index 000000000..8e89b5e8c --- /dev/null +++ b/jets/stage/c/gor.c @@ -0,0 +1,32 @@ +/* j/3/gor.c +** +*/ +#include "all.h" + + +/* functions +*/ + u3_noun + u3qc_gor(u3_noun a, + u3_noun b) + { + c3_w c_w = u3r_mug(a); + c3_w d_w = u3r_mug(b); + + if ( c_w == d_w ) { + return u3qc_dor(a, b); + } + else return (c_w < d_w) ? c3y : c3n; + } + u3_noun + u3wc_gor(u3_noun cor) + { + u3_noun a, b; + + if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) ) { + return u3m_bail(c3__exit); + } else { + return u3qc_gor(a, b); + } + } + diff --git a/jets/stage/c/hor.c b/jets/stage/c/hor.c new file mode 100644 index 000000000..052c53b82 --- /dev/null +++ b/jets/stage/c/hor.c @@ -0,0 +1,46 @@ +/* j/3/hor.c +** +*/ +#include "all.h" + + +/* functions +*/ + u3_noun + u3qc_hor(u3_noun a, + u3_noun b) + { + if ( c3y == u3ud(a) ) { + if ( c3y == u3ud(b) ) { + return u3qc_gor(a, b); + } else { + return c3y; + } + } else { + if ( c3y == u3ud(b) ) { + return c3n; + } + else { + u3_noun h_a = u3h(a); + u3_noun h_b = u3h(b); + + if ( c3y == u3r_sing(h_a, h_b) ) { + return u3qc_gor(u3t(a), u3t(b)); + } else { + return u3qc_gor(h_a, h_b); + } + } + } + } + u3_noun + u3wc_hor(u3_noun cor) + { + u3_noun a, b; + + if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) ) { + return u3m_bail(c3__exit); + } else { + return u3qc_hor(a, b); + } + } + diff --git a/jets/stage/c/vor.c b/jets/stage/c/vor.c new file mode 100644 index 000000000..28364140b --- /dev/null +++ b/jets/stage/c/vor.c @@ -0,0 +1,31 @@ +/* j/3/vor.c +** +*/ +#include "all.h" + + +/* functions +*/ + u3_noun + u3qc_vor(u3_atom a, + u3_atom b) + { + c3_w c_w = u3r_mug(u3r_mug(a)); + c3_w d_w = u3r_mug(u3r_mug(b)); + + if ( c_w == d_w ) { + return u3qc_dor(a, b); + } + else return (c_w < d_w) ? c3y : c3n; + } + u3_noun + u3wc_vor(u3_noun cor) + { + u3_noun a, b; + + if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) ) { + return u3m_bail(c3__exit); + } else { + return u3qc_vor(a, b); + } + } diff --git a/jets/stage/d/by_bif.c b/jets/stage/d/by_bif.c new file mode 100644 index 000000000..3e53ba6d6 --- /dev/null +++ b/jets/stage/d/by_bif.c @@ -0,0 +1,82 @@ +/* jets/d/by_bif.c +** +*/ +#include "all.h" + +/* internal functions +*/ + static + u3_noun _b_bif_putroot(u3_noun a, + u3_noun b) + { + if ( u3_nul == a) { + return u3nt(u3k(b), u3_nul, u3_nul); + } + else { + u3_noun n_a, l_a, r_a; + u3_noun p_n_a, q_n_a; + u3_noun p_b, q_b; + + if ( (c3n == u3r_trel(a, &n_a, &l_a, &r_a)) + || (c3n == u3r_cell(b, &p_b, &q_b)) + || (c3n == u3r_cell(n_a, &p_n_a, &q_n_a)) ) { + return u3m_bail(c3__exit); + } + else if ( c3y == u3r_sing(p_b, p_n_a) ) { + return u3nt(u3k(b), u3k(l_a), u3k(r_a)); + } + else { + u3_noun c, n_c, l_c, r_c; + u3_noun d; + + if ( c3y == u3qc_gor(p_b, p_n_a) ) { + c = _b_bif_putroot(l_a, b); + u3r_trel(c, &n_c, &l_c, &r_c); + d = u3nt(u3k(n_c), + u3k(l_c), + u3nt(u3k(n_a), u3k(r_c), u3k(r_a)) + ); + u3z(c); + return d; + } else { + c = _b_bif_putroot(r_a, b); + u3r_trel(c, &n_c, &l_c, &r_c); + d = u3nt(u3k(n_c), + u3nt(u3k(n_a), u3k(l_a), u3k(l_c)), + u3k(r_c) + ); + u3z(c); + return d; + } + } + } + } + +/* functions +*/ + u3_noun u3wdb_bif(u3_noun cor) + { + u3_noun a, b; + if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { + return u3m_bail(c3__exit); + } else { + return u3qdb_bif(a, b); + } + } + + u3_noun u3qdb_bif(u3_noun a, + u3_noun b) + { + u3_noun c, n_c, l_c, r_c; + u3_noun d; + + c = _b_bif_putroot(a, b); + u3r_trel(c, &n_c, &l_c, &r_c); + d = u3nc(u3k(l_c), u3k(r_c)); + u3z(c); + return d; + } + + /* + u3_weak u3kdi_bif(u3_noun a, u3_noun b); + */ diff --git a/jets/stage/d/by_del.c b/jets/stage/d/by_del.c new file mode 100644 index 000000000..90e11b37c --- /dev/null +++ b/jets/stage/d/by_del.c @@ -0,0 +1,111 @@ +/* j/4/by_del.c +** +*/ +#include "all.h" + +/* functions +*/ + static u3_noun + _rebalance(u3_noun a) + { + u3_noun l_a, n_a, r_a; + + if ( c3n == u3r_trel(a, &n_a, &l_a, &r_a) ) { + return u3m_bail(c3__exit); + } + else { + if ( u3_nul == l_a) { + return u3k(r_a); + } + else if ( u3_nul == r_a) { + return u3k(l_a); + } + else { + u3_noun n_l_a, l_l_a, r_l_a; + u3_noun n_r_a, l_r_a, r_r_a; + + if ( (c3n == u3r_trel(l_a, &n_l_a, &l_l_a, &r_l_a) ) || + (c3n == u3r_trel(r_a, &n_r_a, &l_r_a, &r_r_a) ) || + (c3n == u3du(n_l_a)) || + (c3n == u3du(n_r_a)) ) { + return u3m_bail(c3__exit); + } + else { + if ( c3y == u3qc_vor(u3h(n_l_a), u3h(n_r_a)) ) { + u3_noun new_right = u3nt(u3k(n_a), + u3k(r_l_a), + u3k(r_a)); + + u3_noun ret = u3nt(u3k(n_l_a), + u3k(l_l_a), + _rebalance(new_right)); + u3z(new_right); + + return ret; + } + else { + u3_noun new_left = u3nt(u3k(n_a), + u3k(l_a), + u3k(l_r_a)); + + u3_noun ret = u3nt(u3k(n_r_a), + _rebalance(new_left), + u3k(r_r_a)); + u3z(new_left); + + return ret; + } + } + } + } + } + + u3_noun + u3qdb_del(u3_noun a, + u3_noun b) + { + if ( u3_nul == a ) { + return u3_nul; + } + else { + u3_noun l_a, n_a, r_a, pn_a, qn_a; + + if ( (c3n == u3r_trel(a, &n_a, &l_a, &r_a)) || + (c3n == u3r_cell(n_a, &pn_a, &qn_a)) ) + { + return u3m_bail(c3__exit); + } + else if ( c3n == u3r_sing(pn_a, b) ) { + if ( c3y == u3qc_gor(b, pn_a) ) { + return u3nt(u3k(n_a), + u3qdb_del(l_a, b), + u3k(r_a)); + } + else { + return u3nt(u3k(n_a), + u3k(l_a), + u3qdb_del(r_a, b)); + } + } + else { + return _rebalance(a); + } + } + } + + u3_noun + u3wdb_del(u3_noun cor) + { + u3_noun a, b; + + if ( c3n == u3r_mean(cor, u3x_sam, &b, + u3x_con_sam, &a, 0) ) { + return u3m_bail(c3__exit); + } + else { + u3_noun n = u3qdb_del(a, b); + return n; + } + } + + diff --git a/jets/stage/d/by_dif.c b/jets/stage/d/by_dif.c new file mode 100644 index 000000000..7973a4f34 --- /dev/null +++ b/jets/stage/d/by_dif.c @@ -0,0 +1,86 @@ +/* jets/d/by_dif.c +** +*/ +#include "all.h" + +/* internal functions +*/ + static + u3_noun _b_dif_join(u3_noun d, + u3_noun e) + { + if ( u3_nul == d ) { + return u3k(e); + } else if (u3_nul == e) { + return u3k(d); + } else { + u3_noun n_d, l_d, r_d; + u3_noun n_e, l_e, r_e; + u3_noun p_n_d, q_n_d; + u3_noun p_n_e, q_n_e; + + if ( c3n == u3r_trel(d, &n_d, &l_d, &r_d) + || c3n == u3r_trel(e, &n_e, &l_e, &r_e) + || c3n == u3r_cell(n_d, &p_n_d, &q_n_d) + || c3n == u3r_cell(n_e, &p_n_e, &q_n_e) ) { + return u3m_bail(c3__exit); + } else { + if ( c3y == u3qc_vor(p_n_d, p_n_e) ) { + return u3nt(u3k(n_d), + u3k(l_d), + _b_dif_join(u3k(r_d), u3k(e))); + } else { + return u3nt(u3k(n_e), + _b_dif_join(u3k(d), u3k(l_e)), + u3k(r_e)); + } + } + } + } + +/* functions +*/ + u3_noun u3wdb_dif(u3_noun cor) + { + u3_noun a, b; + if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { + return u3m_bail(c3__exit); + } else { + return u3qdb_dif(a, b); + } + } + + u3_noun u3qdb_dif(u3_noun a, + u3_noun b) + { + if ( u3_nul == b ) { + return u3k(a); + } else { + u3_noun n_b, l_b, r_b; + u3_noun c, l_c, r_c; + + if ( c3n == u3r_trel(b, &n_b, &l_b, &r_b) ) { + return u3m_bail(c3__exit); + } else { + + c = u3qdb_bif(a, n_b); + + if ( c3n == u3r_cell(c, &l_c, &r_c) ) { + return u3m_bail(c3__exit); + } else { + u3_noun d; + u3_noun e; + + d = u3qdb_dif(l_c, l_b); + e = u3qdb_dif(r_c, r_b); + u3z(c); + + return _b_dif_join(d, e); + } + } + } + } + + /* + u3_weak u3kdb_dif(u3_noun a, u3_noun b); + */ diff --git a/jets/stage/d/by_gas.c b/jets/stage/d/by_gas.c new file mode 100644 index 000000000..caa7f5291 --- /dev/null +++ b/jets/stage/d/by_gas.c @@ -0,0 +1,65 @@ +/* j/4/gas.c +** +*/ +#include "all.h" + + +/* functions +*/ + u3_noun + u3qdb_gas(u3_noun a, + u3_noun b) + { + if ( u3_nul == b ) { + return u3k(a); + } + else { + if ( c3n == u3du(b) ) { + return u3m_bail(c3__exit); + } else { + u3_noun i_b = u3h(b); + u3_noun t_b = u3t(b); + + if ( c3n == u3du(i_b) ) { + return u3m_bail(c3__exit); + } else { + u3_noun pi_b = u3h(i_b); + u3_noun qi_b = u3t(i_b); + u3_noun c; + + if ( u3_none == (c = u3qdb_put(a, pi_b, qi_b)) ) { + return u3m_bail(c3__exit); + } else { + u3_noun d = u3qdb_gas(c, t_b); + + u3z(c); + return d; + } + } + } + } + } + u3_noun + u3wdb_gas(u3_noun cor) + { + u3_noun a, b; + + if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { + return u3m_bail(c3__exit); + } else { + return u3qdb_gas(a, b); + } + } + u3_noun + u3kdb_gas(u3_noun a, + u3_noun b) + { + u3_weak c = u3qdb_gas(a, b); + + u3z(a); u3z(b); + if ( u3_none == c ) { + return u3m_bail(c3__exit); + } + else return c; + } + diff --git a/jets/stage/d/by_get.c b/jets/stage/d/by_get.c new file mode 100644 index 000000000..588578764 --- /dev/null +++ b/jets/stage/d/by_get.c @@ -0,0 +1,77 @@ +/* j/4/by_get.c +** +*/ +#include "all.h" + + +/* functions +*/ + u3_noun + u3qdb_get(u3_noun a, + u3_noun b) + { + if ( u3_nul == a ) { + return u3_nul; + } + else { + u3_noun l_a, n_a, r_a; + u3_noun pn_a, qn_a; + + if ( (c3n == u3r_trel(a, &n_a, &l_a, &r_a)) || + (c3n == u3r_cell(n_a, &pn_a, &qn_a) ) ) + { + return u3m_bail(c3__exit); + } + else { + if ( (c3y == u3r_sing(b, pn_a)) ) { + return u3nc(u3_nul, u3k(qn_a)); + } + else { + if ( c3y == u3qc_gor(b, pn_a) ) { + return u3qdb_get(l_a, b); + } + else return u3qdb_get(r_a, b); + } + } + } + } + u3_noun + u3wdb_get(u3_noun cor) + { + u3_noun a, b; + + if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { + return u3m_bail(c3__exit); + } else { + return u3qdb_get(a, b); + } + } + u3_weak + u3kdb_get(u3_noun a, + u3_noun b) + { + u3_noun c = u3qdb_get(a, b); + + u3z(a); u3z(b); + if ( c3n == u3r_du(c) ) { + u3z(c); + return u3_none; + } else { + u3_noun pro = u3k(u3t(c)); + + u3z(c); + return pro; + } + } + u3_noun + u3kdb_got(u3_noun a, + u3_noun b) + { + u3_weak c = u3kdb_get(a, b); + + if ( u3_none == c ) { + return u3m_bail(c3__exit); + } + else return c; + } + diff --git a/jets/stage/d/by_has.c b/jets/stage/d/by_has.c new file mode 100644 index 000000000..0fa41bf3e --- /dev/null +++ b/jets/stage/d/by_has.c @@ -0,0 +1,61 @@ +/* j/4/by_has.c +** +*/ +#include "all.h" + + +/* functions +*/ + u3_noun + u3qdb_has(u3_noun a, + u3_noun b) + { + if ( u3_nul == a ) { + return c3n; + } + else { + u3_noun l_a, n_a, r_a; + u3_noun pn_a, qn_a; + + if ( (c3n == u3r_trel(a, &n_a, &l_a, &r_a)) || + (c3n == u3r_cell(n_a, &pn_a, &qn_a)) ) + { + return u3m_bail(c3__exit); + } + else { + if ( (c3y == u3r_sing(b, pn_a)) ) { + return c3y; + } + else { + if ( c3y == u3qc_gor(b, pn_a) ) { + return u3qdb_has(l_a, b); + } + else return u3qdb_has(r_a, b); + } + } + } + } + u3_noun + u3wdb_has(u3_noun cor) + { + u3_noun a, b; + + if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { + return u3m_bail(c3__exit); + } else { + return u3qdb_has(a, b); + } + } + u3_noun + u3kdb_has(u3_noun a, + u3_noun b) + { + u3_weak c = u3qdb_has(a, b); + + u3z(a); u3z(b); + if ( u3_none == c ) { + return u3m_bail(c3__exit); + } + else return c; + } + diff --git a/jets/stage/d/by_jab.c b/jets/stage/d/by_jab.c new file mode 100644 index 000000000..f147232a2 --- /dev/null +++ b/jets/stage/d/by_jab.c @@ -0,0 +1,56 @@ +/* j/4/by_jab.c +** +*/ +#include "all.h" + + +/* functions +*/ + u3_noun + u3qdb_jab(u3_noun a, + u3_noun key, + u3_noun fun) + { + if ( u3_nul == a ) { + return u3m_bail(c3__exit); + } + else { + u3_noun l_a, n_a, r_a; + u3_noun pn_a, qn_a; + + if ( (c3n == u3r_trel(a, &n_a, &l_a, &r_a)) || + (c3n == u3r_cell(n_a, &pn_a, &qn_a) ) ) + { + return u3m_bail(c3__exit); + } + else { + if ( (c3y == u3r_sing(key, pn_a)) ) { + u3_noun value = u3n_slam_on(u3k(fun), u3k(qn_a)); + return u3nc(u3nc(u3k(pn_a), value), u3k(u3t(a))); + } + else { + if ( c3y == u3qc_gor(key, pn_a) ) { + return u3nt(u3k(n_a), u3qdb_jab(l_a, key, fun), u3k(r_a)); + } + else { + return u3nt(u3k(n_a), u3k(l_a), u3qdb_jab(r_a, key, fun)); + } + } + } + } + } + + u3_noun + u3wdb_jab(u3_noun cor) + { + u3_noun a, key, fun; + + if ( c3n == u3r_mean(cor, u3x_sam_2, &key, + u3x_sam_3, &fun, + u3x_con_sam, &a, 0) ) { + return u3m_bail(c3__exit); + } else { + u3_noun n = u3qdb_jab(a, key, fun); + return n; + } + } diff --git a/jets/stage/d/by_put.c b/jets/stage/d/by_put.c new file mode 100644 index 000000000..5bafdc0c2 --- /dev/null +++ b/jets/stage/d/by_put.c @@ -0,0 +1,117 @@ +/* j/4/put.c +** +*/ +#include "all.h" + + +/* functions +*/ + u3_noun + u3qdb_put(u3_noun a, + u3_noun b, + u3_noun c) + { + if ( u3_nul == a ) { + return u3nt( + u3nc(u3k(b), + u3k(c)), + u3_nul, + u3_nul); + } + else { + u3_noun l_a, n_a, r_a, pn_a, qn_a; + u3_noun d, l_d, n_d, r_d; + + if ( (c3n == u3r_trel(a, &n_a, &l_a, &r_a)) || + (c3n == u3r_cell(n_a, &pn_a, &qn_a)) ) + { + return u3m_bail(c3__exit); + } + else if ( c3y == u3r_sing(pn_a, b) ) { + if ( c3y == u3r_sing(qn_a, c) ) { + return u3k(a); + } else { + return u3nt + (u3nc(u3k(b), u3k(c)), + u3k(l_a), + u3k(r_a)); + } + } + else { + if ( c3y == u3qc_gor(b, pn_a) ) { + d = u3qdb_put(l_a, b, c); + + if ( c3y == u3qc_vor(pn_a, u3h(u3h(d))) ) { + return u3nt(u3k(n_a), + d, + u3k(r_a)); + } + else { + u3r_trel(d, &n_d, &l_d, &r_d); + { + u3_noun e = u3nt + (u3k(n_d), + u3k(l_d), + u3nt(u3k(n_a), + u3k(r_d), + u3k(r_a))); + + u3z(d); + return e; + } + } + } + else { + d = u3qdb_put(r_a, b, c); + + if ( c3y == u3qc_vor(pn_a, u3h(u3h(d))) ) { + return u3nt(u3k(n_a), + u3k(l_a), + d); + } + else { + u3r_trel(d, &n_d, &l_d, &r_d); + { + u3_noun e = u3nt + (u3k(n_d), + u3nt(u3k(n_a), + u3k(l_a), + u3k(l_d)), + u3k(r_d)); + + u3z(d); + return e; + } + } + } + } + } + } + u3_noun + u3wdb_put(u3_noun cor) + { + u3_noun a, b, c; + + if ( c3n == u3r_mean(cor, u3x_sam_2, &b, + u3x_sam_3, &c, + u3x_con_sam, &a, 0) ) { + return u3m_bail(c3__exit); + } else { + return u3qdb_put(a, b, c); + } + } + u3_weak + u3kdb_put(u3_noun a, + u3_noun b, + u3_noun c) + { + // Bizarre asymmetry in old jets. + // + // (Mysterious comment in old glue code.) + // + u3_noun pro = u3qdb_put(a, b, c); + + u3z(a); u3z(b); u3z(c); + return pro; + } + diff --git a/jets/stage/d/in_bif.c b/jets/stage/d/in_bif.c new file mode 100644 index 000000000..4c5bdbeb9 --- /dev/null +++ b/jets/stage/d/in_bif.c @@ -0,0 +1,76 @@ +/* jets/d/in_bif.c +** +*/ +#include "all.h" + +/* internal functions +*/ + static + u3_noun _i_bif_putroot(u3_noun a, + u3_noun b) + { + if ( u3_nul == a) { + return u3nt(u3k(b), u3_nul, u3_nul); + } + else { + u3_noun n_a, l_a, r_a; + + if ( (c3n == u3r_trel(a, &n_a, &l_a, &r_a)) ) { + return u3m_bail(c3__exit); + } + else if ( c3y == u3r_sing(b, n_a) ) { + return u3k(a); + } + else { + u3_noun c, n_c, l_c, r_c; + u3_noun d; + + if ( c3y == u3qc_hor(b, n_a) ) { + c = _i_bif_putroot(l_a, b); + u3r_trel(c, &n_c, &l_c, &r_c); + d = u3nt(u3k(n_c), + u3k(l_c), + u3nt(u3k(n_a), u3k(r_c), u3k(r_a))); + u3z(c); + return d; + } else { + c = _i_bif_putroot(r_a, b); + u3r_trel(c, &n_c, &l_c, &r_c); + d = u3nt(u3k(n_c), + u3nt(u3k(n_a), u3k(l_a), u3k(l_c)), + u3k(r_c)); + u3z(c); + return d; + } + } + } + } + +/* functions +*/ + u3_noun u3wdi_bif(u3_noun cor) + { + u3_noun a, b; + if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { + return u3m_bail(c3__exit); + } else { + return u3qdi_bif(a, b); + } + } + + u3_noun u3qdi_bif(u3_noun a, + u3_noun b) + { + u3_noun c, n_c, l_c, r_c; + u3_noun d; + + c = _i_bif_putroot(a, b); + u3r_trel(c, &n_c, &l_c, &r_c); + d = u3nc(u3k(l_c), u3k(r_c)); + u3z(c); + return d; + } + + /* + u3_weak u3kdi_bif(u3_noun a, u3_noun b); + */ diff --git a/jets/stage/d/in_del.c b/jets/stage/d/in_del.c new file mode 100644 index 000000000..02390ccce --- /dev/null +++ b/jets/stage/d/in_del.c @@ -0,0 +1,105 @@ +/* j/4/in_del.c +** +*/ +#include "all.h" + +/* functions +*/ + static u3_noun + _rebalance(u3_noun a) + { + u3_noun l_a, n_a, r_a; + + if ( c3n == u3r_trel(a, &n_a, &l_a, &r_a) ) { + return u3m_bail(c3__exit); + } + else { + if ( u3_nul == l_a) { + return u3k(r_a); + } + else if ( u3_nul == r_a) { + return u3k(l_a); + } + else { + u3_noun n_l_a, l_l_a, r_l_a; + u3_noun n_r_a, l_r_a, r_r_a; + + if ( (c3n == u3r_trel(l_a, &n_l_a, &l_l_a, &r_l_a) ) || + (c3n == u3r_trel(r_a, &n_r_a, &l_r_a, &r_r_a) ) ) { + return u3m_bail(c3__exit); + } + else { + if ( c3y == u3qc_vor(n_l_a, n_r_a) ) { + u3_noun new_right = u3nt(u3k(n_a), + u3k(r_l_a), + u3k(r_a)); + + u3_noun ret = u3nt(u3k(n_l_a), + u3k(l_l_a), + _rebalance(new_right)); + u3z(new_right); + + return ret; + } + else { + u3_noun new_left = u3nt(u3k(n_a), + u3k(l_a), + u3k(l_r_a)); + + u3_noun ret = u3nt(u3k(n_r_a), + _rebalance(new_left), + u3k(r_r_a)); + u3z(new_left); + + return ret; + } + } + } + } + } + + u3_noun + u3qdi_del(u3_noun a, + u3_noun b) + { + if ( u3_nul == a ) { + return u3_nul; + } + else { + u3_noun l_a, n_a, r_a; + + if ( (c3n == u3r_trel(a, &n_a, &l_a, &r_a)) ) { + return u3m_bail(c3__exit); + } + else if ( c3n == u3r_sing(n_a, b) ) { + if ( c3y == u3qc_hor(b, n_a) ) { + return u3nt(u3k(n_a), + u3qdi_del(l_a, b), + u3k(r_a)); + } + else { + return u3nt(u3k(n_a), + u3k(l_a), + u3qdi_del(r_a, b)); + } + } + else { + return _rebalance(a); + } + } + } + + u3_noun + u3wdi_del(u3_noun cor) + { + u3_noun a, b; + + if ( c3n == u3r_mean(cor, u3x_sam, &b, + u3x_con_sam, &a, 0) ) { + return u3m_bail(c3__exit); + } + else { + u3_noun n = u3qdi_del(a, b); + return n; + } + } diff --git a/jets/stage/d/in_dif.c b/jets/stage/d/in_dif.c new file mode 100644 index 000000000..389cc1fa5 --- /dev/null +++ b/jets/stage/d/in_dif.c @@ -0,0 +1,82 @@ +/* jets/d/in_dif.c +** +*/ +#include "all.h" + +/* internal functions +*/ + static + u3_noun _i_dif_join(u3_noun d, + u3_noun e) + { + if ( u3_nul == d ) { + return u3k(e); + } else if (u3_nul == e) { + return u3k(d); + } else { + u3_noun n_d, l_d, r_d; + u3_noun n_e, l_e, r_e; + + if ( c3n == u3r_trel(d, &n_d, &l_d, &r_d) + || c3n == u3r_trel(e, &n_e, &l_e, &r_e) ) { + return u3m_bail(c3__exit); + } else { + if ( c3y == u3qc_vor(n_d, n_e) ) { + return u3nt(u3k(n_d), + u3k(l_d), + _i_dif_join(u3k(r_d), u3k(e))); + } else { + return u3nt(u3k(n_e), + _i_dif_join(u3k(d), u3k(l_e)), + u3k(r_e)); + } + } + } + } + +/* functions +*/ + u3_noun u3wdi_dif(u3_noun cor) + { + u3_noun a, b; + if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { + return u3m_bail(c3__exit); + } else { + return u3qdi_dif(a, b); + } + } + + u3_noun u3qdi_dif(u3_noun a, + u3_noun b) + { + if ( u3_nul == b ) { + return u3k(a); + } else { + u3_noun n_b, l_b, r_b; + u3_noun c, l_c, r_c; + + if ( c3n == u3r_trel(b, &n_b, &l_b, &r_b) ) { + return u3m_bail(c3__exit); + } else { + + c = u3qdi_bif(a, n_b); + + if ( c3n == u3r_cell(c, &l_c, &r_c) ) { + return u3m_bail(c3__exit); + } else { + u3_noun d; + u3_noun e; + + d = u3qdi_dif(l_c, l_b); + e = u3qdi_dif(r_c, r_b); + u3z(c); + + return _i_dif_join(d, e); + } + } + } + } + + /* + u3_weak u3kdi_dif(u3_noun a, u3_noun b); + */ diff --git a/jets/stage/d/in_gas.c b/jets/stage/d/in_gas.c new file mode 100644 index 000000000..f3f8d7372 --- /dev/null +++ b/jets/stage/d/in_gas.c @@ -0,0 +1,58 @@ +/* j/4/gas.c +** +*/ +#include "all.h" + + +/* functions +*/ + u3_noun + u3qdi_gas(u3_noun a, + u3_noun b) + { + if ( u3_nul == b ) { + return u3k(a); + } + else { + if ( c3n == u3du(b) ) { + return u3m_bail(c3__exit); + } else { + u3_noun i_b = u3h(b); + u3_noun t_b = u3t(b); + u3_noun c; + + if ( u3_none == (c = u3qdi_put(a, i_b)) ) { + return u3m_bail(c3__exit); + } else { + u3_noun d = u3qdi_gas(c, t_b); + + u3z(c); + return d; + } + } + } + } + u3_noun + u3wdi_gas(u3_noun cor) + { + u3_noun a, b; + + if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { + return u3m_bail(c3__exit); + } else { + return u3qdi_gas(a, b); + } + } + u3_noun + u3kdi_gas(u3_noun a, + u3_noun b) + { + u3_weak c = u3qdi_gas(a, b); + + u3z(a); u3z(b); + if ( u3_none == c ) { + return u3m_bail(c3__exit); + } + else return c; + } + diff --git a/jets/stage/d/in_has.c b/jets/stage/d/in_has.c new file mode 100644 index 000000000..fb142bc74 --- /dev/null +++ b/jets/stage/d/in_has.c @@ -0,0 +1,58 @@ +/* j/4/in_has.c +** +*/ +#include "all.h" + + +/* functions +*/ + u3_noun + u3qdi_has(u3_noun a, + u3_noun b) + { + if ( u3_nul == a ) { + return c3n; + } + else { + u3_noun l_a, n_a, r_a; + + if ( (c3n == u3r_mean(a, 2, &n_a, 6, &l_a, 7, &r_a, 0)) ) { + return u3m_bail(c3__exit); + } + else { + if ( (c3y == u3r_sing(b, n_a)) ) { + return c3y; + } + else { + if ( c3y == u3qc_hor(b, n_a) ) { + return u3qdi_has(l_a, b); + } + else return u3qdi_has(r_a, b); + } + } + } + } + u3_noun + u3wdi_has(u3_noun cor) + { + u3_noun a, b; + + if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { + return u3m_bail(c3__exit); + } else { + return u3qdi_has(a, b); + } + } + u3_noun + u3kdi_has(u3_noun a, + u3_noun b) + { + u3_weak c = u3qdi_has(a, b); + + u3z(a); u3z(b); + if ( u3_none == c ) { + return u3m_bail(c3__exit); + } + else return c; + } + diff --git a/jets/stage/d/in_mer.c b/jets/stage/d/in_mer.c new file mode 100644 index 000000000..14fa6675f --- /dev/null +++ b/jets/stage/d/in_mer.c @@ -0,0 +1,80 @@ +/* j/4/in_mer.c +** +*/ +#include "all.h" + + +/* functions +*/ + u3_noun + u3qdi_mer(u3_noun a, + u3_noun b) + { + if ( u3_nul == a ) { + return u3k(b); + } + else if ( u3_nul == b ) { + return u3k(a); + } + else { + u3_noun l_a, n_a, r_a, lr_a; // XX copy tree boilerplate to other pt4 + u3_noun l_b, n_b, r_b, lr_b; + u3_noun c; + + if ( (c3n == u3r_cell(a, &n_a, &lr_a)) ) { + return u3m_bail(c3__exit); + } + else if ( (c3n == u3r_cell(b, &n_b, &lr_b)) ) { + return u3m_bail(c3__exit); + } + else { + if ( c3y == u3qc_vor(n_b, n_a) ) { + c = a; a = b; b = c; + c = n_a; n_a = n_b; n_b = c; + c = lr_a; lr_a = lr_b; lr_b = c; + } + if ( c3n == u3r_cell(lr_a, &l_a, &r_a) ) { + return u3m_bail(c3__exit); + } + else if ( c3n == u3r_cell(lr_b, &l_b, &r_b) ) { + return u3m_bail(c3__exit); + } + else if ( c3y == u3r_sing(n_a, n_b) ) { + return u3nt(u3k(n_a), + u3qdi_mer(l_a, l_b), + u3qdi_mer(r_a, r_b)); + } + else if ( c3y == u3qc_hor(n_b, n_a) ) { + return u3qdi_mer(u3nt(n_a, + u3qdi_mer(l_a, + u3nt(n_b, + l_b, + u3_nul)), + r_a), + r_b); + } + else { + return u3qdi_mer(u3nt(n_a, + l_a, + u3qdi_mer(r_a, + u3nt(n_b, + u3_nul, + r_b))), + l_b); + } + } + } + } + + u3_noun + u3wdi_mer(u3_noun cor) + { + u3_noun a, b; + + if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { + return u3m_bail(c3__exit); + } + else { + return u3qdi_mer(a, b); + } + } diff --git a/jets/stage/d/in_put.c b/jets/stage/d/in_put.c new file mode 100644 index 000000000..10d2c4329 --- /dev/null +++ b/jets/stage/d/in_put.c @@ -0,0 +1,102 @@ +/* j/4/in_put.c +** +*/ +#include "all.h" + + +/* functions +*/ + u3_noun + u3qdi_put(u3_noun a, + u3_noun b) + { + if ( u3_nul == a ) { + return u3nt(u3k(b), u3_nul, u3_nul); + } + else { + u3_noun l_a, n_a, r_a, lr_a; // XX copy tree boilerplate to other pt4 + u3_noun c, l_c, n_c, r_c; + + if ( (c3n == u3r_cell(a, &n_a, &lr_a)) ) { + return u3m_bail(c3__exit); + } + else if ( c3y == u3r_sing(n_a, b) ) { + return u3k(a); + } + else if ( c3n == u3r_cell(lr_a, &l_a, &r_a) ) { + return u3m_bail(c3__exit); + } + else { + if ( c3y == u3qc_hor(b, n_a) ) { + c = u3qdi_put(l_a, b); + + if ( c3y == u3qc_vor(n_a, u3h(c)) ) { + return u3nt(u3k(n_a), + c, + u3k(r_a)); + } + else { + u3r_trel(c, &n_c, &l_c, &r_c); + { + u3_noun d = u3nt(u3k(n_c), + u3k(l_c), + u3nt(u3k(n_a), + u3k(r_c), + u3k(r_a))); + + u3z(c); + return d; + } + } + } + else { + c = u3qdi_put(r_a, b); + + if ( c3y == u3qc_vor(n_a, u3h(c)) ) { + return u3nt(u3k(n_a), + u3k(l_a), + c); + } + else { + u3r_trel(c, &n_c, &l_c, &r_c); + { + u3_noun d = u3nt(u3k(n_c), + u3nt(u3k(n_a), + u3k(l_a), + u3k(l_c)), + u3k(r_c)); + + u3z(c); + return d; + } + } + } + } + } + } + u3_noun + u3wdi_put(u3_noun cor) + { + u3_noun a, b; + + if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { + return u3m_bail(c3__exit); + } else { + return u3qdi_put(a, b); + } + } + u3_weak + u3kdi_put(u3_noun a, + u3_noun b) + { + // Bizarre asymmetry in old jets. + // + // (Mysterious comment in old glue code.) + // + u3_noun pro = u3qdi_put(a, b); + + u3z(a); u3z(b); + return pro; + } + + diff --git a/jets/stage/d/in_uni.c b/jets/stage/d/in_uni.c new file mode 100644 index 000000000..85f07b835 --- /dev/null +++ b/jets/stage/d/in_uni.c @@ -0,0 +1,104 @@ +/* j/4/in_uni.c +** +*/ +#include "all.h" + +/* internal functions +*/ + +static u3_noun +_in_uni(u3_noun a, u3_noun b) +{ + u3_noun n_a, l_a, r_a, + n_b, l_b, r_b, + neb, sub, naw, pro; + if ( u3_nul == a ) { + return u3k(b); + } + else if ( u3_nul == b ) { + return u3k(a); + } + else if ( (c3n == u3r_trel(a, &n_a, &l_a, &r_a)) + || (c3n == u3r_trel(b, &n_b, &l_b, &r_b)) ) + { + return u3m_bail(c3__exit); + } + else if ( c3n == u3qc_vor(n_a, n_b) ) { + if ( c3y == u3r_sing(n_a, n_b) ) { + return u3nt(u3k(n_b), _in_uni(l_a, l_b), _in_uni(r_a, r_b)); + } + else if ( c3y == u3qc_hor(n_a, n_b) ) { + naw = u3nt(u3k(n_a), u3k(l_a), u3_nul); + sub = _in_uni(naw, l_b); + neb = u3nt(u3k(n_b), sub, u3k(r_b)); + pro = _in_uni(r_a, neb); + u3z(naw); u3z(neb); + return pro; + } + else { + naw = u3nt(u3k(n_a), u3_nul, u3k(r_a)); + sub = _in_uni(naw, r_b); + neb = u3nt(u3k(n_b), u3k(l_b), sub); + pro = _in_uni(l_a, neb); + u3z(naw); u3z(neb); + return pro; + } + } + else if ( c3y == u3r_sing(n_b, n_a) ) { + return u3nt(u3k(n_b), _in_uni(l_a, l_b), _in_uni(r_a, r_b)); + } + else if ( c3y == u3qc_hor(n_b, n_a) ) { + neb = u3nt(u3k(n_b), u3k(l_b), u3_nul); + sub = _in_uni(l_a, neb); + naw = u3nt(u3k(n_a), sub, u3k(r_a)); + pro = _in_uni(naw, r_b); + u3z(neb); u3z(naw); + return pro; + } + else { + neb = u3nt(u3k(n_b), u3_nul, u3k(r_b)); + sub = _in_uni(r_a, neb); + naw = u3nt(u3k(n_a), u3k(l_a), sub); + pro = _in_uni(naw, l_b); + u3z(neb); u3z(naw); + return pro; + } +} + + +/* functions +*/ + u3_noun + u3kdi_uni(u3_noun a, + u3_noun b) + { + u3_noun c = u3qdi_uni(a, b); + + u3z(a); + u3z(b); + return c; + } + + u3_noun + u3qdi_uni(u3_noun a, + u3_noun b) + { + if ( c3y == u3r_sing(a, b) ) { + return u3k(a); + } + else { + return _in_uni(a, b); + } + } + u3_noun + u3wdi_uni(u3_noun cor) + { + u3_noun a, b; + + if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { + return u3m_bail(c3__exit); + } else { + return u3qdi_uni(a, b); + } + } + diff --git a/jets/stage/f/fork.c b/jets/stage/f/fork.c new file mode 100644 index 000000000..37aaad236 --- /dev/null +++ b/jets/stage/f/fork.c @@ -0,0 +1,78 @@ +/* j/6/fork.c +** +*/ +#include "all.h" + + +/* functions +*/ + u3_noun + u3qf_forq(u3_noun hoz, + u3_noun bur) + { + if ( c3y == u3r_sing(hoz, bur) ) { + return u3k(hoz); + } + else if ( c3__void == bur ) { + return u3k(hoz); + } + else if ( c3__void == hoz ) { + return u3k(bur); + } + else return u3kf_fork(u3nt(u3k(hoz), u3k(bur), u3_nul)); + } + + u3_noun + u3qf_fork(u3_noun yed) + { + u3_noun lez = u3_nul; + + while ( u3_nul != yed ) { + u3_noun i_yed = u3h(yed); + + if ( c3__void != i_yed ) { + if ( (c3y == u3du(i_yed)) && (c3__fork == u3h(i_yed)) ) { + lez = u3kdi_uni(lez, u3k(u3t(i_yed))); + } + else { + lez = u3kdi_put(lez, u3k(i_yed)); + } + } + + yed = u3t(yed); + } + + if ( u3_nul == lez ) { + return c3__void; + } + else if ( (u3_nul == u3h(u3t(lez))) && (u3_nul == u3t(u3t(lez))) ) { + u3_noun ret = u3k(u3h(lez)); + + u3z(lez); + return ret; + } + else { + return u3nc(c3__fork, lez); + } + } + + u3_noun + u3wf_fork(u3_noun cor) + { + u3_noun yed; + + if ( c3n == u3r_mean(cor, u3x_sam, &yed, 0) ) { + return u3m_bail(c3__fail); + } else { + return u3qf_fork(yed); + } + } + + u3_noun + u3kf_fork(u3_noun yed) + { + u3_noun ret = u3qf_fork(yed); + + u3z(yed); + return ret; + } diff --git a/jets/stage/f/look.c b/jets/stage/f/look.c new file mode 100644 index 000000000..b03df8770 --- /dev/null +++ b/jets/stage/f/look.c @@ -0,0 +1,134 @@ +/* j/6/look.c +** +*/ +#include "all.h" + + +/* internals +*/ + static u3_noun + _look_in(u3_noun cog, + u3_noun dab, + u3_atom axe) + { + if ( u3_nul == dab ) { + return u3_nul; + } + else { + u3_noun n_dab, l_dab, r_dab; + + u3r_trel(dab, &n_dab, &l_dab, &r_dab); + if ( c3n == u3du(n_dab) ) { + // return u3m_bail(c3__fail); + fprintf(stderr, "bad look\r\n"); + return u3m_bail(c3__exit) ; + } + else { + u3_noun pn_dab = u3h(n_dab); + u3_noun qn_dab = u3t(n_dab); + + if ( (u3_nul == l_dab) && (u3_nul == r_dab) ) { + if ( (c3y == u3du(qn_dab)) && + (c3y == u3r_sing(cog, pn_dab)) ) { + return u3nt(u3_nul, + u3k(axe), + u3k(qn_dab)); + } + else { + return u3_nul; + } + } + else if ( (u3_nul == l_dab) ) { + if ( (c3y == u3du(qn_dab)) && + (c3y == u3r_sing(cog, pn_dab)) ) { + return u3nt(u3_nul, + u3qc_peg(axe, 2), + u3k(qn_dab)); + } + else { + if ( c3y == u3qc_gor(cog, pn_dab) ) { + return u3_nul; + } + else { + u3_noun pro; + + axe = u3qc_peg(axe, 3); + pro = _look_in(cog, r_dab, axe); + u3z(axe); + return pro; + } + } + } + else if ( (u3_nul == r_dab) ) { + if ( (c3y == u3du(qn_dab)) && + (c3y == u3r_sing(cog, pn_dab)) ) { + return u3nt(u3_nul, + u3qc_peg(axe, 2), + u3k(qn_dab)); + } + else { + if ( c3y == u3qc_gor(cog, pn_dab) ) { + u3_noun pro; + + axe = u3qc_peg(axe, 3); + pro = _look_in(cog, l_dab, axe); + u3z(axe); + return pro; + } + else { + return u3_nul; + } + } + } + else { + if ( (c3y == u3du(qn_dab)) && + (c3y == u3r_sing(cog, pn_dab)) ) { + return u3nt(u3_nul, + u3qc_peg(axe, 2), + u3k(qn_dab)); + } + else { + if ( c3y == u3qc_gor(cog, pn_dab) ) { + u3_noun pro; + + axe = u3qc_peg(axe, 6); + pro = _look_in(cog, l_dab, axe); + u3z(axe); + return pro; + } + else { + u3_noun pro; + + axe = u3qc_peg(axe, 7); + pro = _look_in(cog, r_dab, axe); + u3z(axe); + return pro; + } + } + } + } + } + } + + + + +/* functions +*/ + u3_noun + u3qf_look(u3_noun cog, + u3_noun dab) + { + return _look_in(cog, dab, 1); + } + u3_noun + u3wf_look(u3_noun cor) + { + u3_noun cog, dab; + + if ( c3n == u3r_mean(cor, u3x_sam_2, &cog, u3x_sam_3, &dab, 0) ) { + return u3m_bail(c3__fail); + } else { + return u3qf_look(cog, dab); + } + } diff --git a/jets/stage/f/loot.c b/jets/stage/f/loot.c new file mode 100644 index 000000000..06abf7542 --- /dev/null +++ b/jets/stage/f/loot.c @@ -0,0 +1,133 @@ +/* j/6/loot.c +** +*/ +#include "all.h" + + +/* internals +*/ + static u3_noun + _loot_in(u3_noun cog, + u3_noun dom, + u3_atom axe) + { + if ( u3_nul == dom ) { + return u3_nul; + } + else { + u3_noun n_dom, l_dom, r_dom; + + u3r_trel(dom, &n_dom, &l_dom, &r_dom); + if ( c3n == u3du(n_dom) ) { + return u3m_bail(c3__fail); + } + else { + u3_noun qqn_dom = u3t(u3t(n_dom)); + u3_noun yep = u3qf_look(cog, qqn_dom); + + if ( (u3_nul == l_dom) && (u3_nul == r_dom) ) { + if ( u3_nul == yep ) { + return u3_nul; + } else { + u3_noun u_yep = u3t(yep); + u3_noun pro; + + pro = u3nt(u3_nul, u3qc_peg(axe, u3h(u_yep)), u3k(u3t(u_yep))); + u3z(yep); + return pro; + } + } + else if ( (u3_nul == l_dom) ) { + if ( u3_nul == yep ) { + u3_noun nax = u3qc_peg(axe, 3); + u3_noun pro; + + pro = _loot_in(cog, r_dom, nax); + u3z(nax); + return pro; + } + else { + u3_noun u_yep = u3t(yep); + u3_noun nax = u3qc_peg(axe, 2); + u3_noun pro; + + pro = u3nt(u3_nul, u3qc_peg(nax, u3h(u_yep)), u3k(u3t(u_yep))); + u3z(nax); + u3z(yep); + return pro; + } + } + else if ( (u3_nul == r_dom) ) { + if ( u3_nul == yep ) { + u3_noun nax = u3qc_peg(axe, 3); + u3_noun pro; + + pro = _loot_in(cog, l_dom, nax); + u3z(nax); + return pro; + } + else { + u3_noun u_yep = u3t(yep); + u3_noun nax = u3qc_peg(axe, 2); + u3_noun pro; + + pro = u3nt(u3_nul, u3qc_peg(nax, u3h(u_yep)), u3k(u3t(u_yep))); + u3z(nax); + u3z(yep); + return pro; + } + } + else { + if ( u3_nul == yep ) { + u3_noun nax = u3qc_peg(axe, 6); + u3_noun pey; + + pey = _loot_in(cog, l_dom, nax); + u3z(nax); + + if ( u3_nul != pey ) { + return pey; + } + else { + u3_noun nax = u3qc_peg(axe, 7); + u3_noun pro; + + pro = _loot_in(cog, r_dom, nax); + u3z(nax); + return pro; + } + } + else { + u3_noun u_yep = u3t(yep); + u3_noun nax = u3qc_peg(axe, 2); + u3_noun pro; + + pro = u3nt(u3_nul, u3qc_peg(nax, u3h(u_yep)), u3k(u3t(u_yep))); + u3z(nax); + u3z(yep); + return pro; + } + } + } + } + } + +/* functions +*/ + u3_noun + u3qf_loot(u3_noun cog, + u3_noun dom) + { + return _loot_in(cog, dom, 1); + } + u3_noun + u3wf_loot(u3_noun cor) + { + u3_noun cog, dom; + + if ( c3n == u3r_mean(cor, u3x_sam_2, &cog, u3x_sam_3, &dom, 0) ) { + return u3m_bail(c3__fail); + } else { + return u3qf_loot(cog, dom); + } + } diff --git a/jets/stage/f/ut.c b/jets/stage/f/ut.c new file mode 100644 index 000000000..9fcf3ec1a --- /dev/null +++ b/jets/stage/f/ut.c @@ -0,0 +1,100 @@ +/* j/6/ut.c +** +*/ +#include "all.h" + + extern void + u3_pier_tank(c3_l tab_l, u3_noun tac); + + + // duck: create a duck core for mean. + // + u3_noun + u3qfu_duck(u3_noun van, + u3_noun typ) + { + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(typ), 0); + u3_noun ret = u3j_cook("u3qfu_duck-dune", u3k(von), "dune"); + + u3z(von); + return ret; + } + + // dung: create a dunk core for mean (noun caption) + // + u3_noun + u3qfu_dung(u3_noun van, + u3_noun paz, + u3_noun typ) + { + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(typ), 0); + u3_noun duq = u3j_cook("u3qfu_dung-dunk", u3k(von), "dunk"); + u3_noun ret = u3i_molt(u3k(duq), u3x_sam, u3k(paz), 0); + + u3z(duq); + u3z(von); + return ret; + } + + // dunq: create a dunk core for mean + // + u3_noun + u3qfu_dunq(u3_noun van, + const c3_c* paz_c, + u3_noun typ) + { + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(typ), 0); + u3_noun duq = u3j_cook("u3qfu_dunq-dunk", u3k(von), "dunk"); + u3_noun paz = u3i_string(paz_c); + u3_noun ret = u3i_molt(u3k(duq), u3x_sam, u3k(paz), 0); + + u3z(paz); + u3z(duq); + u3z(von); + return ret; + } + + // dump: dump a type. + // + void + u3qfu_dump(u3_noun van, + const c3_c* paz_c, + u3_noun typ) + { + c3_c* pfix_c = u3r_string((c3y == u3du(typ)) ? u3h(typ) : typ); + c3_c ugh_c[1024]; + + sprintf(ugh_c, "%s: %s: 0x%8x:", + paz_c, pfix_c, u3r_mug(typ)); +#if 0 + u3_pier_tank(0, u3n_kick_on(u3qfu_dunq(van, ugh_c, typ))); +#endif + } + + // shew: create a show core for mean + // + u3_noun + u3qfu_shew(u3_noun van, + u3_noun mol) + { + u3_noun sho = u3j_cook("u3qfu_shew-show", u3k(van), "show"); + u3_noun ret = u3i_molt(u3k(sho), u3x_sam, u3k(mol), 0); + + u3z(sho); + u3z(mol); + return ret; + } + + // shep: show with caption and style + // + u3_noun + u3qfu_shep(u3_noun van, + const c3_c* paz_c, + u3_noun sty, + u3_noun mol) + { + return u3qfu_shew(van, + u3nc(u3nc('c', u3i_string(paz_c)), + u3nc(u3k(sty), mol))); + } + diff --git a/jets/stage/f/ut_buss.c b/jets/stage/f/ut_buss.c new file mode 100644 index 000000000..144046d8a --- /dev/null +++ b/jets/stage/f/ut_buss.c @@ -0,0 +1,93 @@ +/* j/6/ut_buss.c +** +*/ +#include "all.h" + + +/* logic +*/ + static u3_noun + _cqfu_buss(u3_noun van, + u3_noun sut, + u3_noun cog, + u3_noun gen) + { + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + u3_noun gat = u3j_cook("_cqfu_buss-buss", von, "buss"); + + return u3n_kick_on(u3i_molt(gat, + u3x_sam_2, + u3k(cog), + u3x_sam_3, + u3k(gen), + 0)); + } + + static u3_noun + _cqfu_busk(u3_noun van, + u3_noun sut, + u3_noun gen) + { + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + u3_noun gat = u3j_cook("_cqfu_busk-busk", von, "busk"); + + return u3n_kick_on(u3i_molt(gat, + u3x_sam, + u3k(gen), + 0)); + } + +/* boilerplate +*/ + u3_noun + u3wfu_buss(u3_noun cor) + { + u3_noun sut, cog, gen, van; + + if ( (c3n == u3r_mean(cor, u3x_sam_2, &cog, + u3x_sam_3, &gen, + u3x_con, &van, + 0)) || + (c3n == u3ud(cog)) || + (u3_none == (sut = u3r_at(u3x_sam, van))) ) + { + return u3m_bail(c3__fail); + } else { + return _cqfu_buss(van, sut, cog, gen); + } + } + + u3_noun + u3qfu_buss(u3_noun van, + u3_noun sut, + u3_noun cog, + u3_noun gen) + { + return _cqfu_buss(van, sut, cog, gen); + } + + + u3_noun + u3wfu_busk(u3_noun cor) + { + u3_noun sut, gen, van; + + if ( (c3n == u3r_mean(cor, u3x_sam, &gen, + u3x_con, &van, + 0)) || + (u3_none == (sut = u3r_at(u3x_sam, van))) ) + { + return u3m_bail(c3__fail); + } else { + return _cqfu_busk(van, sut, gen); + } + } + + u3_noun + u3qfu_busk(u3_noun van, + u3_noun sut, + u3_noun gen) + { + return _cqfu_busk(van, sut, gen); + } + diff --git a/jets/stage/f/ut_conk.c b/jets/stage/f/ut_conk.c new file mode 100644 index 000000000..d851143a1 --- /dev/null +++ b/jets/stage/f/ut_conk.c @@ -0,0 +1,88 @@ +/* j/6/ut_conk.c +** +*/ +#include "all.h" + + +/* logic +*/ + static u3_noun + _cqfu_conk(u3_noun van, + u3_noun sut, + u3_noun got) + { + if ( c3y == u3ud(got) ) { + u3_noun ret = u3qf_face(u3k(got), sut); + + return ret; + } + else switch ( u3h(got) ) { + default: return u3m_bail(c3__fail); + + case 0: { + return u3k(sut); + } + case 1: { + u3_noun cok = _cqfu_conk(van, sut, u3t(u3t(got))); + u3_noun nux = u3k(u3h(u3t(got))); + u3_noun ret = u3qf_face(nux, cok); + + u3z(nux); + u3z(cok); + return ret; + } + case 2: { + u3_noun vet = u3r_at(u3qfu_van_vet, van); + u3_noun hed, tal, deh, lat, ret; + + if ( c3y == vet ) { + u3_noun cel = u3nt(c3__cell, c3__noun, c3__noun); + + if ( c3n == u3qfu_nest(van, cel, c3y, sut) ) { + return u3m_bail(c3__fail); + } + u3z(cel); + } + hed = u3qfu_peek(van, sut, c3__both, 2); + tal = u3qfu_peek(van, sut, c3__both, 3); + deh = _cqfu_conk(van, hed, u3h(u3t(got))); + lat = _cqfu_conk(van, tal, u3t(u3t(got))); + + ret = u3qf_cell(deh, lat); + + u3z(lat); + u3z(deh); + u3z(tal); + u3z(hed); + + return ret; + } + } + } + +/* boilerplate +*/ + u3_noun + u3wfu_conk(u3_noun cor) + { + u3_noun sut, got, van; + + if ( (c3n == u3r_mean(cor, u3x_sam, &got, + u3x_con, &van, + 0)) || + (u3_none == (sut = u3r_at(u3x_sam, van))) ) + { + return u3m_bail(c3__fail); + } else { + return _cqfu_conk(van, sut, got); + } + } + + u3_noun + u3qfu_conk(u3_noun van, + u3_noun sut, + u3_noun got) + { + return _cqfu_conk(van, sut, got); + } + diff --git a/jets/stage/f/ut_crop.c b/jets/stage/f/ut_crop.c new file mode 100644 index 000000000..c558737cc --- /dev/null +++ b/jets/stage/f/ut_crop.c @@ -0,0 +1,271 @@ +/* j/6/crop.c +** +*/ +#include "all.h" + +/* logic +*/ + static u3_noun + _crop_dext(u3_noun, u3_noun, u3_noun, u3_noun); + static u3_noun + _crop_sint(u3_noun, u3_noun, u3_noun, u3_noun); + + static u3_noun + _crop_repo(u3_noun van, + u3_noun sut, + u3_noun ref, + u3_noun bix) + { + u3_noun rep = u3qfu_repo(van, sut); + u3_noun ret = _crop_dext(van, rep, ref, bix); + + if ( c3y == u3r_sing(ret, rep) ) { + if ( c3__void == rep ) { + return c3__void; + } else { + u3z(rep); + u3z(ret); + return u3k(sut); + } + } else { + u3z(rep); + return ret; + } + } + + static u3_noun + _crop_dext_fork(u3_noun van, u3_noun p_sut, u3_noun ref, u3_noun bix) + { + if ( u3_nul == p_sut ) { + return u3_nul; + } + else { + return u3nc(_crop_dext(van, u3h(p_sut), ref, bix), + _crop_dext_fork(van, u3t(p_sut), ref, bix)); + } + } + static u3_noun + _crop_sint_fork(u3_noun van, u3_noun sut, u3_noun p_ref, u3_noun bix) + { + if ( u3_nul == p_ref ) { + return u3k(sut); + } + else { + u3_noun tuz = _crop_dext(van, sut, u3h(p_ref), bix); + u3_noun zat = _crop_sint_fork(van, tuz, u3t(p_ref), bix); + + u3z(tuz); + return zat; + } + } + + static u3_noun + _crop_dext(u3_noun van, + u3_noun sut, + u3_noun ref, + u3_noun bix) + { + u3_noun p_sut, q_sut, p_ref, q_ref; + + if ( c3n == u3du(ref) ) { + switch ( ref ) { + case c3__void: return u3k(sut); + case c3__noun: return c3__void; + default: return u3m_bail(c3__fail); + } + } + if ( c3y == u3r_sing(sut, ref) ) { + return c3__void; + } + if ( c3n == u3du(sut) ) switch ( sut ) { + default: return u3m_bail(c3__fail); + + case c3__noun: return _crop_repo(van, sut, ref, bix); + case c3__void: return c3__void; + } + else switch ( u3h(sut) ) { + default: return u3m_bail(c3__fail); + + case c3__atom: u3x_cell(u3t(sut), &p_sut, &q_sut); + { + if ( c3__atom == u3h(ref) ) { + u3x_cell(u3t(ref), &p_ref, &q_ref); + + if ( c3y == u3du(q_sut) ) { + if ( c3y == u3du(q_ref) ) { + if ( c3y == u3r_sing(q_sut, q_ref) ) { + return c3__void; + } else { + return u3k(sut); + } + } else { + return c3__void; + } + } + else { + if ( c3y == u3du(q_ref) ) { + return u3k(sut); + } + else return c3__void; + } + } + else if ( c3__cell == u3h(ref) ) { + return u3k(sut); + } + else return _crop_sint(van, sut, ref, bix); + } + case c3__cell: u3x_cell(u3t(sut), &p_sut, &q_sut); + { + if ( c3__atom == u3h(ref) ) { + return u3k(sut); + } + else if ( c3__cell == u3h(ref) ) { + u3x_cell(u3t(ref), &p_ref, &q_ref); + + if ( c3y == u3qfu_nest(van, p_ref, c3n, p_sut) ) + { + u3_noun foz = _crop_dext(van, q_sut, q_ref, bix); + u3_noun ret = u3qf_cell(p_sut, foz); + + u3z(foz); + return ret; + } + else return u3k(sut); + } + else return _crop_sint(van, sut, ref, bix); + } + case c3__core: + { + if ( (c3__atom == u3h(ref)) || + (c3__cell == u3h(ref)) ) { + return u3k(sut); + } + else return _crop_sint(van, sut, ref, bix); + } + case c3__hint: u3x_cell(u3t(sut), &p_sut, &q_sut); + { + u3_noun foz = _crop_dext(van, q_sut, ref, bix); + u3_noun ret = u3qf_hint(p_sut, foz); + + u3z(foz); + return ret; + } + case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut); + { + u3_noun foz = _crop_dext(van, q_sut, ref, bix); + u3_noun ret = u3qf_face(p_sut, foz); + + u3z(foz); + return ret; + } + case c3__fork: p_sut = u3t(sut); + { + u3_noun yed = u3qdi_tap(p_sut); + u3_noun ret = u3kf_fork(_crop_dext_fork(van, yed, ref, bix)); + + u3z(yed); + return ret; + } + case c3__hold: + { + u3_noun hud = u3nc(u3k(sut), u3k(ref)); + + if ( c3y == u3qdi_has(bix, hud) ) { +# if 0 + u3_noun dun = u3qfu_dunq(van, "type", sut); + u3_noun niz = u3qfu_dunq(van, "over", ref); + + u3t_push(u3nc(c3__mean, dun)); + u3t_push(u3nc(c3__mean, niz)); +# endif + + return u3m_error("crop-loop"); + } else { + u3_noun bux = u3qdi_put(bix, hud); + u3_noun ret = _crop_repo(van, sut, ref, bux); + + u3z(hud); + u3z(bux); + return ret; + } + } + } + } + + static u3_noun + _crop_sint(u3_noun van, + u3_noun sut, + u3_noun ref, + u3_noun bix) + { + u3_noun p_ref, q_ref; + + switch ( u3h(ref) ) { + default: return u3m_bail(c3__fail); + + case c3__core: + case c3__hint: + case c3__face: u3x_cell(u3t(ref), &p_ref, &q_ref); + { + return _crop_dext(van, sut, q_ref, bix); + } + case c3__fork: p_ref = u3t(ref); + { + u3_noun yed = u3qdi_tap(p_ref); + u3_noun ret = _crop_sint_fork(van, sut, yed, bix); + + u3z(yed); + return ret; + } + case c3__hold: + { + u3_noun rep = u3qfu_repo(van, ref); + u3_noun ret = _crop_dext(van, sut, rep, bix); + + u3z(rep); + return ret; + } + } + } + + static u3_noun + _cqfu_crop(u3_noun van, + u3_noun sut, + u3_noun ref) + { + return _crop_dext(van, sut, ref, u3_nul); + } + +/* boilerplate +*/ + u3_noun + u3wfu_crop(u3_noun cor) + { + u3_noun sut, ref, van; + + if ( (c3n == u3r_mean(cor, u3x_sam, &ref, u3x_con, &van, 0)) || + (u3_none == (sut = u3r_at(u3x_sam, van))) ) + { + return u3m_bail(c3__fail); + } else { + return _cqfu_crop(van, sut, ref); + } + } + + u3_noun + u3qfu_crop(u3_noun van, + u3_noun sut, + u3_noun ref) + { + c3_m fun_m = 141 + c3__crop + ((!!u3r_at(u3qfu_van_vet, van)) << 8); + u3_noun pro = u3z_find_2(fun_m, sut, ref); + + if ( u3_none != pro ) { + return pro; + } + else { + pro = _cqfu_crop(van, sut, ref); + + return u3z_save_2(fun_m, sut, ref, pro); + } + } diff --git a/jets/stage/f/ut_find.c b/jets/stage/f/ut_find.c new file mode 100644 index 000000000..bde859ee9 --- /dev/null +++ b/jets/stage/f/ut_find.c @@ -0,0 +1,914 @@ +/* j/6/find.c +** +*/ +#include "all.h" + + static u3_noun + _find_buck(u3_noun van, + u3_noun sut, + u3_noun way, + u3_noun p_heg, + u3_noun q_heg, + u3_noun axe, + u3_noun lon, + u3_noun gil); + +/* `u3qfu_felt_arm` is a helper function for + * u3qfu_felt. It handles the case in which the + * opal is for an arm, by creating a list of + * parent core types. These will be converted to + * a single `fork` type. +*/ + static u3_noun + u3qfu_felt_arm(u3_noun lis) + { + if ( u3_nul == lis ) { + return u3_nul; + } + else { + u3_noun i_lis, t_lis, fot, typ; + u3x_cell(lis, &i_lis, &t_lis); + u3x_cell(i_lis, &typ, &fot); + + if ( (c3n == u3du(typ)) || + (c3__core != u3h(typ)) ) { + return u3m_error("felt-core"); + } + else { + u3_noun p_typ, q_typ, pq_typ, qq_typ, rq_typ; + u3x_cell(u3t(typ), &p_typ, &q_typ); + u3x_trel(q_typ, &pq_typ, &qq_typ, &rq_typ); + + u3_noun dox = u3nt(c3__core, u3k(qq_typ), u3k(q_typ)); + return u3nc(dox, u3qfu_felt_arm(t_lis)); + } + } + } + +/* `u3qfu_felt` takes an opal, lap, and converts + * it to a type. The opal comes from the last + * limb of the wing processed by `+fond`. The + * type is used in +fond as the subject type of + * the next limb in the wing. +*/ + static u3_noun + u3qfu_felt(u3_noun lap) + { + u3_noun lim, mil; + u3x_cell(lap, &lim, &mil); + + if ( c3y == lim ) { + return u3k(mil); + } + else if ( c3n == lim ) { + u3_noun p_lap, q_lap, lis, hos; + u3x_cell(mil, &p_lap, &q_lap); + lis = u3qdi_tap(q_lap); + hos = u3qfu_felt_arm(lis); + + u3z(lis); + return u3kf_fork(hos); + } + else { + u3m_bail(c3__exit); + } + } + + static u3_noun + u3qfu_fund(u3_noun van, + u3_noun sut, + u3_noun way, + u3_noun gen) + { + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + u3_noun gat = u3j_cook("u3qfu_fund-fund", von, "fund"); + + return u3n_kick_on(u3i_molt(gat, + u3x_sam_2, + u3k(way), + u3x_sam_3, + u3k(gen), + 0)); + } + + static u3_noun + u3qfu_fine(u3_noun van, + u3_noun sut, + u3_noun tor) + { + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + u3_noun gat = u3j_cook("u3qfu_fine-fine", von, "fine"); + + return u3n_kick_on(u3i_molt(gat, + u3x_sam, + u3k(tor), + 0)); + } + + static u3_noun + _find_buck_here(u3_noun van, + u3_noun sut, + u3_noun way, + u3_noun p_heg, + u3_noun q_heg, + u3_noun axe, + u3_noun lon, + u3_noun gil) + { + if ( 0 == p_heg ) { + return u3nt + (c3y, + u3nt(u3_nul, + u3nc(u3_nul, u3k(axe)), + u3k(lon)), + u3nc(c3y, u3k(sut))); + } + else { + return u3nt + (c3n, c3y, u3qa_dec(p_heg)); + } + } + + static u3_noun + _find_buck_lose(u3_noun van, + u3_noun sut, + u3_noun way, + u3_noun p_heg, + u3_noun q_heg, + u3_noun axe, + u3_noun lon, + u3_noun gil) + { + return u3nt(c3n, c3y, u3k(p_heg)); + } + static u3_noun + _find_buck_stop(u3_noun van, + u3_noun sut, + u3_noun way, + u3_noun p_heg, + u3_noun q_heg, + u3_noun axe, + u3_noun lon, + u3_noun gil) + { + if ( u3_nul == q_heg ) { + return _find_buck_here(van, sut, way, p_heg, q_heg, axe, lon, gil); + } + else { + return _find_buck_lose(van, sut, way, p_heg, q_heg, axe, lon, gil); + } + } + + static u3_noun + _find_buck_cell(u3_noun van, + u3_noun sut, + u3_noun way, + u3_noun p_heg, + u3_noun q_heg, + u3_noun axe, + u3_noun lon, + u3_noun gil) + { + u3_noun p_sut, q_sut; + + u3x_cell(u3t(sut), &p_sut, &q_sut); + { + if ( u3_nul == q_heg ) { + return _find_buck_here(van, sut, way, p_heg, q_heg, axe, lon, gil); + } + else { + u3_noun exa = u3qc_peg(axe, 2); + u3_noun hed = _find_buck(van, p_sut, way, p_heg, q_heg, exa, lon, gil); + + u3z(exa); + if ( (u3_nul == hed) || (c3y == u3h(hed)) || (c3n == u3h(u3t(hed))) ) { + return hed; + } + else { + u3_noun exa = u3qc_peg(axe, 3); + u3_noun tal = _find_buck + (van, q_sut, way, u3t(u3t(hed)), q_heg, exa, lon, gil); + + u3z(exa); + u3z(hed); + + return tal; + } + } + } + } + + static u3_noun + _find_buck_core(u3_noun van, + u3_noun sut, + u3_noun way, + u3_noun p_heg, + u3_noun q_heg, + u3_noun axe, + u3_noun lon, + u3_noun gil) + { + u3_noun p_sut, q_sut, pq_sut, qq_sut, rq_sut, prq_sut, qrq_sut; + u3_noun ppq_sut, qpq_sut, rpq_sut; + + u3x_cell(u3t(sut), &p_sut, &q_sut); + u3x_trel(q_sut, &pq_sut, &qq_sut, &rq_sut); + u3x_trel(pq_sut, &ppq_sut, &qpq_sut, &rpq_sut); + u3x_cell(rq_sut, &prq_sut, &qrq_sut); + { + if ( u3_nul == q_heg ) { + return _find_buck_here(van, sut, way, p_heg, q_heg, axe, lon, gil); + } + else { + u3_noun zem = u3qf_loot(u3t(q_heg), qrq_sut); + + if ( (u3_nul != zem) && (0 != p_heg) ) { + u3_noun ped; + + ped = u3qa_dec(p_heg); + u3z(p_heg); p_heg = ped; + + u3z(zem); + zem = u3_nul; + } + + if ( u3_nul != zem ) { + u3_noun u_zem = u3t(zem); + u3_noun pu_zem = u3h(u_zem); + u3_noun qu_zem = u3t(u_zem); + u3_noun zut; + u3_noun pro; + +#if 1 + if ( qpq_sut == c3__wet ) { + zut = u3nc(c3__wet, u3k(qu_zem)); + } + else if ( qpq_sut == c3__dry ) { + zut = u3nc(c3__dry, u3k(qu_zem)); + } + else u3m_bail(c3__fail); +#endif + + pro = u3nt + (c3y, + u3nc(u3nc(u3_nul, u3k(axe)), u3k(lon)), + u3nt(c3n, + u3qc_peg(2, pu_zem), + u3nt(u3nc(u3k(sut), zut), u3_nul, u3_nul))); + + u3z(zem); + return pro; + } + else { + u3_noun pec = u3qfu_peel(van, sut, way, rpq_sut); + u3_noun pro; + + if ( c3n == u3h(pec) ) { + pro = _find_buck_lose(van, sut, way, p_heg, q_heg, axe, lon, gil); + } + else if ( c3y == u3t(pec) ) { + u3_noun exa = u3qc_peg(axe, 3); + + pro = _find_buck(van, p_sut, way, p_heg, q_heg, exa, lon, gil); + u3z(exa); + } + else { + u3_noun sam = u3qfu_peek(van, p_sut, way, 2); + u3_noun exa = u3qc_peg(axe, 6); + + pro = _find_buck(van, sam, way, p_heg, q_heg, exa, lon, gil); + u3z(exa); + u3z(sam); + } + u3z(pec); + return pro; + } + } + } + } + + static u3_noun + _find_twin(u3_noun van, + u3_noun hax, + u3_noun yor) + { + if ( c3y == u3r_sing(hax, yor) ) { + return u3k(hax); + } + else if ( u3_nul == hax ) { + return u3k(yor); + } + else if ( u3_nul == yor ) { + return u3k(hax); + } + else if ( c3n == u3h(hax) ) { + if ( (c3n != u3h(yor)) ) { + return u3m_error("find-fork-a"); + } + else { + u3_noun p_hax = u3t(hax); // (each @ud {span nock}) + u3_noun p_yor = u3t(yor); // (each @ud {span nock}) + + if ( (c3n != u3h(p_hax)) || (c3n != u3h(p_yor)) ) { + return u3m_error("find-fork-b"); + } + else { + u3_noun pp_hax = u3t(p_hax); // {span nock} + u3_noun pp_yor = u3t(p_yor); // {span nock} + u3_noun ppp_hax = u3h(pp_hax); // span + u3_noun ppp_yor = u3h(pp_yor); // span + u3_noun qpp_hax = u3t(pp_hax); // nock + u3_noun qpp_yor = u3t(pp_yor); // nock + + if ( c3n == u3r_sing(qpp_hax, qpp_yor) ) { + return u3m_error("find-fork-c"); + } + return u3nt(c3n, + c3n, + u3nc( + u3kf_fork(u3nt(u3k(ppp_hax), u3k(ppp_yor), u3_nul)), + u3k(qpp_hax))); + } + } + } + else { + if ( c3n == u3h(yor) ) { + return u3m_error("find-fork-d"); + } + else { + u3_noun p_hax = u3t(hax); // {vein opal} + u3_noun p_yor = u3t(yor); // {vein opal} + u3_noun pp_hax = u3h(p_hax); // vein + u3_noun pp_yor = u3h(p_yor); // vein + u3_noun qp_hax = u3t(p_hax); // opal + u3_noun qp_yor = u3t(p_yor); // opal + + if ( c3n == u3r_sing(pp_hax, pp_yor) ) { + return u3m_error("find-fork-e"); + } + else { + if ( c3y == u3h(qp_hax) ) { + if ( c3y != u3h(qp_yor) ) { + return u3m_error("find-fork-f"); + } else { + u3_noun pqp_hax = u3t(qp_hax); // type + u3_noun pqp_yor = u3t(qp_yor); // type + + return + u3nt(c3y, + u3k(pp_hax), + u3nc(c3y, u3kf_fork + (u3nt(u3k(pqp_hax), u3k(pqp_yor), u3_nul)))); + } + } + else if ( c3n != u3h(qp_yor) ) { + return u3m_error("find-fork-g"); + } else { + u3_noun pqp_hax = u3h(u3t(qp_hax)); // axis + u3_noun pqp_yor = u3h(u3t(qp_yor)); // axis + u3_noun qqp_hax = u3t(u3t(qp_hax)); // (set {type foot}) + u3_noun qqp_yor = u3t(u3t(qp_yor)); // (set {type foot}) + + if ( c3n == u3r_sing(pqp_hax, pqp_yor) ) { + return u3m_error("find-fork-h"); + } else { + return + u3nt(c3y, + u3k(pp_hax), + u3nt(c3n, u3k(pqp_hax), u3qdi_uni(qqp_hax, qqp_yor))); + } + } + } + } + } + // error: { return u3m_error("find-fork"); } + } + + static u3_noun + _find_buck_fork_twin(u3_noun van, u3_noun wiz) + { + if ( u3_nul == wiz ) { + return u3_nul; + } + else if ( u3_nul == u3t(wiz) ) { + return u3k(u3h(wiz)); + } + else { + u3_noun hax = u3k(u3h(wiz)); + u3_noun yor = _find_buck_fork_twin(van, u3t(wiz)); + u3_noun fid = _find_twin(van, hax, yor); + + u3z(hax); + u3z(yor); + + return fid; + } + } + + static u3_noun + _find_buck_fork_turn(u3_noun van, + u3_noun yed, + u3_noun way, + u3_noun p_heg, + u3_noun q_heg, + u3_noun axe, + u3_noun lon, + u3_noun gil) + { + if ( u3_nul == yed ) { + return u3_nul; + } + else { + u3_noun fid = _find_buck(van, u3h(yed), way, p_heg, q_heg, axe, lon, gil); + + return u3nc + (fid, + _find_buck_fork_turn + (van, u3t(yed), way, p_heg, q_heg, axe, lon, gil)); + } + } + + static u3_noun + _find_buck_fork(u3_noun van, + u3_noun sut, + u3_noun way, + u3_noun p_heg, + u3_noun q_heg, + u3_noun axe, + u3_noun lon, + u3_noun gil) + { + u3_noun p_sut = u3t(sut); + u3_noun yed = u3qdi_tap(p_sut); + u3_noun wiz; + u3_noun ret; + + wiz = _find_buck_fork_turn(van, yed, way, p_heg, q_heg, axe, lon, gil); + u3z(yed); + + ret = _find_buck_fork_twin(van, wiz); + u3z(wiz); + + return ret; + } + + static u3_noun + _find_buck_face_next(u3_noun van, + u3_noun sut, + u3_noun q_sut, + u3_noun qp_sut, + u3_noun way, + u3_noun p_heg, + u3_noun q_heg, + u3_noun axe, + u3_noun lon, + u3_noun gil) + { + if ( u3_nul == qp_sut ) { + u3_noun nol = u3nc(u3_nul, u3k(lon)); + u3_noun ret = _find_buck(van, q_sut, way, p_heg, q_heg, axe, nol, gil); + u3z(nol); + return ret; + } + else { + u3_noun iqp_sut = u3h(qp_sut); // twig + u3_noun tiv = u3qfu_mint // (pair type nock) + (van, q_sut, c3__noun, iqp_sut); + u3_noun tqp_sut = u3t(qp_sut); // (list twig) + u3_noun p_tiv = u3h(tiv); // type + u3_noun q_tiv = u3t(tiv); // nock + u3_noun fid = _find_buck // pony + (van, p_tiv, way, p_heg, q_heg, 1, u3_nul, u3_nul); + + if ( u3_nul == fid ) { + u3z(tiv); + return u3_nul; + } + else if ( (c3n == u3h(fid)) && (c3y == u3h(u3t(fid))) ) { + u3_noun ret; + + ret = _find_buck_face_next + (van, sut, q_sut, tqp_sut, way, u3t(u3t(fid)), q_heg, axe, lon, gil); + u3z(fid); + u3z(tiv); + return ret; + } + else { + u3_noun tor; // port + u3_noun vat; // (pair type nock) + u3_noun ret; + u3_noun dog = u3nc(0, u3k(axe)); // nock + u3_noun cob = u3qf_comb(dog, q_tiv); + + if ( c3y == u3h(fid) ) { + tor = u3nc(c3y, u3k(u3t(fid))); + } else { + tor = u3nc(c3n, u3k(u3t(u3t(fid)))); + } + u3z(fid); + + vat = u3qfu_fine(van, sut, tor); + u3z(tor); + + ret = u3nt + (c3n, + c3n, + u3nc(u3k(u3h(vat)), u3qf_comb(cob, u3t(vat)))); + + u3z(vat); + u3z(dog); + u3z(cob); + u3z(tiv); + + return ret; + } + } + } + + static u3_noun + _find_buck_face(u3_noun van, + u3_noun sut, + u3_noun way, + u3_noun p_heg, + u3_noun q_heg, + u3_noun axe, + u3_noun lon, + u3_noun gil) + { + u3_noun p_sut, q_sut; + + u3x_cell(u3t(sut), &p_sut, &q_sut); + + if ( u3_nul == q_heg ) { + return _find_buck_here(van, q_sut, way, p_heg, q_heg, axe, lon, gil); + } + else { + u3_noun uq_heg = u3t(q_heg); // term + + if ( c3y == u3ud(p_sut) ) { + if ( c3y == u3r_sing(p_sut, uq_heg) ) { + return _find_buck_here(van, q_sut, way, p_heg, q_heg, axe, lon, gil); + } + else { + return _find_buck_lose(van, sut, way, p_heg, q_heg, axe, lon, gil); + } + } + else { + u3_noun pp_sut = u3h(p_sut); // (map term {wain (unit twig)}) + u3_noun qp_sut = u3t(p_sut); // (list (pair type nock)) + u3_noun tyr = u3qdb_get(pp_sut, uq_heg); // (unit (unit twig)) + + if ( u3_nul == tyr ) { + return _find_buck_face_next + (van, sut, q_sut, qp_sut, way, p_heg, q_heg, axe, lon, gil); + } + else { + u3_noun u_tyr = u3t(tyr); // (unit twig) + + if ( u3_nul == u_tyr ) { + u3_noun nol = u3nc(u3_nul, u3k(lon)); + u3_noun dep = u3qa_inc(p_heg); + u3_noun ret = _find_buck + (van, q_sut, way, dep, q_heg, axe, nol, gil); + + u3z(dep); + u3z(nol); + u3z(tyr); + return ret; + } + else { + u3_noun uu_tyr = u3t(u_tyr); + u3_noun tor = u3qfu_fund(van, sut, way, uu_tyr); + + if ( c3y == u3h(tor) ) { + u3_noun p_tor = u3t(tor); // (pair vein opal) + u3_noun pp_tor = u3h(p_tor); // vein + u3_noun qp_tor = u3t(p_tor); // opal + u3_noun nol = // vein + u3nt(u3_nul, u3nc(u3_nul, u3k(axe)), u3k(lon)); + u3_noun ret; + + ret = u3nt(c3y, u3qb_weld(pp_tor, nol), u3k(qp_tor)); + u3z(nol); + u3z(tor); + u3z(tyr); + return ret; + } + else { + u3_noun p_tor = u3t(tor); // (pair type nock) + u3_noun pp_tor = u3h(p_tor); // type + u3_noun qp_tor = u3t(p_tor); // nock + u3_noun dog = u3nc(0, u3k(axe)); // nock + u3_noun ret; + + ret = u3nt(c3n, + c3n, + u3nc(u3k(pp_tor), u3qf_comb(dog, qp_tor))); + u3z(dog); + u3z(tor); + u3z(tyr); + + return ret; + } + } + } + } + } + } + + static u3_noun + _find_buck(u3_noun van, + u3_noun sut, + u3_noun way, + u3_noun p_heg, + u3_noun q_heg, + u3_noun axe, + u3_noun lon, + u3_noun gil) + { + if ( c3n == u3du(sut) ) switch ( sut ) { + default: return u3m_bail(c3__fail); + + case c3__noun: { + // fprintf(stderr, "noun\r\n"); + return _find_buck_stop(van, sut, way, p_heg, q_heg, axe, lon, gil); + } + case c3__void: { + // fprintf(stderr, "void\r\n"); + // return _find_buck_stop(van, sut, way, p_heg, q_heg, axe, lon, gil); + return u3_nul; + } + } + else switch ( u3h(sut) ) { + default: return u3m_bail(c3__fail); + + case c3__atom: + { + // fprintf(stderr, "atom\r\n"); + return _find_buck_stop(van, sut, way, p_heg, q_heg, axe, lon, gil); + } + case c3__cell: + { + // fprintf(stderr, "cell\r\n"); + return _find_buck_cell(van, sut, way, p_heg, q_heg, axe, lon, gil); + } + case c3__core: + { + // fprintf(stderr, "core\r\n"); + return _find_buck_core(van, sut, way, p_heg, q_heg, axe, lon, gil); + } + case c3__hint: + { + u3_noun fop = u3qfu_repo(van, sut); + u3_noun pro = _find_buck(van, fop, way, p_heg, q_heg, axe, lon, gil); + u3z(fop); + return pro; + } + case c3__face: + { + // fprintf(stderr, "face\r\n"); + return _find_buck_face(van, sut, way, p_heg, q_heg, axe, lon, gil); + } + case c3__fork: + { + // fprintf(stderr, "fork\r\n"); + return _find_buck_fork(van, sut, way, p_heg, q_heg, axe, lon, gil); + } + case c3__hold: + { + // fprintf(stderr, "hold\r\n"); + if ( (c3y == u3qdi_has(gil, sut)) ) { + return u3_nul; + } + else { + u3_noun zoc = u3qdi_put(gil, sut); + u3_noun fop = u3qfu_repo(van, sut); + u3_noun pro = _find_buck(van, fop, way, p_heg, q_heg, axe, lon, zoc); + + u3z(fop); + u3z(zoc); + + return pro; + } + } + } + } + + static u3_noun + _find_limb(u3_noun van, + u3_noun sut, // type + u3_noun way, // ?(%read %rite %free %both) + u3_noun i_hyp, // limb + u3_noun p_mor) // palo + { + u3_noun pp_mor = u3h(p_mor); // vein + u3_noun qp_mor = u3t(p_mor); // opal + + { + u3_noun ref = u3qfu_felt(qp_mor); + u3_noun lon = u3k(pp_mor); + u3_noun heg = (c3y == u3du(i_hyp)) + ? u3k(i_hyp) + : u3nq(c3n, 0, u3_nul, u3k(i_hyp)); + u3_noun ret; + + if ( c3y == u3h(heg) ) { + u3_noun p_heg = u3t(heg); // axis + + if ( c3n == u3ud(p_heg) ) { + u3m_p("weird p_heg", p_heg); + return u3m_bail(c3__fail); + } + + ret = u3nt + (c3y, + u3nc(u3nc(u3_nul, u3k(p_heg)), u3k(lon)), + u3nc(c3y, u3qfu_peek(van, ref, way, p_heg))); + } + else { + u3_noun p_heg = u3h(u3t(heg)); // @ud + u3_noun q_heg = u3t(u3t(heg)); // (unit term) + + ret = _find_buck + (van, ref, way, p_heg, q_heg, 1, lon, u3_nul); + } + u3z(heg); + u3z(lon); + u3z(ref); + + return ret; + } + } + + static u3_noun + _find_pony(u3_noun van, + u3_noun sut, + u3_noun way, + u3_noun hyp) + { + if ( u3_nul == hyp ) { + return u3nt(c3y, u3_nul, u3nc(c3y, u3k(sut))); + } + else { + u3_noun i_hyp = u3h(hyp); + u3_noun t_hyp = u3t(hyp); + u3_noun mor = _find_pony(van, sut, way, t_hyp); + + if ( c3n == u3h(mor) ) { + u3_noun p_mor = u3t(mor); + + if ( c3y == u3h(p_mor) ) { + return mor; + } + else { + u3_noun pp_mor = u3t(p_mor); // {span nock} + u3_noun ppp_mor = u3h(pp_mor); // span + u3_noun qpp_mor = u3t(pp_mor); // nock + u3_noun gen = u3nt(c3__wing, u3k(i_hyp), u3_nul); + u3_noun fex = u3qfu_mint(van, ppp_mor, c3__noun, gen); + u3_noun ret = u3nt(c3n, + c3n, + u3nc(u3k(u3h(fex)), + u3qf_comb(qpp_mor, u3t(fex)))); + u3z(fex); + u3z(gen); + u3z(mor); + + return ret; + } + } + else { + u3_noun p_mor = u3t(mor); + u3_noun ret = _find_limb(van, sut, way, i_hyp, p_mor); + + u3z(mor); + return ret; + } + } + } + + static u3_noun + _cqfu_fond(u3_noun van, + u3_noun sut, + u3_noun way, + u3_noun hyp) + { + u3_noun taf; + + taf = _find_pony(van, sut, way, hyp); + + return taf; + } + + static u3_noun + _cqfu_find(u3_noun van, + u3_noun sut, + u3_noun way, + u3_noun hyp) + { + u3_noun taf = _find_pony(van, sut, way, hyp); + + if ( u3_nul == taf ) { + goto error; + } + else { + if ( c3y == u3h(taf) ) { + u3_noun fat = u3nc(c3y, u3k(u3t(taf))); + + u3z(taf); + return fat; + } + else { + if ( c3n == u3h(u3t(taf)) ) { + u3_noun fat = u3nc(c3n, u3k(u3t(u3t(u3t(taf))))); + + u3z(taf); + return fat; + } + else { + goto error; + } + } + } + error: { + u3m_p("wing", hyp); + + return u3m_error("find"); + } + } + +/* boilerplate +*/ + u3_noun + u3wfu_find(u3_noun cor) + { + u3_noun sut, way, hyp, van; + + if ( (c3n == u3r_mean(cor, u3x_sam_2, &way, + u3x_sam_3, &hyp, + u3x_con, &van, + 0)) || + (u3_none == (sut = u3r_at(u3x_sam, van))) ) + { + return u3m_bail(c3__fail); + } else { + return _cqfu_find(van, sut, way, hyp); + } + } + + u3_noun + u3qfu_find(u3_noun van, + u3_noun sut, + u3_noun way, + u3_noun hyp) + { + c3_m fun_m = 141 + c3__find + ((!!u3r_at(u3qfu_van_vet, van)) << 8); + u3_noun pro = u3z_find_3(fun_m, sut, way, hyp); + + if ( u3_none != pro ) { + return pro; + } + else { + pro = _cqfu_find(van, sut, way, hyp); + + return u3z_save_3(fun_m, sut, way, hyp, pro); + } + } + +/* boilerplate +*/ + u3_noun + u3wfu_fond(u3_noun cor) + { + u3_noun sut, way, hyp, van; + + if ( (c3n == u3r_mean(cor, u3x_sam_2, &way, + u3x_sam_3, &hyp, + u3x_con, &van, + 0)) || + (u3_none == (sut = u3r_at(u3x_sam, van))) ) + { + return u3m_bail(c3__fail); + } else { + return _cqfu_fond(van, sut, way, hyp); + } + } + + u3_noun + u3qfu_fond(u3_noun van, + u3_noun sut, + u3_noun way, + u3_noun hyp) + { + c3_m fun_m = 141 + c3__fond + ((!!u3r_at(u3qfu_van_vet, van)) << 8); + u3_noun pro = u3z_find_3(fun_m, sut, way, hyp); + + if ( u3_none != pro ) { + return pro; + } + else { + pro = _cqfu_fond(van, sut, way, hyp); + + return u3z_save_3(fun_m, sut, way, hyp, pro); + } + } diff --git a/jets/stage/f/ut_fire.c b/jets/stage/f/ut_fire.c new file mode 100644 index 000000000..873d4524b --- /dev/null +++ b/jets/stage/f/ut_fire.c @@ -0,0 +1,200 @@ +/* j/6/fire.c +** +*/ +#include "all.h" + + +/* logic +*/ + static u3_noun + _fire_vet(u3_noun van) + { + // u3_noun vet = u3j_hook(u3k(van), "vet"); + u3_noun vet = u3r_at(u3qfu_van_vet, van); + + switch ( vet ) { + case c3n: + case c3y: return vet; + default: return u3m_bail(c3__fail); + } + } + + static u3_noun + _fire_mull(u3_noun van, + u3_noun sut, + u3_noun dox, + u3_noun gen) + { + u3_noun rib = u3r_at(u3qfu_van_rib, van); + u3_noun key = u3nt(u3k(sut), + u3k(dox), + u3k(gen)); + u3_noun ret; + + if ( c3n == _fire_vet(van) ) { + ret = c3y; + } + if ( c3y == u3qdi_has(rib, key) ) { + ret = c3y; + } + else { + u3_noun rob = u3qdi_put(rib, key); + u3_noun von = u3i_molt(u3k(van), + u3qfu_van_rib, + u3k(rob), + 0); + u3_noun mul = u3qfu_mull(von, sut, c3__noun, dox, gen); + + ret = c3y; + + u3z(mul); + u3z(von); + u3z(rob); + } + u3z(key); + return ret; + } + + static u3_noun + _fire_each(u3_noun van, + u3_noun vet, + u3_noun typ, + u3_noun gat) + { + u3_noun p_typ, q_typ, pq_typ, qq_typ, rq_typ; + u3_noun ppq_typ, qpq_typ, rpq_typ; + u3_noun h_gat, t_gat; + + if ( (c3n == u3du(typ)) || (c3__core != u3h(typ)) ) { + return u3m_error("fire-core"); + } else if + ( (c3n == u3r_cell(u3t(typ), &p_typ, &q_typ)) || + (c3n == u3r_trel(q_typ, &pq_typ, &qq_typ, &rq_typ)) || + (c3n == u3r_trel(pq_typ, &ppq_typ, &qpq_typ, &rpq_typ)) || + (c3n == u3r_cell(gat, &h_gat, &t_gat)) ) + { + return u3m_bail(c3__fail); + } else { + u3_noun dox = u3nt(c3__core, + u3k(qq_typ), + u3nt(u3nt(u3k(ppq_typ), u3k(qpq_typ), c3__gold), + u3k(qq_typ), + u3k(rq_typ))); + + if ( (c3__ash == u3h(gat)) || (c3__dry == u3h(gat)) ) { + if ( (c3y == vet) && + (c3n == u3qfu_nest(van, qq_typ, c3y, p_typ)) ) + { +#if 0 + u3_noun dun = u3qfu_dunq(van, "need", qq_typ); + u3_noun niz = u3qfu_dunq(van, "have", p_typ); + + u3t_push(u3nc(c3__mean, niz)); + u3t_push(u3nc(c3__mean, dun)); +#endif + return u3m_error("fire-dry"); + } + else { + return u3nc(dox, u3k(t_gat)); + } + } + else { + c3_assert(c3__wet == u3h(gat)); +#if 0 + u3_noun dun = u3qfu_dunq(van, "wild", typ); + u3_noun niz = u3qfu_dunq(van, "tame", dox); + + u3t_push(u3nc(c3__mean, dun)); + u3t_push(u3nc(c3__mean, niz)); +#endif + if ( (c3y == vet) && + (c3n == _fire_mull(van, typ, dox, t_gat)) ) + { + return u3m_error("fire-wet"); + } + else { + u3z(dox); +#if 0 + u3t_drop(); + u3t_drop(); +#endif + return u3nc(u3k(typ), u3k(t_gat)); + } + } + } + } + + static u3_noun + _fire_in(u3_noun van, + u3_noun vet, + u3_noun hag) + { + if ( u3_nul == hag ) { + return u3_nul; + } + else { + u3_noun i_hag = u3h(hag); + u3_noun t_hag = u3t(hag); + + if ( c3n == u3du(i_hag) ) { + return u3m_bail(c3__fail); + } else { + return u3nc + (_fire_each(van, vet, u3h(i_hag), u3t(i_hag)), + _fire_in(van, vet, t_hag)); + } + } + } + + static u3_noun + _cqfu_fire(u3_noun van, + u3_noun sut, + u3_noun hag) + { + u3_noun vet = u3r_at(u3qfu_van_vet, van); + + c3_assert(!"not live"); + { + if ( (c3y == u3du(hag)) && (u3_nul == u3t(hag)) ) { + u3_noun i_hag = u3h(hag); + u3_noun pi_hag = u3h(i_hag); + u3_noun qi_hag = u3t(i_hag); + + if ( (c3__wet == u3h(qi_hag)) ) { + u3_noun qqi_hag = u3t(qi_hag); + + if ( c3y == u3du(qqi_hag) && + (u3_nul == u3h(qqi_hag)) && + (1 == u3t(qqi_hag)) ) + { + return u3k(pi_hag); + } + } + } + } + return u3nc(c3__hold, _fire_in(van, vet, hag)); + } + +/* boilerplate +*/ + u3_noun + u3wfu_fire(u3_noun cor) + { + u3_noun sut, hag, van; + + if ( (c3n == u3r_mean(cor, u3x_sam, &hag, u3x_con, &van, 0)) || + (u3_none == (sut = u3r_at(u3x_sam, van))) ) + { + return u3m_bail(c3__fail); + } else { + return _cqfu_fire(van, sut, hag); + } + } + + u3_noun + u3qfu_fire(u3_noun van, + u3_noun sut, + u3_noun hag) + { + return _cqfu_fire(van, sut, hag); + } diff --git a/jets/stage/f/ut_fish.c b/jets/stage/f/ut_fish.c new file mode 100644 index 000000000..6454e20b5 --- /dev/null +++ b/jets/stage/f/ut_fish.c @@ -0,0 +1,180 @@ +/* j/6/fish.c +** +*/ +#include "all.h" + +/* functions +*/ + static u3_noun + _fish_in(u3_noun, u3_noun, u3_atom, u3_noun); + + static u3_noun + _fish_fork(u3_noun van, + u3_noun p_sut, + u3_atom axe, + u3_noun vit) + { + if ( u3_nul == p_sut ) { + return u3nc(1, 1); + } + else { + u3_noun hed = _fish_in(van, u3h(p_sut), axe, vit); + u3_noun tal = _fish_fork(van, u3t(p_sut), axe, vit); + u3_noun pro = u3qf_flor(hed, tal); + + u3z(hed); + u3z(tal); + + return pro; + } + } + + static u3_noun + _fish_in(u3_noun van, + u3_noun sut, + u3_atom axe, + u3_noun vit) + { + u3_noun p_sut, q_sut; + + if ( c3y == u3ud(sut) ) switch ( sut ) { + default: return u3m_bail(c3__fail); + + case c3__noun: { + return u3nc(1, 0); + } + case c3__void: { + return u3nc(1, 1); + } + } + else switch ( u3h(sut) ) { + default: return u3m_bail(c3__fail); + + case c3__atom: { + if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { + return u3m_bail(c3__fail); + } else { + if ( c3n == u3du(q_sut) ) { + u3_noun ton = u3nt(3, 0, u3k(axe)); + u3_noun pro = u3qf_flip(ton); + + u3z(ton); + return pro; + } else { + return u3nt(5, + u3nc(1, u3k(u3t(q_sut))), + u3nc(0, u3k(axe))); + } + } + } + case c3__cell: { + if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { + return u3m_bail(c3__fail); + } else { + u3_noun hut = u3nt(3, 0, u3k(axe)); + u3_noun lef = u3qc_peg(axe, 2); + u3_noun rit = u3qc_peg(axe, 3); + u3_noun hed = _fish_in(van, p_sut, lef, vit); + u3_noun tal = _fish_in(van, q_sut, rit, vit); + u3_noun hob = u3qf_flan(hed, tal); + u3_noun vug = u3qf_flan(hut, hob); + + u3z(hob); + u3z(tal); + u3z(hed); + u3z(rit); + u3z(lef); + u3z(hut); + + return vug; + } + } + case c3__core: { + return u3m_error("fish-core"); + } + case c3__hint: + case c3__face: { + if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { + return u3m_bail(c3__fail); + } else { + return _fish_in(van, q_sut, axe, vit); + } + } + case c3__fork: p_sut = u3t(sut); + { + u3_noun yed = u3qdi_tap(p_sut); + u3_noun ret = _fish_fork(van, yed, axe, vit); + + u3z(yed); + return ret; + } + case c3__hold: { + p_sut = u3t(sut); + { + if ( (c3y == u3qdi_has(vit, sut)) ) { + // u3_noun dun = u3qfu_dunq(van, "type", sut); + u3_noun niz = u3qfu_shep + (van, "axis", 'd', u3k(axe)); + + // u3t_push(u3nc(c3__mean, dun)); + u3t_push(u3nc(c3__mean, niz)); + + return u3m_error("fish-loop"); + } else { + u3_noun zoc = u3qdi_put(vit, sut); + u3_noun fop = u3qfu_repo(van, sut); + u3_noun pro = _fish_in(van, fop, axe, zoc); + + u3z(fop); + u3z(zoc); + + return pro; + } + } + } + } + } + + static u3_noun + _cqfu_fish(u3_noun van, + u3_noun sut, + u3_atom axe) + { + return _fish_in(van, sut, axe, u3_nul); + } + + +/* boilerplate +*/ + u3_noun + u3wfu_fish(u3_noun cor) + { + u3_noun sut, axe, van; + + if ( (c3n == u3r_mean(cor, u3x_sam, &axe, u3x_con, &van, 0)) || + (c3n == u3ud(axe)) || + (u3_none == (sut = u3r_at(u3x_sam, van))) ) + { + return u3m_bail(c3__fail); + } else { + return _cqfu_fish(van, sut, axe); + } + } + + u3_noun + u3qfu_fish(u3_noun van, + u3_noun sut, + u3_noun axe) + { + c3_m fun_m = 141 + c3__fish + ((!!u3r_at(u3qfu_van_vet, van)) << 8); + u3_noun pro = u3z_find_2(fun_m, sut, axe); + + if ( u3_none != pro ) { + return pro; + } + else { + pro = _cqfu_fish(van, sut, axe); + + return u3z_save_2(fun_m, sut, axe, pro); + } + } diff --git a/jets/stage/f/ut_fuse.c b/jets/stage/f/ut_fuse.c new file mode 100644 index 000000000..069d0ba14 --- /dev/null +++ b/jets/stage/f/ut_fuse.c @@ -0,0 +1,215 @@ +/* j/6/fuse.c +** +*/ +#include "all.h" + +/* logic +*/ + static u3_noun + _fuse_in(u3_noun, u3_noun, u3_noun, u3_noun); + + static u3_noun + _fuse_repo(u3_noun van, + u3_noun sut, + u3_noun ref, + u3_noun bix) + { + u3_noun rep = u3qfu_repo(van, sut); + u3_noun ret = _fuse_in(van, rep, ref, bix); + + if ( c3y == u3r_sing(ret, rep) ) { + if ( c3__void == rep ) { + return c3__void; + } else { + u3z(rep); + u3z(ret); + return u3k(sut); + } + } else { + u3z(rep); + return ret; + } + } + + static u3_noun + _fuse_in_fork(u3_noun van, u3_noun p_sut, u3_noun ref, u3_noun bix) + { + if ( u3_nul == p_sut ) { + return u3_nul; + } + else { + return u3nc(_fuse_in(van, u3h(p_sut), ref, bix), + _fuse_in_fork(van, u3t(p_sut), ref, bix)); + } + } + + static u3_noun + _fuse_in(u3_noun van, + u3_noun sut, + u3_noun ref, + u3_noun bix) + { + u3_noun p_sut, q_sut; + + if ( c3y == u3r_sing(sut, ref) || (c3__noun == ref) ) { + return u3k(sut); + } + if ( c3n == u3du(sut) ) switch ( sut ) { + default: return u3m_bail(c3__fail); + + case c3__noun: + { + return u3k(ref); + } + case c3__void: + { + return c3__void; + } + } + else switch ( u3h(sut) ) { + default: return u3m_bail(c3__fail); + + case c3__atom: u3x_cell(u3t(sut), &p_sut, &q_sut); + { + if ( c3y == u3du(ref) ) { + if ( c3__atom == u3h(ref) ) { + u3_noun p_ref, q_ref; + + u3x_cell(u3t(ref), &p_ref, &q_ref); + { + u3_noun foc = (c3y == u3qf_fitz(p_ref, p_sut)) + ? u3k(p_sut) + : u3k(p_ref); + + if ( c3y == u3du(q_sut) ) { + if ( c3y == u3du(q_ref) ) { + if ( c3y == u3r_sing(q_ref, q_sut) ) { + return u3nt(c3__atom, foc, u3k(q_sut)); + } + else { + u3z(foc); + return c3__void; + } + } + else { + return u3nt(c3__atom, foc, u3k(q_sut)); + } + } else { + return u3nt(c3__atom, foc, u3k(q_ref)); + } + } + } + else if ( c3__cell == u3h(ref) ) { + return c3__void; + } + } + return _fuse_in(van, ref, sut, bix); + } + case c3__cell: u3x_cell(u3t(sut), &p_sut, &q_sut); + { + u3_noun p_ref, q_ref; + + if ( c3y == u3r_pq(ref, c3__cell, &p_ref, &q_ref) ) { + u3_noun hed = _fuse_in(van, p_sut, p_ref, bix); + u3_noun tal = _fuse_in(van, q_sut, q_ref, bix); + u3_noun ret = u3qf_cell(hed, tal); + + u3z(hed); + u3z(tal); + return ret; + } + else return _fuse_in(van, ref, sut, bix); + } + case c3__core: + { + return _fuse_repo(van, sut, ref, bix); + } + case c3__hint: u3x_cell(u3t(sut), &p_sut, &q_sut); + { + u3_noun vot = _fuse_in(van, q_sut, ref, bix); + u3_noun ret = u3qf_hint(p_sut, vot); + + u3z(vot); + return ret; + } + case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut); + { + u3_noun vot = _fuse_in(van, q_sut, ref, bix); + u3_noun ret = u3qf_face(p_sut, vot); + + u3z(vot); + return ret; + } + case c3__fork: p_sut = u3t(sut); + { + u3_noun yed = u3qdi_tap(p_sut); + u3_noun ret = u3kf_fork(_fuse_in_fork(van, yed, ref, bix)); + + u3z(yed); + return ret; + } + case c3__hold: + { + u3_noun hud = u3nc(u3k(sut), u3k(ref)); + + if ( c3y == u3qdi_has(bix, hud) ) { + // u3_noun dun = u3qfu_dunq(van, "type", sut); + // u3_noun niz = u3qfu_dunq(van, "over", ref); + + // u3t_push(u3nc(c3__mean, dun)); + // u3t_push(u3nc(c3__mean, niz)); + + return u3m_error("fuse-loop"); + } else { + u3_noun bux = u3qdi_put(bix, hud); + u3_noun ret = _fuse_repo(van, sut, ref, bux); + + u3z(hud); + u3z(bux); + return ret; + } + } + } + } + + static u3_noun + _cqfu_fuse(u3_noun van, + u3_noun sut, + u3_noun ref) + { + return _fuse_in(van, sut, ref, u3_nul); + } + +/* boilerplate +*/ + u3_noun + u3wfu_fuse(u3_noun cor) + { + u3_noun sut, ref, van; + + if ( (c3n == u3r_mean(cor, u3x_sam, &ref, u3x_con, &van, 0)) || + (u3_none == (sut = u3r_at(u3x_sam, van))) ) + { + return u3m_bail(c3__fail); + } else { + return _cqfu_fuse(van, sut, ref); + } + } + + u3_noun + u3qfu_fuse(u3_noun van, + u3_noun sut, + u3_noun ref) + { + c3_m fun_m = 141 + c3__fuse + ((!!u3r_at(u3qfu_van_vet, van)) << 8); + u3_noun pro = u3z_find_2(fun_m, sut, ref); + + if ( u3_none != pro ) { + return pro; + } + else { + pro = _cqfu_fuse(van, sut, ref); + + return u3z_save_2(fun_m, sut, ref, pro); + } + } diff --git a/jets/stage/f/ut_gain.c b/jets/stage/f/ut_gain.c new file mode 100644 index 000000000..509740ab1 --- /dev/null +++ b/jets/stage/f/ut_gain.c @@ -0,0 +1,16 @@ +/* j/6/gain.c +** +*/ +#include "all.h" + + + u3_noun + u3qfu_gain(u3_noun van, + u3_noun sut, + u3_noun gen) + { + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + u3_noun gat = u3j_cook("u3qfu_gain-gain", von, "gain"); + + return u3n_kick_on(u3i_molt(gat, u3x_sam, u3k(gen), 0)); + } diff --git a/jets/stage/f/ut_lose.c b/jets/stage/f/ut_lose.c new file mode 100644 index 000000000..16e9f6c0f --- /dev/null +++ b/jets/stage/f/ut_lose.c @@ -0,0 +1,16 @@ +/* j/6/lose.c +** +*/ +#include "all.h" + + + u3_noun + u3qfu_lose(u3_noun van, + u3_noun sut, + u3_noun gen) + { + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + u3_noun gat = u3j_cook("u3qfu_lose-lose", von, "lose"); + + return u3n_kick_on(u3i_molt(gat, u3x_sam, u3k(gen), 0)); + } diff --git a/jets/stage/f/ut_mint.c b/jets/stage/f/ut_mint.c new file mode 100644 index 000000000..54ff5c466 --- /dev/null +++ b/jets/stage/f/ut_mint.c @@ -0,0 +1,904 @@ +/* j/6/mint.c +** +*/ +#include "all.h" + +/* logic +*/ + static u3_noun + _mint_in(u3_noun, u3_noun, u3_noun, u3_noun); + + static u3_noun + _mint_bean() + { + return u3kf_fork(u3nt(u3nq(c3__atom, 'f', u3_nul, 0), + u3nq(c3__atom, 'f', u3_nul, 1), + u3_nul)); + } + + static u3_noun + _mint_tend(u3_noun vit) + { + if ( u3_nul == vit ) { + return 1; + } else { + u3_noun nex = _mint_tend(u3t(vit)); + + if ( u3_nul == u3h(vit) ) { + return nex; + } else { + u3_noun boy = u3qc_peg(u3t(u3h(vit)), nex); + + u3z(nex); + return boy; + } + } + } + + static u3_noun + _mint_vet(u3_noun van) + { + // u3_noun vet = u3j_hook(u3k(van), "vet"); + u3_noun vet = u3r_at(u3qfu_van_vet, van); + + switch ( vet ) { + case c3n: + case c3y: return vet; + default: return u3m_bail(c3__fail); + } + } + + static u3_noun + _mint_feel(u3_noun van, + u3_noun sut, + u3_noun rot) + { + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + u3_noun gat = u3j_hook(von, "feel"); + + return u3n_kick_on(u3i_molt(gat, + u3x_sam, + u3k(rot), + 0)); + } + + static u3_noun + _mint_mine(u3_noun van, + u3_noun sut, + u3_noun mel, + u3_noun nym, + u3_noun hud, + u3_noun dom) + { + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + u3_noun gat = u3j_hook(von, "mine"); + + return u3n_kick_on(u3i_molt(gat, + u3x_sam_2, + u3k(mel), + u3x_sam_6, + u3k(nym), + u3x_sam_14, + u3k(hud), + u3x_sam_15, + u3k(dom), + 0)); + } + + static u3_noun + _mint_burp(u3_noun van, + u3_noun sut) + { + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + + return u3j_hook(von, "burp"); + } + + static u3_noun + _mint_cond(u3_noun pex, + u3_noun yom, + u3_noun woq) + { + if ( 1 == u3h(pex) ) { + if ( 0 == u3t(pex) ) { + u3z(pex); + u3z(woq); + + return yom; + } + else if ( 1 == u3t(pex) ) { + u3z(pex); + u3z(yom); + + return woq; + } + } + return u3nq(6, pex, yom, woq); + } + + static u3_noun + _mint_corn(u3_noun van, + u3_noun sut, + u3_noun gen) + { + u3_noun mil = _mint_in(van, sut, c3__noun, gen); + u3_noun fol = u3k(u3t(mil)); + + u3z(mil); + return fol; + } + + static u3_noun + _mint_nice(u3_noun van, + u3_noun gol, + u3_noun typ) + { + if ( (c3y == _mint_vet(van)) && + (c3n == u3qfu_nest(van, gol, c3y, typ)) ) + { + // u3_noun dun = u3qfu_dunq(van, "need", gol); + // u3_noun niz = u3qfu_dunq(van, "have", typ); + + // u3t_push(u3nc(c3__mean, dun)); + // u3t_push(u3nc(c3__mean, niz)); + + return u3m_error("mint-nice"); + } + else return typ; + } + + static u3_noun + _mint_cove(u3_noun nug) + { + if ( 0 == u3h(nug) ) { + return u3k(u3t(nug)); + } + else if ( 11 == u3h(nug) ) { + return _mint_cove(u3t(u3t(nug))); + } + else { + return u3m_error("mint-cove"); + } + } + + static u3_noun + _mint_grow(u3_noun van, + u3_noun sut, + u3_noun gol, + u3_atom mel, + u3_noun nym, + u3_noun hud, + u3_noun ruf, + u3_noun dom) + { + u3_noun dan = _mint_in(van, sut, c3__noun, ruf); + u3_noun p_dan = u3h(dan); + u3_noun q_dan = u3t(dan); + u3_noun pul = _mint_mine(van, p_dan, mel, nym, hud, dom); + u3_noun ret = u3nc(_mint_nice(van, gol, u3k(u3h(pul))), + u3qf_cons(u3t(pul), q_dan)); + + u3z(pul); + u3z(dan); + return ret; + } + + static u3_noun + _mint_loc(u3_noun van, + u3_noun loc) + { + u3_noun mol = u3nc('o', u3k(loc)); + u3_noun sho = u3j_cook("_mint_loc-show", u3k(van), "show"); + u3_noun ret = u3i_molt(u3k(sho), u3x_sam, u3k(mol), 0); + + u3z(mol); + u3z(sho); + + return ret; + } + +#if 1 + static u3_noun + _mint_cnts(u3_noun van, + u3_noun sut, + u3_noun gol, + u3_noun hyp, + u3_noun rig) + { + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + u3_noun gat = u3j_cook("_mint_cnts-emin", von, "emin"); + + return u3n_kick_on(u3i_molt(gat, + u3x_sam_2, + u3k(gol), + u3x_sam_6, + u3k(hyp), + u3x_sam_7, + u3k(rig), + 0)); + } +#else + static u3_noun + _mint_edit(u3_noun van, + u3_noun sut, + u3_noun mew, + u3_noun p_lar, + u3_noun rag, + u3_noun hej) + { + while ( 1 ) { + if ( c3n == u3du(mew) ) { + u3_noun gim = u3qfu_fire(van, sut, rag); + u3_noun fol = u3qf_hike(p_lar, hej); + + u3z(rag); + u3z(hej); + + return u3nc(gim, fol); + } else { + u3_noun i_mew = u3h(mew); + u3_noun t_mew = u3t(mew); + u3_noun pi_mew = u3h(i_mew); + u3_noun qi_mew = u3t(i_mew); + u3_noun zil = u3qfu_mint(van, sut, c3__noun, qi_mew); + u3_noun p_zil = u3h(zil); + u3_noun q_zil = u3t(zil); + u3_noun wip = u3qfu_toss(van, sut, pi_mew, p_zil, rag); + + u3z(rag); + rag = u3k(u3t(wip)); + + hej = u3nc(u3nc(u3k(u3h(wip)), + u3k(q_zil)), + hej); + + u3z(zil); + u3z(wip); + + mew = t_mew; + } + } + } + static u3_noun + _mint_cnts_old(u3_noun van, + u3_noun sut, + u3_noun gol, + u3_noun hyp, + u3_noun rig) + { + u3_noun lar = u3qfu_seek(van, sut, c3__read, hyp); + u3_noun p_lar = u3h(lar); + u3_noun q_lar = u3t(lar); + u3_noun pq_lar = u3h(q_lar); + u3_noun qq_lar = u3t(q_lar); + u3_noun mew = rig; + u3_noun yom = _mint_edit(van, sut, mew, p_lar, u3k(qq_lar), u3_nul); + u3_noun p_yom = u3h(yom); + u3_noun q_yom = u3t(yom); + u3_noun ret = u3nc(_mint_nice(van, gol, u3k(p_yom)), + (0 == pq_lar) ? u3k(q_yom) + : u3nt(9, u3k(pq_lar), u3k(q_yom))); + + u3z(yom); + u3z(lar); + + return ret; + } +#endif + +# define _mint_used() + + static u3_noun + _mint_in(u3_noun van, + u3_noun sut, + u3_noun gol, + u3_noun gen) + { + u3_noun p_gen, q_gen, r_gen; + u3_noun ret; + + if ( (c3__void == sut) && + !((c3y == u3du(gen)) && (c3__dbug == u3h(gen))) ) + { + if ( (c3n == _mint_vet(van)) + || ((c3y == u3du(gen)) && + ((c3__zpfs == u3h(gen)) || + (c3__zpsk == u3h(gen)) || + (c3__lost == u3h(gen)) || + (c3__fail == u3h(gen)) || + (c3__zpzp == u3h(gen)))) ) + { + return u3nt(c3__void, 0, 0); + } + else { + return u3m_error("mint-vain"); + } + } + + if ( c3n == u3du(gen) ) { + u3_noun ter = u3r_at(u3x_con_3, van); + u3_noun fab = u3r_at(u3qfu_van_fab, van); + u3_noun rex = u3qfp_open(ter, fab, gen); + + ret = _mint_in(van, sut, gol, rex); + u3z(rex); + + return ret; + } + else if ( c3y == u3du(u3h(gen)) ) { + _mint_used(); + { + u3_noun hed = _mint_in(van, sut, c3__noun, u3h(gen)); + u3_noun tal = _mint_in(van, sut, c3__noun, u3t(gen)); + u3_noun typ = u3qf_cell(u3h(hed), u3h(tal)); + + ret = u3nc(_mint_nice(van, gol, typ), + u3qf_cons(u3t(hed), + u3t(tal))); + + u3z(hed); + u3z(tal); + + return ret; + } + } else switch ( u3h(gen) ) { + default: { + u3_noun ter = u3r_at(u3x_con_3, van); + u3_noun fab = u3r_at(u3qfu_van_fab, van); + u3_noun rex = u3qfp_open(ter, fab, gen); + + if ( c3y == u3r_sing(rex, gen) ) { +#if 1 + u3_noun zix = u3qfu_shep(van, "gene", 'q', u3k(gen)); + + u3t_push(u3nc(c3__mean, zix)); + return u3m_error("mint-open"); +#else + u3_err("h", u3h(gen)); + return u3m_bail(c3__fail); +#endif + } + ret = _mint_in(van, sut, gol, rex); + u3z(rex); + + return ret; + } + + case c3__fits: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mint_used(); + { + u3_noun wam = u3qfu_play(van, sut, p_gen); + u3_noun dok = u3nc(c3__wing, u3k(q_gen)); + u3_noun vol = _mint_corn(van, sut, dok); + u3_noun axe = _mint_cove(vol); + + ret = u3nc(_mint_nice(van, gol, _mint_bean()), + u3qfu_fish(van, wam, axe)); + + u3z(axe); + u3z(vol); + u3z(wam); + u3z(dok); + + return ret; + } + + case c3__wtcl: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); + _mint_used(); + { + u3_noun bol = _mint_bean(); + u3_noun nor = _mint_in(van, sut, bol, p_gen); + u3_noun fex = u3qfu_gain(van, sut, p_gen); + u3_noun wux = u3qfu_lose(van, sut, p_gen); + u3_noun duy = (c3__void == fex) + ? ( (c3__void == wux) + ? u3nc(0, 0) + : u3nc(1, 1) ) + : ( (c3__void == wux) + ? u3nc(1, 0) + : u3k(u3t(nor)) ); + u3_noun hiq = _mint_in(van, fex, gol, q_gen); + u3_noun ran = _mint_in(van, wux, gol, r_gen); + + ret = u3nc(u3qf_forq(u3h(hiq), + u3h(ran)), + _mint_cond(duy, + u3k(u3t(hiq)), + u3k(u3t(ran)))); + + u3z(ran); + u3z(hiq); + u3z(nor); + u3z(wux); + u3z(fex); + u3z(bol); + + return ret; + } + + case c3__clhp: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mint_used(); + { + u3_noun hed = _mint_in(van, sut, c3__noun, p_gen); + u3_noun tal = _mint_in(van, sut, c3__noun, q_gen); + u3_noun typ = u3qf_cell(u3h(hed), u3h(tal)); + + ret = u3nc(_mint_nice(van, gol, typ), + u3qf_cons(u3t(hed), + u3t(tal))); + + u3z(hed); + u3z(tal); + + return ret; + } + + case c3__dtts: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mint_used(); + { + u3_noun typ = _mint_nice(van, gol, _mint_bean()); + u3_noun one = _mint_in(van, sut, c3__noun, p_gen); + u3_noun two = _mint_in(van, sut, c3__noun, q_gen); + u3_noun ret; + + if ( (c3y == _mint_vet(van)) && + (c3n == u3qfu_nest(van, u3h(one), c3n, u3h(two))) && + (c3n == u3qfu_nest(van, u3h(two), c3y, u3h(one))) ) + { + return u3m_error("nest"); + } + ret = u3nc(typ, u3nt(5, u3k(u3t(one)), u3k(u3t(two)))); + u3z(one); + u3z(two); + + return ret; + } + + case c3__dtwt: p_gen = u3t(gen); + _mint_used(); + { + u3_noun typ = _mint_nice(van, gol, _mint_bean()); + + return u3nc(typ, + u3nc(3, _mint_corn(van, sut, p_gen))); + } + + case c3__dtkt: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mint_used(); + { + u3_noun nog = u3nc(c3__kttr, u3k(p_gen)); + u3_noun nef = _mint_in(van, sut, gol, nog); + u3_noun viz = _mint_in(van, sut, c3__noun, q_gen); + + ret = u3nc(u3k(u3h(nef)), + u3nt(12, u3nc(1, u3nc(151, u3k(u3h(nef)))), u3k(u3t(viz)))); + + u3z(viz); + u3z(nef); + u3z(nog); + return ret; + } + + case c3__dtls: p_gen = u3t(gen); + _mint_used(); + { + u3_noun tom = u3nt(c3__atom, u3_blip, u3_nul); + u3_noun sam = _mint_in(van, sut, tom, p_gen); + + ret = u3nc(_mint_nice(van, gol, tom), + u3nc(4, u3k(u3t(sam)))); + + u3z(sam); + return ret; + } + + case c3__rock: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mint_used(); + { + u3_noun typ = u3qfu_play(van, sut, gen); + u3_noun ret = u3nc(_mint_nice(van, gol, typ), + u3nc(1, u3k(q_gen))); + + return ret; + } + + case c3__dttr: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mint_used(); + { + u3_noun one = _mint_corn(van, sut, p_gen); + u3_noun two = _mint_corn(van, sut, q_gen); + + return u3nc(_mint_nice(van, gol, c3__noun), + u3nt(2, one, two)); + } + + case c3__sand: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mint_used(); + { + u3_noun typ = u3qfu_play(van, sut, gen); + u3_noun ret = u3nc(_mint_nice(van, gol, typ), + u3nc(1, u3k(q_gen))); + + return ret; + } + + case c3__hand: + _mint_used(); + { + return u3k(u3t(gen)); + } + + case c3__ktbr: p_gen = u3t(gen); + _mint_used(); + { + u3_noun ryd = _mint_in(van, sut, gol, p_gen); + u3_noun tyf = u3qfu_wrap(van, u3h(ryd), c3__iron); + u3_noun tyn = _mint_nice(van, gol, tyf); + u3_noun pro = u3nc(tyn, u3k(u3t(ryd))); + + u3z(ryd); + return pro; + } + + case c3__ktpd: + case c3__ktpm: p_gen = u3t(gen); + _mint_used(); + { + u3_noun ryd = _mint_in(van, sut, gol, p_gen); + u3_noun tyf = u3qfu_wrap(van, u3h(ryd), c3__zinc); + u3_noun tyn = _mint_nice(van, gol, tyf); + u3_noun pro = u3nc(tyn, u3k(u3t(ryd))); + + u3z(ryd); + return pro; + } + + case c3__ktwt: p_gen = u3t(gen); + _mint_used(); + { + u3_noun ryd = _mint_in(van, sut, gol, p_gen); + u3_noun tyf = u3qfu_wrap(van, u3h(ryd), c3__lead); + u3_noun tyn = _mint_nice(van, gol, tyf); + u3_noun pro = u3nc(tyn, u3k(u3t(ryd))); + + u3z(ryd); + return pro; + } + + case c3__note: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mint_used(); + { + u3_noun hit = u3nc(u3k(sut), u3k(p_gen)); + u3_noun hum = _mint_in(van, sut, gol, q_gen); + + u3_noun ret = u3nc(u3qf_hint(hit, u3h(hum)), + u3k(u3t(hum))); + u3z(hum); + u3z(hit); + return ret; + } + + case c3__tune: p_gen = u3t(gen); + _mint_used(); + { + return u3nc(u3qf_face(p_gen, sut), u3nc(0, 1)); + } + + case c3__ktls: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mint_used(); + { + u3_noun huz = u3qfu_play(van, sut, p_gen); + u3_noun hif = _mint_nice(van, gol, huz); + u3_noun zel = _mint_in(van, sut, hif, q_gen); + u3_noun ret = u3nc(hif, u3k(u3t(zel))); + + u3z(zel); + return ret; + } + + case c3__tsbn: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mint_used(); + { + u3_noun fid = _mint_in(van, sut, c3__noun, p_gen); + u3_noun p_fid = u3h(fid); + u3_noun q_fid = u3t(fid); + + if ( 0 == p_fid ) { + u3m_p("bad subject: p_gen", p_gen); + c3_assert(0); + } + u3_noun dov = _mint_in(van, p_fid, gol, q_gen); + u3_noun p_dov = u3h(dov); + u3_noun q_dov = u3t(dov); + + ret = u3nc(u3k(p_dov), + u3qf_comb(q_fid, q_dov)); + + u3z(fid); + u3z(dov); + return ret; + } + + case c3__tscm: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mint_used(); + { + u3_noun boc = u3qfu_busk(van, sut, p_gen); + u3_noun ret = _mint_in(van, boc, gol, q_gen); + + u3z(boc); + return ret; + } + + case c3__cnts: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mint_used(); + { + return _mint_cnts(van, sut, gol, p_gen, q_gen); + } + + case c3__brcn: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mint_used(); + { + u3_noun ruf = u3nc(u3_nul, 1); + + ret = _mint_grow(van, sut, gol, c3__gold, p_gen, c3__dry, ruf, q_gen); + u3z(ruf); + + return ret; + } + + case c3__brvt: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mint_used(); + { + u3_noun ruf = u3nc(u3_nul, 1); + + ret = _mint_grow(van, sut, gol, c3__gold, p_gen, c3__wet, ruf, q_gen); + u3z(ruf); + + return ret; + } + + case c3__sgzp: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mint_used(); + { + u3_noun typ = u3qfu_play(van, sut, p_gen); + u3_noun dug = u3qfu_duck(van, typ); + + u3t_push(u3nc(c3__mean, dug)); + { + ret = _mint_in(van, sut, gol, q_gen); + } + u3t_drop(); + + u3z(typ); + return ret; + } + + case c3__sgbn: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mint_used(); + { + u3_noun hum = _mint_in(van, sut, gol, q_gen); + u3_noun bez; + + if ( c3y == u3ud(p_gen) ) { + bez = u3k(p_gen); + } else { + bez = u3nc(u3k(u3h(p_gen)), + _mint_corn(van, sut, u3t(p_gen))); + } + ret = u3nc(u3k(u3h(hum)), + u3nt(11, bez, u3k(u3t(hum)))); + + u3z(hum); + return ret; + } + + case c3__zpts: p_gen = u3t(gen); + _mint_used(); + { + u3_noun von = u3i_molt(u3k(van), u3qfu_van_vet, c3n, 0); + u3_noun sev = _mint_corn(von, sut, p_gen); + + u3z(von); + return u3nc(c3__noun, u3nc(1, sev)); + } + + case c3__ktcn: p_gen = u3t(gen); + _mint_used(); + { + u3_noun von = u3i_molt(u3k(van), u3qfu_van_fab, c3n, 0); + u3_noun ret = _mint_in(von, sut, gol, p_gen); + + u3z(von); + return ret; + } + + case c3__wthx: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mint_used(); + { + u3_noun hyp = u3nc(u3nc(c3y, 1), u3k(q_gen)); + u3_noun fid = u3qfu_find(van, sut, c3__free, hyp); + + if ( c3y != u3h(fid) ) { + return u3m_error("mint-fragment"); + } + else { + u3_noun pp_fid = u3h(u3t(fid)); + u3_noun qp_fid = u3t(u3t(fid)); + + if ( c3y != u3h(qp_fid) ) { + return u3m_error("mint-fragment"); + } + else { + u3_noun pqp_fid = u3t(qp_fid); + u3_noun axe = _mint_tend(pp_fid); + u3_noun ret; + + ret = u3nc(_mint_nice(van, gol, _mint_bean()), + u3qfr_fish(van, pqp_fid, p_gen, axe)); + + u3z(axe); + u3z(fid); + u3z(hyp); + + return ret; + } + } + } + + case c3__cold: + case c3__ktsg: p_gen = u3t(gen); + _mint_used(); + { + + c3_m fun_m = 141 + c3__blow; + u3_noun vrf = u3r_at(u3qfu_van_vrf, van); + u3_noun pro = u3z_find_4(fun_m, vrf, sut, gol, p_gen); + + if ( u3_none != pro ) { + return pro; + } + else { + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + u3_noun gat = u3j_cook("_mint_in-blow", von, "blow"); + u3_noun pro; + + pro = u3n_kick_on(u3i_molt(gat, + u3x_sam_2, + u3k(gol), + u3x_sam_3, + u3k(p_gen), + 0)); + + return u3z_save_4(fun_m, vrf, sut, gol, p_gen, pro); + } + } + + case c3__zpcm: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mint_used(); + { + return u3nc(_mint_nice(van, + gol, + u3qfu_play(van, sut, p_gen)), + u3nc(1, u3k(q_gen))); + } + + case c3__dbug: u3x_cell(u3t(gen), &p_gen, &q_gen); + { + u3t_push(u3nc(c3__mean, _mint_loc(van, p_gen))); + { + u3_noun hum = _mint_in(van, sut, gol, q_gen); + u3_noun bez = u3nt(c3__spot, 1, u3k(p_gen)); + + ret = u3nc(u3k(u3h(hum)), u3nt(11, bez, u3k(u3t(hum)))); + u3z(hum); + } + u3t_drop(); + return ret; + } + + case c3__zpmc: + case c3__zpsm: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mint_used(); + { + u3_noun vos = _mint_in(van, sut, c3__noun, q_gen); + u3_noun zur = u3qfu_play(van, sut, p_gen); + u3_noun p_vos = u3h(vos); + u3_noun q_vos = u3t(vos); + u3_noun waz = u3nc(1, _mint_burp(van, p_vos)); + // u3_noun waz = u3nc(1, u3k(p_vos)); + u3_noun sif = u3k(zur); + u3_noun cig = u3qf_cell(sif, p_vos); + u3_noun ret; + + ret = u3nc(_mint_nice(van, gol, cig), + u3qf_cons(waz, q_vos)); + + u3z(waz); + u3z(zur); + u3z(sif); + u3z(vos); + + return ret; + } + + case c3__zpvt: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); + _mint_used(); + { + if ( c3y == _mint_feel(van, sut, p_gen) ) { + return _mint_in(van, sut, gol, q_gen); + } else { + return _mint_in(van, sut, gol, r_gen); + } + } + + case c3__lost: p_gen = u3t(gen); + _mint_used(); + { + if ( c3y == _mint_vet(van) ) { + u3_noun zur = u3qfu_play(van, sut, p_gen); + u3_noun dun = u3qfu_dunq(van, "lost", zur); + + u3t_push(u3nc(c3__mean, dun)); + return u3m_error("mint-lost"); + } + else { + return u3nt(c3__void, 0, 0); + } + } + + case c3__fail: + case c3__zpzp: + _mint_used(); + { + return u3nt(c3__void, 0, 0); + } + } + } + + static u3_noun + _cqfu_mint(u3_noun van, + u3_noun sut, + u3_noun gol, + u3_noun gen) + { + return _mint_in(van, sut, gol, gen); + } + +/* boilerplate +*/ + u3_noun + u3wfu_mint(u3_noun cor) + { + u3_noun sut, gol, gen, van; + + if ( (c3n == u3r_mean(cor, u3x_sam_2, &gol, + u3x_sam_3, &gen, + u3x_con, &van, + 0)) || + (u3_none == (sut = u3r_at(u3x_sam, van))) ) + { + return u3m_bail(c3__fail); + } else { + return _cqfu_mint(van, sut, gol, gen); + } + } + + u3_noun + u3qfu_mint(u3_noun van, + u3_noun sut, + u3_noun gol, + u3_noun gen) + { + c3_m fun_m = 141 + c3__mint; + u3_noun vrf = u3r_at(u3qfu_van_vrf, van); + u3_noun pro = u3z_find_4(fun_m, vrf, sut, gol, gen); + + if ( u3_none != pro ) { + return pro; + } + else { + pro = _cqfu_mint(van, sut, gol, gen); + + return u3z_save_4(fun_m, vrf, sut, gol, gen, pro); + } + } diff --git a/jets/stage/f/ut_mull.c b/jets/stage/f/ut_mull.c new file mode 100644 index 000000000..760ebbf1f --- /dev/null +++ b/jets/stage/f/ut_mull.c @@ -0,0 +1,852 @@ +/* j/6/mull.c +** +*/ +#include "all.h" + +/* functions +*/ + static u3_noun + _mull_in(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); + + static u3_noun + _mull_bean() + { + return u3kf_fork(u3nt(u3nq(c3__atom, 'f', u3_nul, 0), + u3nq(c3__atom, 'f', u3_nul, 1), + u3_nul)); + } + + static u3_noun + _mull_loc(u3_noun van, + u3_noun loc) + { + u3_noun mol = u3nc('o', u3k(loc)); + u3_noun sho = u3j_cook("_mull_loc-show", u3k(van), "show"); + u3_noun ret = u3i_molt(u3k(sho), u3x_sam, u3k(mol), 0); + + u3z(mol); + u3z(sho); + + return ret; + } + + static u3_noun + _mull_feel(u3_noun van, + u3_noun sut, + u3_noun rot) + { + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + u3_noun gat = u3j_hook(von, "feel"); + + return u3n_kick_on(u3i_molt(gat, + u3x_sam, + u3k(rot), + 0)); + } + + static u3_noun + _mull_tend(u3_noun vit) + { + if ( u3_nul == vit ) { + return 1; + } else { + u3_noun nex = _mull_tend(u3t(vit)); + + if ( u3_nul == u3h(vit) ) { + return nex; + } else { + u3_noun boy = u3qc_peg(u3t(u3h(vit)), nex); + + u3z(nex); + return boy; + } + } + } + static u3_noun + _mull_cove(u3_noun nug) + { + if ( 0 == u3h(nug) ) { + return u3k(u3t(nug)); + } + else if ( 11 == u3h(nug) ) { + return _mull_cove(u3t(u3t(nug))); + } + else { + return u3m_error("mull-cove"); + } + } + + static u3_noun + _mull_mile(u3_noun van, + u3_noun sut, + u3_noun dox, + u3_noun mel, + u3_noun nym, + u3_noun hud, + u3_noun dom) + { + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + u3_noun gat = u3j_hook(von, "mile"); + + // fprintf(stderr, "mile\r\n"); + return u3n_kick_on(u3i_molt(gat, + u3x_sam_2, + u3k(dox), + u3x_sam_6, + u3k(mel), + u3x_sam_14, + u3k(nym), + u3x_sam_30, + u3k(hud), + u3x_sam_31, + u3k(dom), + 0)); + } + + static u3_noun + _mull_doke(u3_noun van, + u3_noun sut, + u3_noun gen) + { + u3_noun fug = u3qfu_mint(van, sut, c3__noun, gen); + u3_noun axe = _mull_cove(u3t(fug)); + + u3z(fug); + return axe; + } + + static u3_noun + _mull_nice(u3_noun van, + u3_noun gol, + u3_noun typ) + { + if ( c3n == u3qfu_nest(van, gol, c3y, typ) ) { + // u3_noun dun = u3qfu_dunq(van, "need", gol); + // u3_noun niz = u3qfu_dunq(van, "have", typ); + + // u3t_push(u3nc(c3__mean, dun)); + // u3t_push(u3nc(c3__mean, niz)); + + return u3m_error("mull-nice"); + } + else return typ; + } + + static u3_noun + _mull_grow(u3_noun van, + u3_noun sut, + u3_noun gol, + u3_noun dox, + u3_atom mel, + u3_noun nym, + u3_noun hud, + u3_noun ruf, + u3_noun dom) + { + u3_noun dan = _mull_in(van, sut, c3__noun, dox, ruf); + u3_noun p_dan = u3h(dan); + u3_noun q_dan = u3t(dan); + u3_noun yaz = _mull_mile(van, p_dan, q_dan, mel, nym, hud, dom); + u3_noun p_yaz = u3h(yaz); + u3_noun q_yaz = u3t(yaz); + u3_noun ret = u3nc(_mull_nice(van, gol, u3k(p_yaz)), u3k(q_yaz)); + + u3z(yaz); + u3z(dan); + + return ret; + } + + static u3_noun + _mull_both(u3_noun van, + u3_noun gol, + u3_noun typ) + { + return u3nc(_mull_nice(van, gol, u3k(typ)), + typ); + } + +#if 1 + static u3_noun + _mull_cnts(u3_noun van, + u3_noun sut, + u3_noun gol, + u3_noun dox, + u3_noun hyp, + u3_noun rig) + { + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + u3_noun gat = u3j_cook("_mull_cnts-emul", von, "emul"); + + return u3n_kick_on(u3i_molt(gat, + u3x_sam_2, + u3k(gol), + u3x_sam_6, + u3k(dox), + u3x_sam_14, + u3k(hyp), + u3x_sam_15, + u3k(rig), + 0)); + } +#else + static u3_noun + _mull_edit(u3_noun van, + u3_noun sut, + u3_noun dox, + u3_noun mew, + u3_noun p_yom, + u3_noun q_yom) + { + while ( 1 ) { + if ( c3n == u3du(mew) ) { + return u3nc(p_yom, q_yom); + } else { + u3_noun i_mew = u3h(mew); + u3_noun t_mew = u3t(mew); + u3_noun pi_mew = u3h(i_mew); + u3_noun qi_mew = u3t(i_mew); + u3_noun zil = _mull_in(van, sut, c3__noun, dox, qi_mew); + u3_noun p_zil = u3h(zil); + u3_noun q_zil = u3t(zil); + u3_noun cuf = u3qfu_toss(van, sut, pi_mew, p_zil, p_yom); + u3_noun dof = u3qfu_toss(van, sut, pi_mew, q_zil, q_yom); + + if ( u3r_sing(u3h(cuf), u3h(dof)) ) { + u3m_error("mull-bonk-a"); + } + + u3z(p_yom); + p_yom = u3k(u3t(cuf)); + + u3z(q_yom); + q_yom = u3k(u3t(dof)); + + u3z(dof); + u3z(cuf); + u3z(zil); + + mew = t_mew; + } + } + } + + static u3_noun + _mull_cnts_old(u3_noun van, + u3_noun sut, + u3_noun gol, + u3_noun dox, + u3_noun hyp, + u3_noun rig) + { + u3_noun lar = u3qfu_seek(van, sut, c3__read, hyp); + u3_noun vug = u3qfu_seek(van, dox, c3__read, hyp); + u3_noun p_lar = u3h(lar); + u3_noun q_lar = u3t(lar); + u3_noun pq_lar = u3h(q_lar); + u3_noun qq_lar = u3t(q_lar); + u3_noun p_vug = u3h(vug); + u3_noun q_vug = u3t(vug); + u3_noun pq_vug = u3h(q_vug); + u3_noun qq_vug = u3t(q_vug); + + if ( c3a(u3r_sing(p_lar, p_vug), u3r_sing(pq_lar, pq_vug)) ) { + u3m_error("mull-bonk-e"); + } + { + u3_noun mew = rig; + u3_noun yom = _mull_edit + (van, sut, dox, mew, u3k(qq_lar), + u3k(qq_vug)); + u3_noun von = u3i_molt(u3k(van), u3qfu_van_vet, c3n, 0); + u3_noun p_ret = u3qfu_fire(van, sut, u3h(yom)); + u3_noun q_ret = u3qfu_fire(von, sut, u3t(yom)); + + u3z(von); + u3z(yom); + u3z(vug); + u3z(lar); + + return u3nc(_mull_nice(van, gol, p_ret), q_ret); + } + } +#endif + +# define _mull_used() + + static u3_noun + _mull_in(u3_noun van, + u3_noun sut, + u3_noun gol, + u3_noun dox, + u3_noun gen) + { + u3_noun p_gen, q_gen, r_gen; + u3_noun ret; + + if ( c3n == u3du(gen) ) { + u3_noun ter = u3r_at(u3x_con_3, van); + u3_noun fab = u3r_at(u3qfu_van_fab, van); + u3_noun rex = u3qfp_open(ter, fab, gen); + + ret = _mull_in(van, sut, gol, dox, rex); + u3z(rex); + + return ret; + } + else if ( c3y == u3du(u3h(gen)) ) { + _mull_used(); + { + u3_noun hed = _mull_in(van, sut, c3__noun, dox, u3h(gen)); + u3_noun tal = _mull_in(van, sut, c3__noun, dox, u3t(gen)); + u3_noun dis = u3qf_cell(u3h(hed), u3h(tal)); + u3_noun dat = u3qf_cell(u3t(hed), u3t(tal)); + u3_noun ret = u3nc(_mull_nice(van, gol, dis), dat); + + u3z(tal); + u3z(hed); + + return ret; + } + } + else switch ( u3h(gen) ) { + default: { + u3_noun ter = u3r_at(u3x_con_3, van); + u3_noun fab = u3r_at(u3qfu_van_fab, van); + u3_noun rex = u3qfp_open(ter, fab, gen); + + if ( c3y == u3r_sing(rex, gen) ) { +#if 1 + u3_noun zix = u3qfu_shep(van, "gene", 'q', u3k(gen)); + + u3t_push(u3nc(c3__mean, zix)); + return u3m_error("mull-open"); +#else + u3_err("h", u3h(gen)); + return u3m_bail(c3__fail); +#endif + } + ret = _mull_in(van, sut, gol, dox, rex); + u3z(rex); + + return ret; + } + + case c3__fits: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mull_used(); + { + u3_noun p_waz = u3qfu_play(van, sut, p_gen); + u3_noun q_waz = u3qfu_play(van, dox, p_gen); + u3_noun dok = u3nc(c3__wing, u3k(q_gen)); + u3_noun p_syx = _mull_doke(van, sut, dok); + u3_noun q_syx = _mull_doke(van, dox, dok); + u3_noun p_pov = u3qfu_fish(van, p_waz, p_syx); + u3_noun q_pov = u3qfu_fish(van, q_waz, q_syx); + + if ( (c3n == u3r_sing(p_syx, q_syx)) || + (c3n == u3r_sing(p_pov, q_pov)) ) + { + return u3m_error("mull-bonk-b"); + } + u3z(p_waz); u3z(q_waz); + u3z(p_syx); u3z(q_syx); + u3z(p_pov); u3z(q_pov); + u3z(dok); + + return _mull_both(van, gol, _mull_bean()); + } + + case c3__wthx: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mull_used(); + { + u3_noun hyp = u3nc(u3nc(c3y, 1), u3k(q_gen)); + u3_noun fid = u3qfu_find(van, sut, c3__free, hyp); + u3_noun gax = u3qfu_find(van, dox, c3__free, hyp); + u3_noun old_type, old_axis; + u3_noun new_type, new_axis; + + { + if ( c3y != u3h(fid) ) { + return u3m_error("mull-bonk-x"); + } + else { + u3_noun pp_fid = u3h(u3t(fid)); + u3_noun qp_fid = u3t(u3t(fid)); + + if ( c3y != u3h(qp_fid) ) { + return u3m_error("mull-bonk-x"); + } + new_type = u3t(qp_fid); + new_axis = _mull_tend(pp_fid); + } + } + + { + if ( c3y != u3h(gax) ) { + return u3m_error("mull-bonk-x"); + } + else { + u3_noun pp_gax = u3h(u3t(gax)); + u3_noun qp_gax = u3t(u3t(gax)); + + if ( c3y != u3h(qp_gax) ) { + return u3m_error("mull-bonk-x"); + } + old_type = u3t(qp_gax); + old_axis = _mull_tend(pp_gax); + } + } + if ( c3n == u3r_sing(old_axis, new_axis) ) { + return u3m_error("mull-bonk-x"); + } + else if ( c3n == u3qfu_nest(van, old_type, c3y, new_type) ) { + return u3m_error("mull-bonk-x"); + } + + u3z(old_axis); + u3z(new_axis); + u3z(gax); + u3z(fid); + + return _mull_both(van, gol, _mull_bean()); + } + + case c3__wtcl: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); + _mull_used(); + { + u3_noun bol = _mull_bean(); + u3_noun nor = _mull_in(van, sut, bol, dox, p_gen); + u3_noun p_fex = u3qfu_gain(van, sut, p_gen); + u3_noun q_fex = u3qfu_gain(van, dox, p_gen); + u3_noun p_wux = u3qfu_lose(van, sut, p_gen); + u3_noun q_wux = u3qfu_lose(van, dox, p_gen); + u3_noun hiq, ran; + u3_noun dis, dat; + u3_noun ret; + + if ( c3__void == p_fex ) { + hiq = u3nc(c3__void, + (c3__void == q_fex) + ? c3__void + : u3qfu_play(van, q_fex, q_gen)); + } else if ( c3__void == q_fex ) { + hiq = u3m_error("mull-bonk-c"); + } + else hiq = _mull_in(van, p_fex, gol, q_fex, q_gen); + + if ( c3__void == p_wux ) { + ran = u3nc(c3__void, + (c3__void == q_wux) + ? c3__void + : u3qfu_play(van, q_wux, r_gen)); + } else if ( c3__void == q_wux ) { + ran = u3m_error("mull-bonk-d"); + } + else ran = _mull_in(van, p_wux, gol, q_wux, r_gen); + + dis = u3qf_forq(u3h(hiq), u3h(ran)); + dat = u3qf_forq(u3t(hiq), u3t(ran)); + + ret = u3nc(_mull_nice(van, gol, dis), dat); + + u3z(ran); + u3z(hiq); + u3z(q_wux); + u3z(p_wux); + u3z(q_fex); + u3z(p_fex); + u3z(nor); + u3z(bol); + + return ret; + } + + case c3__clhp: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mull_used(); + { + u3_noun hed = _mull_in(van, sut, c3__noun, dox, p_gen); + u3_noun tal = _mull_in(van, sut, c3__noun, dox, q_gen); + u3_noun dis = u3qf_cell(u3h(hed), u3h(tal)); + u3_noun dat = u3qf_cell(u3t(hed), u3t(tal)); + u3_noun ret = u3nc(_mull_nice(van, gol, dis), dat); + + u3z(tal); + u3z(hed); + + return ret; + } + + case c3__dtts: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mull_used(); + { + u3_noun hed = _mull_in(van, sut, c3__noun, dox, p_gen); + u3_noun tal = _mull_in(van, sut, c3__noun, dox, q_gen); + + u3z(hed); + u3z(tal); + + return _mull_both(van, gol, _mull_bean()); + } + + case c3__dtwt: p_gen = u3t(gen); + _mull_used(); + { + u3_noun vay = _mull_in(van, sut, c3__noun, dox, p_gen); + + u3z(vay); + return _mull_both(van, gol, _mull_bean()); + } + + case c3__dtkt: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mull_used(); + { + u3_noun nog = u3nc(c3__kttr, u3k(p_gen)); + u3_noun vay = _mull_in(van, sut, c3__noun, dox, q_gen); + u3_noun ret; + + u3z(vay); + ret = _mull_in(van, sut, gol, dox, nog); + u3z(nog); + return ret; + } + + case c3__dtls: p_gen = u3t(gen); + _mull_used(); + { + u3_noun wuq = u3nt(c3__atom, u3_blip, u3_nul); + u3_noun vay = _mull_in(van, sut, wuq, dox, p_gen); + + u3z(vay); + return _mull_both(van, gol, wuq); + } + + case c3__rock: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mull_used(); + { + u3_noun typ = u3qfu_play(van, sut, gen); + + return _mull_both(van, gol, typ); + } + + case c3__dttr: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mull_used(); + { + u3_noun hed = _mull_in(van, sut, c3__noun, dox, p_gen); + u3_noun tal = _mull_in(van, sut, c3__noun, dox, q_gen); + + u3z(hed); + u3z(tal); + + return _mull_both(van, gol, c3__noun); + } + + case c3__sand: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mull_used(); + { + u3_noun typ = u3qfu_play(van, sut, gen); + return _mull_both(van, gol, typ); + } + + case c3__hand: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mull_used(); + { + return u3nc(u3k(p_gen), u3k(p_gen)); + } + + case c3__ktbr: p_gen = u3t(gen); + _mull_used(); + { + u3_noun vat = _mull_in(van, sut, gol, dox, p_gen); + u3_noun pro = u3nc(u3qfu_wrap(van, + u3h(vat), + c3__iron), + u3qfu_wrap(van, + u3t(vat), + c3__iron)); + + u3z(vat); + return pro; + } + + case c3__ktpd: + case c3__ktpm: p_gen = u3t(gen); + _mull_used(); + { + u3_noun vat = _mull_in(van, sut, gol, dox, p_gen); + u3_noun pro = u3nc(u3qfu_wrap(van, + u3h(vat), + c3__zinc), + u3qfu_wrap(van, + u3t(vat), + c3__zinc)); + + u3z(vat); + return pro; + } + + case c3__ktwt: p_gen = u3t(gen); + _mull_used(); + { + u3_noun vat = _mull_in(van, sut, gol, dox, p_gen); + u3_noun pro = u3nc(u3qfu_wrap(van, + u3h(vat), + c3__lead), + u3qfu_wrap(van, + u3t(vat), + c3__lead)); + + u3z(vat); + return pro; + } + + case c3__note: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mull_used(); + { + u3_noun vat = _mull_in(van, sut, gol, dox, q_gen); + u3_noun hit = u3nc(u3k(sut), u3k(p_gen)); + u3_noun hix = u3nc(u3k(dox), u3k(p_gen)); + u3_noun ret = u3nc(u3qf_hint(hit, u3h(vat)), + u3qf_hint(hix, u3t(vat))); + + u3z(hix); + u3z(hit); + u3z(vat); + return ret; + } + + case c3__tune: p_gen = u3t(gen); + _mull_used(); + { + return u3nc(u3qf_face(p_gen, sut), + u3qf_face(p_gen, dox)); + } + + case c3__ktsg: p_gen = u3t(gen); + _mull_used(); + { + return _mull_in(van, sut, gol, dox, p_gen); + } + + case c3__ktls: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mull_used(); + { + u3_noun p_hif = _mull_nice(van, gol, u3qfu_play(van, sut, p_gen)); + u3_noun q_hif = u3qfu_play(van, dox, p_gen); + u3_noun zel = _mull_in(van, sut, p_hif, dox, q_gen); + u3_noun ret = u3nc(p_hif, q_hif); + + u3z(zel); + return ret; + } + + case c3__tsbn: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mull_used(); + { + u3_noun lem = _mull_in(van, sut, c3__noun, dox, p_gen); + u3_noun p_lem = u3h(lem); + u3_noun q_lem = u3t(lem); + u3_noun ret = _mull_in(van, p_lem, gol, q_lem, q_gen); + + u3z(lem); + return ret; + } + + case c3__tscm: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mull_used(); + { + u3_noun boc = u3qfu_busk(van, sut, p_gen); + u3_noun nuf = u3qfu_busk(van, dox, p_gen); + u3_noun ret = _mull_in(van, boc, gol, nuf, q_gen); + + u3z(boc); + u3z(nuf); + + return ret; + } + + case c3__cnts: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mull_used(); + { + return _mull_cnts(van, sut, gol, dox, p_gen, q_gen); + } + + case c3__brcn: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mull_used(); + { + u3_noun ruf = u3nc(u3_nul, 1); + + ret = _mull_grow + (van, sut, gol, dox, c3__gold, p_gen, c3__dry, ruf, q_gen); + u3z(ruf); + + return ret; + } + + case c3__brvt: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mull_used(); + { + u3_noun ruf = u3nc(u3_nul, 1); + + ret = _mull_grow + (van, sut, gol, dox, c3__gold, p_gen, c3__wet, ruf, q_gen); + u3z(ruf); + + return ret; + } + + case c3__sgzp: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mull_used(); + { + u3_noun typ = u3qfu_play(van, sut, p_gen); + u3_noun dug = u3qfu_duck(van, typ); + u3_noun ret; + + u3t_push(u3nc(c3__mean, dug)); + { + ret = _mull_in(van, sut, gol, dox, q_gen); + } + u3t_drop(); + + u3z(typ); + return ret; + } + + case c3__sgbn: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mull_used(); + { + return _mull_in(van, sut, gol, dox, q_gen); + } + + case c3__zpcm: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mull_used(); + { + u3_noun p_ret = u3qfu_play(van, sut, p_gen); + u3_noun q_ret = u3qfu_play(van, sut, q_gen); + + return u3nc(_mull_nice(van, gol, p_ret), + q_ret); + } + + case c3__dbug: u3x_cell(u3t(gen), &p_gen, &q_gen); + { + u3_noun ret; + + u3t_push(u3nc(c3__mean, _mull_loc(van, p_gen))); + { + ret = _mull_in(van, sut, gol, dox, q_gen); + } + u3t_drop(); + return ret; + } + + case c3__zpts: p_gen = u3t(gen); + _mull_used(); + { + return _mull_both(van, gol, c3__noun); + } + + case c3__ktcn: p_gen = u3t(gen); + _mull_used(); + { + u3_noun von = u3i_molt(u3k(van), u3qfu_van_fab, c3n, 0); + u3_noun ret = _mull_in(von, sut, gol, dox, p_gen); + + u3z(von); + return ret; + } + + case c3__zpmc: + case c3__zpsm: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mull_used(); + { + u3_noun p_zur = u3qfu_play(van, sut, p_gen); + u3_noun q_zur = u3qfu_play (van, dox, p_gen); + u3_noun vos = _mull_in(van, sut, c3__noun, dox, q_gen); + u3_noun p_ret = u3qf_cell(p_zur, u3h(vos)); + u3_noun q_ret = u3qf_cell(q_zur, u3t(vos)); + + u3z(vos); + u3z(q_zur); + u3z(p_zur); + + return u3nc + (_mull_nice(van, gol, p_ret), q_ret); + } + case c3__zpvt: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); + _mull_used(); + { + c3_o fes = _mull_feel(van, sut, p_gen); + c3_o fed = _mull_feel(van, dox, p_gen); + + if ( fes != fed ) { + return u3m_error("mull-bonk-f"); + } + else { + if ( c3y == fes ) { + return _mull_in(van, sut, gol, dox, q_gen); + } else { + return _mull_in(van, sut, gol, dox, r_gen); + } + } + } + + case c3__lost: + case c3__fail: + case c3__zpzp: + _mull_used(); + { + return u3nc(c3__void, c3__void); + } + } + } + + static u3_noun + _cqfu_mull(u3_noun van, + u3_noun sut, + u3_noun gol, + u3_noun dox, + u3_noun gen) + { + return _mull_in(van, sut, gol, dox, gen); + } + +/* boilerplate +*/ + u3_noun + u3wfu_mull(u3_noun cor) + { + u3_noun sut, gol, dox, gen, van; + + if ( (c3n == u3r_mean(cor, u3x_sam_2, &gol, + u3x_sam_6, &dox, + u3x_sam_7, &gen, + u3x_con, &van, + 0)) || + (u3_none == (sut = u3r_at(u3x_sam, van))) ) + { + return u3m_bail(c3__fail); + } else { + return _cqfu_mull(van, sut, gol, dox, gen); + } + } + + u3_noun + u3qfu_mull(u3_noun van, + u3_noun sut, + u3_noun gol, + u3_noun dox, + u3_noun gen) + { + c3_m fun_m = 141 + c3__mull + ((!!u3r_at(u3qfu_van_vet, van)) << 8); + u3_noun pro = u3z_find_4(fun_m, sut, gol, dox, gen); + + if ( u3_none != pro ) { + return pro; + } + else { + pro = _cqfu_mull(van, sut, gol, dox, gen); + + return u3z_save_4(fun_m, sut, gol, dox, gen, pro); + } + } + diff --git a/jets/stage/f/ut_nest.c b/jets/stage/f/ut_nest.c new file mode 100644 index 000000000..f36c1385c --- /dev/null +++ b/jets/stage/f/ut_nest.c @@ -0,0 +1,560 @@ +/* j/6/ut_nest.c +** +*/ +#include "all.h" + +/* logic +*/ + /* forward + */ + static u3_noun + _nest_sint(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); + static u3_noun + _nest_dext(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); + + static u3_noun + _nest_deep(u3_noun van, + u3_noun sut, + u3_noun tel, + u3_noun ref, + u3_noun dab, + u3_noun hem, + u3_noun gil) + { + if ( u3_nul == dab ) { + return u3r_sing(u3_nul, hem); + } else if ( u3_nul == hem ) { + return c3n; + } else { + u3_noun n_dab, l_dab, r_dab; + u3_noun n_hem, l_hem, r_hem; + u3_noun pn_hem, qn_hem, pn_dab, qn_dab; + + u3x_trel(dab, &n_dab, &l_dab, &r_dab); + u3x_trel(hem, &n_hem, &l_hem, &r_hem); + + if ( (c3n == _nest_deep(van, sut, tel, ref, l_dab, l_hem, gil)) || + (c3n == _nest_deep(van, sut, tel, ref, r_dab, r_hem, gil)) ) + { + return c3n; + } + u3x_cell(n_dab, &pn_dab, &qn_dab); + u3x_cell(n_hem, &pn_hem, &qn_hem); + + if ( c3n == u3r_sing(pn_dab, pn_hem) ) { + return c3n; + } + else { + u3_noun vis = u3qfu_play(van, sut, qn_dab); + u3_noun lon = u3qfu_play(van, ref, qn_hem); + + u3_noun ret = _nest_dext(van, vis, tel, lon, u3_nul, u3_nul, gil); + + u3z(vis); + u3z(lon); + return ret; + } + } + } + + static u3_noun + _nest_dope(u3_noun van, + u3_noun sut, + u3_noun tel, + u3_noun ref, + u3_noun dom, + u3_noun vim, + u3_noun gil) + { + if ( u3_nul == dom ) { + return u3r_sing(u3_nul, vim); + } else if ( u3_nul == vim ) { + return c3n; + } else { + u3_noun n_dom, l_dom, r_dom; + u3_noun n_vim, l_vim, r_vim; + u3_noun pn_vim, qn_vim, pn_dom, qn_dom; + u3_noun pqn_vim, qqn_vim, pqn_dom, qqn_dom; + + u3x_trel(dom, &n_dom, &l_dom, &r_dom); + u3x_trel(vim, &n_vim, &l_vim, &r_vim); + + if ( (c3n == _nest_dope(van, sut, tel, ref, l_dom, l_vim, gil)) || + (c3n == _nest_dope(van, sut, tel, ref, r_dom, r_vim, gil)) ) + { + return c3n; + } + u3x_cell(n_dom, &pn_dom, &qn_dom); + u3x_cell(n_vim, &pn_vim, &qn_vim); + + u3x_cell(qn_dom, &pqn_dom, &qqn_dom); + u3x_cell(qn_vim, &pqn_vim, &qqn_vim); + + if ( c3n == u3r_sing(pn_dom, pn_vim) ) { + return c3n; + } else { + return _nest_deep(van, sut, tel, ref, qqn_dom, qqn_vim, gil); + } + } + } + + static u3_noun + _nest_cong(u3_noun van, + u3_noun sut, + u3_noun tel, + u3_noun ref, + u3_noun gil) + { + u3_noun p_sut, q_sut, p_ref, q_ref; + u3_noun pq_sut, qq_sut, rq_sut; + u3_noun pq_ref, qq_ref, rq_ref; + u3_noun prq_sut, qrq_sut, prq_ref, qrq_ref; + u3_noun ppq_sut, qpq_sut, rpq_sut; + u3_noun ppq_ref, qpq_ref, rpq_ref; + u3_noun ret; + + u3x_trel(sut, 0, &p_sut, &q_sut); + u3x_trel(ref, 0, &p_ref, &q_ref); + + u3x_trel(q_sut, &pq_sut, &qq_sut, &rq_sut); + u3x_trel(q_ref, &pq_ref, &qq_ref, &rq_ref); + + u3x_trel(pq_sut, &ppq_sut, &qpq_sut, &rpq_sut); + u3x_trel(pq_ref, &ppq_ref, &qpq_ref, &rpq_ref); + + u3x_cell(rq_sut, &prq_sut, &qrq_sut); + u3x_cell(rq_ref, &prq_ref, &qrq_ref); + + if ( c3y == u3r_sing(q_sut, q_ref) ) { + return _nest_dext(van, p_sut, tel, p_ref, u3_nul, u3_nul, gil); + } + else if ( c3n == u3r_sing(qpq_sut, qpq_ref) ) { + return c3n; + } + else if ( (c3n == _nest_dext + (van, qq_sut, tel, p_sut, u3_nul, u3_nul, gil)) || + (c3n == _nest_dext + (van, p_sut, tel, qq_sut, u3_nul, u3_nul, gil)) || + (c3n == _nest_dext + (van, qq_ref, tel, p_ref, u3_nul, u3_nul, gil)) ) + { + return c3n; + } + else { + if ( (rpq_sut != rpq_ref) && + (c3__lead != rpq_sut) && + (c3__gold != rpq_ref) ) + { + return c3n; + } + else if ( c3__wet == qpq_sut ) { + return u3r_sing(qrq_sut, qrq_ref); + } + else { + u3_noun hud = u3nc(u3k(sut), u3k(ref)); + + if ( (c3y == u3qdi_has(gil, hud)) ) { + u3z(hud); + + return c3y; + } + else { + u3_noun zoc = u3qdi_put(gil, hud); + u3_noun tus = u3nt(c3__core, + u3k(qq_sut), + u3nc(u3nt(u3k(ppq_sut), u3k(qpq_sut), c3__gold), + u3k(u3t(q_sut)))); + + u3_noun fer = u3nt(c3__core, + u3k(qq_ref), + u3nc(u3nt(u3k(ppq_ref), u3k(qpq_ref), c3__gold), + u3k(u3t(q_ref)))); + + ret = _nest_dope(van, tus, tel, fer, qrq_sut, qrq_ref, zoc); + u3z(fer); + u3z(tus); + u3z(zoc); + u3z(hud); + + if ( c3n == ret ) { + return c3n; + } + else { + switch ( rpq_sut ) { + default: return u3m_bail(c3__fail); + + case c3__gold: { + return + c3a(_nest_dext(van, qq_sut, tel, qq_ref, u3_nul, u3_nul, gil), + _nest_dext(van, qq_ref, tel, qq_sut, u3_nul, u3_nul, gil)); + } + case c3__iron: { + u3_noun s_sam = u3qfu_peek(van, qq_sut, c3__rite, 2); + u3_noun r_sam = u3qfu_peek(van, qq_ref, c3__rite, 2); + u3_noun ret = _nest_dext + (van, r_sam, tel, s_sam, u3_nul, u3_nul, gil); + + u3z(r_sam); + u3z(s_sam); + return ret; + } + case c3__lead: { + return c3y; + } + case c3__zinc: { + u3_noun s_pal = u3qfu_peek(van, qq_sut, c3__read, 2); + u3_noun r_pal = u3qfu_peek(van, qq_ref, c3__read, 2); + u3_noun ret = _nest_dext + (van, s_pal, tel, r_pal, u3_nul, u3_nul, gil); + + u3z(r_pal); + u3z(s_pal); + + return ret; + } + } + } + } + } + } + } + + static u3_noun + _nest_dext_in(u3_noun van, + u3_noun sut, + u3_noun tel, + u3_noun ref, + u3_noun seg, + u3_noun reg, + u3_noun gil) + { + u3_noun p_sut, q_sut, p_ref, q_ref; + + if ( (c3n == u3du(sut)) ) switch ( sut ) { + default: return u3m_bail(c3__fail); + + case c3__noun: { + return c3y; + } + case c3__void: { + return _nest_sint(van, sut, tel, ref, seg, reg, gil); + } + } + else switch ( u3h(sut) ) { + default: return u3m_bail(c3__fail); + + case c3__atom: { + if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { + return u3m_bail(c3__fail); + } + else { + if ( c3y == u3r_pq(ref, c3__atom, &p_ref, &q_ref) ) { + if ( (c3n == u3qf_fitz(p_sut, p_ref)) || + ( (c3y == u3du(q_sut)) && + ( (c3n == u3du(q_ref)) || + (c3n == u3r_sing(q_sut, q_ref)))) ) + { + return c3n; + } + return c3y; + } + return _nest_sint(van, sut, tel, ref, seg, reg, gil); + } + } + case c3__cell: { + if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { + return u3m_bail(c3__fail); + } else { + if ( c3y == u3r_pq(ref, c3__cell, &p_ref, &q_ref) ) { + return c3a(_nest_dext(van, p_sut, tel, p_ref, u3_nul, u3_nul, gil), + _nest_dext(van, q_sut, tel, q_ref, u3_nul, u3_nul, gil)); + } + else return _nest_sint(van, sut, tel, ref, seg, reg, gil); + } + } + case c3__core: { + if ( c3n == u3r_trel(sut, 0, &p_sut, &q_sut) ) { + return u3m_bail(c3__fail); + } else { + if ( (c3y == u3r_pq(ref, c3__core, &p_ref, &q_ref)) ) { + return _nest_cong(van, sut, tel, ref, gil); + } + else return _nest_sint(van, sut, tel, ref, seg, reg, gil); + } + } + case c3__hint: + case c3__face: { + if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { + return u3m_bail(c3__fail); + } else { + return _nest_dext(van, q_sut, tel, ref, seg, reg, gil); + } + } + case c3__fork: p_sut = u3t(sut); + { + if ( c3n == u3du(ref) ) switch ( ref ) { + default: return _nest_sint(van, sut, tel, ref, seg, reg, gil); + + case c3__noun: + break; + } + else switch ( u3h(ref) ) { + default: return _nest_sint(van, sut, tel, ref, seg, reg, gil); + + case c3__atom: + case c3__cell: + case c3__core: + break; + } + + { + u3_noun dey = u3qdi_tap(p_sut); + u3_noun yed = dey; + + while ( u3_nul != yed ) { + if ( c3y == _nest_dext(van, u3h(yed), c3n, ref, seg, reg, gil) ) { + u3z(dey); + return c3y; + } else { + yed = u3t(yed); + } + } + u3z(dey); + return c3n; + } + } + case c3__hold: + { + if ( c3y == u3qdi_has(seg, sut) ) { + return c3n; + } + else { + u3_noun hud = u3nc(u3k(sut), u3k(ref)); + + if ( (c3y == u3qdi_has(gil, hud)) ) { + u3z(hud); + + return c3y; + } + else { + u3_noun gus = u3qdi_put(seg, sut); + u3_noun zoc = u3qdi_put(gil, hud); + u3_noun fop = u3qfu_repo(van, sut); + u3_noun hiv = _nest_dext(van, fop, tel, ref, gus, reg, zoc); + + u3z(hud); + u3z(fop); + u3z(zoc); + u3z(gus); + + return hiv; + } + } + } + } + } + + static u3_noun + _nest_dext_to(u3_noun van, + u3_noun sut, + u3_noun tel, + u3_noun ref, + u3_noun seg, + u3_noun reg, + u3_noun gil) + { + u3_noun tyn = _nest_dext_in(van, sut, tel, ref, seg, reg, gil); + + if ( (c3y == tyn) || (c3n == tel) ) { + return tyn; + } else { +#if 0 + u3_noun dun = u3qfu_dunq(van, "need", sut); + u3_noun niz = u3qfu_dunq(van, "have", ref); + + u3t_push(u3nc(c3__mean, dun)); + u3t_push(u3nc(c3__mean, niz)); +#endif + return u3m_error("nest-fail"); + } + } + + static u3_noun + _nest_dext(u3_noun van, + u3_noun sut, + u3_noun tel, + u3_noun ref, + u3_noun seg, + u3_noun reg, + u3_noun gil) + { + + if ( (c3y == u3r_sing(sut, ref)) ) { + return c3y; + } + + { + c3_m fun_m = 141 + c3__nest + ((!!u3r_at(u3qfu_van_vet, van)) << 8); + u3_noun pro = u3z_find_2(fun_m, sut, ref); + + if ( u3_none != pro ) { + return pro; + } + else { + pro = _nest_dext_to(van, sut, tel, ref, seg, reg, gil); + + if ( ((c3y == pro) && (u3_nul == reg)) || + ((c3n == pro) && (u3_nul == seg)) ) + { + return u3z_save_2(fun_m, sut, ref, pro); + } + else return pro; + } + } + } + + static u3_noun + _nest_sint(u3_noun van, + u3_noun sut, + u3_noun tel, + u3_noun ref, + u3_noun seg, + u3_noun reg, + u3_noun gil) + { + u3_noun p_ref, q_ref; + + if ( (c3n == u3du(ref)) ) { + switch ( ref ) { + default: return u3m_bail(c3__fail); + + case c3__noun: return c3n; + case c3__void: return c3y; + } + } + else { + switch ( u3h(ref) ) { + default: { + return u3m_bail(c3__fail); + } + case c3__atom: return c3n; + case c3__cell: return c3n; + case c3__core: { + u3_noun gam = u3qfu_repo(van, ref); + u3_noun hiv = _nest_dext(van, sut, tel, gam, seg, reg, gil); + + u3z(gam); + return hiv; + } + case c3__hint: + case c3__face: { + if ( c3n == u3r_trel(ref, 0, &p_ref, &q_ref) ) { + return u3m_bail(c3__fail); + } else { + return _nest_dext(van, sut, tel, q_ref, seg, reg, gil); + } + } + case c3__fork: p_ref = u3t(ref); + { + u3_noun dey = u3qdi_tap(p_ref); + u3_noun yed = dey; + + while ( u3_nul != yed ) { + if ( c3n == _nest_dext(van, sut, c3n, u3h(yed), seg, reg, gil) ) { + u3z(dey); + return c3n; + } else { + yed = u3t(yed); + } + } + u3z(dey); + return c3y; + } + case c3__hold: { + if ( c3y == u3qdi_has(reg, ref) ) { + return c3y; + } + { + u3_noun hud = u3nc(u3k(sut), u3k(ref)); + + if ( (c3y == u3qdi_has(gil, hud)) ) { + u3z(hud); + + return c3y; + } else { + u3_noun gur = u3qdi_put(reg, ref); + u3_noun zoc = u3qdi_put(gil, hud); + u3_noun gam = u3qfu_repo(van, ref); + + { + u3_noun hiv = _nest_dext(van, sut, tel, gam, seg, gur, zoc); + + u3z(hud); + u3z(gam); + u3z(zoc); + u3z(gur); + + return hiv; + } + } + } + } + } + } + } + + static u3_noun + _cqfu_nest(u3_noun van, + u3_noun sut, + u3_noun tel, + u3_noun ref) + { + return _nest_dext(van, sut, tel, ref, u3_nul, u3_nul, u3_nul); + } + +/* boilerplate +*/ + u3_noun + u3wfu_nest(u3_noun cor) + { + u3_noun sut, tel, ref, van; + + if ( (c3n == u3r_mean(cor, u3x_sam_2, &tel, + u3x_sam_3, &ref, + u3x_con, &van, + 0)) || + (c3n == u3ud(tel)) || (tel > 1) || + (u3_none == (sut = u3r_at(u3x_sam, van))) ) + { + return u3m_bail(c3__fail); + } else { + return _cqfu_nest(van, sut, tel, ref); + } + } + + u3_noun + u3qfu_nest(u3_noun van, + u3_noun sut, + u3_noun tel, + u3_noun ref) + { +#if 1 + c3_m fun_m = 141 + c3__nest; + u3_noun vrf = u3r_at(u3qfu_van_vrf, van); + u3_noun pro = u3z_find_4(fun_m, vrf, sut, tel, ref); + + if ( u3_none != pro ) { + // u3t_heck(c3__good); + return pro; + } + else { + pro = _cqfu_nest(van, sut, tel, ref); + + // u3t_heck(c3__nest); + return u3z_save_4(fun_m, vrf, sut, tel, ref, pro); + } +#else + return _cqfu_nest(van, sut, tel, ref); +#endif + } + diff --git a/jets/stage/f/ut_peek.c b/jets/stage/f/ut_peek.c new file mode 100644 index 000000000..dc9a5887c --- /dev/null +++ b/jets/stage/f/ut_peek.c @@ -0,0 +1,232 @@ +/* j/6/peek.c +** +*/ +#include "all.h" + + +/* logic +*/ + static u3_noun + _cqfu_peek(u3_noun, u3_noun, u3_noun, u3_atom); + + static u3_noun + _peek_in(u3_noun, u3_noun, u3_noun, u3_atom, u3_noun); + + static u3_noun + _peek_fork(u3_noun van, u3_noun p_sut, u3_noun way, u3_noun axe, u3_noun gil) + { + if ( u3_nul == p_sut ) { + return u3_nul; + } + else { + return u3nc(_peek_in(van, u3h(p_sut), way, axe, gil), + _peek_fork(van, u3t(p_sut), way, axe, gil)); + } + } + + static u3_noun + _peek_in(u3_noun van, + u3_noun sut, + u3_noun way, + u3_atom axe, + u3_noun gil) + { + u3_noun p_sut, q_sut; + u3_noun pro; + + if ( (c3n == u3du(sut)) ) switch ( sut ) { + default: return u3m_bail(c3__fail); + + case c3__noun: { + return c3__noun; + } + case c3__void: { + return c3__void; + } + } + else switch ( u3h(sut) ) { + default: return u3m_bail(c3__fail); + + case c3__atom: { + return c3__void; + } + case c3__cell: { + if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { + return u3m_bail(c3__fail); + } else { + u3_atom tip = u3qc_cap(axe); + u3_atom tap = u3qc_mas(axe); + + if ( 2 == tip ) { + pro = _cqfu_peek(van, p_sut, way, tap); + } + else { + pro = _cqfu_peek(van, q_sut, way, tap); + } + u3z(tap); + u3z(tip); + + return pro; + } + } + case c3__core: { + u3_noun pq_sut, qq_sut, rq_sut; + u3_noun ppq_sut, qpq_sut, rpq_sut; + u3_noun prq_sut, qrq_sut; + + if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) || + (c3n == u3r_trel(q_sut, &pq_sut, &qq_sut, &rq_sut)) || + (c3n == u3r_trel(pq_sut, &ppq_sut, &qpq_sut, &rpq_sut)) || + (c3n == u3r_cell(rq_sut, &prq_sut, &qrq_sut)) ) + { + return u3m_bail(c3__fail); + } else { + u3_atom now = u3qc_cap(axe); + u3_atom lat = u3qc_mas(axe); + + if ( 3 == now ) { + u3_noun pec = u3qfu_peel(van, sut, way, rpq_sut); + u3_noun sam = u3h(pec); + u3_noun con = u3t(pec); + u3_atom tow; + + if ( 1 == lat ) { + tow = 1; + } else { + tow = u3qc_cap(lat); + } + + if ( (c3y == c3a(sam, con)) || + ((c3y == sam) && (tow == 2)) || + ((c3y == con) && (tow == 3)) ) + { + pro = _cqfu_peek(van, p_sut, way, lat); + } + else { + + if ( way != c3__read ) { + return u3m_error("payload-block"); + } + + u3_noun typ; + + { + u3_noun hed, tal; + + if ( c3n == sam ) { + hed = c3__noun; + } else { + hed = _cqfu_peek(van, p_sut, way, 2); + } + + if ( c3n == con ) { + tal = c3__noun; + } else { + tal = _cqfu_peek(van, p_sut, way, 3); + } + + typ = u3qf_cell(hed, tal); + u3z(hed); + u3z(tal); + } + + pro = _cqfu_peek(van, typ, way, lat); + u3z(typ); + } + + u3z(pec); + u3z(tow); + } + else { + pro = c3__noun; + } + u3z(lat); + u3z(now); + + return pro; + } + } + case c3__hint: + case c3__face: { + if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { + return u3m_bail(c3__fail); + } else { + return _peek_in(van, q_sut, way, axe, gil); + } + } + case c3__fork: p_sut = u3t(sut); + { + u3_noun yed = u3qdi_tap(p_sut); + u3_noun ret = u3kf_fork(_peek_fork(van, yed, way, axe, gil)); + + u3z(yed); + return ret; + } + case c3__hold: { + if ( (c3y == u3qdi_has(gil, sut)) ) { + return c3__void; + } + else { + u3_noun zoc = u3qdi_put(gil, sut); + u3_noun fop = u3qfu_repo(van, sut); + u3_noun pro = _peek_in(van, fop, way, axe, zoc); + + u3z(fop); + u3z(zoc); + + return pro; + } + } + } + } + + static u3_noun + _cqfu_peek(u3_noun van, + u3_noun sut, + u3_noun way, + u3_atom axe) + { + if ( 1 == axe ) { + return u3k(sut); + } + else return _peek_in(van, sut, way, axe, u3_nul); + } + +/* boilerplate +*/ + u3_noun + u3wfu_peek(u3_noun cor) + { + u3_noun sut, way, axe, van; + + if ( (c3n == u3r_mean(cor, u3x_sam_2, &way, + u3x_sam_3, &axe, + u3x_con, &van, + 0)) || + (c3n == u3ud(axe)) || + (u3_none == (sut = u3r_at(u3x_sam, van))) ) + { + return u3m_bail(c3__fail); + } else { + return _cqfu_peek(van, sut, way, axe); + } + } + + u3_noun + u3qfu_peek(u3_noun van, + u3_noun sut, + u3_noun way, + u3_noun axe) + { + c3_m fun_m = 141 + c3__peek + ((!!u3r_at(u3qfu_van_vet, van)) << 8); + u3_noun pro = u3z_find_3(fun_m, sut, way, axe); + + if ( u3_none != pro ) { + return pro; + } + else { + pro = _cqfu_peek(van, sut, way, axe); + + return u3z_save_3(fun_m, sut, way, axe, pro); + } + } diff --git a/jets/stage/f/ut_peel.c b/jets/stage/f/ut_peel.c new file mode 100644 index 000000000..717a62543 --- /dev/null +++ b/jets/stage/f/ut_peel.c @@ -0,0 +1,55 @@ +/* j/6/ut_peel.c +** +*/ +#include "all.h" + + +/* logic +*/ + u3_noun + _cqfu_peel(u3_noun van, + u3_noun sut, + u3_noun way, + u3_noun met) + { + if ( c3__gold == met ) { + return u3nc(c3y, c3y); + } + else switch ( way ) { + default: return u3m_bail(c3__fail); + + case c3__both: return u3nc(c3n, c3n); + case c3__free: return u3nc(c3y, c3y); + case c3__read: return u3nc(((met == c3__zinc) ? c3y : c3n), c3n); + case c3__rite: return u3nc(((met == c3__iron) ? c3y : c3n), c3n); + } + } + +/* boilerplate +*/ + u3_noun + u3wfu_peel(u3_noun cor) + { + u3_noun sut, way, met, van; + + if ( (c3n == u3r_mean(cor, u3x_sam_2, &way, + u3x_sam_3, &met, + u3x_con, &van, + 0)) || + (u3_none == (sut = u3r_at(u3x_sam, van))) ) + { + return u3m_bail(c3__fail); + } else { + return _cqfu_peel(van, sut, way, met); + } + } + + u3_noun + u3qfu_peel(u3_noun van, + u3_noun sut, + u3_noun way, + u3_noun met) + { + return _cqfu_peel(van, sut, way, met); + } + diff --git a/jets/stage/f/ut_play.c b/jets/stage/f/ut_play.c new file mode 100644 index 000000000..9a300edf4 --- /dev/null +++ b/jets/stage/f/ut_play.c @@ -0,0 +1,606 @@ +/* j/6/play.c +** +*/ +#include "all.h" + +/* logic +*/ +# define _play_used() + + static u3_noun + _play_in(u3_noun, u3_noun, u3_noun); + + static u3_noun + _play_bean() + { + return u3kf_fork(u3nt(u3nq(c3__atom, 'f', u3_nul, 0), + u3nq(c3__atom, 'f', u3_nul, 1), + u3_nul)); + } + + static u3_noun + _play_rock(u3_noun odo, u3_noun bob) + { + if ( c3y == u3ud(bob) ) { + return u3nq(c3__atom, u3k(odo), u3_nul, u3k(bob)); + } + else return u3nt(c3__cell, _play_rock(odo, u3h(bob)), + _play_rock(odo, u3t(bob))); + } + + static u3_noun + _play_sand(u3_noun odo, u3_noun bob) + { + if ( c3y == u3ud(bob) ) { + if ( 'n' == odo ) { + if ( (bob != 0) ) { + return u3m_bail(c3__exit); + } else { + return u3nq(c3__atom, odo, u3_nul, bob); + } + } + if ( 'f' == odo ) { + if ( (bob > 1) ) { + return u3m_bail(c3__exit); + } else { + return _play_bean(); + } + } + return u3nt(c3__atom, u3k(odo), u3_nul); + } + else return u3nt(c3__cell, _play_rock(odo, u3h(bob)), + _play_rock(odo, u3t(bob))); + } + + static u3_noun + _play_core(u3_noun pac, + u3_noun con) + { + if ( (c3__void == pac) ) { + u3z(con); + + return c3__void; + } else { + return u3nt(c3__core, pac, con); + } + } + + static u3_noun + _play_loc(u3_noun van, + u3_noun loc) + { + u3_noun mol = u3nc('o', u3k(loc)); + u3_noun sho = u3j_cook("_play_loc-show", u3k(van), "show"); + u3_noun ret = u3i_molt(u3k(sho), u3x_sam, u3k(mol), 0); + + u3z(mol); + u3z(sho); + + return ret; + } + + static u3_noun + _play_feel(u3_noun van, + u3_noun sut, + u3_noun rot) + { + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + u3_noun gat = u3j_hook(von, "feel"); + + return u3n_kick_on(u3i_molt(gat, + u3x_sam, + u3k(rot), + 0)); + } + +#if 0 + static u3_noun + _play_loc_term(u3_noun van, + u3_noun loc) + { + u3_noun fop = u3kb_flop(u3k(u3h(loc))); + u3_noun nam = ((0 == fop) ? c3__none : u3k(u3h(fop))); + u3_noun lys = u3nt(u3k(u3h(u3t(loc))), u3k(u3t(u3t(loc))), u3_nul); + u3_noun rup = u3nc(nam, lys); + c3_c* pre_c = u3m_pretty(rup); + u3_noun pro = u3i_string(pre_c); + + u3z(fop); + u3z(rup); + free(pre_c); + + return pro; + } +#endif + +#if 1 + static u3_noun + _play_cnts(u3_noun van, + u3_noun sut, + u3_noun hyp, + u3_noun rig) + { + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + u3_noun gat = u3j_cook("_play_cnts-epla", von, "epla"); + + return u3n_kick_on(u3i_molt(gat, + u3x_sam_2, + u3k(hyp), + u3x_sam_3, + u3k(rig), + 0)); + } +#else + static u3_noun + _play_edit(u3_noun van, + u3_noun sut, + u3_noun mew, + u3_noun rag) + { + while ( 1 ) { + if ( c3n == u3du(mew) ) { + return rag; + } else { + u3_noun i_mew = u3h(mew); + u3_noun t_mew = u3t(mew); + u3_noun pi_mew = u3h(i_mew); + u3_noun qi_mew = u3t(i_mew); + u3_noun laf = _play_in(van, sut, qi_mew); + u3_noun ruz = u3qfu_toss(van, sut, pi_mew, laf, rag); + + u3z(laf); + u3z(rag); + rag = u3k(u3t(ruz)); + u3z(ruz); + + mew = t_mew; + } + } + } + static u3_noun + _play_cnts_old(u3_noun van, + u3_noun sut, + u3_noun hyp, + u3_noun rig) + { + u3_noun lar = u3qfu_seek(van, sut, c3__read, hyp); + u3_noun q_lar = u3t(lar); + u3_noun qq_lar = u3t(q_lar); + u3_noun mew = rig; + u3_noun rag = _play_edit(van, sut, mew, u3k(qq_lar)); + u3_noun ret = u3qfu_fire(van, sut, rag); + + u3z(rag); + u3z(lar); + + return ret; + } +#endif + + static u3_noun + _play_grow(u3_noun van, + u3_noun sut, + u3_atom mel, + u3_noun nym, + u3_noun hud, + u3_noun ruf, + u3_noun dom) + { + u3_noun dan = _play_in(van, sut, ruf); + + return _play_core(dan, + u3nt(u3nt(u3k(nym), u3k(hud), u3k(mel)), + u3k(dan), + u3nc(u3nc(u3nc(c3__full, u3_nul), u3_nul), + u3k(dom)))); + } + + static u3_noun + _play_in(u3_noun van, + u3_noun sut, + u3_noun gen); + + static u3_noun + _play_x(u3_noun van, + u3_noun sut, + u3_noun gen) + { +#if 1 + return _play_in(van, sut, gen); +#else + u3_noun zix = u3qfu_shep + (van, "gene", 'q', u3k(gen)); + u3_noun ret; + + u3t_push(u3nc(c3__mean, zix)); + + ret = _play_in(van, sut, gen); + + u3t_drop(); + return ret; +#endif + } + + static u3_noun + _play_in(u3_noun van, + u3_noun sut, + u3_noun gen) + { + u3_noun p_gen, q_gen, r_gen; + + if ( c3n == u3du(gen) ) { + open: { + u3_noun ter = u3r_at(u3x_con_3, van); + u3_noun fab = u3r_at(u3qfu_van_fab, van); + u3_noun rex = u3qfp_open(ter, fab, gen); + u3_noun ret; + + if ( c3y == u3r_sing(rex, gen) ) { + u3_noun zix = u3qfu_shep(van, "gene", 'q', u3k(gen)); + + u3t_push(u3nc(c3__mean, zix)); + return u3m_error("play-open-z"); + } + ret = _play_x(van, sut, rex); + u3z(rex); + + return ret; + } + } + else if ( c3y == u3du(u3h(gen)) ) { + _play_used(); + { + u3_noun dis = _play_x(van, sut, u3h(gen)); + u3_noun dat = _play_x(van, sut, u3t(gen)); + u3_noun ret = u3qf_cell(dis, dat); + + u3z(dis); + u3z(dat); + return ret; + } + } + else switch ( u3h(gen) ) { + default: goto open; + + case c3__fits: u3x_cell(u3t(gen), &p_gen, &q_gen); + _play_used(); + { + return _play_bean(); + } + + case c3__wtcl: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); + _play_used(); + { + u3_noun fex = u3qfu_gain(van, sut, p_gen); + u3_noun wux = u3qfu_lose(van, sut, p_gen); + u3_noun dez = (fex == c3__void) ? c3__void + : _play_x(van, fex, q_gen); + u3_noun doz = (wux == c3__void) ? c3__void + : _play_x(van, wux, r_gen); + u3_noun ret = u3qf_forq(dez, doz); + + u3z(dez); u3z(doz); + u3z(fex); u3z(wux); + return ret; + } + + case c3__clhp: u3x_cell(u3t(gen), &p_gen, &q_gen); + _play_used(); + { + u3_noun dis = _play_x(van, sut, p_gen); + u3_noun dat = _play_x(van, sut, q_gen); + u3_noun ret = u3qf_cell(dis, dat); + + u3z(dis); + u3z(dat); + return ret; + } + + case c3__dtkt: u3x_cell(u3t(gen), &p_gen, &q_gen); + _play_used(); + { + u3_noun nog = u3nc(c3__kttr, u3k(p_gen)); + u3_noun ret = _play_x(van, sut, nog); + + u3z(nog); + return ret; + } + + case c3__dtwt: p_gen = u3t(gen); + _play_used(); + { + return _play_bean(); + } + + case c3__dtts: u3x_cell(u3t(gen), &p_gen, &q_gen); + _play_used(); + { + return _play_bean(); + } + + case c3__dtls: p_gen = u3t(gen); + _play_used(); + { + return u3nt(c3__atom, u3_blip, u3_nul); + } + + case c3__rock: u3x_cell(u3t(gen), &p_gen, &q_gen); + _play_used(); + { + return _play_rock(p_gen, q_gen); + } + + case c3__dttr: u3x_cell(u3t(gen), &p_gen, &q_gen); + _play_used(); + { + return c3__noun; + } + + case c3__sand: u3x_cell(u3t(gen), &p_gen, &q_gen); + _play_used(); + { + return _play_sand(p_gen, q_gen); + } + + case c3__hand: u3x_cell(u3t(gen), &p_gen, &q_gen); + _play_used(); + { + return u3k(p_gen); + } + + case c3__ktbr: p_gen = u3t(gen); + _play_used(); + { + u3_noun boc = _play_x(van, sut, p_gen); + u3_noun pro = u3qfu_wrap(van, boc, c3__iron); + + u3z(boc); + return pro; + } + + case c3__ktpd: p_gen = u3t(gen); + _play_used(); + { + u3_noun boc = _play_x(van, sut, p_gen); + u3_noun pro = u3qfu_wrap(van, boc, c3__zinc); + + u3z(boc); + return pro; + } + + case c3__ktwt: p_gen = u3t(gen); + _play_used(); + { + u3_noun boc = _play_x(van, sut, p_gen); + u3_noun pro = u3qfu_wrap(van, boc, c3__lead); + + u3z(boc); + return pro; + } + + case c3__note: u3x_cell(u3t(gen), &p_gen, &q_gen); + _play_used(); + { + u3_noun boc = _play_x(van, sut, q_gen); + u3_noun hit = u3nc(u3k(sut), u3k(p_gen)); + u3_noun ret = u3qf_hint(hit, boc); + + u3z(hit); + u3z(boc); + return ret; + } + + case c3__tune: p_gen = u3t(gen); + _play_used(); + { + return u3qf_face(p_gen, sut); + } + + case c3__ktsg: p_gen = u3t(gen); + _play_used(); + { + return _play_x(van, sut, p_gen); + } + + case c3__ktls: u3x_cell(u3t(gen), &p_gen, &q_gen); + _play_used(); + { + return _play_x(van, sut, p_gen); + } + + case c3__tsbn: u3x_cell(u3t(gen), &p_gen, &q_gen); + _play_used(); + { + u3_noun boc = _play_x(van, sut, p_gen); + u3_noun ret = _play_x(van, boc, q_gen); + + u3z(boc); + return ret; + } + + case c3__tscm: u3x_cell(u3t(gen), &p_gen, &q_gen); + _play_used(); + { + u3_noun boc = u3qfu_busk(van, sut, p_gen); + u3_noun ret = _play_x(van, boc, q_gen); + + u3z(boc); + return ret; + } + + case c3__cnts: u3x_cell(u3t(gen), &p_gen, &q_gen); + _play_used(); + { + return _play_cnts(van, sut, p_gen, q_gen); + } + + case c3__brcn: u3x_cell(u3t(gen), &p_gen, &q_gen); + _play_used(); + { + u3_noun ruf = u3nc(u3_nul, 1); + u3_noun ret = _play_grow + (van, sut, c3__gold, p_gen, c3__dry, ruf, q_gen); + + u3z(ruf); + return ret; + } + + case c3__brvt: u3x_cell(u3t(gen), &p_gen, &q_gen); + _play_used(); + { + u3_noun ruf = u3nc(u3_nul, 1); + u3_noun ret = _play_grow + (van, sut, c3__gold, p_gen, c3__wet, ruf, q_gen); + + u3z(ruf); + return ret; + } + + case c3__sgzp: u3x_cell(u3t(gen), &p_gen, &q_gen); + _play_used(); + { + u3_noun typ = u3qfu_play(van, sut, p_gen); + u3_noun dug = u3qfu_duck(van, typ); + u3_noun ret; + + u3t_push(u3nc(c3__mean, dug)); + { + ret = _play_x(van, sut, q_gen); + } + u3t_drop(); + + u3z(typ); + return ret; + } + + case c3__sgbn: u3x_cell(u3t(gen), &p_gen, &q_gen); + _play_used(); + { + return _play_x(van, sut, q_gen); + } + + case c3__zpts: p_gen = u3t(gen); + _play_used(); + { + return c3__noun; + } + + case c3__ktcn: p_gen = u3t(gen); + { + u3_noun von = u3i_molt(u3k(van), u3qfu_van_fab, c3n, 0); + u3_noun ret = _play_x(von, sut, p_gen); + + u3z(von); + return ret; + } + + case c3__zpcm: u3x_cell(u3t(gen), &p_gen, &q_gen); + _play_used(); + { + return _play_x(van, sut, p_gen); + } + + case c3__dbug: u3x_cell(u3t(gen), &p_gen, &q_gen); + { + u3_noun ret; + +#if 0 + { + u3_noun cog = _play_loc_term(van, p_gen); + + u3t_heck(cog); + u3z(cog); + } +#endif + u3t_push(u3nc(c3__mean, _play_loc(van, p_gen))); + { + ret = _play_x(van, sut, q_gen); + } + u3t_drop(); + return ret; + } + + case c3__zpmc: + case c3__zpsm: u3x_cell(u3t(gen), &p_gen, &q_gen); + _play_used(); + { + u3_noun zur = _play_x(van, sut, p_gen); + u3_noun vos = _play_x(van, sut, q_gen); + u3_noun ret = u3qf_cell(zur, vos); + + u3z(zur); + u3z(vos); + + return ret; + } + + case c3__zpvt: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); + _play_used(); + { + if ( c3y == _play_feel(van, sut, p_gen) ) { + return _play_x(van, sut, q_gen); + } else { + return _play_x(van, sut, r_gen); + } + } + + case c3__lost: + case c3__fail: + case c3__zpzp: + _play_used(); + { + return c3__void; + } + } + } + + static u3_noun + _cqfu_play(u3_noun van, + u3_noun sut, + u3_noun gen) + { + u3_noun von = u3i_molt(u3k(van), u3qfu_van_vet, c3n, 0); + u3_noun ret = _play_x(von, sut, gen); + + u3z(von); + return ret; + } + +/* boilerplate +*/ + u3_noun + u3wfu_play(u3_noun cor) + { + u3_noun sut, gen, van; + + if ( (c3n == u3r_mean(cor, u3x_sam, &gen, u3x_con, &van, 0)) || + (u3_none == (sut = u3r_at(u3x_sam, van))) ) + { + return u3m_bail(c3__fail); + } else { + return _cqfu_play(van, sut, gen); + } + } + + u3_noun + u3qfu_play(u3_noun van, + u3_noun sut, + u3_noun gen) + { +#if 1 + c3_m fun_m = 141 + c3__play; + u3_noun vrf = u3r_at(u3qfu_van_vrf, van); + u3_noun pro = u3z_find_3(fun_m, vrf, sut, gen); + + if ( u3_none != pro ) { + return pro; + } + else { + pro = _cqfu_play(van, sut, gen); + + return u3z_save_3(fun_m, vrf, sut, gen, pro); + } +#else + return _cqfu_play(van, sut, gen); +#endif + } diff --git a/jets/stage/f/ut_repo.c b/jets/stage/f/ut_repo.c new file mode 100644 index 000000000..0e82bf813 --- /dev/null +++ b/jets/stage/f/ut_repo.c @@ -0,0 +1,70 @@ +/* j/6/ut_repo.c +** +*/ +#include "all.h" + + +/* logic +*/ + u3_noun + u3qfu_repo(u3_noun van, + u3_noun sut) + { + u3_noun p_sut, q_sut; + + if ( c3n == u3du(sut) ) switch ( sut ) { + default: return u3k(sut); + + case c3__noun: { + return u3kf_fork(u3nt(u3nt(c3__atom, u3_blip, u3_nul), + u3nt(c3__cell, c3__noun, c3__noun), + u3_nul)); + } + } + else switch ( u3h(sut) ) { + default: { + u3m_p("head", u3h(sut)); + return u3m_error("repo-flat"); + } + + case c3__core: { + if ( c3n == u3r_cell(u3t(sut), &p_sut, &q_sut) ) { + return u3m_bail(c3__fail); + } else { + return u3nt(c3__cell, c3__noun, u3k(p_sut)); + } + } + case c3__hint: + case c3__face: { + if ( c3n == u3r_cell(u3t(sut), &p_sut, &q_sut)) { + return u3m_bail(c3__fail); + } else { + return u3k(q_sut); + } + } + case c3__hold: { + if ( c3n == u3r_cell(u3t(sut), &p_sut, &q_sut)) { + return u3m_bail(c3__fail); + } else { + u3_noun old = u3nc(u3nc(u3k(p_sut), u3k(q_sut)), u3_nul); + u3_noun ret; + + ret = u3qfu_rest(van, sut, old); + u3z(old); + return ret; + } + } + } + } + + u3_noun + u3wfu_repo(u3_noun cor) + { + u3_noun sut; + + if ( u3_none == (sut = u3r_at(u3x_sam, cor)) ) { + return u3m_bail(c3__fail); + } else { + return u3qfu_repo(cor, sut); + } + } diff --git a/jets/stage/f/ut_rest.c b/jets/stage/f/ut_rest.c new file mode 100644 index 000000000..81edd85df --- /dev/null +++ b/jets/stage/f/ut_rest.c @@ -0,0 +1,114 @@ +/* j/6/ut_rest.c +** +*/ +#include "all.h" + + +/* logic +*/ + static u3_noun + _rest_in_list(u3_noun van, + u3_noun leg) + { + if ( u3_nul == leg ) { + return u3_nul; + } else { + u3_noun i_leg = u3h(leg); + u3_noun t_leg = u3t(leg); + + return u3nc(u3qfu_play(van, u3h(i_leg), u3t(i_leg)), + _rest_in_list(van, t_leg)); + } + } + + static u3_noun + _rest_in_stil(u3_noun van, + u3_noun gar) + { + u3_noun gun = u3qdi_gas(u3_nul, gar); + u3_noun yed = u3qdi_tap(gun); + + u3z(gun); + return yed; + } + + static u3_noun + _rest_in(u3_noun van, + u3_noun leg) + { + u3_noun gar = _rest_in_list(van, leg); + u3_noun yed = _rest_in_stil(van, gar); + u3_noun fub = u3qf_fork(yed); + + u3z(gar); + u3z(yed); + + return fub; + } + + static u3_noun + _rest_hit_fan(u3_noun fan, + u3_noun leg) + { + if ( u3_nul == leg ) { + return c3n; + } else { + return c3o(u3qdi_has(fan, u3h(leg)), + _rest_hit_fan(fan, u3t(leg))); + } + } + + static u3_noun + _cqfu_rest(u3_noun van, + u3_noun sut, + u3_noun leg) + { + u3_noun fan = u3r_at(u3qfu_van_fan, van); + + if ( c3y == _rest_hit_fan(fan, leg) ) { + return u3m_error("rest-loop"); + } + else { + u3_noun naf = u3qdi_gas(fan, leg); + u3_noun nav = u3i_molt(u3k(van), u3qfu_van_fan, u3k(naf), 0); + u3_noun mez = _rest_in(nav, leg); + + u3z(naf); + u3z(nav); + return mez; + } + } + +/* boilerplate +*/ + u3_noun + u3wfu_rest(u3_noun cor) + { + u3_noun sut, leg, van; + + if ( (c3n == u3r_mean(cor, u3x_sam, &leg, u3x_con, &van, 0)) || + (u3_none == (sut = u3r_at(u3x_sam, van))) ) + { + return u3m_bail(c3__fail); + } else { + return _cqfu_rest(van, sut, leg); + } + } + + u3_noun + u3qfu_rest(u3_noun van, + u3_noun sut, + u3_noun leg) + { + c3_m fun_m = 141 + c3__rest + ((!!u3r_at(u3qfu_van_vet, van)) << 8); + u3_noun pro = u3z_find_2(fun_m, sut, leg); + + if ( u3_none != pro ) { + return pro; + } + else { + pro = _cqfu_rest(van, sut, leg); + + return u3z_save_2(fun_m, sut, leg, pro); + } + } diff --git a/jets/stage/f/ut_tack.c b/jets/stage/f/ut_tack.c new file mode 100644 index 000000000..9328c43ae --- /dev/null +++ b/jets/stage/f/ut_tack.c @@ -0,0 +1,21 @@ +/* j/6/tack.c +** +*/ +#include "all.h" + + u3_noun + u3qfu_tack(u3_noun van, + u3_noun sut, + u3_noun hyp, + u3_noun mur) + { + u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); + u3_noun gat = u3j_cook("u3qfu_tack-tack", von, "tack"); + + return u3n_kick_on(u3i_molt(gat, + u3x_sam_2, + u3k(hyp), + u3x_sam_3, + u3k(mur), + 0)); + } diff --git a/jets/stage/f/ut_toss.c b/jets/stage/f/ut_toss.c new file mode 100644 index 000000000..15973cf58 --- /dev/null +++ b/jets/stage/f/ut_toss.c @@ -0,0 +1,97 @@ +/* j/6/toss.c +** +*/ +#include "all.h" + + +/* internals +*/ + static u3_noun + _toss_in(u3_noun van, + u3_noun sut, + u3_noun peh, + u3_noun mur, + u3_noun men) + { + if ( c3n == u3du(men) ) { + return u3nc(u3_nul, u3_nul); + } + else { + u3_noun i_men = u3h(men); + u3_noun pi_men = u3h(i_men); + u3_noun qi_men = u3t(i_men); + u3_noun t_men = u3t(men); + u3_noun geq = u3qfu_tack(van, pi_men, peh, mur); + u3_noun p_geq = u3h(geq); + u3_noun q_geq = u3t(geq); + u3_noun mox = _toss_in(van, sut, peh, mur, t_men); + u3_noun p_mox = u3h(mox); + u3_noun q_mox = u3t(mox); + u3_noun ret; + + ret = u3nc( + ( (u3_nul == p_mox) + ? u3nc(u3_nul, u3k(p_geq)) + : (c3n == u3r_sing(p_geq, u3t(p_mox))) + ? u3m_bail(c3__exit) + : u3k(p_mox) ), + u3nc(u3nc(u3k(q_geq), u3k(qi_men)), u3k(q_mox))); + + u3z(mox); + u3z(geq); + return ret; + } + } + +/* functions +*/ + u3_noun + _cqfu_toss(u3_noun van, + u3_noun sut, + u3_noun peh, + u3_noun mur, + u3_noun men) + { + u3_noun wib = _toss_in(van, sut, peh, mur, men); + u3_noun p_wib = u3h(wib); + u3_noun q_wib = u3t(wib); + + if ( u3_nul == p_wib ) { + return u3m_bail(c3__exit); + } else { + u3_noun ret = u3nc(u3k(u3t(p_wib)), u3k(q_wib)); + + u3z(wib); + return ret; + } + } + +/* boilerplate +*/ + u3_noun + u3wfu_toss(u3_noun cor) + { + u3_noun van, sut, peh, mur, men; + + if ( (c3n == u3r_mean(cor, u3x_sam_2, &peh, + u3x_sam_6, &mur, + u3x_sam_7, &men, + u3x_con, &van, + 0)) || + (u3_none == (sut = u3r_at(u3x_sam, van))) ) + { + return u3m_bail(c3__fail); + } else { + return _cqfu_toss(van, sut, peh, mur, men); + } + } + + u3_noun + u3qfu_toss(u3_noun van, + u3_noun sut, + u3_noun peh, + u3_noun mur, + u3_noun men) + { + return _cqfu_toss(van, sut, peh, mur, men); + } diff --git a/jets/stage/f/ut_wrap.c b/jets/stage/f/ut_wrap.c new file mode 100644 index 000000000..e51d3843f --- /dev/null +++ b/jets/stage/f/ut_wrap.c @@ -0,0 +1,97 @@ +/* j/6/wrap.c +** +*/ +#include "all.h" + + static u3_noun _cqfu_wrap(u3_noun, u3_noun, u3_noun); + + static u3_noun + _wrap_fork(u3_noun van, u3_noun p_sut, u3_noun yoz) + { + if ( u3_nul == p_sut ) { + return u3_nul; + } + else { + return u3nc(_cqfu_wrap(van, u3h(p_sut), yoz), + _wrap_fork(van, u3t(p_sut), yoz)); + } + } + + static u3_noun + _cqfu_wrap(u3_noun van, + u3_noun sut, + u3_noun yoz) + { + u3_noun p_sut, q_sut; + + if ( c3n == u3du(sut) ) { + return u3m_error("wrap-type"); + } + else switch ( u3h(sut) ) { + default: return u3m_error("wrap-type"); + + case c3__core: u3x_cell(u3t(sut), &p_sut, &q_sut); + { + u3_noun pq_sut, qq_sut, rq_sut; + u3_noun ppq_sut, qpq_sut, rpq_sut; + + if ( c3n == u3r_trel(q_sut, &pq_sut, &qq_sut, &rq_sut) ) { + return u3m_bail(c3__fail); + } + if ( c3n == u3r_trel(pq_sut, &ppq_sut, &qpq_sut, &rpq_sut) ) { + return u3m_bail(c3__fail); + } + else if ( (c3__gold != rpq_sut) && + (c3__lead != yoz) ) { + return u3m_error("wrap-metal"); + } + else { + return u3nt(c3__core, + u3k(p_sut), + u3nt(u3nt(u3k(ppq_sut), u3k(qpq_sut), u3k(yoz)), + u3k(qq_sut), + u3k(rq_sut))); + } + } + case c3__fork: p_sut = u3t(sut); + { + u3_noun yed = u3qdi_tap(p_sut); + u3_noun ret = u3kf_fork(_wrap_fork(van, yed, yoz)); + + u3z(yed); + return ret; + } + case c3__hold: + { + u3_noun fop = u3qfu_repo(van, sut); + u3_noun pro = _cqfu_wrap(van, fop, yoz); + + u3z(fop); + return pro; + } + } + } + +/* boilerplate +*/ + u3_noun + u3wfu_wrap(u3_noun cor) + { + u3_noun sut, yoz, van; + + if ( (c3n == u3r_mean(cor, u3x_sam, &yoz, u3x_con, &van, 0)) || + (u3_none == (sut = u3r_at(u3x_sam, van))) ) + { + return u3m_bail(c3__fail); + } else { + return _cqfu_wrap(van, sut, yoz); + } + } + + u3_noun + u3qfu_wrap(u3_noun van, + u3_noun sut, + u3_noun yoz) + { + return _cqfu_wrap(van, sut, yoz); + } From cee1bfe59180e768ceb7fbb202ac123a955b812f Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Fri, 4 Jan 2019 16:33:04 -0500 Subject: [PATCH 10/78] adds staged jet headers and dashboard declarations, renames everything --- include/jets/k.h | 5 + include/jets/q.h | 72 +++++++++++++++ include/jets/w.h | 42 +++++++++ include/noun/retrieve.h | 2 + jets/stage/c/gor.c | 10 +- jets/stage/c/hor.c | 12 +-- jets/stage/c/vor.c | 10 +- jets/stage/d/by_bif.c | 12 +-- jets/stage/d/by_del.c | 14 +-- jets/stage/d/by_dif.c | 16 ++-- jets/stage/d/by_gas.c | 14 +-- jets/stage/d/by_get.c | 20 ++-- jets/stage/d/by_has.c | 16 ++-- jets/stage/d/by_jab.c | 12 +-- jets/stage/d/by_put.c | 20 ++-- jets/stage/d/in_bif.c | 10 +- jets/stage/d/in_del.c | 14 +-- jets/stage/d/in_dif.c | 16 ++-- jets/stage/d/in_gas.c | 14 +-- jets/stage/d/in_has.c | 16 ++-- jets/stage/d/in_mer.c | 22 ++--- jets/stage/d/in_put.c | 20 ++-- jets/stage/d/in_uni.c | 16 ++-- jets/stage/f/fork.c | 18 ++-- jets/stage/f/look.c | 14 +-- jets/stage/f/loot.c | 10 +- jets/stage/f/ut.c | 26 +++--- jets/stage/f/ut_buss.c | 12 +-- jets/stage/f/ut_conk.c | 12 +-- jets/stage/f/ut_crop.c | 26 +++--- jets/stage/f/ut_find.c | 74 +++++++-------- jets/stage/f/ut_fire.c | 28 +++--- jets/stage/f/ut_fish.c | 18 ++-- jets/stage/f/ut_fuse.c | 20 ++-- jets/stage/f/ut_gain.c | 4 +- jets/stage/f/ut_lose.c | 4 +- jets/stage/f/ut_mint.c | 88 +++++++++--------- jets/stage/f/ut_mull.c | 108 +++++++++++----------- jets/stage/f/ut_nest.c | 56 +++++------ jets/stage/f/ut_peek.c | 18 ++-- jets/stage/f/ut_peel.c | 6 +- jets/stage/f/ut_play.c | 48 +++++----- jets/stage/f/ut_repo.c | 10 +- jets/stage/f/ut_rest.c | 22 ++--- jets/stage/f/ut_tack.c | 4 +- jets/stage/f/ut_toss.c | 8 +- jets/stage/f/ut_wrap.c | 10 +- jets/tree.c | 200 +++++++++++++++++++++++++++++++++++++++- meson.build | 53 ++++++++++- 49 files changed, 834 insertions(+), 468 deletions(-) diff --git a/include/jets/k.h b/include/jets/k.h index 3eeb4d227..9b1920353 100644 --- a/include/jets/k.h +++ b/include/jets/k.h @@ -105,6 +105,9 @@ u3_noun u3kdi_uni(u3_noun a, u3_noun b); + u3_weak u3kdi__stage_put(u3_noun a, u3_noun b); + u3_noun u3kdi__stage_uni(u3_noun a, u3_noun b); + # define u3kdb_tap(a) u3kdi_tap(a) /* u3ke: tier 5 functions @@ -129,6 +132,8 @@ u3_noun u3kf_fork(u3_noun yed); + u3_noun u3kf__stage_fork(u3_noun yed); + /* u3kz_fork(): build %fork span. */ u3_noun diff --git a/include/jets/q.h b/include/jets/q.h index f6c101d53..5ccd3368a 100644 --- a/include/jets/q.h +++ b/include/jets/q.h @@ -71,6 +71,10 @@ u3_noun u3qc_sqt(u3_atom); u3_noun u3qc_vor(u3_atom, u3_atom); + u3_noun u3qc__stage_gor(u3_atom, u3_atom); + u3_noun u3qc__stage_hor(u3_atom, u3_atom); + u3_noun u3qc__stage_vor(u3_atom, u3_atom); + /** Tier 4. **/ u3_noun u3qdb_bif(u3_noun, u3_noun); @@ -83,6 +87,14 @@ # define u3qdb_tap u3qdi_tap u3_noun u3qdb_uni(u3_noun, u3_noun); + u3_noun u3qdb__stage_bif(u3_noun, u3_noun); + u3_noun u3qdb__stage_dif(u3_noun, u3_noun); + u3_noun u3qdb__stage_gas(u3_noun, u3_noun); + u3_noun u3qdb__stage_get(u3_noun, u3_noun); + u3_noun u3qdb__stage_has(u3_noun, u3_noun); + u3_noun u3qdb__stage_put(u3_noun, u3_noun, u3_noun); +# define u3qdb__stage_tap u3qdi_tap + u3_noun u3qdi_bif(u3_noun, u3_noun); u3_noun u3qdi_dif(u3_noun, u3_noun); u3_noun u3qdi_gas(u3_noun, u3_noun); @@ -94,6 +106,15 @@ u3_noun u3qdi_uni(u3_noun, u3_noun); u3_noun u3qdi_wyt(u3_noun); + u3_noun u3qdi__stage_bif(u3_noun, u3_noun); + u3_noun u3qdi__stage_dif(u3_noun, u3_noun); + u3_noun u3qdi__stage_gas(u3_noun, u3_noun); + u3_noun u3qdi__stage_has(u3_noun, u3_noun); + u3_noun u3qdi__stage_mer(u3_noun, u3_noun); + u3_noun u3qdi__stage_put(u3_noun, u3_noun); +# define u3qdi__stage_tap u3qdi_tap + u3_noun u3qdi__stage_uni(u3_noun, u3_noun); + /** Tier 5. **/ u3_noun u3qe_cue(u3_atom); @@ -232,6 +253,11 @@ u3_noun u3qf_slot(u3_atom, u3_noun); u3_noun u3qf_type(u3_noun); + u3_noun u3qf__stage_fork(u3_noun); + u3_noun u3qf__stage_forq(u3_noun, u3_noun); + u3_noun u3qf__stage_look(u3_noun, u3_noun); + u3_noun u3qf__stage_loot(u3_noun, u3_noun); + u3_noun u3qfl_bunt(u3_noun, u3_noun); u3_noun u3qfl_whip(u3_noun, u3_noun, u3_noun); @@ -289,4 +315,50 @@ u3_noun u3qfu_toss(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); u3_noun u3qfu_wrap(u3_noun, u3_noun, u3_noun); + u3_noun u3qfu__stage_burn(u3_noun, u3_noun); + u3_noun u3qfu__stage_busk(u3_noun, u3_noun, u3_noun); + u3_noun u3qfu__stage_buss(u3_noun, u3_noun, u3_noun, u3_noun); + u3_noun u3qfu__stage_bust(u3_noun, u3_noun, u3_noun); + u3_noun u3qfu__stage_conk(u3_noun, u3_noun, u3_noun); + u3_noun u3qfu__stage_crop(u3_noun, u3_noun, u3_noun); + u3_noun u3qfu__stage_cull(u3_noun, u3_noun, u3_noun, u3_atom, u3_noun); + u3_noun u3qfu__stage_duck(u3_noun, u3_noun); + u3_noun u3qfu__stage_dung(u3_noun, u3_noun cap, u3_noun); + u3_noun u3qfu__stage_dunq(u3_noun, const c3_c*, u3_noun); + void u3qfu__stage_dump(u3_noun, const c3_c*, u3_noun); + u3_noun u3qfu__stage_fond(u3_noun, u3_noun, u3_noun, u3_noun); + u3_noun u3qfu__stage_find(u3_noun, u3_noun, u3_noun, u3_noun); + u3_noun u3qfu__stage_finc(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); + u3_noun u3qfu__stage_fink(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); + u3_noun u3qfu__stage_fire(u3_noun, u3_noun, u3_noun); + u3_noun u3qfu__stage_firm(u3_noun, u3_noun, u3_noun); + u3_noun u3qfu__stage_fish(u3_noun, u3_noun, u3_atom); + u3_noun u3qfu__stage_fuse(u3_noun, u3_noun, u3_noun); + u3_noun u3qfu__stage_gain(u3_noun, u3_noun, u3_noun); + u3_noun u3qfu__stage_heal(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); + u3_noun u3qfu__stage_lose(u3_noun, u3_noun, u3_noun); + u3_noun u3qfu__stage_mint(u3_noun, u3_noun, u3_noun, u3_noun); + u3_noun u3qfu__stage_mull(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); + u3_noun u3qfu__stage_nest(u3_noun, u3_noun, u3_noun, u3_noun); + u3_noun u3qfu__stage_nost(u3_noun, u3_noun, u3_noun, u3_noun); + u3_noun u3qfu__stage_orth(u3_noun, u3_noun, u3_noun); + u3_noun u3qfu__stage_peek(u3_noun, u3_noun, u3_noun, u3_noun); + u3_noun u3qfu__stage_peel(u3_noun, u3_noun, u3_noun, u3_noun); + u3_noun u3qfu__stage_play(u3_noun, u3_noun, u3_noun); + u3_noun u3qfu__stage_repo(u3_noun, u3_noun); + u3_noun u3qfu__stage_rest(u3_noun, u3_noun, u3_noun); + u3_noun u3qfu__stage_shep(u3_noun, const c3_c*, u3_noun, u3_noun); + u3_noun u3qfu__stage_shew(u3_noun, u3_noun); + u3_noun u3qfu__stage_sift(u3_noun, u3_noun, u3_noun); + u3_noun u3qfu__stage_snub(u3_noun, u3_noun, u3_noun); + u3_noun u3qfu__stage_tack(u3_noun, u3_noun, u3_noun, u3_noun); + u3_noun u3qfu__stage_toss(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); + u3_noun u3qfu__stage_wrap(u3_noun, u3_noun, u3_noun); + +# define u3qfu__stage_van_fan 28 +# define u3qfu__stage_van_rib 58 +# define u3qfu__stage_van_vrf 59 +# define u3qfu__stage_van_vet 118 +# define u3qfu__stage_van_fab 119 + void u3qf_test(const c3_c*, u3_noun); diff --git a/include/jets/w.h b/include/jets/w.h index 0dd3d7f42..81da94705 100644 --- a/include/jets/w.h +++ b/include/jets/w.h @@ -71,6 +71,10 @@ u3_noun u3wc_sqt(u3_noun); u3_noun u3wc_vor(u3_noun); + u3_noun u3wc__stage_gor(u3_noun); + u3_noun u3wc__stage_hor(u3_noun); + u3_noun u3wc__stage_vor(u3_noun); + u3_noun u3wcp_ins(u3_noun); u3_noun u3wcp_ind(u3_noun); u3_noun u3wcp_tos(u3_noun); @@ -90,6 +94,16 @@ # define u3wdb_tap u3wdi_tap u3_noun u3wdb_uni(u3_noun); + u3_noun u3wdb__stage_bif(u3_noun); + u3_noun u3wdb__stage_del(u3_noun); + u3_noun u3wdb__stage_dif(u3_noun); + u3_noun u3wdb__stage_gas(u3_noun); + u3_noun u3wdb__stage_get(u3_noun); + u3_noun u3wdb__stage_has(u3_noun); + u3_noun u3wdb__stage_jab(u3_noun); + u3_noun u3wdb__stage_put(u3_noun); +# define u3wdb__stage_tap u3wdi_tap + u3_noun u3wdi_bif(u3_noun); u3_noun u3wdi_del(u3_noun); u3_noun u3wdi_dif(u3_noun); @@ -102,6 +116,15 @@ u3_noun u3wdi_uni(u3_noun); u3_noun u3wdi_wyt(u3_noun); + u3_noun u3wdi__stage_bif(u3_noun); + u3_noun u3wdi__stage_del(u3_noun); + u3_noun u3wdi__stage_dif(u3_noun); + u3_noun u3wdi__stage_gas(u3_noun); + u3_noun u3wdi__stage_has(u3_noun); + u3_noun u3wdi__stage_mer(u3_noun); + u3_noun u3wdi__stage_put(u3_noun); + u3_noun u3wdi__stage_uni(u3_noun); + /** Tier 5. **/ u3_noun u3we_cue(u3_noun); @@ -257,6 +280,10 @@ u3_noun u3wf_look(u3_noun); u3_noun u3wf_loot(u3_noun); + u3_noun u3wf__stage_fork(u3_noun); + u3_noun u3wf__stage_look(u3_noun); + u3_noun u3wf__stage_loot(u3_noun); + u3_noun u3wfl_bunt(u3_noun); u3_noun u3wfl_whip(u3_noun); @@ -291,3 +318,18 @@ u3_noun u3wfu_snub(u3_noun); u3_noun u3wfu_toss(u3_noun); u3_noun u3wfu_wrap(u3_noun); + + u3_noun u3wfu__stage_crop(u3_noun); + u3_noun u3wfu__stage_find(u3_noun); + u3_noun u3wfu__stage_fire(u3_noun); + u3_noun u3wfu__stage_fish(u3_noun); + u3_noun u3wfu__stage_fond(u3_noun); + u3_noun u3wfu__stage_fuse(u3_noun); + u3_noun u3wfu__stage_mint(u3_noun); + u3_noun u3wfu__stage_mull(u3_noun); + u3_noun u3wfu__stage_nest(u3_noun); + u3_noun u3wfu__stage_peek(u3_noun); + u3_noun u3wfu__stage_play(u3_noun); + u3_noun u3wfu__stage_rest(u3_noun); + u3_noun u3wfu__stage_toss(u3_noun); + u3_noun u3wfu__stage_wrap(u3_noun); diff --git a/include/noun/retrieve.h b/include/noun/retrieve.h index 1de897b09..a430bfb42 100644 --- a/include/noun/retrieve.h +++ b/include/noun/retrieve.h @@ -32,6 +32,8 @@ c3_o u3r_mean(u3_noun a, ...); +#define u3r__stage_mug u3r_mug + /* u3r_mug(): ** ** Compute and/or recall the mug (31-bit hash) of (a). diff --git a/jets/stage/c/gor.c b/jets/stage/c/gor.c index 8e89b5e8c..52bb00043 100644 --- a/jets/stage/c/gor.c +++ b/jets/stage/c/gor.c @@ -7,11 +7,11 @@ /* functions */ u3_noun - u3qc_gor(u3_noun a, + u3qc__stage_gor(u3_noun a, u3_noun b) { - c3_w c_w = u3r_mug(a); - c3_w d_w = u3r_mug(b); + c3_w c_w = u3r__stage_mug(a); + c3_w d_w = u3r__stage_mug(b); if ( c_w == d_w ) { return u3qc_dor(a, b); @@ -19,14 +19,14 @@ else return (c_w < d_w) ? c3y : c3n; } u3_noun - u3wc_gor(u3_noun cor) + u3wc__stage_gor(u3_noun cor) { u3_noun a, b; if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) ) { return u3m_bail(c3__exit); } else { - return u3qc_gor(a, b); + return u3qc__stage_gor(a, b); } } diff --git a/jets/stage/c/hor.c b/jets/stage/c/hor.c index 052c53b82..69e68fb5d 100644 --- a/jets/stage/c/hor.c +++ b/jets/stage/c/hor.c @@ -7,12 +7,12 @@ /* functions */ u3_noun - u3qc_hor(u3_noun a, + u3qc__stage_hor(u3_noun a, u3_noun b) { if ( c3y == u3ud(a) ) { if ( c3y == u3ud(b) ) { - return u3qc_gor(a, b); + return u3qc__stage_gor(a, b); } else { return c3y; } @@ -25,22 +25,22 @@ u3_noun h_b = u3h(b); if ( c3y == u3r_sing(h_a, h_b) ) { - return u3qc_gor(u3t(a), u3t(b)); + return u3qc__stage_gor(u3t(a), u3t(b)); } else { - return u3qc_gor(h_a, h_b); + return u3qc__stage_gor(h_a, h_b); } } } } u3_noun - u3wc_hor(u3_noun cor) + u3wc__stage_hor(u3_noun cor) { u3_noun a, b; if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) ) { return u3m_bail(c3__exit); } else { - return u3qc_hor(a, b); + return u3qc__stage_hor(a, b); } } diff --git a/jets/stage/c/vor.c b/jets/stage/c/vor.c index 28364140b..f388fcc48 100644 --- a/jets/stage/c/vor.c +++ b/jets/stage/c/vor.c @@ -7,11 +7,11 @@ /* functions */ u3_noun - u3qc_vor(u3_atom a, + u3qc__stage_vor(u3_atom a, u3_atom b) { - c3_w c_w = u3r_mug(u3r_mug(a)); - c3_w d_w = u3r_mug(u3r_mug(b)); + c3_w c_w = u3r__stage_mug(u3r__stage_mug(a)); + c3_w d_w = u3r__stage_mug(u3r__stage_mug(b)); if ( c_w == d_w ) { return u3qc_dor(a, b); @@ -19,13 +19,13 @@ else return (c_w < d_w) ? c3y : c3n; } u3_noun - u3wc_vor(u3_noun cor) + u3wc__stage_vor(u3_noun cor) { u3_noun a, b; if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) ) { return u3m_bail(c3__exit); } else { - return u3qc_vor(a, b); + return u3qc__stage_vor(a, b); } } diff --git a/jets/stage/d/by_bif.c b/jets/stage/d/by_bif.c index 3e53ba6d6..057b14e68 100644 --- a/jets/stage/d/by_bif.c +++ b/jets/stage/d/by_bif.c @@ -1,4 +1,4 @@ -/* jets/d/by_bif.c +/* jets/d/yb_bif.c ** */ #include "all.h" @@ -29,7 +29,7 @@ u3_noun c, n_c, l_c, r_c; u3_noun d; - if ( c3y == u3qc_gor(p_b, p_n_a) ) { + if ( c3y == u3qc__stage_gor(p_b, p_n_a) ) { c = _b_bif_putroot(l_a, b); u3r_trel(c, &n_c, &l_c, &r_c); d = u3nt(u3k(n_c), @@ -54,17 +54,17 @@ /* functions */ - u3_noun u3wdb_bif(u3_noun cor) + u3_noun u3wdb__stage_bif(u3_noun cor) { u3_noun a, b; if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { return u3m_bail(c3__exit); } else { - return u3qdb_bif(a, b); + return u3qdb__stage_bif(a, b); } } - u3_noun u3qdb_bif(u3_noun a, + u3_noun u3qdb__stage_bif(u3_noun a, u3_noun b) { u3_noun c, n_c, l_c, r_c; @@ -78,5 +78,5 @@ } /* - u3_weak u3kdi_bif(u3_noun a, u3_noun b); + u3_weak u3kdb__stage_bif(u3_noun a, u3_noun b); */ diff --git a/jets/stage/d/by_del.c b/jets/stage/d/by_del.c index 90e11b37c..612d2748c 100644 --- a/jets/stage/d/by_del.c +++ b/jets/stage/d/by_del.c @@ -31,7 +31,7 @@ return u3m_bail(c3__exit); } else { - if ( c3y == u3qc_vor(u3h(n_l_a), u3h(n_r_a)) ) { + if ( c3y == u3qc__stage_vor(u3h(n_l_a), u3h(n_r_a)) ) { u3_noun new_right = u3nt(u3k(n_a), u3k(r_l_a), u3k(r_a)); @@ -61,7 +61,7 @@ } u3_noun - u3qdb_del(u3_noun a, + u3qdb__stage_del(u3_noun a, u3_noun b) { if ( u3_nul == a ) { @@ -76,15 +76,15 @@ return u3m_bail(c3__exit); } else if ( c3n == u3r_sing(pn_a, b) ) { - if ( c3y == u3qc_gor(b, pn_a) ) { + if ( c3y == u3qc__stage_gor(b, pn_a) ) { return u3nt(u3k(n_a), - u3qdb_del(l_a, b), + u3qdb__stage_del(l_a, b), u3k(r_a)); } else { return u3nt(u3k(n_a), u3k(l_a), - u3qdb_del(r_a, b)); + u3qdb__stage_del(r_a, b)); } } else { @@ -94,7 +94,7 @@ } u3_noun - u3wdb_del(u3_noun cor) + u3wdb__stage_del(u3_noun cor) { u3_noun a, b; @@ -103,7 +103,7 @@ return u3m_bail(c3__exit); } else { - u3_noun n = u3qdb_del(a, b); + u3_noun n = u3qdb__stage_del(a, b); return n; } } diff --git a/jets/stage/d/by_dif.c b/jets/stage/d/by_dif.c index 7973a4f34..dae185569 100644 --- a/jets/stage/d/by_dif.c +++ b/jets/stage/d/by_dif.c @@ -25,7 +25,7 @@ || c3n == u3r_cell(n_e, &p_n_e, &q_n_e) ) { return u3m_bail(c3__exit); } else { - if ( c3y == u3qc_vor(p_n_d, p_n_e) ) { + if ( c3y == u3qc__stage_vor(p_n_d, p_n_e) ) { return u3nt(u3k(n_d), u3k(l_d), _b_dif_join(u3k(r_d), u3k(e))); @@ -40,17 +40,17 @@ /* functions */ - u3_noun u3wdb_dif(u3_noun cor) + u3_noun u3wdb__stage_dif(u3_noun cor) { u3_noun a, b; if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { return u3m_bail(c3__exit); } else { - return u3qdb_dif(a, b); + return u3qdb__stage_dif(a, b); } } - u3_noun u3qdb_dif(u3_noun a, + u3_noun u3qdb__stage_dif(u3_noun a, u3_noun b) { if ( u3_nul == b ) { @@ -63,7 +63,7 @@ return u3m_bail(c3__exit); } else { - c = u3qdb_bif(a, n_b); + c = u3qdb__stage_bif(a, n_b); if ( c3n == u3r_cell(c, &l_c, &r_c) ) { return u3m_bail(c3__exit); @@ -71,8 +71,8 @@ u3_noun d; u3_noun e; - d = u3qdb_dif(l_c, l_b); - e = u3qdb_dif(r_c, r_b); + d = u3qdb__stage_dif(l_c, l_b); + e = u3qdb__stage_dif(r_c, r_b); u3z(c); return _b_dif_join(d, e); @@ -82,5 +82,5 @@ } /* - u3_weak u3kdb_dif(u3_noun a, u3_noun b); + u3_weak u3kdb__stage_dif(u3_noun a, u3_noun b); */ diff --git a/jets/stage/d/by_gas.c b/jets/stage/d/by_gas.c index caa7f5291..dd39fc5ab 100644 --- a/jets/stage/d/by_gas.c +++ b/jets/stage/d/by_gas.c @@ -7,7 +7,7 @@ /* functions */ u3_noun - u3qdb_gas(u3_noun a, + u3qdb__stage_gas(u3_noun a, u3_noun b) { if ( u3_nul == b ) { @@ -27,10 +27,10 @@ u3_noun qi_b = u3t(i_b); u3_noun c; - if ( u3_none == (c = u3qdb_put(a, pi_b, qi_b)) ) { + if ( u3_none == (c = u3qdb__stage_put(a, pi_b, qi_b)) ) { return u3m_bail(c3__exit); } else { - u3_noun d = u3qdb_gas(c, t_b); + u3_noun d = u3qdb__stage_gas(c, t_b); u3z(c); return d; @@ -40,21 +40,21 @@ } } u3_noun - u3wdb_gas(u3_noun cor) + u3wdb__stage_gas(u3_noun cor) { u3_noun a, b; if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { return u3m_bail(c3__exit); } else { - return u3qdb_gas(a, b); + return u3qdb__stage_gas(a, b); } } u3_noun - u3kdb_gas(u3_noun a, + u3kdb__stage_gas(u3_noun a, u3_noun b) { - u3_weak c = u3qdb_gas(a, b); + u3_weak c = u3qdb__stage_gas(a, b); u3z(a); u3z(b); if ( u3_none == c ) { diff --git a/jets/stage/d/by_get.c b/jets/stage/d/by_get.c index 588578764..ac105ff61 100644 --- a/jets/stage/d/by_get.c +++ b/jets/stage/d/by_get.c @@ -7,7 +7,7 @@ /* functions */ u3_noun - u3qdb_get(u3_noun a, + u3qdb__stage_get(u3_noun a, u3_noun b) { if ( u3_nul == a ) { @@ -27,30 +27,30 @@ return u3nc(u3_nul, u3k(qn_a)); } else { - if ( c3y == u3qc_gor(b, pn_a) ) { - return u3qdb_get(l_a, b); + if ( c3y == u3qc__stage_gor(b, pn_a) ) { + return u3qdb__stage_get(l_a, b); } - else return u3qdb_get(r_a, b); + else return u3qdb__stage_get(r_a, b); } } } } u3_noun - u3wdb_get(u3_noun cor) + u3wdb__stage_get(u3_noun cor) { u3_noun a, b; if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { return u3m_bail(c3__exit); } else { - return u3qdb_get(a, b); + return u3qdb__stage_get(a, b); } } u3_weak - u3kdb_get(u3_noun a, + u3kdb__stage_get(u3_noun a, u3_noun b) { - u3_noun c = u3qdb_get(a, b); + u3_noun c = u3qdb__stage_get(a, b); u3z(a); u3z(b); if ( c3n == u3r_du(c) ) { @@ -64,10 +64,10 @@ } } u3_noun - u3kdb_got(u3_noun a, + u3kdb__stage_got(u3_noun a, u3_noun b) { - u3_weak c = u3kdb_get(a, b); + u3_weak c = u3kdb__stage_get(a, b); if ( u3_none == c ) { return u3m_bail(c3__exit); diff --git a/jets/stage/d/by_has.c b/jets/stage/d/by_has.c index 0fa41bf3e..4a3c26bbf 100644 --- a/jets/stage/d/by_has.c +++ b/jets/stage/d/by_has.c @@ -7,7 +7,7 @@ /* functions */ u3_noun - u3qdb_has(u3_noun a, + u3qdb__stage_has(u3_noun a, u3_noun b) { if ( u3_nul == a ) { @@ -27,30 +27,30 @@ return c3y; } else { - if ( c3y == u3qc_gor(b, pn_a) ) { - return u3qdb_has(l_a, b); + if ( c3y == u3qc__stage_gor(b, pn_a) ) { + return u3qdb__stage_has(l_a, b); } - else return u3qdb_has(r_a, b); + else return u3qdb__stage_has(r_a, b); } } } } u3_noun - u3wdb_has(u3_noun cor) + u3wdb__stage_has(u3_noun cor) { u3_noun a, b; if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { return u3m_bail(c3__exit); } else { - return u3qdb_has(a, b); + return u3qdb__stage_has(a, b); } } u3_noun - u3kdb_has(u3_noun a, + u3kdb__stage_has(u3_noun a, u3_noun b) { - u3_weak c = u3qdb_has(a, b); + u3_weak c = u3qdb__stage_has(a, b); u3z(a); u3z(b); if ( u3_none == c ) { diff --git a/jets/stage/d/by_jab.c b/jets/stage/d/by_jab.c index f147232a2..19f4607ad 100644 --- a/jets/stage/d/by_jab.c +++ b/jets/stage/d/by_jab.c @@ -7,7 +7,7 @@ /* functions */ u3_noun - u3qdb_jab(u3_noun a, + u3qdb__stage_jab(u3_noun a, u3_noun key, u3_noun fun) { @@ -29,11 +29,11 @@ return u3nc(u3nc(u3k(pn_a), value), u3k(u3t(a))); } else { - if ( c3y == u3qc_gor(key, pn_a) ) { - return u3nt(u3k(n_a), u3qdb_jab(l_a, key, fun), u3k(r_a)); + if ( c3y == u3qc__stage_gor(key, pn_a) ) { + return u3nt(u3k(n_a), u3qdb__stage_jab(l_a, key, fun), u3k(r_a)); } else { - return u3nt(u3k(n_a), u3k(l_a), u3qdb_jab(r_a, key, fun)); + return u3nt(u3k(n_a), u3k(l_a), u3qdb__stage_jab(r_a, key, fun)); } } } @@ -41,7 +41,7 @@ } u3_noun - u3wdb_jab(u3_noun cor) + u3wdb__stage_jab(u3_noun cor) { u3_noun a, key, fun; @@ -50,7 +50,7 @@ u3x_con_sam, &a, 0) ) { return u3m_bail(c3__exit); } else { - u3_noun n = u3qdb_jab(a, key, fun); + u3_noun n = u3qdb__stage_jab(a, key, fun); return n; } } diff --git a/jets/stage/d/by_put.c b/jets/stage/d/by_put.c index 5bafdc0c2..dd81fea73 100644 --- a/jets/stage/d/by_put.c +++ b/jets/stage/d/by_put.c @@ -7,7 +7,7 @@ /* functions */ u3_noun - u3qdb_put(u3_noun a, + u3qdb__stage_put(u3_noun a, u3_noun b, u3_noun c) { @@ -38,10 +38,10 @@ } } else { - if ( c3y == u3qc_gor(b, pn_a) ) { - d = u3qdb_put(l_a, b, c); + if ( c3y == u3qc__stage_gor(b, pn_a) ) { + d = u3qdb__stage_put(l_a, b, c); - if ( c3y == u3qc_vor(pn_a, u3h(u3h(d))) ) { + if ( c3y == u3qc__stage_vor(pn_a, u3h(u3h(d))) ) { return u3nt(u3k(n_a), d, u3k(r_a)); @@ -62,9 +62,9 @@ } } else { - d = u3qdb_put(r_a, b, c); + d = u3qdb__stage_put(r_a, b, c); - if ( c3y == u3qc_vor(pn_a, u3h(u3h(d))) ) { + if ( c3y == u3qc__stage_vor(pn_a, u3h(u3h(d))) ) { return u3nt(u3k(n_a), u3k(l_a), d); @@ -88,7 +88,7 @@ } } u3_noun - u3wdb_put(u3_noun cor) + u3wdb__stage_put(u3_noun cor) { u3_noun a, b, c; @@ -97,11 +97,11 @@ u3x_con_sam, &a, 0) ) { return u3m_bail(c3__exit); } else { - return u3qdb_put(a, b, c); + return u3qdb__stage_put(a, b, c); } } u3_weak - u3kdb_put(u3_noun a, + u3kdb__stage_put(u3_noun a, u3_noun b, u3_noun c) { @@ -109,7 +109,7 @@ // // (Mysterious comment in old glue code.) // - u3_noun pro = u3qdb_put(a, b, c); + u3_noun pro = u3qdb__stage_put(a, b, c); u3z(a); u3z(b); u3z(c); return pro; diff --git a/jets/stage/d/in_bif.c b/jets/stage/d/in_bif.c index 4c5bdbeb9..5fe6b10fd 100644 --- a/jets/stage/d/in_bif.c +++ b/jets/stage/d/in_bif.c @@ -25,7 +25,7 @@ u3_noun c, n_c, l_c, r_c; u3_noun d; - if ( c3y == u3qc_hor(b, n_a) ) { + if ( c3y == u3qc__stage_hor(b, n_a) ) { c = _i_bif_putroot(l_a, b); u3r_trel(c, &n_c, &l_c, &r_c); d = u3nt(u3k(n_c), @@ -48,17 +48,17 @@ /* functions */ - u3_noun u3wdi_bif(u3_noun cor) + u3_noun u3wdi__stage_bif(u3_noun cor) { u3_noun a, b; if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { return u3m_bail(c3__exit); } else { - return u3qdi_bif(a, b); + return u3qdi__stage_bif(a, b); } } - u3_noun u3qdi_bif(u3_noun a, + u3_noun u3qdi__stage_bif(u3_noun a, u3_noun b) { u3_noun c, n_c, l_c, r_c; @@ -72,5 +72,5 @@ } /* - u3_weak u3kdi_bif(u3_noun a, u3_noun b); + u3_weak u3kdi__stage_bif(u3_noun a, u3_noun b); */ diff --git a/jets/stage/d/in_del.c b/jets/stage/d/in_del.c index 02390ccce..859bacaf5 100644 --- a/jets/stage/d/in_del.c +++ b/jets/stage/d/in_del.c @@ -29,7 +29,7 @@ return u3m_bail(c3__exit); } else { - if ( c3y == u3qc_vor(n_l_a, n_r_a) ) { + if ( c3y == u3qc__stage_vor(n_l_a, n_r_a) ) { u3_noun new_right = u3nt(u3k(n_a), u3k(r_l_a), u3k(r_a)); @@ -59,7 +59,7 @@ } u3_noun - u3qdi_del(u3_noun a, + u3qdi__stage_del(u3_noun a, u3_noun b) { if ( u3_nul == a ) { @@ -72,15 +72,15 @@ return u3m_bail(c3__exit); } else if ( c3n == u3r_sing(n_a, b) ) { - if ( c3y == u3qc_hor(b, n_a) ) { + if ( c3y == u3qc__stage_hor(b, n_a) ) { return u3nt(u3k(n_a), - u3qdi_del(l_a, b), + u3qdi__stage_del(l_a, b), u3k(r_a)); } else { return u3nt(u3k(n_a), u3k(l_a), - u3qdi_del(r_a, b)); + u3qdi__stage_del(r_a, b)); } } else { @@ -90,7 +90,7 @@ } u3_noun - u3wdi_del(u3_noun cor) + u3wdi__stage_del(u3_noun cor) { u3_noun a, b; @@ -99,7 +99,7 @@ return u3m_bail(c3__exit); } else { - u3_noun n = u3qdi_del(a, b); + u3_noun n = u3qdi__stage_del(a, b); return n; } } diff --git a/jets/stage/d/in_dif.c b/jets/stage/d/in_dif.c index 389cc1fa5..84026a40f 100644 --- a/jets/stage/d/in_dif.c +++ b/jets/stage/d/in_dif.c @@ -21,7 +21,7 @@ || c3n == u3r_trel(e, &n_e, &l_e, &r_e) ) { return u3m_bail(c3__exit); } else { - if ( c3y == u3qc_vor(n_d, n_e) ) { + if ( c3y == u3qc__stage_vor(n_d, n_e) ) { return u3nt(u3k(n_d), u3k(l_d), _i_dif_join(u3k(r_d), u3k(e))); @@ -36,17 +36,17 @@ /* functions */ - u3_noun u3wdi_dif(u3_noun cor) + u3_noun u3wdi__stage_dif(u3_noun cor) { u3_noun a, b; if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { return u3m_bail(c3__exit); } else { - return u3qdi_dif(a, b); + return u3qdi__stage_dif(a, b); } } - u3_noun u3qdi_dif(u3_noun a, + u3_noun u3qdi__stage_dif(u3_noun a, u3_noun b) { if ( u3_nul == b ) { @@ -59,7 +59,7 @@ return u3m_bail(c3__exit); } else { - c = u3qdi_bif(a, n_b); + c = u3qdi__stage_bif(a, n_b); if ( c3n == u3r_cell(c, &l_c, &r_c) ) { return u3m_bail(c3__exit); @@ -67,8 +67,8 @@ u3_noun d; u3_noun e; - d = u3qdi_dif(l_c, l_b); - e = u3qdi_dif(r_c, r_b); + d = u3qdi__stage_dif(l_c, l_b); + e = u3qdi__stage_dif(r_c, r_b); u3z(c); return _i_dif_join(d, e); @@ -78,5 +78,5 @@ } /* - u3_weak u3kdi_dif(u3_noun a, u3_noun b); + u3_weak u3kdi__stage_dif(u3_noun a, u3_noun b); */ diff --git a/jets/stage/d/in_gas.c b/jets/stage/d/in_gas.c index f3f8d7372..60a1630e1 100644 --- a/jets/stage/d/in_gas.c +++ b/jets/stage/d/in_gas.c @@ -7,7 +7,7 @@ /* functions */ u3_noun - u3qdi_gas(u3_noun a, + u3qdi__stage_gas(u3_noun a, u3_noun b) { if ( u3_nul == b ) { @@ -21,10 +21,10 @@ u3_noun t_b = u3t(b); u3_noun c; - if ( u3_none == (c = u3qdi_put(a, i_b)) ) { + if ( u3_none == (c = u3qdi__stage_put(a, i_b)) ) { return u3m_bail(c3__exit); } else { - u3_noun d = u3qdi_gas(c, t_b); + u3_noun d = u3qdi__stage_gas(c, t_b); u3z(c); return d; @@ -33,21 +33,21 @@ } } u3_noun - u3wdi_gas(u3_noun cor) + u3wdi__stage_gas(u3_noun cor) { u3_noun a, b; if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { return u3m_bail(c3__exit); } else { - return u3qdi_gas(a, b); + return u3qdi__stage_gas(a, b); } } u3_noun - u3kdi_gas(u3_noun a, + u3kdi__stage_gas(u3_noun a, u3_noun b) { - u3_weak c = u3qdi_gas(a, b); + u3_weak c = u3qdi__stage_gas(a, b); u3z(a); u3z(b); if ( u3_none == c ) { diff --git a/jets/stage/d/in_has.c b/jets/stage/d/in_has.c index fb142bc74..d0c59a770 100644 --- a/jets/stage/d/in_has.c +++ b/jets/stage/d/in_has.c @@ -7,7 +7,7 @@ /* functions */ u3_noun - u3qdi_has(u3_noun a, + u3qdi__stage_has(u3_noun a, u3_noun b) { if ( u3_nul == a ) { @@ -24,30 +24,30 @@ return c3y; } else { - if ( c3y == u3qc_hor(b, n_a) ) { - return u3qdi_has(l_a, b); + if ( c3y == u3qc__stage_hor(b, n_a) ) { + return u3qdi__stage_has(l_a, b); } - else return u3qdi_has(r_a, b); + else return u3qdi__stage_has(r_a, b); } } } } u3_noun - u3wdi_has(u3_noun cor) + u3wdi__stage_has(u3_noun cor) { u3_noun a, b; if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { return u3m_bail(c3__exit); } else { - return u3qdi_has(a, b); + return u3qdi__stage_has(a, b); } } u3_noun - u3kdi_has(u3_noun a, + u3kdi__stage_has(u3_noun a, u3_noun b) { - u3_weak c = u3qdi_has(a, b); + u3_weak c = u3qdi__stage_has(a, b); u3z(a); u3z(b); if ( u3_none == c ) { diff --git a/jets/stage/d/in_mer.c b/jets/stage/d/in_mer.c index 14fa6675f..957368721 100644 --- a/jets/stage/d/in_mer.c +++ b/jets/stage/d/in_mer.c @@ -7,7 +7,7 @@ /* functions */ u3_noun - u3qdi_mer(u3_noun a, + u3qdi__stage_mer(u3_noun a, u3_noun b) { if ( u3_nul == a ) { @@ -28,7 +28,7 @@ return u3m_bail(c3__exit); } else { - if ( c3y == u3qc_vor(n_b, n_a) ) { + if ( c3y == u3qc__stage_vor(n_b, n_a) ) { c = a; a = b; b = c; c = n_a; n_a = n_b; n_b = c; c = lr_a; lr_a = lr_b; lr_b = c; @@ -41,12 +41,12 @@ } else if ( c3y == u3r_sing(n_a, n_b) ) { return u3nt(u3k(n_a), - u3qdi_mer(l_a, l_b), - u3qdi_mer(r_a, r_b)); + u3qdi__stage_mer(l_a, l_b), + u3qdi__stage_mer(r_a, r_b)); } - else if ( c3y == u3qc_hor(n_b, n_a) ) { - return u3qdi_mer(u3nt(n_a, - u3qdi_mer(l_a, + else if ( c3y == u3qc__stage_hor(n_b, n_a) ) { + return u3qdi__stage_mer(u3nt(n_a, + u3qdi__stage_mer(l_a, u3nt(n_b, l_b, u3_nul)), @@ -54,9 +54,9 @@ r_b); } else { - return u3qdi_mer(u3nt(n_a, + return u3qdi__stage_mer(u3nt(n_a, l_a, - u3qdi_mer(r_a, + u3qdi__stage_mer(r_a, u3nt(n_b, u3_nul, r_b))), @@ -67,7 +67,7 @@ } u3_noun - u3wdi_mer(u3_noun cor) + u3wdi__stage_mer(u3_noun cor) { u3_noun a, b; @@ -75,6 +75,6 @@ return u3m_bail(c3__exit); } else { - return u3qdi_mer(a, b); + return u3qdi__stage_mer(a, b); } } diff --git a/jets/stage/d/in_put.c b/jets/stage/d/in_put.c index 10d2c4329..973c3cf80 100644 --- a/jets/stage/d/in_put.c +++ b/jets/stage/d/in_put.c @@ -7,7 +7,7 @@ /* functions */ u3_noun - u3qdi_put(u3_noun a, + u3qdi__stage_put(u3_noun a, u3_noun b) { if ( u3_nul == a ) { @@ -27,10 +27,10 @@ return u3m_bail(c3__exit); } else { - if ( c3y == u3qc_hor(b, n_a) ) { - c = u3qdi_put(l_a, b); + if ( c3y == u3qc__stage_hor(b, n_a) ) { + c = u3qdi__stage_put(l_a, b); - if ( c3y == u3qc_vor(n_a, u3h(c)) ) { + if ( c3y == u3qc__stage_vor(n_a, u3h(c)) ) { return u3nt(u3k(n_a), c, u3k(r_a)); @@ -50,9 +50,9 @@ } } else { - c = u3qdi_put(r_a, b); + c = u3qdi__stage_put(r_a, b); - if ( c3y == u3qc_vor(n_a, u3h(c)) ) { + if ( c3y == u3qc__stage_vor(n_a, u3h(c)) ) { return u3nt(u3k(n_a), u3k(l_a), c); @@ -75,25 +75,25 @@ } } u3_noun - u3wdi_put(u3_noun cor) + u3wdi__stage_put(u3_noun cor) { u3_noun a, b; if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { return u3m_bail(c3__exit); } else { - return u3qdi_put(a, b); + return u3qdi__stage_put(a, b); } } u3_weak - u3kdi_put(u3_noun a, + u3kdi__stage_put(u3_noun a, u3_noun b) { // Bizarre asymmetry in old jets. // // (Mysterious comment in old glue code.) // - u3_noun pro = u3qdi_put(a, b); + u3_noun pro = u3qdi__stage_put(a, b); u3z(a); u3z(b); return pro; diff --git a/jets/stage/d/in_uni.c b/jets/stage/d/in_uni.c index 85f07b835..b5c0c5662 100644 --- a/jets/stage/d/in_uni.c +++ b/jets/stage/d/in_uni.c @@ -23,11 +23,11 @@ _in_uni(u3_noun a, u3_noun b) { return u3m_bail(c3__exit); } - else if ( c3n == u3qc_vor(n_a, n_b) ) { + else if ( c3n == u3qc__stage_vor(n_a, n_b) ) { if ( c3y == u3r_sing(n_a, n_b) ) { return u3nt(u3k(n_b), _in_uni(l_a, l_b), _in_uni(r_a, r_b)); } - else if ( c3y == u3qc_hor(n_a, n_b) ) { + else if ( c3y == u3qc__stage_hor(n_a, n_b) ) { naw = u3nt(u3k(n_a), u3k(l_a), u3_nul); sub = _in_uni(naw, l_b); neb = u3nt(u3k(n_b), sub, u3k(r_b)); @@ -47,7 +47,7 @@ _in_uni(u3_noun a, u3_noun b) else if ( c3y == u3r_sing(n_b, n_a) ) { return u3nt(u3k(n_b), _in_uni(l_a, l_b), _in_uni(r_a, r_b)); } - else if ( c3y == u3qc_hor(n_b, n_a) ) { + else if ( c3y == u3qc__stage_hor(n_b, n_a) ) { neb = u3nt(u3k(n_b), u3k(l_b), u3_nul); sub = _in_uni(l_a, neb); naw = u3nt(u3k(n_a), sub, u3k(r_a)); @@ -69,10 +69,10 @@ _in_uni(u3_noun a, u3_noun b) /* functions */ u3_noun - u3kdi_uni(u3_noun a, + u3kdi__stage_uni(u3_noun a, u3_noun b) { - u3_noun c = u3qdi_uni(a, b); + u3_noun c = u3qdi__stage_uni(a, b); u3z(a); u3z(b); @@ -80,7 +80,7 @@ _in_uni(u3_noun a, u3_noun b) } u3_noun - u3qdi_uni(u3_noun a, + u3qdi__stage_uni(u3_noun a, u3_noun b) { if ( c3y == u3r_sing(a, b) ) { @@ -91,14 +91,14 @@ _in_uni(u3_noun a, u3_noun b) } } u3_noun - u3wdi_uni(u3_noun cor) + u3wdi__stage_uni(u3_noun cor) { u3_noun a, b; if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { return u3m_bail(c3__exit); } else { - return u3qdi_uni(a, b); + return u3qdi__stage_uni(a, b); } } diff --git a/jets/stage/f/fork.c b/jets/stage/f/fork.c index 37aaad236..4b562eb3a 100644 --- a/jets/stage/f/fork.c +++ b/jets/stage/f/fork.c @@ -7,7 +7,7 @@ /* functions */ u3_noun - u3qf_forq(u3_noun hoz, + u3qf__stage_forq(u3_noun hoz, u3_noun bur) { if ( c3y == u3r_sing(hoz, bur) ) { @@ -19,11 +19,11 @@ else if ( c3__void == hoz ) { return u3k(bur); } - else return u3kf_fork(u3nt(u3k(hoz), u3k(bur), u3_nul)); + else return u3kf__stage_fork(u3nt(u3k(hoz), u3k(bur), u3_nul)); } u3_noun - u3qf_fork(u3_noun yed) + u3qf__stage_fork(u3_noun yed) { u3_noun lez = u3_nul; @@ -32,10 +32,10 @@ if ( c3__void != i_yed ) { if ( (c3y == u3du(i_yed)) && (c3__fork == u3h(i_yed)) ) { - lez = u3kdi_uni(lez, u3k(u3t(i_yed))); + lez = u3kdi__stage_uni(lez, u3k(u3t(i_yed))); } else { - lez = u3kdi_put(lez, u3k(i_yed)); + lez = u3kdi__stage_put(lez, u3k(i_yed)); } } @@ -57,21 +57,21 @@ } u3_noun - u3wf_fork(u3_noun cor) + u3wf__stage_fork(u3_noun cor) { u3_noun yed; if ( c3n == u3r_mean(cor, u3x_sam, &yed, 0) ) { return u3m_bail(c3__fail); } else { - return u3qf_fork(yed); + return u3qf__stage_fork(yed); } } u3_noun - u3kf_fork(u3_noun yed) + u3kf__stage_fork(u3_noun yed) { - u3_noun ret = u3qf_fork(yed); + u3_noun ret = u3qf__stage_fork(yed); u3z(yed); return ret; diff --git a/jets/stage/f/look.c b/jets/stage/f/look.c index b03df8770..4ced245e1 100644 --- a/jets/stage/f/look.c +++ b/jets/stage/f/look.c @@ -1,4 +1,4 @@ -/* j/6/look.c +/* j/6/lork.c ** */ #include "all.h" @@ -46,7 +46,7 @@ u3k(qn_dab)); } else { - if ( c3y == u3qc_gor(cog, pn_dab) ) { + if ( c3y == u3qc__stage_gor(cog, pn_dab) ) { return u3_nul; } else { @@ -67,7 +67,7 @@ u3k(qn_dab)); } else { - if ( c3y == u3qc_gor(cog, pn_dab) ) { + if ( c3y == u3qc__stage_gor(cog, pn_dab) ) { u3_noun pro; axe = u3qc_peg(axe, 3); @@ -88,7 +88,7 @@ u3k(qn_dab)); } else { - if ( c3y == u3qc_gor(cog, pn_dab) ) { + if ( c3y == u3qc__stage_gor(cog, pn_dab) ) { u3_noun pro; axe = u3qc_peg(axe, 6); @@ -116,19 +116,19 @@ /* functions */ u3_noun - u3qf_look(u3_noun cog, + u3qf__stage_look(u3_noun cog, u3_noun dab) { return _look_in(cog, dab, 1); } u3_noun - u3wf_look(u3_noun cor) + u3wf__stage_look(u3_noun cor) { u3_noun cog, dab; if ( c3n == u3r_mean(cor, u3x_sam_2, &cog, u3x_sam_3, &dab, 0) ) { return u3m_bail(c3__fail); } else { - return u3qf_look(cog, dab); + return u3qf__stage_look(cog, dab); } } diff --git a/jets/stage/f/loot.c b/jets/stage/f/loot.c index 06abf7542..72f9b9442 100644 --- a/jets/stage/f/loot.c +++ b/jets/stage/f/loot.c @@ -1,4 +1,4 @@ -/* j/6/loot.c +/* j/6/lort.c ** */ #include "all.h" @@ -23,7 +23,7 @@ } else { u3_noun qqn_dom = u3t(u3t(n_dom)); - u3_noun yep = u3qf_look(cog, qqn_dom); + u3_noun yep = u3qf__stage_look(cog, qqn_dom); if ( (u3_nul == l_dom) && (u3_nul == r_dom) ) { if ( u3_nul == yep ) { @@ -115,19 +115,19 @@ /* functions */ u3_noun - u3qf_loot(u3_noun cog, + u3qf__stage_loot(u3_noun cog, u3_noun dom) { return _loot_in(cog, dom, 1); } u3_noun - u3wf_loot(u3_noun cor) + u3wf__stage_loot(u3_noun cor) { u3_noun cog, dom; if ( c3n == u3r_mean(cor, u3x_sam_2, &cog, u3x_sam_3, &dom, 0) ) { return u3m_bail(c3__fail); } else { - return u3qf_loot(cog, dom); + return u3qf__stage_loot(cog, dom); } } diff --git a/jets/stage/f/ut.c b/jets/stage/f/ut.c index 9fcf3ec1a..e8a68f998 100644 --- a/jets/stage/f/ut.c +++ b/jets/stage/f/ut.c @@ -10,11 +10,11 @@ // duck: create a duck core for mean. // u3_noun - u3qfu_duck(u3_noun van, + u3qfu__stage_duck(u3_noun van, u3_noun typ) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(typ), 0); - u3_noun ret = u3j_cook("u3qfu_duck-dune", u3k(von), "dune"); + u3_noun ret = u3j_cook("u3qfu__stage_duck-dune", u3k(von), "dune"); u3z(von); return ret; @@ -23,12 +23,12 @@ // dung: create a dunk core for mean (noun caption) // u3_noun - u3qfu_dung(u3_noun van, + u3qfu__stage_dung(u3_noun van, u3_noun paz, u3_noun typ) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(typ), 0); - u3_noun duq = u3j_cook("u3qfu_dung-dunk", u3k(von), "dunk"); + u3_noun duq = u3j_cook("u3qfu__stage_dung-dunk", u3k(von), "dunk"); u3_noun ret = u3i_molt(u3k(duq), u3x_sam, u3k(paz), 0); u3z(duq); @@ -39,12 +39,12 @@ // dunq: create a dunk core for mean // u3_noun - u3qfu_dunq(u3_noun van, + u3qfu__stage_dunq(u3_noun van, const c3_c* paz_c, u3_noun typ) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(typ), 0); - u3_noun duq = u3j_cook("u3qfu_dunq-dunk", u3k(von), "dunk"); + u3_noun duq = u3j_cook("u3qfu__stage_dunq-dunk", u3k(von), "dunk"); u3_noun paz = u3i_string(paz_c); u3_noun ret = u3i_molt(u3k(duq), u3x_sam, u3k(paz), 0); @@ -57,7 +57,7 @@ // dump: dump a type. // void - u3qfu_dump(u3_noun van, + u3qfu__stage_dump(u3_noun van, const c3_c* paz_c, u3_noun typ) { @@ -65,19 +65,19 @@ c3_c ugh_c[1024]; sprintf(ugh_c, "%s: %s: 0x%8x:", - paz_c, pfix_c, u3r_mug(typ)); + paz_c, pfix_c, u3r__stage_mug(typ)); #if 0 - u3_pier_tank(0, u3n_kick_on(u3qfu_dunq(van, ugh_c, typ))); + u3_pier_tank(0, u3n_kick_on(u3qfu__stage_dunq(van, ugh_c, typ))); #endif } // shew: create a show core for mean // u3_noun - u3qfu_shew(u3_noun van, + u3qfu__stage_shew(u3_noun van, u3_noun mol) { - u3_noun sho = u3j_cook("u3qfu_shew-show", u3k(van), "show"); + u3_noun sho = u3j_cook("u3qfu__stage_shew-show", u3k(van), "show"); u3_noun ret = u3i_molt(u3k(sho), u3x_sam, u3k(mol), 0); u3z(sho); @@ -88,12 +88,12 @@ // shep: show with caption and style // u3_noun - u3qfu_shep(u3_noun van, + u3qfu__stage_shep(u3_noun van, const c3_c* paz_c, u3_noun sty, u3_noun mol) { - return u3qfu_shew(van, + return u3qfu__stage_shew(van, u3nc(u3nc('c', u3i_string(paz_c)), u3nc(u3k(sty), mol))); } diff --git a/jets/stage/f/ut_buss.c b/jets/stage/f/ut_buss.c index 144046d8a..bce8db03c 100644 --- a/jets/stage/f/ut_buss.c +++ b/jets/stage/f/ut_buss.c @@ -13,7 +13,7 @@ u3_noun gen) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_cqfu_buss-buss", von, "buss"); + u3_noun gat = u3j_cook("_stage_cqfu_buss-buss", von, "buss"); return u3n_kick_on(u3i_molt(gat, u3x_sam_2, @@ -29,7 +29,7 @@ u3_noun gen) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_cqfu_busk-busk", von, "busk"); + u3_noun gat = u3j_cook("_stage_cqfu_busk-busk", von, "busk"); return u3n_kick_on(u3i_molt(gat, u3x_sam, @@ -40,7 +40,7 @@ /* boilerplate */ u3_noun - u3wfu_buss(u3_noun cor) + u3wfu__stage_buss(u3_noun cor) { u3_noun sut, cog, gen, van; @@ -58,7 +58,7 @@ } u3_noun - u3qfu_buss(u3_noun van, + u3qfu__stage_buss(u3_noun van, u3_noun sut, u3_noun cog, u3_noun gen) @@ -68,7 +68,7 @@ u3_noun - u3wfu_busk(u3_noun cor) + u3wfu__stage_busk(u3_noun cor) { u3_noun sut, gen, van; @@ -84,7 +84,7 @@ } u3_noun - u3qfu_busk(u3_noun van, + u3qfu__stage_busk(u3_noun van, u3_noun sut, u3_noun gen) { diff --git a/jets/stage/f/ut_conk.c b/jets/stage/f/ut_conk.c index d851143a1..569cf1ed4 100644 --- a/jets/stage/f/ut_conk.c +++ b/jets/stage/f/ut_conk.c @@ -32,19 +32,19 @@ return ret; } case 2: { - u3_noun vet = u3r_at(u3qfu_van_vet, van); + u3_noun vet = u3r_at(u3qfu__stage_van_vet, van); u3_noun hed, tal, deh, lat, ret; if ( c3y == vet ) { u3_noun cel = u3nt(c3__cell, c3__noun, c3__noun); - if ( c3n == u3qfu_nest(van, cel, c3y, sut) ) { + if ( c3n == u3qfu__stage_nest(van, cel, c3y, sut) ) { return u3m_bail(c3__fail); } u3z(cel); } - hed = u3qfu_peek(van, sut, c3__both, 2); - tal = u3qfu_peek(van, sut, c3__both, 3); + hed = u3qfu__stage_peek(van, sut, c3__both, 2); + tal = u3qfu__stage_peek(van, sut, c3__both, 3); deh = _cqfu_conk(van, hed, u3h(u3t(got))); lat = _cqfu_conk(van, tal, u3t(u3t(got))); @@ -63,7 +63,7 @@ /* boilerplate */ u3_noun - u3wfu_conk(u3_noun cor) + u3wfu__stage_conk(u3_noun cor) { u3_noun sut, got, van; @@ -79,7 +79,7 @@ } u3_noun - u3qfu_conk(u3_noun van, + u3qfu__stage_conk(u3_noun van, u3_noun sut, u3_noun got) { diff --git a/jets/stage/f/ut_crop.c b/jets/stage/f/ut_crop.c index c558737cc..7e6a31aff 100644 --- a/jets/stage/f/ut_crop.c +++ b/jets/stage/f/ut_crop.c @@ -16,7 +16,7 @@ u3_noun ref, u3_noun bix) { - u3_noun rep = u3qfu_repo(van, sut); + u3_noun rep = u3qfu__stage_repo(van, sut); u3_noun ret = _crop_dext(van, rep, ref, bix); if ( c3y == u3r_sing(ret, rep) ) { @@ -122,7 +122,7 @@ else if ( c3__cell == u3h(ref) ) { u3x_cell(u3t(ref), &p_ref, &q_ref); - if ( c3y == u3qfu_nest(van, p_ref, c3n, p_sut) ) + if ( c3y == u3qfu__stage_nest(van, p_ref, c3n, p_sut) ) { u3_noun foz = _crop_dext(van, q_sut, q_ref, bix); u3_noun ret = u3qf_cell(p_sut, foz); @@ -160,8 +160,8 @@ } case c3__fork: p_sut = u3t(sut); { - u3_noun yed = u3qdi_tap(p_sut); - u3_noun ret = u3kf_fork(_crop_dext_fork(van, yed, ref, bix)); + u3_noun yed = u3qdi__stage_tap(p_sut); + u3_noun ret = u3kf__stage_fork(_crop_dext_fork(van, yed, ref, bix)); u3z(yed); return ret; @@ -170,10 +170,10 @@ { u3_noun hud = u3nc(u3k(sut), u3k(ref)); - if ( c3y == u3qdi_has(bix, hud) ) { + if ( c3y == u3qdi__stage_has(bix, hud) ) { # if 0 - u3_noun dun = u3qfu_dunq(van, "type", sut); - u3_noun niz = u3qfu_dunq(van, "over", ref); + u3_noun dun = u3qfu__stage_dunq(van, "type", sut); + u3_noun niz = u3qfu__stage_dunq(van, "over", ref); u3t_push(u3nc(c3__mean, dun)); u3t_push(u3nc(c3__mean, niz)); @@ -181,7 +181,7 @@ return u3m_error("crop-loop"); } else { - u3_noun bux = u3qdi_put(bix, hud); + u3_noun bux = u3qdi__stage_put(bix, hud); u3_noun ret = _crop_repo(van, sut, ref, bux); u3z(hud); @@ -211,7 +211,7 @@ } case c3__fork: p_ref = u3t(ref); { - u3_noun yed = u3qdi_tap(p_ref); + u3_noun yed = u3qdi__stage_tap(p_ref); u3_noun ret = _crop_sint_fork(van, sut, yed, bix); u3z(yed); @@ -219,7 +219,7 @@ } case c3__hold: { - u3_noun rep = u3qfu_repo(van, ref); + u3_noun rep = u3qfu__stage_repo(van, ref); u3_noun ret = _crop_dext(van, sut, rep, bix); u3z(rep); @@ -239,7 +239,7 @@ /* boilerplate */ u3_noun - u3wfu_crop(u3_noun cor) + u3wfu__stage_crop(u3_noun cor) { u3_noun sut, ref, van; @@ -253,11 +253,11 @@ } u3_noun - u3qfu_crop(u3_noun van, + u3qfu__stage_crop(u3_noun van, u3_noun sut, u3_noun ref) { - c3_m fun_m = 141 + c3__crop + ((!!u3r_at(u3qfu_van_vet, van)) << 8); + c3_m fun_m = 200 + c3__crop + ((!!u3r_at(u3qfu__stage_van_vet, van)) << 8); u3_noun pro = u3z_find_2(fun_m, sut, ref); if ( u3_none != pro ) { diff --git a/jets/stage/f/ut_find.c b/jets/stage/f/ut_find.c index bde859ee9..7f85ad9f5 100644 --- a/jets/stage/f/ut_find.c +++ b/jets/stage/f/ut_find.c @@ -13,14 +13,14 @@ u3_noun lon, u3_noun gil); -/* `u3qfu_felt_arm` is a helper function for - * u3qfu_felt. It handles the case in which the +/* `u3qfu__stage_felt_arm` is a helper function for + * u3qfu__stage_felt. It handles the case in which the * opal is for an arm, by creating a list of * parent core types. These will be converted to * a single `fork` type. */ static u3_noun - u3qfu_felt_arm(u3_noun lis) + u3qfu__stage_felt_arm(u3_noun lis) { if ( u3_nul == lis ) { return u3_nul; @@ -40,19 +40,19 @@ u3x_trel(q_typ, &pq_typ, &qq_typ, &rq_typ); u3_noun dox = u3nt(c3__core, u3k(qq_typ), u3k(q_typ)); - return u3nc(dox, u3qfu_felt_arm(t_lis)); + return u3nc(dox, u3qfu__stage_felt_arm(t_lis)); } } } -/* `u3qfu_felt` takes an opal, lap, and converts +/* `u3qfu__stage_felt` takes an opal, lap, and converts * it to a type. The opal comes from the last * limb of the wing processed by `+fond`. The * type is used in +fond as the subject type of * the next limb in the wing. */ static u3_noun - u3qfu_felt(u3_noun lap) + u3qfu__stage_felt(u3_noun lap) { u3_noun lim, mil; u3x_cell(lap, &lim, &mil); @@ -63,11 +63,11 @@ else if ( c3n == lim ) { u3_noun p_lap, q_lap, lis, hos; u3x_cell(mil, &p_lap, &q_lap); - lis = u3qdi_tap(q_lap); - hos = u3qfu_felt_arm(lis); + lis = u3qdi__stage_tap(q_lap); + hos = u3qfu__stage_felt_arm(lis); u3z(lis); - return u3kf_fork(hos); + return u3kf__stage_fork(hos); } else { u3m_bail(c3__exit); @@ -75,13 +75,13 @@ } static u3_noun - u3qfu_fund(u3_noun van, + u3qfu__stage_fund(u3_noun van, u3_noun sut, u3_noun way, u3_noun gen) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("u3qfu_fund-fund", von, "fund"); + u3_noun gat = u3j_cook("u3qfu__stage_fund-fund", von, "fund"); return u3n_kick_on(u3i_molt(gat, u3x_sam_2, @@ -92,12 +92,12 @@ } static u3_noun - u3qfu_fine(u3_noun van, + u3qfu__stage_fine(u3_noun van, u3_noun sut, u3_noun tor) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("u3qfu_fine-fine", von, "fine"); + u3_noun gat = u3j_cook("u3qfu__stage_fine-fine", von, "fine"); return u3n_kick_on(u3i_molt(gat, u3x_sam, @@ -220,7 +220,7 @@ return _find_buck_here(van, sut, way, p_heg, q_heg, axe, lon, gil); } else { - u3_noun zem = u3qf_loot(u3t(q_heg), qrq_sut); + u3_noun zem = u3qf__stage_loot(u3t(q_heg), qrq_sut); if ( (u3_nul != zem) && (0 != p_heg) ) { u3_noun ped; @@ -260,7 +260,7 @@ return pro; } else { - u3_noun pec = u3qfu_peel(van, sut, way, rpq_sut); + u3_noun pec = u3qfu__stage_peel(van, sut, way, rpq_sut); u3_noun pro; if ( c3n == u3h(pec) ) { @@ -273,7 +273,7 @@ u3z(exa); } else { - u3_noun sam = u3qfu_peek(van, p_sut, way, 2); + u3_noun sam = u3qfu__stage_peek(van, p_sut, way, 2); u3_noun exa = u3qc_peg(axe, 6); pro = _find_buck(van, sam, way, p_heg, q_heg, exa, lon, gil); @@ -326,7 +326,7 @@ return u3nt(c3n, c3n, u3nc( - u3kf_fork(u3nt(u3k(ppp_hax), u3k(ppp_yor), u3_nul)), + u3kf__stage_fork(u3nt(u3k(ppp_hax), u3k(ppp_yor), u3_nul)), u3k(qpp_hax))); } } @@ -357,7 +357,7 @@ return u3nt(c3y, u3k(pp_hax), - u3nc(c3y, u3kf_fork + u3nc(c3y, u3kf__stage_fork (u3nt(u3k(pqp_hax), u3k(pqp_yor), u3_nul)))); } } @@ -375,7 +375,7 @@ return u3nt(c3y, u3k(pp_hax), - u3nt(c3n, u3k(pqp_hax), u3qdi_uni(qqp_hax, qqp_yor))); + u3nt(c3n, u3k(pqp_hax), u3qdi__stage_uni(qqp_hax, qqp_yor))); } } } @@ -439,7 +439,7 @@ u3_noun gil) { u3_noun p_sut = u3t(sut); - u3_noun yed = u3qdi_tap(p_sut); + u3_noun yed = u3qdi__stage_tap(p_sut); u3_noun wiz; u3_noun ret; @@ -472,7 +472,7 @@ } else { u3_noun iqp_sut = u3h(qp_sut); // twig - u3_noun tiv = u3qfu_mint // (pair type nock) + u3_noun tiv = u3qfu__stage_mint // (pair type nock) (van, q_sut, c3__noun, iqp_sut); u3_noun tqp_sut = u3t(qp_sut); // (list twig) u3_noun p_tiv = u3h(tiv); // type @@ -507,7 +507,7 @@ } u3z(fid); - vat = u3qfu_fine(van, sut, tor); + vat = u3qfu__stage_fine(van, sut, tor); u3z(tor); ret = u3nt @@ -556,7 +556,7 @@ else { u3_noun pp_sut = u3h(p_sut); // (map term {wain (unit twig)}) u3_noun qp_sut = u3t(p_sut); // (list (pair type nock)) - u3_noun tyr = u3qdb_get(pp_sut, uq_heg); // (unit (unit twig)) + u3_noun tyr = u3qdb__stage_get(pp_sut, uq_heg); // (unit (unit twig)) if ( u3_nul == tyr ) { return _find_buck_face_next @@ -578,7 +578,7 @@ } else { u3_noun uu_tyr = u3t(u_tyr); - u3_noun tor = u3qfu_fund(van, sut, way, uu_tyr); + u3_noun tor = u3qfu__stage_fund(van, sut, way, uu_tyr); if ( c3y == u3h(tor) ) { u3_noun p_tor = u3t(tor); // (pair vein opal) @@ -659,7 +659,7 @@ } case c3__hint: { - u3_noun fop = u3qfu_repo(van, sut); + u3_noun fop = u3qfu__stage_repo(van, sut); u3_noun pro = _find_buck(van, fop, way, p_heg, q_heg, axe, lon, gil); u3z(fop); return pro; @@ -677,12 +677,12 @@ case c3__hold: { // fprintf(stderr, "hold\r\n"); - if ( (c3y == u3qdi_has(gil, sut)) ) { + if ( (c3y == u3qdi__stage_has(gil, sut)) ) { return u3_nul; } else { - u3_noun zoc = u3qdi_put(gil, sut); - u3_noun fop = u3qfu_repo(van, sut); + u3_noun zoc = u3qdi__stage_put(gil, sut); + u3_noun fop = u3qfu__stage_repo(van, sut); u3_noun pro = _find_buck(van, fop, way, p_heg, q_heg, axe, lon, zoc); u3z(fop); @@ -705,7 +705,7 @@ u3_noun qp_mor = u3t(p_mor); // opal { - u3_noun ref = u3qfu_felt(qp_mor); + u3_noun ref = u3qfu__stage_felt(qp_mor); u3_noun lon = u3k(pp_mor); u3_noun heg = (c3y == u3du(i_hyp)) ? u3k(i_hyp) @@ -723,7 +723,7 @@ ret = u3nt (c3y, u3nc(u3nc(u3_nul, u3k(p_heg)), u3k(lon)), - u3nc(c3y, u3qfu_peek(van, ref, way, p_heg))); + u3nc(c3y, u3qfu__stage_peek(van, ref, way, p_heg))); } else { u3_noun p_heg = u3h(u3t(heg)); // @ud @@ -765,7 +765,7 @@ u3_noun ppp_mor = u3h(pp_mor); // span u3_noun qpp_mor = u3t(pp_mor); // nock u3_noun gen = u3nt(c3__wing, u3k(i_hyp), u3_nul); - u3_noun fex = u3qfu_mint(van, ppp_mor, c3__noun, gen); + u3_noun fex = u3qfu__stage_mint(van, ppp_mor, c3__noun, gen); u3_noun ret = u3nt(c3n, c3n, u3nc(u3k(u3h(fex)), @@ -840,7 +840,7 @@ /* boilerplate */ u3_noun - u3wfu_find(u3_noun cor) + u3wfu__stage_find(u3_noun cor) { u3_noun sut, way, hyp, van; @@ -857,12 +857,12 @@ } u3_noun - u3qfu_find(u3_noun van, + u3qfu__stage_find(u3_noun van, u3_noun sut, u3_noun way, u3_noun hyp) { - c3_m fun_m = 141 + c3__find + ((!!u3r_at(u3qfu_van_vet, van)) << 8); + c3_m fun_m = 200 + c3__find + ((!!u3r_at(u3qfu__stage_van_vet, van)) << 8); u3_noun pro = u3z_find_3(fun_m, sut, way, hyp); if ( u3_none != pro ) { @@ -878,7 +878,7 @@ /* boilerplate */ u3_noun - u3wfu_fond(u3_noun cor) + u3wfu__stage_fond(u3_noun cor) { u3_noun sut, way, hyp, van; @@ -895,12 +895,12 @@ } u3_noun - u3qfu_fond(u3_noun van, + u3qfu__stage_fond(u3_noun van, u3_noun sut, u3_noun way, u3_noun hyp) { - c3_m fun_m = 141 + c3__fond + ((!!u3r_at(u3qfu_van_vet, van)) << 8); + c3_m fun_m = 200 + c3__fond + ((!!u3r_at(u3qfu__stage_van_vet, van)) << 8); u3_noun pro = u3z_find_3(fun_m, sut, way, hyp); if ( u3_none != pro ) { diff --git a/jets/stage/f/ut_fire.c b/jets/stage/f/ut_fire.c index 873d4524b..552d87f27 100644 --- a/jets/stage/f/ut_fire.c +++ b/jets/stage/f/ut_fire.c @@ -10,7 +10,7 @@ _fire_vet(u3_noun van) { // u3_noun vet = u3j_hook(u3k(van), "vet"); - u3_noun vet = u3r_at(u3qfu_van_vet, van); + u3_noun vet = u3r_at(u3qfu__stage_van_vet, van); switch ( vet ) { case c3n: @@ -25,7 +25,7 @@ u3_noun dox, u3_noun gen) { - u3_noun rib = u3r_at(u3qfu_van_rib, van); + u3_noun rib = u3r_at(u3qfu__stage_van_rib, van); u3_noun key = u3nt(u3k(sut), u3k(dox), u3k(gen)); @@ -34,16 +34,16 @@ if ( c3n == _fire_vet(van) ) { ret = c3y; } - if ( c3y == u3qdi_has(rib, key) ) { + if ( c3y == u3qdi__stage_has(rib, key) ) { ret = c3y; } else { - u3_noun rob = u3qdi_put(rib, key); + u3_noun rob = u3qdi__stage_put(rib, key); u3_noun von = u3i_molt(u3k(van), - u3qfu_van_rib, + u3qfu__stage_van_rib, u3k(rob), 0); - u3_noun mul = u3qfu_mull(von, sut, c3__noun, dox, gen); + u3_noun mul = u3qfu__stage_mull(von, sut, c3__noun, dox, gen); ret = c3y; @@ -83,11 +83,11 @@ if ( (c3__ash == u3h(gat)) || (c3__dry == u3h(gat)) ) { if ( (c3y == vet) && - (c3n == u3qfu_nest(van, qq_typ, c3y, p_typ)) ) + (c3n == u3qfu__stage_nest(van, qq_typ, c3y, p_typ)) ) { #if 0 - u3_noun dun = u3qfu_dunq(van, "need", qq_typ); - u3_noun niz = u3qfu_dunq(van, "have", p_typ); + u3_noun dun = u3qfu__stage_dunq(van, "need", qq_typ); + u3_noun niz = u3qfu__stage_dunq(van, "have", p_typ); u3t_push(u3nc(c3__mean, niz)); u3t_push(u3nc(c3__mean, dun)); @@ -101,8 +101,8 @@ else { c3_assert(c3__wet == u3h(gat)); #if 0 - u3_noun dun = u3qfu_dunq(van, "wild", typ); - u3_noun niz = u3qfu_dunq(van, "tame", dox); + u3_noun dun = u3qfu__stage_dunq(van, "wild", typ); + u3_noun niz = u3qfu__stage_dunq(van, "tame", dox); u3t_push(u3nc(c3__mean, dun)); u3t_push(u3nc(c3__mean, niz)); @@ -151,7 +151,7 @@ u3_noun sut, u3_noun hag) { - u3_noun vet = u3r_at(u3qfu_van_vet, van); + u3_noun vet = u3r_at(u3qfu__stage_van_vet, van); c3_assert(!"not live"); { @@ -178,7 +178,7 @@ /* boilerplate */ u3_noun - u3wfu_fire(u3_noun cor) + u3wfu__stage_fire(u3_noun cor) { u3_noun sut, hag, van; @@ -192,7 +192,7 @@ } u3_noun - u3qfu_fire(u3_noun van, + u3qfu__stage_fire(u3_noun van, u3_noun sut, u3_noun hag) { diff --git a/jets/stage/f/ut_fish.c b/jets/stage/f/ut_fish.c index 6454e20b5..bc218533b 100644 --- a/jets/stage/f/ut_fish.c +++ b/jets/stage/f/ut_fish.c @@ -102,7 +102,7 @@ } case c3__fork: p_sut = u3t(sut); { - u3_noun yed = u3qdi_tap(p_sut); + u3_noun yed = u3qdi__stage_tap(p_sut); u3_noun ret = _fish_fork(van, yed, axe, vit); u3z(yed); @@ -111,9 +111,9 @@ case c3__hold: { p_sut = u3t(sut); { - if ( (c3y == u3qdi_has(vit, sut)) ) { - // u3_noun dun = u3qfu_dunq(van, "type", sut); - u3_noun niz = u3qfu_shep + if ( (c3y == u3qdi__stage_has(vit, sut)) ) { + // u3_noun dun = u3qfu__stage_dunq(van, "type", sut); + u3_noun niz = u3qfu__stage_shep (van, "axis", 'd', u3k(axe)); // u3t_push(u3nc(c3__mean, dun)); @@ -121,8 +121,8 @@ return u3m_error("fish-loop"); } else { - u3_noun zoc = u3qdi_put(vit, sut); - u3_noun fop = u3qfu_repo(van, sut); + u3_noun zoc = u3qdi__stage_put(vit, sut); + u3_noun fop = u3qfu__stage_repo(van, sut); u3_noun pro = _fish_in(van, fop, axe, zoc); u3z(fop); @@ -147,7 +147,7 @@ /* boilerplate */ u3_noun - u3wfu_fish(u3_noun cor) + u3wfu__stage_fish(u3_noun cor) { u3_noun sut, axe, van; @@ -162,11 +162,11 @@ } u3_noun - u3qfu_fish(u3_noun van, + u3qfu__stage_fish(u3_noun van, u3_noun sut, u3_noun axe) { - c3_m fun_m = 141 + c3__fish + ((!!u3r_at(u3qfu_van_vet, van)) << 8); + c3_m fun_m = 200 + c3__fish + ((!!u3r_at(u3qfu__stage_van_vet, van)) << 8); u3_noun pro = u3z_find_2(fun_m, sut, axe); if ( u3_none != pro ) { diff --git a/jets/stage/f/ut_fuse.c b/jets/stage/f/ut_fuse.c index 069d0ba14..c65d8e531 100644 --- a/jets/stage/f/ut_fuse.c +++ b/jets/stage/f/ut_fuse.c @@ -14,7 +14,7 @@ u3_noun ref, u3_noun bix) { - u3_noun rep = u3qfu_repo(van, sut); + u3_noun rep = u3qfu__stage_repo(van, sut); u3_noun ret = _fuse_in(van, rep, ref, bix); if ( c3y == u3r_sing(ret, rep) ) { @@ -142,8 +142,8 @@ } case c3__fork: p_sut = u3t(sut); { - u3_noun yed = u3qdi_tap(p_sut); - u3_noun ret = u3kf_fork(_fuse_in_fork(van, yed, ref, bix)); + u3_noun yed = u3qdi__stage_tap(p_sut); + u3_noun ret = u3kf__stage_fork(_fuse_in_fork(van, yed, ref, bix)); u3z(yed); return ret; @@ -152,16 +152,16 @@ { u3_noun hud = u3nc(u3k(sut), u3k(ref)); - if ( c3y == u3qdi_has(bix, hud) ) { - // u3_noun dun = u3qfu_dunq(van, "type", sut); - // u3_noun niz = u3qfu_dunq(van, "over", ref); + if ( c3y == u3qdi__stage_has(bix, hud) ) { + // u3_noun dun = u3qfu__stage_dunq(van, "type", sut); + // u3_noun niz = u3qfu__stage_dunq(van, "over", ref); // u3t_push(u3nc(c3__mean, dun)); // u3t_push(u3nc(c3__mean, niz)); return u3m_error("fuse-loop"); } else { - u3_noun bux = u3qdi_put(bix, hud); + u3_noun bux = u3qdi__stage_put(bix, hud); u3_noun ret = _fuse_repo(van, sut, ref, bux); u3z(hud); @@ -183,7 +183,7 @@ /* boilerplate */ u3_noun - u3wfu_fuse(u3_noun cor) + u3wfu__stage_fuse(u3_noun cor) { u3_noun sut, ref, van; @@ -197,11 +197,11 @@ } u3_noun - u3qfu_fuse(u3_noun van, + u3qfu__stage_fuse(u3_noun van, u3_noun sut, u3_noun ref) { - c3_m fun_m = 141 + c3__fuse + ((!!u3r_at(u3qfu_van_vet, van)) << 8); + c3_m fun_m = 200 + c3__fuse + ((!!u3r_at(u3qfu__stage_van_vet, van)) << 8); u3_noun pro = u3z_find_2(fun_m, sut, ref); if ( u3_none != pro ) { diff --git a/jets/stage/f/ut_gain.c b/jets/stage/f/ut_gain.c index 509740ab1..ee8f90d9a 100644 --- a/jets/stage/f/ut_gain.c +++ b/jets/stage/f/ut_gain.c @@ -5,12 +5,12 @@ u3_noun - u3qfu_gain(u3_noun van, + u3qfu__stage_gain(u3_noun van, u3_noun sut, u3_noun gen) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("u3qfu_gain-gain", von, "gain"); + u3_noun gat = u3j_cook("u3qfu__stage_gain-gain", von, "gain"); return u3n_kick_on(u3i_molt(gat, u3x_sam, u3k(gen), 0)); } diff --git a/jets/stage/f/ut_lose.c b/jets/stage/f/ut_lose.c index 16e9f6c0f..fd34d74b2 100644 --- a/jets/stage/f/ut_lose.c +++ b/jets/stage/f/ut_lose.c @@ -5,12 +5,12 @@ u3_noun - u3qfu_lose(u3_noun van, + u3qfu__stage_lose(u3_noun van, u3_noun sut, u3_noun gen) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("u3qfu_lose-lose", von, "lose"); + u3_noun gat = u3j_cook("u3qfu__stage_lose-lose", von, "lose"); return u3n_kick_on(u3i_molt(gat, u3x_sam, u3k(gen), 0)); } diff --git a/jets/stage/f/ut_mint.c b/jets/stage/f/ut_mint.c index 54ff5c466..9b34dbaf1 100644 --- a/jets/stage/f/ut_mint.c +++ b/jets/stage/f/ut_mint.c @@ -11,7 +11,7 @@ static u3_noun _mint_bean() { - return u3kf_fork(u3nt(u3nq(c3__atom, 'f', u3_nul, 0), + return u3kf__stage_fork(u3nt(u3nq(c3__atom, 'f', u3_nul, 0), u3nq(c3__atom, 'f', u3_nul, 1), u3_nul)); } @@ -39,7 +39,7 @@ _mint_vet(u3_noun van) { // u3_noun vet = u3j_hook(u3k(van), "vet"); - u3_noun vet = u3r_at(u3qfu_van_vet, van); + u3_noun vet = u3r_at(u3qfu__stage_van_vet, van); switch ( vet ) { case c3n: @@ -134,10 +134,10 @@ u3_noun typ) { if ( (c3y == _mint_vet(van)) && - (c3n == u3qfu_nest(van, gol, c3y, typ)) ) + (c3n == u3qfu__stage_nest(van, gol, c3y, typ)) ) { - // u3_noun dun = u3qfu_dunq(van, "need", gol); - // u3_noun niz = u3qfu_dunq(van, "have", typ); + // u3_noun dun = u3qfu__stage_dunq(van, "need", gol); + // u3_noun niz = u3qfu__stage_dunq(van, "have", typ); // u3t_push(u3nc(c3__mean, dun)); // u3t_push(u3nc(c3__mean, niz)); @@ -188,7 +188,7 @@ u3_noun loc) { u3_noun mol = u3nc('o', u3k(loc)); - u3_noun sho = u3j_cook("_mint_loc-show", u3k(van), "show"); + u3_noun sho = u3j_cook("_stage_mint_loc-show", u3k(van), "show"); u3_noun ret = u3i_molt(u3k(sho), u3x_sam, u3k(mol), 0); u3z(mol); @@ -206,7 +206,7 @@ u3_noun rig) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_mint_cnts-emin", von, "emin"); + u3_noun gat = u3j_cook("_stage_mint_cnts-emin", von, "emin"); return u3n_kick_on(u3i_molt(gat, u3x_sam_2, @@ -228,7 +228,7 @@ { while ( 1 ) { if ( c3n == u3du(mew) ) { - u3_noun gim = u3qfu_fire(van, sut, rag); + u3_noun gim = u3qfu__stage_fire(van, sut, rag); u3_noun fol = u3qf_hike(p_lar, hej); u3z(rag); @@ -240,10 +240,10 @@ u3_noun t_mew = u3t(mew); u3_noun pi_mew = u3h(i_mew); u3_noun qi_mew = u3t(i_mew); - u3_noun zil = u3qfu_mint(van, sut, c3__noun, qi_mew); + u3_noun zil = u3qfu__stage_mint(van, sut, c3__noun, qi_mew); u3_noun p_zil = u3h(zil); u3_noun q_zil = u3t(zil); - u3_noun wip = u3qfu_toss(van, sut, pi_mew, p_zil, rag); + u3_noun wip = u3qfu__stage_toss(van, sut, pi_mew, p_zil, rag); u3z(rag); rag = u3k(u3t(wip)); @@ -266,7 +266,7 @@ u3_noun hyp, u3_noun rig) { - u3_noun lar = u3qfu_seek(van, sut, c3__read, hyp); + u3_noun lar = u3qfu__stage_seek(van, sut, c3__read, hyp); u3_noun p_lar = u3h(lar); u3_noun q_lar = u3t(lar); u3_noun pq_lar = u3h(q_lar); @@ -317,7 +317,7 @@ if ( c3n == u3du(gen) ) { u3_noun ter = u3r_at(u3x_con_3, van); - u3_noun fab = u3r_at(u3qfu_van_fab, van); + u3_noun fab = u3r_at(u3qfu__stage_van_fab, van); u3_noun rex = u3qfp_open(ter, fab, gen); ret = _mint_in(van, sut, gol, rex); @@ -344,12 +344,12 @@ } else switch ( u3h(gen) ) { default: { u3_noun ter = u3r_at(u3x_con_3, van); - u3_noun fab = u3r_at(u3qfu_van_fab, van); + u3_noun fab = u3r_at(u3qfu__stage_van_fab, van); u3_noun rex = u3qfp_open(ter, fab, gen); if ( c3y == u3r_sing(rex, gen) ) { #if 1 - u3_noun zix = u3qfu_shep(van, "gene", 'q', u3k(gen)); + u3_noun zix = u3qfu__stage_shep(van, "gene", 'q', u3k(gen)); u3t_push(u3nc(c3__mean, zix)); return u3m_error("mint-open"); @@ -367,13 +367,13 @@ case c3__fits: u3x_cell(u3t(gen), &p_gen, &q_gen); _mint_used(); { - u3_noun wam = u3qfu_play(van, sut, p_gen); + u3_noun wam = u3qfu__stage_play(van, sut, p_gen); u3_noun dok = u3nc(c3__wing, u3k(q_gen)); u3_noun vol = _mint_corn(van, sut, dok); u3_noun axe = _mint_cove(vol); ret = u3nc(_mint_nice(van, gol, _mint_bean()), - u3qfu_fish(van, wam, axe)); + u3qfu__stage_fish(van, wam, axe)); u3z(axe); u3z(vol); @@ -388,8 +388,8 @@ { u3_noun bol = _mint_bean(); u3_noun nor = _mint_in(van, sut, bol, p_gen); - u3_noun fex = u3qfu_gain(van, sut, p_gen); - u3_noun wux = u3qfu_lose(van, sut, p_gen); + u3_noun fex = u3qfu__stage_gain(van, sut, p_gen); + u3_noun wux = u3qfu__stage_lose(van, sut, p_gen); u3_noun duy = (c3__void == fex) ? ( (c3__void == wux) ? u3nc(0, 0) @@ -400,7 +400,7 @@ u3_noun hiq = _mint_in(van, fex, gol, q_gen); u3_noun ran = _mint_in(van, wux, gol, r_gen); - ret = u3nc(u3qf_forq(u3h(hiq), + ret = u3nc(u3qf__stage_forq(u3h(hiq), u3h(ran)), _mint_cond(duy, u3k(u3t(hiq)), @@ -442,8 +442,8 @@ u3_noun ret; if ( (c3y == _mint_vet(van)) && - (c3n == u3qfu_nest(van, u3h(one), c3n, u3h(two))) && - (c3n == u3qfu_nest(van, u3h(two), c3y, u3h(one))) ) + (c3n == u3qfu__stage_nest(van, u3h(one), c3n, u3h(two))) && + (c3n == u3qfu__stage_nest(van, u3h(two), c3y, u3h(one))) ) { return u3m_error("nest"); } @@ -495,7 +495,7 @@ case c3__rock: u3x_cell(u3t(gen), &p_gen, &q_gen); _mint_used(); { - u3_noun typ = u3qfu_play(van, sut, gen); + u3_noun typ = u3qfu__stage_play(van, sut, gen); u3_noun ret = u3nc(_mint_nice(van, gol, typ), u3nc(1, u3k(q_gen))); @@ -515,7 +515,7 @@ case c3__sand: u3x_cell(u3t(gen), &p_gen, &q_gen); _mint_used(); { - u3_noun typ = u3qfu_play(van, sut, gen); + u3_noun typ = u3qfu__stage_play(van, sut, gen); u3_noun ret = u3nc(_mint_nice(van, gol, typ), u3nc(1, u3k(q_gen))); @@ -532,7 +532,7 @@ _mint_used(); { u3_noun ryd = _mint_in(van, sut, gol, p_gen); - u3_noun tyf = u3qfu_wrap(van, u3h(ryd), c3__iron); + u3_noun tyf = u3qfu__stage_wrap(van, u3h(ryd), c3__iron); u3_noun tyn = _mint_nice(van, gol, tyf); u3_noun pro = u3nc(tyn, u3k(u3t(ryd))); @@ -545,7 +545,7 @@ _mint_used(); { u3_noun ryd = _mint_in(van, sut, gol, p_gen); - u3_noun tyf = u3qfu_wrap(van, u3h(ryd), c3__zinc); + u3_noun tyf = u3qfu__stage_wrap(van, u3h(ryd), c3__zinc); u3_noun tyn = _mint_nice(van, gol, tyf); u3_noun pro = u3nc(tyn, u3k(u3t(ryd))); @@ -557,7 +557,7 @@ _mint_used(); { u3_noun ryd = _mint_in(van, sut, gol, p_gen); - u3_noun tyf = u3qfu_wrap(van, u3h(ryd), c3__lead); + u3_noun tyf = u3qfu__stage_wrap(van, u3h(ryd), c3__lead); u3_noun tyn = _mint_nice(van, gol, tyf); u3_noun pro = u3nc(tyn, u3k(u3t(ryd))); @@ -587,7 +587,7 @@ case c3__ktls: u3x_cell(u3t(gen), &p_gen, &q_gen); _mint_used(); { - u3_noun huz = u3qfu_play(van, sut, p_gen); + u3_noun huz = u3qfu__stage_play(van, sut, p_gen); u3_noun hif = _mint_nice(van, gol, huz); u3_noun zel = _mint_in(van, sut, hif, q_gen); u3_noun ret = u3nc(hif, u3k(u3t(zel))); @@ -622,7 +622,7 @@ case c3__tscm: u3x_cell(u3t(gen), &p_gen, &q_gen); _mint_used(); { - u3_noun boc = u3qfu_busk(van, sut, p_gen); + u3_noun boc = u3qfu__stage_busk(van, sut, p_gen); u3_noun ret = _mint_in(van, boc, gol, q_gen); u3z(boc); @@ -660,8 +660,8 @@ case c3__sgzp: u3x_cell(u3t(gen), &p_gen, &q_gen); _mint_used(); { - u3_noun typ = u3qfu_play(van, sut, p_gen); - u3_noun dug = u3qfu_duck(van, typ); + u3_noun typ = u3qfu__stage_play(van, sut, p_gen); + u3_noun dug = u3qfu__stage_duck(van, typ); u3t_push(u3nc(c3__mean, dug)); { @@ -695,7 +695,7 @@ case c3__zpts: p_gen = u3t(gen); _mint_used(); { - u3_noun von = u3i_molt(u3k(van), u3qfu_van_vet, c3n, 0); + u3_noun von = u3i_molt(u3k(van), u3qfu__stage_van_vet, c3n, 0); u3_noun sev = _mint_corn(von, sut, p_gen); u3z(von); @@ -705,7 +705,7 @@ case c3__ktcn: p_gen = u3t(gen); _mint_used(); { - u3_noun von = u3i_molt(u3k(van), u3qfu_van_fab, c3n, 0); + u3_noun von = u3i_molt(u3k(van), u3qfu__stage_van_fab, c3n, 0); u3_noun ret = _mint_in(von, sut, gol, p_gen); u3z(von); @@ -716,7 +716,7 @@ _mint_used(); { u3_noun hyp = u3nc(u3nc(c3y, 1), u3k(q_gen)); - u3_noun fid = u3qfu_find(van, sut, c3__free, hyp); + u3_noun fid = u3qfu__stage_find(van, sut, c3__free, hyp); if ( c3y != u3h(fid) ) { return u3m_error("mint-fragment"); @@ -750,8 +750,8 @@ _mint_used(); { - c3_m fun_m = 141 + c3__blow; - u3_noun vrf = u3r_at(u3qfu_van_vrf, van); + c3_m fun_m = 200 + c3__blow; + u3_noun vrf = u3r_at(u3qfu__stage_van_vrf, van); u3_noun pro = u3z_find_4(fun_m, vrf, sut, gol, p_gen); if ( u3_none != pro ) { @@ -759,7 +759,7 @@ } else { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_mint_in-blow", von, "blow"); + u3_noun gat = u3j_cook("_stage_mint_in-blow", von, "blow"); u3_noun pro; pro = u3n_kick_on(u3i_molt(gat, @@ -778,7 +778,7 @@ { return u3nc(_mint_nice(van, gol, - u3qfu_play(van, sut, p_gen)), + u3qfu__stage_play(van, sut, p_gen)), u3nc(1, u3k(q_gen))); } @@ -801,7 +801,7 @@ _mint_used(); { u3_noun vos = _mint_in(van, sut, c3__noun, q_gen); - u3_noun zur = u3qfu_play(van, sut, p_gen); + u3_noun zur = u3qfu__stage_play(van, sut, p_gen); u3_noun p_vos = u3h(vos); u3_noun q_vos = u3t(vos); u3_noun waz = u3nc(1, _mint_burp(van, p_vos)); @@ -835,8 +835,8 @@ _mint_used(); { if ( c3y == _mint_vet(van) ) { - u3_noun zur = u3qfu_play(van, sut, p_gen); - u3_noun dun = u3qfu_dunq(van, "lost", zur); + u3_noun zur = u3qfu__stage_play(van, sut, p_gen); + u3_noun dun = u3qfu__stage_dunq(van, "lost", zur); u3t_push(u3nc(c3__mean, dun)); return u3m_error("mint-lost"); @@ -867,7 +867,7 @@ /* boilerplate */ u3_noun - u3wfu_mint(u3_noun cor) + u3wfu__stage_mint(u3_noun cor) { u3_noun sut, gol, gen, van; @@ -884,13 +884,13 @@ } u3_noun - u3qfu_mint(u3_noun van, + u3qfu__stage_mint(u3_noun van, u3_noun sut, u3_noun gol, u3_noun gen) { - c3_m fun_m = 141 + c3__mint; - u3_noun vrf = u3r_at(u3qfu_van_vrf, van); + c3_m fun_m = 200 + c3__mint; + u3_noun vrf = u3r_at(u3qfu__stage_van_vrf, van); u3_noun pro = u3z_find_4(fun_m, vrf, sut, gol, gen); if ( u3_none != pro ) { diff --git a/jets/stage/f/ut_mull.c b/jets/stage/f/ut_mull.c index 760ebbf1f..ba9440d7b 100644 --- a/jets/stage/f/ut_mull.c +++ b/jets/stage/f/ut_mull.c @@ -11,7 +11,7 @@ static u3_noun _mull_bean() { - return u3kf_fork(u3nt(u3nq(c3__atom, 'f', u3_nul, 0), + return u3kf__stage_fork(u3nt(u3nq(c3__atom, 'f', u3_nul, 0), u3nq(c3__atom, 'f', u3_nul, 1), u3_nul)); } @@ -21,7 +21,7 @@ u3_noun loc) { u3_noun mol = u3nc('o', u3k(loc)); - u3_noun sho = u3j_cook("_mull_loc-show", u3k(van), "show"); + u3_noun sho = u3j_cook("_stage_mull_loc-show", u3k(van), "show"); u3_noun ret = u3i_molt(u3k(sho), u3x_sam, u3k(mol), 0); u3z(mol); @@ -108,7 +108,7 @@ u3_noun sut, u3_noun gen) { - u3_noun fug = u3qfu_mint(van, sut, c3__noun, gen); + u3_noun fug = u3qfu__stage_mint(van, sut, c3__noun, gen); u3_noun axe = _mull_cove(u3t(fug)); u3z(fug); @@ -120,9 +120,9 @@ u3_noun gol, u3_noun typ) { - if ( c3n == u3qfu_nest(van, gol, c3y, typ) ) { - // u3_noun dun = u3qfu_dunq(van, "need", gol); - // u3_noun niz = u3qfu_dunq(van, "have", typ); + if ( c3n == u3qfu__stage_nest(van, gol, c3y, typ) ) { + // u3_noun dun = u3qfu__stage_dunq(van, "need", gol); + // u3_noun niz = u3qfu__stage_dunq(van, "have", typ); // u3t_push(u3nc(c3__mean, dun)); // u3t_push(u3nc(c3__mean, niz)); @@ -176,7 +176,7 @@ u3_noun rig) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_mull_cnts-emul", von, "emul"); + u3_noun gat = u3j_cook("_stage_mull_cnts-emul", von, "emul"); return u3n_kick_on(u3i_molt(gat, u3x_sam_2, @@ -209,8 +209,8 @@ u3_noun zil = _mull_in(van, sut, c3__noun, dox, qi_mew); u3_noun p_zil = u3h(zil); u3_noun q_zil = u3t(zil); - u3_noun cuf = u3qfu_toss(van, sut, pi_mew, p_zil, p_yom); - u3_noun dof = u3qfu_toss(van, sut, pi_mew, q_zil, q_yom); + u3_noun cuf = u3qfu__stage_toss(van, sut, pi_mew, p_zil, p_yom); + u3_noun dof = u3qfu__stage_toss(van, sut, pi_mew, q_zil, q_yom); if ( u3r_sing(u3h(cuf), u3h(dof)) ) { u3m_error("mull-bonk-a"); @@ -239,8 +239,8 @@ u3_noun hyp, u3_noun rig) { - u3_noun lar = u3qfu_seek(van, sut, c3__read, hyp); - u3_noun vug = u3qfu_seek(van, dox, c3__read, hyp); + u3_noun lar = u3qfu__stage_seek(van, sut, c3__read, hyp); + u3_noun vug = u3qfu__stage_seek(van, dox, c3__read, hyp); u3_noun p_lar = u3h(lar); u3_noun q_lar = u3t(lar); u3_noun pq_lar = u3h(q_lar); @@ -258,9 +258,9 @@ u3_noun yom = _mull_edit (van, sut, dox, mew, u3k(qq_lar), u3k(qq_vug)); - u3_noun von = u3i_molt(u3k(van), u3qfu_van_vet, c3n, 0); - u3_noun p_ret = u3qfu_fire(van, sut, u3h(yom)); - u3_noun q_ret = u3qfu_fire(von, sut, u3t(yom)); + u3_noun von = u3i_molt(u3k(van), u3qfu__stage_van_vet, c3n, 0); + u3_noun p_ret = u3qfu__stage_fire(van, sut, u3h(yom)); + u3_noun q_ret = u3qfu__stage_fire(von, sut, u3t(yom)); u3z(von); u3z(yom); @@ -286,7 +286,7 @@ if ( c3n == u3du(gen) ) { u3_noun ter = u3r_at(u3x_con_3, van); - u3_noun fab = u3r_at(u3qfu_van_fab, van); + u3_noun fab = u3r_at(u3qfu__stage_van_fab, van); u3_noun rex = u3qfp_open(ter, fab, gen); ret = _mull_in(van, sut, gol, dox, rex); @@ -312,12 +312,12 @@ else switch ( u3h(gen) ) { default: { u3_noun ter = u3r_at(u3x_con_3, van); - u3_noun fab = u3r_at(u3qfu_van_fab, van); + u3_noun fab = u3r_at(u3qfu__stage_van_fab, van); u3_noun rex = u3qfp_open(ter, fab, gen); if ( c3y == u3r_sing(rex, gen) ) { #if 1 - u3_noun zix = u3qfu_shep(van, "gene", 'q', u3k(gen)); + u3_noun zix = u3qfu__stage_shep(van, "gene", 'q', u3k(gen)); u3t_push(u3nc(c3__mean, zix)); return u3m_error("mull-open"); @@ -335,13 +335,13 @@ case c3__fits: u3x_cell(u3t(gen), &p_gen, &q_gen); _mull_used(); { - u3_noun p_waz = u3qfu_play(van, sut, p_gen); - u3_noun q_waz = u3qfu_play(van, dox, p_gen); + u3_noun p_waz = u3qfu__stage_play(van, sut, p_gen); + u3_noun q_waz = u3qfu__stage_play(van, dox, p_gen); u3_noun dok = u3nc(c3__wing, u3k(q_gen)); u3_noun p_syx = _mull_doke(van, sut, dok); u3_noun q_syx = _mull_doke(van, dox, dok); - u3_noun p_pov = u3qfu_fish(van, p_waz, p_syx); - u3_noun q_pov = u3qfu_fish(van, q_waz, q_syx); + u3_noun p_pov = u3qfu__stage_fish(van, p_waz, p_syx); + u3_noun q_pov = u3qfu__stage_fish(van, q_waz, q_syx); if ( (c3n == u3r_sing(p_syx, q_syx)) || (c3n == u3r_sing(p_pov, q_pov)) ) @@ -360,8 +360,8 @@ _mull_used(); { u3_noun hyp = u3nc(u3nc(c3y, 1), u3k(q_gen)); - u3_noun fid = u3qfu_find(van, sut, c3__free, hyp); - u3_noun gax = u3qfu_find(van, dox, c3__free, hyp); + u3_noun fid = u3qfu__stage_find(van, sut, c3__free, hyp); + u3_noun gax = u3qfu__stage_find(van, dox, c3__free, hyp); u3_noun old_type, old_axis; u3_noun new_type, new_axis; @@ -399,7 +399,7 @@ if ( c3n == u3r_sing(old_axis, new_axis) ) { return u3m_error("mull-bonk-x"); } - else if ( c3n == u3qfu_nest(van, old_type, c3y, new_type) ) { + else if ( c3n == u3qfu__stage_nest(van, old_type, c3y, new_type) ) { return u3m_error("mull-bonk-x"); } @@ -416,10 +416,10 @@ { u3_noun bol = _mull_bean(); u3_noun nor = _mull_in(van, sut, bol, dox, p_gen); - u3_noun p_fex = u3qfu_gain(van, sut, p_gen); - u3_noun q_fex = u3qfu_gain(van, dox, p_gen); - u3_noun p_wux = u3qfu_lose(van, sut, p_gen); - u3_noun q_wux = u3qfu_lose(van, dox, p_gen); + u3_noun p_fex = u3qfu__stage_gain(van, sut, p_gen); + u3_noun q_fex = u3qfu__stage_gain(van, dox, p_gen); + u3_noun p_wux = u3qfu__stage_lose(van, sut, p_gen); + u3_noun q_wux = u3qfu__stage_lose(van, dox, p_gen); u3_noun hiq, ran; u3_noun dis, dat; u3_noun ret; @@ -428,7 +428,7 @@ hiq = u3nc(c3__void, (c3__void == q_fex) ? c3__void - : u3qfu_play(van, q_fex, q_gen)); + : u3qfu__stage_play(van, q_fex, q_gen)); } else if ( c3__void == q_fex ) { hiq = u3m_error("mull-bonk-c"); } @@ -438,14 +438,14 @@ ran = u3nc(c3__void, (c3__void == q_wux) ? c3__void - : u3qfu_play(van, q_wux, r_gen)); + : u3qfu__stage_play(van, q_wux, r_gen)); } else if ( c3__void == q_wux ) { ran = u3m_error("mull-bonk-d"); } else ran = _mull_in(van, p_wux, gol, q_wux, r_gen); - dis = u3qf_forq(u3h(hiq), u3h(ran)); - dat = u3qf_forq(u3t(hiq), u3t(ran)); + dis = u3qf__stage_forq(u3h(hiq), u3h(ran)); + dat = u3qf__stage_forq(u3t(hiq), u3t(ran)); ret = u3nc(_mull_nice(van, gol, dis), dat); @@ -523,7 +523,7 @@ case c3__rock: u3x_cell(u3t(gen), &p_gen, &q_gen); _mull_used(); { - u3_noun typ = u3qfu_play(van, sut, gen); + u3_noun typ = u3qfu__stage_play(van, sut, gen); return _mull_both(van, gol, typ); } @@ -543,7 +543,7 @@ case c3__sand: u3x_cell(u3t(gen), &p_gen, &q_gen); _mull_used(); { - u3_noun typ = u3qfu_play(van, sut, gen); + u3_noun typ = u3qfu__stage_play(van, sut, gen); return _mull_both(van, gol, typ); } @@ -557,10 +557,10 @@ _mull_used(); { u3_noun vat = _mull_in(van, sut, gol, dox, p_gen); - u3_noun pro = u3nc(u3qfu_wrap(van, + u3_noun pro = u3nc(u3qfu__stage_wrap(van, u3h(vat), c3__iron), - u3qfu_wrap(van, + u3qfu__stage_wrap(van, u3t(vat), c3__iron)); @@ -573,10 +573,10 @@ _mull_used(); { u3_noun vat = _mull_in(van, sut, gol, dox, p_gen); - u3_noun pro = u3nc(u3qfu_wrap(van, + u3_noun pro = u3nc(u3qfu__stage_wrap(van, u3h(vat), c3__zinc), - u3qfu_wrap(van, + u3qfu__stage_wrap(van, u3t(vat), c3__zinc)); @@ -588,10 +588,10 @@ _mull_used(); { u3_noun vat = _mull_in(van, sut, gol, dox, p_gen); - u3_noun pro = u3nc(u3qfu_wrap(van, + u3_noun pro = u3nc(u3qfu__stage_wrap(van, u3h(vat), c3__lead), - u3qfu_wrap(van, + u3qfu__stage_wrap(van, u3t(vat), c3__lead)); @@ -630,8 +630,8 @@ case c3__ktls: u3x_cell(u3t(gen), &p_gen, &q_gen); _mull_used(); { - u3_noun p_hif = _mull_nice(van, gol, u3qfu_play(van, sut, p_gen)); - u3_noun q_hif = u3qfu_play(van, dox, p_gen); + u3_noun p_hif = _mull_nice(van, gol, u3qfu__stage_play(van, sut, p_gen)); + u3_noun q_hif = u3qfu__stage_play(van, dox, p_gen); u3_noun zel = _mull_in(van, sut, p_hif, dox, q_gen); u3_noun ret = u3nc(p_hif, q_hif); @@ -654,8 +654,8 @@ case c3__tscm: u3x_cell(u3t(gen), &p_gen, &q_gen); _mull_used(); { - u3_noun boc = u3qfu_busk(van, sut, p_gen); - u3_noun nuf = u3qfu_busk(van, dox, p_gen); + u3_noun boc = u3qfu__stage_busk(van, sut, p_gen); + u3_noun nuf = u3qfu__stage_busk(van, dox, p_gen); u3_noun ret = _mull_in(van, boc, gol, nuf, q_gen); u3z(boc); @@ -697,8 +697,8 @@ case c3__sgzp: u3x_cell(u3t(gen), &p_gen, &q_gen); _mull_used(); { - u3_noun typ = u3qfu_play(van, sut, p_gen); - u3_noun dug = u3qfu_duck(van, typ); + u3_noun typ = u3qfu__stage_play(van, sut, p_gen); + u3_noun dug = u3qfu__stage_duck(van, typ); u3_noun ret; u3t_push(u3nc(c3__mean, dug)); @@ -720,8 +720,8 @@ case c3__zpcm: u3x_cell(u3t(gen), &p_gen, &q_gen); _mull_used(); { - u3_noun p_ret = u3qfu_play(van, sut, p_gen); - u3_noun q_ret = u3qfu_play(van, sut, q_gen); + u3_noun p_ret = u3qfu__stage_play(van, sut, p_gen); + u3_noun q_ret = u3qfu__stage_play(van, sut, q_gen); return u3nc(_mull_nice(van, gol, p_ret), q_ret); @@ -748,7 +748,7 @@ case c3__ktcn: p_gen = u3t(gen); _mull_used(); { - u3_noun von = u3i_molt(u3k(van), u3qfu_van_fab, c3n, 0); + u3_noun von = u3i_molt(u3k(van), u3qfu__stage_van_fab, c3n, 0); u3_noun ret = _mull_in(von, sut, gol, dox, p_gen); u3z(von); @@ -759,8 +759,8 @@ case c3__zpsm: u3x_cell(u3t(gen), &p_gen, &q_gen); _mull_used(); { - u3_noun p_zur = u3qfu_play(van, sut, p_gen); - u3_noun q_zur = u3qfu_play (van, dox, p_gen); + u3_noun p_zur = u3qfu__stage_play(van, sut, p_gen); + u3_noun q_zur = u3qfu__stage_play (van, dox, p_gen); u3_noun vos = _mull_in(van, sut, c3__noun, dox, q_gen); u3_noun p_ret = u3qf_cell(p_zur, u3h(vos)); u3_noun q_ret = u3qf_cell(q_zur, u3t(vos)); @@ -813,7 +813,7 @@ /* boilerplate */ u3_noun - u3wfu_mull(u3_noun cor) + u3wfu__stage_mull(u3_noun cor) { u3_noun sut, gol, dox, gen, van; @@ -831,13 +831,13 @@ } u3_noun - u3qfu_mull(u3_noun van, + u3qfu__stage_mull(u3_noun van, u3_noun sut, u3_noun gol, u3_noun dox, u3_noun gen) { - c3_m fun_m = 141 + c3__mull + ((!!u3r_at(u3qfu_van_vet, van)) << 8); + c3_m fun_m = 200 + c3__mull + ((!!u3r_at(u3qfu__stage_van_vet, van)) << 8); u3_noun pro = u3z_find_4(fun_m, sut, gol, dox, gen); if ( u3_none != pro ) { diff --git a/jets/stage/f/ut_nest.c b/jets/stage/f/ut_nest.c index f36c1385c..985a17a7c 100644 --- a/jets/stage/f/ut_nest.c +++ b/jets/stage/f/ut_nest.c @@ -45,8 +45,8 @@ return c3n; } else { - u3_noun vis = u3qfu_play(van, sut, qn_dab); - u3_noun lon = u3qfu_play(van, ref, qn_hem); + u3_noun vis = u3qfu__stage_play(van, sut, qn_dab); + u3_noun lon = u3qfu__stage_play(van, ref, qn_hem); u3_noun ret = _nest_dext(van, vis, tel, lon, u3_nul, u3_nul, gil); @@ -153,13 +153,13 @@ else { u3_noun hud = u3nc(u3k(sut), u3k(ref)); - if ( (c3y == u3qdi_has(gil, hud)) ) { + if ( (c3y == u3qdi__stage_has(gil, hud)) ) { u3z(hud); return c3y; } else { - u3_noun zoc = u3qdi_put(gil, hud); + u3_noun zoc = u3qdi__stage_put(gil, hud); u3_noun tus = u3nt(c3__core, u3k(qq_sut), u3nc(u3nt(u3k(ppq_sut), u3k(qpq_sut), c3__gold), @@ -189,8 +189,8 @@ _nest_dext(van, qq_ref, tel, qq_sut, u3_nul, u3_nul, gil)); } case c3__iron: { - u3_noun s_sam = u3qfu_peek(van, qq_sut, c3__rite, 2); - u3_noun r_sam = u3qfu_peek(van, qq_ref, c3__rite, 2); + u3_noun s_sam = u3qfu__stage_peek(van, qq_sut, c3__rite, 2); + u3_noun r_sam = u3qfu__stage_peek(van, qq_ref, c3__rite, 2); u3_noun ret = _nest_dext (van, r_sam, tel, s_sam, u3_nul, u3_nul, gil); @@ -202,8 +202,8 @@ return c3y; } case c3__zinc: { - u3_noun s_pal = u3qfu_peek(van, qq_sut, c3__read, 2); - u3_noun r_pal = u3qfu_peek(van, qq_ref, c3__read, 2); + u3_noun s_pal = u3qfu__stage_peek(van, qq_sut, c3__read, 2); + u3_noun r_pal = u3qfu__stage_peek(van, qq_ref, c3__read, 2); u3_noun ret = _nest_dext (van, s_pal, tel, r_pal, u3_nul, u3_nul, gil); @@ -308,7 +308,7 @@ } { - u3_noun dey = u3qdi_tap(p_sut); + u3_noun dey = u3qdi__stage_tap(p_sut); u3_noun yed = dey; while ( u3_nul != yed ) { @@ -325,21 +325,21 @@ } case c3__hold: { - if ( c3y == u3qdi_has(seg, sut) ) { + if ( c3y == u3qdi__stage_has(seg, sut) ) { return c3n; } else { u3_noun hud = u3nc(u3k(sut), u3k(ref)); - if ( (c3y == u3qdi_has(gil, hud)) ) { + if ( (c3y == u3qdi__stage_has(gil, hud)) ) { u3z(hud); return c3y; } else { - u3_noun gus = u3qdi_put(seg, sut); - u3_noun zoc = u3qdi_put(gil, hud); - u3_noun fop = u3qfu_repo(van, sut); + u3_noun gus = u3qdi__stage_put(seg, sut); + u3_noun zoc = u3qdi__stage_put(gil, hud); + u3_noun fop = u3qfu__stage_repo(van, sut); u3_noun hiv = _nest_dext(van, fop, tel, ref, gus, reg, zoc); u3z(hud); @@ -369,8 +369,8 @@ return tyn; } else { #if 0 - u3_noun dun = u3qfu_dunq(van, "need", sut); - u3_noun niz = u3qfu_dunq(van, "have", ref); + u3_noun dun = u3qfu__stage_dunq(van, "need", sut); + u3_noun niz = u3qfu__stage_dunq(van, "have", ref); u3t_push(u3nc(c3__mean, dun)); u3t_push(u3nc(c3__mean, niz)); @@ -394,7 +394,7 @@ } { - c3_m fun_m = 141 + c3__nest + ((!!u3r_at(u3qfu_van_vet, van)) << 8); + c3_m fun_m = 200 + c3__nest + ((!!u3r_at(u3qfu__stage_van_vet, van)) << 8); u3_noun pro = u3z_find_2(fun_m, sut, ref); if ( u3_none != pro ) { @@ -440,7 +440,7 @@ case c3__atom: return c3n; case c3__cell: return c3n; case c3__core: { - u3_noun gam = u3qfu_repo(van, ref); + u3_noun gam = u3qfu__stage_repo(van, ref); u3_noun hiv = _nest_dext(van, sut, tel, gam, seg, reg, gil); u3z(gam); @@ -456,7 +456,7 @@ } case c3__fork: p_ref = u3t(ref); { - u3_noun dey = u3qdi_tap(p_ref); + u3_noun dey = u3qdi__stage_tap(p_ref); u3_noun yed = dey; while ( u3_nul != yed ) { @@ -471,20 +471,20 @@ return c3y; } case c3__hold: { - if ( c3y == u3qdi_has(reg, ref) ) { + if ( c3y == u3qdi__stage_has(reg, ref) ) { return c3y; } { u3_noun hud = u3nc(u3k(sut), u3k(ref)); - if ( (c3y == u3qdi_has(gil, hud)) ) { + if ( (c3y == u3qdi__stage_has(gil, hud)) ) { u3z(hud); return c3y; } else { - u3_noun gur = u3qdi_put(reg, ref); - u3_noun zoc = u3qdi_put(gil, hud); - u3_noun gam = u3qfu_repo(van, ref); + u3_noun gur = u3qdi__stage_put(reg, ref); + u3_noun zoc = u3qdi__stage_put(gil, hud); + u3_noun gam = u3qfu__stage_repo(van, ref); { u3_noun hiv = _nest_dext(van, sut, tel, gam, seg, gur, zoc); @@ -515,7 +515,7 @@ /* boilerplate */ u3_noun - u3wfu_nest(u3_noun cor) + u3wfu__stage_nest(u3_noun cor) { u3_noun sut, tel, ref, van; @@ -533,14 +533,14 @@ } u3_noun - u3qfu_nest(u3_noun van, + u3qfu__stage_nest(u3_noun van, u3_noun sut, u3_noun tel, u3_noun ref) { #if 1 - c3_m fun_m = 141 + c3__nest; - u3_noun vrf = u3r_at(u3qfu_van_vrf, van); + c3_m fun_m = 200 + c3__nest; + u3_noun vrf = u3r_at(u3qfu__stage_van_vrf, van); u3_noun pro = u3z_find_4(fun_m, vrf, sut, tel, ref); if ( u3_none != pro ) { diff --git a/jets/stage/f/ut_peek.c b/jets/stage/f/ut_peek.c index dc9a5887c..bbaba3a8d 100644 --- a/jets/stage/f/ut_peek.c +++ b/jets/stage/f/ut_peek.c @@ -85,7 +85,7 @@ u3_atom lat = u3qc_mas(axe); if ( 3 == now ) { - u3_noun pec = u3qfu_peel(van, sut, way, rpq_sut); + u3_noun pec = u3qfu__stage_peel(van, sut, way, rpq_sut); u3_noun sam = u3h(pec); u3_noun con = u3t(pec); u3_atom tow; @@ -156,19 +156,19 @@ } case c3__fork: p_sut = u3t(sut); { - u3_noun yed = u3qdi_tap(p_sut); - u3_noun ret = u3kf_fork(_peek_fork(van, yed, way, axe, gil)); + u3_noun yed = u3qdi__stage_tap(p_sut); + u3_noun ret = u3kf__stage_fork(_peek_fork(van, yed, way, axe, gil)); u3z(yed); return ret; } case c3__hold: { - if ( (c3y == u3qdi_has(gil, sut)) ) { + if ( (c3y == u3qdi__stage_has(gil, sut)) ) { return c3__void; } else { - u3_noun zoc = u3qdi_put(gil, sut); - u3_noun fop = u3qfu_repo(van, sut); + u3_noun zoc = u3qdi__stage_put(gil, sut); + u3_noun fop = u3qfu__stage_repo(van, sut); u3_noun pro = _peek_in(van, fop, way, axe, zoc); u3z(fop); @@ -195,7 +195,7 @@ /* boilerplate */ u3_noun - u3wfu_peek(u3_noun cor) + u3wfu__stage_peek(u3_noun cor) { u3_noun sut, way, axe, van; @@ -213,12 +213,12 @@ } u3_noun - u3qfu_peek(u3_noun van, + u3qfu__stage_peek(u3_noun van, u3_noun sut, u3_noun way, u3_noun axe) { - c3_m fun_m = 141 + c3__peek + ((!!u3r_at(u3qfu_van_vet, van)) << 8); + c3_m fun_m = 200 + c3__peek + ((!!u3r_at(u3qfu__stage_van_vet, van)) << 8); u3_noun pro = u3z_find_3(fun_m, sut, way, axe); if ( u3_none != pro ) { diff --git a/jets/stage/f/ut_peel.c b/jets/stage/f/ut_peel.c index 717a62543..0ffc3f940 100644 --- a/jets/stage/f/ut_peel.c +++ b/jets/stage/f/ut_peel.c @@ -6,7 +6,7 @@ /* logic */ - u3_noun + static u3_noun _cqfu_peel(u3_noun van, u3_noun sut, u3_noun way, @@ -28,7 +28,7 @@ /* boilerplate */ u3_noun - u3wfu_peel(u3_noun cor) + u3wfu__stage_peel(u3_noun cor) { u3_noun sut, way, met, van; @@ -45,7 +45,7 @@ } u3_noun - u3qfu_peel(u3_noun van, + u3qfu__stage_peel(u3_noun van, u3_noun sut, u3_noun way, u3_noun met) diff --git a/jets/stage/f/ut_play.c b/jets/stage/f/ut_play.c index 9a300edf4..0dc6e00e6 100644 --- a/jets/stage/f/ut_play.c +++ b/jets/stage/f/ut_play.c @@ -13,7 +13,7 @@ static u3_noun _play_bean() { - return u3kf_fork(u3nt(u3nq(c3__atom, 'f', u3_nul, 0), + return u3kf__stage_fork(u3nt(u3nq(c3__atom, 'f', u3_nul, 0), u3nq(c3__atom, 'f', u3_nul, 1), u3_nul)); } @@ -70,7 +70,7 @@ u3_noun loc) { u3_noun mol = u3nc('o', u3k(loc)); - u3_noun sho = u3j_cook("_play_loc-show", u3k(van), "show"); + u3_noun sho = u3j_cook("_stage_play_loc-show", u3k(van), "show"); u3_noun ret = u3i_molt(u3k(sho), u3x_sam, u3k(mol), 0); u3z(mol); @@ -121,7 +121,7 @@ u3_noun rig) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_play_cnts-epla", von, "epla"); + u3_noun gat = u3j_cook("_stage_play_cnts-epla", von, "epla"); return u3n_kick_on(u3i_molt(gat, u3x_sam_2, @@ -146,7 +146,7 @@ u3_noun pi_mew = u3h(i_mew); u3_noun qi_mew = u3t(i_mew); u3_noun laf = _play_in(van, sut, qi_mew); - u3_noun ruz = u3qfu_toss(van, sut, pi_mew, laf, rag); + u3_noun ruz = u3qfu__stage_toss(van, sut, pi_mew, laf, rag); u3z(laf); u3z(rag); @@ -163,12 +163,12 @@ u3_noun hyp, u3_noun rig) { - u3_noun lar = u3qfu_seek(van, sut, c3__read, hyp); + u3_noun lar = u3qfu__stage_seek(van, sut, c3__read, hyp); u3_noun q_lar = u3t(lar); u3_noun qq_lar = u3t(q_lar); u3_noun mew = rig; u3_noun rag = _play_edit(van, sut, mew, u3k(qq_lar)); - u3_noun ret = u3qfu_fire(van, sut, rag); + u3_noun ret = u3qfu__stage_fire(van, sut, rag); u3z(rag); u3z(lar); @@ -208,7 +208,7 @@ #if 1 return _play_in(van, sut, gen); #else - u3_noun zix = u3qfu_shep + u3_noun zix = u3qfu__stage_shep (van, "gene", 'q', u3k(gen)); u3_noun ret; @@ -231,12 +231,12 @@ if ( c3n == u3du(gen) ) { open: { u3_noun ter = u3r_at(u3x_con_3, van); - u3_noun fab = u3r_at(u3qfu_van_fab, van); + u3_noun fab = u3r_at(u3qfu__stage_van_fab, van); u3_noun rex = u3qfp_open(ter, fab, gen); u3_noun ret; if ( c3y == u3r_sing(rex, gen) ) { - u3_noun zix = u3qfu_shep(van, "gene", 'q', u3k(gen)); + u3_noun zix = u3qfu__stage_shep(van, "gene", 'q', u3k(gen)); u3t_push(u3nc(c3__mean, zix)); return u3m_error("play-open-z"); @@ -271,13 +271,13 @@ case c3__wtcl: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); _play_used(); { - u3_noun fex = u3qfu_gain(van, sut, p_gen); - u3_noun wux = u3qfu_lose(van, sut, p_gen); + u3_noun fex = u3qfu__stage_gain(van, sut, p_gen); + u3_noun wux = u3qfu__stage_lose(van, sut, p_gen); u3_noun dez = (fex == c3__void) ? c3__void : _play_x(van, fex, q_gen); u3_noun doz = (wux == c3__void) ? c3__void : _play_x(van, wux, r_gen); - u3_noun ret = u3qf_forq(dez, doz); + u3_noun ret = u3qf__stage_forq(dez, doz); u3z(dez); u3z(doz); u3z(fex); u3z(wux); @@ -352,7 +352,7 @@ _play_used(); { u3_noun boc = _play_x(van, sut, p_gen); - u3_noun pro = u3qfu_wrap(van, boc, c3__iron); + u3_noun pro = u3qfu__stage_wrap(van, boc, c3__iron); u3z(boc); return pro; @@ -362,7 +362,7 @@ _play_used(); { u3_noun boc = _play_x(van, sut, p_gen); - u3_noun pro = u3qfu_wrap(van, boc, c3__zinc); + u3_noun pro = u3qfu__stage_wrap(van, boc, c3__zinc); u3z(boc); return pro; @@ -372,7 +372,7 @@ _play_used(); { u3_noun boc = _play_x(van, sut, p_gen); - u3_noun pro = u3qfu_wrap(van, boc, c3__lead); + u3_noun pro = u3qfu__stage_wrap(van, boc, c3__lead); u3z(boc); return pro; @@ -421,7 +421,7 @@ case c3__tscm: u3x_cell(u3t(gen), &p_gen, &q_gen); _play_used(); { - u3_noun boc = u3qfu_busk(van, sut, p_gen); + u3_noun boc = u3qfu__stage_busk(van, sut, p_gen); u3_noun ret = _play_x(van, boc, q_gen); u3z(boc); @@ -459,8 +459,8 @@ case c3__sgzp: u3x_cell(u3t(gen), &p_gen, &q_gen); _play_used(); { - u3_noun typ = u3qfu_play(van, sut, p_gen); - u3_noun dug = u3qfu_duck(van, typ); + u3_noun typ = u3qfu__stage_play(van, sut, p_gen); + u3_noun dug = u3qfu__stage_duck(van, typ); u3_noun ret; u3t_push(u3nc(c3__mean, dug)); @@ -487,7 +487,7 @@ case c3__ktcn: p_gen = u3t(gen); { - u3_noun von = u3i_molt(u3k(van), u3qfu_van_fab, c3n, 0); + u3_noun von = u3i_molt(u3k(van), u3qfu__stage_van_fab, c3n, 0); u3_noun ret = _play_x(von, sut, p_gen); u3z(von); @@ -559,7 +559,7 @@ u3_noun sut, u3_noun gen) { - u3_noun von = u3i_molt(u3k(van), u3qfu_van_vet, c3n, 0); + u3_noun von = u3i_molt(u3k(van), u3qfu__stage_van_vet, c3n, 0); u3_noun ret = _play_x(von, sut, gen); u3z(von); @@ -569,7 +569,7 @@ /* boilerplate */ u3_noun - u3wfu_play(u3_noun cor) + u3wfu__stage_play(u3_noun cor) { u3_noun sut, gen, van; @@ -583,13 +583,13 @@ } u3_noun - u3qfu_play(u3_noun van, + u3qfu__stage_play(u3_noun van, u3_noun sut, u3_noun gen) { #if 1 - c3_m fun_m = 141 + c3__play; - u3_noun vrf = u3r_at(u3qfu_van_vrf, van); + c3_m fun_m = 200 + c3__play; + u3_noun vrf = u3r_at(u3qfu__stage_van_vrf, van); u3_noun pro = u3z_find_3(fun_m, vrf, sut, gen); if ( u3_none != pro ) { diff --git a/jets/stage/f/ut_repo.c b/jets/stage/f/ut_repo.c index 0e82bf813..1cea98c9d 100644 --- a/jets/stage/f/ut_repo.c +++ b/jets/stage/f/ut_repo.c @@ -7,7 +7,7 @@ /* logic */ u3_noun - u3qfu_repo(u3_noun van, + u3qfu__stage_repo(u3_noun van, u3_noun sut) { u3_noun p_sut, q_sut; @@ -16,7 +16,7 @@ default: return u3k(sut); case c3__noun: { - return u3kf_fork(u3nt(u3nt(c3__atom, u3_blip, u3_nul), + return u3kf__stage_fork(u3nt(u3nt(c3__atom, u3_blip, u3_nul), u3nt(c3__cell, c3__noun, c3__noun), u3_nul)); } @@ -49,7 +49,7 @@ u3_noun old = u3nc(u3nc(u3k(p_sut), u3k(q_sut)), u3_nul); u3_noun ret; - ret = u3qfu_rest(van, sut, old); + ret = u3qfu__stage_rest(van, sut, old); u3z(old); return ret; } @@ -58,13 +58,13 @@ } u3_noun - u3wfu_repo(u3_noun cor) + u3wfu__stage_repo(u3_noun cor) { u3_noun sut; if ( u3_none == (sut = u3r_at(u3x_sam, cor)) ) { return u3m_bail(c3__fail); } else { - return u3qfu_repo(cor, sut); + return u3qfu__stage_repo(cor, sut); } } diff --git a/jets/stage/f/ut_rest.c b/jets/stage/f/ut_rest.c index 81edd85df..1134ffeb2 100644 --- a/jets/stage/f/ut_rest.c +++ b/jets/stage/f/ut_rest.c @@ -16,7 +16,7 @@ u3_noun i_leg = u3h(leg); u3_noun t_leg = u3t(leg); - return u3nc(u3qfu_play(van, u3h(i_leg), u3t(i_leg)), + return u3nc(u3qfu__stage_play(van, u3h(i_leg), u3t(i_leg)), _rest_in_list(van, t_leg)); } } @@ -25,8 +25,8 @@ _rest_in_stil(u3_noun van, u3_noun gar) { - u3_noun gun = u3qdi_gas(u3_nul, gar); - u3_noun yed = u3qdi_tap(gun); + u3_noun gun = u3qdi__stage_gas(u3_nul, gar); + u3_noun yed = u3qdi__stage_tap(gun); u3z(gun); return yed; @@ -38,7 +38,7 @@ { u3_noun gar = _rest_in_list(van, leg); u3_noun yed = _rest_in_stil(van, gar); - u3_noun fub = u3qf_fork(yed); + u3_noun fub = u3qf__stage_fork(yed); u3z(gar); u3z(yed); @@ -53,7 +53,7 @@ if ( u3_nul == leg ) { return c3n; } else { - return c3o(u3qdi_has(fan, u3h(leg)), + return c3o(u3qdi__stage_has(fan, u3h(leg)), _rest_hit_fan(fan, u3t(leg))); } } @@ -63,14 +63,14 @@ u3_noun sut, u3_noun leg) { - u3_noun fan = u3r_at(u3qfu_van_fan, van); + u3_noun fan = u3r_at(u3qfu__stage_van_fan, van); if ( c3y == _rest_hit_fan(fan, leg) ) { return u3m_error("rest-loop"); } else { - u3_noun naf = u3qdi_gas(fan, leg); - u3_noun nav = u3i_molt(u3k(van), u3qfu_van_fan, u3k(naf), 0); + u3_noun naf = u3qdi__stage_gas(fan, leg); + u3_noun nav = u3i_molt(u3k(van), u3qfu__stage_van_fan, u3k(naf), 0); u3_noun mez = _rest_in(nav, leg); u3z(naf); @@ -82,7 +82,7 @@ /* boilerplate */ u3_noun - u3wfu_rest(u3_noun cor) + u3wfu__stage_rest(u3_noun cor) { u3_noun sut, leg, van; @@ -96,11 +96,11 @@ } u3_noun - u3qfu_rest(u3_noun van, + u3qfu__stage_rest(u3_noun van, u3_noun sut, u3_noun leg) { - c3_m fun_m = 141 + c3__rest + ((!!u3r_at(u3qfu_van_vet, van)) << 8); + c3_m fun_m = 200 + c3__rest + ((!!u3r_at(u3qfu__stage_van_vet, van)) << 8); u3_noun pro = u3z_find_2(fun_m, sut, leg); if ( u3_none != pro ) { diff --git a/jets/stage/f/ut_tack.c b/jets/stage/f/ut_tack.c index 9328c43ae..5ebf7736b 100644 --- a/jets/stage/f/ut_tack.c +++ b/jets/stage/f/ut_tack.c @@ -4,13 +4,13 @@ #include "all.h" u3_noun - u3qfu_tack(u3_noun van, + u3qfu__stage_tack(u3_noun van, u3_noun sut, u3_noun hyp, u3_noun mur) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("u3qfu_tack-tack", von, "tack"); + u3_noun gat = u3j_cook("u3qfu__stage_tack-tack", von, "tack"); return u3n_kick_on(u3i_molt(gat, u3x_sam_2, diff --git a/jets/stage/f/ut_toss.c b/jets/stage/f/ut_toss.c index 15973cf58..84a90190e 100644 --- a/jets/stage/f/ut_toss.c +++ b/jets/stage/f/ut_toss.c @@ -21,7 +21,7 @@ u3_noun pi_men = u3h(i_men); u3_noun qi_men = u3t(i_men); u3_noun t_men = u3t(men); - u3_noun geq = u3qfu_tack(van, pi_men, peh, mur); + u3_noun geq = u3qfu__stage_tack(van, pi_men, peh, mur); u3_noun p_geq = u3h(geq); u3_noun q_geq = u3t(geq); u3_noun mox = _toss_in(van, sut, peh, mur, t_men); @@ -45,7 +45,7 @@ /* functions */ - u3_noun + static u3_noun _cqfu_toss(u3_noun van, u3_noun sut, u3_noun peh, @@ -69,7 +69,7 @@ /* boilerplate */ u3_noun - u3wfu_toss(u3_noun cor) + u3wfu__stage_toss(u3_noun cor) { u3_noun van, sut, peh, mur, men; @@ -87,7 +87,7 @@ } u3_noun - u3qfu_toss(u3_noun van, + u3qfu__stage_toss(u3_noun van, u3_noun sut, u3_noun peh, u3_noun mur, diff --git a/jets/stage/f/ut_wrap.c b/jets/stage/f/ut_wrap.c index e51d3843f..85ef1458e 100644 --- a/jets/stage/f/ut_wrap.c +++ b/jets/stage/f/ut_wrap.c @@ -55,15 +55,15 @@ } case c3__fork: p_sut = u3t(sut); { - u3_noun yed = u3qdi_tap(p_sut); - u3_noun ret = u3kf_fork(_wrap_fork(van, yed, yoz)); + u3_noun yed = u3qdi__stage_tap(p_sut); + u3_noun ret = u3kf__stage_fork(_wrap_fork(van, yed, yoz)); u3z(yed); return ret; } case c3__hold: { - u3_noun fop = u3qfu_repo(van, sut); + u3_noun fop = u3qfu__stage_repo(van, sut); u3_noun pro = _cqfu_wrap(van, fop, yoz); u3z(fop); @@ -75,7 +75,7 @@ /* boilerplate */ u3_noun - u3wfu_wrap(u3_noun cor) + u3wfu__stage_wrap(u3_noun cor) { u3_noun sut, yoz, van; @@ -89,7 +89,7 @@ } u3_noun - u3qfu_wrap(u3_noun van, + u3qfu__stage_wrap(u3_noun van, u3_noun sut, u3_noun yoz) { diff --git a/jets/tree.c b/jets/tree.c index b73f0110a..bc9182027 100644 --- a/jets/tree.c +++ b/jets/tree.c @@ -220,6 +220,15 @@ static c3_c* _141_pen_look_ha[] = {0}; static u3j_harm _141_pen_loot_a[] = {{".2", u3wf_loot}, {}}; static c3_c* _141_pen_loot_ha[] = {0}; +// mug staging +// +static u3j_harm _141_pen_stage_fork_a[] = {{".2", u3wf__stage_fork}, {}}; +static c3_c* _141_pen_stage_fork_ha[] = {0}; +static u3j_harm _141_pen_stage_look_a[] = {{".2", u3wf__stage_look}, {}}; +static c3_c* _141_pen_stage_look_ha[] = {0}; +static u3j_harm _141_pen_stage_loot_a[] = {{".2", u3wf__stage_loot}, {}}; +static c3_c* _141_pen_stage_loot_ha[] = {0}; + static u3j_harm _141_pen__ut_crop_a[] = {{".2", u3wfu_crop}, {}}; static c3_c* _141_pen__ut_crop_ha[] = {0}; static u3j_harm _141_pen__ut_fire_a[] = {{".2", u3wfu_fire}, {}}; @@ -264,11 +273,11 @@ static u3j_core _141_pen__ut_d[] = { "wrap", 7, _141_pen__ut_wrap_a, 0, _141_pen__ut_wrap_ha }, {} }; + static u3j_harm _141_pen__ut_a[] = { {"repo", u3wfu_repo}, {} }; - static c3_c* _141_pen__ut_ha[] = {0}; static u3j_hood _141_pen__ut_ho[] = { @@ -317,6 +326,106 @@ static u3j_hood _141_pen__ut_ho[] = { {}, }; +// mug staging +// + + static u3j_harm _141_pen__ut_stage_crop_a[] = {{".2", u3wfu__stage_crop}, {}}; + static c3_c* _141_pen__ut_stage_crop_ha[] = {0}; + static u3j_harm _141_pen__ut_stage_fire_a[] = {{".2", u3wfu__stage_fire}, {}}; + static c3_c* _141_pen__ut_stage_fire_ha[] = {0}; + static u3j_harm _141_pen__ut_stage_fish_a[] = {{".2", u3wfu__stage_fish}, {}}; + static c3_c* _141_pen__ut_stage_fish_ha[] = {0}; + static u3j_harm _141_pen__ut_stage_fond_a[] = {{".2", u3wfu__stage_fond}, {}}; + static c3_c* _141_pen__ut_stage_fond_ha[] = {0}; + static u3j_harm _141_pen__ut_stage_fuse_a[] = {{".2", u3wfu__stage_fuse}, {}}; + static c3_c* _141_pen__ut_stage_fuse_ha[] = {0}; + static u3j_harm _141_pen__ut_stage_mint_a[] = {{".2", u3wfu__stage_mint}, {}}; + static c3_c* _141_pen__ut_stage_mint_ha[] = {0}; + static u3j_harm _141_pen__ut_stage_mull_a[] = {{".2", u3wfu__stage_mull}, {}}; + static c3_c* _141_pen__ut_stage_mull_ha[] = {0}; + static u3j_harm _141_pen__ut_stage_nest_a[] = {{".2", u3wfu__stage_nest}, {}}; + static c3_c* _141_pen__ut_stage_nest_ha[] = {0}; + static u3j_harm _141_pen__ut_stage_peek_a[] = {{".2", u3wfu__stage_peek}, {}}; + static c3_c* _141_pen__ut_stage_peek_ha[] = {0}; + static u3j_harm _141_pen__ut_stage_play_a[] = {{".2", u3wfu__stage_play}, {}}; + static c3_c* _141_pen__ut_stage_play_ha[] = {0}; + static u3j_harm _141_pen__ut_stage_rest_a[] = {{".2", u3wfu__stage_rest}, {}}; + static c3_c* _141_pen__ut_stage_rest_ha[] = {0}; + static u3j_harm _141_pen__ut_stage_toss_a[] = {{".2", u3wfu__stage_toss}, {}}; + static c3_c* _141_pen__ut_stage_toss_ha[] = {0}; + static u3j_harm _141_pen__ut_stage_wrap_a[] = {{".2", u3wfu__stage_wrap}, {}}; + static c3_c* _141_pen__ut_stage_wrap_ha[] = {0}; + +static u3j_core _141_pen__stage_ut_d[] = + { + { "crop", 7, _141_pen__ut_stage_crop_a, 0, _141_pen__ut_stage_crop_ha }, + { "fond", 7, _141_pen__ut_stage_fond_a, 0, _141_pen__ut_stage_fond_ha }, + { "fire", 7, _141_pen__ut_stage_fire_a, 0, _141_pen__ut_stage_fire_ha }, + { "fish", 7, _141_pen__ut_stage_fish_a, 0, _141_pen__ut_stage_fish_ha }, + { "fuse", 7, _141_pen__ut_stage_fuse_a, 0, _141_pen__ut_stage_fuse_ha }, + { "mint", 7, _141_pen__ut_stage_mint_a, 0, _141_pen__ut_stage_mint_ha }, + { "mull", 7, _141_pen__ut_stage_mull_a, 0, _141_pen__ut_stage_mull_ha }, + { "nest", 7, _141_pen__ut_stage_nest_a, 0, _141_pen__ut_stage_nest_ha }, + { "peek", 7, _141_pen__ut_stage_peek_a, 0, _141_pen__ut_stage_peek_ha }, + { "play", 7, _141_pen__ut_stage_play_a, 0, _141_pen__ut_stage_play_ha }, + { "rest", 7, _141_pen__ut_stage_rest_a, 0, _141_pen__ut_stage_rest_ha }, + { "toss", 7, _141_pen__ut_stage_toss_a, 0, _141_pen__ut_stage_toss_ha }, + { "wrap", 7, _141_pen__ut_stage_wrap_a, 0, _141_pen__ut_stage_wrap_ha }, + {} + }; + +static u3j_harm _141_pen__stage_ut_a[] = + { {"repo", u3wfu_repo}, + {} + }; +static c3_c* _141_pen__stage_ut_ha[] = {0}; + +static u3j_hood _141_pen__stage_ut_ho[] = { + // %ar ar + { "fan", 28, c3n }, + { "rib", 58, c3n }, + { "vet", 118, c3n }, + { "fab", 119, c3n }, + + { "blow", 49131 }, + // %burp burp + { "busk", 0x5ff57 }, + { "buss", 94 }, + { "crop", 4 }, + { "duck", 48087 }, + { "dune", 1524 }, + { "dunk", 763 }, + { "epla", 12283 }, + { "emin", 5998 }, + { "emul", 86 }, + // %feel feel + { "felt", 24046 }, + { "fine", 3004 }, + { "fire", 700 }, + { "fish", 1498 }, + { "fond", 92 }, + { "fund", 1402 }, + { "funk", 0x1757c, c3y, 31 }, + { "fuse", 1534 }, + { "gain", 748 }, + { "lose", 22 }, + // %mile mile + // %mine mine + { "mint", 0x17fd4 }, + { "moot", 2807 }, + { "mull", 11995 }, + { "nest", 380 }, + { "peel", 5999 }, + { "play", 12022 }, + { "peek", 5996 }, + { "repo", 3050 }, + { "rest", 382 }, + { "tack", 351 }, + { "toss", 24042 }, + { "wrap", 6143 }, + {}, +}; + // XX figure out why this is disabled #if 0 static u3j_harm _141_pen__ap_a[] = @@ -347,13 +456,17 @@ static u3j_core _141_pen_d[] = { "flip", 7, _141_pen_flip_a, 0, _141_pen_flip_ha }, { "flor", 7, _141_pen_flor_a, 0, _141_pen_flor_ha }, { "fork", 7, _141_pen_fork_a, 0, _141_pen_fork_ha }, + { "stage-fork", 7, _141_pen_stage_fork_a, 0, _141_pen_stage_fork_ha }, // { "hike", 7, _141_pen_hike_a, 0, _141_pen_hike_ha }, { "look", 7, _141_pen_look_a, 0, _141_pen_look_ha }, + { "stage-look", 7, _141_pen_stage_look_a, 0, _141_pen_stage_look_ha }, { "loot", 7, _141_pen_loot_a, 0, _141_pen_loot_ha }, + { "stage-loot", 7, _141_pen_stage_loot_a, 0, _141_pen_stage_loot_ha }, // { "ap", 7, _141_pen__ap_a, 0, _141_pen__ap_ha }, // { "al", 7, _141_pen__al_a, 0, _141_pen__al_ha }, { "ut", 15, _141_pen__ut_a, _141_pen__ut_d, _141_pen__ut_ha, _141_pen__ut_ho }, + { "stage-ut", 15, _141_pen__stage_ut_a, _141_pen__stage_ut_d, _141_pen__stage_ut_ha, _141_pen__stage_ut_ho }, {} }; static c3_c* _141_pen_ha[] = {0}; @@ -852,6 +965,15 @@ static c3_c* _141_two_vor_ha[] = {0}; static u3j_harm _141_two_xeb_a[] = {{".2", u3wc_xeb, c3y}, {}}; static c3_c* _141_two_xeb_ha[] = {0}; +// mug staging +// +static u3j_harm _141_two_stage_gor_a[] = {{".2", u3wc__stage_gor, c3y}, {}}; +static c3_c* _141_two_stage_gor_ha[] = {0}; +static u3j_harm _141_two_stage_hor_a[] = {{".2", u3wc__stage_hor, c3y}, {}}; +static c3_c* _141_two_stage_hor_ha[] = {0}; +static u3j_harm _141_two_stage_vor_a[] = {{".2", u3wc__stage_vor, c3y}, {}}; +static c3_c* _141_two_stage_vor_ha[] = {0}; + static u3j_harm _141_two__in_bif_a[] = {{".2", u3wdi_bif}, {}}; static c3_c* _141_two__in_bif_ha[] = {0}; static u3j_harm _141_two__in_del_a[] = {{".2", u3wdi_del}, {}}; @@ -893,6 +1015,40 @@ static u3j_core _141_two__in_d[] = }; static c3_c* _141_two__in_ha[] = {0}; +// mug staging +// + + static u3j_harm _141_two__stage_in_bif_a[] = {{".2", u3wdi__stage_bif}, {}}; + static c3_c* _141_two__stage_in_bif_ha[] = {0}; + static u3j_harm _141_two__stage_in_del_a[] = {{".2", u3wdi__stage_del}, {}}; + static c3_c* _141_two__stage_in_del_ha[] = {0}; + static u3j_harm _141_two__stage_in_dif_a[] = {{".2", u3wdi__stage_dif}, {}}; + static c3_c* _141_two__stage_in_dif_ha[] = {0}; + static u3j_harm _141_two__stage_in_gas_a[] = {{".2", u3wdi__stage_gas}, {}}; + static c3_c* _141_two__stage_in_gas_ha[] = {0}; + static u3j_harm _141_two__stage_in_has_a[] = {{".2", u3wdi__stage_has}, {}}; + static c3_c* _141_two__stage_in_has_ha[] = {0}; + static u3j_harm _141_two__stage_in_mer_a[] = {{".2", u3wdi__stage_mer}, {}}; + static c3_c* _141_two__stage_in_mer_ha[] = {0}; + static u3j_harm _141_two__stage_in_put_a[] = {{".2", u3wdi__stage_put}, {}}; + static c3_c* _141_two__stage_in_put_ha[] = {0}; + static u3j_harm _141_two__stage_in_uni_a[] = {{".2", u3wdi__stage_uni}, {}}; + static c3_c* _141_two__stage_in_uni_ha[] = {0}; +static u3j_core _141_two__stage_in_d[] = + { { "bif", 7, _141_two__stage_in_bif_a, 0, _141_two__stage_in_bif_ha }, + { "del", 7, _141_two__stage_in_del_a, 0, _141_two__stage_in_del_ha }, + { "dif", 7, _141_two__stage_in_dif_a, 0, _141_two__stage_in_dif_ha }, + { "gas", 7, _141_two__stage_in_gas_a, 0, _141_two__stage_in_gas_ha }, + { "has", 7, _141_two__stage_in_has_a, 0, _141_two__stage_in_has_ha }, + { "mer", 7, _141_two__stage_in_mer_a, 0, _141_two__stage_in_mer_ha }, + { "put", 7, _141_two__stage_in_put_a, 0, _141_two__stage_in_put_ha }, + { "tap", 7, _141_two__in_tap_a, 0, _141_two__in_tap_ha }, + { "uni", 7, _141_two__stage_in_uni_a, 0, _141_two__stage_in_uni_ha }, + { "wyt", 7, _141_two__in_wyt_a, 0, _141_two__in_wyt_ha }, + {} + }; +static c3_c* _141_two__stage_in_ha[] = {0}; + static u3j_harm _141_two__by_bif_a[] = {{".2", u3wdb_bif, c3y}, {}}; static c3_c* _141_two__by_bif_ha[] = {0}; static u3j_harm _141_two__by_del_a[] = {{".2", u3wdb_del, c3y}, {}}; @@ -937,6 +1093,43 @@ static u3j_core _141_two__by_d[] = }; static c3_c* _141_two__by_ha[] = {0}; +// mug staging +// + + static u3j_harm _141_two__stage_by_bif_a[] = {{".2", u3wdb__stage_bif, c3y}, {}}; + static c3_c* _141_two__stage_by_bif_ha[] = {0}; + static u3j_harm _141_two__stage_by_del_a[] = {{".2", u3wdb__stage_del, c3y}, {}}; + static c3_c* _141_two__stage_by_del_ha[] = {0}; + static u3j_harm _141_two__stage_by_dif_a[] = {{".2", u3wdb__stage_dif, c3y}, {}}; + static c3_c* _141_two__stage_by_dif_ha[] = {0}; + static u3j_harm _141_two__stage_by_gas_a[] = {{".2", u3wdb__stage_gas, c3y}, {}}; + static c3_c* _141_two__stage_by_gas_ha[] = {0}; + static u3j_harm _141_two__stage_by_get_a[] = {{".2", u3wdb__stage_get, c3y}, {}}; + static c3_c* _141_two__stage_by_get_ha[] = {0}; + static u3j_harm _141_two__stage_by_has_a[] = {{".2", u3wdb__stage_has, c3y}, {}}; + static c3_c* _141_two__stage_by_has_ha[] = {0}; + + static u3j_harm _141_two__stage_by_jab_a[] = {{".2", u3wdb__stage_jab, c3y}, {}}; + static c3_c* _141_two__stage_by_jab_ha[] = {0}; + static u3j_harm _141_two__stage_by_put_a[] = {{".2", u3wdb__stage_put, c3y}, {}}; + static c3_c* _141_two__stage_by_put_ha[] = {0}; + static u3j_harm _141_two__stage_by_tap_a[] = {{".2", u3wdb__stage_tap, c3y}, {}}; + static c3_c* _141_two__stage_by_tap_ha[] = {0}; + +static u3j_core _141_two__stage_by_d[] = + { { "bif", 7, _141_two__stage_by_bif_a, 0, _141_two__stage_by_bif_ha }, + { "del", 7, _141_two__stage_by_del_a, 0, _141_two__stage_by_del_ha }, + { "dif", 7, _141_two__stage_by_dif_a, 0, _141_two__stage_by_dif_ha }, + { "gas", 7, _141_two__stage_by_gas_a, 0, _141_two__stage_by_gas_ha }, + { "get", 7, _141_two__stage_by_get_a, 0, _141_two__stage_by_get_ha }, + { "has", 7, _141_two__stage_by_has_a, 0, _141_two__stage_by_has_ha }, + { "jab", 7, _141_two__stage_by_jab_a, 0, _141_two__stage_by_jab_ha }, + { "put", 7, _141_two__stage_by_put_a, 0, _141_two__stage_by_put_ha }, + { "tap", 7, _141_two__stage_by_tap_a, 0, _141_two__stage_by_tap_ha }, + {} + }; +static c3_c* _141_two__stage_by_ha[] = {0}; + static u3j_harm _141_two_cue_a[] = {{".2", u3we_cue}, {}}; static c3_c* _141_two_cue_ha[] = {0}; static u3j_harm _141_two_jam_a[] = {{".2", u3we_jam}, {}}; @@ -980,7 +1173,9 @@ static u3j_core _141_two_d[] = { "dvr", 7, _141_two_dvr_a, 0, _141_two_dvr_ha }, { "end", 7, _141_two_end_a, 0, _141_two_end_ha }, { "gor", 7, _141_two_gor_a, 0, _141_two_gor_ha }, + { "stage-gor", 7, _141_two_stage_gor_a, 0, _141_two_stage_gor_ha }, { "hor", 7, _141_two_hor_a, 0, _141_two_hor_ha }, + { "stage-hor", 7, _141_two_stage_hor_a, 0, _141_two_stage_hor_ha }, { "jam", 7, _141_two_jam_a, 0, _141_two_jam_ha }, { "lsh", 7, _141_two_lsh_a, 0, _141_two_lsh_ha }, { "mas", 7, _141_two_mas_a, 0, _141_two_mas_ha }, @@ -1000,10 +1195,13 @@ static u3j_core _141_two_d[] = { "pow", 7, _141_two_pow_a, 0, _141_two_pow_ha }, { "sqt", 7, _141_two_sqt_a, 0, _141_two_sqt_ha }, { "vor", 7, _141_two_vor_a, 0, _141_two_vor_ha }, + { "stage-vor", 7, _141_two_stage_vor_a, 0, _141_two_stage_vor_ha }, { "xeb", 7, _141_two_xeb_a, 0, _141_two_xeb_ha }, { "by", 7, 0, _141_two__by_d, _141_two__by_ha }, + { "stage-by", 7, 0, _141_two__stage_by_d, _141_two__stage_by_ha }, { "in", 7, 0, _141_two__in_d, _141_two__in_ha }, + { "stage-in", 7, 0, _141_two__stage_in_d, _141_two__stage_in_ha }, {} }; static c3_c* _141_two_ha[] = {0}; diff --git a/meson.build b/meson.build index 0b0c35bd8..ec3776996 100644 --- a/meson.build +++ b/meson.build @@ -77,6 +77,10 @@ jets_c_src = [ 'jets/c/swp.c', 'jets/c/sqt.c', 'jets/c/vor.c', + +'jets/stage/c/gor.c', +'jets/stage/c/hor.c', +'jets/stage/c/vor.c', ] jets_d_src = [ @@ -100,7 +104,25 @@ jets_d_src = [ 'jets/d/by_put.c', 'jets/d/by_uni.c', 'jets/d/by_bif.c', -'jets/d/by_dif.c' +'jets/d/by_dif.c', + +'jets/stage/d/in_bif.c', +'jets/stage/d/in_del.c', +'jets/stage/d/in_dif.c', +'jets/stage/d/in_gas.c', +'jets/stage/d/in_has.c', +'jets/stage/d/in_mer.c', +'jets/stage/d/in_put.c', +'jets/stage/d/in_uni.c', + +'jets/stage/d/by_bif.c', +'jets/stage/d/by_del.c', +'jets/stage/d/by_dif.c', +'jets/stage/d/by_gas.c', +'jets/stage/d/by_get.c', +'jets/stage/d/by_has.c', +'jets/stage/d/by_jab.c', +'jets/stage/d/by_put.c', ] jets_e_src = [ @@ -155,7 +177,11 @@ jets_f_src = [ 'jets/f/hint.c', 'jets/f/hike.c', 'jets/f/look.c', -'jets/f/loot.c' +'jets/f/loot.c', + +'jets/stage/f/fork.c', +'jets/stage/f/look.c', +'jets/stage/f/loot.c' ] jets_f_ut_src = [ @@ -178,7 +204,28 @@ jets_f_ut_src = [ 'jets/f/ut_rest.c', 'jets/f/ut_tack.c', 'jets/f/ut_toss.c', -'jets/f/ut_wrap.c' +'jets/f/ut_wrap.c', + +'jets/stage/f/ut.c', +'jets/stage/f/ut_buss.c', +'jets/stage/f/ut_crop.c', +'jets/stage/f/ut_find.c', +'jets/stage/f/ut_fire.c', +'jets/stage/f/ut_fish.c', +'jets/stage/f/ut_fuse.c', +'jets/stage/f/ut_gain.c', +'jets/stage/f/ut_lose.c', +'jets/stage/f/ut_mint.c', +'jets/stage/f/ut_mull.c', +'jets/stage/f/ut_nest.c', +'jets/stage/f/ut_peek.c', +'jets/stage/f/ut_peel.c', +'jets/stage/f/ut_play.c', +'jets/stage/f/ut_repo.c', +'jets/stage/f/ut_rest.c', +'jets/stage/f/ut_tack.c', +'jets/stage/f/ut_toss.c', +'jets/stage/f/ut_wrap.c', ] jets_src = [ From cd96ad658d3f15bab0dbc05a300bd76ac05f4198 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Thu, 3 Jan 2019 00:20:48 -0500 Subject: [PATCH 11/78] adds temporary gum_w hash slot to u3_noun --- include/noun/allocate.h | 7 +++++-- noun/allocate.c | 3 +++ noun/imprison.c | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/include/noun/allocate.h b/include/noun/allocate.h index 32a8e8d37..fbf5dca21 100644 --- a/include/noun/allocate.h +++ b/include/noun/allocate.h @@ -27,9 +27,9 @@ /* u3a_minimum: minimum number of words in a box. */ #ifdef U3_MEMORY_DEBUG -# define u3a_minimum 8 +# define u3a_minimum 9 #else -# define u3a_minimum 6 +# define u3a_minimum 7 #endif /* u3a_fbox_no: number of free lists per size. @@ -43,16 +43,19 @@ */ typedef struct { c3_w mug_w; + c3_w gum_w; } u3a_noun; typedef struct { c3_w mug_w; + c3_w gum_w; c3_w len_w; c3_w buf_w[0]; } u3a_atom; typedef struct { c3_w mug_w; + c3_w gum_w; u3_noun hed; u3_noun tel; } u3a_cell; diff --git a/noun/allocate.c b/noun/allocate.c index 7f2272439..b2f6c5259 100644 --- a/noun/allocate.c +++ b/noun/allocate.c @@ -904,6 +904,7 @@ _me_wash_north(u3_noun dog) if ( dog_u->mug_w == 0 ) return; dog_u->mug_w = 0; // power wash + dog_u->gum_w = 0; // if ( dog_u->mug_w >> 31 ) { dog_u->mug_w = 0; } if ( _(u3a_is_pom(dog)) ) { @@ -937,6 +938,7 @@ _me_wash_south(u3_noun dog) if ( dog_u->mug_w == 0 ) return; dog_u->mug_w = 0; // power wash + dog_u->gum_w = 0; // if ( dog_u->mug_w >> 31 ) { dog_u->mug_w = 0; } if ( _(u3a_is_pom(dog)) ) { @@ -1828,6 +1830,7 @@ u3a_slab(c3_w len_w) u3a_atom* pug_u = (void *)nov_w; pug_u->mug_w = 0; + pug_u->gum_w = 0; pug_u->len_w = len_w; /* Clear teh slab. diff --git a/noun/imprison.c b/noun/imprison.c index 13ba89cc5..5c78a21af 100644 --- a/noun/imprison.c +++ b/noun/imprison.c @@ -33,6 +33,7 @@ u3i_words(c3_w a_w, u3a_atom* nov_u = (void*)nov_w; nov_u->mug_w = 0; + nov_u->gum_w = 0; nov_u->len_w = a_w; /* Fill the words. @@ -111,6 +112,7 @@ u3i_bytes(c3_w a_w, u3a_atom* nov_u = (void*)nov_w; nov_u->mug_w = 0; + nov_u->gum_w = 0; nov_u->len_w = len_w; /* Clear the words. @@ -212,6 +214,7 @@ u3i_cell(u3_noun a, u3_noun b) u3_noun pro; nov_u->mug_w = 0; + nov_u->gum_w = 0; nov_u->hed = a; nov_u->tel = b; From de3dcee7d5b00d11a0fe041e3a01f67de7c3ff1e Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Thu, 3 Jan 2019 00:21:19 -0500 Subject: [PATCH 12/78] memoize u3r_mur in temporary gum_w --- noun/retrieve.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/noun/retrieve.c b/noun/retrieve.c index 6b65f55cc..c47dc3ffc 100644 --- a/noun/retrieve.c +++ b/noun/retrieve.c @@ -1779,9 +1779,9 @@ u3r_mur(u3_noun veb) u3a_noun* veb_u = u3a_to_ptr(veb); - // if ( veb_u->mug_w ) { - // return veb_u->mug_w; - // } + if ( veb_u->gum_w ) { + return veb_u->gum_w; + } if ( _(u3a_is_cell(veb)) ) { mur_w = u3r_mur_cell(u3h(veb), u3t(veb)); @@ -1793,7 +1793,7 @@ u3r_mur(u3_noun veb) mur_w = u3r_mur_bytes((c3_y*)vat_u->buf_w, len_w); } - // veb_u->mug_w = mur_w; + veb_u->gum_w = mur_w; return mur_w; } From e1796673239421bfd36b8471af5736536888767b Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Wed, 2 Jan 2019 14:12:14 -0500 Subject: [PATCH 13/78] jets u3r_mur --- include/jets/w.h | 1 + jets/c/mur.c | 19 +++++++++++++++++++ jets/tree.c | 3 +++ meson.build | 1 + 4 files changed, 24 insertions(+) create mode 100644 jets/c/mur.c diff --git a/include/jets/w.h b/include/jets/w.h index 81da94705..5d79565de 100644 --- a/include/jets/w.h +++ b/include/jets/w.h @@ -60,6 +60,7 @@ u3_noun u3wc_mix(u3_noun); u3_noun u3wc_mug(u3_noun); u3_noun u3wc_muk(u3_noun); + u3_noun u3wc_mur(u3_noun); u3_noun u3wc_peg(u3_noun); u3_noun u3wc_pow(u3_noun); u3_noun u3wc_rap(u3_noun); diff --git a/jets/c/mur.c b/jets/c/mur.c new file mode 100644 index 000000000..8b994f969 --- /dev/null +++ b/jets/c/mur.c @@ -0,0 +1,19 @@ +/* j/3/mur.c +** +*/ +#include "all.h" + + +/* functions +*/ + u3_noun + u3wc_mur(u3_noun cor) + { + u3_noun sam; + + if ( u3_none == (sam = u3r_at(u3x_sam, cor)) ) { + return u3m_bail(c3__exit); + } else { + return u3r_mur(sam); + } + } diff --git a/jets/tree.c b/jets/tree.c index bc9182027..d837c6b12 100644 --- a/jets/tree.c +++ b/jets/tree.c @@ -942,6 +942,8 @@ static u3j_harm _141_two_mug_a[] = {{".2", u3wc_mug, c3y}, {}}; static c3_c* _141_two_mug_ha[] = {0}; static u3j_harm _141_two_muk_a[] = {{".2", u3wc_muk, c3y}, {}}; static c3_c* _141_two_muk_ha[] = {0}; +static u3j_harm _141_two_mur_a[] = {{".2", u3wc_mur, c3y}, {}}; +static c3_c* _141_two_mur_ha[] = {0}; static u3j_harm _141_two_peg_a[] = {{".2", u3wc_peg, c3y}, {}}; static c3_c* _141_two_peg_ha[] = {0}; static u3j_harm _141_two_pow_a[] = {{".2", u3wc_pow, c3y}, {}}; @@ -1184,6 +1186,7 @@ static u3j_core _141_two_d[] = { "mix", 7, _141_two_mix_a, 0, _141_two_mix_ha }, { "mug", 7, _141_two_mug_a, 0, _141_two_mug_ha }, { "muk", 59, _141_two_muk_a, 0, _141_two_muk_ha }, + { "mur", 7, _141_two_mur_a, 0, _141_two_mur_ha }, { "rap", 7, _141_two_rap_a, 0, _141_two_rap_ha }, { "rep", 7, _141_two_rep_a, 0, _141_two_rep_ha }, { "rev", 7, _141_two_rev_a, 0, _141_two_rev_ha }, diff --git a/meson.build b/meson.build index ec3776996..3f4522a75 100644 --- a/meson.build +++ b/meson.build @@ -66,6 +66,7 @@ jets_c_src = [ 'jets/c/mix.c', 'jets/c/mug.c', 'jets/c/muk.c', +'jets/c/mur.c', 'jets/c/peg.c', 'jets/c/po.c', 'jets/c/pow.c', From aa3566a6425a7705d08b379bb4976ffea4eee647 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Mon, 7 Jan 2019 23:08:57 -0500 Subject: [PATCH 14/78] sets u3r__stage_mug to point to u3r_mur --- include/noun/retrieve.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/noun/retrieve.h b/include/noun/retrieve.h index a430bfb42..1dd432de5 100644 --- a/include/noun/retrieve.h +++ b/include/noun/retrieve.h @@ -32,7 +32,7 @@ c3_o u3r_mean(u3_noun a, ...); -#define u3r__stage_mug u3r_mug +#define u3r__stage_mug u3r_mur /* u3r_mug(): ** From ce7eb6ffcbac37fc8ce6e0e299ad65d08d33d7c3 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 8 Jan 2019 17:53:48 -0500 Subject: [PATCH 15/78] sets u3qc__stage_hor to point to u3qc__stage_gor --- include/jets/q.h | 2 +- include/jets/w.h | 2 +- jets/stage/c/hor.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/jets/q.h b/include/jets/q.h index 5ccd3368a..a20452da1 100644 --- a/include/jets/q.h +++ b/include/jets/q.h @@ -72,7 +72,7 @@ u3_noun u3qc_vor(u3_atom, u3_atom); u3_noun u3qc__stage_gor(u3_atom, u3_atom); - u3_noun u3qc__stage_hor(u3_atom, u3_atom); +# define u3qc__stage_hor u3qc__stage_gor u3_noun u3qc__stage_vor(u3_atom, u3_atom); /** Tier 4. diff --git a/include/jets/w.h b/include/jets/w.h index 5d79565de..16c438e5c 100644 --- a/include/jets/w.h +++ b/include/jets/w.h @@ -73,7 +73,7 @@ u3_noun u3wc_vor(u3_noun); u3_noun u3wc__stage_gor(u3_noun); - u3_noun u3wc__stage_hor(u3_noun); +# define u3wc__stage_hor u3wc__stage_gor u3_noun u3wc__stage_vor(u3_noun); u3_noun u3wcp_ins(u3_noun); diff --git a/jets/stage/c/hor.c b/jets/stage/c/hor.c index 69e68fb5d..8180f2b02 100644 --- a/jets/stage/c/hor.c +++ b/jets/stage/c/hor.c @@ -7,7 +7,7 @@ /* functions */ u3_noun - u3qc__stage_hor(u3_noun a, + u3qc__disabled__stage_hor(u3_noun a, u3_noun b) { if ( c3y == u3ud(a) ) { @@ -33,7 +33,7 @@ } } u3_noun - u3wc__stage_hor(u3_noun cor) + u3wc__disabled__stage_hor(u3_noun cor) { u3_noun a, b; From 1d1a259f31c2512a0741e31f7e8f66c0ed14aba7 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Mon, 7 Jan 2019 23:26:11 -0500 Subject: [PATCH 16/78] removes old u3r_mug*, switches u3r_mur* to u3r_mug* --- include/noun/retrieve.h | 77 +-------- jets/c/mur.c | 2 +- noun/retrieve.c | 336 +++++----------------------------------- tests/hash_tests.c | 22 +-- 4 files changed, 56 insertions(+), 381 deletions(-) diff --git a/include/noun/retrieve.h b/include/noun/retrieve.h index 1dd432de5..0a7be687d 100644 --- a/include/noun/retrieve.h +++ b/include/noun/retrieve.h @@ -32,7 +32,7 @@ c3_o u3r_mean(u3_noun a, ...); -#define u3r__stage_mug u3r_mur +#define u3r__stage_mug u3r_mug /* u3r_mug(): ** @@ -433,78 +433,3 @@ */ c3_y* u3r_tape(u3_noun a); - - // XX temporary - // - - /* u3r_mur(): - ** - ** Compute and/or recall the mug (31-bit hash) of (a). - */ - c3_w - u3r_mur(u3_noun a); - - /* u3r_mur_string(): - ** - ** Compute the mug of `a`, LSB first. - */ - c3_w - u3r_mur_string(const c3_c *a_c); - - /* u3r_mur_words(): - ** - ** Compute the mug of `buf`, `len`, LSW first. - */ - c3_w - u3r_mur_words(const c3_w *buf_w, - c3_w len_w); - - /* u3r_mur_d(): - ** - ** Compute the mug of `num`, LSW first. - */ - c3_w - u3r_mur_d(c3_d num_d); - - /* u3r_mur_bytes(): - ** - ** Compute the mug of `buf`, `len`, LSW first. - */ - c3_w - u3r_mur_bytes(const c3_y *buf_w, - c3_w len_w); - - /* u3r_mur_cell(): - ** - ** Compute the mug of `[a b]`. - */ - c3_w - u3r_mur_cell(u3_noun a, - u3_noun b); - - /* u3r_mur_trel(): - ** - ** Compute the mug of `[a b c]`. - */ - c3_w - u3r_mur_trel(u3_noun a, - u3_noun b, - u3_noun c); - - /* u3r_mur_qual(): - ** - ** Compute the mug of `[a b c d]`. - */ - c3_w - u3r_mur_qual(u3_noun a, - u3_noun b, - u3_noun c, - u3_noun d); - - /* u3r_mur_both(): - ** - ** Join two mugs. - */ - c3_w - u3r_mur_both(c3_w a_w, - c3_w b_w); \ No newline at end of file diff --git a/jets/c/mur.c b/jets/c/mur.c index 8b994f969..924b333ed 100644 --- a/jets/c/mur.c +++ b/jets/c/mur.c @@ -14,6 +14,6 @@ if ( u3_none == (sam = u3r_at(u3x_sam, cor)) ) { return u3m_bail(c3__exit); } else { - return u3r_mur(sam); + return u3r_mug(sam); } } diff --git a/noun/retrieve.c b/noun/retrieve.c index c47dc3ffc..3ba3bc06b 100644 --- a/noun/retrieve.c +++ b/noun/retrieve.c @@ -208,256 +208,6 @@ u3r_mean(u3_noun som, return _mean_extract(som, len_w, prs_m); } -static __inline__ c3_w -_mug_fnv(c3_w has_w) -{ - return (has_w * ((c3_w)16777619)); -} - -static __inline__ c3_w -_mug_out(c3_w has_w) -{ - return (has_w >> 31) ^ (has_w & 0x7fffffff); -} - -static __inline__ c3_w -_mug_both(c3_w lef_w, c3_w rit_w) -{ - c3_w bot_w = _mug_fnv(lef_w ^ _mug_fnv(rit_w)); - c3_w out_w = _mug_out(bot_w); - - if ( 0 != out_w ) { - return out_w; - } - else { - return _mug_both(lef_w, ++rit_w); - } -} - -/* u3r_mug_both(): -** -** Join two mugs. -*/ -c3_w -u3r_mug_both(c3_w lef_w, c3_w rit_w) -{ - return _mug_both(lef_w, rit_w); -} - -static __inline__ c3_w -_mug_bytes_in(c3_w off_w, c3_w nby_w, const c3_y* byt_y) -{ - c3_w i_w; - - for ( i_w = 0; i_w < nby_w; i_w++ ) { - off_w = _mug_fnv(off_w ^ byt_y[i_w]); - } - return off_w; -} - -static c3_w -_mug_bytes(c3_w off_w, c3_w nby_w, const c3_y* byt_y) -{ - c3_w has_w = _mug_bytes_in(off_w, nby_w, byt_y); - c3_w out_w = _mug_out(has_w); - - if ( 0 != out_w ) { - return out_w; - } - else { - return _mug_bytes(++off_w, nby_w, byt_y); - } -} - -static __inline__ c3_w -_mug_words_in(c3_w off_w, c3_w nwd_w, const c3_w* wod_w) -{ - if ( 0 == nwd_w ) { - return off_w; - } else { - c3_w i_w, x_w; - - for ( i_w = 0; i_w < (nwd_w - 1); i_w++ ) { - x_w = wod_w[i_w]; - { - c3_y a_y = (x_w & 0xff); - c3_y b_y = ((x_w >> 8) & 0xff); - c3_y c_y = ((x_w >> 16) & 0xff); - c3_y d_y = ((x_w >> 24) & 0xff); - - off_w = _mug_fnv(off_w ^ a_y); - off_w = _mug_fnv(off_w ^ b_y); - off_w = _mug_fnv(off_w ^ c_y); - off_w = _mug_fnv(off_w ^ d_y); - } - } - x_w = wod_w[nwd_w - 1]; - - if ( x_w ) { - off_w = _mug_fnv(off_w ^ (x_w & 0xff)); - x_w >>= 8; - - if ( x_w ) { - off_w = _mug_fnv(off_w ^ (x_w & 0xff)); - x_w >>= 8; - - if ( x_w ) { - off_w = _mug_fnv(off_w ^ (x_w & 0xff)); - x_w >>= 8; - - if ( x_w ) { - off_w = _mug_fnv(off_w ^ (x_w & 0xff)); - } - } - } - } - } - return off_w; -} - -static c3_w -_mug_words(c3_w off_w, c3_w nwd_w, const c3_w* wod_w) -{ - c3_w has_w = _mug_words_in(off_w, nwd_w, wod_w); - c3_w out_w = _mug_out(has_w); - - if ( 0 != out_w ) { - return out_w; - } - else { - return _mug_words(++off_w, nwd_w, wod_w); - } -} - -/* u3r_mug(): -** -** Compute and/or recall the mug (31-bit FNV1a hash) of (a). -*/ -c3_w -u3r_mug(u3_noun veb) -{ - c3_assert(u3_none != veb); - - if ( _(u3a_is_cat(veb)) ) { - c3_w x_w = veb; - - return _mug_words(2166136261U, (veb ? 1 : 0), &x_w); - } else { - u3a_noun* veb_u = u3a_to_ptr(veb); - - if ( veb_u->mug_w ) { - return veb_u->mug_w; - } - else { - if ( _(u3a_is_cell(veb)) ) { - u3a_cell* veb_u = u3a_to_ptr(veb); - u3_noun hed = veb_u->hed; - u3_noun tel = veb_u->tel; - - veb_u->mug_w = u3r_mug_cell(hed, tel); - return veb_u->mug_w; - } - else { - u3a_atom* veb_u = u3a_to_ptr(veb); - c3_w len_w = veb_u->len_w; - - veb_u->mug_w = _mug_words(2166136261U, len_w, veb_u->buf_w); - return veb_u->mug_w; - } - } - } -} - -/* u3r_mug_words(): -** -** Compute the mug of `buf`, `len`, LSW first. -*/ -c3_w -u3r_mug_words(const c3_w *buf_w, - c3_w len_w) -{ - return _mug_words(2166136261U, len_w, buf_w); -} - -/* u3r_mug_d(): -** -** Compute the mug of `num`, LSW first. -*/ -c3_w -u3r_mug_d(c3_d num_d) -{ - c3_w buf_w[2]; - - buf_w[0] = (c3_w)(num_d & 0xffffffffULL); - buf_w[1] = (c3_w)(num_d >> 32ULL); - - return u3r_mug_words(buf_w, 2); -} - -/* u3r_mug_bytes(): -** -** Compute the mug of `buf`, `len`, LSW first. -*/ -c3_w -u3r_mug_bytes(const c3_y *buf_w, - c3_w len_w) -{ - return _mug_bytes(2166136261U, len_w, buf_w); -} - -/* u3r_mug_string(): -** -** Compute the mug of `a`, LSB first. -*/ -c3_w -u3r_mug_string(const c3_c *a_c) -{ - return _mug_bytes(2166136261U, strlen(a_c), (c3_y *)a_c); -} - -/* u3r_mug_cell(): -** -** Compute the mug of the cell `[hed tel]`. -*/ -c3_w -u3r_mug_cell(u3_noun hed, - u3_noun tel) -{ - c3_w lus_w = u3r_mug(hed); - c3_w biq_w = u3r_mug(tel); - - return u3r_mug_both(lus_w, biq_w); -} - -/* u3r_mug_trel(): -** -** Compute the mug of `[a b c]`. -*/ -c3_w -u3r_mug_trel(u3_noun a, - u3_noun b, - u3_noun c) -{ - return u3r_mug_both - (u3r_mug(a), u3r_mug_both(u3r_mug(b), u3r_mug(c))); -} - -/* u3r_mug_qual(): -** -** Compute the mug of `[a b c d]`. -*/ -c3_w -u3r_mug_qual(u3_noun a, - u3_noun b, - u3_noun c, - u3_noun d) -{ - return u3r_mug_both - (u3r_mug(a), - u3r_mug_both(u3r_mug(b), - u3r_mug_both(u3r_mug(c), u3r_mug(d)))); -} - /* _sang_one(): unify but leak old. */ static void @@ -1711,20 +1461,20 @@ u3r_tape(u3_noun a) return a_y; } -/* u3r_mur_words(): 31-bit nonzero MurmurHash3 on raw words. +/* u3r_mug_words(): 31-bit nonzero MurmurHash3 on raw words. */ c3_w -u3r_mur_words(const c3_w* key_w, c3_w len_w) +u3r_mug_words(const c3_w* key_w, c3_w len_w) { - return u3r_mur_bytes((c3_y*)key_w, 4 * len_w); + return u3r_mug_bytes((c3_y*)key_w, 4 * len_w); } -/* u3r_mur_bytes(): +/* u3r_mug_bytes(): ** ** Compute the mug of `buf`, `len`, LSW first. */ c3_w -u3r_mur_bytes(const c3_y *buf_y, +u3r_mug_bytes(const c3_y *buf_y, c3_w len_w) { c3_w syd_w = 0xcafebabe; @@ -1740,112 +1490,112 @@ u3r_mur_bytes(const c3_y *buf_y, return ham_w; } -/* u3r_mur_d(): +/* u3r_mug_d(): ** ** Compute the mug of `num`, LSW first. -** XX rename to u3r_mur_chub +** XX rename to u3r_mug_chub */ c3_w -u3r_mur_d(c3_d num_d) +u3r_mug_d(c3_d num_d) { - return u3r_mur_bytes((c3_y*)&num_d, 8); + return u3r_mug_bytes((c3_y*)&num_d, 8); } -/* u3r_mur_both(): +/* u3r_mug_both(): ** -** Join two murs. +** Join two mugs. */ c3_w -u3r_mur_both(c3_w lef_w, c3_w rit_w) +u3r_mug_both(c3_w lef_w, c3_w rit_w) { c3_w ham_w = lef_w ^ (0x7fffffff ^ rit_w); - return u3r_mur_words(&ham_w, (0 == ham_w) ? 0 : 1); + return u3r_mug_words(&ham_w, (0 == ham_w) ? 0 : 1); } -/* u3r_mur(): MurmurHash3 on a noun. +/* u3r_mug(): MurmurHash3 on a noun. */ c3_w -u3r_mur(u3_noun veb) +u3r_mug(u3_noun veb) { c3_assert(u3_none != veb); if ( _(u3a_is_cat(veb)) ) { c3_w len_w = u3r_met(3, veb); - return u3r_mur_bytes((c3_y*)&veb, len_w); + return u3r_mug_bytes((c3_y*)&veb, len_w); } else { - c3_w mur_w; + c3_w mug_w; u3a_noun* veb_u = u3a_to_ptr(veb); - if ( veb_u->gum_w ) { - return veb_u->gum_w; + if ( veb_u->mug_w ) { + return veb_u->mug_w; } if ( _(u3a_is_cell(veb)) ) { - mur_w = u3r_mur_cell(u3h(veb), u3t(veb)); + mug_w = u3r_mug_cell(u3h(veb), u3t(veb)); } else { u3a_atom* vat_u = (u3a_atom*)veb_u; c3_w len_w = u3r_met(3, veb); - mur_w = u3r_mur_bytes((c3_y*)vat_u->buf_w, len_w); + mug_w = u3r_mug_bytes((c3_y*)vat_u->buf_w, len_w); } - veb_u->gum_w = mur_w; + veb_u->mug_w = mug_w; - return mur_w; + return mug_w; } } -/* u3r_mur_string(): +/* u3r_mug_string(): ** -** Compute the mur of `a`, LSB first. +** Compute the mug of `a`, LSB first. */ c3_w -u3r_mur_string(const c3_c *a_c) +u3r_mug_string(const c3_c *a_c) { - return u3r_mur_bytes((c3_y*)a_c, strlen(a_c)); + return u3r_mug_bytes((c3_y*)a_c, strlen(a_c)); } -/* u3r_mur_cell(): +/* u3r_mug_cell(): ** -** Compute the mur of the cell `[hed tel]`. +** Compute the mug of the cell `[hed tel]`. */ c3_w -u3r_mur_cell(u3_noun hed, +u3r_mug_cell(u3_noun hed, u3_noun tel) { - c3_w lus_w = u3r_mur(hed); - c3_w biq_w = u3r_mur(tel); + c3_w lus_w = u3r_mug(hed); + c3_w biq_w = u3r_mug(tel); - return u3r_mur_both(lus_w, biq_w); + return u3r_mug_both(lus_w, biq_w); } -/* u3r_mur_trel(): +/* u3r_mug_trel(): ** -** Compute the mur of `[a b c]`. +** Compute the mug of `[a b c]`. */ c3_w -u3r_mur_trel(u3_noun a, +u3r_mug_trel(u3_noun a, u3_noun b, u3_noun c) { - return u3r_mur_both(u3r_mur(a), u3r_mur_both(u3r_mur(b), u3r_mur(c))); + return u3r_mug_both(u3r_mug(a), u3r_mug_both(u3r_mug(b), u3r_mug(c))); } -/* u3r_mur_qual(): +/* u3r_mug_qual(): ** -** Compute the mur of `[a b c d]`. +** Compute the mug of `[a b c d]`. */ c3_w -u3r_mur_qual(u3_noun a, +u3r_mug_qual(u3_noun a, u3_noun b, u3_noun c, u3_noun d) { - return u3r_mur_both(u3r_mur(a), - u3r_mur_both(u3r_mur(b), - u3r_mur_both(u3r_mur(c), u3r_mur(d)))); + return u3r_mug_both(u3r_mug(a), + u3r_mug_both(u3r_mug(b), + u3r_mug_both(u3r_mug(c), u3r_mug(d)))); } diff --git a/tests/hash_tests.c b/tests/hash_tests.c index 6a11795ee..a9bad5654 100644 --- a/tests/hash_tests.c +++ b/tests/hash_tests.c @@ -9,47 +9,47 @@ _setup(void) u3m_pave(c3y, c3n); } -/* _test_mur(): spot check u3r_mur hashes. +/* _test_mug(): spot check u3r_mug hashes. */ static void -_test_mur(void) +_test_mug(void) { - if ( 0x4d441035 != u3r_mur_string("Hello, world!") ) { + if ( 0x4d441035 != u3r_mug_string("Hello, world!") ) { fprintf(stderr, "fail\r\n"); exit(1); } - if ( 0x4d441035 != u3r_mur(u3i_string("Hello, world!")) ) { + if ( 0x4d441035 != u3r_mug(u3i_string("Hello, world!")) ) { fprintf(stderr, "fail\r\n"); exit(1); } - if ( 0x79ff04e8 != u3r_mur_bytes(0, 0) ) { + if ( 0x79ff04e8 != u3r_mug_bytes(0, 0) ) { fprintf(stderr, "fail\r\n"); exit(1); } - if ( 0x64dfda5c != u3r_mur(u3i_string("xxxxxxxxxxxxxxxxxxxxxxxxxxxx")) ) { + if ( 0x64dfda5c != u3r_mug(u3i_string("xxxxxxxxxxxxxxxxxxxxxxxxxxxx")) ) { fprintf(stderr, "fail\r\n"); exit(1); } - if ( 0x389ca03a != u3r_mur_cell(0, 0) ) { + if ( 0x389ca03a != u3r_mug_cell(0, 0) ) { fprintf(stderr, "fail\r\n"); exit(1); } - if ( 0x389ca03a != u3r_mur_cell(1, 1) ) { + if ( 0x389ca03a != u3r_mug_cell(1, 1) ) { fprintf(stderr, "fail\r\n"); exit(1); } - if ( 0x5258a6c0 != u3r_mur_cell(0, u3qc_bex(32)) ) { + if ( 0x5258a6c0 != u3r_mug_cell(0, u3qc_bex(32)) ) { fprintf(stderr, "fail\r\n"); exit(1); } - if ( 0x2ad39968 != u3r_mur_cell(u3qa_dec(u3qc_bex(128)), 1) ) { + if ( 0x2ad39968 != u3r_mug_cell(u3qa_dec(u3qc_bex(128)), 1) ) { fprintf(stderr, "fail\r\n"); exit(1); } @@ -62,7 +62,7 @@ main(int argc, char* argv[]) { _setup(); - _test_mur(); + _test_mug(); return 0; } From bad60672e4c4347172d2fd8b90e1c2799f657085 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 8 Jan 2019 18:15:39 -0500 Subject: [PATCH 17/78] removes +hor jet, sets *_hor to point to *_gor --- include/jets/q.h | 2 +- include/jets/w.h | 2 +- jets/c/hor.c | 46 ---------------------------------------------- meson.build | 1 - 4 files changed, 2 insertions(+), 49 deletions(-) delete mode 100644 jets/c/hor.c diff --git a/include/jets/q.h b/include/jets/q.h index a20452da1..5b9aaa479 100644 --- a/include/jets/q.h +++ b/include/jets/q.h @@ -54,7 +54,7 @@ u3_noun u3qc_dvr(u3_atom, u3_atom); u3_noun u3qc_end(u3_atom, u3_atom, u3_atom); u3_noun u3qc_gor(u3_atom, u3_atom); - u3_noun u3qc_hor(u3_atom, u3_atom); +# define u3qc_hor u3qc_gor u3_noun u3qc_lsh(u3_atom, u3_atom, u3_atom); u3_noun u3qc_mas(u3_atom); u3_noun u3qc_met(u3_atom, u3_atom); diff --git a/include/jets/w.h b/include/jets/w.h index 16c438e5c..be1014f27 100644 --- a/include/jets/w.h +++ b/include/jets/w.h @@ -53,7 +53,7 @@ u3_noun u3wc_dvr(u3_noun); u3_noun u3wc_end(u3_noun); u3_noun u3wc_gor(u3_noun); - u3_noun u3wc_hor(u3_noun); +# define u3wc_hor u3wc_gor u3_noun u3wc_lsh(u3_noun); u3_noun u3wc_mas(u3_noun); u3_noun u3wc_met(u3_noun); diff --git a/jets/c/hor.c b/jets/c/hor.c deleted file mode 100644 index 052c53b82..000000000 --- a/jets/c/hor.c +++ /dev/null @@ -1,46 +0,0 @@ -/* j/3/hor.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3qc_hor(u3_noun a, - u3_noun b) - { - if ( c3y == u3ud(a) ) { - if ( c3y == u3ud(b) ) { - return u3qc_gor(a, b); - } else { - return c3y; - } - } else { - if ( c3y == u3ud(b) ) { - return c3n; - } - else { - u3_noun h_a = u3h(a); - u3_noun h_b = u3h(b); - - if ( c3y == u3r_sing(h_a, h_b) ) { - return u3qc_gor(u3t(a), u3t(b)); - } else { - return u3qc_gor(h_a, h_b); - } - } - } - } - u3_noun - u3wc_hor(u3_noun cor) - { - u3_noun a, b; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) ) { - return u3m_bail(c3__exit); - } else { - return u3qc_hor(a, b); - } - } - diff --git a/meson.build b/meson.build index 3f4522a75..84adab162 100644 --- a/meson.build +++ b/meson.build @@ -59,7 +59,6 @@ jets_c_src = [ 'jets/c/dis.c', 'jets/c/end.c', 'jets/c/gor.c', -'jets/c/hor.c', 'jets/c/lsh.c', 'jets/c/mas.c', 'jets/c/met.c', From 421781652d9bc3e0282ec0f9e8b0741b9e792393 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Mon, 7 Jan 2019 23:26:25 -0500 Subject: [PATCH 18/78] updates arvo interface to use new axes --- noun/vortex.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/noun/vortex.c b/noun/vortex.c index c40fd3fcf..b9a1cc5d4 100644 --- a/noun/vortex.c +++ b/noun/vortex.c @@ -4,9 +4,9 @@ #include #include "all.h" -#define _CVX_WISH 4 -#define _CVX_POKE 10 -#define _CVX_PEEK 47 +#define _CVX_WISH 22 +#define _CVX_POKE 47 +#define _CVX_PEEK 46 int WISH; /* _cv_nock_wish(): call wish through hardcoded interface. From 8fe90875cdbe1b61c51fa72f68a889ac701f0c86 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 8 Jan 2019 20:13:27 -0500 Subject: [PATCH 19/78] replaces calls to u3qc_hor with u3qc_gor --- include/jets/q.h | 1 - jets/d/in_bif.c | 2 +- jets/d/in_del.c | 2 +- jets/d/in_has.c | 2 +- jets/d/in_int.c | 2 +- jets/d/in_mer.c | 2 +- jets/d/in_put.c | 2 +- jets/d/in_uni.c | 4 ++-- 8 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/jets/q.h b/include/jets/q.h index 5b9aaa479..405259dea 100644 --- a/include/jets/q.h +++ b/include/jets/q.h @@ -54,7 +54,6 @@ u3_noun u3qc_dvr(u3_atom, u3_atom); u3_noun u3qc_end(u3_atom, u3_atom, u3_atom); u3_noun u3qc_gor(u3_atom, u3_atom); -# define u3qc_hor u3qc_gor u3_noun u3qc_lsh(u3_atom, u3_atom, u3_atom); u3_noun u3qc_mas(u3_atom); u3_noun u3qc_met(u3_atom, u3_atom); diff --git a/jets/d/in_bif.c b/jets/d/in_bif.c index 4c5bdbeb9..5d93cc9d2 100644 --- a/jets/d/in_bif.c +++ b/jets/d/in_bif.c @@ -25,7 +25,7 @@ u3_noun c, n_c, l_c, r_c; u3_noun d; - if ( c3y == u3qc_hor(b, n_a) ) { + if ( c3y == u3qc_gor(b, n_a) ) { c = _i_bif_putroot(l_a, b); u3r_trel(c, &n_c, &l_c, &r_c); d = u3nt(u3k(n_c), diff --git a/jets/d/in_del.c b/jets/d/in_del.c index 02390ccce..17451ad69 100644 --- a/jets/d/in_del.c +++ b/jets/d/in_del.c @@ -72,7 +72,7 @@ return u3m_bail(c3__exit); } else if ( c3n == u3r_sing(n_a, b) ) { - if ( c3y == u3qc_hor(b, n_a) ) { + if ( c3y == u3qc_gor(b, n_a) ) { return u3nt(u3k(n_a), u3qdi_del(l_a, b), u3k(r_a)); diff --git a/jets/d/in_has.c b/jets/d/in_has.c index fb142bc74..c794e2bad 100644 --- a/jets/d/in_has.c +++ b/jets/d/in_has.c @@ -24,7 +24,7 @@ return c3y; } else { - if ( c3y == u3qc_hor(b, n_a) ) { + if ( c3y == u3qc_gor(b, n_a) ) { return u3qdi_has(l_a, b); } else return u3qdi_has(r_a, b); diff --git a/jets/d/in_int.c b/jets/d/in_int.c index 3f39d3250..eeec46b0a 100644 --- a/jets/d/in_int.c +++ b/jets/d/in_int.c @@ -44,7 +44,7 @@ u3qdi_int(l_a, l_b), u3qdi_int(r_a, r_b)); } - else if ( c3y == u3qc_hor(n_b, n_a) ) { + else if ( c3y == u3qc_gor(n_b, n_a) ) { return u3qdi_uni(u3qdi_int(l_a, u3nt(n_b, l_b, diff --git a/jets/d/in_mer.c b/jets/d/in_mer.c index 14fa6675f..f3c68056e 100644 --- a/jets/d/in_mer.c +++ b/jets/d/in_mer.c @@ -44,7 +44,7 @@ u3qdi_mer(l_a, l_b), u3qdi_mer(r_a, r_b)); } - else if ( c3y == u3qc_hor(n_b, n_a) ) { + else if ( c3y == u3qc_gor(n_b, n_a) ) { return u3qdi_mer(u3nt(n_a, u3qdi_mer(l_a, u3nt(n_b, diff --git a/jets/d/in_put.c b/jets/d/in_put.c index 10d2c4329..5726e10e4 100644 --- a/jets/d/in_put.c +++ b/jets/d/in_put.c @@ -27,7 +27,7 @@ return u3m_bail(c3__exit); } else { - if ( c3y == u3qc_hor(b, n_a) ) { + if ( c3y == u3qc_gor(b, n_a) ) { c = u3qdi_put(l_a, b); if ( c3y == u3qc_vor(n_a, u3h(c)) ) { diff --git a/jets/d/in_uni.c b/jets/d/in_uni.c index 85f07b835..10df406fa 100644 --- a/jets/d/in_uni.c +++ b/jets/d/in_uni.c @@ -27,7 +27,7 @@ _in_uni(u3_noun a, u3_noun b) if ( c3y == u3r_sing(n_a, n_b) ) { return u3nt(u3k(n_b), _in_uni(l_a, l_b), _in_uni(r_a, r_b)); } - else if ( c3y == u3qc_hor(n_a, n_b) ) { + else if ( c3y == u3qc_gor(n_a, n_b) ) { naw = u3nt(u3k(n_a), u3k(l_a), u3_nul); sub = _in_uni(naw, l_b); neb = u3nt(u3k(n_b), sub, u3k(r_b)); @@ -47,7 +47,7 @@ _in_uni(u3_noun a, u3_noun b) else if ( c3y == u3r_sing(n_b, n_a) ) { return u3nt(u3k(n_b), _in_uni(l_a, l_b), _in_uni(r_a, r_b)); } - else if ( c3y == u3qc_hor(n_b, n_a) ) { + else if ( c3y == u3qc_gor(n_b, n_a) ) { neb = u3nt(u3k(n_b), u3k(l_b), u3_nul); sub = _in_uni(l_a, neb); naw = u3nt(u3k(n_a), sub, u3k(r_a)); From b33f6e4b42535cee212ae446b0fdb73c4286c8c7 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 8 Jan 2019 20:30:20 -0500 Subject: [PATCH 20/78] renames *_vor to *_mor --- include/jets/q.h | 2 +- include/jets/w.h | 2 +- jets/c/{vor.c => mor.c} | 8 ++++---- jets/d/by_del.c | 2 +- jets/d/by_dif.c | 2 +- jets/d/by_int.c | 2 +- jets/d/by_put.c | 4 ++-- jets/d/by_uni.c | 2 +- jets/d/in_del.c | 2 +- jets/d/in_dif.c | 2 +- jets/d/in_int.c | 2 +- jets/d/in_mer.c | 2 +- jets/d/in_put.c | 4 ++-- jets/d/in_uni.c | 2 +- jets/tree.c | 9 ++++++--- meson.build | 2 +- 16 files changed, 26 insertions(+), 23 deletions(-) rename jets/c/{vor.c => mor.c} (82%) diff --git a/include/jets/q.h b/include/jets/q.h index 405259dea..41ae13036 100644 --- a/include/jets/q.h +++ b/include/jets/q.h @@ -58,6 +58,7 @@ u3_noun u3qc_mas(u3_atom); u3_noun u3qc_met(u3_atom, u3_atom); u3_noun u3qc_mix(u3_atom, u3_atom); + u3_noun u3qc_mor(u3_atom, u3_atom); u3_noun u3qc_muk(u3_atom, u3_atom, u3_atom); u3_noun u3qc_peg(u3_atom, u3_atom); u3_noun u3qc_pow(u3_atom, u3_atom); @@ -68,7 +69,6 @@ u3_noun u3qc_rsh(u3_atom, u3_atom, u3_atom); u3_noun u3qc_swp(u3_atom, u3_atom); u3_noun u3qc_sqt(u3_atom); - u3_noun u3qc_vor(u3_atom, u3_atom); u3_noun u3qc__stage_gor(u3_atom, u3_atom); # define u3qc__stage_hor u3qc__stage_gor diff --git a/include/jets/w.h b/include/jets/w.h index be1014f27..acbd695f9 100644 --- a/include/jets/w.h +++ b/include/jets/w.h @@ -58,6 +58,7 @@ u3_noun u3wc_mas(u3_noun); u3_noun u3wc_met(u3_noun); u3_noun u3wc_mix(u3_noun); + u3_noun u3wc_mor(u3_noun); u3_noun u3wc_mug(u3_noun); u3_noun u3wc_muk(u3_noun); u3_noun u3wc_mur(u3_noun); @@ -70,7 +71,6 @@ u3_noun u3wc_rsh(u3_noun); u3_noun u3wc_swp(u3_noun); u3_noun u3wc_sqt(u3_noun); - u3_noun u3wc_vor(u3_noun); u3_noun u3wc__stage_gor(u3_noun); # define u3wc__stage_hor u3wc__stage_gor diff --git a/jets/c/vor.c b/jets/c/mor.c similarity index 82% rename from jets/c/vor.c rename to jets/c/mor.c index 28364140b..1c0fec930 100644 --- a/jets/c/vor.c +++ b/jets/c/mor.c @@ -1,4 +1,4 @@ -/* j/3/vor.c +/* j/3/mor.c ** */ #include "all.h" @@ -7,7 +7,7 @@ /* functions */ u3_noun - u3qc_vor(u3_atom a, + u3qc_mor(u3_atom a, u3_atom b) { c3_w c_w = u3r_mug(u3r_mug(a)); @@ -19,13 +19,13 @@ else return (c_w < d_w) ? c3y : c3n; } u3_noun - u3wc_vor(u3_noun cor) + u3wc_mor(u3_noun cor) { u3_noun a, b; if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) ) { return u3m_bail(c3__exit); } else { - return u3qc_vor(a, b); + return u3qc_mor(a, b); } } diff --git a/jets/d/by_del.c b/jets/d/by_del.c index 90e11b37c..0a17e9db5 100644 --- a/jets/d/by_del.c +++ b/jets/d/by_del.c @@ -31,7 +31,7 @@ return u3m_bail(c3__exit); } else { - if ( c3y == u3qc_vor(u3h(n_l_a), u3h(n_r_a)) ) { + if ( c3y == u3qc_mor(u3h(n_l_a), u3h(n_r_a)) ) { u3_noun new_right = u3nt(u3k(n_a), u3k(r_l_a), u3k(r_a)); diff --git a/jets/d/by_dif.c b/jets/d/by_dif.c index 7973a4f34..d6e88cb6f 100644 --- a/jets/d/by_dif.c +++ b/jets/d/by_dif.c @@ -25,7 +25,7 @@ || c3n == u3r_cell(n_e, &p_n_e, &q_n_e) ) { return u3m_bail(c3__exit); } else { - if ( c3y == u3qc_vor(p_n_d, p_n_e) ) { + if ( c3y == u3qc_mor(p_n_d, p_n_e) ) { return u3nt(u3k(n_d), u3k(l_d), _b_dif_join(u3k(r_d), u3k(e))); diff --git a/jets/d/by_int.c b/jets/d/by_int.c index f8e5a2231..ec1b7cfa9 100644 --- a/jets/d/by_int.c +++ b/jets/d/by_int.c @@ -40,7 +40,7 @@ else if ( c3n == u3r_cell(n_b, &p_n_b, &q_n_b) ) { return u3m_bail(c3__exit); } - else if ( c3y == u3qc_vor(p_n_a, p_n_b) ) { + else if ( c3y == u3qc_mor(p_n_a, p_n_b) ) { if ( c3y == u3r_sing(p_n_a, p_n_b) ) { return u3nt( u3k(n_b), diff --git a/jets/d/by_put.c b/jets/d/by_put.c index 5bafdc0c2..a0f755fc4 100644 --- a/jets/d/by_put.c +++ b/jets/d/by_put.c @@ -41,7 +41,7 @@ if ( c3y == u3qc_gor(b, pn_a) ) { d = u3qdb_put(l_a, b, c); - if ( c3y == u3qc_vor(pn_a, u3h(u3h(d))) ) { + if ( c3y == u3qc_mor(pn_a, u3h(u3h(d))) ) { return u3nt(u3k(n_a), d, u3k(r_a)); @@ -64,7 +64,7 @@ else { d = u3qdb_put(r_a, b, c); - if ( c3y == u3qc_vor(pn_a, u3h(u3h(d))) ) { + if ( c3y == u3qc_mor(pn_a, u3h(u3h(d))) ) { return u3nt(u3k(n_a), u3k(l_a), d); diff --git a/jets/d/by_uni.c b/jets/d/by_uni.c index 0725b7924..43eb838eb 100644 --- a/jets/d/by_uni.c +++ b/jets/d/by_uni.c @@ -40,7 +40,7 @@ else if ( c3n == u3r_cell(lr_b, &l_b, &r_b) ) { return u3m_bail(c3__exit); } - else if ( c3y == u3qc_vor(p_n_a, p_n_b) ) { + else if ( c3y == u3qc_mor(p_n_a, p_n_b) ) { if ( c3y == u3r_sing(p_n_a, p_n_b) ) { return u3nt(u3k(n_b), u3qdb_uni(u3k(l_a), diff --git a/jets/d/in_del.c b/jets/d/in_del.c index 17451ad69..62c2d9f5d 100644 --- a/jets/d/in_del.c +++ b/jets/d/in_del.c @@ -29,7 +29,7 @@ return u3m_bail(c3__exit); } else { - if ( c3y == u3qc_vor(n_l_a, n_r_a) ) { + if ( c3y == u3qc_mor(n_l_a, n_r_a) ) { u3_noun new_right = u3nt(u3k(n_a), u3k(r_l_a), u3k(r_a)); diff --git a/jets/d/in_dif.c b/jets/d/in_dif.c index 389cc1fa5..f542717d0 100644 --- a/jets/d/in_dif.c +++ b/jets/d/in_dif.c @@ -21,7 +21,7 @@ || c3n == u3r_trel(e, &n_e, &l_e, &r_e) ) { return u3m_bail(c3__exit); } else { - if ( c3y == u3qc_vor(n_d, n_e) ) { + if ( c3y == u3qc_mor(n_d, n_e) ) { return u3nt(u3k(n_d), u3k(l_d), _i_dif_join(u3k(r_d), u3k(e))); diff --git a/jets/d/in_int.c b/jets/d/in_int.c index eeec46b0a..3922c58dc 100644 --- a/jets/d/in_int.c +++ b/jets/d/in_int.c @@ -28,7 +28,7 @@ return u3m_bail(c3__exit); } else { - if ( c3y == u3qc_vor(n_b, n_a) ) { + if ( c3y == u3qc_mor(n_b, n_a) ) { c = a; a = b; b = c; c = n_a; n_a = n_b; n_b = c; c = lr_a; lr_a = lr_b; lr_b = c; diff --git a/jets/d/in_mer.c b/jets/d/in_mer.c index f3c68056e..3cd70e2cd 100644 --- a/jets/d/in_mer.c +++ b/jets/d/in_mer.c @@ -28,7 +28,7 @@ return u3m_bail(c3__exit); } else { - if ( c3y == u3qc_vor(n_b, n_a) ) { + if ( c3y == u3qc_mor(n_b, n_a) ) { c = a; a = b; b = c; c = n_a; n_a = n_b; n_b = c; c = lr_a; lr_a = lr_b; lr_b = c; diff --git a/jets/d/in_put.c b/jets/d/in_put.c index 5726e10e4..827b8e52b 100644 --- a/jets/d/in_put.c +++ b/jets/d/in_put.c @@ -30,7 +30,7 @@ if ( c3y == u3qc_gor(b, n_a) ) { c = u3qdi_put(l_a, b); - if ( c3y == u3qc_vor(n_a, u3h(c)) ) { + if ( c3y == u3qc_mor(n_a, u3h(c)) ) { return u3nt(u3k(n_a), c, u3k(r_a)); @@ -52,7 +52,7 @@ else { c = u3qdi_put(r_a, b); - if ( c3y == u3qc_vor(n_a, u3h(c)) ) { + if ( c3y == u3qc_mor(n_a, u3h(c)) ) { return u3nt(u3k(n_a), u3k(l_a), c); diff --git a/jets/d/in_uni.c b/jets/d/in_uni.c index 10df406fa..ce417a3fc 100644 --- a/jets/d/in_uni.c +++ b/jets/d/in_uni.c @@ -23,7 +23,7 @@ _in_uni(u3_noun a, u3_noun b) { return u3m_bail(c3__exit); } - else if ( c3n == u3qc_vor(n_a, n_b) ) { + else if ( c3n == u3qc_mor(n_a, n_b) ) { if ( c3y == u3r_sing(n_a, n_b) ) { return u3nt(u3k(n_b), _in_uni(l_a, l_b), _in_uni(r_a, r_b)); } diff --git a/jets/tree.c b/jets/tree.c index d837c6b12..f34c0a999 100644 --- a/jets/tree.c +++ b/jets/tree.c @@ -938,6 +938,8 @@ static u3j_harm _141_two_met_a[] = {{".2", u3wc_met, c3y}, {}}; static c3_c* _141_two_met_ha[] = {0}; static u3j_harm _141_two_mix_a[] = {{".2", u3wc_mix, c3y}, {}}; static c3_c* _141_two_mix_ha[] = {0}; +static u3j_harm _141_two_mor_a[] = {{".2", u3wc_mor, c3y}, {}}; +static c3_c* _141_two_mor_ha[] = {0}; static u3j_harm _141_two_mug_a[] = {{".2", u3wc_mug, c3y}, {}}; static c3_c* _141_two_mug_ha[] = {0}; static u3j_harm _141_two_muk_a[] = {{".2", u3wc_muk, c3y}, {}}; @@ -962,8 +964,6 @@ static u3j_harm _141_two_swp_a[] = {{".2", u3wc_swp, c3y}, {}}; static c3_c* _141_two_swp_ha[] = {0}; static u3j_harm _141_two_sqt_a[] = {{".2", u3wc_sqt, c3y}, {}}; static c3_c* _141_two_sqt_ha[] = {0}; -static u3j_harm _141_two_vor_a[] = {{".2", u3wc_vor, c3y}, {}}; -static c3_c* _141_two_vor_ha[] = {0}; static u3j_harm _141_two_xeb_a[] = {{".2", u3wc_xeb, c3y}, {}}; static c3_c* _141_two_xeb_ha[] = {0}; @@ -1184,6 +1184,7 @@ static u3j_core _141_two_d[] = { "mat", 7, _141_two_mat_a, 0, _141_two_mat_ha }, { "met", 7, _141_two_met_a, 0, _141_two_met_ha }, { "mix", 7, _141_two_mix_a, 0, _141_two_mix_ha }, + { "mor", 7, _141_two_mor_a, 0, _141_two_mor_ha }, { "mug", 7, _141_two_mug_a, 0, _141_two_mug_ha }, { "muk", 59, _141_two_muk_a, 0, _141_two_muk_ha }, { "mur", 7, _141_two_mur_a, 0, _141_two_mur_ha }, @@ -1197,7 +1198,9 @@ static u3j_core _141_two_d[] = { "peg", 7, _141_two_peg_a, 0, _141_two_peg_ha }, { "pow", 7, _141_two_pow_a, 0, _141_two_pow_ha }, { "sqt", 7, _141_two_sqt_a, 0, _141_two_sqt_ha }, - { "vor", 7, _141_two_vor_a, 0, _141_two_vor_ha }, + // temporary alias for staging +vor -> +mor + // + { "vor", 7, _141_two_mor_a, 0, _141_two_mor_ha }, { "stage-vor", 7, _141_two_stage_vor_a, 0, _141_two_stage_vor_ha }, { "xeb", 7, _141_two_xeb_a, 0, _141_two_xeb_ha }, diff --git a/meson.build b/meson.build index 84adab162..5c3f673af 100644 --- a/meson.build +++ b/meson.build @@ -63,6 +63,7 @@ jets_c_src = [ 'jets/c/mas.c', 'jets/c/met.c', 'jets/c/mix.c', +'jets/c/mor.c', 'jets/c/mug.c', 'jets/c/muk.c', 'jets/c/mur.c', @@ -76,7 +77,6 @@ jets_c_src = [ 'jets/c/rsh.c', 'jets/c/swp.c', 'jets/c/sqt.c', -'jets/c/vor.c', 'jets/stage/c/gor.c', 'jets/stage/c/hor.c', From bc0a50a4af4591c7b524c59dcb98d10f3806d857 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 8 Jan 2019 01:13:13 -0500 Subject: [PATCH 21/78] [CI] ctrl-x out of :talk --- .travis/test.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.travis/test.js b/.travis/test.js index 4efa96008..987cc42d3 100644 --- a/.travis/test.js +++ b/.travis/test.js @@ -26,6 +26,16 @@ function exit() { } Promise.resolve(urbit) +// XX temporary +// send ctrl-x to select dojo +// +.then(function(){ + return urbit.expect(/talk\[\] /) + .then(function() { + return urbit.pty.write("\x18") + }) + .then(function() { return urbit }) +}) .then(actions.safeBoot) .then(actions.test) .then(exit) From 875dce84209814e4abe6d0b9a630ce38a15d9f94 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 8 Jan 2019 00:41:10 -0500 Subject: [PATCH 22/78] [CI] updates pinned arvo commit --- .travis/pin-arvo-commit.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis/pin-arvo-commit.txt b/.travis/pin-arvo-commit.txt index a59368215..6d936e53e 100644 --- a/.travis/pin-arvo-commit.txt +++ b/.travis/pin-arvo-commit.txt @@ -1 +1 @@ -00c79de3df4ecae9f499053990471d420f0e79a0 +fe643204f78131e0c805b03d2b7fbf7d619a15fc From b3fad746ca978e500e34b85e175b2035fa70584f Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Mon, 7 Jan 2019 23:27:35 -0500 Subject: [PATCH 23/78] Revert "jets u3r_mur" This reverts commit b0ef096e1c99b7ba06fd8f9717da0a409551ea00. --- include/jets/w.h | 1 - jets/c/mur.c | 19 ------------------- jets/tree.c | 3 --- meson.build | 1 - 4 files changed, 24 deletions(-) delete mode 100644 jets/c/mur.c diff --git a/include/jets/w.h b/include/jets/w.h index acbd695f9..60d77191f 100644 --- a/include/jets/w.h +++ b/include/jets/w.h @@ -61,7 +61,6 @@ u3_noun u3wc_mor(u3_noun); u3_noun u3wc_mug(u3_noun); u3_noun u3wc_muk(u3_noun); - u3_noun u3wc_mur(u3_noun); u3_noun u3wc_peg(u3_noun); u3_noun u3wc_pow(u3_noun); u3_noun u3wc_rap(u3_noun); diff --git a/jets/c/mur.c b/jets/c/mur.c deleted file mode 100644 index 924b333ed..000000000 --- a/jets/c/mur.c +++ /dev/null @@ -1,19 +0,0 @@ -/* j/3/mur.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3wc_mur(u3_noun cor) - { - u3_noun sam; - - if ( u3_none == (sam = u3r_at(u3x_sam, cor)) ) { - return u3m_bail(c3__exit); - } else { - return u3r_mug(sam); - } - } diff --git a/jets/tree.c b/jets/tree.c index f34c0a999..54cacc9ad 100644 --- a/jets/tree.c +++ b/jets/tree.c @@ -944,8 +944,6 @@ static u3j_harm _141_two_mug_a[] = {{".2", u3wc_mug, c3y}, {}}; static c3_c* _141_two_mug_ha[] = {0}; static u3j_harm _141_two_muk_a[] = {{".2", u3wc_muk, c3y}, {}}; static c3_c* _141_two_muk_ha[] = {0}; -static u3j_harm _141_two_mur_a[] = {{".2", u3wc_mur, c3y}, {}}; -static c3_c* _141_two_mur_ha[] = {0}; static u3j_harm _141_two_peg_a[] = {{".2", u3wc_peg, c3y}, {}}; static c3_c* _141_two_peg_ha[] = {0}; static u3j_harm _141_two_pow_a[] = {{".2", u3wc_pow, c3y}, {}}; @@ -1187,7 +1185,6 @@ static u3j_core _141_two_d[] = { "mor", 7, _141_two_mor_a, 0, _141_two_mor_ha }, { "mug", 7, _141_two_mug_a, 0, _141_two_mug_ha }, { "muk", 59, _141_two_muk_a, 0, _141_two_muk_ha }, - { "mur", 7, _141_two_mur_a, 0, _141_two_mur_ha }, { "rap", 7, _141_two_rap_a, 0, _141_two_rap_ha }, { "rep", 7, _141_two_rep_a, 0, _141_two_rep_ha }, { "rev", 7, _141_two_rev_a, 0, _141_two_rev_ha }, diff --git a/meson.build b/meson.build index 5c3f673af..7ba1d8be1 100644 --- a/meson.build +++ b/meson.build @@ -66,7 +66,6 @@ jets_c_src = [ 'jets/c/mor.c', 'jets/c/mug.c', 'jets/c/muk.c', -'jets/c/mur.c', 'jets/c/peg.c', 'jets/c/po.c', 'jets/c/pow.c', From 1a40bc70b9db813c64d9a8b1e96eaf924e523d03 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Mon, 7 Jan 2019 23:34:16 -0500 Subject: [PATCH 24/78] Revert "adds temporary gum_w hash slot to u3_noun" This reverts commit cd96ad658d3f15bab0dbc05a300bd76ac05f4198. --- include/noun/allocate.h | 7 ++----- noun/allocate.c | 3 --- noun/imprison.c | 3 --- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/include/noun/allocate.h b/include/noun/allocate.h index fbf5dca21..32a8e8d37 100644 --- a/include/noun/allocate.h +++ b/include/noun/allocate.h @@ -27,9 +27,9 @@ /* u3a_minimum: minimum number of words in a box. */ #ifdef U3_MEMORY_DEBUG -# define u3a_minimum 9 +# define u3a_minimum 8 #else -# define u3a_minimum 7 +# define u3a_minimum 6 #endif /* u3a_fbox_no: number of free lists per size. @@ -43,19 +43,16 @@ */ typedef struct { c3_w mug_w; - c3_w gum_w; } u3a_noun; typedef struct { c3_w mug_w; - c3_w gum_w; c3_w len_w; c3_w buf_w[0]; } u3a_atom; typedef struct { c3_w mug_w; - c3_w gum_w; u3_noun hed; u3_noun tel; } u3a_cell; diff --git a/noun/allocate.c b/noun/allocate.c index b2f6c5259..7f2272439 100644 --- a/noun/allocate.c +++ b/noun/allocate.c @@ -904,7 +904,6 @@ _me_wash_north(u3_noun dog) if ( dog_u->mug_w == 0 ) return; dog_u->mug_w = 0; // power wash - dog_u->gum_w = 0; // if ( dog_u->mug_w >> 31 ) { dog_u->mug_w = 0; } if ( _(u3a_is_pom(dog)) ) { @@ -938,7 +937,6 @@ _me_wash_south(u3_noun dog) if ( dog_u->mug_w == 0 ) return; dog_u->mug_w = 0; // power wash - dog_u->gum_w = 0; // if ( dog_u->mug_w >> 31 ) { dog_u->mug_w = 0; } if ( _(u3a_is_pom(dog)) ) { @@ -1830,7 +1828,6 @@ u3a_slab(c3_w len_w) u3a_atom* pug_u = (void *)nov_w; pug_u->mug_w = 0; - pug_u->gum_w = 0; pug_u->len_w = len_w; /* Clear teh slab. diff --git a/noun/imprison.c b/noun/imprison.c index 5c78a21af..13ba89cc5 100644 --- a/noun/imprison.c +++ b/noun/imprison.c @@ -33,7 +33,6 @@ u3i_words(c3_w a_w, u3a_atom* nov_u = (void*)nov_w; nov_u->mug_w = 0; - nov_u->gum_w = 0; nov_u->len_w = a_w; /* Fill the words. @@ -112,7 +111,6 @@ u3i_bytes(c3_w a_w, u3a_atom* nov_u = (void*)nov_w; nov_u->mug_w = 0; - nov_u->gum_w = 0; nov_u->len_w = len_w; /* Clear the words. @@ -214,7 +212,6 @@ u3i_cell(u3_noun a, u3_noun b) u3_noun pro; nov_u->mug_w = 0; - nov_u->gum_w = 0; nov_u->hed = a; nov_u->tel = b; From 658a77f88b970820f2d7d833fa1d1796d124d9f6 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Mon, 7 Jan 2019 23:34:38 -0500 Subject: [PATCH 25/78] Revert "adds staged jet headers and dashboard declarations, renames everything" This reverts commit cee1bfe59180e768ceb7fbb202ac123a955b812f. --- include/jets/k.h | 5 - include/jets/q.h | 72 --------------- include/jets/w.h | 42 --------- include/noun/retrieve.h | 2 - jets/stage/c/gor.c | 10 +- jets/stage/c/hor.c | 46 --------- jets/stage/c/vor.c | 10 +- jets/stage/d/by_bif.c | 12 +-- jets/stage/d/by_del.c | 14 +-- jets/stage/d/by_dif.c | 16 ++-- jets/stage/d/by_gas.c | 14 +-- jets/stage/d/by_get.c | 20 ++-- jets/stage/d/by_has.c | 16 ++-- jets/stage/d/by_jab.c | 12 +-- jets/stage/d/by_put.c | 20 ++-- jets/stage/d/in_bif.c | 10 +- jets/stage/d/in_del.c | 14 +-- jets/stage/d/in_dif.c | 16 ++-- jets/stage/d/in_gas.c | 14 +-- jets/stage/d/in_has.c | 16 ++-- jets/stage/d/in_mer.c | 22 ++--- jets/stage/d/in_put.c | 20 ++-- jets/stage/d/in_uni.c | 16 ++-- jets/stage/f/fork.c | 18 ++-- jets/stage/f/look.c | 14 +-- jets/stage/f/loot.c | 10 +- jets/stage/f/ut.c | 26 +++--- jets/stage/f/ut_buss.c | 12 +-- jets/stage/f/ut_conk.c | 12 +-- jets/stage/f/ut_crop.c | 26 +++--- jets/stage/f/ut_find.c | 74 +++++++-------- jets/stage/f/ut_fire.c | 28 +++--- jets/stage/f/ut_fish.c | 18 ++-- jets/stage/f/ut_fuse.c | 20 ++-- jets/stage/f/ut_gain.c | 4 +- jets/stage/f/ut_lose.c | 4 +- jets/stage/f/ut_mint.c | 88 +++++++++--------- jets/stage/f/ut_mull.c | 108 +++++++++++----------- jets/stage/f/ut_nest.c | 56 +++++------ jets/stage/f/ut_peek.c | 18 ++-- jets/stage/f/ut_peel.c | 6 +- jets/stage/f/ut_play.c | 48 +++++----- jets/stage/f/ut_repo.c | 10 +- jets/stage/f/ut_rest.c | 22 ++--- jets/stage/f/ut_tack.c | 4 +- jets/stage/f/ut_toss.c | 8 +- jets/stage/f/ut_wrap.c | 10 +- jets/tree.c | 200 +--------------------------------------- meson.build | 55 +---------- 49 files changed, 463 insertions(+), 875 deletions(-) delete mode 100644 jets/stage/c/hor.c diff --git a/include/jets/k.h b/include/jets/k.h index 9b1920353..3eeb4d227 100644 --- a/include/jets/k.h +++ b/include/jets/k.h @@ -105,9 +105,6 @@ u3_noun u3kdi_uni(u3_noun a, u3_noun b); - u3_weak u3kdi__stage_put(u3_noun a, u3_noun b); - u3_noun u3kdi__stage_uni(u3_noun a, u3_noun b); - # define u3kdb_tap(a) u3kdi_tap(a) /* u3ke: tier 5 functions @@ -132,8 +129,6 @@ u3_noun u3kf_fork(u3_noun yed); - u3_noun u3kf__stage_fork(u3_noun yed); - /* u3kz_fork(): build %fork span. */ u3_noun diff --git a/include/jets/q.h b/include/jets/q.h index 41ae13036..24475289a 100644 --- a/include/jets/q.h +++ b/include/jets/q.h @@ -70,10 +70,6 @@ u3_noun u3qc_swp(u3_atom, u3_atom); u3_noun u3qc_sqt(u3_atom); - u3_noun u3qc__stage_gor(u3_atom, u3_atom); -# define u3qc__stage_hor u3qc__stage_gor - u3_noun u3qc__stage_vor(u3_atom, u3_atom); - /** Tier 4. **/ u3_noun u3qdb_bif(u3_noun, u3_noun); @@ -86,14 +82,6 @@ # define u3qdb_tap u3qdi_tap u3_noun u3qdb_uni(u3_noun, u3_noun); - u3_noun u3qdb__stage_bif(u3_noun, u3_noun); - u3_noun u3qdb__stage_dif(u3_noun, u3_noun); - u3_noun u3qdb__stage_gas(u3_noun, u3_noun); - u3_noun u3qdb__stage_get(u3_noun, u3_noun); - u3_noun u3qdb__stage_has(u3_noun, u3_noun); - u3_noun u3qdb__stage_put(u3_noun, u3_noun, u3_noun); -# define u3qdb__stage_tap u3qdi_tap - u3_noun u3qdi_bif(u3_noun, u3_noun); u3_noun u3qdi_dif(u3_noun, u3_noun); u3_noun u3qdi_gas(u3_noun, u3_noun); @@ -105,15 +93,6 @@ u3_noun u3qdi_uni(u3_noun, u3_noun); u3_noun u3qdi_wyt(u3_noun); - u3_noun u3qdi__stage_bif(u3_noun, u3_noun); - u3_noun u3qdi__stage_dif(u3_noun, u3_noun); - u3_noun u3qdi__stage_gas(u3_noun, u3_noun); - u3_noun u3qdi__stage_has(u3_noun, u3_noun); - u3_noun u3qdi__stage_mer(u3_noun, u3_noun); - u3_noun u3qdi__stage_put(u3_noun, u3_noun); -# define u3qdi__stage_tap u3qdi_tap - u3_noun u3qdi__stage_uni(u3_noun, u3_noun); - /** Tier 5. **/ u3_noun u3qe_cue(u3_atom); @@ -252,11 +231,6 @@ u3_noun u3qf_slot(u3_atom, u3_noun); u3_noun u3qf_type(u3_noun); - u3_noun u3qf__stage_fork(u3_noun); - u3_noun u3qf__stage_forq(u3_noun, u3_noun); - u3_noun u3qf__stage_look(u3_noun, u3_noun); - u3_noun u3qf__stage_loot(u3_noun, u3_noun); - u3_noun u3qfl_bunt(u3_noun, u3_noun); u3_noun u3qfl_whip(u3_noun, u3_noun, u3_noun); @@ -314,50 +288,4 @@ u3_noun u3qfu_toss(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); u3_noun u3qfu_wrap(u3_noun, u3_noun, u3_noun); - u3_noun u3qfu__stage_burn(u3_noun, u3_noun); - u3_noun u3qfu__stage_busk(u3_noun, u3_noun, u3_noun); - u3_noun u3qfu__stage_buss(u3_noun, u3_noun, u3_noun, u3_noun); - u3_noun u3qfu__stage_bust(u3_noun, u3_noun, u3_noun); - u3_noun u3qfu__stage_conk(u3_noun, u3_noun, u3_noun); - u3_noun u3qfu__stage_crop(u3_noun, u3_noun, u3_noun); - u3_noun u3qfu__stage_cull(u3_noun, u3_noun, u3_noun, u3_atom, u3_noun); - u3_noun u3qfu__stage_duck(u3_noun, u3_noun); - u3_noun u3qfu__stage_dung(u3_noun, u3_noun cap, u3_noun); - u3_noun u3qfu__stage_dunq(u3_noun, const c3_c*, u3_noun); - void u3qfu__stage_dump(u3_noun, const c3_c*, u3_noun); - u3_noun u3qfu__stage_fond(u3_noun, u3_noun, u3_noun, u3_noun); - u3_noun u3qfu__stage_find(u3_noun, u3_noun, u3_noun, u3_noun); - u3_noun u3qfu__stage_finc(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); - u3_noun u3qfu__stage_fink(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); - u3_noun u3qfu__stage_fire(u3_noun, u3_noun, u3_noun); - u3_noun u3qfu__stage_firm(u3_noun, u3_noun, u3_noun); - u3_noun u3qfu__stage_fish(u3_noun, u3_noun, u3_atom); - u3_noun u3qfu__stage_fuse(u3_noun, u3_noun, u3_noun); - u3_noun u3qfu__stage_gain(u3_noun, u3_noun, u3_noun); - u3_noun u3qfu__stage_heal(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); - u3_noun u3qfu__stage_lose(u3_noun, u3_noun, u3_noun); - u3_noun u3qfu__stage_mint(u3_noun, u3_noun, u3_noun, u3_noun); - u3_noun u3qfu__stage_mull(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); - u3_noun u3qfu__stage_nest(u3_noun, u3_noun, u3_noun, u3_noun); - u3_noun u3qfu__stage_nost(u3_noun, u3_noun, u3_noun, u3_noun); - u3_noun u3qfu__stage_orth(u3_noun, u3_noun, u3_noun); - u3_noun u3qfu__stage_peek(u3_noun, u3_noun, u3_noun, u3_noun); - u3_noun u3qfu__stage_peel(u3_noun, u3_noun, u3_noun, u3_noun); - u3_noun u3qfu__stage_play(u3_noun, u3_noun, u3_noun); - u3_noun u3qfu__stage_repo(u3_noun, u3_noun); - u3_noun u3qfu__stage_rest(u3_noun, u3_noun, u3_noun); - u3_noun u3qfu__stage_shep(u3_noun, const c3_c*, u3_noun, u3_noun); - u3_noun u3qfu__stage_shew(u3_noun, u3_noun); - u3_noun u3qfu__stage_sift(u3_noun, u3_noun, u3_noun); - u3_noun u3qfu__stage_snub(u3_noun, u3_noun, u3_noun); - u3_noun u3qfu__stage_tack(u3_noun, u3_noun, u3_noun, u3_noun); - u3_noun u3qfu__stage_toss(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); - u3_noun u3qfu__stage_wrap(u3_noun, u3_noun, u3_noun); - -# define u3qfu__stage_van_fan 28 -# define u3qfu__stage_van_rib 58 -# define u3qfu__stage_van_vrf 59 -# define u3qfu__stage_van_vet 118 -# define u3qfu__stage_van_fab 119 - void u3qf_test(const c3_c*, u3_noun); diff --git a/include/jets/w.h b/include/jets/w.h index 60d77191f..21d4d84d3 100644 --- a/include/jets/w.h +++ b/include/jets/w.h @@ -71,10 +71,6 @@ u3_noun u3wc_swp(u3_noun); u3_noun u3wc_sqt(u3_noun); - u3_noun u3wc__stage_gor(u3_noun); -# define u3wc__stage_hor u3wc__stage_gor - u3_noun u3wc__stage_vor(u3_noun); - u3_noun u3wcp_ins(u3_noun); u3_noun u3wcp_ind(u3_noun); u3_noun u3wcp_tos(u3_noun); @@ -94,16 +90,6 @@ # define u3wdb_tap u3wdi_tap u3_noun u3wdb_uni(u3_noun); - u3_noun u3wdb__stage_bif(u3_noun); - u3_noun u3wdb__stage_del(u3_noun); - u3_noun u3wdb__stage_dif(u3_noun); - u3_noun u3wdb__stage_gas(u3_noun); - u3_noun u3wdb__stage_get(u3_noun); - u3_noun u3wdb__stage_has(u3_noun); - u3_noun u3wdb__stage_jab(u3_noun); - u3_noun u3wdb__stage_put(u3_noun); -# define u3wdb__stage_tap u3wdi_tap - u3_noun u3wdi_bif(u3_noun); u3_noun u3wdi_del(u3_noun); u3_noun u3wdi_dif(u3_noun); @@ -116,15 +102,6 @@ u3_noun u3wdi_uni(u3_noun); u3_noun u3wdi_wyt(u3_noun); - u3_noun u3wdi__stage_bif(u3_noun); - u3_noun u3wdi__stage_del(u3_noun); - u3_noun u3wdi__stage_dif(u3_noun); - u3_noun u3wdi__stage_gas(u3_noun); - u3_noun u3wdi__stage_has(u3_noun); - u3_noun u3wdi__stage_mer(u3_noun); - u3_noun u3wdi__stage_put(u3_noun); - u3_noun u3wdi__stage_uni(u3_noun); - /** Tier 5. **/ u3_noun u3we_cue(u3_noun); @@ -280,10 +257,6 @@ u3_noun u3wf_look(u3_noun); u3_noun u3wf_loot(u3_noun); - u3_noun u3wf__stage_fork(u3_noun); - u3_noun u3wf__stage_look(u3_noun); - u3_noun u3wf__stage_loot(u3_noun); - u3_noun u3wfl_bunt(u3_noun); u3_noun u3wfl_whip(u3_noun); @@ -318,18 +291,3 @@ u3_noun u3wfu_snub(u3_noun); u3_noun u3wfu_toss(u3_noun); u3_noun u3wfu_wrap(u3_noun); - - u3_noun u3wfu__stage_crop(u3_noun); - u3_noun u3wfu__stage_find(u3_noun); - u3_noun u3wfu__stage_fire(u3_noun); - u3_noun u3wfu__stage_fish(u3_noun); - u3_noun u3wfu__stage_fond(u3_noun); - u3_noun u3wfu__stage_fuse(u3_noun); - u3_noun u3wfu__stage_mint(u3_noun); - u3_noun u3wfu__stage_mull(u3_noun); - u3_noun u3wfu__stage_nest(u3_noun); - u3_noun u3wfu__stage_peek(u3_noun); - u3_noun u3wfu__stage_play(u3_noun); - u3_noun u3wfu__stage_rest(u3_noun); - u3_noun u3wfu__stage_toss(u3_noun); - u3_noun u3wfu__stage_wrap(u3_noun); diff --git a/include/noun/retrieve.h b/include/noun/retrieve.h index 0a7be687d..3c63beb72 100644 --- a/include/noun/retrieve.h +++ b/include/noun/retrieve.h @@ -32,8 +32,6 @@ c3_o u3r_mean(u3_noun a, ...); -#define u3r__stage_mug u3r_mug - /* u3r_mug(): ** ** Compute and/or recall the mug (31-bit hash) of (a). diff --git a/jets/stage/c/gor.c b/jets/stage/c/gor.c index 52bb00043..8e89b5e8c 100644 --- a/jets/stage/c/gor.c +++ b/jets/stage/c/gor.c @@ -7,11 +7,11 @@ /* functions */ u3_noun - u3qc__stage_gor(u3_noun a, + u3qc_gor(u3_noun a, u3_noun b) { - c3_w c_w = u3r__stage_mug(a); - c3_w d_w = u3r__stage_mug(b); + c3_w c_w = u3r_mug(a); + c3_w d_w = u3r_mug(b); if ( c_w == d_w ) { return u3qc_dor(a, b); @@ -19,14 +19,14 @@ else return (c_w < d_w) ? c3y : c3n; } u3_noun - u3wc__stage_gor(u3_noun cor) + u3wc_gor(u3_noun cor) { u3_noun a, b; if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) ) { return u3m_bail(c3__exit); } else { - return u3qc__stage_gor(a, b); + return u3qc_gor(a, b); } } diff --git a/jets/stage/c/hor.c b/jets/stage/c/hor.c deleted file mode 100644 index 8180f2b02..000000000 --- a/jets/stage/c/hor.c +++ /dev/null @@ -1,46 +0,0 @@ -/* j/3/hor.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3qc__disabled__stage_hor(u3_noun a, - u3_noun b) - { - if ( c3y == u3ud(a) ) { - if ( c3y == u3ud(b) ) { - return u3qc__stage_gor(a, b); - } else { - return c3y; - } - } else { - if ( c3y == u3ud(b) ) { - return c3n; - } - else { - u3_noun h_a = u3h(a); - u3_noun h_b = u3h(b); - - if ( c3y == u3r_sing(h_a, h_b) ) { - return u3qc__stage_gor(u3t(a), u3t(b)); - } else { - return u3qc__stage_gor(h_a, h_b); - } - } - } - } - u3_noun - u3wc__disabled__stage_hor(u3_noun cor) - { - u3_noun a, b; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) ) { - return u3m_bail(c3__exit); - } else { - return u3qc__stage_hor(a, b); - } - } - diff --git a/jets/stage/c/vor.c b/jets/stage/c/vor.c index f388fcc48..28364140b 100644 --- a/jets/stage/c/vor.c +++ b/jets/stage/c/vor.c @@ -7,11 +7,11 @@ /* functions */ u3_noun - u3qc__stage_vor(u3_atom a, + u3qc_vor(u3_atom a, u3_atom b) { - c3_w c_w = u3r__stage_mug(u3r__stage_mug(a)); - c3_w d_w = u3r__stage_mug(u3r__stage_mug(b)); + c3_w c_w = u3r_mug(u3r_mug(a)); + c3_w d_w = u3r_mug(u3r_mug(b)); if ( c_w == d_w ) { return u3qc_dor(a, b); @@ -19,13 +19,13 @@ else return (c_w < d_w) ? c3y : c3n; } u3_noun - u3wc__stage_vor(u3_noun cor) + u3wc_vor(u3_noun cor) { u3_noun a, b; if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) ) { return u3m_bail(c3__exit); } else { - return u3qc__stage_vor(a, b); + return u3qc_vor(a, b); } } diff --git a/jets/stage/d/by_bif.c b/jets/stage/d/by_bif.c index 057b14e68..3e53ba6d6 100644 --- a/jets/stage/d/by_bif.c +++ b/jets/stage/d/by_bif.c @@ -1,4 +1,4 @@ -/* jets/d/yb_bif.c +/* jets/d/by_bif.c ** */ #include "all.h" @@ -29,7 +29,7 @@ u3_noun c, n_c, l_c, r_c; u3_noun d; - if ( c3y == u3qc__stage_gor(p_b, p_n_a) ) { + if ( c3y == u3qc_gor(p_b, p_n_a) ) { c = _b_bif_putroot(l_a, b); u3r_trel(c, &n_c, &l_c, &r_c); d = u3nt(u3k(n_c), @@ -54,17 +54,17 @@ /* functions */ - u3_noun u3wdb__stage_bif(u3_noun cor) + u3_noun u3wdb_bif(u3_noun cor) { u3_noun a, b; if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { return u3m_bail(c3__exit); } else { - return u3qdb__stage_bif(a, b); + return u3qdb_bif(a, b); } } - u3_noun u3qdb__stage_bif(u3_noun a, + u3_noun u3qdb_bif(u3_noun a, u3_noun b) { u3_noun c, n_c, l_c, r_c; @@ -78,5 +78,5 @@ } /* - u3_weak u3kdb__stage_bif(u3_noun a, u3_noun b); + u3_weak u3kdi_bif(u3_noun a, u3_noun b); */ diff --git a/jets/stage/d/by_del.c b/jets/stage/d/by_del.c index 612d2748c..90e11b37c 100644 --- a/jets/stage/d/by_del.c +++ b/jets/stage/d/by_del.c @@ -31,7 +31,7 @@ return u3m_bail(c3__exit); } else { - if ( c3y == u3qc__stage_vor(u3h(n_l_a), u3h(n_r_a)) ) { + if ( c3y == u3qc_vor(u3h(n_l_a), u3h(n_r_a)) ) { u3_noun new_right = u3nt(u3k(n_a), u3k(r_l_a), u3k(r_a)); @@ -61,7 +61,7 @@ } u3_noun - u3qdb__stage_del(u3_noun a, + u3qdb_del(u3_noun a, u3_noun b) { if ( u3_nul == a ) { @@ -76,15 +76,15 @@ return u3m_bail(c3__exit); } else if ( c3n == u3r_sing(pn_a, b) ) { - if ( c3y == u3qc__stage_gor(b, pn_a) ) { + if ( c3y == u3qc_gor(b, pn_a) ) { return u3nt(u3k(n_a), - u3qdb__stage_del(l_a, b), + u3qdb_del(l_a, b), u3k(r_a)); } else { return u3nt(u3k(n_a), u3k(l_a), - u3qdb__stage_del(r_a, b)); + u3qdb_del(r_a, b)); } } else { @@ -94,7 +94,7 @@ } u3_noun - u3wdb__stage_del(u3_noun cor) + u3wdb_del(u3_noun cor) { u3_noun a, b; @@ -103,7 +103,7 @@ return u3m_bail(c3__exit); } else { - u3_noun n = u3qdb__stage_del(a, b); + u3_noun n = u3qdb_del(a, b); return n; } } diff --git a/jets/stage/d/by_dif.c b/jets/stage/d/by_dif.c index dae185569..7973a4f34 100644 --- a/jets/stage/d/by_dif.c +++ b/jets/stage/d/by_dif.c @@ -25,7 +25,7 @@ || c3n == u3r_cell(n_e, &p_n_e, &q_n_e) ) { return u3m_bail(c3__exit); } else { - if ( c3y == u3qc__stage_vor(p_n_d, p_n_e) ) { + if ( c3y == u3qc_vor(p_n_d, p_n_e) ) { return u3nt(u3k(n_d), u3k(l_d), _b_dif_join(u3k(r_d), u3k(e))); @@ -40,17 +40,17 @@ /* functions */ - u3_noun u3wdb__stage_dif(u3_noun cor) + u3_noun u3wdb_dif(u3_noun cor) { u3_noun a, b; if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { return u3m_bail(c3__exit); } else { - return u3qdb__stage_dif(a, b); + return u3qdb_dif(a, b); } } - u3_noun u3qdb__stage_dif(u3_noun a, + u3_noun u3qdb_dif(u3_noun a, u3_noun b) { if ( u3_nul == b ) { @@ -63,7 +63,7 @@ return u3m_bail(c3__exit); } else { - c = u3qdb__stage_bif(a, n_b); + c = u3qdb_bif(a, n_b); if ( c3n == u3r_cell(c, &l_c, &r_c) ) { return u3m_bail(c3__exit); @@ -71,8 +71,8 @@ u3_noun d; u3_noun e; - d = u3qdb__stage_dif(l_c, l_b); - e = u3qdb__stage_dif(r_c, r_b); + d = u3qdb_dif(l_c, l_b); + e = u3qdb_dif(r_c, r_b); u3z(c); return _b_dif_join(d, e); @@ -82,5 +82,5 @@ } /* - u3_weak u3kdb__stage_dif(u3_noun a, u3_noun b); + u3_weak u3kdb_dif(u3_noun a, u3_noun b); */ diff --git a/jets/stage/d/by_gas.c b/jets/stage/d/by_gas.c index dd39fc5ab..caa7f5291 100644 --- a/jets/stage/d/by_gas.c +++ b/jets/stage/d/by_gas.c @@ -7,7 +7,7 @@ /* functions */ u3_noun - u3qdb__stage_gas(u3_noun a, + u3qdb_gas(u3_noun a, u3_noun b) { if ( u3_nul == b ) { @@ -27,10 +27,10 @@ u3_noun qi_b = u3t(i_b); u3_noun c; - if ( u3_none == (c = u3qdb__stage_put(a, pi_b, qi_b)) ) { + if ( u3_none == (c = u3qdb_put(a, pi_b, qi_b)) ) { return u3m_bail(c3__exit); } else { - u3_noun d = u3qdb__stage_gas(c, t_b); + u3_noun d = u3qdb_gas(c, t_b); u3z(c); return d; @@ -40,21 +40,21 @@ } } u3_noun - u3wdb__stage_gas(u3_noun cor) + u3wdb_gas(u3_noun cor) { u3_noun a, b; if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { return u3m_bail(c3__exit); } else { - return u3qdb__stage_gas(a, b); + return u3qdb_gas(a, b); } } u3_noun - u3kdb__stage_gas(u3_noun a, + u3kdb_gas(u3_noun a, u3_noun b) { - u3_weak c = u3qdb__stage_gas(a, b); + u3_weak c = u3qdb_gas(a, b); u3z(a); u3z(b); if ( u3_none == c ) { diff --git a/jets/stage/d/by_get.c b/jets/stage/d/by_get.c index ac105ff61..588578764 100644 --- a/jets/stage/d/by_get.c +++ b/jets/stage/d/by_get.c @@ -7,7 +7,7 @@ /* functions */ u3_noun - u3qdb__stage_get(u3_noun a, + u3qdb_get(u3_noun a, u3_noun b) { if ( u3_nul == a ) { @@ -27,30 +27,30 @@ return u3nc(u3_nul, u3k(qn_a)); } else { - if ( c3y == u3qc__stage_gor(b, pn_a) ) { - return u3qdb__stage_get(l_a, b); + if ( c3y == u3qc_gor(b, pn_a) ) { + return u3qdb_get(l_a, b); } - else return u3qdb__stage_get(r_a, b); + else return u3qdb_get(r_a, b); } } } } u3_noun - u3wdb__stage_get(u3_noun cor) + u3wdb_get(u3_noun cor) { u3_noun a, b; if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { return u3m_bail(c3__exit); } else { - return u3qdb__stage_get(a, b); + return u3qdb_get(a, b); } } u3_weak - u3kdb__stage_get(u3_noun a, + u3kdb_get(u3_noun a, u3_noun b) { - u3_noun c = u3qdb__stage_get(a, b); + u3_noun c = u3qdb_get(a, b); u3z(a); u3z(b); if ( c3n == u3r_du(c) ) { @@ -64,10 +64,10 @@ } } u3_noun - u3kdb__stage_got(u3_noun a, + u3kdb_got(u3_noun a, u3_noun b) { - u3_weak c = u3kdb__stage_get(a, b); + u3_weak c = u3kdb_get(a, b); if ( u3_none == c ) { return u3m_bail(c3__exit); diff --git a/jets/stage/d/by_has.c b/jets/stage/d/by_has.c index 4a3c26bbf..0fa41bf3e 100644 --- a/jets/stage/d/by_has.c +++ b/jets/stage/d/by_has.c @@ -7,7 +7,7 @@ /* functions */ u3_noun - u3qdb__stage_has(u3_noun a, + u3qdb_has(u3_noun a, u3_noun b) { if ( u3_nul == a ) { @@ -27,30 +27,30 @@ return c3y; } else { - if ( c3y == u3qc__stage_gor(b, pn_a) ) { - return u3qdb__stage_has(l_a, b); + if ( c3y == u3qc_gor(b, pn_a) ) { + return u3qdb_has(l_a, b); } - else return u3qdb__stage_has(r_a, b); + else return u3qdb_has(r_a, b); } } } } u3_noun - u3wdb__stage_has(u3_noun cor) + u3wdb_has(u3_noun cor) { u3_noun a, b; if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { return u3m_bail(c3__exit); } else { - return u3qdb__stage_has(a, b); + return u3qdb_has(a, b); } } u3_noun - u3kdb__stage_has(u3_noun a, + u3kdb_has(u3_noun a, u3_noun b) { - u3_weak c = u3qdb__stage_has(a, b); + u3_weak c = u3qdb_has(a, b); u3z(a); u3z(b); if ( u3_none == c ) { diff --git a/jets/stage/d/by_jab.c b/jets/stage/d/by_jab.c index 19f4607ad..f147232a2 100644 --- a/jets/stage/d/by_jab.c +++ b/jets/stage/d/by_jab.c @@ -7,7 +7,7 @@ /* functions */ u3_noun - u3qdb__stage_jab(u3_noun a, + u3qdb_jab(u3_noun a, u3_noun key, u3_noun fun) { @@ -29,11 +29,11 @@ return u3nc(u3nc(u3k(pn_a), value), u3k(u3t(a))); } else { - if ( c3y == u3qc__stage_gor(key, pn_a) ) { - return u3nt(u3k(n_a), u3qdb__stage_jab(l_a, key, fun), u3k(r_a)); + if ( c3y == u3qc_gor(key, pn_a) ) { + return u3nt(u3k(n_a), u3qdb_jab(l_a, key, fun), u3k(r_a)); } else { - return u3nt(u3k(n_a), u3k(l_a), u3qdb__stage_jab(r_a, key, fun)); + return u3nt(u3k(n_a), u3k(l_a), u3qdb_jab(r_a, key, fun)); } } } @@ -41,7 +41,7 @@ } u3_noun - u3wdb__stage_jab(u3_noun cor) + u3wdb_jab(u3_noun cor) { u3_noun a, key, fun; @@ -50,7 +50,7 @@ u3x_con_sam, &a, 0) ) { return u3m_bail(c3__exit); } else { - u3_noun n = u3qdb__stage_jab(a, key, fun); + u3_noun n = u3qdb_jab(a, key, fun); return n; } } diff --git a/jets/stage/d/by_put.c b/jets/stage/d/by_put.c index dd81fea73..5bafdc0c2 100644 --- a/jets/stage/d/by_put.c +++ b/jets/stage/d/by_put.c @@ -7,7 +7,7 @@ /* functions */ u3_noun - u3qdb__stage_put(u3_noun a, + u3qdb_put(u3_noun a, u3_noun b, u3_noun c) { @@ -38,10 +38,10 @@ } } else { - if ( c3y == u3qc__stage_gor(b, pn_a) ) { - d = u3qdb__stage_put(l_a, b, c); + if ( c3y == u3qc_gor(b, pn_a) ) { + d = u3qdb_put(l_a, b, c); - if ( c3y == u3qc__stage_vor(pn_a, u3h(u3h(d))) ) { + if ( c3y == u3qc_vor(pn_a, u3h(u3h(d))) ) { return u3nt(u3k(n_a), d, u3k(r_a)); @@ -62,9 +62,9 @@ } } else { - d = u3qdb__stage_put(r_a, b, c); + d = u3qdb_put(r_a, b, c); - if ( c3y == u3qc__stage_vor(pn_a, u3h(u3h(d))) ) { + if ( c3y == u3qc_vor(pn_a, u3h(u3h(d))) ) { return u3nt(u3k(n_a), u3k(l_a), d); @@ -88,7 +88,7 @@ } } u3_noun - u3wdb__stage_put(u3_noun cor) + u3wdb_put(u3_noun cor) { u3_noun a, b, c; @@ -97,11 +97,11 @@ u3x_con_sam, &a, 0) ) { return u3m_bail(c3__exit); } else { - return u3qdb__stage_put(a, b, c); + return u3qdb_put(a, b, c); } } u3_weak - u3kdb__stage_put(u3_noun a, + u3kdb_put(u3_noun a, u3_noun b, u3_noun c) { @@ -109,7 +109,7 @@ // // (Mysterious comment in old glue code.) // - u3_noun pro = u3qdb__stage_put(a, b, c); + u3_noun pro = u3qdb_put(a, b, c); u3z(a); u3z(b); u3z(c); return pro; diff --git a/jets/stage/d/in_bif.c b/jets/stage/d/in_bif.c index 5fe6b10fd..4c5bdbeb9 100644 --- a/jets/stage/d/in_bif.c +++ b/jets/stage/d/in_bif.c @@ -25,7 +25,7 @@ u3_noun c, n_c, l_c, r_c; u3_noun d; - if ( c3y == u3qc__stage_hor(b, n_a) ) { + if ( c3y == u3qc_hor(b, n_a) ) { c = _i_bif_putroot(l_a, b); u3r_trel(c, &n_c, &l_c, &r_c); d = u3nt(u3k(n_c), @@ -48,17 +48,17 @@ /* functions */ - u3_noun u3wdi__stage_bif(u3_noun cor) + u3_noun u3wdi_bif(u3_noun cor) { u3_noun a, b; if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { return u3m_bail(c3__exit); } else { - return u3qdi__stage_bif(a, b); + return u3qdi_bif(a, b); } } - u3_noun u3qdi__stage_bif(u3_noun a, + u3_noun u3qdi_bif(u3_noun a, u3_noun b) { u3_noun c, n_c, l_c, r_c; @@ -72,5 +72,5 @@ } /* - u3_weak u3kdi__stage_bif(u3_noun a, u3_noun b); + u3_weak u3kdi_bif(u3_noun a, u3_noun b); */ diff --git a/jets/stage/d/in_del.c b/jets/stage/d/in_del.c index 859bacaf5..02390ccce 100644 --- a/jets/stage/d/in_del.c +++ b/jets/stage/d/in_del.c @@ -29,7 +29,7 @@ return u3m_bail(c3__exit); } else { - if ( c3y == u3qc__stage_vor(n_l_a, n_r_a) ) { + if ( c3y == u3qc_vor(n_l_a, n_r_a) ) { u3_noun new_right = u3nt(u3k(n_a), u3k(r_l_a), u3k(r_a)); @@ -59,7 +59,7 @@ } u3_noun - u3qdi__stage_del(u3_noun a, + u3qdi_del(u3_noun a, u3_noun b) { if ( u3_nul == a ) { @@ -72,15 +72,15 @@ return u3m_bail(c3__exit); } else if ( c3n == u3r_sing(n_a, b) ) { - if ( c3y == u3qc__stage_hor(b, n_a) ) { + if ( c3y == u3qc_hor(b, n_a) ) { return u3nt(u3k(n_a), - u3qdi__stage_del(l_a, b), + u3qdi_del(l_a, b), u3k(r_a)); } else { return u3nt(u3k(n_a), u3k(l_a), - u3qdi__stage_del(r_a, b)); + u3qdi_del(r_a, b)); } } else { @@ -90,7 +90,7 @@ } u3_noun - u3wdi__stage_del(u3_noun cor) + u3wdi_del(u3_noun cor) { u3_noun a, b; @@ -99,7 +99,7 @@ return u3m_bail(c3__exit); } else { - u3_noun n = u3qdi__stage_del(a, b); + u3_noun n = u3qdi_del(a, b); return n; } } diff --git a/jets/stage/d/in_dif.c b/jets/stage/d/in_dif.c index 84026a40f..389cc1fa5 100644 --- a/jets/stage/d/in_dif.c +++ b/jets/stage/d/in_dif.c @@ -21,7 +21,7 @@ || c3n == u3r_trel(e, &n_e, &l_e, &r_e) ) { return u3m_bail(c3__exit); } else { - if ( c3y == u3qc__stage_vor(n_d, n_e) ) { + if ( c3y == u3qc_vor(n_d, n_e) ) { return u3nt(u3k(n_d), u3k(l_d), _i_dif_join(u3k(r_d), u3k(e))); @@ -36,17 +36,17 @@ /* functions */ - u3_noun u3wdi__stage_dif(u3_noun cor) + u3_noun u3wdi_dif(u3_noun cor) { u3_noun a, b; if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { return u3m_bail(c3__exit); } else { - return u3qdi__stage_dif(a, b); + return u3qdi_dif(a, b); } } - u3_noun u3qdi__stage_dif(u3_noun a, + u3_noun u3qdi_dif(u3_noun a, u3_noun b) { if ( u3_nul == b ) { @@ -59,7 +59,7 @@ return u3m_bail(c3__exit); } else { - c = u3qdi__stage_bif(a, n_b); + c = u3qdi_bif(a, n_b); if ( c3n == u3r_cell(c, &l_c, &r_c) ) { return u3m_bail(c3__exit); @@ -67,8 +67,8 @@ u3_noun d; u3_noun e; - d = u3qdi__stage_dif(l_c, l_b); - e = u3qdi__stage_dif(r_c, r_b); + d = u3qdi_dif(l_c, l_b); + e = u3qdi_dif(r_c, r_b); u3z(c); return _i_dif_join(d, e); @@ -78,5 +78,5 @@ } /* - u3_weak u3kdi__stage_dif(u3_noun a, u3_noun b); + u3_weak u3kdi_dif(u3_noun a, u3_noun b); */ diff --git a/jets/stage/d/in_gas.c b/jets/stage/d/in_gas.c index 60a1630e1..f3f8d7372 100644 --- a/jets/stage/d/in_gas.c +++ b/jets/stage/d/in_gas.c @@ -7,7 +7,7 @@ /* functions */ u3_noun - u3qdi__stage_gas(u3_noun a, + u3qdi_gas(u3_noun a, u3_noun b) { if ( u3_nul == b ) { @@ -21,10 +21,10 @@ u3_noun t_b = u3t(b); u3_noun c; - if ( u3_none == (c = u3qdi__stage_put(a, i_b)) ) { + if ( u3_none == (c = u3qdi_put(a, i_b)) ) { return u3m_bail(c3__exit); } else { - u3_noun d = u3qdi__stage_gas(c, t_b); + u3_noun d = u3qdi_gas(c, t_b); u3z(c); return d; @@ -33,21 +33,21 @@ } } u3_noun - u3wdi__stage_gas(u3_noun cor) + u3wdi_gas(u3_noun cor) { u3_noun a, b; if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { return u3m_bail(c3__exit); } else { - return u3qdi__stage_gas(a, b); + return u3qdi_gas(a, b); } } u3_noun - u3kdi__stage_gas(u3_noun a, + u3kdi_gas(u3_noun a, u3_noun b) { - u3_weak c = u3qdi__stage_gas(a, b); + u3_weak c = u3qdi_gas(a, b); u3z(a); u3z(b); if ( u3_none == c ) { diff --git a/jets/stage/d/in_has.c b/jets/stage/d/in_has.c index d0c59a770..fb142bc74 100644 --- a/jets/stage/d/in_has.c +++ b/jets/stage/d/in_has.c @@ -7,7 +7,7 @@ /* functions */ u3_noun - u3qdi__stage_has(u3_noun a, + u3qdi_has(u3_noun a, u3_noun b) { if ( u3_nul == a ) { @@ -24,30 +24,30 @@ return c3y; } else { - if ( c3y == u3qc__stage_hor(b, n_a) ) { - return u3qdi__stage_has(l_a, b); + if ( c3y == u3qc_hor(b, n_a) ) { + return u3qdi_has(l_a, b); } - else return u3qdi__stage_has(r_a, b); + else return u3qdi_has(r_a, b); } } } } u3_noun - u3wdi__stage_has(u3_noun cor) + u3wdi_has(u3_noun cor) { u3_noun a, b; if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { return u3m_bail(c3__exit); } else { - return u3qdi__stage_has(a, b); + return u3qdi_has(a, b); } } u3_noun - u3kdi__stage_has(u3_noun a, + u3kdi_has(u3_noun a, u3_noun b) { - u3_weak c = u3qdi__stage_has(a, b); + u3_weak c = u3qdi_has(a, b); u3z(a); u3z(b); if ( u3_none == c ) { diff --git a/jets/stage/d/in_mer.c b/jets/stage/d/in_mer.c index 957368721..14fa6675f 100644 --- a/jets/stage/d/in_mer.c +++ b/jets/stage/d/in_mer.c @@ -7,7 +7,7 @@ /* functions */ u3_noun - u3qdi__stage_mer(u3_noun a, + u3qdi_mer(u3_noun a, u3_noun b) { if ( u3_nul == a ) { @@ -28,7 +28,7 @@ return u3m_bail(c3__exit); } else { - if ( c3y == u3qc__stage_vor(n_b, n_a) ) { + if ( c3y == u3qc_vor(n_b, n_a) ) { c = a; a = b; b = c; c = n_a; n_a = n_b; n_b = c; c = lr_a; lr_a = lr_b; lr_b = c; @@ -41,12 +41,12 @@ } else if ( c3y == u3r_sing(n_a, n_b) ) { return u3nt(u3k(n_a), - u3qdi__stage_mer(l_a, l_b), - u3qdi__stage_mer(r_a, r_b)); + u3qdi_mer(l_a, l_b), + u3qdi_mer(r_a, r_b)); } - else if ( c3y == u3qc__stage_hor(n_b, n_a) ) { - return u3qdi__stage_mer(u3nt(n_a, - u3qdi__stage_mer(l_a, + else if ( c3y == u3qc_hor(n_b, n_a) ) { + return u3qdi_mer(u3nt(n_a, + u3qdi_mer(l_a, u3nt(n_b, l_b, u3_nul)), @@ -54,9 +54,9 @@ r_b); } else { - return u3qdi__stage_mer(u3nt(n_a, + return u3qdi_mer(u3nt(n_a, l_a, - u3qdi__stage_mer(r_a, + u3qdi_mer(r_a, u3nt(n_b, u3_nul, r_b))), @@ -67,7 +67,7 @@ } u3_noun - u3wdi__stage_mer(u3_noun cor) + u3wdi_mer(u3_noun cor) { u3_noun a, b; @@ -75,6 +75,6 @@ return u3m_bail(c3__exit); } else { - return u3qdi__stage_mer(a, b); + return u3qdi_mer(a, b); } } diff --git a/jets/stage/d/in_put.c b/jets/stage/d/in_put.c index 973c3cf80..10d2c4329 100644 --- a/jets/stage/d/in_put.c +++ b/jets/stage/d/in_put.c @@ -7,7 +7,7 @@ /* functions */ u3_noun - u3qdi__stage_put(u3_noun a, + u3qdi_put(u3_noun a, u3_noun b) { if ( u3_nul == a ) { @@ -27,10 +27,10 @@ return u3m_bail(c3__exit); } else { - if ( c3y == u3qc__stage_hor(b, n_a) ) { - c = u3qdi__stage_put(l_a, b); + if ( c3y == u3qc_hor(b, n_a) ) { + c = u3qdi_put(l_a, b); - if ( c3y == u3qc__stage_vor(n_a, u3h(c)) ) { + if ( c3y == u3qc_vor(n_a, u3h(c)) ) { return u3nt(u3k(n_a), c, u3k(r_a)); @@ -50,9 +50,9 @@ } } else { - c = u3qdi__stage_put(r_a, b); + c = u3qdi_put(r_a, b); - if ( c3y == u3qc__stage_vor(n_a, u3h(c)) ) { + if ( c3y == u3qc_vor(n_a, u3h(c)) ) { return u3nt(u3k(n_a), u3k(l_a), c); @@ -75,25 +75,25 @@ } } u3_noun - u3wdi__stage_put(u3_noun cor) + u3wdi_put(u3_noun cor) { u3_noun a, b; if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { return u3m_bail(c3__exit); } else { - return u3qdi__stage_put(a, b); + return u3qdi_put(a, b); } } u3_weak - u3kdi__stage_put(u3_noun a, + u3kdi_put(u3_noun a, u3_noun b) { // Bizarre asymmetry in old jets. // // (Mysterious comment in old glue code.) // - u3_noun pro = u3qdi__stage_put(a, b); + u3_noun pro = u3qdi_put(a, b); u3z(a); u3z(b); return pro; diff --git a/jets/stage/d/in_uni.c b/jets/stage/d/in_uni.c index b5c0c5662..85f07b835 100644 --- a/jets/stage/d/in_uni.c +++ b/jets/stage/d/in_uni.c @@ -23,11 +23,11 @@ _in_uni(u3_noun a, u3_noun b) { return u3m_bail(c3__exit); } - else if ( c3n == u3qc__stage_vor(n_a, n_b) ) { + else if ( c3n == u3qc_vor(n_a, n_b) ) { if ( c3y == u3r_sing(n_a, n_b) ) { return u3nt(u3k(n_b), _in_uni(l_a, l_b), _in_uni(r_a, r_b)); } - else if ( c3y == u3qc__stage_hor(n_a, n_b) ) { + else if ( c3y == u3qc_hor(n_a, n_b) ) { naw = u3nt(u3k(n_a), u3k(l_a), u3_nul); sub = _in_uni(naw, l_b); neb = u3nt(u3k(n_b), sub, u3k(r_b)); @@ -47,7 +47,7 @@ _in_uni(u3_noun a, u3_noun b) else if ( c3y == u3r_sing(n_b, n_a) ) { return u3nt(u3k(n_b), _in_uni(l_a, l_b), _in_uni(r_a, r_b)); } - else if ( c3y == u3qc__stage_hor(n_b, n_a) ) { + else if ( c3y == u3qc_hor(n_b, n_a) ) { neb = u3nt(u3k(n_b), u3k(l_b), u3_nul); sub = _in_uni(l_a, neb); naw = u3nt(u3k(n_a), sub, u3k(r_a)); @@ -69,10 +69,10 @@ _in_uni(u3_noun a, u3_noun b) /* functions */ u3_noun - u3kdi__stage_uni(u3_noun a, + u3kdi_uni(u3_noun a, u3_noun b) { - u3_noun c = u3qdi__stage_uni(a, b); + u3_noun c = u3qdi_uni(a, b); u3z(a); u3z(b); @@ -80,7 +80,7 @@ _in_uni(u3_noun a, u3_noun b) } u3_noun - u3qdi__stage_uni(u3_noun a, + u3qdi_uni(u3_noun a, u3_noun b) { if ( c3y == u3r_sing(a, b) ) { @@ -91,14 +91,14 @@ _in_uni(u3_noun a, u3_noun b) } } u3_noun - u3wdi__stage_uni(u3_noun cor) + u3wdi_uni(u3_noun cor) { u3_noun a, b; if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { return u3m_bail(c3__exit); } else { - return u3qdi__stage_uni(a, b); + return u3qdi_uni(a, b); } } diff --git a/jets/stage/f/fork.c b/jets/stage/f/fork.c index 4b562eb3a..37aaad236 100644 --- a/jets/stage/f/fork.c +++ b/jets/stage/f/fork.c @@ -7,7 +7,7 @@ /* functions */ u3_noun - u3qf__stage_forq(u3_noun hoz, + u3qf_forq(u3_noun hoz, u3_noun bur) { if ( c3y == u3r_sing(hoz, bur) ) { @@ -19,11 +19,11 @@ else if ( c3__void == hoz ) { return u3k(bur); } - else return u3kf__stage_fork(u3nt(u3k(hoz), u3k(bur), u3_nul)); + else return u3kf_fork(u3nt(u3k(hoz), u3k(bur), u3_nul)); } u3_noun - u3qf__stage_fork(u3_noun yed) + u3qf_fork(u3_noun yed) { u3_noun lez = u3_nul; @@ -32,10 +32,10 @@ if ( c3__void != i_yed ) { if ( (c3y == u3du(i_yed)) && (c3__fork == u3h(i_yed)) ) { - lez = u3kdi__stage_uni(lez, u3k(u3t(i_yed))); + lez = u3kdi_uni(lez, u3k(u3t(i_yed))); } else { - lez = u3kdi__stage_put(lez, u3k(i_yed)); + lez = u3kdi_put(lez, u3k(i_yed)); } } @@ -57,21 +57,21 @@ } u3_noun - u3wf__stage_fork(u3_noun cor) + u3wf_fork(u3_noun cor) { u3_noun yed; if ( c3n == u3r_mean(cor, u3x_sam, &yed, 0) ) { return u3m_bail(c3__fail); } else { - return u3qf__stage_fork(yed); + return u3qf_fork(yed); } } u3_noun - u3kf__stage_fork(u3_noun yed) + u3kf_fork(u3_noun yed) { - u3_noun ret = u3qf__stage_fork(yed); + u3_noun ret = u3qf_fork(yed); u3z(yed); return ret; diff --git a/jets/stage/f/look.c b/jets/stage/f/look.c index 4ced245e1..b03df8770 100644 --- a/jets/stage/f/look.c +++ b/jets/stage/f/look.c @@ -1,4 +1,4 @@ -/* j/6/lork.c +/* j/6/look.c ** */ #include "all.h" @@ -46,7 +46,7 @@ u3k(qn_dab)); } else { - if ( c3y == u3qc__stage_gor(cog, pn_dab) ) { + if ( c3y == u3qc_gor(cog, pn_dab) ) { return u3_nul; } else { @@ -67,7 +67,7 @@ u3k(qn_dab)); } else { - if ( c3y == u3qc__stage_gor(cog, pn_dab) ) { + if ( c3y == u3qc_gor(cog, pn_dab) ) { u3_noun pro; axe = u3qc_peg(axe, 3); @@ -88,7 +88,7 @@ u3k(qn_dab)); } else { - if ( c3y == u3qc__stage_gor(cog, pn_dab) ) { + if ( c3y == u3qc_gor(cog, pn_dab) ) { u3_noun pro; axe = u3qc_peg(axe, 6); @@ -116,19 +116,19 @@ /* functions */ u3_noun - u3qf__stage_look(u3_noun cog, + u3qf_look(u3_noun cog, u3_noun dab) { return _look_in(cog, dab, 1); } u3_noun - u3wf__stage_look(u3_noun cor) + u3wf_look(u3_noun cor) { u3_noun cog, dab; if ( c3n == u3r_mean(cor, u3x_sam_2, &cog, u3x_sam_3, &dab, 0) ) { return u3m_bail(c3__fail); } else { - return u3qf__stage_look(cog, dab); + return u3qf_look(cog, dab); } } diff --git a/jets/stage/f/loot.c b/jets/stage/f/loot.c index 72f9b9442..06abf7542 100644 --- a/jets/stage/f/loot.c +++ b/jets/stage/f/loot.c @@ -1,4 +1,4 @@ -/* j/6/lort.c +/* j/6/loot.c ** */ #include "all.h" @@ -23,7 +23,7 @@ } else { u3_noun qqn_dom = u3t(u3t(n_dom)); - u3_noun yep = u3qf__stage_look(cog, qqn_dom); + u3_noun yep = u3qf_look(cog, qqn_dom); if ( (u3_nul == l_dom) && (u3_nul == r_dom) ) { if ( u3_nul == yep ) { @@ -115,19 +115,19 @@ /* functions */ u3_noun - u3qf__stage_loot(u3_noun cog, + u3qf_loot(u3_noun cog, u3_noun dom) { return _loot_in(cog, dom, 1); } u3_noun - u3wf__stage_loot(u3_noun cor) + u3wf_loot(u3_noun cor) { u3_noun cog, dom; if ( c3n == u3r_mean(cor, u3x_sam_2, &cog, u3x_sam_3, &dom, 0) ) { return u3m_bail(c3__fail); } else { - return u3qf__stage_loot(cog, dom); + return u3qf_loot(cog, dom); } } diff --git a/jets/stage/f/ut.c b/jets/stage/f/ut.c index e8a68f998..9fcf3ec1a 100644 --- a/jets/stage/f/ut.c +++ b/jets/stage/f/ut.c @@ -10,11 +10,11 @@ // duck: create a duck core for mean. // u3_noun - u3qfu__stage_duck(u3_noun van, + u3qfu_duck(u3_noun van, u3_noun typ) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(typ), 0); - u3_noun ret = u3j_cook("u3qfu__stage_duck-dune", u3k(von), "dune"); + u3_noun ret = u3j_cook("u3qfu_duck-dune", u3k(von), "dune"); u3z(von); return ret; @@ -23,12 +23,12 @@ // dung: create a dunk core for mean (noun caption) // u3_noun - u3qfu__stage_dung(u3_noun van, + u3qfu_dung(u3_noun van, u3_noun paz, u3_noun typ) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(typ), 0); - u3_noun duq = u3j_cook("u3qfu__stage_dung-dunk", u3k(von), "dunk"); + u3_noun duq = u3j_cook("u3qfu_dung-dunk", u3k(von), "dunk"); u3_noun ret = u3i_molt(u3k(duq), u3x_sam, u3k(paz), 0); u3z(duq); @@ -39,12 +39,12 @@ // dunq: create a dunk core for mean // u3_noun - u3qfu__stage_dunq(u3_noun van, + u3qfu_dunq(u3_noun van, const c3_c* paz_c, u3_noun typ) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(typ), 0); - u3_noun duq = u3j_cook("u3qfu__stage_dunq-dunk", u3k(von), "dunk"); + u3_noun duq = u3j_cook("u3qfu_dunq-dunk", u3k(von), "dunk"); u3_noun paz = u3i_string(paz_c); u3_noun ret = u3i_molt(u3k(duq), u3x_sam, u3k(paz), 0); @@ -57,7 +57,7 @@ // dump: dump a type. // void - u3qfu__stage_dump(u3_noun van, + u3qfu_dump(u3_noun van, const c3_c* paz_c, u3_noun typ) { @@ -65,19 +65,19 @@ c3_c ugh_c[1024]; sprintf(ugh_c, "%s: %s: 0x%8x:", - paz_c, pfix_c, u3r__stage_mug(typ)); + paz_c, pfix_c, u3r_mug(typ)); #if 0 - u3_pier_tank(0, u3n_kick_on(u3qfu__stage_dunq(van, ugh_c, typ))); + u3_pier_tank(0, u3n_kick_on(u3qfu_dunq(van, ugh_c, typ))); #endif } // shew: create a show core for mean // u3_noun - u3qfu__stage_shew(u3_noun van, + u3qfu_shew(u3_noun van, u3_noun mol) { - u3_noun sho = u3j_cook("u3qfu__stage_shew-show", u3k(van), "show"); + u3_noun sho = u3j_cook("u3qfu_shew-show", u3k(van), "show"); u3_noun ret = u3i_molt(u3k(sho), u3x_sam, u3k(mol), 0); u3z(sho); @@ -88,12 +88,12 @@ // shep: show with caption and style // u3_noun - u3qfu__stage_shep(u3_noun van, + u3qfu_shep(u3_noun van, const c3_c* paz_c, u3_noun sty, u3_noun mol) { - return u3qfu__stage_shew(van, + return u3qfu_shew(van, u3nc(u3nc('c', u3i_string(paz_c)), u3nc(u3k(sty), mol))); } diff --git a/jets/stage/f/ut_buss.c b/jets/stage/f/ut_buss.c index bce8db03c..144046d8a 100644 --- a/jets/stage/f/ut_buss.c +++ b/jets/stage/f/ut_buss.c @@ -13,7 +13,7 @@ u3_noun gen) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_stage_cqfu_buss-buss", von, "buss"); + u3_noun gat = u3j_cook("_cqfu_buss-buss", von, "buss"); return u3n_kick_on(u3i_molt(gat, u3x_sam_2, @@ -29,7 +29,7 @@ u3_noun gen) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_stage_cqfu_busk-busk", von, "busk"); + u3_noun gat = u3j_cook("_cqfu_busk-busk", von, "busk"); return u3n_kick_on(u3i_molt(gat, u3x_sam, @@ -40,7 +40,7 @@ /* boilerplate */ u3_noun - u3wfu__stage_buss(u3_noun cor) + u3wfu_buss(u3_noun cor) { u3_noun sut, cog, gen, van; @@ -58,7 +58,7 @@ } u3_noun - u3qfu__stage_buss(u3_noun van, + u3qfu_buss(u3_noun van, u3_noun sut, u3_noun cog, u3_noun gen) @@ -68,7 +68,7 @@ u3_noun - u3wfu__stage_busk(u3_noun cor) + u3wfu_busk(u3_noun cor) { u3_noun sut, gen, van; @@ -84,7 +84,7 @@ } u3_noun - u3qfu__stage_busk(u3_noun van, + u3qfu_busk(u3_noun van, u3_noun sut, u3_noun gen) { diff --git a/jets/stage/f/ut_conk.c b/jets/stage/f/ut_conk.c index 569cf1ed4..d851143a1 100644 --- a/jets/stage/f/ut_conk.c +++ b/jets/stage/f/ut_conk.c @@ -32,19 +32,19 @@ return ret; } case 2: { - u3_noun vet = u3r_at(u3qfu__stage_van_vet, van); + u3_noun vet = u3r_at(u3qfu_van_vet, van); u3_noun hed, tal, deh, lat, ret; if ( c3y == vet ) { u3_noun cel = u3nt(c3__cell, c3__noun, c3__noun); - if ( c3n == u3qfu__stage_nest(van, cel, c3y, sut) ) { + if ( c3n == u3qfu_nest(van, cel, c3y, sut) ) { return u3m_bail(c3__fail); } u3z(cel); } - hed = u3qfu__stage_peek(van, sut, c3__both, 2); - tal = u3qfu__stage_peek(van, sut, c3__both, 3); + hed = u3qfu_peek(van, sut, c3__both, 2); + tal = u3qfu_peek(van, sut, c3__both, 3); deh = _cqfu_conk(van, hed, u3h(u3t(got))); lat = _cqfu_conk(van, tal, u3t(u3t(got))); @@ -63,7 +63,7 @@ /* boilerplate */ u3_noun - u3wfu__stage_conk(u3_noun cor) + u3wfu_conk(u3_noun cor) { u3_noun sut, got, van; @@ -79,7 +79,7 @@ } u3_noun - u3qfu__stage_conk(u3_noun van, + u3qfu_conk(u3_noun van, u3_noun sut, u3_noun got) { diff --git a/jets/stage/f/ut_crop.c b/jets/stage/f/ut_crop.c index 7e6a31aff..c558737cc 100644 --- a/jets/stage/f/ut_crop.c +++ b/jets/stage/f/ut_crop.c @@ -16,7 +16,7 @@ u3_noun ref, u3_noun bix) { - u3_noun rep = u3qfu__stage_repo(van, sut); + u3_noun rep = u3qfu_repo(van, sut); u3_noun ret = _crop_dext(van, rep, ref, bix); if ( c3y == u3r_sing(ret, rep) ) { @@ -122,7 +122,7 @@ else if ( c3__cell == u3h(ref) ) { u3x_cell(u3t(ref), &p_ref, &q_ref); - if ( c3y == u3qfu__stage_nest(van, p_ref, c3n, p_sut) ) + if ( c3y == u3qfu_nest(van, p_ref, c3n, p_sut) ) { u3_noun foz = _crop_dext(van, q_sut, q_ref, bix); u3_noun ret = u3qf_cell(p_sut, foz); @@ -160,8 +160,8 @@ } case c3__fork: p_sut = u3t(sut); { - u3_noun yed = u3qdi__stage_tap(p_sut); - u3_noun ret = u3kf__stage_fork(_crop_dext_fork(van, yed, ref, bix)); + u3_noun yed = u3qdi_tap(p_sut); + u3_noun ret = u3kf_fork(_crop_dext_fork(van, yed, ref, bix)); u3z(yed); return ret; @@ -170,10 +170,10 @@ { u3_noun hud = u3nc(u3k(sut), u3k(ref)); - if ( c3y == u3qdi__stage_has(bix, hud) ) { + if ( c3y == u3qdi_has(bix, hud) ) { # if 0 - u3_noun dun = u3qfu__stage_dunq(van, "type", sut); - u3_noun niz = u3qfu__stage_dunq(van, "over", ref); + u3_noun dun = u3qfu_dunq(van, "type", sut); + u3_noun niz = u3qfu_dunq(van, "over", ref); u3t_push(u3nc(c3__mean, dun)); u3t_push(u3nc(c3__mean, niz)); @@ -181,7 +181,7 @@ return u3m_error("crop-loop"); } else { - u3_noun bux = u3qdi__stage_put(bix, hud); + u3_noun bux = u3qdi_put(bix, hud); u3_noun ret = _crop_repo(van, sut, ref, bux); u3z(hud); @@ -211,7 +211,7 @@ } case c3__fork: p_ref = u3t(ref); { - u3_noun yed = u3qdi__stage_tap(p_ref); + u3_noun yed = u3qdi_tap(p_ref); u3_noun ret = _crop_sint_fork(van, sut, yed, bix); u3z(yed); @@ -219,7 +219,7 @@ } case c3__hold: { - u3_noun rep = u3qfu__stage_repo(van, ref); + u3_noun rep = u3qfu_repo(van, ref); u3_noun ret = _crop_dext(van, sut, rep, bix); u3z(rep); @@ -239,7 +239,7 @@ /* boilerplate */ u3_noun - u3wfu__stage_crop(u3_noun cor) + u3wfu_crop(u3_noun cor) { u3_noun sut, ref, van; @@ -253,11 +253,11 @@ } u3_noun - u3qfu__stage_crop(u3_noun van, + u3qfu_crop(u3_noun van, u3_noun sut, u3_noun ref) { - c3_m fun_m = 200 + c3__crop + ((!!u3r_at(u3qfu__stage_van_vet, van)) << 8); + c3_m fun_m = 141 + c3__crop + ((!!u3r_at(u3qfu_van_vet, van)) << 8); u3_noun pro = u3z_find_2(fun_m, sut, ref); if ( u3_none != pro ) { diff --git a/jets/stage/f/ut_find.c b/jets/stage/f/ut_find.c index 7f85ad9f5..bde859ee9 100644 --- a/jets/stage/f/ut_find.c +++ b/jets/stage/f/ut_find.c @@ -13,14 +13,14 @@ u3_noun lon, u3_noun gil); -/* `u3qfu__stage_felt_arm` is a helper function for - * u3qfu__stage_felt. It handles the case in which the +/* `u3qfu_felt_arm` is a helper function for + * u3qfu_felt. It handles the case in which the * opal is for an arm, by creating a list of * parent core types. These will be converted to * a single `fork` type. */ static u3_noun - u3qfu__stage_felt_arm(u3_noun lis) + u3qfu_felt_arm(u3_noun lis) { if ( u3_nul == lis ) { return u3_nul; @@ -40,19 +40,19 @@ u3x_trel(q_typ, &pq_typ, &qq_typ, &rq_typ); u3_noun dox = u3nt(c3__core, u3k(qq_typ), u3k(q_typ)); - return u3nc(dox, u3qfu__stage_felt_arm(t_lis)); + return u3nc(dox, u3qfu_felt_arm(t_lis)); } } } -/* `u3qfu__stage_felt` takes an opal, lap, and converts +/* `u3qfu_felt` takes an opal, lap, and converts * it to a type. The opal comes from the last * limb of the wing processed by `+fond`. The * type is used in +fond as the subject type of * the next limb in the wing. */ static u3_noun - u3qfu__stage_felt(u3_noun lap) + u3qfu_felt(u3_noun lap) { u3_noun lim, mil; u3x_cell(lap, &lim, &mil); @@ -63,11 +63,11 @@ else if ( c3n == lim ) { u3_noun p_lap, q_lap, lis, hos; u3x_cell(mil, &p_lap, &q_lap); - lis = u3qdi__stage_tap(q_lap); - hos = u3qfu__stage_felt_arm(lis); + lis = u3qdi_tap(q_lap); + hos = u3qfu_felt_arm(lis); u3z(lis); - return u3kf__stage_fork(hos); + return u3kf_fork(hos); } else { u3m_bail(c3__exit); @@ -75,13 +75,13 @@ } static u3_noun - u3qfu__stage_fund(u3_noun van, + u3qfu_fund(u3_noun van, u3_noun sut, u3_noun way, u3_noun gen) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("u3qfu__stage_fund-fund", von, "fund"); + u3_noun gat = u3j_cook("u3qfu_fund-fund", von, "fund"); return u3n_kick_on(u3i_molt(gat, u3x_sam_2, @@ -92,12 +92,12 @@ } static u3_noun - u3qfu__stage_fine(u3_noun van, + u3qfu_fine(u3_noun van, u3_noun sut, u3_noun tor) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("u3qfu__stage_fine-fine", von, "fine"); + u3_noun gat = u3j_cook("u3qfu_fine-fine", von, "fine"); return u3n_kick_on(u3i_molt(gat, u3x_sam, @@ -220,7 +220,7 @@ return _find_buck_here(van, sut, way, p_heg, q_heg, axe, lon, gil); } else { - u3_noun zem = u3qf__stage_loot(u3t(q_heg), qrq_sut); + u3_noun zem = u3qf_loot(u3t(q_heg), qrq_sut); if ( (u3_nul != zem) && (0 != p_heg) ) { u3_noun ped; @@ -260,7 +260,7 @@ return pro; } else { - u3_noun pec = u3qfu__stage_peel(van, sut, way, rpq_sut); + u3_noun pec = u3qfu_peel(van, sut, way, rpq_sut); u3_noun pro; if ( c3n == u3h(pec) ) { @@ -273,7 +273,7 @@ u3z(exa); } else { - u3_noun sam = u3qfu__stage_peek(van, p_sut, way, 2); + u3_noun sam = u3qfu_peek(van, p_sut, way, 2); u3_noun exa = u3qc_peg(axe, 6); pro = _find_buck(van, sam, way, p_heg, q_heg, exa, lon, gil); @@ -326,7 +326,7 @@ return u3nt(c3n, c3n, u3nc( - u3kf__stage_fork(u3nt(u3k(ppp_hax), u3k(ppp_yor), u3_nul)), + u3kf_fork(u3nt(u3k(ppp_hax), u3k(ppp_yor), u3_nul)), u3k(qpp_hax))); } } @@ -357,7 +357,7 @@ return u3nt(c3y, u3k(pp_hax), - u3nc(c3y, u3kf__stage_fork + u3nc(c3y, u3kf_fork (u3nt(u3k(pqp_hax), u3k(pqp_yor), u3_nul)))); } } @@ -375,7 +375,7 @@ return u3nt(c3y, u3k(pp_hax), - u3nt(c3n, u3k(pqp_hax), u3qdi__stage_uni(qqp_hax, qqp_yor))); + u3nt(c3n, u3k(pqp_hax), u3qdi_uni(qqp_hax, qqp_yor))); } } } @@ -439,7 +439,7 @@ u3_noun gil) { u3_noun p_sut = u3t(sut); - u3_noun yed = u3qdi__stage_tap(p_sut); + u3_noun yed = u3qdi_tap(p_sut); u3_noun wiz; u3_noun ret; @@ -472,7 +472,7 @@ } else { u3_noun iqp_sut = u3h(qp_sut); // twig - u3_noun tiv = u3qfu__stage_mint // (pair type nock) + u3_noun tiv = u3qfu_mint // (pair type nock) (van, q_sut, c3__noun, iqp_sut); u3_noun tqp_sut = u3t(qp_sut); // (list twig) u3_noun p_tiv = u3h(tiv); // type @@ -507,7 +507,7 @@ } u3z(fid); - vat = u3qfu__stage_fine(van, sut, tor); + vat = u3qfu_fine(van, sut, tor); u3z(tor); ret = u3nt @@ -556,7 +556,7 @@ else { u3_noun pp_sut = u3h(p_sut); // (map term {wain (unit twig)}) u3_noun qp_sut = u3t(p_sut); // (list (pair type nock)) - u3_noun tyr = u3qdb__stage_get(pp_sut, uq_heg); // (unit (unit twig)) + u3_noun tyr = u3qdb_get(pp_sut, uq_heg); // (unit (unit twig)) if ( u3_nul == tyr ) { return _find_buck_face_next @@ -578,7 +578,7 @@ } else { u3_noun uu_tyr = u3t(u_tyr); - u3_noun tor = u3qfu__stage_fund(van, sut, way, uu_tyr); + u3_noun tor = u3qfu_fund(van, sut, way, uu_tyr); if ( c3y == u3h(tor) ) { u3_noun p_tor = u3t(tor); // (pair vein opal) @@ -659,7 +659,7 @@ } case c3__hint: { - u3_noun fop = u3qfu__stage_repo(van, sut); + u3_noun fop = u3qfu_repo(van, sut); u3_noun pro = _find_buck(van, fop, way, p_heg, q_heg, axe, lon, gil); u3z(fop); return pro; @@ -677,12 +677,12 @@ case c3__hold: { // fprintf(stderr, "hold\r\n"); - if ( (c3y == u3qdi__stage_has(gil, sut)) ) { + if ( (c3y == u3qdi_has(gil, sut)) ) { return u3_nul; } else { - u3_noun zoc = u3qdi__stage_put(gil, sut); - u3_noun fop = u3qfu__stage_repo(van, sut); + u3_noun zoc = u3qdi_put(gil, sut); + u3_noun fop = u3qfu_repo(van, sut); u3_noun pro = _find_buck(van, fop, way, p_heg, q_heg, axe, lon, zoc); u3z(fop); @@ -705,7 +705,7 @@ u3_noun qp_mor = u3t(p_mor); // opal { - u3_noun ref = u3qfu__stage_felt(qp_mor); + u3_noun ref = u3qfu_felt(qp_mor); u3_noun lon = u3k(pp_mor); u3_noun heg = (c3y == u3du(i_hyp)) ? u3k(i_hyp) @@ -723,7 +723,7 @@ ret = u3nt (c3y, u3nc(u3nc(u3_nul, u3k(p_heg)), u3k(lon)), - u3nc(c3y, u3qfu__stage_peek(van, ref, way, p_heg))); + u3nc(c3y, u3qfu_peek(van, ref, way, p_heg))); } else { u3_noun p_heg = u3h(u3t(heg)); // @ud @@ -765,7 +765,7 @@ u3_noun ppp_mor = u3h(pp_mor); // span u3_noun qpp_mor = u3t(pp_mor); // nock u3_noun gen = u3nt(c3__wing, u3k(i_hyp), u3_nul); - u3_noun fex = u3qfu__stage_mint(van, ppp_mor, c3__noun, gen); + u3_noun fex = u3qfu_mint(van, ppp_mor, c3__noun, gen); u3_noun ret = u3nt(c3n, c3n, u3nc(u3k(u3h(fex)), @@ -840,7 +840,7 @@ /* boilerplate */ u3_noun - u3wfu__stage_find(u3_noun cor) + u3wfu_find(u3_noun cor) { u3_noun sut, way, hyp, van; @@ -857,12 +857,12 @@ } u3_noun - u3qfu__stage_find(u3_noun van, + u3qfu_find(u3_noun van, u3_noun sut, u3_noun way, u3_noun hyp) { - c3_m fun_m = 200 + c3__find + ((!!u3r_at(u3qfu__stage_van_vet, van)) << 8); + c3_m fun_m = 141 + c3__find + ((!!u3r_at(u3qfu_van_vet, van)) << 8); u3_noun pro = u3z_find_3(fun_m, sut, way, hyp); if ( u3_none != pro ) { @@ -878,7 +878,7 @@ /* boilerplate */ u3_noun - u3wfu__stage_fond(u3_noun cor) + u3wfu_fond(u3_noun cor) { u3_noun sut, way, hyp, van; @@ -895,12 +895,12 @@ } u3_noun - u3qfu__stage_fond(u3_noun van, + u3qfu_fond(u3_noun van, u3_noun sut, u3_noun way, u3_noun hyp) { - c3_m fun_m = 200 + c3__fond + ((!!u3r_at(u3qfu__stage_van_vet, van)) << 8); + c3_m fun_m = 141 + c3__fond + ((!!u3r_at(u3qfu_van_vet, van)) << 8); u3_noun pro = u3z_find_3(fun_m, sut, way, hyp); if ( u3_none != pro ) { diff --git a/jets/stage/f/ut_fire.c b/jets/stage/f/ut_fire.c index 552d87f27..873d4524b 100644 --- a/jets/stage/f/ut_fire.c +++ b/jets/stage/f/ut_fire.c @@ -10,7 +10,7 @@ _fire_vet(u3_noun van) { // u3_noun vet = u3j_hook(u3k(van), "vet"); - u3_noun vet = u3r_at(u3qfu__stage_van_vet, van); + u3_noun vet = u3r_at(u3qfu_van_vet, van); switch ( vet ) { case c3n: @@ -25,7 +25,7 @@ u3_noun dox, u3_noun gen) { - u3_noun rib = u3r_at(u3qfu__stage_van_rib, van); + u3_noun rib = u3r_at(u3qfu_van_rib, van); u3_noun key = u3nt(u3k(sut), u3k(dox), u3k(gen)); @@ -34,16 +34,16 @@ if ( c3n == _fire_vet(van) ) { ret = c3y; } - if ( c3y == u3qdi__stage_has(rib, key) ) { + if ( c3y == u3qdi_has(rib, key) ) { ret = c3y; } else { - u3_noun rob = u3qdi__stage_put(rib, key); + u3_noun rob = u3qdi_put(rib, key); u3_noun von = u3i_molt(u3k(van), - u3qfu__stage_van_rib, + u3qfu_van_rib, u3k(rob), 0); - u3_noun mul = u3qfu__stage_mull(von, sut, c3__noun, dox, gen); + u3_noun mul = u3qfu_mull(von, sut, c3__noun, dox, gen); ret = c3y; @@ -83,11 +83,11 @@ if ( (c3__ash == u3h(gat)) || (c3__dry == u3h(gat)) ) { if ( (c3y == vet) && - (c3n == u3qfu__stage_nest(van, qq_typ, c3y, p_typ)) ) + (c3n == u3qfu_nest(van, qq_typ, c3y, p_typ)) ) { #if 0 - u3_noun dun = u3qfu__stage_dunq(van, "need", qq_typ); - u3_noun niz = u3qfu__stage_dunq(van, "have", p_typ); + u3_noun dun = u3qfu_dunq(van, "need", qq_typ); + u3_noun niz = u3qfu_dunq(van, "have", p_typ); u3t_push(u3nc(c3__mean, niz)); u3t_push(u3nc(c3__mean, dun)); @@ -101,8 +101,8 @@ else { c3_assert(c3__wet == u3h(gat)); #if 0 - u3_noun dun = u3qfu__stage_dunq(van, "wild", typ); - u3_noun niz = u3qfu__stage_dunq(van, "tame", dox); + u3_noun dun = u3qfu_dunq(van, "wild", typ); + u3_noun niz = u3qfu_dunq(van, "tame", dox); u3t_push(u3nc(c3__mean, dun)); u3t_push(u3nc(c3__mean, niz)); @@ -151,7 +151,7 @@ u3_noun sut, u3_noun hag) { - u3_noun vet = u3r_at(u3qfu__stage_van_vet, van); + u3_noun vet = u3r_at(u3qfu_van_vet, van); c3_assert(!"not live"); { @@ -178,7 +178,7 @@ /* boilerplate */ u3_noun - u3wfu__stage_fire(u3_noun cor) + u3wfu_fire(u3_noun cor) { u3_noun sut, hag, van; @@ -192,7 +192,7 @@ } u3_noun - u3qfu__stage_fire(u3_noun van, + u3qfu_fire(u3_noun van, u3_noun sut, u3_noun hag) { diff --git a/jets/stage/f/ut_fish.c b/jets/stage/f/ut_fish.c index bc218533b..6454e20b5 100644 --- a/jets/stage/f/ut_fish.c +++ b/jets/stage/f/ut_fish.c @@ -102,7 +102,7 @@ } case c3__fork: p_sut = u3t(sut); { - u3_noun yed = u3qdi__stage_tap(p_sut); + u3_noun yed = u3qdi_tap(p_sut); u3_noun ret = _fish_fork(van, yed, axe, vit); u3z(yed); @@ -111,9 +111,9 @@ case c3__hold: { p_sut = u3t(sut); { - if ( (c3y == u3qdi__stage_has(vit, sut)) ) { - // u3_noun dun = u3qfu__stage_dunq(van, "type", sut); - u3_noun niz = u3qfu__stage_shep + if ( (c3y == u3qdi_has(vit, sut)) ) { + // u3_noun dun = u3qfu_dunq(van, "type", sut); + u3_noun niz = u3qfu_shep (van, "axis", 'd', u3k(axe)); // u3t_push(u3nc(c3__mean, dun)); @@ -121,8 +121,8 @@ return u3m_error("fish-loop"); } else { - u3_noun zoc = u3qdi__stage_put(vit, sut); - u3_noun fop = u3qfu__stage_repo(van, sut); + u3_noun zoc = u3qdi_put(vit, sut); + u3_noun fop = u3qfu_repo(van, sut); u3_noun pro = _fish_in(van, fop, axe, zoc); u3z(fop); @@ -147,7 +147,7 @@ /* boilerplate */ u3_noun - u3wfu__stage_fish(u3_noun cor) + u3wfu_fish(u3_noun cor) { u3_noun sut, axe, van; @@ -162,11 +162,11 @@ } u3_noun - u3qfu__stage_fish(u3_noun van, + u3qfu_fish(u3_noun van, u3_noun sut, u3_noun axe) { - c3_m fun_m = 200 + c3__fish + ((!!u3r_at(u3qfu__stage_van_vet, van)) << 8); + c3_m fun_m = 141 + c3__fish + ((!!u3r_at(u3qfu_van_vet, van)) << 8); u3_noun pro = u3z_find_2(fun_m, sut, axe); if ( u3_none != pro ) { diff --git a/jets/stage/f/ut_fuse.c b/jets/stage/f/ut_fuse.c index c65d8e531..069d0ba14 100644 --- a/jets/stage/f/ut_fuse.c +++ b/jets/stage/f/ut_fuse.c @@ -14,7 +14,7 @@ u3_noun ref, u3_noun bix) { - u3_noun rep = u3qfu__stage_repo(van, sut); + u3_noun rep = u3qfu_repo(van, sut); u3_noun ret = _fuse_in(van, rep, ref, bix); if ( c3y == u3r_sing(ret, rep) ) { @@ -142,8 +142,8 @@ } case c3__fork: p_sut = u3t(sut); { - u3_noun yed = u3qdi__stage_tap(p_sut); - u3_noun ret = u3kf__stage_fork(_fuse_in_fork(van, yed, ref, bix)); + u3_noun yed = u3qdi_tap(p_sut); + u3_noun ret = u3kf_fork(_fuse_in_fork(van, yed, ref, bix)); u3z(yed); return ret; @@ -152,16 +152,16 @@ { u3_noun hud = u3nc(u3k(sut), u3k(ref)); - if ( c3y == u3qdi__stage_has(bix, hud) ) { - // u3_noun dun = u3qfu__stage_dunq(van, "type", sut); - // u3_noun niz = u3qfu__stage_dunq(van, "over", ref); + if ( c3y == u3qdi_has(bix, hud) ) { + // u3_noun dun = u3qfu_dunq(van, "type", sut); + // u3_noun niz = u3qfu_dunq(van, "over", ref); // u3t_push(u3nc(c3__mean, dun)); // u3t_push(u3nc(c3__mean, niz)); return u3m_error("fuse-loop"); } else { - u3_noun bux = u3qdi__stage_put(bix, hud); + u3_noun bux = u3qdi_put(bix, hud); u3_noun ret = _fuse_repo(van, sut, ref, bux); u3z(hud); @@ -183,7 +183,7 @@ /* boilerplate */ u3_noun - u3wfu__stage_fuse(u3_noun cor) + u3wfu_fuse(u3_noun cor) { u3_noun sut, ref, van; @@ -197,11 +197,11 @@ } u3_noun - u3qfu__stage_fuse(u3_noun van, + u3qfu_fuse(u3_noun van, u3_noun sut, u3_noun ref) { - c3_m fun_m = 200 + c3__fuse + ((!!u3r_at(u3qfu__stage_van_vet, van)) << 8); + c3_m fun_m = 141 + c3__fuse + ((!!u3r_at(u3qfu_van_vet, van)) << 8); u3_noun pro = u3z_find_2(fun_m, sut, ref); if ( u3_none != pro ) { diff --git a/jets/stage/f/ut_gain.c b/jets/stage/f/ut_gain.c index ee8f90d9a..509740ab1 100644 --- a/jets/stage/f/ut_gain.c +++ b/jets/stage/f/ut_gain.c @@ -5,12 +5,12 @@ u3_noun - u3qfu__stage_gain(u3_noun van, + u3qfu_gain(u3_noun van, u3_noun sut, u3_noun gen) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("u3qfu__stage_gain-gain", von, "gain"); + u3_noun gat = u3j_cook("u3qfu_gain-gain", von, "gain"); return u3n_kick_on(u3i_molt(gat, u3x_sam, u3k(gen), 0)); } diff --git a/jets/stage/f/ut_lose.c b/jets/stage/f/ut_lose.c index fd34d74b2..16e9f6c0f 100644 --- a/jets/stage/f/ut_lose.c +++ b/jets/stage/f/ut_lose.c @@ -5,12 +5,12 @@ u3_noun - u3qfu__stage_lose(u3_noun van, + u3qfu_lose(u3_noun van, u3_noun sut, u3_noun gen) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("u3qfu__stage_lose-lose", von, "lose"); + u3_noun gat = u3j_cook("u3qfu_lose-lose", von, "lose"); return u3n_kick_on(u3i_molt(gat, u3x_sam, u3k(gen), 0)); } diff --git a/jets/stage/f/ut_mint.c b/jets/stage/f/ut_mint.c index 9b34dbaf1..54ff5c466 100644 --- a/jets/stage/f/ut_mint.c +++ b/jets/stage/f/ut_mint.c @@ -11,7 +11,7 @@ static u3_noun _mint_bean() { - return u3kf__stage_fork(u3nt(u3nq(c3__atom, 'f', u3_nul, 0), + return u3kf_fork(u3nt(u3nq(c3__atom, 'f', u3_nul, 0), u3nq(c3__atom, 'f', u3_nul, 1), u3_nul)); } @@ -39,7 +39,7 @@ _mint_vet(u3_noun van) { // u3_noun vet = u3j_hook(u3k(van), "vet"); - u3_noun vet = u3r_at(u3qfu__stage_van_vet, van); + u3_noun vet = u3r_at(u3qfu_van_vet, van); switch ( vet ) { case c3n: @@ -134,10 +134,10 @@ u3_noun typ) { if ( (c3y == _mint_vet(van)) && - (c3n == u3qfu__stage_nest(van, gol, c3y, typ)) ) + (c3n == u3qfu_nest(van, gol, c3y, typ)) ) { - // u3_noun dun = u3qfu__stage_dunq(van, "need", gol); - // u3_noun niz = u3qfu__stage_dunq(van, "have", typ); + // u3_noun dun = u3qfu_dunq(van, "need", gol); + // u3_noun niz = u3qfu_dunq(van, "have", typ); // u3t_push(u3nc(c3__mean, dun)); // u3t_push(u3nc(c3__mean, niz)); @@ -188,7 +188,7 @@ u3_noun loc) { u3_noun mol = u3nc('o', u3k(loc)); - u3_noun sho = u3j_cook("_stage_mint_loc-show", u3k(van), "show"); + u3_noun sho = u3j_cook("_mint_loc-show", u3k(van), "show"); u3_noun ret = u3i_molt(u3k(sho), u3x_sam, u3k(mol), 0); u3z(mol); @@ -206,7 +206,7 @@ u3_noun rig) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_stage_mint_cnts-emin", von, "emin"); + u3_noun gat = u3j_cook("_mint_cnts-emin", von, "emin"); return u3n_kick_on(u3i_molt(gat, u3x_sam_2, @@ -228,7 +228,7 @@ { while ( 1 ) { if ( c3n == u3du(mew) ) { - u3_noun gim = u3qfu__stage_fire(van, sut, rag); + u3_noun gim = u3qfu_fire(van, sut, rag); u3_noun fol = u3qf_hike(p_lar, hej); u3z(rag); @@ -240,10 +240,10 @@ u3_noun t_mew = u3t(mew); u3_noun pi_mew = u3h(i_mew); u3_noun qi_mew = u3t(i_mew); - u3_noun zil = u3qfu__stage_mint(van, sut, c3__noun, qi_mew); + u3_noun zil = u3qfu_mint(van, sut, c3__noun, qi_mew); u3_noun p_zil = u3h(zil); u3_noun q_zil = u3t(zil); - u3_noun wip = u3qfu__stage_toss(van, sut, pi_mew, p_zil, rag); + u3_noun wip = u3qfu_toss(van, sut, pi_mew, p_zil, rag); u3z(rag); rag = u3k(u3t(wip)); @@ -266,7 +266,7 @@ u3_noun hyp, u3_noun rig) { - u3_noun lar = u3qfu__stage_seek(van, sut, c3__read, hyp); + u3_noun lar = u3qfu_seek(van, sut, c3__read, hyp); u3_noun p_lar = u3h(lar); u3_noun q_lar = u3t(lar); u3_noun pq_lar = u3h(q_lar); @@ -317,7 +317,7 @@ if ( c3n == u3du(gen) ) { u3_noun ter = u3r_at(u3x_con_3, van); - u3_noun fab = u3r_at(u3qfu__stage_van_fab, van); + u3_noun fab = u3r_at(u3qfu_van_fab, van); u3_noun rex = u3qfp_open(ter, fab, gen); ret = _mint_in(van, sut, gol, rex); @@ -344,12 +344,12 @@ } else switch ( u3h(gen) ) { default: { u3_noun ter = u3r_at(u3x_con_3, van); - u3_noun fab = u3r_at(u3qfu__stage_van_fab, van); + u3_noun fab = u3r_at(u3qfu_van_fab, van); u3_noun rex = u3qfp_open(ter, fab, gen); if ( c3y == u3r_sing(rex, gen) ) { #if 1 - u3_noun zix = u3qfu__stage_shep(van, "gene", 'q', u3k(gen)); + u3_noun zix = u3qfu_shep(van, "gene", 'q', u3k(gen)); u3t_push(u3nc(c3__mean, zix)); return u3m_error("mint-open"); @@ -367,13 +367,13 @@ case c3__fits: u3x_cell(u3t(gen), &p_gen, &q_gen); _mint_used(); { - u3_noun wam = u3qfu__stage_play(van, sut, p_gen); + u3_noun wam = u3qfu_play(van, sut, p_gen); u3_noun dok = u3nc(c3__wing, u3k(q_gen)); u3_noun vol = _mint_corn(van, sut, dok); u3_noun axe = _mint_cove(vol); ret = u3nc(_mint_nice(van, gol, _mint_bean()), - u3qfu__stage_fish(van, wam, axe)); + u3qfu_fish(van, wam, axe)); u3z(axe); u3z(vol); @@ -388,8 +388,8 @@ { u3_noun bol = _mint_bean(); u3_noun nor = _mint_in(van, sut, bol, p_gen); - u3_noun fex = u3qfu__stage_gain(van, sut, p_gen); - u3_noun wux = u3qfu__stage_lose(van, sut, p_gen); + u3_noun fex = u3qfu_gain(van, sut, p_gen); + u3_noun wux = u3qfu_lose(van, sut, p_gen); u3_noun duy = (c3__void == fex) ? ( (c3__void == wux) ? u3nc(0, 0) @@ -400,7 +400,7 @@ u3_noun hiq = _mint_in(van, fex, gol, q_gen); u3_noun ran = _mint_in(van, wux, gol, r_gen); - ret = u3nc(u3qf__stage_forq(u3h(hiq), + ret = u3nc(u3qf_forq(u3h(hiq), u3h(ran)), _mint_cond(duy, u3k(u3t(hiq)), @@ -442,8 +442,8 @@ u3_noun ret; if ( (c3y == _mint_vet(van)) && - (c3n == u3qfu__stage_nest(van, u3h(one), c3n, u3h(two))) && - (c3n == u3qfu__stage_nest(van, u3h(two), c3y, u3h(one))) ) + (c3n == u3qfu_nest(van, u3h(one), c3n, u3h(two))) && + (c3n == u3qfu_nest(van, u3h(two), c3y, u3h(one))) ) { return u3m_error("nest"); } @@ -495,7 +495,7 @@ case c3__rock: u3x_cell(u3t(gen), &p_gen, &q_gen); _mint_used(); { - u3_noun typ = u3qfu__stage_play(van, sut, gen); + u3_noun typ = u3qfu_play(van, sut, gen); u3_noun ret = u3nc(_mint_nice(van, gol, typ), u3nc(1, u3k(q_gen))); @@ -515,7 +515,7 @@ case c3__sand: u3x_cell(u3t(gen), &p_gen, &q_gen); _mint_used(); { - u3_noun typ = u3qfu__stage_play(van, sut, gen); + u3_noun typ = u3qfu_play(van, sut, gen); u3_noun ret = u3nc(_mint_nice(van, gol, typ), u3nc(1, u3k(q_gen))); @@ -532,7 +532,7 @@ _mint_used(); { u3_noun ryd = _mint_in(van, sut, gol, p_gen); - u3_noun tyf = u3qfu__stage_wrap(van, u3h(ryd), c3__iron); + u3_noun tyf = u3qfu_wrap(van, u3h(ryd), c3__iron); u3_noun tyn = _mint_nice(van, gol, tyf); u3_noun pro = u3nc(tyn, u3k(u3t(ryd))); @@ -545,7 +545,7 @@ _mint_used(); { u3_noun ryd = _mint_in(van, sut, gol, p_gen); - u3_noun tyf = u3qfu__stage_wrap(van, u3h(ryd), c3__zinc); + u3_noun tyf = u3qfu_wrap(van, u3h(ryd), c3__zinc); u3_noun tyn = _mint_nice(van, gol, tyf); u3_noun pro = u3nc(tyn, u3k(u3t(ryd))); @@ -557,7 +557,7 @@ _mint_used(); { u3_noun ryd = _mint_in(van, sut, gol, p_gen); - u3_noun tyf = u3qfu__stage_wrap(van, u3h(ryd), c3__lead); + u3_noun tyf = u3qfu_wrap(van, u3h(ryd), c3__lead); u3_noun tyn = _mint_nice(van, gol, tyf); u3_noun pro = u3nc(tyn, u3k(u3t(ryd))); @@ -587,7 +587,7 @@ case c3__ktls: u3x_cell(u3t(gen), &p_gen, &q_gen); _mint_used(); { - u3_noun huz = u3qfu__stage_play(van, sut, p_gen); + u3_noun huz = u3qfu_play(van, sut, p_gen); u3_noun hif = _mint_nice(van, gol, huz); u3_noun zel = _mint_in(van, sut, hif, q_gen); u3_noun ret = u3nc(hif, u3k(u3t(zel))); @@ -622,7 +622,7 @@ case c3__tscm: u3x_cell(u3t(gen), &p_gen, &q_gen); _mint_used(); { - u3_noun boc = u3qfu__stage_busk(van, sut, p_gen); + u3_noun boc = u3qfu_busk(van, sut, p_gen); u3_noun ret = _mint_in(van, boc, gol, q_gen); u3z(boc); @@ -660,8 +660,8 @@ case c3__sgzp: u3x_cell(u3t(gen), &p_gen, &q_gen); _mint_used(); { - u3_noun typ = u3qfu__stage_play(van, sut, p_gen); - u3_noun dug = u3qfu__stage_duck(van, typ); + u3_noun typ = u3qfu_play(van, sut, p_gen); + u3_noun dug = u3qfu_duck(van, typ); u3t_push(u3nc(c3__mean, dug)); { @@ -695,7 +695,7 @@ case c3__zpts: p_gen = u3t(gen); _mint_used(); { - u3_noun von = u3i_molt(u3k(van), u3qfu__stage_van_vet, c3n, 0); + u3_noun von = u3i_molt(u3k(van), u3qfu_van_vet, c3n, 0); u3_noun sev = _mint_corn(von, sut, p_gen); u3z(von); @@ -705,7 +705,7 @@ case c3__ktcn: p_gen = u3t(gen); _mint_used(); { - u3_noun von = u3i_molt(u3k(van), u3qfu__stage_van_fab, c3n, 0); + u3_noun von = u3i_molt(u3k(van), u3qfu_van_fab, c3n, 0); u3_noun ret = _mint_in(von, sut, gol, p_gen); u3z(von); @@ -716,7 +716,7 @@ _mint_used(); { u3_noun hyp = u3nc(u3nc(c3y, 1), u3k(q_gen)); - u3_noun fid = u3qfu__stage_find(van, sut, c3__free, hyp); + u3_noun fid = u3qfu_find(van, sut, c3__free, hyp); if ( c3y != u3h(fid) ) { return u3m_error("mint-fragment"); @@ -750,8 +750,8 @@ _mint_used(); { - c3_m fun_m = 200 + c3__blow; - u3_noun vrf = u3r_at(u3qfu__stage_van_vrf, van); + c3_m fun_m = 141 + c3__blow; + u3_noun vrf = u3r_at(u3qfu_van_vrf, van); u3_noun pro = u3z_find_4(fun_m, vrf, sut, gol, p_gen); if ( u3_none != pro ) { @@ -759,7 +759,7 @@ } else { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_stage_mint_in-blow", von, "blow"); + u3_noun gat = u3j_cook("_mint_in-blow", von, "blow"); u3_noun pro; pro = u3n_kick_on(u3i_molt(gat, @@ -778,7 +778,7 @@ { return u3nc(_mint_nice(van, gol, - u3qfu__stage_play(van, sut, p_gen)), + u3qfu_play(van, sut, p_gen)), u3nc(1, u3k(q_gen))); } @@ -801,7 +801,7 @@ _mint_used(); { u3_noun vos = _mint_in(van, sut, c3__noun, q_gen); - u3_noun zur = u3qfu__stage_play(van, sut, p_gen); + u3_noun zur = u3qfu_play(van, sut, p_gen); u3_noun p_vos = u3h(vos); u3_noun q_vos = u3t(vos); u3_noun waz = u3nc(1, _mint_burp(van, p_vos)); @@ -835,8 +835,8 @@ _mint_used(); { if ( c3y == _mint_vet(van) ) { - u3_noun zur = u3qfu__stage_play(van, sut, p_gen); - u3_noun dun = u3qfu__stage_dunq(van, "lost", zur); + u3_noun zur = u3qfu_play(van, sut, p_gen); + u3_noun dun = u3qfu_dunq(van, "lost", zur); u3t_push(u3nc(c3__mean, dun)); return u3m_error("mint-lost"); @@ -867,7 +867,7 @@ /* boilerplate */ u3_noun - u3wfu__stage_mint(u3_noun cor) + u3wfu_mint(u3_noun cor) { u3_noun sut, gol, gen, van; @@ -884,13 +884,13 @@ } u3_noun - u3qfu__stage_mint(u3_noun van, + u3qfu_mint(u3_noun van, u3_noun sut, u3_noun gol, u3_noun gen) { - c3_m fun_m = 200 + c3__mint; - u3_noun vrf = u3r_at(u3qfu__stage_van_vrf, van); + c3_m fun_m = 141 + c3__mint; + u3_noun vrf = u3r_at(u3qfu_van_vrf, van); u3_noun pro = u3z_find_4(fun_m, vrf, sut, gol, gen); if ( u3_none != pro ) { diff --git a/jets/stage/f/ut_mull.c b/jets/stage/f/ut_mull.c index ba9440d7b..760ebbf1f 100644 --- a/jets/stage/f/ut_mull.c +++ b/jets/stage/f/ut_mull.c @@ -11,7 +11,7 @@ static u3_noun _mull_bean() { - return u3kf__stage_fork(u3nt(u3nq(c3__atom, 'f', u3_nul, 0), + return u3kf_fork(u3nt(u3nq(c3__atom, 'f', u3_nul, 0), u3nq(c3__atom, 'f', u3_nul, 1), u3_nul)); } @@ -21,7 +21,7 @@ u3_noun loc) { u3_noun mol = u3nc('o', u3k(loc)); - u3_noun sho = u3j_cook("_stage_mull_loc-show", u3k(van), "show"); + u3_noun sho = u3j_cook("_mull_loc-show", u3k(van), "show"); u3_noun ret = u3i_molt(u3k(sho), u3x_sam, u3k(mol), 0); u3z(mol); @@ -108,7 +108,7 @@ u3_noun sut, u3_noun gen) { - u3_noun fug = u3qfu__stage_mint(van, sut, c3__noun, gen); + u3_noun fug = u3qfu_mint(van, sut, c3__noun, gen); u3_noun axe = _mull_cove(u3t(fug)); u3z(fug); @@ -120,9 +120,9 @@ u3_noun gol, u3_noun typ) { - if ( c3n == u3qfu__stage_nest(van, gol, c3y, typ) ) { - // u3_noun dun = u3qfu__stage_dunq(van, "need", gol); - // u3_noun niz = u3qfu__stage_dunq(van, "have", typ); + if ( c3n == u3qfu_nest(van, gol, c3y, typ) ) { + // u3_noun dun = u3qfu_dunq(van, "need", gol); + // u3_noun niz = u3qfu_dunq(van, "have", typ); // u3t_push(u3nc(c3__mean, dun)); // u3t_push(u3nc(c3__mean, niz)); @@ -176,7 +176,7 @@ u3_noun rig) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_stage_mull_cnts-emul", von, "emul"); + u3_noun gat = u3j_cook("_mull_cnts-emul", von, "emul"); return u3n_kick_on(u3i_molt(gat, u3x_sam_2, @@ -209,8 +209,8 @@ u3_noun zil = _mull_in(van, sut, c3__noun, dox, qi_mew); u3_noun p_zil = u3h(zil); u3_noun q_zil = u3t(zil); - u3_noun cuf = u3qfu__stage_toss(van, sut, pi_mew, p_zil, p_yom); - u3_noun dof = u3qfu__stage_toss(van, sut, pi_mew, q_zil, q_yom); + u3_noun cuf = u3qfu_toss(van, sut, pi_mew, p_zil, p_yom); + u3_noun dof = u3qfu_toss(van, sut, pi_mew, q_zil, q_yom); if ( u3r_sing(u3h(cuf), u3h(dof)) ) { u3m_error("mull-bonk-a"); @@ -239,8 +239,8 @@ u3_noun hyp, u3_noun rig) { - u3_noun lar = u3qfu__stage_seek(van, sut, c3__read, hyp); - u3_noun vug = u3qfu__stage_seek(van, dox, c3__read, hyp); + u3_noun lar = u3qfu_seek(van, sut, c3__read, hyp); + u3_noun vug = u3qfu_seek(van, dox, c3__read, hyp); u3_noun p_lar = u3h(lar); u3_noun q_lar = u3t(lar); u3_noun pq_lar = u3h(q_lar); @@ -258,9 +258,9 @@ u3_noun yom = _mull_edit (van, sut, dox, mew, u3k(qq_lar), u3k(qq_vug)); - u3_noun von = u3i_molt(u3k(van), u3qfu__stage_van_vet, c3n, 0); - u3_noun p_ret = u3qfu__stage_fire(van, sut, u3h(yom)); - u3_noun q_ret = u3qfu__stage_fire(von, sut, u3t(yom)); + u3_noun von = u3i_molt(u3k(van), u3qfu_van_vet, c3n, 0); + u3_noun p_ret = u3qfu_fire(van, sut, u3h(yom)); + u3_noun q_ret = u3qfu_fire(von, sut, u3t(yom)); u3z(von); u3z(yom); @@ -286,7 +286,7 @@ if ( c3n == u3du(gen) ) { u3_noun ter = u3r_at(u3x_con_3, van); - u3_noun fab = u3r_at(u3qfu__stage_van_fab, van); + u3_noun fab = u3r_at(u3qfu_van_fab, van); u3_noun rex = u3qfp_open(ter, fab, gen); ret = _mull_in(van, sut, gol, dox, rex); @@ -312,12 +312,12 @@ else switch ( u3h(gen) ) { default: { u3_noun ter = u3r_at(u3x_con_3, van); - u3_noun fab = u3r_at(u3qfu__stage_van_fab, van); + u3_noun fab = u3r_at(u3qfu_van_fab, van); u3_noun rex = u3qfp_open(ter, fab, gen); if ( c3y == u3r_sing(rex, gen) ) { #if 1 - u3_noun zix = u3qfu__stage_shep(van, "gene", 'q', u3k(gen)); + u3_noun zix = u3qfu_shep(van, "gene", 'q', u3k(gen)); u3t_push(u3nc(c3__mean, zix)); return u3m_error("mull-open"); @@ -335,13 +335,13 @@ case c3__fits: u3x_cell(u3t(gen), &p_gen, &q_gen); _mull_used(); { - u3_noun p_waz = u3qfu__stage_play(van, sut, p_gen); - u3_noun q_waz = u3qfu__stage_play(van, dox, p_gen); + u3_noun p_waz = u3qfu_play(van, sut, p_gen); + u3_noun q_waz = u3qfu_play(van, dox, p_gen); u3_noun dok = u3nc(c3__wing, u3k(q_gen)); u3_noun p_syx = _mull_doke(van, sut, dok); u3_noun q_syx = _mull_doke(van, dox, dok); - u3_noun p_pov = u3qfu__stage_fish(van, p_waz, p_syx); - u3_noun q_pov = u3qfu__stage_fish(van, q_waz, q_syx); + u3_noun p_pov = u3qfu_fish(van, p_waz, p_syx); + u3_noun q_pov = u3qfu_fish(van, q_waz, q_syx); if ( (c3n == u3r_sing(p_syx, q_syx)) || (c3n == u3r_sing(p_pov, q_pov)) ) @@ -360,8 +360,8 @@ _mull_used(); { u3_noun hyp = u3nc(u3nc(c3y, 1), u3k(q_gen)); - u3_noun fid = u3qfu__stage_find(van, sut, c3__free, hyp); - u3_noun gax = u3qfu__stage_find(van, dox, c3__free, hyp); + u3_noun fid = u3qfu_find(van, sut, c3__free, hyp); + u3_noun gax = u3qfu_find(van, dox, c3__free, hyp); u3_noun old_type, old_axis; u3_noun new_type, new_axis; @@ -399,7 +399,7 @@ if ( c3n == u3r_sing(old_axis, new_axis) ) { return u3m_error("mull-bonk-x"); } - else if ( c3n == u3qfu__stage_nest(van, old_type, c3y, new_type) ) { + else if ( c3n == u3qfu_nest(van, old_type, c3y, new_type) ) { return u3m_error("mull-bonk-x"); } @@ -416,10 +416,10 @@ { u3_noun bol = _mull_bean(); u3_noun nor = _mull_in(van, sut, bol, dox, p_gen); - u3_noun p_fex = u3qfu__stage_gain(van, sut, p_gen); - u3_noun q_fex = u3qfu__stage_gain(van, dox, p_gen); - u3_noun p_wux = u3qfu__stage_lose(van, sut, p_gen); - u3_noun q_wux = u3qfu__stage_lose(van, dox, p_gen); + u3_noun p_fex = u3qfu_gain(van, sut, p_gen); + u3_noun q_fex = u3qfu_gain(van, dox, p_gen); + u3_noun p_wux = u3qfu_lose(van, sut, p_gen); + u3_noun q_wux = u3qfu_lose(van, dox, p_gen); u3_noun hiq, ran; u3_noun dis, dat; u3_noun ret; @@ -428,7 +428,7 @@ hiq = u3nc(c3__void, (c3__void == q_fex) ? c3__void - : u3qfu__stage_play(van, q_fex, q_gen)); + : u3qfu_play(van, q_fex, q_gen)); } else if ( c3__void == q_fex ) { hiq = u3m_error("mull-bonk-c"); } @@ -438,14 +438,14 @@ ran = u3nc(c3__void, (c3__void == q_wux) ? c3__void - : u3qfu__stage_play(van, q_wux, r_gen)); + : u3qfu_play(van, q_wux, r_gen)); } else if ( c3__void == q_wux ) { ran = u3m_error("mull-bonk-d"); } else ran = _mull_in(van, p_wux, gol, q_wux, r_gen); - dis = u3qf__stage_forq(u3h(hiq), u3h(ran)); - dat = u3qf__stage_forq(u3t(hiq), u3t(ran)); + dis = u3qf_forq(u3h(hiq), u3h(ran)); + dat = u3qf_forq(u3t(hiq), u3t(ran)); ret = u3nc(_mull_nice(van, gol, dis), dat); @@ -523,7 +523,7 @@ case c3__rock: u3x_cell(u3t(gen), &p_gen, &q_gen); _mull_used(); { - u3_noun typ = u3qfu__stage_play(van, sut, gen); + u3_noun typ = u3qfu_play(van, sut, gen); return _mull_both(van, gol, typ); } @@ -543,7 +543,7 @@ case c3__sand: u3x_cell(u3t(gen), &p_gen, &q_gen); _mull_used(); { - u3_noun typ = u3qfu__stage_play(van, sut, gen); + u3_noun typ = u3qfu_play(van, sut, gen); return _mull_both(van, gol, typ); } @@ -557,10 +557,10 @@ _mull_used(); { u3_noun vat = _mull_in(van, sut, gol, dox, p_gen); - u3_noun pro = u3nc(u3qfu__stage_wrap(van, + u3_noun pro = u3nc(u3qfu_wrap(van, u3h(vat), c3__iron), - u3qfu__stage_wrap(van, + u3qfu_wrap(van, u3t(vat), c3__iron)); @@ -573,10 +573,10 @@ _mull_used(); { u3_noun vat = _mull_in(van, sut, gol, dox, p_gen); - u3_noun pro = u3nc(u3qfu__stage_wrap(van, + u3_noun pro = u3nc(u3qfu_wrap(van, u3h(vat), c3__zinc), - u3qfu__stage_wrap(van, + u3qfu_wrap(van, u3t(vat), c3__zinc)); @@ -588,10 +588,10 @@ _mull_used(); { u3_noun vat = _mull_in(van, sut, gol, dox, p_gen); - u3_noun pro = u3nc(u3qfu__stage_wrap(van, + u3_noun pro = u3nc(u3qfu_wrap(van, u3h(vat), c3__lead), - u3qfu__stage_wrap(van, + u3qfu_wrap(van, u3t(vat), c3__lead)); @@ -630,8 +630,8 @@ case c3__ktls: u3x_cell(u3t(gen), &p_gen, &q_gen); _mull_used(); { - u3_noun p_hif = _mull_nice(van, gol, u3qfu__stage_play(van, sut, p_gen)); - u3_noun q_hif = u3qfu__stage_play(van, dox, p_gen); + u3_noun p_hif = _mull_nice(van, gol, u3qfu_play(van, sut, p_gen)); + u3_noun q_hif = u3qfu_play(van, dox, p_gen); u3_noun zel = _mull_in(van, sut, p_hif, dox, q_gen); u3_noun ret = u3nc(p_hif, q_hif); @@ -654,8 +654,8 @@ case c3__tscm: u3x_cell(u3t(gen), &p_gen, &q_gen); _mull_used(); { - u3_noun boc = u3qfu__stage_busk(van, sut, p_gen); - u3_noun nuf = u3qfu__stage_busk(van, dox, p_gen); + u3_noun boc = u3qfu_busk(van, sut, p_gen); + u3_noun nuf = u3qfu_busk(van, dox, p_gen); u3_noun ret = _mull_in(van, boc, gol, nuf, q_gen); u3z(boc); @@ -697,8 +697,8 @@ case c3__sgzp: u3x_cell(u3t(gen), &p_gen, &q_gen); _mull_used(); { - u3_noun typ = u3qfu__stage_play(van, sut, p_gen); - u3_noun dug = u3qfu__stage_duck(van, typ); + u3_noun typ = u3qfu_play(van, sut, p_gen); + u3_noun dug = u3qfu_duck(van, typ); u3_noun ret; u3t_push(u3nc(c3__mean, dug)); @@ -720,8 +720,8 @@ case c3__zpcm: u3x_cell(u3t(gen), &p_gen, &q_gen); _mull_used(); { - u3_noun p_ret = u3qfu__stage_play(van, sut, p_gen); - u3_noun q_ret = u3qfu__stage_play(van, sut, q_gen); + u3_noun p_ret = u3qfu_play(van, sut, p_gen); + u3_noun q_ret = u3qfu_play(van, sut, q_gen); return u3nc(_mull_nice(van, gol, p_ret), q_ret); @@ -748,7 +748,7 @@ case c3__ktcn: p_gen = u3t(gen); _mull_used(); { - u3_noun von = u3i_molt(u3k(van), u3qfu__stage_van_fab, c3n, 0); + u3_noun von = u3i_molt(u3k(van), u3qfu_van_fab, c3n, 0); u3_noun ret = _mull_in(von, sut, gol, dox, p_gen); u3z(von); @@ -759,8 +759,8 @@ case c3__zpsm: u3x_cell(u3t(gen), &p_gen, &q_gen); _mull_used(); { - u3_noun p_zur = u3qfu__stage_play(van, sut, p_gen); - u3_noun q_zur = u3qfu__stage_play (van, dox, p_gen); + u3_noun p_zur = u3qfu_play(van, sut, p_gen); + u3_noun q_zur = u3qfu_play (van, dox, p_gen); u3_noun vos = _mull_in(van, sut, c3__noun, dox, q_gen); u3_noun p_ret = u3qf_cell(p_zur, u3h(vos)); u3_noun q_ret = u3qf_cell(q_zur, u3t(vos)); @@ -813,7 +813,7 @@ /* boilerplate */ u3_noun - u3wfu__stage_mull(u3_noun cor) + u3wfu_mull(u3_noun cor) { u3_noun sut, gol, dox, gen, van; @@ -831,13 +831,13 @@ } u3_noun - u3qfu__stage_mull(u3_noun van, + u3qfu_mull(u3_noun van, u3_noun sut, u3_noun gol, u3_noun dox, u3_noun gen) { - c3_m fun_m = 200 + c3__mull + ((!!u3r_at(u3qfu__stage_van_vet, van)) << 8); + c3_m fun_m = 141 + c3__mull + ((!!u3r_at(u3qfu_van_vet, van)) << 8); u3_noun pro = u3z_find_4(fun_m, sut, gol, dox, gen); if ( u3_none != pro ) { diff --git a/jets/stage/f/ut_nest.c b/jets/stage/f/ut_nest.c index 985a17a7c..f36c1385c 100644 --- a/jets/stage/f/ut_nest.c +++ b/jets/stage/f/ut_nest.c @@ -45,8 +45,8 @@ return c3n; } else { - u3_noun vis = u3qfu__stage_play(van, sut, qn_dab); - u3_noun lon = u3qfu__stage_play(van, ref, qn_hem); + u3_noun vis = u3qfu_play(van, sut, qn_dab); + u3_noun lon = u3qfu_play(van, ref, qn_hem); u3_noun ret = _nest_dext(van, vis, tel, lon, u3_nul, u3_nul, gil); @@ -153,13 +153,13 @@ else { u3_noun hud = u3nc(u3k(sut), u3k(ref)); - if ( (c3y == u3qdi__stage_has(gil, hud)) ) { + if ( (c3y == u3qdi_has(gil, hud)) ) { u3z(hud); return c3y; } else { - u3_noun zoc = u3qdi__stage_put(gil, hud); + u3_noun zoc = u3qdi_put(gil, hud); u3_noun tus = u3nt(c3__core, u3k(qq_sut), u3nc(u3nt(u3k(ppq_sut), u3k(qpq_sut), c3__gold), @@ -189,8 +189,8 @@ _nest_dext(van, qq_ref, tel, qq_sut, u3_nul, u3_nul, gil)); } case c3__iron: { - u3_noun s_sam = u3qfu__stage_peek(van, qq_sut, c3__rite, 2); - u3_noun r_sam = u3qfu__stage_peek(van, qq_ref, c3__rite, 2); + u3_noun s_sam = u3qfu_peek(van, qq_sut, c3__rite, 2); + u3_noun r_sam = u3qfu_peek(van, qq_ref, c3__rite, 2); u3_noun ret = _nest_dext (van, r_sam, tel, s_sam, u3_nul, u3_nul, gil); @@ -202,8 +202,8 @@ return c3y; } case c3__zinc: { - u3_noun s_pal = u3qfu__stage_peek(van, qq_sut, c3__read, 2); - u3_noun r_pal = u3qfu__stage_peek(van, qq_ref, c3__read, 2); + u3_noun s_pal = u3qfu_peek(van, qq_sut, c3__read, 2); + u3_noun r_pal = u3qfu_peek(van, qq_ref, c3__read, 2); u3_noun ret = _nest_dext (van, s_pal, tel, r_pal, u3_nul, u3_nul, gil); @@ -308,7 +308,7 @@ } { - u3_noun dey = u3qdi__stage_tap(p_sut); + u3_noun dey = u3qdi_tap(p_sut); u3_noun yed = dey; while ( u3_nul != yed ) { @@ -325,21 +325,21 @@ } case c3__hold: { - if ( c3y == u3qdi__stage_has(seg, sut) ) { + if ( c3y == u3qdi_has(seg, sut) ) { return c3n; } else { u3_noun hud = u3nc(u3k(sut), u3k(ref)); - if ( (c3y == u3qdi__stage_has(gil, hud)) ) { + if ( (c3y == u3qdi_has(gil, hud)) ) { u3z(hud); return c3y; } else { - u3_noun gus = u3qdi__stage_put(seg, sut); - u3_noun zoc = u3qdi__stage_put(gil, hud); - u3_noun fop = u3qfu__stage_repo(van, sut); + u3_noun gus = u3qdi_put(seg, sut); + u3_noun zoc = u3qdi_put(gil, hud); + u3_noun fop = u3qfu_repo(van, sut); u3_noun hiv = _nest_dext(van, fop, tel, ref, gus, reg, zoc); u3z(hud); @@ -369,8 +369,8 @@ return tyn; } else { #if 0 - u3_noun dun = u3qfu__stage_dunq(van, "need", sut); - u3_noun niz = u3qfu__stage_dunq(van, "have", ref); + u3_noun dun = u3qfu_dunq(van, "need", sut); + u3_noun niz = u3qfu_dunq(van, "have", ref); u3t_push(u3nc(c3__mean, dun)); u3t_push(u3nc(c3__mean, niz)); @@ -394,7 +394,7 @@ } { - c3_m fun_m = 200 + c3__nest + ((!!u3r_at(u3qfu__stage_van_vet, van)) << 8); + c3_m fun_m = 141 + c3__nest + ((!!u3r_at(u3qfu_van_vet, van)) << 8); u3_noun pro = u3z_find_2(fun_m, sut, ref); if ( u3_none != pro ) { @@ -440,7 +440,7 @@ case c3__atom: return c3n; case c3__cell: return c3n; case c3__core: { - u3_noun gam = u3qfu__stage_repo(van, ref); + u3_noun gam = u3qfu_repo(van, ref); u3_noun hiv = _nest_dext(van, sut, tel, gam, seg, reg, gil); u3z(gam); @@ -456,7 +456,7 @@ } case c3__fork: p_ref = u3t(ref); { - u3_noun dey = u3qdi__stage_tap(p_ref); + u3_noun dey = u3qdi_tap(p_ref); u3_noun yed = dey; while ( u3_nul != yed ) { @@ -471,20 +471,20 @@ return c3y; } case c3__hold: { - if ( c3y == u3qdi__stage_has(reg, ref) ) { + if ( c3y == u3qdi_has(reg, ref) ) { return c3y; } { u3_noun hud = u3nc(u3k(sut), u3k(ref)); - if ( (c3y == u3qdi__stage_has(gil, hud)) ) { + if ( (c3y == u3qdi_has(gil, hud)) ) { u3z(hud); return c3y; } else { - u3_noun gur = u3qdi__stage_put(reg, ref); - u3_noun zoc = u3qdi__stage_put(gil, hud); - u3_noun gam = u3qfu__stage_repo(van, ref); + u3_noun gur = u3qdi_put(reg, ref); + u3_noun zoc = u3qdi_put(gil, hud); + u3_noun gam = u3qfu_repo(van, ref); { u3_noun hiv = _nest_dext(van, sut, tel, gam, seg, gur, zoc); @@ -515,7 +515,7 @@ /* boilerplate */ u3_noun - u3wfu__stage_nest(u3_noun cor) + u3wfu_nest(u3_noun cor) { u3_noun sut, tel, ref, van; @@ -533,14 +533,14 @@ } u3_noun - u3qfu__stage_nest(u3_noun van, + u3qfu_nest(u3_noun van, u3_noun sut, u3_noun tel, u3_noun ref) { #if 1 - c3_m fun_m = 200 + c3__nest; - u3_noun vrf = u3r_at(u3qfu__stage_van_vrf, van); + c3_m fun_m = 141 + c3__nest; + u3_noun vrf = u3r_at(u3qfu_van_vrf, van); u3_noun pro = u3z_find_4(fun_m, vrf, sut, tel, ref); if ( u3_none != pro ) { diff --git a/jets/stage/f/ut_peek.c b/jets/stage/f/ut_peek.c index bbaba3a8d..dc9a5887c 100644 --- a/jets/stage/f/ut_peek.c +++ b/jets/stage/f/ut_peek.c @@ -85,7 +85,7 @@ u3_atom lat = u3qc_mas(axe); if ( 3 == now ) { - u3_noun pec = u3qfu__stage_peel(van, sut, way, rpq_sut); + u3_noun pec = u3qfu_peel(van, sut, way, rpq_sut); u3_noun sam = u3h(pec); u3_noun con = u3t(pec); u3_atom tow; @@ -156,19 +156,19 @@ } case c3__fork: p_sut = u3t(sut); { - u3_noun yed = u3qdi__stage_tap(p_sut); - u3_noun ret = u3kf__stage_fork(_peek_fork(van, yed, way, axe, gil)); + u3_noun yed = u3qdi_tap(p_sut); + u3_noun ret = u3kf_fork(_peek_fork(van, yed, way, axe, gil)); u3z(yed); return ret; } case c3__hold: { - if ( (c3y == u3qdi__stage_has(gil, sut)) ) { + if ( (c3y == u3qdi_has(gil, sut)) ) { return c3__void; } else { - u3_noun zoc = u3qdi__stage_put(gil, sut); - u3_noun fop = u3qfu__stage_repo(van, sut); + u3_noun zoc = u3qdi_put(gil, sut); + u3_noun fop = u3qfu_repo(van, sut); u3_noun pro = _peek_in(van, fop, way, axe, zoc); u3z(fop); @@ -195,7 +195,7 @@ /* boilerplate */ u3_noun - u3wfu__stage_peek(u3_noun cor) + u3wfu_peek(u3_noun cor) { u3_noun sut, way, axe, van; @@ -213,12 +213,12 @@ } u3_noun - u3qfu__stage_peek(u3_noun van, + u3qfu_peek(u3_noun van, u3_noun sut, u3_noun way, u3_noun axe) { - c3_m fun_m = 200 + c3__peek + ((!!u3r_at(u3qfu__stage_van_vet, van)) << 8); + c3_m fun_m = 141 + c3__peek + ((!!u3r_at(u3qfu_van_vet, van)) << 8); u3_noun pro = u3z_find_3(fun_m, sut, way, axe); if ( u3_none != pro ) { diff --git a/jets/stage/f/ut_peel.c b/jets/stage/f/ut_peel.c index 0ffc3f940..717a62543 100644 --- a/jets/stage/f/ut_peel.c +++ b/jets/stage/f/ut_peel.c @@ -6,7 +6,7 @@ /* logic */ - static u3_noun + u3_noun _cqfu_peel(u3_noun van, u3_noun sut, u3_noun way, @@ -28,7 +28,7 @@ /* boilerplate */ u3_noun - u3wfu__stage_peel(u3_noun cor) + u3wfu_peel(u3_noun cor) { u3_noun sut, way, met, van; @@ -45,7 +45,7 @@ } u3_noun - u3qfu__stage_peel(u3_noun van, + u3qfu_peel(u3_noun van, u3_noun sut, u3_noun way, u3_noun met) diff --git a/jets/stage/f/ut_play.c b/jets/stage/f/ut_play.c index 0dc6e00e6..9a300edf4 100644 --- a/jets/stage/f/ut_play.c +++ b/jets/stage/f/ut_play.c @@ -13,7 +13,7 @@ static u3_noun _play_bean() { - return u3kf__stage_fork(u3nt(u3nq(c3__atom, 'f', u3_nul, 0), + return u3kf_fork(u3nt(u3nq(c3__atom, 'f', u3_nul, 0), u3nq(c3__atom, 'f', u3_nul, 1), u3_nul)); } @@ -70,7 +70,7 @@ u3_noun loc) { u3_noun mol = u3nc('o', u3k(loc)); - u3_noun sho = u3j_cook("_stage_play_loc-show", u3k(van), "show"); + u3_noun sho = u3j_cook("_play_loc-show", u3k(van), "show"); u3_noun ret = u3i_molt(u3k(sho), u3x_sam, u3k(mol), 0); u3z(mol); @@ -121,7 +121,7 @@ u3_noun rig) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_stage_play_cnts-epla", von, "epla"); + u3_noun gat = u3j_cook("_play_cnts-epla", von, "epla"); return u3n_kick_on(u3i_molt(gat, u3x_sam_2, @@ -146,7 +146,7 @@ u3_noun pi_mew = u3h(i_mew); u3_noun qi_mew = u3t(i_mew); u3_noun laf = _play_in(van, sut, qi_mew); - u3_noun ruz = u3qfu__stage_toss(van, sut, pi_mew, laf, rag); + u3_noun ruz = u3qfu_toss(van, sut, pi_mew, laf, rag); u3z(laf); u3z(rag); @@ -163,12 +163,12 @@ u3_noun hyp, u3_noun rig) { - u3_noun lar = u3qfu__stage_seek(van, sut, c3__read, hyp); + u3_noun lar = u3qfu_seek(van, sut, c3__read, hyp); u3_noun q_lar = u3t(lar); u3_noun qq_lar = u3t(q_lar); u3_noun mew = rig; u3_noun rag = _play_edit(van, sut, mew, u3k(qq_lar)); - u3_noun ret = u3qfu__stage_fire(van, sut, rag); + u3_noun ret = u3qfu_fire(van, sut, rag); u3z(rag); u3z(lar); @@ -208,7 +208,7 @@ #if 1 return _play_in(van, sut, gen); #else - u3_noun zix = u3qfu__stage_shep + u3_noun zix = u3qfu_shep (van, "gene", 'q', u3k(gen)); u3_noun ret; @@ -231,12 +231,12 @@ if ( c3n == u3du(gen) ) { open: { u3_noun ter = u3r_at(u3x_con_3, van); - u3_noun fab = u3r_at(u3qfu__stage_van_fab, van); + u3_noun fab = u3r_at(u3qfu_van_fab, van); u3_noun rex = u3qfp_open(ter, fab, gen); u3_noun ret; if ( c3y == u3r_sing(rex, gen) ) { - u3_noun zix = u3qfu__stage_shep(van, "gene", 'q', u3k(gen)); + u3_noun zix = u3qfu_shep(van, "gene", 'q', u3k(gen)); u3t_push(u3nc(c3__mean, zix)); return u3m_error("play-open-z"); @@ -271,13 +271,13 @@ case c3__wtcl: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); _play_used(); { - u3_noun fex = u3qfu__stage_gain(van, sut, p_gen); - u3_noun wux = u3qfu__stage_lose(van, sut, p_gen); + u3_noun fex = u3qfu_gain(van, sut, p_gen); + u3_noun wux = u3qfu_lose(van, sut, p_gen); u3_noun dez = (fex == c3__void) ? c3__void : _play_x(van, fex, q_gen); u3_noun doz = (wux == c3__void) ? c3__void : _play_x(van, wux, r_gen); - u3_noun ret = u3qf__stage_forq(dez, doz); + u3_noun ret = u3qf_forq(dez, doz); u3z(dez); u3z(doz); u3z(fex); u3z(wux); @@ -352,7 +352,7 @@ _play_used(); { u3_noun boc = _play_x(van, sut, p_gen); - u3_noun pro = u3qfu__stage_wrap(van, boc, c3__iron); + u3_noun pro = u3qfu_wrap(van, boc, c3__iron); u3z(boc); return pro; @@ -362,7 +362,7 @@ _play_used(); { u3_noun boc = _play_x(van, sut, p_gen); - u3_noun pro = u3qfu__stage_wrap(van, boc, c3__zinc); + u3_noun pro = u3qfu_wrap(van, boc, c3__zinc); u3z(boc); return pro; @@ -372,7 +372,7 @@ _play_used(); { u3_noun boc = _play_x(van, sut, p_gen); - u3_noun pro = u3qfu__stage_wrap(van, boc, c3__lead); + u3_noun pro = u3qfu_wrap(van, boc, c3__lead); u3z(boc); return pro; @@ -421,7 +421,7 @@ case c3__tscm: u3x_cell(u3t(gen), &p_gen, &q_gen); _play_used(); { - u3_noun boc = u3qfu__stage_busk(van, sut, p_gen); + u3_noun boc = u3qfu_busk(van, sut, p_gen); u3_noun ret = _play_x(van, boc, q_gen); u3z(boc); @@ -459,8 +459,8 @@ case c3__sgzp: u3x_cell(u3t(gen), &p_gen, &q_gen); _play_used(); { - u3_noun typ = u3qfu__stage_play(van, sut, p_gen); - u3_noun dug = u3qfu__stage_duck(van, typ); + u3_noun typ = u3qfu_play(van, sut, p_gen); + u3_noun dug = u3qfu_duck(van, typ); u3_noun ret; u3t_push(u3nc(c3__mean, dug)); @@ -487,7 +487,7 @@ case c3__ktcn: p_gen = u3t(gen); { - u3_noun von = u3i_molt(u3k(van), u3qfu__stage_van_fab, c3n, 0); + u3_noun von = u3i_molt(u3k(van), u3qfu_van_fab, c3n, 0); u3_noun ret = _play_x(von, sut, p_gen); u3z(von); @@ -559,7 +559,7 @@ u3_noun sut, u3_noun gen) { - u3_noun von = u3i_molt(u3k(van), u3qfu__stage_van_vet, c3n, 0); + u3_noun von = u3i_molt(u3k(van), u3qfu_van_vet, c3n, 0); u3_noun ret = _play_x(von, sut, gen); u3z(von); @@ -569,7 +569,7 @@ /* boilerplate */ u3_noun - u3wfu__stage_play(u3_noun cor) + u3wfu_play(u3_noun cor) { u3_noun sut, gen, van; @@ -583,13 +583,13 @@ } u3_noun - u3qfu__stage_play(u3_noun van, + u3qfu_play(u3_noun van, u3_noun sut, u3_noun gen) { #if 1 - c3_m fun_m = 200 + c3__play; - u3_noun vrf = u3r_at(u3qfu__stage_van_vrf, van); + c3_m fun_m = 141 + c3__play; + u3_noun vrf = u3r_at(u3qfu_van_vrf, van); u3_noun pro = u3z_find_3(fun_m, vrf, sut, gen); if ( u3_none != pro ) { diff --git a/jets/stage/f/ut_repo.c b/jets/stage/f/ut_repo.c index 1cea98c9d..0e82bf813 100644 --- a/jets/stage/f/ut_repo.c +++ b/jets/stage/f/ut_repo.c @@ -7,7 +7,7 @@ /* logic */ u3_noun - u3qfu__stage_repo(u3_noun van, + u3qfu_repo(u3_noun van, u3_noun sut) { u3_noun p_sut, q_sut; @@ -16,7 +16,7 @@ default: return u3k(sut); case c3__noun: { - return u3kf__stage_fork(u3nt(u3nt(c3__atom, u3_blip, u3_nul), + return u3kf_fork(u3nt(u3nt(c3__atom, u3_blip, u3_nul), u3nt(c3__cell, c3__noun, c3__noun), u3_nul)); } @@ -49,7 +49,7 @@ u3_noun old = u3nc(u3nc(u3k(p_sut), u3k(q_sut)), u3_nul); u3_noun ret; - ret = u3qfu__stage_rest(van, sut, old); + ret = u3qfu_rest(van, sut, old); u3z(old); return ret; } @@ -58,13 +58,13 @@ } u3_noun - u3wfu__stage_repo(u3_noun cor) + u3wfu_repo(u3_noun cor) { u3_noun sut; if ( u3_none == (sut = u3r_at(u3x_sam, cor)) ) { return u3m_bail(c3__fail); } else { - return u3qfu__stage_repo(cor, sut); + return u3qfu_repo(cor, sut); } } diff --git a/jets/stage/f/ut_rest.c b/jets/stage/f/ut_rest.c index 1134ffeb2..81edd85df 100644 --- a/jets/stage/f/ut_rest.c +++ b/jets/stage/f/ut_rest.c @@ -16,7 +16,7 @@ u3_noun i_leg = u3h(leg); u3_noun t_leg = u3t(leg); - return u3nc(u3qfu__stage_play(van, u3h(i_leg), u3t(i_leg)), + return u3nc(u3qfu_play(van, u3h(i_leg), u3t(i_leg)), _rest_in_list(van, t_leg)); } } @@ -25,8 +25,8 @@ _rest_in_stil(u3_noun van, u3_noun gar) { - u3_noun gun = u3qdi__stage_gas(u3_nul, gar); - u3_noun yed = u3qdi__stage_tap(gun); + u3_noun gun = u3qdi_gas(u3_nul, gar); + u3_noun yed = u3qdi_tap(gun); u3z(gun); return yed; @@ -38,7 +38,7 @@ { u3_noun gar = _rest_in_list(van, leg); u3_noun yed = _rest_in_stil(van, gar); - u3_noun fub = u3qf__stage_fork(yed); + u3_noun fub = u3qf_fork(yed); u3z(gar); u3z(yed); @@ -53,7 +53,7 @@ if ( u3_nul == leg ) { return c3n; } else { - return c3o(u3qdi__stage_has(fan, u3h(leg)), + return c3o(u3qdi_has(fan, u3h(leg)), _rest_hit_fan(fan, u3t(leg))); } } @@ -63,14 +63,14 @@ u3_noun sut, u3_noun leg) { - u3_noun fan = u3r_at(u3qfu__stage_van_fan, van); + u3_noun fan = u3r_at(u3qfu_van_fan, van); if ( c3y == _rest_hit_fan(fan, leg) ) { return u3m_error("rest-loop"); } else { - u3_noun naf = u3qdi__stage_gas(fan, leg); - u3_noun nav = u3i_molt(u3k(van), u3qfu__stage_van_fan, u3k(naf), 0); + u3_noun naf = u3qdi_gas(fan, leg); + u3_noun nav = u3i_molt(u3k(van), u3qfu_van_fan, u3k(naf), 0); u3_noun mez = _rest_in(nav, leg); u3z(naf); @@ -82,7 +82,7 @@ /* boilerplate */ u3_noun - u3wfu__stage_rest(u3_noun cor) + u3wfu_rest(u3_noun cor) { u3_noun sut, leg, van; @@ -96,11 +96,11 @@ } u3_noun - u3qfu__stage_rest(u3_noun van, + u3qfu_rest(u3_noun van, u3_noun sut, u3_noun leg) { - c3_m fun_m = 200 + c3__rest + ((!!u3r_at(u3qfu__stage_van_vet, van)) << 8); + c3_m fun_m = 141 + c3__rest + ((!!u3r_at(u3qfu_van_vet, van)) << 8); u3_noun pro = u3z_find_2(fun_m, sut, leg); if ( u3_none != pro ) { diff --git a/jets/stage/f/ut_tack.c b/jets/stage/f/ut_tack.c index 5ebf7736b..9328c43ae 100644 --- a/jets/stage/f/ut_tack.c +++ b/jets/stage/f/ut_tack.c @@ -4,13 +4,13 @@ #include "all.h" u3_noun - u3qfu__stage_tack(u3_noun van, + u3qfu_tack(u3_noun van, u3_noun sut, u3_noun hyp, u3_noun mur) { u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("u3qfu__stage_tack-tack", von, "tack"); + u3_noun gat = u3j_cook("u3qfu_tack-tack", von, "tack"); return u3n_kick_on(u3i_molt(gat, u3x_sam_2, diff --git a/jets/stage/f/ut_toss.c b/jets/stage/f/ut_toss.c index 84a90190e..15973cf58 100644 --- a/jets/stage/f/ut_toss.c +++ b/jets/stage/f/ut_toss.c @@ -21,7 +21,7 @@ u3_noun pi_men = u3h(i_men); u3_noun qi_men = u3t(i_men); u3_noun t_men = u3t(men); - u3_noun geq = u3qfu__stage_tack(van, pi_men, peh, mur); + u3_noun geq = u3qfu_tack(van, pi_men, peh, mur); u3_noun p_geq = u3h(geq); u3_noun q_geq = u3t(geq); u3_noun mox = _toss_in(van, sut, peh, mur, t_men); @@ -45,7 +45,7 @@ /* functions */ - static u3_noun + u3_noun _cqfu_toss(u3_noun van, u3_noun sut, u3_noun peh, @@ -69,7 +69,7 @@ /* boilerplate */ u3_noun - u3wfu__stage_toss(u3_noun cor) + u3wfu_toss(u3_noun cor) { u3_noun van, sut, peh, mur, men; @@ -87,7 +87,7 @@ } u3_noun - u3qfu__stage_toss(u3_noun van, + u3qfu_toss(u3_noun van, u3_noun sut, u3_noun peh, u3_noun mur, diff --git a/jets/stage/f/ut_wrap.c b/jets/stage/f/ut_wrap.c index 85ef1458e..e51d3843f 100644 --- a/jets/stage/f/ut_wrap.c +++ b/jets/stage/f/ut_wrap.c @@ -55,15 +55,15 @@ } case c3__fork: p_sut = u3t(sut); { - u3_noun yed = u3qdi__stage_tap(p_sut); - u3_noun ret = u3kf__stage_fork(_wrap_fork(van, yed, yoz)); + u3_noun yed = u3qdi_tap(p_sut); + u3_noun ret = u3kf_fork(_wrap_fork(van, yed, yoz)); u3z(yed); return ret; } case c3__hold: { - u3_noun fop = u3qfu__stage_repo(van, sut); + u3_noun fop = u3qfu_repo(van, sut); u3_noun pro = _cqfu_wrap(van, fop, yoz); u3z(fop); @@ -75,7 +75,7 @@ /* boilerplate */ u3_noun - u3wfu__stage_wrap(u3_noun cor) + u3wfu_wrap(u3_noun cor) { u3_noun sut, yoz, van; @@ -89,7 +89,7 @@ } u3_noun - u3qfu__stage_wrap(u3_noun van, + u3qfu_wrap(u3_noun van, u3_noun sut, u3_noun yoz) { diff --git a/jets/tree.c b/jets/tree.c index 54cacc9ad..c2bb9b6f7 100644 --- a/jets/tree.c +++ b/jets/tree.c @@ -220,15 +220,6 @@ static c3_c* _141_pen_look_ha[] = {0}; static u3j_harm _141_pen_loot_a[] = {{".2", u3wf_loot}, {}}; static c3_c* _141_pen_loot_ha[] = {0}; -// mug staging -// -static u3j_harm _141_pen_stage_fork_a[] = {{".2", u3wf__stage_fork}, {}}; -static c3_c* _141_pen_stage_fork_ha[] = {0}; -static u3j_harm _141_pen_stage_look_a[] = {{".2", u3wf__stage_look}, {}}; -static c3_c* _141_pen_stage_look_ha[] = {0}; -static u3j_harm _141_pen_stage_loot_a[] = {{".2", u3wf__stage_loot}, {}}; -static c3_c* _141_pen_stage_loot_ha[] = {0}; - static u3j_harm _141_pen__ut_crop_a[] = {{".2", u3wfu_crop}, {}}; static c3_c* _141_pen__ut_crop_ha[] = {0}; static u3j_harm _141_pen__ut_fire_a[] = {{".2", u3wfu_fire}, {}}; @@ -273,11 +264,11 @@ static u3j_core _141_pen__ut_d[] = { "wrap", 7, _141_pen__ut_wrap_a, 0, _141_pen__ut_wrap_ha }, {} }; - static u3j_harm _141_pen__ut_a[] = { {"repo", u3wfu_repo}, {} }; + static c3_c* _141_pen__ut_ha[] = {0}; static u3j_hood _141_pen__ut_ho[] = { @@ -326,106 +317,6 @@ static u3j_hood _141_pen__ut_ho[] = { {}, }; -// mug staging -// - - static u3j_harm _141_pen__ut_stage_crop_a[] = {{".2", u3wfu__stage_crop}, {}}; - static c3_c* _141_pen__ut_stage_crop_ha[] = {0}; - static u3j_harm _141_pen__ut_stage_fire_a[] = {{".2", u3wfu__stage_fire}, {}}; - static c3_c* _141_pen__ut_stage_fire_ha[] = {0}; - static u3j_harm _141_pen__ut_stage_fish_a[] = {{".2", u3wfu__stage_fish}, {}}; - static c3_c* _141_pen__ut_stage_fish_ha[] = {0}; - static u3j_harm _141_pen__ut_stage_fond_a[] = {{".2", u3wfu__stage_fond}, {}}; - static c3_c* _141_pen__ut_stage_fond_ha[] = {0}; - static u3j_harm _141_pen__ut_stage_fuse_a[] = {{".2", u3wfu__stage_fuse}, {}}; - static c3_c* _141_pen__ut_stage_fuse_ha[] = {0}; - static u3j_harm _141_pen__ut_stage_mint_a[] = {{".2", u3wfu__stage_mint}, {}}; - static c3_c* _141_pen__ut_stage_mint_ha[] = {0}; - static u3j_harm _141_pen__ut_stage_mull_a[] = {{".2", u3wfu__stage_mull}, {}}; - static c3_c* _141_pen__ut_stage_mull_ha[] = {0}; - static u3j_harm _141_pen__ut_stage_nest_a[] = {{".2", u3wfu__stage_nest}, {}}; - static c3_c* _141_pen__ut_stage_nest_ha[] = {0}; - static u3j_harm _141_pen__ut_stage_peek_a[] = {{".2", u3wfu__stage_peek}, {}}; - static c3_c* _141_pen__ut_stage_peek_ha[] = {0}; - static u3j_harm _141_pen__ut_stage_play_a[] = {{".2", u3wfu__stage_play}, {}}; - static c3_c* _141_pen__ut_stage_play_ha[] = {0}; - static u3j_harm _141_pen__ut_stage_rest_a[] = {{".2", u3wfu__stage_rest}, {}}; - static c3_c* _141_pen__ut_stage_rest_ha[] = {0}; - static u3j_harm _141_pen__ut_stage_toss_a[] = {{".2", u3wfu__stage_toss}, {}}; - static c3_c* _141_pen__ut_stage_toss_ha[] = {0}; - static u3j_harm _141_pen__ut_stage_wrap_a[] = {{".2", u3wfu__stage_wrap}, {}}; - static c3_c* _141_pen__ut_stage_wrap_ha[] = {0}; - -static u3j_core _141_pen__stage_ut_d[] = - { - { "crop", 7, _141_pen__ut_stage_crop_a, 0, _141_pen__ut_stage_crop_ha }, - { "fond", 7, _141_pen__ut_stage_fond_a, 0, _141_pen__ut_stage_fond_ha }, - { "fire", 7, _141_pen__ut_stage_fire_a, 0, _141_pen__ut_stage_fire_ha }, - { "fish", 7, _141_pen__ut_stage_fish_a, 0, _141_pen__ut_stage_fish_ha }, - { "fuse", 7, _141_pen__ut_stage_fuse_a, 0, _141_pen__ut_stage_fuse_ha }, - { "mint", 7, _141_pen__ut_stage_mint_a, 0, _141_pen__ut_stage_mint_ha }, - { "mull", 7, _141_pen__ut_stage_mull_a, 0, _141_pen__ut_stage_mull_ha }, - { "nest", 7, _141_pen__ut_stage_nest_a, 0, _141_pen__ut_stage_nest_ha }, - { "peek", 7, _141_pen__ut_stage_peek_a, 0, _141_pen__ut_stage_peek_ha }, - { "play", 7, _141_pen__ut_stage_play_a, 0, _141_pen__ut_stage_play_ha }, - { "rest", 7, _141_pen__ut_stage_rest_a, 0, _141_pen__ut_stage_rest_ha }, - { "toss", 7, _141_pen__ut_stage_toss_a, 0, _141_pen__ut_stage_toss_ha }, - { "wrap", 7, _141_pen__ut_stage_wrap_a, 0, _141_pen__ut_stage_wrap_ha }, - {} - }; - -static u3j_harm _141_pen__stage_ut_a[] = - { {"repo", u3wfu_repo}, - {} - }; -static c3_c* _141_pen__stage_ut_ha[] = {0}; - -static u3j_hood _141_pen__stage_ut_ho[] = { - // %ar ar - { "fan", 28, c3n }, - { "rib", 58, c3n }, - { "vet", 118, c3n }, - { "fab", 119, c3n }, - - { "blow", 49131 }, - // %burp burp - { "busk", 0x5ff57 }, - { "buss", 94 }, - { "crop", 4 }, - { "duck", 48087 }, - { "dune", 1524 }, - { "dunk", 763 }, - { "epla", 12283 }, - { "emin", 5998 }, - { "emul", 86 }, - // %feel feel - { "felt", 24046 }, - { "fine", 3004 }, - { "fire", 700 }, - { "fish", 1498 }, - { "fond", 92 }, - { "fund", 1402 }, - { "funk", 0x1757c, c3y, 31 }, - { "fuse", 1534 }, - { "gain", 748 }, - { "lose", 22 }, - // %mile mile - // %mine mine - { "mint", 0x17fd4 }, - { "moot", 2807 }, - { "mull", 11995 }, - { "nest", 380 }, - { "peel", 5999 }, - { "play", 12022 }, - { "peek", 5996 }, - { "repo", 3050 }, - { "rest", 382 }, - { "tack", 351 }, - { "toss", 24042 }, - { "wrap", 6143 }, - {}, -}; - // XX figure out why this is disabled #if 0 static u3j_harm _141_pen__ap_a[] = @@ -456,17 +347,13 @@ static u3j_core _141_pen_d[] = { "flip", 7, _141_pen_flip_a, 0, _141_pen_flip_ha }, { "flor", 7, _141_pen_flor_a, 0, _141_pen_flor_ha }, { "fork", 7, _141_pen_fork_a, 0, _141_pen_fork_ha }, - { "stage-fork", 7, _141_pen_stage_fork_a, 0, _141_pen_stage_fork_ha }, // { "hike", 7, _141_pen_hike_a, 0, _141_pen_hike_ha }, { "look", 7, _141_pen_look_a, 0, _141_pen_look_ha }, - { "stage-look", 7, _141_pen_stage_look_a, 0, _141_pen_stage_look_ha }, { "loot", 7, _141_pen_loot_a, 0, _141_pen_loot_ha }, - { "stage-loot", 7, _141_pen_stage_loot_a, 0, _141_pen_stage_loot_ha }, // { "ap", 7, _141_pen__ap_a, 0, _141_pen__ap_ha }, // { "al", 7, _141_pen__al_a, 0, _141_pen__al_ha }, { "ut", 15, _141_pen__ut_a, _141_pen__ut_d, _141_pen__ut_ha, _141_pen__ut_ho }, - { "stage-ut", 15, _141_pen__stage_ut_a, _141_pen__stage_ut_d, _141_pen__stage_ut_ha, _141_pen__stage_ut_ho }, {} }; static c3_c* _141_pen_ha[] = {0}; @@ -965,15 +852,6 @@ static c3_c* _141_two_sqt_ha[] = {0}; static u3j_harm _141_two_xeb_a[] = {{".2", u3wc_xeb, c3y}, {}}; static c3_c* _141_two_xeb_ha[] = {0}; -// mug staging -// -static u3j_harm _141_two_stage_gor_a[] = {{".2", u3wc__stage_gor, c3y}, {}}; -static c3_c* _141_two_stage_gor_ha[] = {0}; -static u3j_harm _141_two_stage_hor_a[] = {{".2", u3wc__stage_hor, c3y}, {}}; -static c3_c* _141_two_stage_hor_ha[] = {0}; -static u3j_harm _141_two_stage_vor_a[] = {{".2", u3wc__stage_vor, c3y}, {}}; -static c3_c* _141_two_stage_vor_ha[] = {0}; - static u3j_harm _141_two__in_bif_a[] = {{".2", u3wdi_bif}, {}}; static c3_c* _141_two__in_bif_ha[] = {0}; static u3j_harm _141_two__in_del_a[] = {{".2", u3wdi_del}, {}}; @@ -1015,40 +893,6 @@ static u3j_core _141_two__in_d[] = }; static c3_c* _141_two__in_ha[] = {0}; -// mug staging -// - - static u3j_harm _141_two__stage_in_bif_a[] = {{".2", u3wdi__stage_bif}, {}}; - static c3_c* _141_two__stage_in_bif_ha[] = {0}; - static u3j_harm _141_two__stage_in_del_a[] = {{".2", u3wdi__stage_del}, {}}; - static c3_c* _141_two__stage_in_del_ha[] = {0}; - static u3j_harm _141_two__stage_in_dif_a[] = {{".2", u3wdi__stage_dif}, {}}; - static c3_c* _141_two__stage_in_dif_ha[] = {0}; - static u3j_harm _141_two__stage_in_gas_a[] = {{".2", u3wdi__stage_gas}, {}}; - static c3_c* _141_two__stage_in_gas_ha[] = {0}; - static u3j_harm _141_two__stage_in_has_a[] = {{".2", u3wdi__stage_has}, {}}; - static c3_c* _141_two__stage_in_has_ha[] = {0}; - static u3j_harm _141_two__stage_in_mer_a[] = {{".2", u3wdi__stage_mer}, {}}; - static c3_c* _141_two__stage_in_mer_ha[] = {0}; - static u3j_harm _141_two__stage_in_put_a[] = {{".2", u3wdi__stage_put}, {}}; - static c3_c* _141_two__stage_in_put_ha[] = {0}; - static u3j_harm _141_two__stage_in_uni_a[] = {{".2", u3wdi__stage_uni}, {}}; - static c3_c* _141_two__stage_in_uni_ha[] = {0}; -static u3j_core _141_two__stage_in_d[] = - { { "bif", 7, _141_two__stage_in_bif_a, 0, _141_two__stage_in_bif_ha }, - { "del", 7, _141_two__stage_in_del_a, 0, _141_two__stage_in_del_ha }, - { "dif", 7, _141_two__stage_in_dif_a, 0, _141_two__stage_in_dif_ha }, - { "gas", 7, _141_two__stage_in_gas_a, 0, _141_two__stage_in_gas_ha }, - { "has", 7, _141_two__stage_in_has_a, 0, _141_two__stage_in_has_ha }, - { "mer", 7, _141_two__stage_in_mer_a, 0, _141_two__stage_in_mer_ha }, - { "put", 7, _141_two__stage_in_put_a, 0, _141_two__stage_in_put_ha }, - { "tap", 7, _141_two__in_tap_a, 0, _141_two__in_tap_ha }, - { "uni", 7, _141_two__stage_in_uni_a, 0, _141_two__stage_in_uni_ha }, - { "wyt", 7, _141_two__in_wyt_a, 0, _141_two__in_wyt_ha }, - {} - }; -static c3_c* _141_two__stage_in_ha[] = {0}; - static u3j_harm _141_two__by_bif_a[] = {{".2", u3wdb_bif, c3y}, {}}; static c3_c* _141_two__by_bif_ha[] = {0}; static u3j_harm _141_two__by_del_a[] = {{".2", u3wdb_del, c3y}, {}}; @@ -1093,43 +937,6 @@ static u3j_core _141_two__by_d[] = }; static c3_c* _141_two__by_ha[] = {0}; -// mug staging -// - - static u3j_harm _141_two__stage_by_bif_a[] = {{".2", u3wdb__stage_bif, c3y}, {}}; - static c3_c* _141_two__stage_by_bif_ha[] = {0}; - static u3j_harm _141_two__stage_by_del_a[] = {{".2", u3wdb__stage_del, c3y}, {}}; - static c3_c* _141_two__stage_by_del_ha[] = {0}; - static u3j_harm _141_two__stage_by_dif_a[] = {{".2", u3wdb__stage_dif, c3y}, {}}; - static c3_c* _141_two__stage_by_dif_ha[] = {0}; - static u3j_harm _141_two__stage_by_gas_a[] = {{".2", u3wdb__stage_gas, c3y}, {}}; - static c3_c* _141_two__stage_by_gas_ha[] = {0}; - static u3j_harm _141_two__stage_by_get_a[] = {{".2", u3wdb__stage_get, c3y}, {}}; - static c3_c* _141_two__stage_by_get_ha[] = {0}; - static u3j_harm _141_two__stage_by_has_a[] = {{".2", u3wdb__stage_has, c3y}, {}}; - static c3_c* _141_two__stage_by_has_ha[] = {0}; - - static u3j_harm _141_two__stage_by_jab_a[] = {{".2", u3wdb__stage_jab, c3y}, {}}; - static c3_c* _141_two__stage_by_jab_ha[] = {0}; - static u3j_harm _141_two__stage_by_put_a[] = {{".2", u3wdb__stage_put, c3y}, {}}; - static c3_c* _141_two__stage_by_put_ha[] = {0}; - static u3j_harm _141_two__stage_by_tap_a[] = {{".2", u3wdb__stage_tap, c3y}, {}}; - static c3_c* _141_two__stage_by_tap_ha[] = {0}; - -static u3j_core _141_two__stage_by_d[] = - { { "bif", 7, _141_two__stage_by_bif_a, 0, _141_two__stage_by_bif_ha }, - { "del", 7, _141_two__stage_by_del_a, 0, _141_two__stage_by_del_ha }, - { "dif", 7, _141_two__stage_by_dif_a, 0, _141_two__stage_by_dif_ha }, - { "gas", 7, _141_two__stage_by_gas_a, 0, _141_two__stage_by_gas_ha }, - { "get", 7, _141_two__stage_by_get_a, 0, _141_two__stage_by_get_ha }, - { "has", 7, _141_two__stage_by_has_a, 0, _141_two__stage_by_has_ha }, - { "jab", 7, _141_two__stage_by_jab_a, 0, _141_two__stage_by_jab_ha }, - { "put", 7, _141_two__stage_by_put_a, 0, _141_two__stage_by_put_ha }, - { "tap", 7, _141_two__stage_by_tap_a, 0, _141_two__stage_by_tap_ha }, - {} - }; -static c3_c* _141_two__stage_by_ha[] = {0}; - static u3j_harm _141_two_cue_a[] = {{".2", u3we_cue}, {}}; static c3_c* _141_two_cue_ha[] = {0}; static u3j_harm _141_two_jam_a[] = {{".2", u3we_jam}, {}}; @@ -1173,9 +980,7 @@ static u3j_core _141_two_d[] = { "dvr", 7, _141_two_dvr_a, 0, _141_two_dvr_ha }, { "end", 7, _141_two_end_a, 0, _141_two_end_ha }, { "gor", 7, _141_two_gor_a, 0, _141_two_gor_ha }, - { "stage-gor", 7, _141_two_stage_gor_a, 0, _141_two_stage_gor_ha }, { "hor", 7, _141_two_hor_a, 0, _141_two_hor_ha }, - { "stage-hor", 7, _141_two_stage_hor_a, 0, _141_two_stage_hor_ha }, { "jam", 7, _141_two_jam_a, 0, _141_two_jam_ha }, { "lsh", 7, _141_two_lsh_a, 0, _141_two_lsh_ha }, { "mas", 7, _141_two_mas_a, 0, _141_two_mas_ha }, @@ -1198,13 +1003,10 @@ static u3j_core _141_two_d[] = // temporary alias for staging +vor -> +mor // { "vor", 7, _141_two_mor_a, 0, _141_two_mor_ha }, - { "stage-vor", 7, _141_two_stage_vor_a, 0, _141_two_stage_vor_ha }, { "xeb", 7, _141_two_xeb_a, 0, _141_two_xeb_ha }, { "by", 7, 0, _141_two__by_d, _141_two__by_ha }, - { "stage-by", 7, 0, _141_two__stage_by_d, _141_two__stage_by_ha }, { "in", 7, 0, _141_two__in_d, _141_two__in_ha }, - { "stage-in", 7, 0, _141_two__stage_in_d, _141_two__stage_in_ha }, {} }; static c3_c* _141_two_ha[] = {0}; diff --git a/meson.build b/meson.build index 7ba1d8be1..d62e1067e 100644 --- a/meson.build +++ b/meson.build @@ -75,11 +75,7 @@ jets_c_src = [ 'jets/c/rip.c', 'jets/c/rsh.c', 'jets/c/swp.c', -'jets/c/sqt.c', - -'jets/stage/c/gor.c', -'jets/stage/c/hor.c', -'jets/stage/c/vor.c', +'jets/c/sqt.c' ] jets_d_src = [ @@ -103,25 +99,7 @@ jets_d_src = [ 'jets/d/by_put.c', 'jets/d/by_uni.c', 'jets/d/by_bif.c', -'jets/d/by_dif.c', - -'jets/stage/d/in_bif.c', -'jets/stage/d/in_del.c', -'jets/stage/d/in_dif.c', -'jets/stage/d/in_gas.c', -'jets/stage/d/in_has.c', -'jets/stage/d/in_mer.c', -'jets/stage/d/in_put.c', -'jets/stage/d/in_uni.c', - -'jets/stage/d/by_bif.c', -'jets/stage/d/by_del.c', -'jets/stage/d/by_dif.c', -'jets/stage/d/by_gas.c', -'jets/stage/d/by_get.c', -'jets/stage/d/by_has.c', -'jets/stage/d/by_jab.c', -'jets/stage/d/by_put.c', +'jets/d/by_dif.c' ] jets_e_src = [ @@ -176,11 +154,7 @@ jets_f_src = [ 'jets/f/hint.c', 'jets/f/hike.c', 'jets/f/look.c', -'jets/f/loot.c', - -'jets/stage/f/fork.c', -'jets/stage/f/look.c', -'jets/stage/f/loot.c' +'jets/f/loot.c' ] jets_f_ut_src = [ @@ -203,28 +177,7 @@ jets_f_ut_src = [ 'jets/f/ut_rest.c', 'jets/f/ut_tack.c', 'jets/f/ut_toss.c', -'jets/f/ut_wrap.c', - -'jets/stage/f/ut.c', -'jets/stage/f/ut_buss.c', -'jets/stage/f/ut_crop.c', -'jets/stage/f/ut_find.c', -'jets/stage/f/ut_fire.c', -'jets/stage/f/ut_fish.c', -'jets/stage/f/ut_fuse.c', -'jets/stage/f/ut_gain.c', -'jets/stage/f/ut_lose.c', -'jets/stage/f/ut_mint.c', -'jets/stage/f/ut_mull.c', -'jets/stage/f/ut_nest.c', -'jets/stage/f/ut_peek.c', -'jets/stage/f/ut_peel.c', -'jets/stage/f/ut_play.c', -'jets/stage/f/ut_repo.c', -'jets/stage/f/ut_rest.c', -'jets/stage/f/ut_tack.c', -'jets/stage/f/ut_toss.c', -'jets/stage/f/ut_wrap.c', +'jets/f/ut_wrap.c' ] jets_src = [ From 4e9c237b611f3b5bed7516a19c307cf31a8a4e46 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Mon, 7 Jan 2019 23:35:06 -0500 Subject: [PATCH 26/78] Revert "adds pristine jet copies (hash-order, containers, compiler)" This reverts commit a906af1ca432b6fe7c3bb5915410c03af3efb619. --- jets/stage/c/gor.c | 32 -- jets/stage/c/vor.c | 31 -- jets/stage/d/by_bif.c | 82 ---- jets/stage/d/by_del.c | 111 ----- jets/stage/d/by_dif.c | 86 ---- jets/stage/d/by_gas.c | 65 --- jets/stage/d/by_get.c | 77 ---- jets/stage/d/by_has.c | 61 --- jets/stage/d/by_jab.c | 56 --- jets/stage/d/by_put.c | 117 ------ jets/stage/d/in_bif.c | 76 ---- jets/stage/d/in_del.c | 105 ----- jets/stage/d/in_dif.c | 82 ---- jets/stage/d/in_gas.c | 58 --- jets/stage/d/in_has.c | 58 --- jets/stage/d/in_mer.c | 80 ---- jets/stage/d/in_put.c | 102 ----- jets/stage/d/in_uni.c | 104 ----- jets/stage/f/fork.c | 78 ---- jets/stage/f/look.c | 134 ------ jets/stage/f/loot.c | 133 ------ jets/stage/f/ut.c | 100 ----- jets/stage/f/ut_buss.c | 93 ----- jets/stage/f/ut_conk.c | 88 ---- jets/stage/f/ut_crop.c | 271 ------------ jets/stage/f/ut_find.c | 914 ----------------------------------------- jets/stage/f/ut_fire.c | 200 --------- jets/stage/f/ut_fish.c | 180 -------- jets/stage/f/ut_fuse.c | 215 ---------- jets/stage/f/ut_gain.c | 16 - jets/stage/f/ut_lose.c | 16 - jets/stage/f/ut_mint.c | 904 ---------------------------------------- jets/stage/f/ut_mull.c | 852 -------------------------------------- jets/stage/f/ut_nest.c | 560 ------------------------- jets/stage/f/ut_peek.c | 232 ----------- jets/stage/f/ut_peel.c | 55 --- jets/stage/f/ut_play.c | 606 --------------------------- jets/stage/f/ut_repo.c | 70 ---- jets/stage/f/ut_rest.c | 114 ----- jets/stage/f/ut_tack.c | 21 - jets/stage/f/ut_toss.c | 97 ----- jets/stage/f/ut_wrap.c | 97 ----- 42 files changed, 7429 deletions(-) delete mode 100644 jets/stage/c/gor.c delete mode 100644 jets/stage/c/vor.c delete mode 100644 jets/stage/d/by_bif.c delete mode 100644 jets/stage/d/by_del.c delete mode 100644 jets/stage/d/by_dif.c delete mode 100644 jets/stage/d/by_gas.c delete mode 100644 jets/stage/d/by_get.c delete mode 100644 jets/stage/d/by_has.c delete mode 100644 jets/stage/d/by_jab.c delete mode 100644 jets/stage/d/by_put.c delete mode 100644 jets/stage/d/in_bif.c delete mode 100644 jets/stage/d/in_del.c delete mode 100644 jets/stage/d/in_dif.c delete mode 100644 jets/stage/d/in_gas.c delete mode 100644 jets/stage/d/in_has.c delete mode 100644 jets/stage/d/in_mer.c delete mode 100644 jets/stage/d/in_put.c delete mode 100644 jets/stage/d/in_uni.c delete mode 100644 jets/stage/f/fork.c delete mode 100644 jets/stage/f/look.c delete mode 100644 jets/stage/f/loot.c delete mode 100644 jets/stage/f/ut.c delete mode 100644 jets/stage/f/ut_buss.c delete mode 100644 jets/stage/f/ut_conk.c delete mode 100644 jets/stage/f/ut_crop.c delete mode 100644 jets/stage/f/ut_find.c delete mode 100644 jets/stage/f/ut_fire.c delete mode 100644 jets/stage/f/ut_fish.c delete mode 100644 jets/stage/f/ut_fuse.c delete mode 100644 jets/stage/f/ut_gain.c delete mode 100644 jets/stage/f/ut_lose.c delete mode 100644 jets/stage/f/ut_mint.c delete mode 100644 jets/stage/f/ut_mull.c delete mode 100644 jets/stage/f/ut_nest.c delete mode 100644 jets/stage/f/ut_peek.c delete mode 100644 jets/stage/f/ut_peel.c delete mode 100644 jets/stage/f/ut_play.c delete mode 100644 jets/stage/f/ut_repo.c delete mode 100644 jets/stage/f/ut_rest.c delete mode 100644 jets/stage/f/ut_tack.c delete mode 100644 jets/stage/f/ut_toss.c delete mode 100644 jets/stage/f/ut_wrap.c diff --git a/jets/stage/c/gor.c b/jets/stage/c/gor.c deleted file mode 100644 index 8e89b5e8c..000000000 --- a/jets/stage/c/gor.c +++ /dev/null @@ -1,32 +0,0 @@ -/* j/3/gor.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3qc_gor(u3_noun a, - u3_noun b) - { - c3_w c_w = u3r_mug(a); - c3_w d_w = u3r_mug(b); - - if ( c_w == d_w ) { - return u3qc_dor(a, b); - } - else return (c_w < d_w) ? c3y : c3n; - } - u3_noun - u3wc_gor(u3_noun cor) - { - u3_noun a, b; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) ) { - return u3m_bail(c3__exit); - } else { - return u3qc_gor(a, b); - } - } - diff --git a/jets/stage/c/vor.c b/jets/stage/c/vor.c deleted file mode 100644 index 28364140b..000000000 --- a/jets/stage/c/vor.c +++ /dev/null @@ -1,31 +0,0 @@ -/* j/3/vor.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3qc_vor(u3_atom a, - u3_atom b) - { - c3_w c_w = u3r_mug(u3r_mug(a)); - c3_w d_w = u3r_mug(u3r_mug(b)); - - if ( c_w == d_w ) { - return u3qc_dor(a, b); - } - else return (c_w < d_w) ? c3y : c3n; - } - u3_noun - u3wc_vor(u3_noun cor) - { - u3_noun a, b; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) ) { - return u3m_bail(c3__exit); - } else { - return u3qc_vor(a, b); - } - } diff --git a/jets/stage/d/by_bif.c b/jets/stage/d/by_bif.c deleted file mode 100644 index 3e53ba6d6..000000000 --- a/jets/stage/d/by_bif.c +++ /dev/null @@ -1,82 +0,0 @@ -/* jets/d/by_bif.c -** -*/ -#include "all.h" - -/* internal functions -*/ - static - u3_noun _b_bif_putroot(u3_noun a, - u3_noun b) - { - if ( u3_nul == a) { - return u3nt(u3k(b), u3_nul, u3_nul); - } - else { - u3_noun n_a, l_a, r_a; - u3_noun p_n_a, q_n_a; - u3_noun p_b, q_b; - - if ( (c3n == u3r_trel(a, &n_a, &l_a, &r_a)) - || (c3n == u3r_cell(b, &p_b, &q_b)) - || (c3n == u3r_cell(n_a, &p_n_a, &q_n_a)) ) { - return u3m_bail(c3__exit); - } - else if ( c3y == u3r_sing(p_b, p_n_a) ) { - return u3nt(u3k(b), u3k(l_a), u3k(r_a)); - } - else { - u3_noun c, n_c, l_c, r_c; - u3_noun d; - - if ( c3y == u3qc_gor(p_b, p_n_a) ) { - c = _b_bif_putroot(l_a, b); - u3r_trel(c, &n_c, &l_c, &r_c); - d = u3nt(u3k(n_c), - u3k(l_c), - u3nt(u3k(n_a), u3k(r_c), u3k(r_a)) - ); - u3z(c); - return d; - } else { - c = _b_bif_putroot(r_a, b); - u3r_trel(c, &n_c, &l_c, &r_c); - d = u3nt(u3k(n_c), - u3nt(u3k(n_a), u3k(l_a), u3k(l_c)), - u3k(r_c) - ); - u3z(c); - return d; - } - } - } - } - -/* functions -*/ - u3_noun u3wdb_bif(u3_noun cor) - { - u3_noun a, b; - if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { - return u3m_bail(c3__exit); - } else { - return u3qdb_bif(a, b); - } - } - - u3_noun u3qdb_bif(u3_noun a, - u3_noun b) - { - u3_noun c, n_c, l_c, r_c; - u3_noun d; - - c = _b_bif_putroot(a, b); - u3r_trel(c, &n_c, &l_c, &r_c); - d = u3nc(u3k(l_c), u3k(r_c)); - u3z(c); - return d; - } - - /* - u3_weak u3kdi_bif(u3_noun a, u3_noun b); - */ diff --git a/jets/stage/d/by_del.c b/jets/stage/d/by_del.c deleted file mode 100644 index 90e11b37c..000000000 --- a/jets/stage/d/by_del.c +++ /dev/null @@ -1,111 +0,0 @@ -/* j/4/by_del.c -** -*/ -#include "all.h" - -/* functions -*/ - static u3_noun - _rebalance(u3_noun a) - { - u3_noun l_a, n_a, r_a; - - if ( c3n == u3r_trel(a, &n_a, &l_a, &r_a) ) { - return u3m_bail(c3__exit); - } - else { - if ( u3_nul == l_a) { - return u3k(r_a); - } - else if ( u3_nul == r_a) { - return u3k(l_a); - } - else { - u3_noun n_l_a, l_l_a, r_l_a; - u3_noun n_r_a, l_r_a, r_r_a; - - if ( (c3n == u3r_trel(l_a, &n_l_a, &l_l_a, &r_l_a) ) || - (c3n == u3r_trel(r_a, &n_r_a, &l_r_a, &r_r_a) ) || - (c3n == u3du(n_l_a)) || - (c3n == u3du(n_r_a)) ) { - return u3m_bail(c3__exit); - } - else { - if ( c3y == u3qc_vor(u3h(n_l_a), u3h(n_r_a)) ) { - u3_noun new_right = u3nt(u3k(n_a), - u3k(r_l_a), - u3k(r_a)); - - u3_noun ret = u3nt(u3k(n_l_a), - u3k(l_l_a), - _rebalance(new_right)); - u3z(new_right); - - return ret; - } - else { - u3_noun new_left = u3nt(u3k(n_a), - u3k(l_a), - u3k(l_r_a)); - - u3_noun ret = u3nt(u3k(n_r_a), - _rebalance(new_left), - u3k(r_r_a)); - u3z(new_left); - - return ret; - } - } - } - } - } - - u3_noun - u3qdb_del(u3_noun a, - u3_noun b) - { - if ( u3_nul == a ) { - return u3_nul; - } - else { - u3_noun l_a, n_a, r_a, pn_a, qn_a; - - if ( (c3n == u3r_trel(a, &n_a, &l_a, &r_a)) || - (c3n == u3r_cell(n_a, &pn_a, &qn_a)) ) - { - return u3m_bail(c3__exit); - } - else if ( c3n == u3r_sing(pn_a, b) ) { - if ( c3y == u3qc_gor(b, pn_a) ) { - return u3nt(u3k(n_a), - u3qdb_del(l_a, b), - u3k(r_a)); - } - else { - return u3nt(u3k(n_a), - u3k(l_a), - u3qdb_del(r_a, b)); - } - } - else { - return _rebalance(a); - } - } - } - - u3_noun - u3wdb_del(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam, &b, - u3x_con_sam, &a, 0) ) { - return u3m_bail(c3__exit); - } - else { - u3_noun n = u3qdb_del(a, b); - return n; - } - } - - diff --git a/jets/stage/d/by_dif.c b/jets/stage/d/by_dif.c deleted file mode 100644 index 7973a4f34..000000000 --- a/jets/stage/d/by_dif.c +++ /dev/null @@ -1,86 +0,0 @@ -/* jets/d/by_dif.c -** -*/ -#include "all.h" - -/* internal functions -*/ - static - u3_noun _b_dif_join(u3_noun d, - u3_noun e) - { - if ( u3_nul == d ) { - return u3k(e); - } else if (u3_nul == e) { - return u3k(d); - } else { - u3_noun n_d, l_d, r_d; - u3_noun n_e, l_e, r_e; - u3_noun p_n_d, q_n_d; - u3_noun p_n_e, q_n_e; - - if ( c3n == u3r_trel(d, &n_d, &l_d, &r_d) - || c3n == u3r_trel(e, &n_e, &l_e, &r_e) - || c3n == u3r_cell(n_d, &p_n_d, &q_n_d) - || c3n == u3r_cell(n_e, &p_n_e, &q_n_e) ) { - return u3m_bail(c3__exit); - } else { - if ( c3y == u3qc_vor(p_n_d, p_n_e) ) { - return u3nt(u3k(n_d), - u3k(l_d), - _b_dif_join(u3k(r_d), u3k(e))); - } else { - return u3nt(u3k(n_e), - _b_dif_join(u3k(d), u3k(l_e)), - u3k(r_e)); - } - } - } - } - -/* functions -*/ - u3_noun u3wdb_dif(u3_noun cor) - { - u3_noun a, b; - if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { - return u3m_bail(c3__exit); - } else { - return u3qdb_dif(a, b); - } - } - - u3_noun u3qdb_dif(u3_noun a, - u3_noun b) - { - if ( u3_nul == b ) { - return u3k(a); - } else { - u3_noun n_b, l_b, r_b; - u3_noun c, l_c, r_c; - - if ( c3n == u3r_trel(b, &n_b, &l_b, &r_b) ) { - return u3m_bail(c3__exit); - } else { - - c = u3qdb_bif(a, n_b); - - if ( c3n == u3r_cell(c, &l_c, &r_c) ) { - return u3m_bail(c3__exit); - } else { - u3_noun d; - u3_noun e; - - d = u3qdb_dif(l_c, l_b); - e = u3qdb_dif(r_c, r_b); - u3z(c); - - return _b_dif_join(d, e); - } - } - } - } - - /* - u3_weak u3kdb_dif(u3_noun a, u3_noun b); - */ diff --git a/jets/stage/d/by_gas.c b/jets/stage/d/by_gas.c deleted file mode 100644 index caa7f5291..000000000 --- a/jets/stage/d/by_gas.c +++ /dev/null @@ -1,65 +0,0 @@ -/* j/4/gas.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3qdb_gas(u3_noun a, - u3_noun b) - { - if ( u3_nul == b ) { - return u3k(a); - } - else { - if ( c3n == u3du(b) ) { - return u3m_bail(c3__exit); - } else { - u3_noun i_b = u3h(b); - u3_noun t_b = u3t(b); - - if ( c3n == u3du(i_b) ) { - return u3m_bail(c3__exit); - } else { - u3_noun pi_b = u3h(i_b); - u3_noun qi_b = u3t(i_b); - u3_noun c; - - if ( u3_none == (c = u3qdb_put(a, pi_b, qi_b)) ) { - return u3m_bail(c3__exit); - } else { - u3_noun d = u3qdb_gas(c, t_b); - - u3z(c); - return d; - } - } - } - } - } - u3_noun - u3wdb_gas(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { - return u3m_bail(c3__exit); - } else { - return u3qdb_gas(a, b); - } - } - u3_noun - u3kdb_gas(u3_noun a, - u3_noun b) - { - u3_weak c = u3qdb_gas(a, b); - - u3z(a); u3z(b); - if ( u3_none == c ) { - return u3m_bail(c3__exit); - } - else return c; - } - diff --git a/jets/stage/d/by_get.c b/jets/stage/d/by_get.c deleted file mode 100644 index 588578764..000000000 --- a/jets/stage/d/by_get.c +++ /dev/null @@ -1,77 +0,0 @@ -/* j/4/by_get.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3qdb_get(u3_noun a, - u3_noun b) - { - if ( u3_nul == a ) { - return u3_nul; - } - else { - u3_noun l_a, n_a, r_a; - u3_noun pn_a, qn_a; - - if ( (c3n == u3r_trel(a, &n_a, &l_a, &r_a)) || - (c3n == u3r_cell(n_a, &pn_a, &qn_a) ) ) - { - return u3m_bail(c3__exit); - } - else { - if ( (c3y == u3r_sing(b, pn_a)) ) { - return u3nc(u3_nul, u3k(qn_a)); - } - else { - if ( c3y == u3qc_gor(b, pn_a) ) { - return u3qdb_get(l_a, b); - } - else return u3qdb_get(r_a, b); - } - } - } - } - u3_noun - u3wdb_get(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { - return u3m_bail(c3__exit); - } else { - return u3qdb_get(a, b); - } - } - u3_weak - u3kdb_get(u3_noun a, - u3_noun b) - { - u3_noun c = u3qdb_get(a, b); - - u3z(a); u3z(b); - if ( c3n == u3r_du(c) ) { - u3z(c); - return u3_none; - } else { - u3_noun pro = u3k(u3t(c)); - - u3z(c); - return pro; - } - } - u3_noun - u3kdb_got(u3_noun a, - u3_noun b) - { - u3_weak c = u3kdb_get(a, b); - - if ( u3_none == c ) { - return u3m_bail(c3__exit); - } - else return c; - } - diff --git a/jets/stage/d/by_has.c b/jets/stage/d/by_has.c deleted file mode 100644 index 0fa41bf3e..000000000 --- a/jets/stage/d/by_has.c +++ /dev/null @@ -1,61 +0,0 @@ -/* j/4/by_has.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3qdb_has(u3_noun a, - u3_noun b) - { - if ( u3_nul == a ) { - return c3n; - } - else { - u3_noun l_a, n_a, r_a; - u3_noun pn_a, qn_a; - - if ( (c3n == u3r_trel(a, &n_a, &l_a, &r_a)) || - (c3n == u3r_cell(n_a, &pn_a, &qn_a)) ) - { - return u3m_bail(c3__exit); - } - else { - if ( (c3y == u3r_sing(b, pn_a)) ) { - return c3y; - } - else { - if ( c3y == u3qc_gor(b, pn_a) ) { - return u3qdb_has(l_a, b); - } - else return u3qdb_has(r_a, b); - } - } - } - } - u3_noun - u3wdb_has(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { - return u3m_bail(c3__exit); - } else { - return u3qdb_has(a, b); - } - } - u3_noun - u3kdb_has(u3_noun a, - u3_noun b) - { - u3_weak c = u3qdb_has(a, b); - - u3z(a); u3z(b); - if ( u3_none == c ) { - return u3m_bail(c3__exit); - } - else return c; - } - diff --git a/jets/stage/d/by_jab.c b/jets/stage/d/by_jab.c deleted file mode 100644 index f147232a2..000000000 --- a/jets/stage/d/by_jab.c +++ /dev/null @@ -1,56 +0,0 @@ -/* j/4/by_jab.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3qdb_jab(u3_noun a, - u3_noun key, - u3_noun fun) - { - if ( u3_nul == a ) { - return u3m_bail(c3__exit); - } - else { - u3_noun l_a, n_a, r_a; - u3_noun pn_a, qn_a; - - if ( (c3n == u3r_trel(a, &n_a, &l_a, &r_a)) || - (c3n == u3r_cell(n_a, &pn_a, &qn_a) ) ) - { - return u3m_bail(c3__exit); - } - else { - if ( (c3y == u3r_sing(key, pn_a)) ) { - u3_noun value = u3n_slam_on(u3k(fun), u3k(qn_a)); - return u3nc(u3nc(u3k(pn_a), value), u3k(u3t(a))); - } - else { - if ( c3y == u3qc_gor(key, pn_a) ) { - return u3nt(u3k(n_a), u3qdb_jab(l_a, key, fun), u3k(r_a)); - } - else { - return u3nt(u3k(n_a), u3k(l_a), u3qdb_jab(r_a, key, fun)); - } - } - } - } - } - - u3_noun - u3wdb_jab(u3_noun cor) - { - u3_noun a, key, fun; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &key, - u3x_sam_3, &fun, - u3x_con_sam, &a, 0) ) { - return u3m_bail(c3__exit); - } else { - u3_noun n = u3qdb_jab(a, key, fun); - return n; - } - } diff --git a/jets/stage/d/by_put.c b/jets/stage/d/by_put.c deleted file mode 100644 index 5bafdc0c2..000000000 --- a/jets/stage/d/by_put.c +++ /dev/null @@ -1,117 +0,0 @@ -/* j/4/put.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3qdb_put(u3_noun a, - u3_noun b, - u3_noun c) - { - if ( u3_nul == a ) { - return u3nt( - u3nc(u3k(b), - u3k(c)), - u3_nul, - u3_nul); - } - else { - u3_noun l_a, n_a, r_a, pn_a, qn_a; - u3_noun d, l_d, n_d, r_d; - - if ( (c3n == u3r_trel(a, &n_a, &l_a, &r_a)) || - (c3n == u3r_cell(n_a, &pn_a, &qn_a)) ) - { - return u3m_bail(c3__exit); - } - else if ( c3y == u3r_sing(pn_a, b) ) { - if ( c3y == u3r_sing(qn_a, c) ) { - return u3k(a); - } else { - return u3nt - (u3nc(u3k(b), u3k(c)), - u3k(l_a), - u3k(r_a)); - } - } - else { - if ( c3y == u3qc_gor(b, pn_a) ) { - d = u3qdb_put(l_a, b, c); - - if ( c3y == u3qc_vor(pn_a, u3h(u3h(d))) ) { - return u3nt(u3k(n_a), - d, - u3k(r_a)); - } - else { - u3r_trel(d, &n_d, &l_d, &r_d); - { - u3_noun e = u3nt - (u3k(n_d), - u3k(l_d), - u3nt(u3k(n_a), - u3k(r_d), - u3k(r_a))); - - u3z(d); - return e; - } - } - } - else { - d = u3qdb_put(r_a, b, c); - - if ( c3y == u3qc_vor(pn_a, u3h(u3h(d))) ) { - return u3nt(u3k(n_a), - u3k(l_a), - d); - } - else { - u3r_trel(d, &n_d, &l_d, &r_d); - { - u3_noun e = u3nt - (u3k(n_d), - u3nt(u3k(n_a), - u3k(l_a), - u3k(l_d)), - u3k(r_d)); - - u3z(d); - return e; - } - } - } - } - } - } - u3_noun - u3wdb_put(u3_noun cor) - { - u3_noun a, b, c; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &b, - u3x_sam_3, &c, - u3x_con_sam, &a, 0) ) { - return u3m_bail(c3__exit); - } else { - return u3qdb_put(a, b, c); - } - } - u3_weak - u3kdb_put(u3_noun a, - u3_noun b, - u3_noun c) - { - // Bizarre asymmetry in old jets. - // - // (Mysterious comment in old glue code.) - // - u3_noun pro = u3qdb_put(a, b, c); - - u3z(a); u3z(b); u3z(c); - return pro; - } - diff --git a/jets/stage/d/in_bif.c b/jets/stage/d/in_bif.c deleted file mode 100644 index 4c5bdbeb9..000000000 --- a/jets/stage/d/in_bif.c +++ /dev/null @@ -1,76 +0,0 @@ -/* jets/d/in_bif.c -** -*/ -#include "all.h" - -/* internal functions -*/ - static - u3_noun _i_bif_putroot(u3_noun a, - u3_noun b) - { - if ( u3_nul == a) { - return u3nt(u3k(b), u3_nul, u3_nul); - } - else { - u3_noun n_a, l_a, r_a; - - if ( (c3n == u3r_trel(a, &n_a, &l_a, &r_a)) ) { - return u3m_bail(c3__exit); - } - else if ( c3y == u3r_sing(b, n_a) ) { - return u3k(a); - } - else { - u3_noun c, n_c, l_c, r_c; - u3_noun d; - - if ( c3y == u3qc_hor(b, n_a) ) { - c = _i_bif_putroot(l_a, b); - u3r_trel(c, &n_c, &l_c, &r_c); - d = u3nt(u3k(n_c), - u3k(l_c), - u3nt(u3k(n_a), u3k(r_c), u3k(r_a))); - u3z(c); - return d; - } else { - c = _i_bif_putroot(r_a, b); - u3r_trel(c, &n_c, &l_c, &r_c); - d = u3nt(u3k(n_c), - u3nt(u3k(n_a), u3k(l_a), u3k(l_c)), - u3k(r_c)); - u3z(c); - return d; - } - } - } - } - -/* functions -*/ - u3_noun u3wdi_bif(u3_noun cor) - { - u3_noun a, b; - if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { - return u3m_bail(c3__exit); - } else { - return u3qdi_bif(a, b); - } - } - - u3_noun u3qdi_bif(u3_noun a, - u3_noun b) - { - u3_noun c, n_c, l_c, r_c; - u3_noun d; - - c = _i_bif_putroot(a, b); - u3r_trel(c, &n_c, &l_c, &r_c); - d = u3nc(u3k(l_c), u3k(r_c)); - u3z(c); - return d; - } - - /* - u3_weak u3kdi_bif(u3_noun a, u3_noun b); - */ diff --git a/jets/stage/d/in_del.c b/jets/stage/d/in_del.c deleted file mode 100644 index 02390ccce..000000000 --- a/jets/stage/d/in_del.c +++ /dev/null @@ -1,105 +0,0 @@ -/* j/4/in_del.c -** -*/ -#include "all.h" - -/* functions -*/ - static u3_noun - _rebalance(u3_noun a) - { - u3_noun l_a, n_a, r_a; - - if ( c3n == u3r_trel(a, &n_a, &l_a, &r_a) ) { - return u3m_bail(c3__exit); - } - else { - if ( u3_nul == l_a) { - return u3k(r_a); - } - else if ( u3_nul == r_a) { - return u3k(l_a); - } - else { - u3_noun n_l_a, l_l_a, r_l_a; - u3_noun n_r_a, l_r_a, r_r_a; - - if ( (c3n == u3r_trel(l_a, &n_l_a, &l_l_a, &r_l_a) ) || - (c3n == u3r_trel(r_a, &n_r_a, &l_r_a, &r_r_a) ) ) { - return u3m_bail(c3__exit); - } - else { - if ( c3y == u3qc_vor(n_l_a, n_r_a) ) { - u3_noun new_right = u3nt(u3k(n_a), - u3k(r_l_a), - u3k(r_a)); - - u3_noun ret = u3nt(u3k(n_l_a), - u3k(l_l_a), - _rebalance(new_right)); - u3z(new_right); - - return ret; - } - else { - u3_noun new_left = u3nt(u3k(n_a), - u3k(l_a), - u3k(l_r_a)); - - u3_noun ret = u3nt(u3k(n_r_a), - _rebalance(new_left), - u3k(r_r_a)); - u3z(new_left); - - return ret; - } - } - } - } - } - - u3_noun - u3qdi_del(u3_noun a, - u3_noun b) - { - if ( u3_nul == a ) { - return u3_nul; - } - else { - u3_noun l_a, n_a, r_a; - - if ( (c3n == u3r_trel(a, &n_a, &l_a, &r_a)) ) { - return u3m_bail(c3__exit); - } - else if ( c3n == u3r_sing(n_a, b) ) { - if ( c3y == u3qc_hor(b, n_a) ) { - return u3nt(u3k(n_a), - u3qdi_del(l_a, b), - u3k(r_a)); - } - else { - return u3nt(u3k(n_a), - u3k(l_a), - u3qdi_del(r_a, b)); - } - } - else { - return _rebalance(a); - } - } - } - - u3_noun - u3wdi_del(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam, &b, - u3x_con_sam, &a, 0) ) { - return u3m_bail(c3__exit); - } - else { - u3_noun n = u3qdi_del(a, b); - return n; - } - } diff --git a/jets/stage/d/in_dif.c b/jets/stage/d/in_dif.c deleted file mode 100644 index 389cc1fa5..000000000 --- a/jets/stage/d/in_dif.c +++ /dev/null @@ -1,82 +0,0 @@ -/* jets/d/in_dif.c -** -*/ -#include "all.h" - -/* internal functions -*/ - static - u3_noun _i_dif_join(u3_noun d, - u3_noun e) - { - if ( u3_nul == d ) { - return u3k(e); - } else if (u3_nul == e) { - return u3k(d); - } else { - u3_noun n_d, l_d, r_d; - u3_noun n_e, l_e, r_e; - - if ( c3n == u3r_trel(d, &n_d, &l_d, &r_d) - || c3n == u3r_trel(e, &n_e, &l_e, &r_e) ) { - return u3m_bail(c3__exit); - } else { - if ( c3y == u3qc_vor(n_d, n_e) ) { - return u3nt(u3k(n_d), - u3k(l_d), - _i_dif_join(u3k(r_d), u3k(e))); - } else { - return u3nt(u3k(n_e), - _i_dif_join(u3k(d), u3k(l_e)), - u3k(r_e)); - } - } - } - } - -/* functions -*/ - u3_noun u3wdi_dif(u3_noun cor) - { - u3_noun a, b; - if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { - return u3m_bail(c3__exit); - } else { - return u3qdi_dif(a, b); - } - } - - u3_noun u3qdi_dif(u3_noun a, - u3_noun b) - { - if ( u3_nul == b ) { - return u3k(a); - } else { - u3_noun n_b, l_b, r_b; - u3_noun c, l_c, r_c; - - if ( c3n == u3r_trel(b, &n_b, &l_b, &r_b) ) { - return u3m_bail(c3__exit); - } else { - - c = u3qdi_bif(a, n_b); - - if ( c3n == u3r_cell(c, &l_c, &r_c) ) { - return u3m_bail(c3__exit); - } else { - u3_noun d; - u3_noun e; - - d = u3qdi_dif(l_c, l_b); - e = u3qdi_dif(r_c, r_b); - u3z(c); - - return _i_dif_join(d, e); - } - } - } - } - - /* - u3_weak u3kdi_dif(u3_noun a, u3_noun b); - */ diff --git a/jets/stage/d/in_gas.c b/jets/stage/d/in_gas.c deleted file mode 100644 index f3f8d7372..000000000 --- a/jets/stage/d/in_gas.c +++ /dev/null @@ -1,58 +0,0 @@ -/* j/4/gas.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3qdi_gas(u3_noun a, - u3_noun b) - { - if ( u3_nul == b ) { - return u3k(a); - } - else { - if ( c3n == u3du(b) ) { - return u3m_bail(c3__exit); - } else { - u3_noun i_b = u3h(b); - u3_noun t_b = u3t(b); - u3_noun c; - - if ( u3_none == (c = u3qdi_put(a, i_b)) ) { - return u3m_bail(c3__exit); - } else { - u3_noun d = u3qdi_gas(c, t_b); - - u3z(c); - return d; - } - } - } - } - u3_noun - u3wdi_gas(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { - return u3m_bail(c3__exit); - } else { - return u3qdi_gas(a, b); - } - } - u3_noun - u3kdi_gas(u3_noun a, - u3_noun b) - { - u3_weak c = u3qdi_gas(a, b); - - u3z(a); u3z(b); - if ( u3_none == c ) { - return u3m_bail(c3__exit); - } - else return c; - } - diff --git a/jets/stage/d/in_has.c b/jets/stage/d/in_has.c deleted file mode 100644 index fb142bc74..000000000 --- a/jets/stage/d/in_has.c +++ /dev/null @@ -1,58 +0,0 @@ -/* j/4/in_has.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3qdi_has(u3_noun a, - u3_noun b) - { - if ( u3_nul == a ) { - return c3n; - } - else { - u3_noun l_a, n_a, r_a; - - if ( (c3n == u3r_mean(a, 2, &n_a, 6, &l_a, 7, &r_a, 0)) ) { - return u3m_bail(c3__exit); - } - else { - if ( (c3y == u3r_sing(b, n_a)) ) { - return c3y; - } - else { - if ( c3y == u3qc_hor(b, n_a) ) { - return u3qdi_has(l_a, b); - } - else return u3qdi_has(r_a, b); - } - } - } - } - u3_noun - u3wdi_has(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { - return u3m_bail(c3__exit); - } else { - return u3qdi_has(a, b); - } - } - u3_noun - u3kdi_has(u3_noun a, - u3_noun b) - { - u3_weak c = u3qdi_has(a, b); - - u3z(a); u3z(b); - if ( u3_none == c ) { - return u3m_bail(c3__exit); - } - else return c; - } - diff --git a/jets/stage/d/in_mer.c b/jets/stage/d/in_mer.c deleted file mode 100644 index 14fa6675f..000000000 --- a/jets/stage/d/in_mer.c +++ /dev/null @@ -1,80 +0,0 @@ -/* j/4/in_mer.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3qdi_mer(u3_noun a, - u3_noun b) - { - if ( u3_nul == a ) { - return u3k(b); - } - else if ( u3_nul == b ) { - return u3k(a); - } - else { - u3_noun l_a, n_a, r_a, lr_a; // XX copy tree boilerplate to other pt4 - u3_noun l_b, n_b, r_b, lr_b; - u3_noun c; - - if ( (c3n == u3r_cell(a, &n_a, &lr_a)) ) { - return u3m_bail(c3__exit); - } - else if ( (c3n == u3r_cell(b, &n_b, &lr_b)) ) { - return u3m_bail(c3__exit); - } - else { - if ( c3y == u3qc_vor(n_b, n_a) ) { - c = a; a = b; b = c; - c = n_a; n_a = n_b; n_b = c; - c = lr_a; lr_a = lr_b; lr_b = c; - } - if ( c3n == u3r_cell(lr_a, &l_a, &r_a) ) { - return u3m_bail(c3__exit); - } - else if ( c3n == u3r_cell(lr_b, &l_b, &r_b) ) { - return u3m_bail(c3__exit); - } - else if ( c3y == u3r_sing(n_a, n_b) ) { - return u3nt(u3k(n_a), - u3qdi_mer(l_a, l_b), - u3qdi_mer(r_a, r_b)); - } - else if ( c3y == u3qc_hor(n_b, n_a) ) { - return u3qdi_mer(u3nt(n_a, - u3qdi_mer(l_a, - u3nt(n_b, - l_b, - u3_nul)), - r_a), - r_b); - } - else { - return u3qdi_mer(u3nt(n_a, - l_a, - u3qdi_mer(r_a, - u3nt(n_b, - u3_nul, - r_b))), - l_b); - } - } - } - } - - u3_noun - u3wdi_mer(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { - return u3m_bail(c3__exit); - } - else { - return u3qdi_mer(a, b); - } - } diff --git a/jets/stage/d/in_put.c b/jets/stage/d/in_put.c deleted file mode 100644 index 10d2c4329..000000000 --- a/jets/stage/d/in_put.c +++ /dev/null @@ -1,102 +0,0 @@ -/* j/4/in_put.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3qdi_put(u3_noun a, - u3_noun b) - { - if ( u3_nul == a ) { - return u3nt(u3k(b), u3_nul, u3_nul); - } - else { - u3_noun l_a, n_a, r_a, lr_a; // XX copy tree boilerplate to other pt4 - u3_noun c, l_c, n_c, r_c; - - if ( (c3n == u3r_cell(a, &n_a, &lr_a)) ) { - return u3m_bail(c3__exit); - } - else if ( c3y == u3r_sing(n_a, b) ) { - return u3k(a); - } - else if ( c3n == u3r_cell(lr_a, &l_a, &r_a) ) { - return u3m_bail(c3__exit); - } - else { - if ( c3y == u3qc_hor(b, n_a) ) { - c = u3qdi_put(l_a, b); - - if ( c3y == u3qc_vor(n_a, u3h(c)) ) { - return u3nt(u3k(n_a), - c, - u3k(r_a)); - } - else { - u3r_trel(c, &n_c, &l_c, &r_c); - { - u3_noun d = u3nt(u3k(n_c), - u3k(l_c), - u3nt(u3k(n_a), - u3k(r_c), - u3k(r_a))); - - u3z(c); - return d; - } - } - } - else { - c = u3qdi_put(r_a, b); - - if ( c3y == u3qc_vor(n_a, u3h(c)) ) { - return u3nt(u3k(n_a), - u3k(l_a), - c); - } - else { - u3r_trel(c, &n_c, &l_c, &r_c); - { - u3_noun d = u3nt(u3k(n_c), - u3nt(u3k(n_a), - u3k(l_a), - u3k(l_c)), - u3k(r_c)); - - u3z(c); - return d; - } - } - } - } - } - } - u3_noun - u3wdi_put(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { - return u3m_bail(c3__exit); - } else { - return u3qdi_put(a, b); - } - } - u3_weak - u3kdi_put(u3_noun a, - u3_noun b) - { - // Bizarre asymmetry in old jets. - // - // (Mysterious comment in old glue code.) - // - u3_noun pro = u3qdi_put(a, b); - - u3z(a); u3z(b); - return pro; - } - - diff --git a/jets/stage/d/in_uni.c b/jets/stage/d/in_uni.c deleted file mode 100644 index 85f07b835..000000000 --- a/jets/stage/d/in_uni.c +++ /dev/null @@ -1,104 +0,0 @@ -/* j/4/in_uni.c -** -*/ -#include "all.h" - -/* internal functions -*/ - -static u3_noun -_in_uni(u3_noun a, u3_noun b) -{ - u3_noun n_a, l_a, r_a, - n_b, l_b, r_b, - neb, sub, naw, pro; - if ( u3_nul == a ) { - return u3k(b); - } - else if ( u3_nul == b ) { - return u3k(a); - } - else if ( (c3n == u3r_trel(a, &n_a, &l_a, &r_a)) - || (c3n == u3r_trel(b, &n_b, &l_b, &r_b)) ) - { - return u3m_bail(c3__exit); - } - else if ( c3n == u3qc_vor(n_a, n_b) ) { - if ( c3y == u3r_sing(n_a, n_b) ) { - return u3nt(u3k(n_b), _in_uni(l_a, l_b), _in_uni(r_a, r_b)); - } - else if ( c3y == u3qc_hor(n_a, n_b) ) { - naw = u3nt(u3k(n_a), u3k(l_a), u3_nul); - sub = _in_uni(naw, l_b); - neb = u3nt(u3k(n_b), sub, u3k(r_b)); - pro = _in_uni(r_a, neb); - u3z(naw); u3z(neb); - return pro; - } - else { - naw = u3nt(u3k(n_a), u3_nul, u3k(r_a)); - sub = _in_uni(naw, r_b); - neb = u3nt(u3k(n_b), u3k(l_b), sub); - pro = _in_uni(l_a, neb); - u3z(naw); u3z(neb); - return pro; - } - } - else if ( c3y == u3r_sing(n_b, n_a) ) { - return u3nt(u3k(n_b), _in_uni(l_a, l_b), _in_uni(r_a, r_b)); - } - else if ( c3y == u3qc_hor(n_b, n_a) ) { - neb = u3nt(u3k(n_b), u3k(l_b), u3_nul); - sub = _in_uni(l_a, neb); - naw = u3nt(u3k(n_a), sub, u3k(r_a)); - pro = _in_uni(naw, r_b); - u3z(neb); u3z(naw); - return pro; - } - else { - neb = u3nt(u3k(n_b), u3_nul, u3k(r_b)); - sub = _in_uni(r_a, neb); - naw = u3nt(u3k(n_a), u3k(l_a), sub); - pro = _in_uni(naw, l_b); - u3z(neb); u3z(naw); - return pro; - } -} - - -/* functions -*/ - u3_noun - u3kdi_uni(u3_noun a, - u3_noun b) - { - u3_noun c = u3qdi_uni(a, b); - - u3z(a); - u3z(b); - return c; - } - - u3_noun - u3qdi_uni(u3_noun a, - u3_noun b) - { - if ( c3y == u3r_sing(a, b) ) { - return u3k(a); - } - else { - return _in_uni(a, b); - } - } - u3_noun - u3wdi_uni(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { - return u3m_bail(c3__exit); - } else { - return u3qdi_uni(a, b); - } - } - diff --git a/jets/stage/f/fork.c b/jets/stage/f/fork.c deleted file mode 100644 index 37aaad236..000000000 --- a/jets/stage/f/fork.c +++ /dev/null @@ -1,78 +0,0 @@ -/* j/6/fork.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3qf_forq(u3_noun hoz, - u3_noun bur) - { - if ( c3y == u3r_sing(hoz, bur) ) { - return u3k(hoz); - } - else if ( c3__void == bur ) { - return u3k(hoz); - } - else if ( c3__void == hoz ) { - return u3k(bur); - } - else return u3kf_fork(u3nt(u3k(hoz), u3k(bur), u3_nul)); - } - - u3_noun - u3qf_fork(u3_noun yed) - { - u3_noun lez = u3_nul; - - while ( u3_nul != yed ) { - u3_noun i_yed = u3h(yed); - - if ( c3__void != i_yed ) { - if ( (c3y == u3du(i_yed)) && (c3__fork == u3h(i_yed)) ) { - lez = u3kdi_uni(lez, u3k(u3t(i_yed))); - } - else { - lez = u3kdi_put(lez, u3k(i_yed)); - } - } - - yed = u3t(yed); - } - - if ( u3_nul == lez ) { - return c3__void; - } - else if ( (u3_nul == u3h(u3t(lez))) && (u3_nul == u3t(u3t(lez))) ) { - u3_noun ret = u3k(u3h(lez)); - - u3z(lez); - return ret; - } - else { - return u3nc(c3__fork, lez); - } - } - - u3_noun - u3wf_fork(u3_noun cor) - { - u3_noun yed; - - if ( c3n == u3r_mean(cor, u3x_sam, &yed, 0) ) { - return u3m_bail(c3__fail); - } else { - return u3qf_fork(yed); - } - } - - u3_noun - u3kf_fork(u3_noun yed) - { - u3_noun ret = u3qf_fork(yed); - - u3z(yed); - return ret; - } diff --git a/jets/stage/f/look.c b/jets/stage/f/look.c deleted file mode 100644 index b03df8770..000000000 --- a/jets/stage/f/look.c +++ /dev/null @@ -1,134 +0,0 @@ -/* j/6/look.c -** -*/ -#include "all.h" - - -/* internals -*/ - static u3_noun - _look_in(u3_noun cog, - u3_noun dab, - u3_atom axe) - { - if ( u3_nul == dab ) { - return u3_nul; - } - else { - u3_noun n_dab, l_dab, r_dab; - - u3r_trel(dab, &n_dab, &l_dab, &r_dab); - if ( c3n == u3du(n_dab) ) { - // return u3m_bail(c3__fail); - fprintf(stderr, "bad look\r\n"); - return u3m_bail(c3__exit) ; - } - else { - u3_noun pn_dab = u3h(n_dab); - u3_noun qn_dab = u3t(n_dab); - - if ( (u3_nul == l_dab) && (u3_nul == r_dab) ) { - if ( (c3y == u3du(qn_dab)) && - (c3y == u3r_sing(cog, pn_dab)) ) { - return u3nt(u3_nul, - u3k(axe), - u3k(qn_dab)); - } - else { - return u3_nul; - } - } - else if ( (u3_nul == l_dab) ) { - if ( (c3y == u3du(qn_dab)) && - (c3y == u3r_sing(cog, pn_dab)) ) { - return u3nt(u3_nul, - u3qc_peg(axe, 2), - u3k(qn_dab)); - } - else { - if ( c3y == u3qc_gor(cog, pn_dab) ) { - return u3_nul; - } - else { - u3_noun pro; - - axe = u3qc_peg(axe, 3); - pro = _look_in(cog, r_dab, axe); - u3z(axe); - return pro; - } - } - } - else if ( (u3_nul == r_dab) ) { - if ( (c3y == u3du(qn_dab)) && - (c3y == u3r_sing(cog, pn_dab)) ) { - return u3nt(u3_nul, - u3qc_peg(axe, 2), - u3k(qn_dab)); - } - else { - if ( c3y == u3qc_gor(cog, pn_dab) ) { - u3_noun pro; - - axe = u3qc_peg(axe, 3); - pro = _look_in(cog, l_dab, axe); - u3z(axe); - return pro; - } - else { - return u3_nul; - } - } - } - else { - if ( (c3y == u3du(qn_dab)) && - (c3y == u3r_sing(cog, pn_dab)) ) { - return u3nt(u3_nul, - u3qc_peg(axe, 2), - u3k(qn_dab)); - } - else { - if ( c3y == u3qc_gor(cog, pn_dab) ) { - u3_noun pro; - - axe = u3qc_peg(axe, 6); - pro = _look_in(cog, l_dab, axe); - u3z(axe); - return pro; - } - else { - u3_noun pro; - - axe = u3qc_peg(axe, 7); - pro = _look_in(cog, r_dab, axe); - u3z(axe); - return pro; - } - } - } - } - } - } - - - - -/* functions -*/ - u3_noun - u3qf_look(u3_noun cog, - u3_noun dab) - { - return _look_in(cog, dab, 1); - } - u3_noun - u3wf_look(u3_noun cor) - { - u3_noun cog, dab; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &cog, u3x_sam_3, &dab, 0) ) { - return u3m_bail(c3__fail); - } else { - return u3qf_look(cog, dab); - } - } diff --git a/jets/stage/f/loot.c b/jets/stage/f/loot.c deleted file mode 100644 index 06abf7542..000000000 --- a/jets/stage/f/loot.c +++ /dev/null @@ -1,133 +0,0 @@ -/* j/6/loot.c -** -*/ -#include "all.h" - - -/* internals -*/ - static u3_noun - _loot_in(u3_noun cog, - u3_noun dom, - u3_atom axe) - { - if ( u3_nul == dom ) { - return u3_nul; - } - else { - u3_noun n_dom, l_dom, r_dom; - - u3r_trel(dom, &n_dom, &l_dom, &r_dom); - if ( c3n == u3du(n_dom) ) { - return u3m_bail(c3__fail); - } - else { - u3_noun qqn_dom = u3t(u3t(n_dom)); - u3_noun yep = u3qf_look(cog, qqn_dom); - - if ( (u3_nul == l_dom) && (u3_nul == r_dom) ) { - if ( u3_nul == yep ) { - return u3_nul; - } else { - u3_noun u_yep = u3t(yep); - u3_noun pro; - - pro = u3nt(u3_nul, u3qc_peg(axe, u3h(u_yep)), u3k(u3t(u_yep))); - u3z(yep); - return pro; - } - } - else if ( (u3_nul == l_dom) ) { - if ( u3_nul == yep ) { - u3_noun nax = u3qc_peg(axe, 3); - u3_noun pro; - - pro = _loot_in(cog, r_dom, nax); - u3z(nax); - return pro; - } - else { - u3_noun u_yep = u3t(yep); - u3_noun nax = u3qc_peg(axe, 2); - u3_noun pro; - - pro = u3nt(u3_nul, u3qc_peg(nax, u3h(u_yep)), u3k(u3t(u_yep))); - u3z(nax); - u3z(yep); - return pro; - } - } - else if ( (u3_nul == r_dom) ) { - if ( u3_nul == yep ) { - u3_noun nax = u3qc_peg(axe, 3); - u3_noun pro; - - pro = _loot_in(cog, l_dom, nax); - u3z(nax); - return pro; - } - else { - u3_noun u_yep = u3t(yep); - u3_noun nax = u3qc_peg(axe, 2); - u3_noun pro; - - pro = u3nt(u3_nul, u3qc_peg(nax, u3h(u_yep)), u3k(u3t(u_yep))); - u3z(nax); - u3z(yep); - return pro; - } - } - else { - if ( u3_nul == yep ) { - u3_noun nax = u3qc_peg(axe, 6); - u3_noun pey; - - pey = _loot_in(cog, l_dom, nax); - u3z(nax); - - if ( u3_nul != pey ) { - return pey; - } - else { - u3_noun nax = u3qc_peg(axe, 7); - u3_noun pro; - - pro = _loot_in(cog, r_dom, nax); - u3z(nax); - return pro; - } - } - else { - u3_noun u_yep = u3t(yep); - u3_noun nax = u3qc_peg(axe, 2); - u3_noun pro; - - pro = u3nt(u3_nul, u3qc_peg(nax, u3h(u_yep)), u3k(u3t(u_yep))); - u3z(nax); - u3z(yep); - return pro; - } - } - } - } - } - -/* functions -*/ - u3_noun - u3qf_loot(u3_noun cog, - u3_noun dom) - { - return _loot_in(cog, dom, 1); - } - u3_noun - u3wf_loot(u3_noun cor) - { - u3_noun cog, dom; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &cog, u3x_sam_3, &dom, 0) ) { - return u3m_bail(c3__fail); - } else { - return u3qf_loot(cog, dom); - } - } diff --git a/jets/stage/f/ut.c b/jets/stage/f/ut.c deleted file mode 100644 index 9fcf3ec1a..000000000 --- a/jets/stage/f/ut.c +++ /dev/null @@ -1,100 +0,0 @@ -/* j/6/ut.c -** -*/ -#include "all.h" - - extern void - u3_pier_tank(c3_l tab_l, u3_noun tac); - - - // duck: create a duck core for mean. - // - u3_noun - u3qfu_duck(u3_noun van, - u3_noun typ) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(typ), 0); - u3_noun ret = u3j_cook("u3qfu_duck-dune", u3k(von), "dune"); - - u3z(von); - return ret; - } - - // dung: create a dunk core for mean (noun caption) - // - u3_noun - u3qfu_dung(u3_noun van, - u3_noun paz, - u3_noun typ) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(typ), 0); - u3_noun duq = u3j_cook("u3qfu_dung-dunk", u3k(von), "dunk"); - u3_noun ret = u3i_molt(u3k(duq), u3x_sam, u3k(paz), 0); - - u3z(duq); - u3z(von); - return ret; - } - - // dunq: create a dunk core for mean - // - u3_noun - u3qfu_dunq(u3_noun van, - const c3_c* paz_c, - u3_noun typ) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(typ), 0); - u3_noun duq = u3j_cook("u3qfu_dunq-dunk", u3k(von), "dunk"); - u3_noun paz = u3i_string(paz_c); - u3_noun ret = u3i_molt(u3k(duq), u3x_sam, u3k(paz), 0); - - u3z(paz); - u3z(duq); - u3z(von); - return ret; - } - - // dump: dump a type. - // - void - u3qfu_dump(u3_noun van, - const c3_c* paz_c, - u3_noun typ) - { - c3_c* pfix_c = u3r_string((c3y == u3du(typ)) ? u3h(typ) : typ); - c3_c ugh_c[1024]; - - sprintf(ugh_c, "%s: %s: 0x%8x:", - paz_c, pfix_c, u3r_mug(typ)); -#if 0 - u3_pier_tank(0, u3n_kick_on(u3qfu_dunq(van, ugh_c, typ))); -#endif - } - - // shew: create a show core for mean - // - u3_noun - u3qfu_shew(u3_noun van, - u3_noun mol) - { - u3_noun sho = u3j_cook("u3qfu_shew-show", u3k(van), "show"); - u3_noun ret = u3i_molt(u3k(sho), u3x_sam, u3k(mol), 0); - - u3z(sho); - u3z(mol); - return ret; - } - - // shep: show with caption and style - // - u3_noun - u3qfu_shep(u3_noun van, - const c3_c* paz_c, - u3_noun sty, - u3_noun mol) - { - return u3qfu_shew(van, - u3nc(u3nc('c', u3i_string(paz_c)), - u3nc(u3k(sty), mol))); - } - diff --git a/jets/stage/f/ut_buss.c b/jets/stage/f/ut_buss.c deleted file mode 100644 index 144046d8a..000000000 --- a/jets/stage/f/ut_buss.c +++ /dev/null @@ -1,93 +0,0 @@ -/* j/6/ut_buss.c -** -*/ -#include "all.h" - - -/* logic -*/ - static u3_noun - _cqfu_buss(u3_noun van, - u3_noun sut, - u3_noun cog, - u3_noun gen) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_cqfu_buss-buss", von, "buss"); - - return u3n_kick_on(u3i_molt(gat, - u3x_sam_2, - u3k(cog), - u3x_sam_3, - u3k(gen), - 0)); - } - - static u3_noun - _cqfu_busk(u3_noun van, - u3_noun sut, - u3_noun gen) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_cqfu_busk-busk", von, "busk"); - - return u3n_kick_on(u3i_molt(gat, - u3x_sam, - u3k(gen), - 0)); - } - -/* boilerplate -*/ - u3_noun - u3wfu_buss(u3_noun cor) - { - u3_noun sut, cog, gen, van; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &cog, - u3x_sam_3, &gen, - u3x_con, &van, - 0)) || - (c3n == u3ud(cog)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return _cqfu_buss(van, sut, cog, gen); - } - } - - u3_noun - u3qfu_buss(u3_noun van, - u3_noun sut, - u3_noun cog, - u3_noun gen) - { - return _cqfu_buss(van, sut, cog, gen); - } - - - u3_noun - u3wfu_busk(u3_noun cor) - { - u3_noun sut, gen, van; - - if ( (c3n == u3r_mean(cor, u3x_sam, &gen, - u3x_con, &van, - 0)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return _cqfu_busk(van, sut, gen); - } - } - - u3_noun - u3qfu_busk(u3_noun van, - u3_noun sut, - u3_noun gen) - { - return _cqfu_busk(van, sut, gen); - } - diff --git a/jets/stage/f/ut_conk.c b/jets/stage/f/ut_conk.c deleted file mode 100644 index d851143a1..000000000 --- a/jets/stage/f/ut_conk.c +++ /dev/null @@ -1,88 +0,0 @@ -/* j/6/ut_conk.c -** -*/ -#include "all.h" - - -/* logic -*/ - static u3_noun - _cqfu_conk(u3_noun van, - u3_noun sut, - u3_noun got) - { - if ( c3y == u3ud(got) ) { - u3_noun ret = u3qf_face(u3k(got), sut); - - return ret; - } - else switch ( u3h(got) ) { - default: return u3m_bail(c3__fail); - - case 0: { - return u3k(sut); - } - case 1: { - u3_noun cok = _cqfu_conk(van, sut, u3t(u3t(got))); - u3_noun nux = u3k(u3h(u3t(got))); - u3_noun ret = u3qf_face(nux, cok); - - u3z(nux); - u3z(cok); - return ret; - } - case 2: { - u3_noun vet = u3r_at(u3qfu_van_vet, van); - u3_noun hed, tal, deh, lat, ret; - - if ( c3y == vet ) { - u3_noun cel = u3nt(c3__cell, c3__noun, c3__noun); - - if ( c3n == u3qfu_nest(van, cel, c3y, sut) ) { - return u3m_bail(c3__fail); - } - u3z(cel); - } - hed = u3qfu_peek(van, sut, c3__both, 2); - tal = u3qfu_peek(van, sut, c3__both, 3); - deh = _cqfu_conk(van, hed, u3h(u3t(got))); - lat = _cqfu_conk(van, tal, u3t(u3t(got))); - - ret = u3qf_cell(deh, lat); - - u3z(lat); - u3z(deh); - u3z(tal); - u3z(hed); - - return ret; - } - } - } - -/* boilerplate -*/ - u3_noun - u3wfu_conk(u3_noun cor) - { - u3_noun sut, got, van; - - if ( (c3n == u3r_mean(cor, u3x_sam, &got, - u3x_con, &van, - 0)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return _cqfu_conk(van, sut, got); - } - } - - u3_noun - u3qfu_conk(u3_noun van, - u3_noun sut, - u3_noun got) - { - return _cqfu_conk(van, sut, got); - } - diff --git a/jets/stage/f/ut_crop.c b/jets/stage/f/ut_crop.c deleted file mode 100644 index c558737cc..000000000 --- a/jets/stage/f/ut_crop.c +++ /dev/null @@ -1,271 +0,0 @@ -/* j/6/crop.c -** -*/ -#include "all.h" - -/* logic -*/ - static u3_noun - _crop_dext(u3_noun, u3_noun, u3_noun, u3_noun); - static u3_noun - _crop_sint(u3_noun, u3_noun, u3_noun, u3_noun); - - static u3_noun - _crop_repo(u3_noun van, - u3_noun sut, - u3_noun ref, - u3_noun bix) - { - u3_noun rep = u3qfu_repo(van, sut); - u3_noun ret = _crop_dext(van, rep, ref, bix); - - if ( c3y == u3r_sing(ret, rep) ) { - if ( c3__void == rep ) { - return c3__void; - } else { - u3z(rep); - u3z(ret); - return u3k(sut); - } - } else { - u3z(rep); - return ret; - } - } - - static u3_noun - _crop_dext_fork(u3_noun van, u3_noun p_sut, u3_noun ref, u3_noun bix) - { - if ( u3_nul == p_sut ) { - return u3_nul; - } - else { - return u3nc(_crop_dext(van, u3h(p_sut), ref, bix), - _crop_dext_fork(van, u3t(p_sut), ref, bix)); - } - } - static u3_noun - _crop_sint_fork(u3_noun van, u3_noun sut, u3_noun p_ref, u3_noun bix) - { - if ( u3_nul == p_ref ) { - return u3k(sut); - } - else { - u3_noun tuz = _crop_dext(van, sut, u3h(p_ref), bix); - u3_noun zat = _crop_sint_fork(van, tuz, u3t(p_ref), bix); - - u3z(tuz); - return zat; - } - } - - static u3_noun - _crop_dext(u3_noun van, - u3_noun sut, - u3_noun ref, - u3_noun bix) - { - u3_noun p_sut, q_sut, p_ref, q_ref; - - if ( c3n == u3du(ref) ) { - switch ( ref ) { - case c3__void: return u3k(sut); - case c3__noun: return c3__void; - default: return u3m_bail(c3__fail); - } - } - if ( c3y == u3r_sing(sut, ref) ) { - return c3__void; - } - if ( c3n == u3du(sut) ) switch ( sut ) { - default: return u3m_bail(c3__fail); - - case c3__noun: return _crop_repo(van, sut, ref, bix); - case c3__void: return c3__void; - } - else switch ( u3h(sut) ) { - default: return u3m_bail(c3__fail); - - case c3__atom: u3x_cell(u3t(sut), &p_sut, &q_sut); - { - if ( c3__atom == u3h(ref) ) { - u3x_cell(u3t(ref), &p_ref, &q_ref); - - if ( c3y == u3du(q_sut) ) { - if ( c3y == u3du(q_ref) ) { - if ( c3y == u3r_sing(q_sut, q_ref) ) { - return c3__void; - } else { - return u3k(sut); - } - } else { - return c3__void; - } - } - else { - if ( c3y == u3du(q_ref) ) { - return u3k(sut); - } - else return c3__void; - } - } - else if ( c3__cell == u3h(ref) ) { - return u3k(sut); - } - else return _crop_sint(van, sut, ref, bix); - } - case c3__cell: u3x_cell(u3t(sut), &p_sut, &q_sut); - { - if ( c3__atom == u3h(ref) ) { - return u3k(sut); - } - else if ( c3__cell == u3h(ref) ) { - u3x_cell(u3t(ref), &p_ref, &q_ref); - - if ( c3y == u3qfu_nest(van, p_ref, c3n, p_sut) ) - { - u3_noun foz = _crop_dext(van, q_sut, q_ref, bix); - u3_noun ret = u3qf_cell(p_sut, foz); - - u3z(foz); - return ret; - } - else return u3k(sut); - } - else return _crop_sint(van, sut, ref, bix); - } - case c3__core: - { - if ( (c3__atom == u3h(ref)) || - (c3__cell == u3h(ref)) ) { - return u3k(sut); - } - else return _crop_sint(van, sut, ref, bix); - } - case c3__hint: u3x_cell(u3t(sut), &p_sut, &q_sut); - { - u3_noun foz = _crop_dext(van, q_sut, ref, bix); - u3_noun ret = u3qf_hint(p_sut, foz); - - u3z(foz); - return ret; - } - case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut); - { - u3_noun foz = _crop_dext(van, q_sut, ref, bix); - u3_noun ret = u3qf_face(p_sut, foz); - - u3z(foz); - return ret; - } - case c3__fork: p_sut = u3t(sut); - { - u3_noun yed = u3qdi_tap(p_sut); - u3_noun ret = u3kf_fork(_crop_dext_fork(van, yed, ref, bix)); - - u3z(yed); - return ret; - } - case c3__hold: - { - u3_noun hud = u3nc(u3k(sut), u3k(ref)); - - if ( c3y == u3qdi_has(bix, hud) ) { -# if 0 - u3_noun dun = u3qfu_dunq(van, "type", sut); - u3_noun niz = u3qfu_dunq(van, "over", ref); - - u3t_push(u3nc(c3__mean, dun)); - u3t_push(u3nc(c3__mean, niz)); -# endif - - return u3m_error("crop-loop"); - } else { - u3_noun bux = u3qdi_put(bix, hud); - u3_noun ret = _crop_repo(van, sut, ref, bux); - - u3z(hud); - u3z(bux); - return ret; - } - } - } - } - - static u3_noun - _crop_sint(u3_noun van, - u3_noun sut, - u3_noun ref, - u3_noun bix) - { - u3_noun p_ref, q_ref; - - switch ( u3h(ref) ) { - default: return u3m_bail(c3__fail); - - case c3__core: - case c3__hint: - case c3__face: u3x_cell(u3t(ref), &p_ref, &q_ref); - { - return _crop_dext(van, sut, q_ref, bix); - } - case c3__fork: p_ref = u3t(ref); - { - u3_noun yed = u3qdi_tap(p_ref); - u3_noun ret = _crop_sint_fork(van, sut, yed, bix); - - u3z(yed); - return ret; - } - case c3__hold: - { - u3_noun rep = u3qfu_repo(van, ref); - u3_noun ret = _crop_dext(van, sut, rep, bix); - - u3z(rep); - return ret; - } - } - } - - static u3_noun - _cqfu_crop(u3_noun van, - u3_noun sut, - u3_noun ref) - { - return _crop_dext(van, sut, ref, u3_nul); - } - -/* boilerplate -*/ - u3_noun - u3wfu_crop(u3_noun cor) - { - u3_noun sut, ref, van; - - if ( (c3n == u3r_mean(cor, u3x_sam, &ref, u3x_con, &van, 0)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return _cqfu_crop(van, sut, ref); - } - } - - u3_noun - u3qfu_crop(u3_noun van, - u3_noun sut, - u3_noun ref) - { - c3_m fun_m = 141 + c3__crop + ((!!u3r_at(u3qfu_van_vet, van)) << 8); - u3_noun pro = u3z_find_2(fun_m, sut, ref); - - if ( u3_none != pro ) { - return pro; - } - else { - pro = _cqfu_crop(van, sut, ref); - - return u3z_save_2(fun_m, sut, ref, pro); - } - } diff --git a/jets/stage/f/ut_find.c b/jets/stage/f/ut_find.c deleted file mode 100644 index bde859ee9..000000000 --- a/jets/stage/f/ut_find.c +++ /dev/null @@ -1,914 +0,0 @@ -/* j/6/find.c -** -*/ -#include "all.h" - - static u3_noun - _find_buck(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun p_heg, - u3_noun q_heg, - u3_noun axe, - u3_noun lon, - u3_noun gil); - -/* `u3qfu_felt_arm` is a helper function for - * u3qfu_felt. It handles the case in which the - * opal is for an arm, by creating a list of - * parent core types. These will be converted to - * a single `fork` type. -*/ - static u3_noun - u3qfu_felt_arm(u3_noun lis) - { - if ( u3_nul == lis ) { - return u3_nul; - } - else { - u3_noun i_lis, t_lis, fot, typ; - u3x_cell(lis, &i_lis, &t_lis); - u3x_cell(i_lis, &typ, &fot); - - if ( (c3n == u3du(typ)) || - (c3__core != u3h(typ)) ) { - return u3m_error("felt-core"); - } - else { - u3_noun p_typ, q_typ, pq_typ, qq_typ, rq_typ; - u3x_cell(u3t(typ), &p_typ, &q_typ); - u3x_trel(q_typ, &pq_typ, &qq_typ, &rq_typ); - - u3_noun dox = u3nt(c3__core, u3k(qq_typ), u3k(q_typ)); - return u3nc(dox, u3qfu_felt_arm(t_lis)); - } - } - } - -/* `u3qfu_felt` takes an opal, lap, and converts - * it to a type. The opal comes from the last - * limb of the wing processed by `+fond`. The - * type is used in +fond as the subject type of - * the next limb in the wing. -*/ - static u3_noun - u3qfu_felt(u3_noun lap) - { - u3_noun lim, mil; - u3x_cell(lap, &lim, &mil); - - if ( c3y == lim ) { - return u3k(mil); - } - else if ( c3n == lim ) { - u3_noun p_lap, q_lap, lis, hos; - u3x_cell(mil, &p_lap, &q_lap); - lis = u3qdi_tap(q_lap); - hos = u3qfu_felt_arm(lis); - - u3z(lis); - return u3kf_fork(hos); - } - else { - u3m_bail(c3__exit); - } - } - - static u3_noun - u3qfu_fund(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun gen) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("u3qfu_fund-fund", von, "fund"); - - return u3n_kick_on(u3i_molt(gat, - u3x_sam_2, - u3k(way), - u3x_sam_3, - u3k(gen), - 0)); - } - - static u3_noun - u3qfu_fine(u3_noun van, - u3_noun sut, - u3_noun tor) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("u3qfu_fine-fine", von, "fine"); - - return u3n_kick_on(u3i_molt(gat, - u3x_sam, - u3k(tor), - 0)); - } - - static u3_noun - _find_buck_here(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun p_heg, - u3_noun q_heg, - u3_noun axe, - u3_noun lon, - u3_noun gil) - { - if ( 0 == p_heg ) { - return u3nt - (c3y, - u3nt(u3_nul, - u3nc(u3_nul, u3k(axe)), - u3k(lon)), - u3nc(c3y, u3k(sut))); - } - else { - return u3nt - (c3n, c3y, u3qa_dec(p_heg)); - } - } - - static u3_noun - _find_buck_lose(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun p_heg, - u3_noun q_heg, - u3_noun axe, - u3_noun lon, - u3_noun gil) - { - return u3nt(c3n, c3y, u3k(p_heg)); - } - static u3_noun - _find_buck_stop(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun p_heg, - u3_noun q_heg, - u3_noun axe, - u3_noun lon, - u3_noun gil) - { - if ( u3_nul == q_heg ) { - return _find_buck_here(van, sut, way, p_heg, q_heg, axe, lon, gil); - } - else { - return _find_buck_lose(van, sut, way, p_heg, q_heg, axe, lon, gil); - } - } - - static u3_noun - _find_buck_cell(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun p_heg, - u3_noun q_heg, - u3_noun axe, - u3_noun lon, - u3_noun gil) - { - u3_noun p_sut, q_sut; - - u3x_cell(u3t(sut), &p_sut, &q_sut); - { - if ( u3_nul == q_heg ) { - return _find_buck_here(van, sut, way, p_heg, q_heg, axe, lon, gil); - } - else { - u3_noun exa = u3qc_peg(axe, 2); - u3_noun hed = _find_buck(van, p_sut, way, p_heg, q_heg, exa, lon, gil); - - u3z(exa); - if ( (u3_nul == hed) || (c3y == u3h(hed)) || (c3n == u3h(u3t(hed))) ) { - return hed; - } - else { - u3_noun exa = u3qc_peg(axe, 3); - u3_noun tal = _find_buck - (van, q_sut, way, u3t(u3t(hed)), q_heg, exa, lon, gil); - - u3z(exa); - u3z(hed); - - return tal; - } - } - } - } - - static u3_noun - _find_buck_core(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun p_heg, - u3_noun q_heg, - u3_noun axe, - u3_noun lon, - u3_noun gil) - { - u3_noun p_sut, q_sut, pq_sut, qq_sut, rq_sut, prq_sut, qrq_sut; - u3_noun ppq_sut, qpq_sut, rpq_sut; - - u3x_cell(u3t(sut), &p_sut, &q_sut); - u3x_trel(q_sut, &pq_sut, &qq_sut, &rq_sut); - u3x_trel(pq_sut, &ppq_sut, &qpq_sut, &rpq_sut); - u3x_cell(rq_sut, &prq_sut, &qrq_sut); - { - if ( u3_nul == q_heg ) { - return _find_buck_here(van, sut, way, p_heg, q_heg, axe, lon, gil); - } - else { - u3_noun zem = u3qf_loot(u3t(q_heg), qrq_sut); - - if ( (u3_nul != zem) && (0 != p_heg) ) { - u3_noun ped; - - ped = u3qa_dec(p_heg); - u3z(p_heg); p_heg = ped; - - u3z(zem); - zem = u3_nul; - } - - if ( u3_nul != zem ) { - u3_noun u_zem = u3t(zem); - u3_noun pu_zem = u3h(u_zem); - u3_noun qu_zem = u3t(u_zem); - u3_noun zut; - u3_noun pro; - -#if 1 - if ( qpq_sut == c3__wet ) { - zut = u3nc(c3__wet, u3k(qu_zem)); - } - else if ( qpq_sut == c3__dry ) { - zut = u3nc(c3__dry, u3k(qu_zem)); - } - else u3m_bail(c3__fail); -#endif - - pro = u3nt - (c3y, - u3nc(u3nc(u3_nul, u3k(axe)), u3k(lon)), - u3nt(c3n, - u3qc_peg(2, pu_zem), - u3nt(u3nc(u3k(sut), zut), u3_nul, u3_nul))); - - u3z(zem); - return pro; - } - else { - u3_noun pec = u3qfu_peel(van, sut, way, rpq_sut); - u3_noun pro; - - if ( c3n == u3h(pec) ) { - pro = _find_buck_lose(van, sut, way, p_heg, q_heg, axe, lon, gil); - } - else if ( c3y == u3t(pec) ) { - u3_noun exa = u3qc_peg(axe, 3); - - pro = _find_buck(van, p_sut, way, p_heg, q_heg, exa, lon, gil); - u3z(exa); - } - else { - u3_noun sam = u3qfu_peek(van, p_sut, way, 2); - u3_noun exa = u3qc_peg(axe, 6); - - pro = _find_buck(van, sam, way, p_heg, q_heg, exa, lon, gil); - u3z(exa); - u3z(sam); - } - u3z(pec); - return pro; - } - } - } - } - - static u3_noun - _find_twin(u3_noun van, - u3_noun hax, - u3_noun yor) - { - if ( c3y == u3r_sing(hax, yor) ) { - return u3k(hax); - } - else if ( u3_nul == hax ) { - return u3k(yor); - } - else if ( u3_nul == yor ) { - return u3k(hax); - } - else if ( c3n == u3h(hax) ) { - if ( (c3n != u3h(yor)) ) { - return u3m_error("find-fork-a"); - } - else { - u3_noun p_hax = u3t(hax); // (each @ud {span nock}) - u3_noun p_yor = u3t(yor); // (each @ud {span nock}) - - if ( (c3n != u3h(p_hax)) || (c3n != u3h(p_yor)) ) { - return u3m_error("find-fork-b"); - } - else { - u3_noun pp_hax = u3t(p_hax); // {span nock} - u3_noun pp_yor = u3t(p_yor); // {span nock} - u3_noun ppp_hax = u3h(pp_hax); // span - u3_noun ppp_yor = u3h(pp_yor); // span - u3_noun qpp_hax = u3t(pp_hax); // nock - u3_noun qpp_yor = u3t(pp_yor); // nock - - if ( c3n == u3r_sing(qpp_hax, qpp_yor) ) { - return u3m_error("find-fork-c"); - } - return u3nt(c3n, - c3n, - u3nc( - u3kf_fork(u3nt(u3k(ppp_hax), u3k(ppp_yor), u3_nul)), - u3k(qpp_hax))); - } - } - } - else { - if ( c3n == u3h(yor) ) { - return u3m_error("find-fork-d"); - } - else { - u3_noun p_hax = u3t(hax); // {vein opal} - u3_noun p_yor = u3t(yor); // {vein opal} - u3_noun pp_hax = u3h(p_hax); // vein - u3_noun pp_yor = u3h(p_yor); // vein - u3_noun qp_hax = u3t(p_hax); // opal - u3_noun qp_yor = u3t(p_yor); // opal - - if ( c3n == u3r_sing(pp_hax, pp_yor) ) { - return u3m_error("find-fork-e"); - } - else { - if ( c3y == u3h(qp_hax) ) { - if ( c3y != u3h(qp_yor) ) { - return u3m_error("find-fork-f"); - } else { - u3_noun pqp_hax = u3t(qp_hax); // type - u3_noun pqp_yor = u3t(qp_yor); // type - - return - u3nt(c3y, - u3k(pp_hax), - u3nc(c3y, u3kf_fork - (u3nt(u3k(pqp_hax), u3k(pqp_yor), u3_nul)))); - } - } - else if ( c3n != u3h(qp_yor) ) { - return u3m_error("find-fork-g"); - } else { - u3_noun pqp_hax = u3h(u3t(qp_hax)); // axis - u3_noun pqp_yor = u3h(u3t(qp_yor)); // axis - u3_noun qqp_hax = u3t(u3t(qp_hax)); // (set {type foot}) - u3_noun qqp_yor = u3t(u3t(qp_yor)); // (set {type foot}) - - if ( c3n == u3r_sing(pqp_hax, pqp_yor) ) { - return u3m_error("find-fork-h"); - } else { - return - u3nt(c3y, - u3k(pp_hax), - u3nt(c3n, u3k(pqp_hax), u3qdi_uni(qqp_hax, qqp_yor))); - } - } - } - } - } - // error: { return u3m_error("find-fork"); } - } - - static u3_noun - _find_buck_fork_twin(u3_noun van, u3_noun wiz) - { - if ( u3_nul == wiz ) { - return u3_nul; - } - else if ( u3_nul == u3t(wiz) ) { - return u3k(u3h(wiz)); - } - else { - u3_noun hax = u3k(u3h(wiz)); - u3_noun yor = _find_buck_fork_twin(van, u3t(wiz)); - u3_noun fid = _find_twin(van, hax, yor); - - u3z(hax); - u3z(yor); - - return fid; - } - } - - static u3_noun - _find_buck_fork_turn(u3_noun van, - u3_noun yed, - u3_noun way, - u3_noun p_heg, - u3_noun q_heg, - u3_noun axe, - u3_noun lon, - u3_noun gil) - { - if ( u3_nul == yed ) { - return u3_nul; - } - else { - u3_noun fid = _find_buck(van, u3h(yed), way, p_heg, q_heg, axe, lon, gil); - - return u3nc - (fid, - _find_buck_fork_turn - (van, u3t(yed), way, p_heg, q_heg, axe, lon, gil)); - } - } - - static u3_noun - _find_buck_fork(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun p_heg, - u3_noun q_heg, - u3_noun axe, - u3_noun lon, - u3_noun gil) - { - u3_noun p_sut = u3t(sut); - u3_noun yed = u3qdi_tap(p_sut); - u3_noun wiz; - u3_noun ret; - - wiz = _find_buck_fork_turn(van, yed, way, p_heg, q_heg, axe, lon, gil); - u3z(yed); - - ret = _find_buck_fork_twin(van, wiz); - u3z(wiz); - - return ret; - } - - static u3_noun - _find_buck_face_next(u3_noun van, - u3_noun sut, - u3_noun q_sut, - u3_noun qp_sut, - u3_noun way, - u3_noun p_heg, - u3_noun q_heg, - u3_noun axe, - u3_noun lon, - u3_noun gil) - { - if ( u3_nul == qp_sut ) { - u3_noun nol = u3nc(u3_nul, u3k(lon)); - u3_noun ret = _find_buck(van, q_sut, way, p_heg, q_heg, axe, nol, gil); - u3z(nol); - return ret; - } - else { - u3_noun iqp_sut = u3h(qp_sut); // twig - u3_noun tiv = u3qfu_mint // (pair type nock) - (van, q_sut, c3__noun, iqp_sut); - u3_noun tqp_sut = u3t(qp_sut); // (list twig) - u3_noun p_tiv = u3h(tiv); // type - u3_noun q_tiv = u3t(tiv); // nock - u3_noun fid = _find_buck // pony - (van, p_tiv, way, p_heg, q_heg, 1, u3_nul, u3_nul); - - if ( u3_nul == fid ) { - u3z(tiv); - return u3_nul; - } - else if ( (c3n == u3h(fid)) && (c3y == u3h(u3t(fid))) ) { - u3_noun ret; - - ret = _find_buck_face_next - (van, sut, q_sut, tqp_sut, way, u3t(u3t(fid)), q_heg, axe, lon, gil); - u3z(fid); - u3z(tiv); - return ret; - } - else { - u3_noun tor; // port - u3_noun vat; // (pair type nock) - u3_noun ret; - u3_noun dog = u3nc(0, u3k(axe)); // nock - u3_noun cob = u3qf_comb(dog, q_tiv); - - if ( c3y == u3h(fid) ) { - tor = u3nc(c3y, u3k(u3t(fid))); - } else { - tor = u3nc(c3n, u3k(u3t(u3t(fid)))); - } - u3z(fid); - - vat = u3qfu_fine(van, sut, tor); - u3z(tor); - - ret = u3nt - (c3n, - c3n, - u3nc(u3k(u3h(vat)), u3qf_comb(cob, u3t(vat)))); - - u3z(vat); - u3z(dog); - u3z(cob); - u3z(tiv); - - return ret; - } - } - } - - static u3_noun - _find_buck_face(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun p_heg, - u3_noun q_heg, - u3_noun axe, - u3_noun lon, - u3_noun gil) - { - u3_noun p_sut, q_sut; - - u3x_cell(u3t(sut), &p_sut, &q_sut); - - if ( u3_nul == q_heg ) { - return _find_buck_here(van, q_sut, way, p_heg, q_heg, axe, lon, gil); - } - else { - u3_noun uq_heg = u3t(q_heg); // term - - if ( c3y == u3ud(p_sut) ) { - if ( c3y == u3r_sing(p_sut, uq_heg) ) { - return _find_buck_here(van, q_sut, way, p_heg, q_heg, axe, lon, gil); - } - else { - return _find_buck_lose(van, sut, way, p_heg, q_heg, axe, lon, gil); - } - } - else { - u3_noun pp_sut = u3h(p_sut); // (map term {wain (unit twig)}) - u3_noun qp_sut = u3t(p_sut); // (list (pair type nock)) - u3_noun tyr = u3qdb_get(pp_sut, uq_heg); // (unit (unit twig)) - - if ( u3_nul == tyr ) { - return _find_buck_face_next - (van, sut, q_sut, qp_sut, way, p_heg, q_heg, axe, lon, gil); - } - else { - u3_noun u_tyr = u3t(tyr); // (unit twig) - - if ( u3_nul == u_tyr ) { - u3_noun nol = u3nc(u3_nul, u3k(lon)); - u3_noun dep = u3qa_inc(p_heg); - u3_noun ret = _find_buck - (van, q_sut, way, dep, q_heg, axe, nol, gil); - - u3z(dep); - u3z(nol); - u3z(tyr); - return ret; - } - else { - u3_noun uu_tyr = u3t(u_tyr); - u3_noun tor = u3qfu_fund(van, sut, way, uu_tyr); - - if ( c3y == u3h(tor) ) { - u3_noun p_tor = u3t(tor); // (pair vein opal) - u3_noun pp_tor = u3h(p_tor); // vein - u3_noun qp_tor = u3t(p_tor); // opal - u3_noun nol = // vein - u3nt(u3_nul, u3nc(u3_nul, u3k(axe)), u3k(lon)); - u3_noun ret; - - ret = u3nt(c3y, u3qb_weld(pp_tor, nol), u3k(qp_tor)); - u3z(nol); - u3z(tor); - u3z(tyr); - return ret; - } - else { - u3_noun p_tor = u3t(tor); // (pair type nock) - u3_noun pp_tor = u3h(p_tor); // type - u3_noun qp_tor = u3t(p_tor); // nock - u3_noun dog = u3nc(0, u3k(axe)); // nock - u3_noun ret; - - ret = u3nt(c3n, - c3n, - u3nc(u3k(pp_tor), u3qf_comb(dog, qp_tor))); - u3z(dog); - u3z(tor); - u3z(tyr); - - return ret; - } - } - } - } - } - } - - static u3_noun - _find_buck(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun p_heg, - u3_noun q_heg, - u3_noun axe, - u3_noun lon, - u3_noun gil) - { - if ( c3n == u3du(sut) ) switch ( sut ) { - default: return u3m_bail(c3__fail); - - case c3__noun: { - // fprintf(stderr, "noun\r\n"); - return _find_buck_stop(van, sut, way, p_heg, q_heg, axe, lon, gil); - } - case c3__void: { - // fprintf(stderr, "void\r\n"); - // return _find_buck_stop(van, sut, way, p_heg, q_heg, axe, lon, gil); - return u3_nul; - } - } - else switch ( u3h(sut) ) { - default: return u3m_bail(c3__fail); - - case c3__atom: - { - // fprintf(stderr, "atom\r\n"); - return _find_buck_stop(van, sut, way, p_heg, q_heg, axe, lon, gil); - } - case c3__cell: - { - // fprintf(stderr, "cell\r\n"); - return _find_buck_cell(van, sut, way, p_heg, q_heg, axe, lon, gil); - } - case c3__core: - { - // fprintf(stderr, "core\r\n"); - return _find_buck_core(van, sut, way, p_heg, q_heg, axe, lon, gil); - } - case c3__hint: - { - u3_noun fop = u3qfu_repo(van, sut); - u3_noun pro = _find_buck(van, fop, way, p_heg, q_heg, axe, lon, gil); - u3z(fop); - return pro; - } - case c3__face: - { - // fprintf(stderr, "face\r\n"); - return _find_buck_face(van, sut, way, p_heg, q_heg, axe, lon, gil); - } - case c3__fork: - { - // fprintf(stderr, "fork\r\n"); - return _find_buck_fork(van, sut, way, p_heg, q_heg, axe, lon, gil); - } - case c3__hold: - { - // fprintf(stderr, "hold\r\n"); - if ( (c3y == u3qdi_has(gil, sut)) ) { - return u3_nul; - } - else { - u3_noun zoc = u3qdi_put(gil, sut); - u3_noun fop = u3qfu_repo(van, sut); - u3_noun pro = _find_buck(van, fop, way, p_heg, q_heg, axe, lon, zoc); - - u3z(fop); - u3z(zoc); - - return pro; - } - } - } - } - - static u3_noun - _find_limb(u3_noun van, - u3_noun sut, // type - u3_noun way, // ?(%read %rite %free %both) - u3_noun i_hyp, // limb - u3_noun p_mor) // palo - { - u3_noun pp_mor = u3h(p_mor); // vein - u3_noun qp_mor = u3t(p_mor); // opal - - { - u3_noun ref = u3qfu_felt(qp_mor); - u3_noun lon = u3k(pp_mor); - u3_noun heg = (c3y == u3du(i_hyp)) - ? u3k(i_hyp) - : u3nq(c3n, 0, u3_nul, u3k(i_hyp)); - u3_noun ret; - - if ( c3y == u3h(heg) ) { - u3_noun p_heg = u3t(heg); // axis - - if ( c3n == u3ud(p_heg) ) { - u3m_p("weird p_heg", p_heg); - return u3m_bail(c3__fail); - } - - ret = u3nt - (c3y, - u3nc(u3nc(u3_nul, u3k(p_heg)), u3k(lon)), - u3nc(c3y, u3qfu_peek(van, ref, way, p_heg))); - } - else { - u3_noun p_heg = u3h(u3t(heg)); // @ud - u3_noun q_heg = u3t(u3t(heg)); // (unit term) - - ret = _find_buck - (van, ref, way, p_heg, q_heg, 1, lon, u3_nul); - } - u3z(heg); - u3z(lon); - u3z(ref); - - return ret; - } - } - - static u3_noun - _find_pony(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun hyp) - { - if ( u3_nul == hyp ) { - return u3nt(c3y, u3_nul, u3nc(c3y, u3k(sut))); - } - else { - u3_noun i_hyp = u3h(hyp); - u3_noun t_hyp = u3t(hyp); - u3_noun mor = _find_pony(van, sut, way, t_hyp); - - if ( c3n == u3h(mor) ) { - u3_noun p_mor = u3t(mor); - - if ( c3y == u3h(p_mor) ) { - return mor; - } - else { - u3_noun pp_mor = u3t(p_mor); // {span nock} - u3_noun ppp_mor = u3h(pp_mor); // span - u3_noun qpp_mor = u3t(pp_mor); // nock - u3_noun gen = u3nt(c3__wing, u3k(i_hyp), u3_nul); - u3_noun fex = u3qfu_mint(van, ppp_mor, c3__noun, gen); - u3_noun ret = u3nt(c3n, - c3n, - u3nc(u3k(u3h(fex)), - u3qf_comb(qpp_mor, u3t(fex)))); - u3z(fex); - u3z(gen); - u3z(mor); - - return ret; - } - } - else { - u3_noun p_mor = u3t(mor); - u3_noun ret = _find_limb(van, sut, way, i_hyp, p_mor); - - u3z(mor); - return ret; - } - } - } - - static u3_noun - _cqfu_fond(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun hyp) - { - u3_noun taf; - - taf = _find_pony(van, sut, way, hyp); - - return taf; - } - - static u3_noun - _cqfu_find(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun hyp) - { - u3_noun taf = _find_pony(van, sut, way, hyp); - - if ( u3_nul == taf ) { - goto error; - } - else { - if ( c3y == u3h(taf) ) { - u3_noun fat = u3nc(c3y, u3k(u3t(taf))); - - u3z(taf); - return fat; - } - else { - if ( c3n == u3h(u3t(taf)) ) { - u3_noun fat = u3nc(c3n, u3k(u3t(u3t(u3t(taf))))); - - u3z(taf); - return fat; - } - else { - goto error; - } - } - } - error: { - u3m_p("wing", hyp); - - return u3m_error("find"); - } - } - -/* boilerplate -*/ - u3_noun - u3wfu_find(u3_noun cor) - { - u3_noun sut, way, hyp, van; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &way, - u3x_sam_3, &hyp, - u3x_con, &van, - 0)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return _cqfu_find(van, sut, way, hyp); - } - } - - u3_noun - u3qfu_find(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun hyp) - { - c3_m fun_m = 141 + c3__find + ((!!u3r_at(u3qfu_van_vet, van)) << 8); - u3_noun pro = u3z_find_3(fun_m, sut, way, hyp); - - if ( u3_none != pro ) { - return pro; - } - else { - pro = _cqfu_find(van, sut, way, hyp); - - return u3z_save_3(fun_m, sut, way, hyp, pro); - } - } - -/* boilerplate -*/ - u3_noun - u3wfu_fond(u3_noun cor) - { - u3_noun sut, way, hyp, van; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &way, - u3x_sam_3, &hyp, - u3x_con, &van, - 0)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return _cqfu_fond(van, sut, way, hyp); - } - } - - u3_noun - u3qfu_fond(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun hyp) - { - c3_m fun_m = 141 + c3__fond + ((!!u3r_at(u3qfu_van_vet, van)) << 8); - u3_noun pro = u3z_find_3(fun_m, sut, way, hyp); - - if ( u3_none != pro ) { - return pro; - } - else { - pro = _cqfu_fond(van, sut, way, hyp); - - return u3z_save_3(fun_m, sut, way, hyp, pro); - } - } diff --git a/jets/stage/f/ut_fire.c b/jets/stage/f/ut_fire.c deleted file mode 100644 index 873d4524b..000000000 --- a/jets/stage/f/ut_fire.c +++ /dev/null @@ -1,200 +0,0 @@ -/* j/6/fire.c -** -*/ -#include "all.h" - - -/* logic -*/ - static u3_noun - _fire_vet(u3_noun van) - { - // u3_noun vet = u3j_hook(u3k(van), "vet"); - u3_noun vet = u3r_at(u3qfu_van_vet, van); - - switch ( vet ) { - case c3n: - case c3y: return vet; - default: return u3m_bail(c3__fail); - } - } - - static u3_noun - _fire_mull(u3_noun van, - u3_noun sut, - u3_noun dox, - u3_noun gen) - { - u3_noun rib = u3r_at(u3qfu_van_rib, van); - u3_noun key = u3nt(u3k(sut), - u3k(dox), - u3k(gen)); - u3_noun ret; - - if ( c3n == _fire_vet(van) ) { - ret = c3y; - } - if ( c3y == u3qdi_has(rib, key) ) { - ret = c3y; - } - else { - u3_noun rob = u3qdi_put(rib, key); - u3_noun von = u3i_molt(u3k(van), - u3qfu_van_rib, - u3k(rob), - 0); - u3_noun mul = u3qfu_mull(von, sut, c3__noun, dox, gen); - - ret = c3y; - - u3z(mul); - u3z(von); - u3z(rob); - } - u3z(key); - return ret; - } - - static u3_noun - _fire_each(u3_noun van, - u3_noun vet, - u3_noun typ, - u3_noun gat) - { - u3_noun p_typ, q_typ, pq_typ, qq_typ, rq_typ; - u3_noun ppq_typ, qpq_typ, rpq_typ; - u3_noun h_gat, t_gat; - - if ( (c3n == u3du(typ)) || (c3__core != u3h(typ)) ) { - return u3m_error("fire-core"); - } else if - ( (c3n == u3r_cell(u3t(typ), &p_typ, &q_typ)) || - (c3n == u3r_trel(q_typ, &pq_typ, &qq_typ, &rq_typ)) || - (c3n == u3r_trel(pq_typ, &ppq_typ, &qpq_typ, &rpq_typ)) || - (c3n == u3r_cell(gat, &h_gat, &t_gat)) ) - { - return u3m_bail(c3__fail); - } else { - u3_noun dox = u3nt(c3__core, - u3k(qq_typ), - u3nt(u3nt(u3k(ppq_typ), u3k(qpq_typ), c3__gold), - u3k(qq_typ), - u3k(rq_typ))); - - if ( (c3__ash == u3h(gat)) || (c3__dry == u3h(gat)) ) { - if ( (c3y == vet) && - (c3n == u3qfu_nest(van, qq_typ, c3y, p_typ)) ) - { -#if 0 - u3_noun dun = u3qfu_dunq(van, "need", qq_typ); - u3_noun niz = u3qfu_dunq(van, "have", p_typ); - - u3t_push(u3nc(c3__mean, niz)); - u3t_push(u3nc(c3__mean, dun)); -#endif - return u3m_error("fire-dry"); - } - else { - return u3nc(dox, u3k(t_gat)); - } - } - else { - c3_assert(c3__wet == u3h(gat)); -#if 0 - u3_noun dun = u3qfu_dunq(van, "wild", typ); - u3_noun niz = u3qfu_dunq(van, "tame", dox); - - u3t_push(u3nc(c3__mean, dun)); - u3t_push(u3nc(c3__mean, niz)); -#endif - if ( (c3y == vet) && - (c3n == _fire_mull(van, typ, dox, t_gat)) ) - { - return u3m_error("fire-wet"); - } - else { - u3z(dox); -#if 0 - u3t_drop(); - u3t_drop(); -#endif - return u3nc(u3k(typ), u3k(t_gat)); - } - } - } - } - - static u3_noun - _fire_in(u3_noun van, - u3_noun vet, - u3_noun hag) - { - if ( u3_nul == hag ) { - return u3_nul; - } - else { - u3_noun i_hag = u3h(hag); - u3_noun t_hag = u3t(hag); - - if ( c3n == u3du(i_hag) ) { - return u3m_bail(c3__fail); - } else { - return u3nc - (_fire_each(van, vet, u3h(i_hag), u3t(i_hag)), - _fire_in(van, vet, t_hag)); - } - } - } - - static u3_noun - _cqfu_fire(u3_noun van, - u3_noun sut, - u3_noun hag) - { - u3_noun vet = u3r_at(u3qfu_van_vet, van); - - c3_assert(!"not live"); - { - if ( (c3y == u3du(hag)) && (u3_nul == u3t(hag)) ) { - u3_noun i_hag = u3h(hag); - u3_noun pi_hag = u3h(i_hag); - u3_noun qi_hag = u3t(i_hag); - - if ( (c3__wet == u3h(qi_hag)) ) { - u3_noun qqi_hag = u3t(qi_hag); - - if ( c3y == u3du(qqi_hag) && - (u3_nul == u3h(qqi_hag)) && - (1 == u3t(qqi_hag)) ) - { - return u3k(pi_hag); - } - } - } - } - return u3nc(c3__hold, _fire_in(van, vet, hag)); - } - -/* boilerplate -*/ - u3_noun - u3wfu_fire(u3_noun cor) - { - u3_noun sut, hag, van; - - if ( (c3n == u3r_mean(cor, u3x_sam, &hag, u3x_con, &van, 0)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return _cqfu_fire(van, sut, hag); - } - } - - u3_noun - u3qfu_fire(u3_noun van, - u3_noun sut, - u3_noun hag) - { - return _cqfu_fire(van, sut, hag); - } diff --git a/jets/stage/f/ut_fish.c b/jets/stage/f/ut_fish.c deleted file mode 100644 index 6454e20b5..000000000 --- a/jets/stage/f/ut_fish.c +++ /dev/null @@ -1,180 +0,0 @@ -/* j/6/fish.c -** -*/ -#include "all.h" - -/* functions -*/ - static u3_noun - _fish_in(u3_noun, u3_noun, u3_atom, u3_noun); - - static u3_noun - _fish_fork(u3_noun van, - u3_noun p_sut, - u3_atom axe, - u3_noun vit) - { - if ( u3_nul == p_sut ) { - return u3nc(1, 1); - } - else { - u3_noun hed = _fish_in(van, u3h(p_sut), axe, vit); - u3_noun tal = _fish_fork(van, u3t(p_sut), axe, vit); - u3_noun pro = u3qf_flor(hed, tal); - - u3z(hed); - u3z(tal); - - return pro; - } - } - - static u3_noun - _fish_in(u3_noun van, - u3_noun sut, - u3_atom axe, - u3_noun vit) - { - u3_noun p_sut, q_sut; - - if ( c3y == u3ud(sut) ) switch ( sut ) { - default: return u3m_bail(c3__fail); - - case c3__noun: { - return u3nc(1, 0); - } - case c3__void: { - return u3nc(1, 1); - } - } - else switch ( u3h(sut) ) { - default: return u3m_bail(c3__fail); - - case c3__atom: { - if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { - return u3m_bail(c3__fail); - } else { - if ( c3n == u3du(q_sut) ) { - u3_noun ton = u3nt(3, 0, u3k(axe)); - u3_noun pro = u3qf_flip(ton); - - u3z(ton); - return pro; - } else { - return u3nt(5, - u3nc(1, u3k(u3t(q_sut))), - u3nc(0, u3k(axe))); - } - } - } - case c3__cell: { - if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { - return u3m_bail(c3__fail); - } else { - u3_noun hut = u3nt(3, 0, u3k(axe)); - u3_noun lef = u3qc_peg(axe, 2); - u3_noun rit = u3qc_peg(axe, 3); - u3_noun hed = _fish_in(van, p_sut, lef, vit); - u3_noun tal = _fish_in(van, q_sut, rit, vit); - u3_noun hob = u3qf_flan(hed, tal); - u3_noun vug = u3qf_flan(hut, hob); - - u3z(hob); - u3z(tal); - u3z(hed); - u3z(rit); - u3z(lef); - u3z(hut); - - return vug; - } - } - case c3__core: { - return u3m_error("fish-core"); - } - case c3__hint: - case c3__face: { - if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { - return u3m_bail(c3__fail); - } else { - return _fish_in(van, q_sut, axe, vit); - } - } - case c3__fork: p_sut = u3t(sut); - { - u3_noun yed = u3qdi_tap(p_sut); - u3_noun ret = _fish_fork(van, yed, axe, vit); - - u3z(yed); - return ret; - } - case c3__hold: { - p_sut = u3t(sut); - { - if ( (c3y == u3qdi_has(vit, sut)) ) { - // u3_noun dun = u3qfu_dunq(van, "type", sut); - u3_noun niz = u3qfu_shep - (van, "axis", 'd', u3k(axe)); - - // u3t_push(u3nc(c3__mean, dun)); - u3t_push(u3nc(c3__mean, niz)); - - return u3m_error("fish-loop"); - } else { - u3_noun zoc = u3qdi_put(vit, sut); - u3_noun fop = u3qfu_repo(van, sut); - u3_noun pro = _fish_in(van, fop, axe, zoc); - - u3z(fop); - u3z(zoc); - - return pro; - } - } - } - } - } - - static u3_noun - _cqfu_fish(u3_noun van, - u3_noun sut, - u3_atom axe) - { - return _fish_in(van, sut, axe, u3_nul); - } - - -/* boilerplate -*/ - u3_noun - u3wfu_fish(u3_noun cor) - { - u3_noun sut, axe, van; - - if ( (c3n == u3r_mean(cor, u3x_sam, &axe, u3x_con, &van, 0)) || - (c3n == u3ud(axe)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return _cqfu_fish(van, sut, axe); - } - } - - u3_noun - u3qfu_fish(u3_noun van, - u3_noun sut, - u3_noun axe) - { - c3_m fun_m = 141 + c3__fish + ((!!u3r_at(u3qfu_van_vet, van)) << 8); - u3_noun pro = u3z_find_2(fun_m, sut, axe); - - if ( u3_none != pro ) { - return pro; - } - else { - pro = _cqfu_fish(van, sut, axe); - - return u3z_save_2(fun_m, sut, axe, pro); - } - } diff --git a/jets/stage/f/ut_fuse.c b/jets/stage/f/ut_fuse.c deleted file mode 100644 index 069d0ba14..000000000 --- a/jets/stage/f/ut_fuse.c +++ /dev/null @@ -1,215 +0,0 @@ -/* j/6/fuse.c -** -*/ -#include "all.h" - -/* logic -*/ - static u3_noun - _fuse_in(u3_noun, u3_noun, u3_noun, u3_noun); - - static u3_noun - _fuse_repo(u3_noun van, - u3_noun sut, - u3_noun ref, - u3_noun bix) - { - u3_noun rep = u3qfu_repo(van, sut); - u3_noun ret = _fuse_in(van, rep, ref, bix); - - if ( c3y == u3r_sing(ret, rep) ) { - if ( c3__void == rep ) { - return c3__void; - } else { - u3z(rep); - u3z(ret); - return u3k(sut); - } - } else { - u3z(rep); - return ret; - } - } - - static u3_noun - _fuse_in_fork(u3_noun van, u3_noun p_sut, u3_noun ref, u3_noun bix) - { - if ( u3_nul == p_sut ) { - return u3_nul; - } - else { - return u3nc(_fuse_in(van, u3h(p_sut), ref, bix), - _fuse_in_fork(van, u3t(p_sut), ref, bix)); - } - } - - static u3_noun - _fuse_in(u3_noun van, - u3_noun sut, - u3_noun ref, - u3_noun bix) - { - u3_noun p_sut, q_sut; - - if ( c3y == u3r_sing(sut, ref) || (c3__noun == ref) ) { - return u3k(sut); - } - if ( c3n == u3du(sut) ) switch ( sut ) { - default: return u3m_bail(c3__fail); - - case c3__noun: - { - return u3k(ref); - } - case c3__void: - { - return c3__void; - } - } - else switch ( u3h(sut) ) { - default: return u3m_bail(c3__fail); - - case c3__atom: u3x_cell(u3t(sut), &p_sut, &q_sut); - { - if ( c3y == u3du(ref) ) { - if ( c3__atom == u3h(ref) ) { - u3_noun p_ref, q_ref; - - u3x_cell(u3t(ref), &p_ref, &q_ref); - { - u3_noun foc = (c3y == u3qf_fitz(p_ref, p_sut)) - ? u3k(p_sut) - : u3k(p_ref); - - if ( c3y == u3du(q_sut) ) { - if ( c3y == u3du(q_ref) ) { - if ( c3y == u3r_sing(q_ref, q_sut) ) { - return u3nt(c3__atom, foc, u3k(q_sut)); - } - else { - u3z(foc); - return c3__void; - } - } - else { - return u3nt(c3__atom, foc, u3k(q_sut)); - } - } else { - return u3nt(c3__atom, foc, u3k(q_ref)); - } - } - } - else if ( c3__cell == u3h(ref) ) { - return c3__void; - } - } - return _fuse_in(van, ref, sut, bix); - } - case c3__cell: u3x_cell(u3t(sut), &p_sut, &q_sut); - { - u3_noun p_ref, q_ref; - - if ( c3y == u3r_pq(ref, c3__cell, &p_ref, &q_ref) ) { - u3_noun hed = _fuse_in(van, p_sut, p_ref, bix); - u3_noun tal = _fuse_in(van, q_sut, q_ref, bix); - u3_noun ret = u3qf_cell(hed, tal); - - u3z(hed); - u3z(tal); - return ret; - } - else return _fuse_in(van, ref, sut, bix); - } - case c3__core: - { - return _fuse_repo(van, sut, ref, bix); - } - case c3__hint: u3x_cell(u3t(sut), &p_sut, &q_sut); - { - u3_noun vot = _fuse_in(van, q_sut, ref, bix); - u3_noun ret = u3qf_hint(p_sut, vot); - - u3z(vot); - return ret; - } - case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut); - { - u3_noun vot = _fuse_in(van, q_sut, ref, bix); - u3_noun ret = u3qf_face(p_sut, vot); - - u3z(vot); - return ret; - } - case c3__fork: p_sut = u3t(sut); - { - u3_noun yed = u3qdi_tap(p_sut); - u3_noun ret = u3kf_fork(_fuse_in_fork(van, yed, ref, bix)); - - u3z(yed); - return ret; - } - case c3__hold: - { - u3_noun hud = u3nc(u3k(sut), u3k(ref)); - - if ( c3y == u3qdi_has(bix, hud) ) { - // u3_noun dun = u3qfu_dunq(van, "type", sut); - // u3_noun niz = u3qfu_dunq(van, "over", ref); - - // u3t_push(u3nc(c3__mean, dun)); - // u3t_push(u3nc(c3__mean, niz)); - - return u3m_error("fuse-loop"); - } else { - u3_noun bux = u3qdi_put(bix, hud); - u3_noun ret = _fuse_repo(van, sut, ref, bux); - - u3z(hud); - u3z(bux); - return ret; - } - } - } - } - - static u3_noun - _cqfu_fuse(u3_noun van, - u3_noun sut, - u3_noun ref) - { - return _fuse_in(van, sut, ref, u3_nul); - } - -/* boilerplate -*/ - u3_noun - u3wfu_fuse(u3_noun cor) - { - u3_noun sut, ref, van; - - if ( (c3n == u3r_mean(cor, u3x_sam, &ref, u3x_con, &van, 0)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return _cqfu_fuse(van, sut, ref); - } - } - - u3_noun - u3qfu_fuse(u3_noun van, - u3_noun sut, - u3_noun ref) - { - c3_m fun_m = 141 + c3__fuse + ((!!u3r_at(u3qfu_van_vet, van)) << 8); - u3_noun pro = u3z_find_2(fun_m, sut, ref); - - if ( u3_none != pro ) { - return pro; - } - else { - pro = _cqfu_fuse(van, sut, ref); - - return u3z_save_2(fun_m, sut, ref, pro); - } - } diff --git a/jets/stage/f/ut_gain.c b/jets/stage/f/ut_gain.c deleted file mode 100644 index 509740ab1..000000000 --- a/jets/stage/f/ut_gain.c +++ /dev/null @@ -1,16 +0,0 @@ -/* j/6/gain.c -** -*/ -#include "all.h" - - - u3_noun - u3qfu_gain(u3_noun van, - u3_noun sut, - u3_noun gen) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("u3qfu_gain-gain", von, "gain"); - - return u3n_kick_on(u3i_molt(gat, u3x_sam, u3k(gen), 0)); - } diff --git a/jets/stage/f/ut_lose.c b/jets/stage/f/ut_lose.c deleted file mode 100644 index 16e9f6c0f..000000000 --- a/jets/stage/f/ut_lose.c +++ /dev/null @@ -1,16 +0,0 @@ -/* j/6/lose.c -** -*/ -#include "all.h" - - - u3_noun - u3qfu_lose(u3_noun van, - u3_noun sut, - u3_noun gen) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("u3qfu_lose-lose", von, "lose"); - - return u3n_kick_on(u3i_molt(gat, u3x_sam, u3k(gen), 0)); - } diff --git a/jets/stage/f/ut_mint.c b/jets/stage/f/ut_mint.c deleted file mode 100644 index 54ff5c466..000000000 --- a/jets/stage/f/ut_mint.c +++ /dev/null @@ -1,904 +0,0 @@ -/* j/6/mint.c -** -*/ -#include "all.h" - -/* logic -*/ - static u3_noun - _mint_in(u3_noun, u3_noun, u3_noun, u3_noun); - - static u3_noun - _mint_bean() - { - return u3kf_fork(u3nt(u3nq(c3__atom, 'f', u3_nul, 0), - u3nq(c3__atom, 'f', u3_nul, 1), - u3_nul)); - } - - static u3_noun - _mint_tend(u3_noun vit) - { - if ( u3_nul == vit ) { - return 1; - } else { - u3_noun nex = _mint_tend(u3t(vit)); - - if ( u3_nul == u3h(vit) ) { - return nex; - } else { - u3_noun boy = u3qc_peg(u3t(u3h(vit)), nex); - - u3z(nex); - return boy; - } - } - } - - static u3_noun - _mint_vet(u3_noun van) - { - // u3_noun vet = u3j_hook(u3k(van), "vet"); - u3_noun vet = u3r_at(u3qfu_van_vet, van); - - switch ( vet ) { - case c3n: - case c3y: return vet; - default: return u3m_bail(c3__fail); - } - } - - static u3_noun - _mint_feel(u3_noun van, - u3_noun sut, - u3_noun rot) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_hook(von, "feel"); - - return u3n_kick_on(u3i_molt(gat, - u3x_sam, - u3k(rot), - 0)); - } - - static u3_noun - _mint_mine(u3_noun van, - u3_noun sut, - u3_noun mel, - u3_noun nym, - u3_noun hud, - u3_noun dom) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_hook(von, "mine"); - - return u3n_kick_on(u3i_molt(gat, - u3x_sam_2, - u3k(mel), - u3x_sam_6, - u3k(nym), - u3x_sam_14, - u3k(hud), - u3x_sam_15, - u3k(dom), - 0)); - } - - static u3_noun - _mint_burp(u3_noun van, - u3_noun sut) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - - return u3j_hook(von, "burp"); - } - - static u3_noun - _mint_cond(u3_noun pex, - u3_noun yom, - u3_noun woq) - { - if ( 1 == u3h(pex) ) { - if ( 0 == u3t(pex) ) { - u3z(pex); - u3z(woq); - - return yom; - } - else if ( 1 == u3t(pex) ) { - u3z(pex); - u3z(yom); - - return woq; - } - } - return u3nq(6, pex, yom, woq); - } - - static u3_noun - _mint_corn(u3_noun van, - u3_noun sut, - u3_noun gen) - { - u3_noun mil = _mint_in(van, sut, c3__noun, gen); - u3_noun fol = u3k(u3t(mil)); - - u3z(mil); - return fol; - } - - static u3_noun - _mint_nice(u3_noun van, - u3_noun gol, - u3_noun typ) - { - if ( (c3y == _mint_vet(van)) && - (c3n == u3qfu_nest(van, gol, c3y, typ)) ) - { - // u3_noun dun = u3qfu_dunq(van, "need", gol); - // u3_noun niz = u3qfu_dunq(van, "have", typ); - - // u3t_push(u3nc(c3__mean, dun)); - // u3t_push(u3nc(c3__mean, niz)); - - return u3m_error("mint-nice"); - } - else return typ; - } - - static u3_noun - _mint_cove(u3_noun nug) - { - if ( 0 == u3h(nug) ) { - return u3k(u3t(nug)); - } - else if ( 11 == u3h(nug) ) { - return _mint_cove(u3t(u3t(nug))); - } - else { - return u3m_error("mint-cove"); - } - } - - static u3_noun - _mint_grow(u3_noun van, - u3_noun sut, - u3_noun gol, - u3_atom mel, - u3_noun nym, - u3_noun hud, - u3_noun ruf, - u3_noun dom) - { - u3_noun dan = _mint_in(van, sut, c3__noun, ruf); - u3_noun p_dan = u3h(dan); - u3_noun q_dan = u3t(dan); - u3_noun pul = _mint_mine(van, p_dan, mel, nym, hud, dom); - u3_noun ret = u3nc(_mint_nice(van, gol, u3k(u3h(pul))), - u3qf_cons(u3t(pul), q_dan)); - - u3z(pul); - u3z(dan); - return ret; - } - - static u3_noun - _mint_loc(u3_noun van, - u3_noun loc) - { - u3_noun mol = u3nc('o', u3k(loc)); - u3_noun sho = u3j_cook("_mint_loc-show", u3k(van), "show"); - u3_noun ret = u3i_molt(u3k(sho), u3x_sam, u3k(mol), 0); - - u3z(mol); - u3z(sho); - - return ret; - } - -#if 1 - static u3_noun - _mint_cnts(u3_noun van, - u3_noun sut, - u3_noun gol, - u3_noun hyp, - u3_noun rig) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_mint_cnts-emin", von, "emin"); - - return u3n_kick_on(u3i_molt(gat, - u3x_sam_2, - u3k(gol), - u3x_sam_6, - u3k(hyp), - u3x_sam_7, - u3k(rig), - 0)); - } -#else - static u3_noun - _mint_edit(u3_noun van, - u3_noun sut, - u3_noun mew, - u3_noun p_lar, - u3_noun rag, - u3_noun hej) - { - while ( 1 ) { - if ( c3n == u3du(mew) ) { - u3_noun gim = u3qfu_fire(van, sut, rag); - u3_noun fol = u3qf_hike(p_lar, hej); - - u3z(rag); - u3z(hej); - - return u3nc(gim, fol); - } else { - u3_noun i_mew = u3h(mew); - u3_noun t_mew = u3t(mew); - u3_noun pi_mew = u3h(i_mew); - u3_noun qi_mew = u3t(i_mew); - u3_noun zil = u3qfu_mint(van, sut, c3__noun, qi_mew); - u3_noun p_zil = u3h(zil); - u3_noun q_zil = u3t(zil); - u3_noun wip = u3qfu_toss(van, sut, pi_mew, p_zil, rag); - - u3z(rag); - rag = u3k(u3t(wip)); - - hej = u3nc(u3nc(u3k(u3h(wip)), - u3k(q_zil)), - hej); - - u3z(zil); - u3z(wip); - - mew = t_mew; - } - } - } - static u3_noun - _mint_cnts_old(u3_noun van, - u3_noun sut, - u3_noun gol, - u3_noun hyp, - u3_noun rig) - { - u3_noun lar = u3qfu_seek(van, sut, c3__read, hyp); - u3_noun p_lar = u3h(lar); - u3_noun q_lar = u3t(lar); - u3_noun pq_lar = u3h(q_lar); - u3_noun qq_lar = u3t(q_lar); - u3_noun mew = rig; - u3_noun yom = _mint_edit(van, sut, mew, p_lar, u3k(qq_lar), u3_nul); - u3_noun p_yom = u3h(yom); - u3_noun q_yom = u3t(yom); - u3_noun ret = u3nc(_mint_nice(van, gol, u3k(p_yom)), - (0 == pq_lar) ? u3k(q_yom) - : u3nt(9, u3k(pq_lar), u3k(q_yom))); - - u3z(yom); - u3z(lar); - - return ret; - } -#endif - -# define _mint_used() - - static u3_noun - _mint_in(u3_noun van, - u3_noun sut, - u3_noun gol, - u3_noun gen) - { - u3_noun p_gen, q_gen, r_gen; - u3_noun ret; - - if ( (c3__void == sut) && - !((c3y == u3du(gen)) && (c3__dbug == u3h(gen))) ) - { - if ( (c3n == _mint_vet(van)) - || ((c3y == u3du(gen)) && - ((c3__zpfs == u3h(gen)) || - (c3__zpsk == u3h(gen)) || - (c3__lost == u3h(gen)) || - (c3__fail == u3h(gen)) || - (c3__zpzp == u3h(gen)))) ) - { - return u3nt(c3__void, 0, 0); - } - else { - return u3m_error("mint-vain"); - } - } - - if ( c3n == u3du(gen) ) { - u3_noun ter = u3r_at(u3x_con_3, van); - u3_noun fab = u3r_at(u3qfu_van_fab, van); - u3_noun rex = u3qfp_open(ter, fab, gen); - - ret = _mint_in(van, sut, gol, rex); - u3z(rex); - - return ret; - } - else if ( c3y == u3du(u3h(gen)) ) { - _mint_used(); - { - u3_noun hed = _mint_in(van, sut, c3__noun, u3h(gen)); - u3_noun tal = _mint_in(van, sut, c3__noun, u3t(gen)); - u3_noun typ = u3qf_cell(u3h(hed), u3h(tal)); - - ret = u3nc(_mint_nice(van, gol, typ), - u3qf_cons(u3t(hed), - u3t(tal))); - - u3z(hed); - u3z(tal); - - return ret; - } - } else switch ( u3h(gen) ) { - default: { - u3_noun ter = u3r_at(u3x_con_3, van); - u3_noun fab = u3r_at(u3qfu_van_fab, van); - u3_noun rex = u3qfp_open(ter, fab, gen); - - if ( c3y == u3r_sing(rex, gen) ) { -#if 1 - u3_noun zix = u3qfu_shep(van, "gene", 'q', u3k(gen)); - - u3t_push(u3nc(c3__mean, zix)); - return u3m_error("mint-open"); -#else - u3_err("h", u3h(gen)); - return u3m_bail(c3__fail); -#endif - } - ret = _mint_in(van, sut, gol, rex); - u3z(rex); - - return ret; - } - - case c3__fits: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun wam = u3qfu_play(van, sut, p_gen); - u3_noun dok = u3nc(c3__wing, u3k(q_gen)); - u3_noun vol = _mint_corn(van, sut, dok); - u3_noun axe = _mint_cove(vol); - - ret = u3nc(_mint_nice(van, gol, _mint_bean()), - u3qfu_fish(van, wam, axe)); - - u3z(axe); - u3z(vol); - u3z(wam); - u3z(dok); - - return ret; - } - - case c3__wtcl: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); - _mint_used(); - { - u3_noun bol = _mint_bean(); - u3_noun nor = _mint_in(van, sut, bol, p_gen); - u3_noun fex = u3qfu_gain(van, sut, p_gen); - u3_noun wux = u3qfu_lose(van, sut, p_gen); - u3_noun duy = (c3__void == fex) - ? ( (c3__void == wux) - ? u3nc(0, 0) - : u3nc(1, 1) ) - : ( (c3__void == wux) - ? u3nc(1, 0) - : u3k(u3t(nor)) ); - u3_noun hiq = _mint_in(van, fex, gol, q_gen); - u3_noun ran = _mint_in(van, wux, gol, r_gen); - - ret = u3nc(u3qf_forq(u3h(hiq), - u3h(ran)), - _mint_cond(duy, - u3k(u3t(hiq)), - u3k(u3t(ran)))); - - u3z(ran); - u3z(hiq); - u3z(nor); - u3z(wux); - u3z(fex); - u3z(bol); - - return ret; - } - - case c3__clhp: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun hed = _mint_in(van, sut, c3__noun, p_gen); - u3_noun tal = _mint_in(van, sut, c3__noun, q_gen); - u3_noun typ = u3qf_cell(u3h(hed), u3h(tal)); - - ret = u3nc(_mint_nice(van, gol, typ), - u3qf_cons(u3t(hed), - u3t(tal))); - - u3z(hed); - u3z(tal); - - return ret; - } - - case c3__dtts: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun typ = _mint_nice(van, gol, _mint_bean()); - u3_noun one = _mint_in(van, sut, c3__noun, p_gen); - u3_noun two = _mint_in(van, sut, c3__noun, q_gen); - u3_noun ret; - - if ( (c3y == _mint_vet(van)) && - (c3n == u3qfu_nest(van, u3h(one), c3n, u3h(two))) && - (c3n == u3qfu_nest(van, u3h(two), c3y, u3h(one))) ) - { - return u3m_error("nest"); - } - ret = u3nc(typ, u3nt(5, u3k(u3t(one)), u3k(u3t(two)))); - u3z(one); - u3z(two); - - return ret; - } - - case c3__dtwt: p_gen = u3t(gen); - _mint_used(); - { - u3_noun typ = _mint_nice(van, gol, _mint_bean()); - - return u3nc(typ, - u3nc(3, _mint_corn(van, sut, p_gen))); - } - - case c3__dtkt: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun nog = u3nc(c3__kttr, u3k(p_gen)); - u3_noun nef = _mint_in(van, sut, gol, nog); - u3_noun viz = _mint_in(van, sut, c3__noun, q_gen); - - ret = u3nc(u3k(u3h(nef)), - u3nt(12, u3nc(1, u3nc(151, u3k(u3h(nef)))), u3k(u3t(viz)))); - - u3z(viz); - u3z(nef); - u3z(nog); - return ret; - } - - case c3__dtls: p_gen = u3t(gen); - _mint_used(); - { - u3_noun tom = u3nt(c3__atom, u3_blip, u3_nul); - u3_noun sam = _mint_in(van, sut, tom, p_gen); - - ret = u3nc(_mint_nice(van, gol, tom), - u3nc(4, u3k(u3t(sam)))); - - u3z(sam); - return ret; - } - - case c3__rock: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun typ = u3qfu_play(van, sut, gen); - u3_noun ret = u3nc(_mint_nice(van, gol, typ), - u3nc(1, u3k(q_gen))); - - return ret; - } - - case c3__dttr: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun one = _mint_corn(van, sut, p_gen); - u3_noun two = _mint_corn(van, sut, q_gen); - - return u3nc(_mint_nice(van, gol, c3__noun), - u3nt(2, one, two)); - } - - case c3__sand: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun typ = u3qfu_play(van, sut, gen); - u3_noun ret = u3nc(_mint_nice(van, gol, typ), - u3nc(1, u3k(q_gen))); - - return ret; - } - - case c3__hand: - _mint_used(); - { - return u3k(u3t(gen)); - } - - case c3__ktbr: p_gen = u3t(gen); - _mint_used(); - { - u3_noun ryd = _mint_in(van, sut, gol, p_gen); - u3_noun tyf = u3qfu_wrap(van, u3h(ryd), c3__iron); - u3_noun tyn = _mint_nice(van, gol, tyf); - u3_noun pro = u3nc(tyn, u3k(u3t(ryd))); - - u3z(ryd); - return pro; - } - - case c3__ktpd: - case c3__ktpm: p_gen = u3t(gen); - _mint_used(); - { - u3_noun ryd = _mint_in(van, sut, gol, p_gen); - u3_noun tyf = u3qfu_wrap(van, u3h(ryd), c3__zinc); - u3_noun tyn = _mint_nice(van, gol, tyf); - u3_noun pro = u3nc(tyn, u3k(u3t(ryd))); - - u3z(ryd); - return pro; - } - - case c3__ktwt: p_gen = u3t(gen); - _mint_used(); - { - u3_noun ryd = _mint_in(van, sut, gol, p_gen); - u3_noun tyf = u3qfu_wrap(van, u3h(ryd), c3__lead); - u3_noun tyn = _mint_nice(van, gol, tyf); - u3_noun pro = u3nc(tyn, u3k(u3t(ryd))); - - u3z(ryd); - return pro; - } - - case c3__note: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun hit = u3nc(u3k(sut), u3k(p_gen)); - u3_noun hum = _mint_in(van, sut, gol, q_gen); - - u3_noun ret = u3nc(u3qf_hint(hit, u3h(hum)), - u3k(u3t(hum))); - u3z(hum); - u3z(hit); - return ret; - } - - case c3__tune: p_gen = u3t(gen); - _mint_used(); - { - return u3nc(u3qf_face(p_gen, sut), u3nc(0, 1)); - } - - case c3__ktls: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun huz = u3qfu_play(van, sut, p_gen); - u3_noun hif = _mint_nice(van, gol, huz); - u3_noun zel = _mint_in(van, sut, hif, q_gen); - u3_noun ret = u3nc(hif, u3k(u3t(zel))); - - u3z(zel); - return ret; - } - - case c3__tsbn: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun fid = _mint_in(van, sut, c3__noun, p_gen); - u3_noun p_fid = u3h(fid); - u3_noun q_fid = u3t(fid); - - if ( 0 == p_fid ) { - u3m_p("bad subject: p_gen", p_gen); - c3_assert(0); - } - u3_noun dov = _mint_in(van, p_fid, gol, q_gen); - u3_noun p_dov = u3h(dov); - u3_noun q_dov = u3t(dov); - - ret = u3nc(u3k(p_dov), - u3qf_comb(q_fid, q_dov)); - - u3z(fid); - u3z(dov); - return ret; - } - - case c3__tscm: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun boc = u3qfu_busk(van, sut, p_gen); - u3_noun ret = _mint_in(van, boc, gol, q_gen); - - u3z(boc); - return ret; - } - - case c3__cnts: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - return _mint_cnts(van, sut, gol, p_gen, q_gen); - } - - case c3__brcn: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun ruf = u3nc(u3_nul, 1); - - ret = _mint_grow(van, sut, gol, c3__gold, p_gen, c3__dry, ruf, q_gen); - u3z(ruf); - - return ret; - } - - case c3__brvt: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun ruf = u3nc(u3_nul, 1); - - ret = _mint_grow(van, sut, gol, c3__gold, p_gen, c3__wet, ruf, q_gen); - u3z(ruf); - - return ret; - } - - case c3__sgzp: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun typ = u3qfu_play(van, sut, p_gen); - u3_noun dug = u3qfu_duck(van, typ); - - u3t_push(u3nc(c3__mean, dug)); - { - ret = _mint_in(van, sut, gol, q_gen); - } - u3t_drop(); - - u3z(typ); - return ret; - } - - case c3__sgbn: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun hum = _mint_in(van, sut, gol, q_gen); - u3_noun bez; - - if ( c3y == u3ud(p_gen) ) { - bez = u3k(p_gen); - } else { - bez = u3nc(u3k(u3h(p_gen)), - _mint_corn(van, sut, u3t(p_gen))); - } - ret = u3nc(u3k(u3h(hum)), - u3nt(11, bez, u3k(u3t(hum)))); - - u3z(hum); - return ret; - } - - case c3__zpts: p_gen = u3t(gen); - _mint_used(); - { - u3_noun von = u3i_molt(u3k(van), u3qfu_van_vet, c3n, 0); - u3_noun sev = _mint_corn(von, sut, p_gen); - - u3z(von); - return u3nc(c3__noun, u3nc(1, sev)); - } - - case c3__ktcn: p_gen = u3t(gen); - _mint_used(); - { - u3_noun von = u3i_molt(u3k(van), u3qfu_van_fab, c3n, 0); - u3_noun ret = _mint_in(von, sut, gol, p_gen); - - u3z(von); - return ret; - } - - case c3__wthx: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun hyp = u3nc(u3nc(c3y, 1), u3k(q_gen)); - u3_noun fid = u3qfu_find(van, sut, c3__free, hyp); - - if ( c3y != u3h(fid) ) { - return u3m_error("mint-fragment"); - } - else { - u3_noun pp_fid = u3h(u3t(fid)); - u3_noun qp_fid = u3t(u3t(fid)); - - if ( c3y != u3h(qp_fid) ) { - return u3m_error("mint-fragment"); - } - else { - u3_noun pqp_fid = u3t(qp_fid); - u3_noun axe = _mint_tend(pp_fid); - u3_noun ret; - - ret = u3nc(_mint_nice(van, gol, _mint_bean()), - u3qfr_fish(van, pqp_fid, p_gen, axe)); - - u3z(axe); - u3z(fid); - u3z(hyp); - - return ret; - } - } - } - - case c3__cold: - case c3__ktsg: p_gen = u3t(gen); - _mint_used(); - { - - c3_m fun_m = 141 + c3__blow; - u3_noun vrf = u3r_at(u3qfu_van_vrf, van); - u3_noun pro = u3z_find_4(fun_m, vrf, sut, gol, p_gen); - - if ( u3_none != pro ) { - return pro; - } - else { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_mint_in-blow", von, "blow"); - u3_noun pro; - - pro = u3n_kick_on(u3i_molt(gat, - u3x_sam_2, - u3k(gol), - u3x_sam_3, - u3k(p_gen), - 0)); - - return u3z_save_4(fun_m, vrf, sut, gol, p_gen, pro); - } - } - - case c3__zpcm: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - return u3nc(_mint_nice(van, - gol, - u3qfu_play(van, sut, p_gen)), - u3nc(1, u3k(q_gen))); - } - - case c3__dbug: u3x_cell(u3t(gen), &p_gen, &q_gen); - { - u3t_push(u3nc(c3__mean, _mint_loc(van, p_gen))); - { - u3_noun hum = _mint_in(van, sut, gol, q_gen); - u3_noun bez = u3nt(c3__spot, 1, u3k(p_gen)); - - ret = u3nc(u3k(u3h(hum)), u3nt(11, bez, u3k(u3t(hum)))); - u3z(hum); - } - u3t_drop(); - return ret; - } - - case c3__zpmc: - case c3__zpsm: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun vos = _mint_in(van, sut, c3__noun, q_gen); - u3_noun zur = u3qfu_play(van, sut, p_gen); - u3_noun p_vos = u3h(vos); - u3_noun q_vos = u3t(vos); - u3_noun waz = u3nc(1, _mint_burp(van, p_vos)); - // u3_noun waz = u3nc(1, u3k(p_vos)); - u3_noun sif = u3k(zur); - u3_noun cig = u3qf_cell(sif, p_vos); - u3_noun ret; - - ret = u3nc(_mint_nice(van, gol, cig), - u3qf_cons(waz, q_vos)); - - u3z(waz); - u3z(zur); - u3z(sif); - u3z(vos); - - return ret; - } - - case c3__zpvt: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); - _mint_used(); - { - if ( c3y == _mint_feel(van, sut, p_gen) ) { - return _mint_in(van, sut, gol, q_gen); - } else { - return _mint_in(van, sut, gol, r_gen); - } - } - - case c3__lost: p_gen = u3t(gen); - _mint_used(); - { - if ( c3y == _mint_vet(van) ) { - u3_noun zur = u3qfu_play(van, sut, p_gen); - u3_noun dun = u3qfu_dunq(van, "lost", zur); - - u3t_push(u3nc(c3__mean, dun)); - return u3m_error("mint-lost"); - } - else { - return u3nt(c3__void, 0, 0); - } - } - - case c3__fail: - case c3__zpzp: - _mint_used(); - { - return u3nt(c3__void, 0, 0); - } - } - } - - static u3_noun - _cqfu_mint(u3_noun van, - u3_noun sut, - u3_noun gol, - u3_noun gen) - { - return _mint_in(van, sut, gol, gen); - } - -/* boilerplate -*/ - u3_noun - u3wfu_mint(u3_noun cor) - { - u3_noun sut, gol, gen, van; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &gol, - u3x_sam_3, &gen, - u3x_con, &van, - 0)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return _cqfu_mint(van, sut, gol, gen); - } - } - - u3_noun - u3qfu_mint(u3_noun van, - u3_noun sut, - u3_noun gol, - u3_noun gen) - { - c3_m fun_m = 141 + c3__mint; - u3_noun vrf = u3r_at(u3qfu_van_vrf, van); - u3_noun pro = u3z_find_4(fun_m, vrf, sut, gol, gen); - - if ( u3_none != pro ) { - return pro; - } - else { - pro = _cqfu_mint(van, sut, gol, gen); - - return u3z_save_4(fun_m, vrf, sut, gol, gen, pro); - } - } diff --git a/jets/stage/f/ut_mull.c b/jets/stage/f/ut_mull.c deleted file mode 100644 index 760ebbf1f..000000000 --- a/jets/stage/f/ut_mull.c +++ /dev/null @@ -1,852 +0,0 @@ -/* j/6/mull.c -** -*/ -#include "all.h" - -/* functions -*/ - static u3_noun - _mull_in(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); - - static u3_noun - _mull_bean() - { - return u3kf_fork(u3nt(u3nq(c3__atom, 'f', u3_nul, 0), - u3nq(c3__atom, 'f', u3_nul, 1), - u3_nul)); - } - - static u3_noun - _mull_loc(u3_noun van, - u3_noun loc) - { - u3_noun mol = u3nc('o', u3k(loc)); - u3_noun sho = u3j_cook("_mull_loc-show", u3k(van), "show"); - u3_noun ret = u3i_molt(u3k(sho), u3x_sam, u3k(mol), 0); - - u3z(mol); - u3z(sho); - - return ret; - } - - static u3_noun - _mull_feel(u3_noun van, - u3_noun sut, - u3_noun rot) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_hook(von, "feel"); - - return u3n_kick_on(u3i_molt(gat, - u3x_sam, - u3k(rot), - 0)); - } - - static u3_noun - _mull_tend(u3_noun vit) - { - if ( u3_nul == vit ) { - return 1; - } else { - u3_noun nex = _mull_tend(u3t(vit)); - - if ( u3_nul == u3h(vit) ) { - return nex; - } else { - u3_noun boy = u3qc_peg(u3t(u3h(vit)), nex); - - u3z(nex); - return boy; - } - } - } - static u3_noun - _mull_cove(u3_noun nug) - { - if ( 0 == u3h(nug) ) { - return u3k(u3t(nug)); - } - else if ( 11 == u3h(nug) ) { - return _mull_cove(u3t(u3t(nug))); - } - else { - return u3m_error("mull-cove"); - } - } - - static u3_noun - _mull_mile(u3_noun van, - u3_noun sut, - u3_noun dox, - u3_noun mel, - u3_noun nym, - u3_noun hud, - u3_noun dom) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_hook(von, "mile"); - - // fprintf(stderr, "mile\r\n"); - return u3n_kick_on(u3i_molt(gat, - u3x_sam_2, - u3k(dox), - u3x_sam_6, - u3k(mel), - u3x_sam_14, - u3k(nym), - u3x_sam_30, - u3k(hud), - u3x_sam_31, - u3k(dom), - 0)); - } - - static u3_noun - _mull_doke(u3_noun van, - u3_noun sut, - u3_noun gen) - { - u3_noun fug = u3qfu_mint(van, sut, c3__noun, gen); - u3_noun axe = _mull_cove(u3t(fug)); - - u3z(fug); - return axe; - } - - static u3_noun - _mull_nice(u3_noun van, - u3_noun gol, - u3_noun typ) - { - if ( c3n == u3qfu_nest(van, gol, c3y, typ) ) { - // u3_noun dun = u3qfu_dunq(van, "need", gol); - // u3_noun niz = u3qfu_dunq(van, "have", typ); - - // u3t_push(u3nc(c3__mean, dun)); - // u3t_push(u3nc(c3__mean, niz)); - - return u3m_error("mull-nice"); - } - else return typ; - } - - static u3_noun - _mull_grow(u3_noun van, - u3_noun sut, - u3_noun gol, - u3_noun dox, - u3_atom mel, - u3_noun nym, - u3_noun hud, - u3_noun ruf, - u3_noun dom) - { - u3_noun dan = _mull_in(van, sut, c3__noun, dox, ruf); - u3_noun p_dan = u3h(dan); - u3_noun q_dan = u3t(dan); - u3_noun yaz = _mull_mile(van, p_dan, q_dan, mel, nym, hud, dom); - u3_noun p_yaz = u3h(yaz); - u3_noun q_yaz = u3t(yaz); - u3_noun ret = u3nc(_mull_nice(van, gol, u3k(p_yaz)), u3k(q_yaz)); - - u3z(yaz); - u3z(dan); - - return ret; - } - - static u3_noun - _mull_both(u3_noun van, - u3_noun gol, - u3_noun typ) - { - return u3nc(_mull_nice(van, gol, u3k(typ)), - typ); - } - -#if 1 - static u3_noun - _mull_cnts(u3_noun van, - u3_noun sut, - u3_noun gol, - u3_noun dox, - u3_noun hyp, - u3_noun rig) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_mull_cnts-emul", von, "emul"); - - return u3n_kick_on(u3i_molt(gat, - u3x_sam_2, - u3k(gol), - u3x_sam_6, - u3k(dox), - u3x_sam_14, - u3k(hyp), - u3x_sam_15, - u3k(rig), - 0)); - } -#else - static u3_noun - _mull_edit(u3_noun van, - u3_noun sut, - u3_noun dox, - u3_noun mew, - u3_noun p_yom, - u3_noun q_yom) - { - while ( 1 ) { - if ( c3n == u3du(mew) ) { - return u3nc(p_yom, q_yom); - } else { - u3_noun i_mew = u3h(mew); - u3_noun t_mew = u3t(mew); - u3_noun pi_mew = u3h(i_mew); - u3_noun qi_mew = u3t(i_mew); - u3_noun zil = _mull_in(van, sut, c3__noun, dox, qi_mew); - u3_noun p_zil = u3h(zil); - u3_noun q_zil = u3t(zil); - u3_noun cuf = u3qfu_toss(van, sut, pi_mew, p_zil, p_yom); - u3_noun dof = u3qfu_toss(van, sut, pi_mew, q_zil, q_yom); - - if ( u3r_sing(u3h(cuf), u3h(dof)) ) { - u3m_error("mull-bonk-a"); - } - - u3z(p_yom); - p_yom = u3k(u3t(cuf)); - - u3z(q_yom); - q_yom = u3k(u3t(dof)); - - u3z(dof); - u3z(cuf); - u3z(zil); - - mew = t_mew; - } - } - } - - static u3_noun - _mull_cnts_old(u3_noun van, - u3_noun sut, - u3_noun gol, - u3_noun dox, - u3_noun hyp, - u3_noun rig) - { - u3_noun lar = u3qfu_seek(van, sut, c3__read, hyp); - u3_noun vug = u3qfu_seek(van, dox, c3__read, hyp); - u3_noun p_lar = u3h(lar); - u3_noun q_lar = u3t(lar); - u3_noun pq_lar = u3h(q_lar); - u3_noun qq_lar = u3t(q_lar); - u3_noun p_vug = u3h(vug); - u3_noun q_vug = u3t(vug); - u3_noun pq_vug = u3h(q_vug); - u3_noun qq_vug = u3t(q_vug); - - if ( c3a(u3r_sing(p_lar, p_vug), u3r_sing(pq_lar, pq_vug)) ) { - u3m_error("mull-bonk-e"); - } - { - u3_noun mew = rig; - u3_noun yom = _mull_edit - (van, sut, dox, mew, u3k(qq_lar), - u3k(qq_vug)); - u3_noun von = u3i_molt(u3k(van), u3qfu_van_vet, c3n, 0); - u3_noun p_ret = u3qfu_fire(van, sut, u3h(yom)); - u3_noun q_ret = u3qfu_fire(von, sut, u3t(yom)); - - u3z(von); - u3z(yom); - u3z(vug); - u3z(lar); - - return u3nc(_mull_nice(van, gol, p_ret), q_ret); - } - } -#endif - -# define _mull_used() - - static u3_noun - _mull_in(u3_noun van, - u3_noun sut, - u3_noun gol, - u3_noun dox, - u3_noun gen) - { - u3_noun p_gen, q_gen, r_gen; - u3_noun ret; - - if ( c3n == u3du(gen) ) { - u3_noun ter = u3r_at(u3x_con_3, van); - u3_noun fab = u3r_at(u3qfu_van_fab, van); - u3_noun rex = u3qfp_open(ter, fab, gen); - - ret = _mull_in(van, sut, gol, dox, rex); - u3z(rex); - - return ret; - } - else if ( c3y == u3du(u3h(gen)) ) { - _mull_used(); - { - u3_noun hed = _mull_in(van, sut, c3__noun, dox, u3h(gen)); - u3_noun tal = _mull_in(van, sut, c3__noun, dox, u3t(gen)); - u3_noun dis = u3qf_cell(u3h(hed), u3h(tal)); - u3_noun dat = u3qf_cell(u3t(hed), u3t(tal)); - u3_noun ret = u3nc(_mull_nice(van, gol, dis), dat); - - u3z(tal); - u3z(hed); - - return ret; - } - } - else switch ( u3h(gen) ) { - default: { - u3_noun ter = u3r_at(u3x_con_3, van); - u3_noun fab = u3r_at(u3qfu_van_fab, van); - u3_noun rex = u3qfp_open(ter, fab, gen); - - if ( c3y == u3r_sing(rex, gen) ) { -#if 1 - u3_noun zix = u3qfu_shep(van, "gene", 'q', u3k(gen)); - - u3t_push(u3nc(c3__mean, zix)); - return u3m_error("mull-open"); -#else - u3_err("h", u3h(gen)); - return u3m_bail(c3__fail); -#endif - } - ret = _mull_in(van, sut, gol, dox, rex); - u3z(rex); - - return ret; - } - - case c3__fits: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun p_waz = u3qfu_play(van, sut, p_gen); - u3_noun q_waz = u3qfu_play(van, dox, p_gen); - u3_noun dok = u3nc(c3__wing, u3k(q_gen)); - u3_noun p_syx = _mull_doke(van, sut, dok); - u3_noun q_syx = _mull_doke(van, dox, dok); - u3_noun p_pov = u3qfu_fish(van, p_waz, p_syx); - u3_noun q_pov = u3qfu_fish(van, q_waz, q_syx); - - if ( (c3n == u3r_sing(p_syx, q_syx)) || - (c3n == u3r_sing(p_pov, q_pov)) ) - { - return u3m_error("mull-bonk-b"); - } - u3z(p_waz); u3z(q_waz); - u3z(p_syx); u3z(q_syx); - u3z(p_pov); u3z(q_pov); - u3z(dok); - - return _mull_both(van, gol, _mull_bean()); - } - - case c3__wthx: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun hyp = u3nc(u3nc(c3y, 1), u3k(q_gen)); - u3_noun fid = u3qfu_find(van, sut, c3__free, hyp); - u3_noun gax = u3qfu_find(van, dox, c3__free, hyp); - u3_noun old_type, old_axis; - u3_noun new_type, new_axis; - - { - if ( c3y != u3h(fid) ) { - return u3m_error("mull-bonk-x"); - } - else { - u3_noun pp_fid = u3h(u3t(fid)); - u3_noun qp_fid = u3t(u3t(fid)); - - if ( c3y != u3h(qp_fid) ) { - return u3m_error("mull-bonk-x"); - } - new_type = u3t(qp_fid); - new_axis = _mull_tend(pp_fid); - } - } - - { - if ( c3y != u3h(gax) ) { - return u3m_error("mull-bonk-x"); - } - else { - u3_noun pp_gax = u3h(u3t(gax)); - u3_noun qp_gax = u3t(u3t(gax)); - - if ( c3y != u3h(qp_gax) ) { - return u3m_error("mull-bonk-x"); - } - old_type = u3t(qp_gax); - old_axis = _mull_tend(pp_gax); - } - } - if ( c3n == u3r_sing(old_axis, new_axis) ) { - return u3m_error("mull-bonk-x"); - } - else if ( c3n == u3qfu_nest(van, old_type, c3y, new_type) ) { - return u3m_error("mull-bonk-x"); - } - - u3z(old_axis); - u3z(new_axis); - u3z(gax); - u3z(fid); - - return _mull_both(van, gol, _mull_bean()); - } - - case c3__wtcl: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); - _mull_used(); - { - u3_noun bol = _mull_bean(); - u3_noun nor = _mull_in(van, sut, bol, dox, p_gen); - u3_noun p_fex = u3qfu_gain(van, sut, p_gen); - u3_noun q_fex = u3qfu_gain(van, dox, p_gen); - u3_noun p_wux = u3qfu_lose(van, sut, p_gen); - u3_noun q_wux = u3qfu_lose(van, dox, p_gen); - u3_noun hiq, ran; - u3_noun dis, dat; - u3_noun ret; - - if ( c3__void == p_fex ) { - hiq = u3nc(c3__void, - (c3__void == q_fex) - ? c3__void - : u3qfu_play(van, q_fex, q_gen)); - } else if ( c3__void == q_fex ) { - hiq = u3m_error("mull-bonk-c"); - } - else hiq = _mull_in(van, p_fex, gol, q_fex, q_gen); - - if ( c3__void == p_wux ) { - ran = u3nc(c3__void, - (c3__void == q_wux) - ? c3__void - : u3qfu_play(van, q_wux, r_gen)); - } else if ( c3__void == q_wux ) { - ran = u3m_error("mull-bonk-d"); - } - else ran = _mull_in(van, p_wux, gol, q_wux, r_gen); - - dis = u3qf_forq(u3h(hiq), u3h(ran)); - dat = u3qf_forq(u3t(hiq), u3t(ran)); - - ret = u3nc(_mull_nice(van, gol, dis), dat); - - u3z(ran); - u3z(hiq); - u3z(q_wux); - u3z(p_wux); - u3z(q_fex); - u3z(p_fex); - u3z(nor); - u3z(bol); - - return ret; - } - - case c3__clhp: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun hed = _mull_in(van, sut, c3__noun, dox, p_gen); - u3_noun tal = _mull_in(van, sut, c3__noun, dox, q_gen); - u3_noun dis = u3qf_cell(u3h(hed), u3h(tal)); - u3_noun dat = u3qf_cell(u3t(hed), u3t(tal)); - u3_noun ret = u3nc(_mull_nice(van, gol, dis), dat); - - u3z(tal); - u3z(hed); - - return ret; - } - - case c3__dtts: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun hed = _mull_in(van, sut, c3__noun, dox, p_gen); - u3_noun tal = _mull_in(van, sut, c3__noun, dox, q_gen); - - u3z(hed); - u3z(tal); - - return _mull_both(van, gol, _mull_bean()); - } - - case c3__dtwt: p_gen = u3t(gen); - _mull_used(); - { - u3_noun vay = _mull_in(van, sut, c3__noun, dox, p_gen); - - u3z(vay); - return _mull_both(van, gol, _mull_bean()); - } - - case c3__dtkt: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun nog = u3nc(c3__kttr, u3k(p_gen)); - u3_noun vay = _mull_in(van, sut, c3__noun, dox, q_gen); - u3_noun ret; - - u3z(vay); - ret = _mull_in(van, sut, gol, dox, nog); - u3z(nog); - return ret; - } - - case c3__dtls: p_gen = u3t(gen); - _mull_used(); - { - u3_noun wuq = u3nt(c3__atom, u3_blip, u3_nul); - u3_noun vay = _mull_in(van, sut, wuq, dox, p_gen); - - u3z(vay); - return _mull_both(van, gol, wuq); - } - - case c3__rock: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun typ = u3qfu_play(van, sut, gen); - - return _mull_both(van, gol, typ); - } - - case c3__dttr: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun hed = _mull_in(van, sut, c3__noun, dox, p_gen); - u3_noun tal = _mull_in(van, sut, c3__noun, dox, q_gen); - - u3z(hed); - u3z(tal); - - return _mull_both(van, gol, c3__noun); - } - - case c3__sand: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun typ = u3qfu_play(van, sut, gen); - return _mull_both(van, gol, typ); - } - - case c3__hand: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - return u3nc(u3k(p_gen), u3k(p_gen)); - } - - case c3__ktbr: p_gen = u3t(gen); - _mull_used(); - { - u3_noun vat = _mull_in(van, sut, gol, dox, p_gen); - u3_noun pro = u3nc(u3qfu_wrap(van, - u3h(vat), - c3__iron), - u3qfu_wrap(van, - u3t(vat), - c3__iron)); - - u3z(vat); - return pro; - } - - case c3__ktpd: - case c3__ktpm: p_gen = u3t(gen); - _mull_used(); - { - u3_noun vat = _mull_in(van, sut, gol, dox, p_gen); - u3_noun pro = u3nc(u3qfu_wrap(van, - u3h(vat), - c3__zinc), - u3qfu_wrap(van, - u3t(vat), - c3__zinc)); - - u3z(vat); - return pro; - } - - case c3__ktwt: p_gen = u3t(gen); - _mull_used(); - { - u3_noun vat = _mull_in(van, sut, gol, dox, p_gen); - u3_noun pro = u3nc(u3qfu_wrap(van, - u3h(vat), - c3__lead), - u3qfu_wrap(van, - u3t(vat), - c3__lead)); - - u3z(vat); - return pro; - } - - case c3__note: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun vat = _mull_in(van, sut, gol, dox, q_gen); - u3_noun hit = u3nc(u3k(sut), u3k(p_gen)); - u3_noun hix = u3nc(u3k(dox), u3k(p_gen)); - u3_noun ret = u3nc(u3qf_hint(hit, u3h(vat)), - u3qf_hint(hix, u3t(vat))); - - u3z(hix); - u3z(hit); - u3z(vat); - return ret; - } - - case c3__tune: p_gen = u3t(gen); - _mull_used(); - { - return u3nc(u3qf_face(p_gen, sut), - u3qf_face(p_gen, dox)); - } - - case c3__ktsg: p_gen = u3t(gen); - _mull_used(); - { - return _mull_in(van, sut, gol, dox, p_gen); - } - - case c3__ktls: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun p_hif = _mull_nice(van, gol, u3qfu_play(van, sut, p_gen)); - u3_noun q_hif = u3qfu_play(van, dox, p_gen); - u3_noun zel = _mull_in(van, sut, p_hif, dox, q_gen); - u3_noun ret = u3nc(p_hif, q_hif); - - u3z(zel); - return ret; - } - - case c3__tsbn: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun lem = _mull_in(van, sut, c3__noun, dox, p_gen); - u3_noun p_lem = u3h(lem); - u3_noun q_lem = u3t(lem); - u3_noun ret = _mull_in(van, p_lem, gol, q_lem, q_gen); - - u3z(lem); - return ret; - } - - case c3__tscm: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun boc = u3qfu_busk(van, sut, p_gen); - u3_noun nuf = u3qfu_busk(van, dox, p_gen); - u3_noun ret = _mull_in(van, boc, gol, nuf, q_gen); - - u3z(boc); - u3z(nuf); - - return ret; - } - - case c3__cnts: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - return _mull_cnts(van, sut, gol, dox, p_gen, q_gen); - } - - case c3__brcn: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun ruf = u3nc(u3_nul, 1); - - ret = _mull_grow - (van, sut, gol, dox, c3__gold, p_gen, c3__dry, ruf, q_gen); - u3z(ruf); - - return ret; - } - - case c3__brvt: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun ruf = u3nc(u3_nul, 1); - - ret = _mull_grow - (van, sut, gol, dox, c3__gold, p_gen, c3__wet, ruf, q_gen); - u3z(ruf); - - return ret; - } - - case c3__sgzp: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun typ = u3qfu_play(van, sut, p_gen); - u3_noun dug = u3qfu_duck(van, typ); - u3_noun ret; - - u3t_push(u3nc(c3__mean, dug)); - { - ret = _mull_in(van, sut, gol, dox, q_gen); - } - u3t_drop(); - - u3z(typ); - return ret; - } - - case c3__sgbn: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - return _mull_in(van, sut, gol, dox, q_gen); - } - - case c3__zpcm: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun p_ret = u3qfu_play(van, sut, p_gen); - u3_noun q_ret = u3qfu_play(van, sut, q_gen); - - return u3nc(_mull_nice(van, gol, p_ret), - q_ret); - } - - case c3__dbug: u3x_cell(u3t(gen), &p_gen, &q_gen); - { - u3_noun ret; - - u3t_push(u3nc(c3__mean, _mull_loc(van, p_gen))); - { - ret = _mull_in(van, sut, gol, dox, q_gen); - } - u3t_drop(); - return ret; - } - - case c3__zpts: p_gen = u3t(gen); - _mull_used(); - { - return _mull_both(van, gol, c3__noun); - } - - case c3__ktcn: p_gen = u3t(gen); - _mull_used(); - { - u3_noun von = u3i_molt(u3k(van), u3qfu_van_fab, c3n, 0); - u3_noun ret = _mull_in(von, sut, gol, dox, p_gen); - - u3z(von); - return ret; - } - - case c3__zpmc: - case c3__zpsm: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun p_zur = u3qfu_play(van, sut, p_gen); - u3_noun q_zur = u3qfu_play (van, dox, p_gen); - u3_noun vos = _mull_in(van, sut, c3__noun, dox, q_gen); - u3_noun p_ret = u3qf_cell(p_zur, u3h(vos)); - u3_noun q_ret = u3qf_cell(q_zur, u3t(vos)); - - u3z(vos); - u3z(q_zur); - u3z(p_zur); - - return u3nc - (_mull_nice(van, gol, p_ret), q_ret); - } - case c3__zpvt: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); - _mull_used(); - { - c3_o fes = _mull_feel(van, sut, p_gen); - c3_o fed = _mull_feel(van, dox, p_gen); - - if ( fes != fed ) { - return u3m_error("mull-bonk-f"); - } - else { - if ( c3y == fes ) { - return _mull_in(van, sut, gol, dox, q_gen); - } else { - return _mull_in(van, sut, gol, dox, r_gen); - } - } - } - - case c3__lost: - case c3__fail: - case c3__zpzp: - _mull_used(); - { - return u3nc(c3__void, c3__void); - } - } - } - - static u3_noun - _cqfu_mull(u3_noun van, - u3_noun sut, - u3_noun gol, - u3_noun dox, - u3_noun gen) - { - return _mull_in(van, sut, gol, dox, gen); - } - -/* boilerplate -*/ - u3_noun - u3wfu_mull(u3_noun cor) - { - u3_noun sut, gol, dox, gen, van; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &gol, - u3x_sam_6, &dox, - u3x_sam_7, &gen, - u3x_con, &van, - 0)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return _cqfu_mull(van, sut, gol, dox, gen); - } - } - - u3_noun - u3qfu_mull(u3_noun van, - u3_noun sut, - u3_noun gol, - u3_noun dox, - u3_noun gen) - { - c3_m fun_m = 141 + c3__mull + ((!!u3r_at(u3qfu_van_vet, van)) << 8); - u3_noun pro = u3z_find_4(fun_m, sut, gol, dox, gen); - - if ( u3_none != pro ) { - return pro; - } - else { - pro = _cqfu_mull(van, sut, gol, dox, gen); - - return u3z_save_4(fun_m, sut, gol, dox, gen, pro); - } - } - diff --git a/jets/stage/f/ut_nest.c b/jets/stage/f/ut_nest.c deleted file mode 100644 index f36c1385c..000000000 --- a/jets/stage/f/ut_nest.c +++ /dev/null @@ -1,560 +0,0 @@ -/* j/6/ut_nest.c -** -*/ -#include "all.h" - -/* logic -*/ - /* forward - */ - static u3_noun - _nest_sint(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); - static u3_noun - _nest_dext(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); - - static u3_noun - _nest_deep(u3_noun van, - u3_noun sut, - u3_noun tel, - u3_noun ref, - u3_noun dab, - u3_noun hem, - u3_noun gil) - { - if ( u3_nul == dab ) { - return u3r_sing(u3_nul, hem); - } else if ( u3_nul == hem ) { - return c3n; - } else { - u3_noun n_dab, l_dab, r_dab; - u3_noun n_hem, l_hem, r_hem; - u3_noun pn_hem, qn_hem, pn_dab, qn_dab; - - u3x_trel(dab, &n_dab, &l_dab, &r_dab); - u3x_trel(hem, &n_hem, &l_hem, &r_hem); - - if ( (c3n == _nest_deep(van, sut, tel, ref, l_dab, l_hem, gil)) || - (c3n == _nest_deep(van, sut, tel, ref, r_dab, r_hem, gil)) ) - { - return c3n; - } - u3x_cell(n_dab, &pn_dab, &qn_dab); - u3x_cell(n_hem, &pn_hem, &qn_hem); - - if ( c3n == u3r_sing(pn_dab, pn_hem) ) { - return c3n; - } - else { - u3_noun vis = u3qfu_play(van, sut, qn_dab); - u3_noun lon = u3qfu_play(van, ref, qn_hem); - - u3_noun ret = _nest_dext(van, vis, tel, lon, u3_nul, u3_nul, gil); - - u3z(vis); - u3z(lon); - return ret; - } - } - } - - static u3_noun - _nest_dope(u3_noun van, - u3_noun sut, - u3_noun tel, - u3_noun ref, - u3_noun dom, - u3_noun vim, - u3_noun gil) - { - if ( u3_nul == dom ) { - return u3r_sing(u3_nul, vim); - } else if ( u3_nul == vim ) { - return c3n; - } else { - u3_noun n_dom, l_dom, r_dom; - u3_noun n_vim, l_vim, r_vim; - u3_noun pn_vim, qn_vim, pn_dom, qn_dom; - u3_noun pqn_vim, qqn_vim, pqn_dom, qqn_dom; - - u3x_trel(dom, &n_dom, &l_dom, &r_dom); - u3x_trel(vim, &n_vim, &l_vim, &r_vim); - - if ( (c3n == _nest_dope(van, sut, tel, ref, l_dom, l_vim, gil)) || - (c3n == _nest_dope(van, sut, tel, ref, r_dom, r_vim, gil)) ) - { - return c3n; - } - u3x_cell(n_dom, &pn_dom, &qn_dom); - u3x_cell(n_vim, &pn_vim, &qn_vim); - - u3x_cell(qn_dom, &pqn_dom, &qqn_dom); - u3x_cell(qn_vim, &pqn_vim, &qqn_vim); - - if ( c3n == u3r_sing(pn_dom, pn_vim) ) { - return c3n; - } else { - return _nest_deep(van, sut, tel, ref, qqn_dom, qqn_vim, gil); - } - } - } - - static u3_noun - _nest_cong(u3_noun van, - u3_noun sut, - u3_noun tel, - u3_noun ref, - u3_noun gil) - { - u3_noun p_sut, q_sut, p_ref, q_ref; - u3_noun pq_sut, qq_sut, rq_sut; - u3_noun pq_ref, qq_ref, rq_ref; - u3_noun prq_sut, qrq_sut, prq_ref, qrq_ref; - u3_noun ppq_sut, qpq_sut, rpq_sut; - u3_noun ppq_ref, qpq_ref, rpq_ref; - u3_noun ret; - - u3x_trel(sut, 0, &p_sut, &q_sut); - u3x_trel(ref, 0, &p_ref, &q_ref); - - u3x_trel(q_sut, &pq_sut, &qq_sut, &rq_sut); - u3x_trel(q_ref, &pq_ref, &qq_ref, &rq_ref); - - u3x_trel(pq_sut, &ppq_sut, &qpq_sut, &rpq_sut); - u3x_trel(pq_ref, &ppq_ref, &qpq_ref, &rpq_ref); - - u3x_cell(rq_sut, &prq_sut, &qrq_sut); - u3x_cell(rq_ref, &prq_ref, &qrq_ref); - - if ( c3y == u3r_sing(q_sut, q_ref) ) { - return _nest_dext(van, p_sut, tel, p_ref, u3_nul, u3_nul, gil); - } - else if ( c3n == u3r_sing(qpq_sut, qpq_ref) ) { - return c3n; - } - else if ( (c3n == _nest_dext - (van, qq_sut, tel, p_sut, u3_nul, u3_nul, gil)) || - (c3n == _nest_dext - (van, p_sut, tel, qq_sut, u3_nul, u3_nul, gil)) || - (c3n == _nest_dext - (van, qq_ref, tel, p_ref, u3_nul, u3_nul, gil)) ) - { - return c3n; - } - else { - if ( (rpq_sut != rpq_ref) && - (c3__lead != rpq_sut) && - (c3__gold != rpq_ref) ) - { - return c3n; - } - else if ( c3__wet == qpq_sut ) { - return u3r_sing(qrq_sut, qrq_ref); - } - else { - u3_noun hud = u3nc(u3k(sut), u3k(ref)); - - if ( (c3y == u3qdi_has(gil, hud)) ) { - u3z(hud); - - return c3y; - } - else { - u3_noun zoc = u3qdi_put(gil, hud); - u3_noun tus = u3nt(c3__core, - u3k(qq_sut), - u3nc(u3nt(u3k(ppq_sut), u3k(qpq_sut), c3__gold), - u3k(u3t(q_sut)))); - - u3_noun fer = u3nt(c3__core, - u3k(qq_ref), - u3nc(u3nt(u3k(ppq_ref), u3k(qpq_ref), c3__gold), - u3k(u3t(q_ref)))); - - ret = _nest_dope(van, tus, tel, fer, qrq_sut, qrq_ref, zoc); - u3z(fer); - u3z(tus); - u3z(zoc); - u3z(hud); - - if ( c3n == ret ) { - return c3n; - } - else { - switch ( rpq_sut ) { - default: return u3m_bail(c3__fail); - - case c3__gold: { - return - c3a(_nest_dext(van, qq_sut, tel, qq_ref, u3_nul, u3_nul, gil), - _nest_dext(van, qq_ref, tel, qq_sut, u3_nul, u3_nul, gil)); - } - case c3__iron: { - u3_noun s_sam = u3qfu_peek(van, qq_sut, c3__rite, 2); - u3_noun r_sam = u3qfu_peek(van, qq_ref, c3__rite, 2); - u3_noun ret = _nest_dext - (van, r_sam, tel, s_sam, u3_nul, u3_nul, gil); - - u3z(r_sam); - u3z(s_sam); - return ret; - } - case c3__lead: { - return c3y; - } - case c3__zinc: { - u3_noun s_pal = u3qfu_peek(van, qq_sut, c3__read, 2); - u3_noun r_pal = u3qfu_peek(van, qq_ref, c3__read, 2); - u3_noun ret = _nest_dext - (van, s_pal, tel, r_pal, u3_nul, u3_nul, gil); - - u3z(r_pal); - u3z(s_pal); - - return ret; - } - } - } - } - } - } - } - - static u3_noun - _nest_dext_in(u3_noun van, - u3_noun sut, - u3_noun tel, - u3_noun ref, - u3_noun seg, - u3_noun reg, - u3_noun gil) - { - u3_noun p_sut, q_sut, p_ref, q_ref; - - if ( (c3n == u3du(sut)) ) switch ( sut ) { - default: return u3m_bail(c3__fail); - - case c3__noun: { - return c3y; - } - case c3__void: { - return _nest_sint(van, sut, tel, ref, seg, reg, gil); - } - } - else switch ( u3h(sut) ) { - default: return u3m_bail(c3__fail); - - case c3__atom: { - if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { - return u3m_bail(c3__fail); - } - else { - if ( c3y == u3r_pq(ref, c3__atom, &p_ref, &q_ref) ) { - if ( (c3n == u3qf_fitz(p_sut, p_ref)) || - ( (c3y == u3du(q_sut)) && - ( (c3n == u3du(q_ref)) || - (c3n == u3r_sing(q_sut, q_ref)))) ) - { - return c3n; - } - return c3y; - } - return _nest_sint(van, sut, tel, ref, seg, reg, gil); - } - } - case c3__cell: { - if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { - return u3m_bail(c3__fail); - } else { - if ( c3y == u3r_pq(ref, c3__cell, &p_ref, &q_ref) ) { - return c3a(_nest_dext(van, p_sut, tel, p_ref, u3_nul, u3_nul, gil), - _nest_dext(van, q_sut, tel, q_ref, u3_nul, u3_nul, gil)); - } - else return _nest_sint(van, sut, tel, ref, seg, reg, gil); - } - } - case c3__core: { - if ( c3n == u3r_trel(sut, 0, &p_sut, &q_sut) ) { - return u3m_bail(c3__fail); - } else { - if ( (c3y == u3r_pq(ref, c3__core, &p_ref, &q_ref)) ) { - return _nest_cong(van, sut, tel, ref, gil); - } - else return _nest_sint(van, sut, tel, ref, seg, reg, gil); - } - } - case c3__hint: - case c3__face: { - if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { - return u3m_bail(c3__fail); - } else { - return _nest_dext(van, q_sut, tel, ref, seg, reg, gil); - } - } - case c3__fork: p_sut = u3t(sut); - { - if ( c3n == u3du(ref) ) switch ( ref ) { - default: return _nest_sint(van, sut, tel, ref, seg, reg, gil); - - case c3__noun: - break; - } - else switch ( u3h(ref) ) { - default: return _nest_sint(van, sut, tel, ref, seg, reg, gil); - - case c3__atom: - case c3__cell: - case c3__core: - break; - } - - { - u3_noun dey = u3qdi_tap(p_sut); - u3_noun yed = dey; - - while ( u3_nul != yed ) { - if ( c3y == _nest_dext(van, u3h(yed), c3n, ref, seg, reg, gil) ) { - u3z(dey); - return c3y; - } else { - yed = u3t(yed); - } - } - u3z(dey); - return c3n; - } - } - case c3__hold: - { - if ( c3y == u3qdi_has(seg, sut) ) { - return c3n; - } - else { - u3_noun hud = u3nc(u3k(sut), u3k(ref)); - - if ( (c3y == u3qdi_has(gil, hud)) ) { - u3z(hud); - - return c3y; - } - else { - u3_noun gus = u3qdi_put(seg, sut); - u3_noun zoc = u3qdi_put(gil, hud); - u3_noun fop = u3qfu_repo(van, sut); - u3_noun hiv = _nest_dext(van, fop, tel, ref, gus, reg, zoc); - - u3z(hud); - u3z(fop); - u3z(zoc); - u3z(gus); - - return hiv; - } - } - } - } - } - - static u3_noun - _nest_dext_to(u3_noun van, - u3_noun sut, - u3_noun tel, - u3_noun ref, - u3_noun seg, - u3_noun reg, - u3_noun gil) - { - u3_noun tyn = _nest_dext_in(van, sut, tel, ref, seg, reg, gil); - - if ( (c3y == tyn) || (c3n == tel) ) { - return tyn; - } else { -#if 0 - u3_noun dun = u3qfu_dunq(van, "need", sut); - u3_noun niz = u3qfu_dunq(van, "have", ref); - - u3t_push(u3nc(c3__mean, dun)); - u3t_push(u3nc(c3__mean, niz)); -#endif - return u3m_error("nest-fail"); - } - } - - static u3_noun - _nest_dext(u3_noun van, - u3_noun sut, - u3_noun tel, - u3_noun ref, - u3_noun seg, - u3_noun reg, - u3_noun gil) - { - - if ( (c3y == u3r_sing(sut, ref)) ) { - return c3y; - } - - { - c3_m fun_m = 141 + c3__nest + ((!!u3r_at(u3qfu_van_vet, van)) << 8); - u3_noun pro = u3z_find_2(fun_m, sut, ref); - - if ( u3_none != pro ) { - return pro; - } - else { - pro = _nest_dext_to(van, sut, tel, ref, seg, reg, gil); - - if ( ((c3y == pro) && (u3_nul == reg)) || - ((c3n == pro) && (u3_nul == seg)) ) - { - return u3z_save_2(fun_m, sut, ref, pro); - } - else return pro; - } - } - } - - static u3_noun - _nest_sint(u3_noun van, - u3_noun sut, - u3_noun tel, - u3_noun ref, - u3_noun seg, - u3_noun reg, - u3_noun gil) - { - u3_noun p_ref, q_ref; - - if ( (c3n == u3du(ref)) ) { - switch ( ref ) { - default: return u3m_bail(c3__fail); - - case c3__noun: return c3n; - case c3__void: return c3y; - } - } - else { - switch ( u3h(ref) ) { - default: { - return u3m_bail(c3__fail); - } - case c3__atom: return c3n; - case c3__cell: return c3n; - case c3__core: { - u3_noun gam = u3qfu_repo(van, ref); - u3_noun hiv = _nest_dext(van, sut, tel, gam, seg, reg, gil); - - u3z(gam); - return hiv; - } - case c3__hint: - case c3__face: { - if ( c3n == u3r_trel(ref, 0, &p_ref, &q_ref) ) { - return u3m_bail(c3__fail); - } else { - return _nest_dext(van, sut, tel, q_ref, seg, reg, gil); - } - } - case c3__fork: p_ref = u3t(ref); - { - u3_noun dey = u3qdi_tap(p_ref); - u3_noun yed = dey; - - while ( u3_nul != yed ) { - if ( c3n == _nest_dext(van, sut, c3n, u3h(yed), seg, reg, gil) ) { - u3z(dey); - return c3n; - } else { - yed = u3t(yed); - } - } - u3z(dey); - return c3y; - } - case c3__hold: { - if ( c3y == u3qdi_has(reg, ref) ) { - return c3y; - } - { - u3_noun hud = u3nc(u3k(sut), u3k(ref)); - - if ( (c3y == u3qdi_has(gil, hud)) ) { - u3z(hud); - - return c3y; - } else { - u3_noun gur = u3qdi_put(reg, ref); - u3_noun zoc = u3qdi_put(gil, hud); - u3_noun gam = u3qfu_repo(van, ref); - - { - u3_noun hiv = _nest_dext(van, sut, tel, gam, seg, gur, zoc); - - u3z(hud); - u3z(gam); - u3z(zoc); - u3z(gur); - - return hiv; - } - } - } - } - } - } - } - - static u3_noun - _cqfu_nest(u3_noun van, - u3_noun sut, - u3_noun tel, - u3_noun ref) - { - return _nest_dext(van, sut, tel, ref, u3_nul, u3_nul, u3_nul); - } - -/* boilerplate -*/ - u3_noun - u3wfu_nest(u3_noun cor) - { - u3_noun sut, tel, ref, van; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &tel, - u3x_sam_3, &ref, - u3x_con, &van, - 0)) || - (c3n == u3ud(tel)) || (tel > 1) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return _cqfu_nest(van, sut, tel, ref); - } - } - - u3_noun - u3qfu_nest(u3_noun van, - u3_noun sut, - u3_noun tel, - u3_noun ref) - { -#if 1 - c3_m fun_m = 141 + c3__nest; - u3_noun vrf = u3r_at(u3qfu_van_vrf, van); - u3_noun pro = u3z_find_4(fun_m, vrf, sut, tel, ref); - - if ( u3_none != pro ) { - // u3t_heck(c3__good); - return pro; - } - else { - pro = _cqfu_nest(van, sut, tel, ref); - - // u3t_heck(c3__nest); - return u3z_save_4(fun_m, vrf, sut, tel, ref, pro); - } -#else - return _cqfu_nest(van, sut, tel, ref); -#endif - } - diff --git a/jets/stage/f/ut_peek.c b/jets/stage/f/ut_peek.c deleted file mode 100644 index dc9a5887c..000000000 --- a/jets/stage/f/ut_peek.c +++ /dev/null @@ -1,232 +0,0 @@ -/* j/6/peek.c -** -*/ -#include "all.h" - - -/* logic -*/ - static u3_noun - _cqfu_peek(u3_noun, u3_noun, u3_noun, u3_atom); - - static u3_noun - _peek_in(u3_noun, u3_noun, u3_noun, u3_atom, u3_noun); - - static u3_noun - _peek_fork(u3_noun van, u3_noun p_sut, u3_noun way, u3_noun axe, u3_noun gil) - { - if ( u3_nul == p_sut ) { - return u3_nul; - } - else { - return u3nc(_peek_in(van, u3h(p_sut), way, axe, gil), - _peek_fork(van, u3t(p_sut), way, axe, gil)); - } - } - - static u3_noun - _peek_in(u3_noun van, - u3_noun sut, - u3_noun way, - u3_atom axe, - u3_noun gil) - { - u3_noun p_sut, q_sut; - u3_noun pro; - - if ( (c3n == u3du(sut)) ) switch ( sut ) { - default: return u3m_bail(c3__fail); - - case c3__noun: { - return c3__noun; - } - case c3__void: { - return c3__void; - } - } - else switch ( u3h(sut) ) { - default: return u3m_bail(c3__fail); - - case c3__atom: { - return c3__void; - } - case c3__cell: { - if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { - return u3m_bail(c3__fail); - } else { - u3_atom tip = u3qc_cap(axe); - u3_atom tap = u3qc_mas(axe); - - if ( 2 == tip ) { - pro = _cqfu_peek(van, p_sut, way, tap); - } - else { - pro = _cqfu_peek(van, q_sut, way, tap); - } - u3z(tap); - u3z(tip); - - return pro; - } - } - case c3__core: { - u3_noun pq_sut, qq_sut, rq_sut; - u3_noun ppq_sut, qpq_sut, rpq_sut; - u3_noun prq_sut, qrq_sut; - - if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) || - (c3n == u3r_trel(q_sut, &pq_sut, &qq_sut, &rq_sut)) || - (c3n == u3r_trel(pq_sut, &ppq_sut, &qpq_sut, &rpq_sut)) || - (c3n == u3r_cell(rq_sut, &prq_sut, &qrq_sut)) ) - { - return u3m_bail(c3__fail); - } else { - u3_atom now = u3qc_cap(axe); - u3_atom lat = u3qc_mas(axe); - - if ( 3 == now ) { - u3_noun pec = u3qfu_peel(van, sut, way, rpq_sut); - u3_noun sam = u3h(pec); - u3_noun con = u3t(pec); - u3_atom tow; - - if ( 1 == lat ) { - tow = 1; - } else { - tow = u3qc_cap(lat); - } - - if ( (c3y == c3a(sam, con)) || - ((c3y == sam) && (tow == 2)) || - ((c3y == con) && (tow == 3)) ) - { - pro = _cqfu_peek(van, p_sut, way, lat); - } - else { - - if ( way != c3__read ) { - return u3m_error("payload-block"); - } - - u3_noun typ; - - { - u3_noun hed, tal; - - if ( c3n == sam ) { - hed = c3__noun; - } else { - hed = _cqfu_peek(van, p_sut, way, 2); - } - - if ( c3n == con ) { - tal = c3__noun; - } else { - tal = _cqfu_peek(van, p_sut, way, 3); - } - - typ = u3qf_cell(hed, tal); - u3z(hed); - u3z(tal); - } - - pro = _cqfu_peek(van, typ, way, lat); - u3z(typ); - } - - u3z(pec); - u3z(tow); - } - else { - pro = c3__noun; - } - u3z(lat); - u3z(now); - - return pro; - } - } - case c3__hint: - case c3__face: { - if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { - return u3m_bail(c3__fail); - } else { - return _peek_in(van, q_sut, way, axe, gil); - } - } - case c3__fork: p_sut = u3t(sut); - { - u3_noun yed = u3qdi_tap(p_sut); - u3_noun ret = u3kf_fork(_peek_fork(van, yed, way, axe, gil)); - - u3z(yed); - return ret; - } - case c3__hold: { - if ( (c3y == u3qdi_has(gil, sut)) ) { - return c3__void; - } - else { - u3_noun zoc = u3qdi_put(gil, sut); - u3_noun fop = u3qfu_repo(van, sut); - u3_noun pro = _peek_in(van, fop, way, axe, zoc); - - u3z(fop); - u3z(zoc); - - return pro; - } - } - } - } - - static u3_noun - _cqfu_peek(u3_noun van, - u3_noun sut, - u3_noun way, - u3_atom axe) - { - if ( 1 == axe ) { - return u3k(sut); - } - else return _peek_in(van, sut, way, axe, u3_nul); - } - -/* boilerplate -*/ - u3_noun - u3wfu_peek(u3_noun cor) - { - u3_noun sut, way, axe, van; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &way, - u3x_sam_3, &axe, - u3x_con, &van, - 0)) || - (c3n == u3ud(axe)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return _cqfu_peek(van, sut, way, axe); - } - } - - u3_noun - u3qfu_peek(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun axe) - { - c3_m fun_m = 141 + c3__peek + ((!!u3r_at(u3qfu_van_vet, van)) << 8); - u3_noun pro = u3z_find_3(fun_m, sut, way, axe); - - if ( u3_none != pro ) { - return pro; - } - else { - pro = _cqfu_peek(van, sut, way, axe); - - return u3z_save_3(fun_m, sut, way, axe, pro); - } - } diff --git a/jets/stage/f/ut_peel.c b/jets/stage/f/ut_peel.c deleted file mode 100644 index 717a62543..000000000 --- a/jets/stage/f/ut_peel.c +++ /dev/null @@ -1,55 +0,0 @@ -/* j/6/ut_peel.c -** -*/ -#include "all.h" - - -/* logic -*/ - u3_noun - _cqfu_peel(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun met) - { - if ( c3__gold == met ) { - return u3nc(c3y, c3y); - } - else switch ( way ) { - default: return u3m_bail(c3__fail); - - case c3__both: return u3nc(c3n, c3n); - case c3__free: return u3nc(c3y, c3y); - case c3__read: return u3nc(((met == c3__zinc) ? c3y : c3n), c3n); - case c3__rite: return u3nc(((met == c3__iron) ? c3y : c3n), c3n); - } - } - -/* boilerplate -*/ - u3_noun - u3wfu_peel(u3_noun cor) - { - u3_noun sut, way, met, van; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &way, - u3x_sam_3, &met, - u3x_con, &van, - 0)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return _cqfu_peel(van, sut, way, met); - } - } - - u3_noun - u3qfu_peel(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun met) - { - return _cqfu_peel(van, sut, way, met); - } - diff --git a/jets/stage/f/ut_play.c b/jets/stage/f/ut_play.c deleted file mode 100644 index 9a300edf4..000000000 --- a/jets/stage/f/ut_play.c +++ /dev/null @@ -1,606 +0,0 @@ -/* j/6/play.c -** -*/ -#include "all.h" - -/* logic -*/ -# define _play_used() - - static u3_noun - _play_in(u3_noun, u3_noun, u3_noun); - - static u3_noun - _play_bean() - { - return u3kf_fork(u3nt(u3nq(c3__atom, 'f', u3_nul, 0), - u3nq(c3__atom, 'f', u3_nul, 1), - u3_nul)); - } - - static u3_noun - _play_rock(u3_noun odo, u3_noun bob) - { - if ( c3y == u3ud(bob) ) { - return u3nq(c3__atom, u3k(odo), u3_nul, u3k(bob)); - } - else return u3nt(c3__cell, _play_rock(odo, u3h(bob)), - _play_rock(odo, u3t(bob))); - } - - static u3_noun - _play_sand(u3_noun odo, u3_noun bob) - { - if ( c3y == u3ud(bob) ) { - if ( 'n' == odo ) { - if ( (bob != 0) ) { - return u3m_bail(c3__exit); - } else { - return u3nq(c3__atom, odo, u3_nul, bob); - } - } - if ( 'f' == odo ) { - if ( (bob > 1) ) { - return u3m_bail(c3__exit); - } else { - return _play_bean(); - } - } - return u3nt(c3__atom, u3k(odo), u3_nul); - } - else return u3nt(c3__cell, _play_rock(odo, u3h(bob)), - _play_rock(odo, u3t(bob))); - } - - static u3_noun - _play_core(u3_noun pac, - u3_noun con) - { - if ( (c3__void == pac) ) { - u3z(con); - - return c3__void; - } else { - return u3nt(c3__core, pac, con); - } - } - - static u3_noun - _play_loc(u3_noun van, - u3_noun loc) - { - u3_noun mol = u3nc('o', u3k(loc)); - u3_noun sho = u3j_cook("_play_loc-show", u3k(van), "show"); - u3_noun ret = u3i_molt(u3k(sho), u3x_sam, u3k(mol), 0); - - u3z(mol); - u3z(sho); - - return ret; - } - - static u3_noun - _play_feel(u3_noun van, - u3_noun sut, - u3_noun rot) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_hook(von, "feel"); - - return u3n_kick_on(u3i_molt(gat, - u3x_sam, - u3k(rot), - 0)); - } - -#if 0 - static u3_noun - _play_loc_term(u3_noun van, - u3_noun loc) - { - u3_noun fop = u3kb_flop(u3k(u3h(loc))); - u3_noun nam = ((0 == fop) ? c3__none : u3k(u3h(fop))); - u3_noun lys = u3nt(u3k(u3h(u3t(loc))), u3k(u3t(u3t(loc))), u3_nul); - u3_noun rup = u3nc(nam, lys); - c3_c* pre_c = u3m_pretty(rup); - u3_noun pro = u3i_string(pre_c); - - u3z(fop); - u3z(rup); - free(pre_c); - - return pro; - } -#endif - -#if 1 - static u3_noun - _play_cnts(u3_noun van, - u3_noun sut, - u3_noun hyp, - u3_noun rig) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("_play_cnts-epla", von, "epla"); - - return u3n_kick_on(u3i_molt(gat, - u3x_sam_2, - u3k(hyp), - u3x_sam_3, - u3k(rig), - 0)); - } -#else - static u3_noun - _play_edit(u3_noun van, - u3_noun sut, - u3_noun mew, - u3_noun rag) - { - while ( 1 ) { - if ( c3n == u3du(mew) ) { - return rag; - } else { - u3_noun i_mew = u3h(mew); - u3_noun t_mew = u3t(mew); - u3_noun pi_mew = u3h(i_mew); - u3_noun qi_mew = u3t(i_mew); - u3_noun laf = _play_in(van, sut, qi_mew); - u3_noun ruz = u3qfu_toss(van, sut, pi_mew, laf, rag); - - u3z(laf); - u3z(rag); - rag = u3k(u3t(ruz)); - u3z(ruz); - - mew = t_mew; - } - } - } - static u3_noun - _play_cnts_old(u3_noun van, - u3_noun sut, - u3_noun hyp, - u3_noun rig) - { - u3_noun lar = u3qfu_seek(van, sut, c3__read, hyp); - u3_noun q_lar = u3t(lar); - u3_noun qq_lar = u3t(q_lar); - u3_noun mew = rig; - u3_noun rag = _play_edit(van, sut, mew, u3k(qq_lar)); - u3_noun ret = u3qfu_fire(van, sut, rag); - - u3z(rag); - u3z(lar); - - return ret; - } -#endif - - static u3_noun - _play_grow(u3_noun van, - u3_noun sut, - u3_atom mel, - u3_noun nym, - u3_noun hud, - u3_noun ruf, - u3_noun dom) - { - u3_noun dan = _play_in(van, sut, ruf); - - return _play_core(dan, - u3nt(u3nt(u3k(nym), u3k(hud), u3k(mel)), - u3k(dan), - u3nc(u3nc(u3nc(c3__full, u3_nul), u3_nul), - u3k(dom)))); - } - - static u3_noun - _play_in(u3_noun van, - u3_noun sut, - u3_noun gen); - - static u3_noun - _play_x(u3_noun van, - u3_noun sut, - u3_noun gen) - { -#if 1 - return _play_in(van, sut, gen); -#else - u3_noun zix = u3qfu_shep - (van, "gene", 'q', u3k(gen)); - u3_noun ret; - - u3t_push(u3nc(c3__mean, zix)); - - ret = _play_in(van, sut, gen); - - u3t_drop(); - return ret; -#endif - } - - static u3_noun - _play_in(u3_noun van, - u3_noun sut, - u3_noun gen) - { - u3_noun p_gen, q_gen, r_gen; - - if ( c3n == u3du(gen) ) { - open: { - u3_noun ter = u3r_at(u3x_con_3, van); - u3_noun fab = u3r_at(u3qfu_van_fab, van); - u3_noun rex = u3qfp_open(ter, fab, gen); - u3_noun ret; - - if ( c3y == u3r_sing(rex, gen) ) { - u3_noun zix = u3qfu_shep(van, "gene", 'q', u3k(gen)); - - u3t_push(u3nc(c3__mean, zix)); - return u3m_error("play-open-z"); - } - ret = _play_x(van, sut, rex); - u3z(rex); - - return ret; - } - } - else if ( c3y == u3du(u3h(gen)) ) { - _play_used(); - { - u3_noun dis = _play_x(van, sut, u3h(gen)); - u3_noun dat = _play_x(van, sut, u3t(gen)); - u3_noun ret = u3qf_cell(dis, dat); - - u3z(dis); - u3z(dat); - return ret; - } - } - else switch ( u3h(gen) ) { - default: goto open; - - case c3__fits: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - return _play_bean(); - } - - case c3__wtcl: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); - _play_used(); - { - u3_noun fex = u3qfu_gain(van, sut, p_gen); - u3_noun wux = u3qfu_lose(van, sut, p_gen); - u3_noun dez = (fex == c3__void) ? c3__void - : _play_x(van, fex, q_gen); - u3_noun doz = (wux == c3__void) ? c3__void - : _play_x(van, wux, r_gen); - u3_noun ret = u3qf_forq(dez, doz); - - u3z(dez); u3z(doz); - u3z(fex); u3z(wux); - return ret; - } - - case c3__clhp: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - u3_noun dis = _play_x(van, sut, p_gen); - u3_noun dat = _play_x(van, sut, q_gen); - u3_noun ret = u3qf_cell(dis, dat); - - u3z(dis); - u3z(dat); - return ret; - } - - case c3__dtkt: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - u3_noun nog = u3nc(c3__kttr, u3k(p_gen)); - u3_noun ret = _play_x(van, sut, nog); - - u3z(nog); - return ret; - } - - case c3__dtwt: p_gen = u3t(gen); - _play_used(); - { - return _play_bean(); - } - - case c3__dtts: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - return _play_bean(); - } - - case c3__dtls: p_gen = u3t(gen); - _play_used(); - { - return u3nt(c3__atom, u3_blip, u3_nul); - } - - case c3__rock: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - return _play_rock(p_gen, q_gen); - } - - case c3__dttr: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - return c3__noun; - } - - case c3__sand: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - return _play_sand(p_gen, q_gen); - } - - case c3__hand: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - return u3k(p_gen); - } - - case c3__ktbr: p_gen = u3t(gen); - _play_used(); - { - u3_noun boc = _play_x(van, sut, p_gen); - u3_noun pro = u3qfu_wrap(van, boc, c3__iron); - - u3z(boc); - return pro; - } - - case c3__ktpd: p_gen = u3t(gen); - _play_used(); - { - u3_noun boc = _play_x(van, sut, p_gen); - u3_noun pro = u3qfu_wrap(van, boc, c3__zinc); - - u3z(boc); - return pro; - } - - case c3__ktwt: p_gen = u3t(gen); - _play_used(); - { - u3_noun boc = _play_x(van, sut, p_gen); - u3_noun pro = u3qfu_wrap(van, boc, c3__lead); - - u3z(boc); - return pro; - } - - case c3__note: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - u3_noun boc = _play_x(van, sut, q_gen); - u3_noun hit = u3nc(u3k(sut), u3k(p_gen)); - u3_noun ret = u3qf_hint(hit, boc); - - u3z(hit); - u3z(boc); - return ret; - } - - case c3__tune: p_gen = u3t(gen); - _play_used(); - { - return u3qf_face(p_gen, sut); - } - - case c3__ktsg: p_gen = u3t(gen); - _play_used(); - { - return _play_x(van, sut, p_gen); - } - - case c3__ktls: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - return _play_x(van, sut, p_gen); - } - - case c3__tsbn: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - u3_noun boc = _play_x(van, sut, p_gen); - u3_noun ret = _play_x(van, boc, q_gen); - - u3z(boc); - return ret; - } - - case c3__tscm: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - u3_noun boc = u3qfu_busk(van, sut, p_gen); - u3_noun ret = _play_x(van, boc, q_gen); - - u3z(boc); - return ret; - } - - case c3__cnts: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - return _play_cnts(van, sut, p_gen, q_gen); - } - - case c3__brcn: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - u3_noun ruf = u3nc(u3_nul, 1); - u3_noun ret = _play_grow - (van, sut, c3__gold, p_gen, c3__dry, ruf, q_gen); - - u3z(ruf); - return ret; - } - - case c3__brvt: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - u3_noun ruf = u3nc(u3_nul, 1); - u3_noun ret = _play_grow - (van, sut, c3__gold, p_gen, c3__wet, ruf, q_gen); - - u3z(ruf); - return ret; - } - - case c3__sgzp: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - u3_noun typ = u3qfu_play(van, sut, p_gen); - u3_noun dug = u3qfu_duck(van, typ); - u3_noun ret; - - u3t_push(u3nc(c3__mean, dug)); - { - ret = _play_x(van, sut, q_gen); - } - u3t_drop(); - - u3z(typ); - return ret; - } - - case c3__sgbn: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - return _play_x(van, sut, q_gen); - } - - case c3__zpts: p_gen = u3t(gen); - _play_used(); - { - return c3__noun; - } - - case c3__ktcn: p_gen = u3t(gen); - { - u3_noun von = u3i_molt(u3k(van), u3qfu_van_fab, c3n, 0); - u3_noun ret = _play_x(von, sut, p_gen); - - u3z(von); - return ret; - } - - case c3__zpcm: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - return _play_x(van, sut, p_gen); - } - - case c3__dbug: u3x_cell(u3t(gen), &p_gen, &q_gen); - { - u3_noun ret; - -#if 0 - { - u3_noun cog = _play_loc_term(van, p_gen); - - u3t_heck(cog); - u3z(cog); - } -#endif - u3t_push(u3nc(c3__mean, _play_loc(van, p_gen))); - { - ret = _play_x(van, sut, q_gen); - } - u3t_drop(); - return ret; - } - - case c3__zpmc: - case c3__zpsm: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - u3_noun zur = _play_x(van, sut, p_gen); - u3_noun vos = _play_x(van, sut, q_gen); - u3_noun ret = u3qf_cell(zur, vos); - - u3z(zur); - u3z(vos); - - return ret; - } - - case c3__zpvt: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); - _play_used(); - { - if ( c3y == _play_feel(van, sut, p_gen) ) { - return _play_x(van, sut, q_gen); - } else { - return _play_x(van, sut, r_gen); - } - } - - case c3__lost: - case c3__fail: - case c3__zpzp: - _play_used(); - { - return c3__void; - } - } - } - - static u3_noun - _cqfu_play(u3_noun van, - u3_noun sut, - u3_noun gen) - { - u3_noun von = u3i_molt(u3k(van), u3qfu_van_vet, c3n, 0); - u3_noun ret = _play_x(von, sut, gen); - - u3z(von); - return ret; - } - -/* boilerplate -*/ - u3_noun - u3wfu_play(u3_noun cor) - { - u3_noun sut, gen, van; - - if ( (c3n == u3r_mean(cor, u3x_sam, &gen, u3x_con, &van, 0)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return _cqfu_play(van, sut, gen); - } - } - - u3_noun - u3qfu_play(u3_noun van, - u3_noun sut, - u3_noun gen) - { -#if 1 - c3_m fun_m = 141 + c3__play; - u3_noun vrf = u3r_at(u3qfu_van_vrf, van); - u3_noun pro = u3z_find_3(fun_m, vrf, sut, gen); - - if ( u3_none != pro ) { - return pro; - } - else { - pro = _cqfu_play(van, sut, gen); - - return u3z_save_3(fun_m, vrf, sut, gen, pro); - } -#else - return _cqfu_play(van, sut, gen); -#endif - } diff --git a/jets/stage/f/ut_repo.c b/jets/stage/f/ut_repo.c deleted file mode 100644 index 0e82bf813..000000000 --- a/jets/stage/f/ut_repo.c +++ /dev/null @@ -1,70 +0,0 @@ -/* j/6/ut_repo.c -** -*/ -#include "all.h" - - -/* logic -*/ - u3_noun - u3qfu_repo(u3_noun van, - u3_noun sut) - { - u3_noun p_sut, q_sut; - - if ( c3n == u3du(sut) ) switch ( sut ) { - default: return u3k(sut); - - case c3__noun: { - return u3kf_fork(u3nt(u3nt(c3__atom, u3_blip, u3_nul), - u3nt(c3__cell, c3__noun, c3__noun), - u3_nul)); - } - } - else switch ( u3h(sut) ) { - default: { - u3m_p("head", u3h(sut)); - return u3m_error("repo-flat"); - } - - case c3__core: { - if ( c3n == u3r_cell(u3t(sut), &p_sut, &q_sut) ) { - return u3m_bail(c3__fail); - } else { - return u3nt(c3__cell, c3__noun, u3k(p_sut)); - } - } - case c3__hint: - case c3__face: { - if ( c3n == u3r_cell(u3t(sut), &p_sut, &q_sut)) { - return u3m_bail(c3__fail); - } else { - return u3k(q_sut); - } - } - case c3__hold: { - if ( c3n == u3r_cell(u3t(sut), &p_sut, &q_sut)) { - return u3m_bail(c3__fail); - } else { - u3_noun old = u3nc(u3nc(u3k(p_sut), u3k(q_sut)), u3_nul); - u3_noun ret; - - ret = u3qfu_rest(van, sut, old); - u3z(old); - return ret; - } - } - } - } - - u3_noun - u3wfu_repo(u3_noun cor) - { - u3_noun sut; - - if ( u3_none == (sut = u3r_at(u3x_sam, cor)) ) { - return u3m_bail(c3__fail); - } else { - return u3qfu_repo(cor, sut); - } - } diff --git a/jets/stage/f/ut_rest.c b/jets/stage/f/ut_rest.c deleted file mode 100644 index 81edd85df..000000000 --- a/jets/stage/f/ut_rest.c +++ /dev/null @@ -1,114 +0,0 @@ -/* j/6/ut_rest.c -** -*/ -#include "all.h" - - -/* logic -*/ - static u3_noun - _rest_in_list(u3_noun van, - u3_noun leg) - { - if ( u3_nul == leg ) { - return u3_nul; - } else { - u3_noun i_leg = u3h(leg); - u3_noun t_leg = u3t(leg); - - return u3nc(u3qfu_play(van, u3h(i_leg), u3t(i_leg)), - _rest_in_list(van, t_leg)); - } - } - - static u3_noun - _rest_in_stil(u3_noun van, - u3_noun gar) - { - u3_noun gun = u3qdi_gas(u3_nul, gar); - u3_noun yed = u3qdi_tap(gun); - - u3z(gun); - return yed; - } - - static u3_noun - _rest_in(u3_noun van, - u3_noun leg) - { - u3_noun gar = _rest_in_list(van, leg); - u3_noun yed = _rest_in_stil(van, gar); - u3_noun fub = u3qf_fork(yed); - - u3z(gar); - u3z(yed); - - return fub; - } - - static u3_noun - _rest_hit_fan(u3_noun fan, - u3_noun leg) - { - if ( u3_nul == leg ) { - return c3n; - } else { - return c3o(u3qdi_has(fan, u3h(leg)), - _rest_hit_fan(fan, u3t(leg))); - } - } - - static u3_noun - _cqfu_rest(u3_noun van, - u3_noun sut, - u3_noun leg) - { - u3_noun fan = u3r_at(u3qfu_van_fan, van); - - if ( c3y == _rest_hit_fan(fan, leg) ) { - return u3m_error("rest-loop"); - } - else { - u3_noun naf = u3qdi_gas(fan, leg); - u3_noun nav = u3i_molt(u3k(van), u3qfu_van_fan, u3k(naf), 0); - u3_noun mez = _rest_in(nav, leg); - - u3z(naf); - u3z(nav); - return mez; - } - } - -/* boilerplate -*/ - u3_noun - u3wfu_rest(u3_noun cor) - { - u3_noun sut, leg, van; - - if ( (c3n == u3r_mean(cor, u3x_sam, &leg, u3x_con, &van, 0)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return _cqfu_rest(van, sut, leg); - } - } - - u3_noun - u3qfu_rest(u3_noun van, - u3_noun sut, - u3_noun leg) - { - c3_m fun_m = 141 + c3__rest + ((!!u3r_at(u3qfu_van_vet, van)) << 8); - u3_noun pro = u3z_find_2(fun_m, sut, leg); - - if ( u3_none != pro ) { - return pro; - } - else { - pro = _cqfu_rest(van, sut, leg); - - return u3z_save_2(fun_m, sut, leg, pro); - } - } diff --git a/jets/stage/f/ut_tack.c b/jets/stage/f/ut_tack.c deleted file mode 100644 index 9328c43ae..000000000 --- a/jets/stage/f/ut_tack.c +++ /dev/null @@ -1,21 +0,0 @@ -/* j/6/tack.c -** -*/ -#include "all.h" - - u3_noun - u3qfu_tack(u3_noun van, - u3_noun sut, - u3_noun hyp, - u3_noun mur) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_cook("u3qfu_tack-tack", von, "tack"); - - return u3n_kick_on(u3i_molt(gat, - u3x_sam_2, - u3k(hyp), - u3x_sam_3, - u3k(mur), - 0)); - } diff --git a/jets/stage/f/ut_toss.c b/jets/stage/f/ut_toss.c deleted file mode 100644 index 15973cf58..000000000 --- a/jets/stage/f/ut_toss.c +++ /dev/null @@ -1,97 +0,0 @@ -/* j/6/toss.c -** -*/ -#include "all.h" - - -/* internals -*/ - static u3_noun - _toss_in(u3_noun van, - u3_noun sut, - u3_noun peh, - u3_noun mur, - u3_noun men) - { - if ( c3n == u3du(men) ) { - return u3nc(u3_nul, u3_nul); - } - else { - u3_noun i_men = u3h(men); - u3_noun pi_men = u3h(i_men); - u3_noun qi_men = u3t(i_men); - u3_noun t_men = u3t(men); - u3_noun geq = u3qfu_tack(van, pi_men, peh, mur); - u3_noun p_geq = u3h(geq); - u3_noun q_geq = u3t(geq); - u3_noun mox = _toss_in(van, sut, peh, mur, t_men); - u3_noun p_mox = u3h(mox); - u3_noun q_mox = u3t(mox); - u3_noun ret; - - ret = u3nc( - ( (u3_nul == p_mox) - ? u3nc(u3_nul, u3k(p_geq)) - : (c3n == u3r_sing(p_geq, u3t(p_mox))) - ? u3m_bail(c3__exit) - : u3k(p_mox) ), - u3nc(u3nc(u3k(q_geq), u3k(qi_men)), u3k(q_mox))); - - u3z(mox); - u3z(geq); - return ret; - } - } - -/* functions -*/ - u3_noun - _cqfu_toss(u3_noun van, - u3_noun sut, - u3_noun peh, - u3_noun mur, - u3_noun men) - { - u3_noun wib = _toss_in(van, sut, peh, mur, men); - u3_noun p_wib = u3h(wib); - u3_noun q_wib = u3t(wib); - - if ( u3_nul == p_wib ) { - return u3m_bail(c3__exit); - } else { - u3_noun ret = u3nc(u3k(u3t(p_wib)), u3k(q_wib)); - - u3z(wib); - return ret; - } - } - -/* boilerplate -*/ - u3_noun - u3wfu_toss(u3_noun cor) - { - u3_noun van, sut, peh, mur, men; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &peh, - u3x_sam_6, &mur, - u3x_sam_7, &men, - u3x_con, &van, - 0)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return _cqfu_toss(van, sut, peh, mur, men); - } - } - - u3_noun - u3qfu_toss(u3_noun van, - u3_noun sut, - u3_noun peh, - u3_noun mur, - u3_noun men) - { - return _cqfu_toss(van, sut, peh, mur, men); - } diff --git a/jets/stage/f/ut_wrap.c b/jets/stage/f/ut_wrap.c deleted file mode 100644 index e51d3843f..000000000 --- a/jets/stage/f/ut_wrap.c +++ /dev/null @@ -1,97 +0,0 @@ -/* j/6/wrap.c -** -*/ -#include "all.h" - - static u3_noun _cqfu_wrap(u3_noun, u3_noun, u3_noun); - - static u3_noun - _wrap_fork(u3_noun van, u3_noun p_sut, u3_noun yoz) - { - if ( u3_nul == p_sut ) { - return u3_nul; - } - else { - return u3nc(_cqfu_wrap(van, u3h(p_sut), yoz), - _wrap_fork(van, u3t(p_sut), yoz)); - } - } - - static u3_noun - _cqfu_wrap(u3_noun van, - u3_noun sut, - u3_noun yoz) - { - u3_noun p_sut, q_sut; - - if ( c3n == u3du(sut) ) { - return u3m_error("wrap-type"); - } - else switch ( u3h(sut) ) { - default: return u3m_error("wrap-type"); - - case c3__core: u3x_cell(u3t(sut), &p_sut, &q_sut); - { - u3_noun pq_sut, qq_sut, rq_sut; - u3_noun ppq_sut, qpq_sut, rpq_sut; - - if ( c3n == u3r_trel(q_sut, &pq_sut, &qq_sut, &rq_sut) ) { - return u3m_bail(c3__fail); - } - if ( c3n == u3r_trel(pq_sut, &ppq_sut, &qpq_sut, &rpq_sut) ) { - return u3m_bail(c3__fail); - } - else if ( (c3__gold != rpq_sut) && - (c3__lead != yoz) ) { - return u3m_error("wrap-metal"); - } - else { - return u3nt(c3__core, - u3k(p_sut), - u3nt(u3nt(u3k(ppq_sut), u3k(qpq_sut), u3k(yoz)), - u3k(qq_sut), - u3k(rq_sut))); - } - } - case c3__fork: p_sut = u3t(sut); - { - u3_noun yed = u3qdi_tap(p_sut); - u3_noun ret = u3kf_fork(_wrap_fork(van, yed, yoz)); - - u3z(yed); - return ret; - } - case c3__hold: - { - u3_noun fop = u3qfu_repo(van, sut); - u3_noun pro = _cqfu_wrap(van, fop, yoz); - - u3z(fop); - return pro; - } - } - } - -/* boilerplate -*/ - u3_noun - u3wfu_wrap(u3_noun cor) - { - u3_noun sut, yoz, van; - - if ( (c3n == u3r_mean(cor, u3x_sam, &yoz, u3x_con, &van, 0)) || - (u3_none == (sut = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return _cqfu_wrap(van, sut, yoz); - } - } - - u3_noun - u3qfu_wrap(u3_noun van, - u3_noun sut, - u3_noun yoz) - { - return _cqfu_wrap(van, sut, yoz); - } From da7d3587a63dacd0bd1a05fa03a6d5ceac1bb4eb Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 8 Jan 2019 01:44:25 -0500 Subject: [PATCH 27/78] [CI] updates pinned arvo commit --- .travis/pin-arvo-commit.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis/pin-arvo-commit.txt b/.travis/pin-arvo-commit.txt index 6d936e53e..8d559e855 100644 --- a/.travis/pin-arvo-commit.txt +++ b/.travis/pin-arvo-commit.txt @@ -1 +1 @@ -fe643204f78131e0c805b03d2b7fbf7d619a15fc +1d2f2ff36a112bf9d81e58db75d4f8f5ec51ee66 From 93bc0c7a9732fb33a1387d3f286b2061b9eb77c0 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 8 Jan 2019 22:40:13 -0500 Subject: [PATCH 28/78] removes aliases for +hor and +vor --- include/jets/w.h | 1 - jets/tree.c | 6 ------ 2 files changed, 7 deletions(-) diff --git a/include/jets/w.h b/include/jets/w.h index 21d4d84d3..2ecb90c53 100644 --- a/include/jets/w.h +++ b/include/jets/w.h @@ -53,7 +53,6 @@ u3_noun u3wc_dvr(u3_noun); u3_noun u3wc_end(u3_noun); u3_noun u3wc_gor(u3_noun); -# define u3wc_hor u3wc_gor u3_noun u3wc_lsh(u3_noun); u3_noun u3wc_mas(u3_noun); u3_noun u3wc_met(u3_noun); diff --git a/jets/tree.c b/jets/tree.c index c2bb9b6f7..515f5dbc7 100644 --- a/jets/tree.c +++ b/jets/tree.c @@ -815,8 +815,6 @@ static u3j_harm _141_two_end_a[] = {{".2", u3wc_end, c3y}, {}}; static c3_c* _141_two_end_ha[] = {0}; static u3j_harm _141_two_gor_a[] = {{".2", u3wc_gor, c3y}, {}}; static c3_c* _141_two_gor_ha[] = {0}; -static u3j_harm _141_two_hor_a[] = {{".2", u3wc_hor, c3y}, {}}; -static c3_c* _141_two_hor_ha[] = {0}; static u3j_harm _141_two_lsh_a[] = {{".2", u3wc_lsh, c3y}, {}}; static c3_c* _141_two_lsh_ha[] = {0}; static u3j_harm _141_two_mas_a[] = {{".2", u3wc_mas, c3y}, {}}; @@ -980,7 +978,6 @@ static u3j_core _141_two_d[] = { "dvr", 7, _141_two_dvr_a, 0, _141_two_dvr_ha }, { "end", 7, _141_two_end_a, 0, _141_two_end_ha }, { "gor", 7, _141_two_gor_a, 0, _141_two_gor_ha }, - { "hor", 7, _141_two_hor_a, 0, _141_two_hor_ha }, { "jam", 7, _141_two_jam_a, 0, _141_two_jam_ha }, { "lsh", 7, _141_two_lsh_a, 0, _141_two_lsh_ha }, { "mas", 7, _141_two_mas_a, 0, _141_two_mas_ha }, @@ -1000,9 +997,6 @@ static u3j_core _141_two_d[] = { "peg", 7, _141_two_peg_a, 0, _141_two_peg_ha }, { "pow", 7, _141_two_pow_a, 0, _141_two_pow_ha }, { "sqt", 7, _141_two_sqt_a, 0, _141_two_sqt_ha }, - // temporary alias for staging +vor -> +mor - // - { "vor", 7, _141_two_mor_a, 0, _141_two_mor_ha }, { "xeb", 7, _141_two_xeb_a, 0, _141_two_xeb_ha }, { "by", 7, 0, _141_two__by_d, _141_two__by_ha }, From 91dce35acb6aa5fb565ce9c5d75fad35181ba233 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 8 Jan 2019 22:42:11 -0500 Subject: [PATCH 29/78] [CI] updates pinned arvo commit --- .travis/pin-arvo-commit.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis/pin-arvo-commit.txt b/.travis/pin-arvo-commit.txt index 8d559e855..8e4dfdaf2 100644 --- a/.travis/pin-arvo-commit.txt +++ b/.travis/pin-arvo-commit.txt @@ -1 +1 @@ -1d2f2ff36a112bf9d81e58db75d4f8f5ec51ee66 +d318b2cfcf33ac41aeaacb03e8b5593f8eb5e690 From e4a52c7568e693ea36d08d44321649c95ada15b8 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 8 Jan 2019 02:23:50 -0500 Subject: [PATCH 30/78] corrects +muk jet comment --- jets/c/muk.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jets/c/muk.c b/jets/c/muk.c index 6d7d47571..44d63ca85 100644 --- a/jets/c/muk.c +++ b/jets/c/muk.c @@ -32,10 +32,13 @@ key_y = u3a_calloc(sizeof(c3_y), len_w); } + // Efficiency: unnecessary copy. + // + // We could calculate the hash directly against + // the atom internals, a la u3r_mug + // u3r_bytes(0, len_w, key_y, key); - // XX we could skip the copy and use _mur_words() instead - // MurmurHash3_x86_32(key_y, len_w, seed_w, &out_w); u3a_free(key_y); From 8807423b01e586579946209828bb1bfa3d6d1c5e Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 8 Jan 2019 13:28:04 -0500 Subject: [PATCH 31/78] refactors u3r_mug* and some call sites --- include/noun/retrieve.h | 60 +++++++------------- noun/retrieve.c | 123 +++++++++++++++++----------------------- vere/sist.c | 20 +++---- 3 files changed, 82 insertions(+), 121 deletions(-) diff --git a/include/noun/retrieve.h b/include/noun/retrieve.h index 3c63beb72..b9a4de440 100644 --- a/include/noun/retrieve.h +++ b/include/noun/retrieve.h @@ -32,63 +32,46 @@ c3_o u3r_mean(u3_noun a, ...); - /* u3r_mug(): - ** - ** Compute and/or recall the mug (31-bit hash) of (a). + /* u3r_mug_bytes(): Compute the mug of `buf`, `len`, LSW first. */ c3_w - u3r_mug(u3_noun a); + u3r_mug_bytes(const c3_y *buf_y, + c3_w len_w); - /* u3r_mug_string(): - ** - ** Compute the mug of `a`, LSB first. + /* u3r_mug_chub(): Compute the mug of `num`, LSW first. + */ + c3_w + u3r_mug_chub(c3_d num_d); + + /* u3r_mug_string(): Compute the mug of `a`, LSB first. */ c3_w u3r_mug_string(const c3_c *a_c); - /* u3r_mug_words(): - ** - ** Compute the mug of `buf`, `len`, LSW first. + /* u3r_mug_words(): 31-bit nonzero MurmurHash3 on raw words. */ c3_w - u3r_mug_words(const c3_w *buf_w, - c3_w len_w); + u3r_mug_words(const c3_w* key_w, c3_w len_w); - /* u3r_mug_d(): - ** - ** Compute the mug of `num`, LSW first. + /* u3r_mug_both(): Join two mugs. */ c3_w - u3r_mug_d(c3_d num_d); + u3r_mug_both(c3_w lef_w, c3_w rit_w); - /* u3r_mug_bytes(): - ** - ** Compute the mug of `buf`, `len`, LSW first. - */ - c3_w - u3r_mug_bytes(const c3_y *buf_w, - c3_w len_w); - - /* u3r_mug_cell(): - ** - ** Compute the mug of `[a b]`. + /* u3r_mug_cell(): Compute the mug of the cell `[hed tel]`. */ c3_w - u3r_mug_cell(u3_noun a, - u3_noun b); + u3r_mug_cell(u3_noun hed, + u3_noun tel); - /* u3r_mug_trel(): - ** - ** Compute the mug of `[a b c]`. + /* u3r_mug_trel(): Compute the mug of `[a b c]`. */ c3_w u3r_mug_trel(u3_noun a, u3_noun b, u3_noun c); - /* u3r_mug_qual(): - ** - ** Compute the mug of `[a b c d]`. + /* u3r_mug_qual(): Compute the mug of `[a b c d]`. */ c3_w u3r_mug_qual(u3_noun a, @@ -96,13 +79,10 @@ u3_noun c, u3_noun d); - /* u3r_mug_both(): - ** - ** Join two mugs. + /* u3r_mug(): MurmurHash3 on a noun. */ c3_w - u3r_mug_both(c3_w a_w, - c3_w b_w); + u3r_mug(u3_noun veb); /* u3r_fing(): ** diff --git a/noun/retrieve.c b/noun/retrieve.c index 3ba3bc06b..b919ef47e 100644 --- a/noun/retrieve.c +++ b/noun/retrieve.c @@ -1461,17 +1461,7 @@ u3r_tape(u3_noun a) return a_y; } -/* u3r_mug_words(): 31-bit nonzero MurmurHash3 on raw words. -*/ -c3_w -u3r_mug_words(const c3_w* key_w, c3_w len_w) -{ - return u3r_mug_bytes((c3_y*)key_w, 4 * len_w); -} - -/* u3r_mug_bytes(): -** -** Compute the mug of `buf`, `len`, LSW first. +/* u3r_mug_bytes(): Compute the mug of `buf`, `len`, LSW first. */ c3_w u3r_mug_bytes(const c3_y *buf_y, @@ -1490,20 +1480,31 @@ u3r_mug_bytes(const c3_y *buf_y, return ham_w; } -/* u3r_mug_d(): -** -** Compute the mug of `num`, LSW first. -** XX rename to u3r_mug_chub +/* u3r_mug_chub(): Compute the mug of `num`, LSW first. */ c3_w -u3r_mug_d(c3_d num_d) +u3r_mug_chub(c3_d num_d) { return u3r_mug_bytes((c3_y*)&num_d, 8); } -/* u3r_mug_both(): -** -** Join two mugs. +/* u3r_mug_string(): Compute the mug of `a`, LSB first. +*/ +c3_w +u3r_mug_string(const c3_c *a_c) +{ + return u3r_mug_bytes((c3_y*)a_c, strlen(a_c)); +} + +/* u3r_mug_words(): 31-bit nonzero MurmurHash3 on raw words. +*/ +c3_w +u3r_mug_words(const c3_w* key_w, c3_w len_w) +{ + return u3r_mug_bytes((c3_y*)key_w, 4 * len_w); +} + +/* u3r_mug_both(): Join two mugs. */ c3_w u3r_mug_both(c3_w lef_w, c3_w rit_w) @@ -1513,6 +1514,39 @@ u3r_mug_both(c3_w lef_w, c3_w rit_w) return u3r_mug_words(&ham_w, (0 == ham_w) ? 0 : 1); } +/* u3r_mug_cell(): Compute the mug of the cell `[hed tel]`. +*/ +c3_w +u3r_mug_cell(u3_noun hed, + u3_noun tel) +{ + c3_w lus_w = u3r_mug(hed); + c3_w biq_w = u3r_mug(tel); + + return u3r_mug_both(lus_w, biq_w); +} + +/* u3r_mug_trel(): Compute the mug of `[a b c]`. +*/ +c3_w +u3r_mug_trel(u3_noun a, + u3_noun b, + u3_noun c) +{ + return u3r_mug_both(u3r_mug(a), u3r_mug_cell(b, c)); +} + +/* u3r_mug_qual(): Compute the mug of `[a b c d]`. +*/ +c3_w +u3r_mug_qual(u3_noun a, + u3_noun b, + u3_noun c, + u3_noun d) +{ + return u3r_mug_both(u3r_mug(a), u3r_mug_trel(b, c, d)); +} + /* u3r_mug(): MurmurHash3 on a noun. */ c3_w @@ -1548,54 +1582,3 @@ u3r_mug(u3_noun veb) return mug_w; } } - -/* u3r_mug_string(): -** -** Compute the mug of `a`, LSB first. -*/ -c3_w -u3r_mug_string(const c3_c *a_c) -{ - return u3r_mug_bytes((c3_y*)a_c, strlen(a_c)); -} - -/* u3r_mug_cell(): -** -** Compute the mug of the cell `[hed tel]`. -*/ -c3_w -u3r_mug_cell(u3_noun hed, - u3_noun tel) -{ - c3_w lus_w = u3r_mug(hed); - c3_w biq_w = u3r_mug(tel); - - return u3r_mug_both(lus_w, biq_w); -} - -/* u3r_mug_trel(): -** -** Compute the mug of `[a b c]`. -*/ -c3_w -u3r_mug_trel(u3_noun a, - u3_noun b, - u3_noun c) -{ - return u3r_mug_both(u3r_mug(a), u3r_mug_both(u3r_mug(b), u3r_mug(c))); -} - -/* u3r_mug_qual(): -** -** Compute the mug of `[a b c d]`. -*/ -c3_w -u3r_mug_qual(u3_noun a, - u3_noun b, - u3_noun c, - u3_noun d) -{ - return u3r_mug_both(u3r_mug(a), - u3r_mug_both(u3r_mug(b), - u3r_mug_both(u3r_mug(c), u3r_mug(d)))); -} diff --git a/vere/sist.c b/vere/sist.c index a0a466595..b4103f0e6 100644 --- a/vere/sist.c +++ b/vere/sist.c @@ -31,10 +31,10 @@ u3_sist_pack(c3_w tem_w, c3_w typ_w, c3_w* bob_w, c3_w len_w) lar_u.tem_w = tem_w; lar_u.typ_w = typ_w; - lar_u.syn_w = u3r_mug_d(tar_d); + lar_u.syn_w = u3r_mug_chub(tar_d); lar_u.mug_w = u3r_mug_both(u3r_mug_words(bob_w, len_w), - u3r_mug_both(u3r_mug(lar_u.tem_w), - u3r_mug(lar_u.typ_w))); + u3r_mug_both(u3r_mug_words(&lar_u.tem_w, 1), + u3r_mug_words(&lar_u.typ_w, 1))); lar_u.ent_d = u3A->ent_d; u3A->ent_d++; lar_u.len_w = len_w; @@ -625,7 +625,7 @@ _sist_rest_nuu(u3_ulog* lug_u, u3_uled led_u, c3_c* old_c) u3_lo_bail(); } - if ( lar_u.syn_w != u3r_mug_d(tar_d) ) { + if ( lar_u.syn_w != u3r_mug_chub(tar_d) ) { uL(fprintf(uH, "rest_nuu failed (d)\n")); u3_lo_bail(); } @@ -690,9 +690,7 @@ _sist_rest_nuu(u3_ulog* lug_u, u3_uled led_u, c3_c* old_c) lar_u.ent_d = ent_d; lar_u.tem_w = 0; lar_u.typ_w = c3__ov; - lar_u.mug_w = u3r_mug_both(u3r_mug(ovo), - u3r_mug_both(u3r_mug(0), - u3r_mug(c3__ov))); + lar_u.mug_w = u3r_mug_trel(ovo, u3_nul, c3__ov); img_w = c3_malloc(lar_u.len_w << 2); u3r_words(0, lar_u.len_w, img_w, ovo); @@ -876,12 +874,12 @@ _sist_rest() u3_lo_bail(); } - if ( lar_u.syn_w != u3r_mug_d(tar_d) ) { + if ( lar_u.syn_w != u3r_mug_chub(tar_d) ) { if ( c3n == rup ) { uL(fprintf(uH, "corruption detected; attempting to fix\n")); rup = c3y; } - uL(fprintf(uH, "lar:%x mug:%x\n", lar_u.syn_w, u3r_mug_d(tar_d))); + uL(fprintf(uH, "lar:%x mug:%x\n", lar_u.syn_w, u3r_mug_chub(tar_d))); end_d--; u3Z->lug_u.len_d--; continue; } @@ -936,8 +934,8 @@ _sist_rest() if ( lar_u.mug_w != u3r_mug_both(u3r_mug(ron), - u3r_mug_both(u3r_mug(lar_u.tem_w), - u3r_mug(lar_u.typ_w))) ) + u3r_mug_both(u3r_mug_words(&lar_u.tem_w, 1), + u3r_mug_words(&lar_u.typ_w, 1))) ) { uL(fprintf(uH, "record (%s) is corrupt (j)\n", ful_c)); u3_lo_bail(); From e14e2aabbccc64820325ce70b9e1ec3d98a06f37 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Wed, 9 Jan 2019 00:15:22 -0500 Subject: [PATCH 32/78] globally disable hashboard (pending actual hashes) --- vere/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vere/main.c b/vere/main.c index 9aebe6fef..43e978d97 100644 --- a/vere/main.c +++ b/vere/main.c @@ -80,7 +80,10 @@ _main_getopt(c3_i argc, c3_c** argv) u3_Host.ops_u.etn = c3n; u3_Host.ops_u.gab = c3n; u3_Host.ops_u.git = c3n; - u3_Host.ops_u.has = c3n; + // always disable hashboard + // XX temporary, remove once hashes are added + // + u3_Host.ops_u.has = c3y; u3_Host.ops_u.net = c3y; u3_Host.ops_u.nuu = c3n; u3_Host.ops_u.pro = c3n; From a8c19d9bae9aebb2263c853fe160c2a09286319f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C5=8Dshin?= Date: Fri, 4 Jan 2019 14:15:23 -0800 Subject: [PATCH 33/78] c3_rand cleanup This should work on Linux since kernel 3.17, OS X since 10.12, OpenBSD since 5.6, and FreeBSD since 12.0. It also introduces no external dependencies. Note that getentropy should only be called with at most 256 bytes or it will return EIO. The getrandom variant on Linux doesn't check for this. If called with len > 256, it's allowed to produce a short read if it gets interrupted. This should show up as an error, so everything's fine. --- include/c/defs.h | 5 +++++ include/c/portable.h | 11 ++++++++++- include/vere/vere.h | 5 ----- vere/sist.c | 24 +++++------------------- 4 files changed, 20 insertions(+), 25 deletions(-) diff --git a/include/c/defs.h b/include/c/defs.h index 4f4ba37b7..1ffb16514 100644 --- a/include/c/defs.h +++ b/include/c/defs.h @@ -55,6 +55,11 @@ int c3_cooked(); + /* Fill 16 words (64 bytes) with high-quality entropy. + */ + void + c3_rand(c3_w* rad_w); + /* Short integers. */ # define c3_s1(a) ( (a) ) diff --git a/include/c/portable.h b/include/c/portable.h index 7595921a9..d4ac5ac7e 100644 --- a/include/c/portable.h +++ b/include/c/portable.h @@ -33,6 +33,7 @@ # include # include # include +# include # include # include # include @@ -50,6 +51,7 @@ # include # include # include +# include # include # include # include @@ -188,7 +190,14 @@ /* Entropy */ -#define c3_rand u3_sist_rand +# if defined(U3_OS_linux) +# define c3_getentropy(B, L) \ + ((L) == syscall(SYS_getrandom, B, L, 0) ? 0 : -1) +# elif defined(U3_OS_bsd) || defined(U3_OS_osx) +# define c3_getentropy getentropy +# else +# error "port: getentropy" +# endif /* Static assertion */ diff --git a/include/vere/vere.h b/include/vere/vere.h index fe54c6f3a..c701a4b22 100644 --- a/include/vere/vere.h +++ b/include/vere/vere.h @@ -1180,11 +1180,6 @@ void u3_sist_get(const c3_c* key_c, c3_y* val_y); - /* u3_sist_rand(): fill 8 words (32 bytes) with high-quality entropy. - */ - void - u3_sist_rand(c3_w* rad_w); - /** HTTP client. **/ /* u3_cttp_ef_thus(): send %thus effect to cttp. diff --git a/vere/sist.c b/vere/sist.c index 04f32f659..ef9bd2087 100644 --- a/vere/sist.c +++ b/vere/sist.c @@ -12,12 +12,6 @@ #include "all.h" #include "vere/vere.h" -#if defined(U3_OS_linux) -#define DEVRANDOM "/dev/urandom" -#else -#define DEVRANDOM "/dev/random" -#endif - /* u3_sist_pack(): write a blob to disk, transferring. */ c3_d @@ -411,23 +405,15 @@ _sist_bask(c3_c* pop_c, u3_noun may) } #endif -/* u3_sist_rand(): fill a 512-bit (16-word) buffer. +/* c3_rand(): fill a 512-bit (16-word) buffer. */ void -u3_sist_rand(c3_w* rad_w) +c3_rand(c3_w* rad_w) { -#if defined(U3_OS_bsd) && defined(__OpenBSD__) - if (-1 == getentropy(rad_w, 64)) { - c3_assert(!"lo_rand"); + if ( 0 != c3_getentropy(rad_w, 64) ) { + uL(fprintf(uH, "c3_rand getentropy: %s\n", strerror(errno))); + u3_lo_bail(); } -#else - c3_i fid_i = open(DEVRANDOM, O_RDONLY); - - if ( 64 != read(fid_i, (c3_y*) rad_w, 64) ) { - c3_assert(!"lo_rand"); - } - close(fid_i); -#endif } /* _sist_fast(): offer to save passcode by mug in home directory. From e253be75cc8b7243a3526b1ba330cef744f9ab4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C5=8Dshin?= Date: Fri, 4 Jan 2019 14:44:23 -0800 Subject: [PATCH 34/78] Consistent indentation in portable.h Also remove the gcc/C99 comment. --- include/c/portable.h | 173 +++++++++++++++++++++---------------------- 1 file changed, 85 insertions(+), 88 deletions(-) diff --git a/include/c/portable.h b/include/c/portable.h index d4ac5ac7e..2314e7ded 100644 --- a/include/c/portable.h +++ b/include/c/portable.h @@ -2,17 +2,15 @@ ** ** This file is in the public domain. */ - /** Must be compiled on gcc with C99 support. - **/ #include "config.h" -# ifndef __GNUC__ -# error "port me" -# endif -# ifndef _GNU_SOURCE -# define _GNU_SOURCE -# endif +# ifndef __GNUC__ +# error "port me" +# endif +# ifndef _GNU_SOURCE +# define _GNU_SOURCE +# endif /** System include files. @@ -79,26 +77,26 @@ /** Address space layout. **/ -# if defined(U3_OS_linux) -# define U3_OS_LoomBase 0x36000000 -# define U3_OS_LoomBits 29 // ie, 2^29 words == 2GB -# elif defined(U3_OS_osx) -# ifdef __LP64__ -# define U3_OS_LoomBase 0x200000000 +# if defined(U3_OS_linux) +# define U3_OS_LoomBase 0x36000000 +# define U3_OS_LoomBits 29 // ie, 2^29 words == 2GB +# elif defined(U3_OS_osx) +# ifdef __LP64__ +# define U3_OS_LoomBase 0x200000000 +# else +# define U3_OS_LoomBase 0x4000000 +# endif +# define U3_OS_LoomBits 29 // ie, 2^29 words == 2GB +# elif defined(U3_OS_bsd) +# ifdef __LP64__ +# define U3_OS_LoomBase 0x200000000 +# else +# define U3_OS_LoomBase 0x4000000 +# endif +# define U3_OS_LoomBits 29 // ie, 2^29 words == 2GB # else -# define U3_OS_LoomBase 0x4000000 +# error "port: LoomBase" # endif -# define U3_OS_LoomBits 29 // ie, 2^29 words == 2GB -# elif defined(U3_OS_bsd) -# ifdef __LP64__ -# define U3_OS_LoomBase 0x200000000 -# else -# define U3_OS_LoomBase 0x4000000 -# endif -# define U3_OS_LoomBits 29 // ie, 2^29 words == 2GB -# else -# error "port: LoomBase" -# endif /** Global variable control. *** @@ -114,7 +112,7 @@ /* The GMP (GNU arbitrary-precision arithmetic) library. ** (Tested with version 4.0.1.) */ -# include +# include /** Private C "extensions." @@ -138,70 +136,69 @@ /* Byte swapping. */ -# if defined(U3_OS_linux) || defined(U3_OS_bsd) -# define c3_bswap_16(x) bswap_16(x) -# define c3_bswap_32(x) bswap_32(x) -# define c3_bswap_64(x) bswap_64(x) +# if defined(U3_OS_linux) || defined(U3_OS_bsd) +# define c3_bswap_16(x) bswap_16(x) +# define c3_bswap_32(x) bswap_32(x) +# define c3_bswap_64(x) bswap_64(x) +# elif defined(U3_OS_osx) +# define c3_bswap_16(x) NXSwapShort(x) +# define c3_bswap_32(x) NXSwapInt(x) +# define c3_bswap_64(x) NXSwapLongLong(x) +# else +# error "port: byte swap" +# endif -# elif defined(U3_OS_osx) -# define c3_bswap_16(x) NXSwapShort(x) -# define c3_bswap_32(x) NXSwapInt(x) -# define c3_bswap_64(x) NXSwapLongLong(x) -# else -# error "port: byte swap" -# endif + /* Sync. + */ +# if defined(U3_OS_linux) +# define c3_sync(fd) (fdatasync(fd)) +# elif defined(U3_OS_osx) +# define c3_sync(fd) (fcntl(fd, F_FULLFSYNC, 0)) +# elif defined(U3_OS_bsd) +# define c3_sync(fd) (fsync(fd)) +# else +# error "port: sync" +# endif -/* Sync - */ -# if defined(U3_OS_linux) -# define c3_sync(fd) (fdatasync(fd)) -# elif defined(U3_OS_osx) -# define c3_sync(fd) (fcntl(fd, F_FULLFSYNC, 0)) -# elif defined(U3_OS_bsd) -# define c3_sync(fd) (fsync(fd)) -# else -# error "port: sync" -# endif + /* Purge. + */ +# if defined(U3_OS_linux) +# include +# define c3_fpurge __fpurge +# elif defined(U3_OS_bsd) || defined(U3_OS_osx) +# define c3_fpurge fpurge +# else +# error "port: fpurge" +# endif -/* Purge - */ -# if defined(U3_OS_linux) -# include -# define c3_fpurge __fpurge -# elif defined(U3_OS_bsd) || defined(U3_OS_osx) -# define c3_fpurge fpurge -# else -# error "port: fpurge" -# endif + /* Stat. + */ +# if defined(U3_OS_linux) +# define c3_stat_mtime(dp) (u3_time_t_in_ts((dp)->st_mtime)) +# elif defined(U3_OS_osx) +# define c3_stat_mtime(dp) (u3_time_in_ts(&((dp)->st_mtimespec))) +# define lseek64 lseek +# elif defined(U3_OS_bsd) +# define c3_stat_mtime(dp) (u3_time_in_ts(&((dp)->st_mtim))) +# define lseek64 lseek +# else +# error "port: timeconvert" +# endif -/* Stat struct - */ -# if defined(U3_OS_linux) -# define c3_stat_mtime(dp) (u3_time_t_in_ts((dp)->st_mtime)) -# elif defined(U3_OS_osx) -# define c3_stat_mtime(dp) (u3_time_in_ts(&((dp)->st_mtimespec))) -# define lseek64 lseek -# elif defined(U3_OS_bsd) -# define c3_stat_mtime(dp) (u3_time_in_ts(&((dp)->st_mtim))) -# define lseek64 lseek -# else -# error "port: timeconvert" -# endif + /* Entropy. + */ +# if defined(U3_OS_linux) +# define c3_getentropy(B, L) \ + ((L) == syscall(SYS_getrandom, B, L, 0) ? 0 : -1) +# elif defined(U3_OS_bsd) || defined(U3_OS_osx) +# define c3_getentropy getentropy +# else +# error "port: getentropy" +# endif -/* Entropy - */ -# if defined(U3_OS_linux) -# define c3_getentropy(B, L) \ - ((L) == syscall(SYS_getrandom, B, L, 0) ? 0 : -1) -# elif defined(U3_OS_bsd) || defined(U3_OS_osx) -# define c3_getentropy getentropy -# else -# error "port: getentropy" -# endif - -/* Static assertion - */ -#define ASSERT_CONCAT_(a, b) a##b -#define ASSERT_CONCAT(a, b) ASSERT_CONCAT_(a, b) -#define STATIC_ASSERT(e,m) \ + /* Static assertion. + */ +# define ASSERT_CONCAT_(a, b) a##b +# define ASSERT_CONCAT(a, b) ASSERT_CONCAT_(a, b) +# define STATIC_ASSERT(e,m) \ ;enum { ASSERT_CONCAT(assert_line_, __LINE__) = 1/(int)(!!(e)) } From 23cc08d2242745150fef6930e8ff23476f1c2aa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C5=8Dshin?= Date: Fri, 4 Jan 2019 14:48:54 -0800 Subject: [PATCH 35/78] xenial in .travis.yml Necessitates pulling in setuptools and wheel explicitly so meson can build. --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 3c645ce07..32b5bd9f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,4 @@ +dist: xenial language: node_js node_js: - 4 @@ -32,6 +33,8 @@ addons: packages: - python3 - python3-pip + - python3-setuptools + - python3-wheel - libgmp3-dev - libsigsegv-dev - openssl From b16f61a11e6aebfa06bdb1dff4137f971f2ce2ad Mon Sep 17 00:00:00 2001 From: Isaac Visintainer Date: Wed, 9 Jan 2019 16:38:39 -0800 Subject: [PATCH 36/78] bumped up buffer size because it was failing upon pasting exactly 64 bytes into dojo --- vere/term.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vere/term.c b/vere/term.c index 1550797e4..e83a9b6e2 100644 --- a/vere/term.c +++ b/vere/term.c @@ -50,10 +50,11 @@ _term_alloc(uv_handle_t* had_u, ) { // this read can range from a single byte to a paste buffer - // 32 bytes has been chosen heuristically + // 123 bytes has been chosen because its not a power of 2 + // this is probably still broken // - void* ptr_v = c3_malloc(32); - *buf = uv_buf_init(ptr_v, 32); + void* ptr_v = c3_malloc(123); + *buf = uv_buf_init(ptr_v, 123); } From 87e52f27c4e476e43caea0e184864f524d10688a Mon Sep 17 00:00:00 2001 From: Isaac Visintainer Date: Wed, 9 Jan 2019 17:07:39 -0800 Subject: [PATCH 37/78] bump urbit version --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index d62e1067e..da71dbfeb 100644 --- a/meson.build +++ b/meson.build @@ -236,7 +236,7 @@ endforeach incdir = include_directories('include/') conf_data = configuration_data() -conf_data.set('URBIT_VERSION', '"0.6.0"') +conf_data.set('URBIT_VERSION', '"0.7.0"') conf_data.set('U3_MEMORY_DEBUG', get_option('gc')) conf_data.set('U3_CPU_DEBUG', get_option('prof')) conf_data.set('U3_EVENT_TIME_DEBUG', get_option('event-time')) From 671dfa6647bfc9220ca9811ed463c09c22aab8a9 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Thu, 10 Jan 2019 02:39:05 -0500 Subject: [PATCH 38/78] updates terminal read callback to shutdown gracefully on EOF --- vere/term.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/vere/term.c b/vere/term.c index 1550797e4..ca6a5bda9 100644 --- a/vere/term.c +++ b/vere/term.c @@ -721,8 +721,15 @@ _term_suck(u3_utty* uty_u, const c3_y* buf, ssize_t siz_i) u3_lo_open(); { if ( siz_i == UV_EOF ) { - // nothing - } else if ( siz_i < 0 ) { + // We hear EOF (on the third read callback) if + // 2x the _term_alloc() buffer size is pasted. + // The process hangs if we do nothing (and ctrl-z + // then corrupts the event log), so we force shutdown. + // + fprintf(stderr, "term: hangup (EOF)\r\n"); + u3_lo_bail(); + } + else if ( siz_i < 0 ) { uL(fprintf(uH, "term %d: read: %s\n", uty_u->tid_l, uv_strerror(siz_i))); } else { From 46da7e6739aba106625d36376e9a8be29639f91c Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Thu, 10 Jan 2019 13:15:01 -0500 Subject: [PATCH 39/78] backports u3r_chubs from cc-release --- include/noun/retrieve.h | 10 ++++++++++ noun/retrieve.c | 15 +++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/include/noun/retrieve.h b/include/noun/retrieve.h index b9a4de440..4a9398c0b 100644 --- a/include/noun/retrieve.h +++ b/include/noun/retrieve.h @@ -402,6 +402,16 @@ c3_w* c_w, u3_atom d); + /* u3r_chubs(): + ** + ** Copy double-words (a_w) through (a_w + b_w - 1) from (d) to (c). + */ + void + u3r_chubs(c3_w a_w, + c3_w b_w, + c3_d* c_d, + u3_atom d); + /* u3r_string(): `a`, a text atom, as malloced C string. */ c3_c* diff --git a/noun/retrieve.c b/noun/retrieve.c index b919ef47e..d106034e8 100644 --- a/noun/retrieve.c +++ b/noun/retrieve.c @@ -1352,6 +1352,21 @@ u3r_words(c3_w a_w, } } +/* u3r_chubs(): +** +** Copy double-words (a_w) through (a_w + b_w - 1) from (d) to (c). +*/ +void +u3r_chubs(c3_w a_w, + c3_w b_w, + c3_d* c_d, + u3_atom d) +{ + /* XX: assumes little-endian + */ + u3r_words(a_w * 2, b_w * 2, (c3_w *)c_d, d); +} + /* u3r_chop(): ** ** Into the bloq space of `met`, from position `fum` for a From 4c92b65d1f428b80852931c08a852a235e49fb50 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Thu, 10 Jan 2019 13:41:52 -0500 Subject: [PATCH 40/78] refactors u3_ward/u3_warc lifecycle, preventing potential leaks --- include/vere/vere.h | 4 +-- vere/http.c | 65 +++++++++++++++++++++------------------------ 2 files changed, 32 insertions(+), 37 deletions(-) diff --git a/include/vere/vere.h b/include/vere/vere.h index fe54c6f3a..d5f031cac 100644 --- a/include/vere/vere.h +++ b/include/vere/vere.h @@ -133,7 +133,7 @@ c3_w ipf_w; // ward ip c3_s por_s; // ward port c3_o sec; // secure connection - u3_atom sip; // ward ship + c3_d who_d[2]; // ward ship c3_c* hot_c; // ward hostname uv_buf_t non_u; // nonce struct _u3_http* htp_u; // local server backlink @@ -154,7 +154,7 @@ typedef struct _u3_ward { uv_tcp_t tcp_u; // listener handle uv_timer_t tim_u; // expiration timer - u3_atom sip; // reverse proxy for ship + c3_d who_d[2]; // reverse proxy for ship c3_s por_s; // listening on port uv_buf_t non_u; // nonce struct _u3_wcon* won_u; // candidate upstream connections diff --git a/vere/http.c b/vere/http.c index e0ee698ca..25e887f40 100644 --- a/vere/http.c +++ b/vere/http.c @@ -1652,22 +1652,32 @@ _proxy_warc_free(u3_warc* cli_u) /* _proxy_warc_new(): allocate ship-specific proxy client */ static u3_warc* -_proxy_warc_new(u3_http* htp_u, u3_atom sip, c3_s por_s, c3_o sec) +_proxy_warc_new(u3_http* htp_u, u3_atom sip, u3_atom non, c3_s por_s, c3_o sec) { - u3_warc* cli_u = c3_malloc(sizeof(*cli_u)); + u3_warc* cli_u = c3_calloc(sizeof(*cli_u)); cli_u->htp_u = htp_u; cli_u->por_s = por_s; - // XX set here instead of u3_http_ef_that() ? - cli_u->non_u = uv_buf_init(0, 0); - cli_u->sip = sip; cli_u->sec = sec; - // XX set here instead of _proxy_ward_resolve() ? - cli_u->hot_c = 0; - cli_u->nex_u = 0; - cli_u->pre_u = 0; + u3r_chubs(0, 2, cli_u->who_d, sip); _proxy_warc_link(cli_u); + { + c3_w len_w = u3r_met(3, non); + + c3_assert( 256 > len_w ); + + c3_y* non_y = c3_malloc(1 + len_w); + non_y[0] = (c3_y)len_w; + + u3r_bytes(0, len_w, non_y + 1, non); + + cli_u->non_u = uv_buf_init((c3_c*)non_y, 1 + len_w); + } + + u3z(non); + u3z(sip); + return cli_u; } @@ -2133,7 +2143,6 @@ _proxy_ward_free(uv_handle_t* han_u) { u3_ward* rev_u = han_u->data; - u3z(rev_u->sip); free(rev_u->non_u.base); free(rev_u); } @@ -2168,18 +2177,16 @@ _proxy_ward_close(u3_ward* rev_u) static u3_ward* _proxy_ward_new(u3_pcon* con_u, u3_atom sip) { - u3_ward* rev_u = c3_malloc(sizeof(*rev_u)); + u3_ward* rev_u = c3_calloc(sizeof(*rev_u)); rev_u->tcp_u.data = rev_u; rev_u->tim_u.data = rev_u; rev_u->con_u = con_u; - rev_u->sip = sip; - rev_u->por_s = 0; // set after opened - rev_u->won_u = 0; - rev_u->nex_u = 0; - rev_u->pre_u = 0; + u3r_chubs(0, 2, rev_u->who_d, sip); _proxy_ward_link(con_u, rev_u); + u3z(sip); + return rev_u; } @@ -2293,7 +2300,7 @@ _proxy_ward_plan(u3_ward* rev_u) u3_noun pax = u3nq(u3_blip, c3__http, c3__prox, u3nc(u3k(u3A->sen), u3_nul)); - u3_noun wis = u3nc(c3__wise, u3nq(u3k(rev_u->sip), + u3_noun wis = u3nc(c3__wise, u3nq(u3i_chubs(2, rev_u->who_d), rev_u->por_s, u3k(rev_u->con_u->sec), u3i_words(16, (c3_w*)rev_u->non_u.base))); @@ -2305,7 +2312,7 @@ _proxy_ward_plan(u3_ward* rev_u) static void _proxy_ward_start(u3_pcon* con_u, u3_noun sip) { - u3_ward* rev_u = _proxy_ward_new(con_u, sip); + u3_ward* rev_u = _proxy_ward_new(con_u, u3k(sip)); uv_tcp_init(u3L, &rev_u->tcp_u); @@ -2355,6 +2362,8 @@ _proxy_ward_start(u3_pcon* con_u, u3_noun sip) // XX u3_lo_shut(c3y); } + + u3z(sip); } /* _proxy_ward_connect_cb(): ward connection callback @@ -2455,7 +2464,7 @@ _proxy_ward_resolve(u3_warc* cli_u) // XX revisit c3_assert( 0 != u3_Host.sam_u.dns_c ); - u3_noun sip = u3dc("scot", 'p', u3k(cli_u->sip)); + u3_noun sip = u3dc("scot", 'p', u3i_chubs(2, cli_u->who_d)); c3_c* sip_c = u3r_string(sip); c3_w len_w = 1 + strlen(sip_c) + strlen(u3_Host.sam_u.dns_c); cli_u->hot_c = c3_malloc(len_w); @@ -2613,7 +2622,6 @@ _proxy_dest(u3_pcon* con_u, u3_noun sip) else { // XX check if (sein:title sip) == our // XX check will - // XX extract bytes from hip, this could leak _proxy_ward_start(con_u, u3k(hip)); } } @@ -2875,21 +2883,8 @@ u3_http_ef_that(u3_noun tat) return; } - // XX extract bytes from sip, this could leak - cli_u = _proxy_warc_new(htp_u, (u3_atom)sip, (c3_s)por, (c3_o)sec); - - // XX add to constructor - c3_w len_w = u3r_met(3, non); - - c3_assert( 256 > len_w ); - - c3_y* non_y = c3_malloc(1 + len_w); - non_y[0] = (c3_y)len_w; - - u3r_bytes(0, len_w, non_y + 1, non); - - cli_u->non_u = uv_buf_init((c3_c*)non_y, 1 + len_w); - + cli_u = _proxy_warc_new(htp_u, (u3_atom)u3k(sip), (u3_atom)u3k(non), + (c3_s)por, (c3_o)sec); if ( c3n == u3_Host.ops_u.net ) { cli_u->ipf_w = INADDR_LOOPBACK; From e31ea32519fc7914edf55aadff2fb57145a3702d Mon Sep 17 00:00:00 2001 From: Robert Date: Thu, 10 Jan 2019 11:22:02 -0800 Subject: [PATCH 41/78] adds realpath() for printing absolute path --- vere/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vere/main.c b/vere/main.c index bcbb37029..094f84c02 100644 --- a/vere/main.c +++ b/vere/main.c @@ -51,7 +51,7 @@ static c3_c hostbuf[2048]; // kill me /* _main_presig(): prefix optional sig. */ -c3_c* +c3_c* _main_presig(c3_c* txt_c) { c3_c* new_c = malloc(2 + strlen(txt_c)); @@ -554,7 +554,7 @@ main(c3_i argc, mprint_i *= 2; abs_c = (c3_c *)malloc(mprint_i); } - printf("boot: home is %s/%s\n", abs_c, u3_Host.dir_c); + printf("boot: home is %s/%s\n", realpath(abs_c, NULL), u3_Host.dir_c); free(abs_c); // printf("vere: hostname is %s\n", u3_Host.ops_u.nam_c); @@ -598,7 +598,7 @@ main(c3_i argc, if ( _(u3_Host.ops_u.qui) ) { u3C.wag_w |= u3o_quiet; } - + /* Set dry-run flag. */ if ( _(u3_Host.ops_u.dry) ) { From 9f6300b79bf196122bc4f5aabf373ecc913d1c9d Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Thu, 10 Jan 2019 14:16:26 -0500 Subject: [PATCH 42/78] refactors and comments u3_http_ef_that() --- vere/http.c | 54 +++++++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/vere/http.c b/vere/http.c index 25e887f40..b2e5b9cb3 100644 --- a/vere/http.c +++ b/vere/http.c @@ -2863,37 +2863,39 @@ u3_http_ef_that(u3_noun tat) !( c3y == sec || c3n == sec ) || ( c3n == u3ud(non) ) ) { uL(fprintf(uH, "http: that: invalid card\n")); - u3z(tat); - return; } + else { + u3_http* htp_u; + u3_warc* cli_u; - u3_http* htp_u; - u3_warc* cli_u; + for ( htp_u = u3_Host.htp_u; (0 != htp_u); htp_u = htp_u->nex_u ) { + if ( c3n == htp_u->lop && sec == htp_u->sec ) { + break; + } + } - for ( htp_u = u3_Host.htp_u; (0 != htp_u); htp_u = htp_u->nex_u ) { - if ( c3n == htp_u->lop && sec == htp_u->sec ) { - break; + // XX we should inform our sponsor if we aren't running a server + // so this situation can be avoided + // + if ( 0 == htp_u ) { + uL(fprintf(uH, "http: that: no %s server\n", (c3y == sec) ? + "secure" : "insecure")); + } + else { + cli_u = _proxy_warc_new(htp_u, (u3_atom)u3k(sip), (u3_atom)u3k(non), + (c3_s)por, (c3_o)sec); + + // resolve to loopback if networking is disabling + // + if ( c3n == u3_Host.ops_u.net ) { + cli_u->ipf_w = INADDR_LOOPBACK; + _proxy_ward_connect(cli_u); + } + else { + _proxy_ward_resolve(cli_u); + } } } - if ( 0 == htp_u ) { - uL(fprintf(uH, "http: that: no %s server\n", (c3y == sec) ? - "secure" : "insecure")); - u3z(tat); - return; - } - - cli_u = _proxy_warc_new(htp_u, (u3_atom)u3k(sip), (u3_atom)u3k(non), - (c3_s)por, (c3_o)sec); - - if ( c3n == u3_Host.ops_u.net ) { - cli_u->ipf_w = INADDR_LOOPBACK; - _proxy_ward_connect(cli_u); - u3z(tat); - return; - } - - _proxy_ward_resolve(cli_u); - u3z(tat); } From a20508b49d46f7307157af117549c1733e400321 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Thu, 10 Jan 2019 15:03:19 -0500 Subject: [PATCH 43/78] hardcodes tcp proxy domain --- vere/http.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/vere/http.c b/vere/http.c index b2e5b9cb3..94bd4bf6e 100644 --- a/vere/http.c +++ b/vere/http.c @@ -41,6 +41,10 @@ static void _http_form_free(void); static const c3_i TCP_BACKLOG = 16; +// XX temporary, add to u3_http_ef_form +// +#define PROXY_DOMAIN "arvo.network" + /* _http_vec_to_meth(): convert h2o_iovec_t to meth */ static u3_weak @@ -2460,16 +2464,15 @@ _proxy_ward_resolve(u3_warc* cli_u) hin_u.ai_socktype = SOCK_STREAM; hin_u.ai_protocol = IPPROTO_TCP; + // XX why the conditional? + // if ( 0 == cli_u->hot_c ) { - // XX revisit - c3_assert( 0 != u3_Host.sam_u.dns_c ); - u3_noun sip = u3dc("scot", 'p', u3i_chubs(2, cli_u->who_d)); c3_c* sip_c = u3r_string(sip); - c3_w len_w = 1 + strlen(sip_c) + strlen(u3_Host.sam_u.dns_c); + c3_w len_w = 1 + strlen(sip_c) + strlen(PROXY_DOMAIN); cli_u->hot_c = c3_malloc(len_w); // incremented to skip '~' - snprintf(cli_u->hot_c, len_w, "%s.%s", sip_c + 1, u3_Host.sam_u.dns_c); + snprintf(cli_u->hot_c, len_w, "%s.%s", sip_c + 1, PROXY_DOMAIN); free(sip_c); u3z(sip); From 280ff8725192a82cab864698e1d682aa0764cdf8 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Thu, 10 Jan 2019 13:42:30 -0500 Subject: [PATCH 44/78] refactors proxy domain parsing and validation --- vere/http.c | 68 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 30 deletions(-) diff --git a/vere/http.c b/vere/http.c index 94bd4bf6e..0e74174ed 100644 --- a/vere/http.c +++ b/vere/http.c @@ -2566,45 +2566,52 @@ _proxy_parse_sni(const uv_buf_t* buf_u, c3_c** hot_c) return u3_pars_good; } -/* _proxy_parse_ship(): determine destination for proxied request +/* _proxy_parse_ship(): determine destination (unit ship) for proxied request */ static u3_noun _proxy_parse_ship(c3_c* hot_c) { - u3_noun sip = u3_nul; - c3_c* dom_c; - if ( 0 == hot_c ) { - return sip; + return u3_nul; } + else { + c3_c* dom_c = strchr(hot_c, '.'); - dom_c = strchr(hot_c, '.'); + if ( 0 == dom_c ) { + return u3_nul; + } + else { + // length of the first subdomain + // + c3_w dif_w = dom_c - hot_c; + c3_w dns_w = strlen(PROXY_DOMAIN); - if ( 0 == dom_c ) { - return sip; - } + // validate that everything after the first subdomain + // matches the proxy domain + // (skipped if networking is disabled) + // + if ( (c3y == u3_Host.ops_u.net) && + ( (dns_w != strlen(hot_c) - (dif_w + 1)) || + (0 != strncmp(dom_c + 1, PROXY_DOMAIN, dns_w)) ) ) + { + return u3_nul; + } + else { + // attempt to parse the first subdomain as a @p + // + u3_noun sip; + c3_c* sip_c = c3_malloc(2 + dif_w); - // XX revisit - c3_assert( 0 != u3_Host.sam_u.dns_c ); + strncpy(sip_c + 1, hot_c, dif_w); + sip_c[0] = '~'; + sip_c[1 + dif_w] = 0; - c3_w dif_w = dom_c - hot_c; - c3_w dns_w = strlen(u3_Host.sam_u.dns_c); + sip = u3dc("slaw", 'p', u3i_string(sip_c)); + free(sip_c); - if ( (dns_w != strlen(hot_c) - (dif_w + 1)) || - (0 != strncmp(dom_c + 1, u3_Host.sam_u.dns_c, dns_w)) ) { - return sip; - } - - { - c3_c* sip_c = c3_malloc(2 + dif_w); - strncpy(sip_c + 1, hot_c, dif_w); - sip_c[0] = '~'; - sip_c[1 + dif_w] = 0; - - sip = u3dc("slaw", 'p', u3i_string(sip_c)); - free(sip_c); - - return sip; + return sip; + } + } } } @@ -2623,8 +2630,9 @@ _proxy_dest(u3_pcon* con_u, u3_noun sip) _proxy_loop_connect(con_u); } else { - // XX check if (sein:title sip) == our - // XX check will + // XX we should u3v_peek %j /=sein= to confirm + // that we're sponsoring this ship + // _proxy_ward_start(con_u, u3k(hip)); } } From 4c3d9f2b1e8bdb441afcbd57d55e6e1e76b8ec3e Mon Sep 17 00:00:00 2001 From: Robert Date: Thu, 10 Jan 2019 14:23:02 -0800 Subject: [PATCH 45/78] adds better way to print absolute path --- vere/main.c | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/vere/main.c b/vere/main.c index 094f84c02..05c1ae231 100644 --- a/vere/main.c +++ b/vere/main.c @@ -544,18 +544,31 @@ main(c3_i argc, printf("~\n"); // printf("welcome.\n"); printf("urbit %s\n", URBIT_VERSION); - int mprint_i = 1000; - c3_c* abs_c = (c3_c *)malloc(mprint_i); - // allocates more memory as needed if the path is too large + // prints the absolute path of the pier // - while ( abs_c != getcwd(abs_c, mprint_i) ) { + c3_c* abs_c = realpath(u3_Host.dir_c, 0); + + // if the ship is being booted, we use realpath(). Otherwise, we use getcwd() + // with a memory-allocation loop + // + if (abs_c == NULL) { + c3_i mprint_i = 1000; + abs_c = c3_malloc(mprint_i); + + // allocates more memory as needed if the path is too large + // + while ( abs_c != getcwd(abs_c, mprint_i) ) { + free(abs_c); + mprint_i *= 2; + abs_c = c3_malloc(mprint_i); + } + printf("boot: home is %s/%s\n", abs_c, u3_Host.dir_c); + free(abs_c); + } else { + printf("boot: home is %s\n", abs_c); free(abs_c); - mprint_i *= 2; - abs_c = (c3_c *)malloc(mprint_i); } - printf("boot: home is %s/%s\n", realpath(abs_c, NULL), u3_Host.dir_c); - free(abs_c); // printf("vere: hostname is %s\n", u3_Host.ops_u.nam_c); if ( c3y == u3_Host.ops_u.dem && c3n == u3_Host.ops_u.bat ) { From 85c697f87dc91000d6af4b9a6802bfe77968c2fb Mon Sep 17 00:00:00 2001 From: Robert Date: Thu, 10 Jan 2019 15:23:37 -0800 Subject: [PATCH 46/78] makes boot message clearer --- vere/sist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vere/sist.c b/vere/sist.c index 5a01d0062..f94fd8422 100644 --- a/vere/sist.c +++ b/vere/sist.c @@ -443,7 +443,7 @@ _sist_fast(u3_noun pas, c3_l key_l) c3_c* yek_c = u3r_string(yek); printf("boot: saving passcode in %s/.urb/code.%s\r\n", hom_c, gum_c); - printf("boot: for real security, write it down and delete the file\r\n"); + printf("boot: for more security, write it down and delete the file\r\n"); { c3_i fid_i; From a50c21e3cf1b40188512ef9acc0e13c61dcbe93b Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Thu, 10 Jan 2019 18:43:03 -0500 Subject: [PATCH 47/78] identifies hash test failure printfs --- tests/hash_tests.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/hash_tests.c b/tests/hash_tests.c index a9bad5654..f3e190c06 100644 --- a/tests/hash_tests.c +++ b/tests/hash_tests.c @@ -15,42 +15,42 @@ static void _test_mug(void) { if ( 0x4d441035 != u3r_mug_string("Hello, world!") ) { - fprintf(stderr, "fail\r\n"); + fprintf(stderr, "fail (a)\r\n"); exit(1); } if ( 0x4d441035 != u3r_mug(u3i_string("Hello, world!")) ) { - fprintf(stderr, "fail\r\n"); + fprintf(stderr, "fail (b)\r\n"); exit(1); } if ( 0x79ff04e8 != u3r_mug_bytes(0, 0) ) { - fprintf(stderr, "fail\r\n"); + fprintf(stderr, "fail (c)\r\n"); exit(1); } if ( 0x64dfda5c != u3r_mug(u3i_string("xxxxxxxxxxxxxxxxxxxxxxxxxxxx")) ) { - fprintf(stderr, "fail\r\n"); + fprintf(stderr, "fail (d)\r\n"); exit(1); } if ( 0x389ca03a != u3r_mug_cell(0, 0) ) { - fprintf(stderr, "fail\r\n"); + fprintf(stderr, "fail (e)\r\n"); exit(1); } if ( 0x389ca03a != u3r_mug_cell(1, 1) ) { - fprintf(stderr, "fail\r\n"); + fprintf(stderr, "fail (f)\r\n"); exit(1); } if ( 0x5258a6c0 != u3r_mug_cell(0, u3qc_bex(32)) ) { - fprintf(stderr, "fail\r\n"); + fprintf(stderr, "fail (g)\r\n"); exit(1); } if ( 0x2ad39968 != u3r_mug_cell(u3qa_dec(u3qc_bex(128)), 1) ) { - fprintf(stderr, "fail\r\n"); + fprintf(stderr, "fail (h)\r\n"); exit(1); } } From cd757b39b9674572c3ede6f0f697b85a713f8e94 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Thu, 10 Jan 2019 18:43:43 -0500 Subject: [PATCH 48/78] revises u3r_mug_chub and u3r_mug_words to match u3r_mug_bytes --- noun/retrieve.c | 19 +++++++++++++++++-- tests/hash_tests.c | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 2 deletions(-) diff --git a/noun/retrieve.c b/noun/retrieve.c index b919ef47e..6fdb8e651 100644 --- a/noun/retrieve.c +++ b/noun/retrieve.c @@ -1485,7 +1485,12 @@ u3r_mug_bytes(const c3_y *buf_y, c3_w u3r_mug_chub(c3_d num_d) { - return u3r_mug_bytes((c3_y*)&num_d, 8); + c3_w buf_w[2]; + + buf_w[0] = (c3_w)(num_d & 0xffffffffULL); + buf_w[1] = (c3_w)(num_d >> 32ULL); + + return u3r_mug_words(buf_w, 2); } /* u3r_mug_string(): Compute the mug of `a`, LSB first. @@ -1501,7 +1506,17 @@ u3r_mug_string(const c3_c *a_c) c3_w u3r_mug_words(const c3_w* key_w, c3_w len_w) { - return u3r_mug_bytes((c3_y*)key_w, 4 * len_w); + c3_w siz_w = 0; + c3_w byt_w = 0; + c3_w wor_w; + + while ( siz_w < len_w ) { + wor_w = key_w[siz_w]; + byt_w += _(u3a_is_cat(wor_w)) ? u3r_met(3, wor_w) : 4; + siz_w++; + } + + return u3r_mug_bytes((c3_y*)key_w, byt_w); } /* u3r_mug_both(): Join two mugs. diff --git a/tests/hash_tests.c b/tests/hash_tests.c index f3e190c06..0acd279fd 100644 --- a/tests/hash_tests.c +++ b/tests/hash_tests.c @@ -53,6 +53,46 @@ _test_mug(void) fprintf(stderr, "fail (h)\r\n"); exit(1); } + + { + // stick some zero bytes in a string + u3_noun str = u3kc_lsh(3, 1, + u3kc_mix(u3qc_bex(212), + u3i_string("abcdefjhijklmnopqrstuvwxyz"))); + + c3_w byt_w = u3r_met(3, str); + c3_w wor_w = u3r_met(5, str); + c3_y* str_y = c3_malloc(byt_w); + c3_w* str_w = c3_malloc(wor_w); + c3_d str_d = 0; + + u3r_bytes(0, byt_w, str_y, str); + u3r_words(0, wor_w, str_w, str); + + str_d |= str_w[0]; + str_d |= ((c3_d)str_w[1] << 32ULL); + + if ( 0x34d08717 != u3r_mug(str) ) { + fprintf(stderr, "fail (i) (1) \r\n"); + exit(1); + } + if ( 0x34d08717 != u3r_mug_bytes(str_y, byt_w) ) { + fprintf(stderr, "fail (i) (2)\r\n"); + exit(1); + } + if ( 0x34d08717 != u3r_mug_words(str_w, wor_w) ) { + fprintf(stderr, "fail (i) (3)\r\n"); + exit(1); + } + if ( u3r_mug_words(str_w, 2) != u3r_mug_chub(str_d) ) { + fprintf(stderr, "fail (i) (4)\r\n"); + exit(1); + } + + free(str_w); + free(str_y); + u3z(str); + } } /* main(): run all test cases. From a82a68df21f71a728bdf9022da8f01203541abcc Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Thu, 10 Jan 2019 19:00:50 -0500 Subject: [PATCH 49/78] skip free() in tests --- tests/hash_tests.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/hash_tests.c b/tests/hash_tests.c index 0acd279fd..cf25133ed 100644 --- a/tests/hash_tests.c +++ b/tests/hash_tests.c @@ -88,10 +88,6 @@ _test_mug(void) fprintf(stderr, "fail (i) (4)\r\n"); exit(1); } - - free(str_w); - free(str_y); - u3z(str); } } From 5c0a05011a99f5d7231be5c237282ac1eddcfe71 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Thu, 10 Jan 2019 20:20:42 -0500 Subject: [PATCH 50/78] disables proxy printf on u3_ward auth failure --- vere/http.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/vere/http.c b/vere/http.c index 0e74174ed..95783fa1e 100644 --- a/vere/http.c +++ b/vere/http.c @@ -2215,11 +2215,10 @@ _proxy_wcon_peek_read_cb(uv_stream_t* upt_u, c3_w len_w = rev_u->non_u.len; - // XX await further reads if siz_w < len_w ? if ( ((len_w + 1) != siz_w) || (len_w != buf_u->base[0]) || (0 != memcmp(rev_u->non_u.base, buf_u->base + 1, len_w)) ) { - uL(fprintf(uH, "proxy: ward auth fail\n")); + // uL(fprintf(uH, "proxy: ward auth fail\n")); _proxy_wcon_unlink(won_u); _proxy_wcon_close(won_u); } @@ -2344,6 +2343,16 @@ _proxy_ward_start(u3_pcon* con_u, u3_noun sip) rev_u->por_s = ntohs(add_u.sin_port); +#if 0 + { + u3_noun who = u3dc("scot", 'p', u3k(sip)); + c3_c* who_c = u3r_string(who); + fprintf(stderr, "\r\nward for %s started on %u\r\n", who_c, rev_u->por_s); + free(who_c); + u3z(who); + } +#endif + { c3_w* non_w = c3_malloc(64); From 71d27f99f05022f1efd0e4a8d3a53d31d786de1b Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Thu, 10 Jan 2019 20:51:14 -0500 Subject: [PATCH 51/78] refactors _proxy_ward_start() and _proxy_ward_plan() --- vere/http.c | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/vere/http.c b/vere/http.c index 95783fa1e..5bd47ef29 100644 --- a/vere/http.c +++ b/vere/http.c @@ -2299,6 +2299,23 @@ _proxy_ward_timer_cb(uv_timer_t* tim_u) static void _proxy_ward_plan(u3_ward* rev_u) { + u3_noun non; + + { + c3_w* non_w = c3_malloc(64); + c3_w len_w; + + c3_rand(non_w); + + non = u3i_words(16, non_w); + len_w = u3r_met(3, non); + + // the nonce is saved to authenticate u3_wcon + // and will be freed with u3_ward + // + rev_u->non_u = uv_buf_init((c3_c*)non_w, len_w); + } + // XX confirm duct u3_noun pax = u3nq(u3_blip, c3__http, c3__prox, u3nc(u3k(u3A->sen), u3_nul)); @@ -2306,7 +2323,7 @@ _proxy_ward_plan(u3_ward* rev_u) u3_noun wis = u3nc(c3__wise, u3nq(u3i_chubs(2, rev_u->who_d), rev_u->por_s, u3k(rev_u->con_u->sec), - u3i_words(16, (c3_w*)rev_u->non_u.base))); + non)); u3v_plan(pax, wis); } @@ -2353,24 +2370,11 @@ _proxy_ward_start(u3_pcon* con_u, u3_noun sip) } #endif - { - c3_w* non_w = c3_malloc(64); - - c3_rand(non_w); - - u3_noun non = u3i_words(16, non_w); - c3_w len_w = u3r_met(3, non); - - rev_u->non_u = uv_buf_init((c3_c*)non_w, len_w); - - u3z(non); - } - _proxy_ward_plan(rev_u); + // XX how long? + // uv_timer_init(u3L, &rev_u->tim_u); - - // XX how long? uv_timer_start(&rev_u->tim_u, _proxy_ward_timer_cb, 300 * 1000, 0); // XX u3_lo_shut(c3y); From a89db3ccc32a570905e50fd51e7cb83321bbbada Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Thu, 10 Jan 2019 22:10:44 -0500 Subject: [PATCH 52/78] simplifies u3r_mug_words bytewidth loop --- noun/retrieve.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/noun/retrieve.c b/noun/retrieve.c index 6fdb8e651..9d45511ac 100644 --- a/noun/retrieve.c +++ b/noun/retrieve.c @@ -1506,14 +1506,12 @@ u3r_mug_string(const c3_c *a_c) c3_w u3r_mug_words(const c3_w* key_w, c3_w len_w) { - c3_w siz_w = 0; c3_w byt_w = 0; c3_w wor_w; - while ( siz_w < len_w ) { - wor_w = key_w[siz_w]; + while ( 0 < len_w ) { + wor_w = key_w[--len_w]; byt_w += _(u3a_is_cat(wor_w)) ? u3r_met(3, wor_w) : 4; - siz_w++; } return u3r_mug_bytes((c3_y*)key_w, byt_w); From dc8e8f36c4ee161df0661e39887facb48417e437 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Thu, 10 Jan 2019 22:22:25 -0500 Subject: [PATCH 53/78] disables inconsistent event-log validation step on replay --- vere/sist.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vere/sist.c b/vere/sist.c index f94fd8422..4ece7388b 100644 --- a/vere/sist.c +++ b/vere/sist.c @@ -943,6 +943,12 @@ _sist_rest() ron = u3i_words(lar_u.len_w, img_w); free(img_w); + // this validation is disabled, as it broke when mug + // was switched from FNV to Murmur3 + // event-log encryption is enabled, so any actual corruption + // that this check would've caught will still be caught below + // +#if 0 if ( lar_u.mug_w != u3r_mug_both(u3r_mug(ron), u3r_mug_both(u3r_mug_words(&lar_u.tem_w, 1), @@ -951,6 +957,7 @@ _sist_rest() uL(fprintf(uH, "rest: record (%s) is corrupt (j)\n", ful_c)); u3_lo_bail(); } +#endif if ( c3__ov != lar_u.typ_w ) { u3z(ron); From 61afdf9309e0ae68bec9b02c59f578a75b5f3ee2 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Fri, 11 Jan 2019 11:06:20 -0500 Subject: [PATCH 54/78] fixes typos in http.c --- vere/http.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vere/http.c b/vere/http.c index 5bd47ef29..8baf7f729 100644 --- a/vere/http.c +++ b/vere/http.c @@ -2689,7 +2689,7 @@ _proxy_peek(u3_pcon* con_u) } } - if ( 0 != hot_c ) { + if ( 0 != hot_c ) { free(hot_c); } } @@ -2909,7 +2909,7 @@ u3_http_ef_that(u3_noun tat) cli_u = _proxy_warc_new(htp_u, (u3_atom)u3k(sip), (u3_atom)u3k(non), (c3_s)por, (c3_o)sec); - // resolve to loopback if networking is disabling + // resolve to loopback if networking is disabled // if ( c3n == u3_Host.ops_u.net ) { cli_u->ipf_w = INADDR_LOOPBACK; From 4ea849231916d9b57478ae1d9a6f6b2c10e8d079 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Fri, 11 Jan 2019 08:07:26 -0800 Subject: [PATCH 55/78] -m eth snap url, -C raw eth chain --- include/vere/vere.h | 2 ++ vere/dawn.c | 54 ++++++++++++++++++++++++++++++++++++++++++++- vere/main.c | 47 +++++++++++++++++++++++++++++++++++++-- 3 files changed, 100 insertions(+), 3 deletions(-) diff --git a/include/vere/vere.h b/include/vere/vere.h index fe54c6f3a..dc046ec84 100644 --- a/include/vere/vere.h +++ b/include/vere/vere.h @@ -581,6 +581,7 @@ c3_o abo; // -a, abort aggressively c3_c* pil_c; // -B, bootstrap from c3_o bat; // -b, batch create + c3_o can; // -C, chain-only, no eth snapshot c3_o nuu; // -c, new pier c3_o dry; // -D, dry compute, no checkpoint c3_o dem; // -d, daemon @@ -596,6 +597,7 @@ c3_c* key_c; // -k, private key file c3_o net; // -L, local-only networking c3_s rop_s; // -l, raft port + c3_c* sap_c; // -m, eth snapshot url c3_c* nam_c; // -n, unix hostname c3_o pro; // -P, profile c3_s por_s; // -p, ames port diff --git a/vere/dawn.c b/vere/dawn.c index 0da25c071..607175525 100644 --- a/vere/dawn.c +++ b/vere/dawn.c @@ -259,14 +259,66 @@ u3_dawn_vent(u3_noun seed) u3_noun ship = u3h(seed); u3_noun rank = u3do("clan:title", u3k(ship)); - // load snapshot if exists + // load snapshot from file // if ( 0 != u3_Host.ops_u.ets_c ) { fprintf(stderr, "boot: loading ethereum snapshot\r\n"); u3_noun raw_snap = u3ke_cue(u3m_file(u3_Host.ops_u.ets_c)); sap = u3nc(u3_nul, raw_snap); } + // load snapshot from HTTP URL + // + // note: some duplicate code with _boot_home() in noun/manage.c + // + else if ( 0 != u3_Host.ops_u.sap_c ) { + c3_c ful_c[2048]; + CURL *curl; + CURLcode result; + FILE *file; + long cod_l; + + snprintf(ful_c, 2048, "%s/.urb/ethereum.snap", u3_Host.dir_c); + printf("dawn: downloading ethereum snapshot: fetching %s to %s\r\n", + u3_Host.ops_u.sap_c, ful_c); + fflush(stdout); + + if ( !(curl = curl_easy_init()) ) { + fprintf(stderr, "failed to initialize libcurl\n"); + fflush(stderr); + exit(1); + } + if ( !(file = fopen(ful_c, "w")) ) { + fprintf(stderr, "failed to open %s\n", ful_c); + fflush(stderr); + exit(1); + } + curl_easy_setopt(curl, CURLOPT_URL, u3_Host.ops_u.sap_c); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, file); + result = curl_easy_perform(curl); + curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &cod_l); + fclose(file); + if ( CURLE_OK != result ) { + fprintf(stderr, "failed to fetch %s: %s\n", + u3_Host.ops_u.sap_c, curl_easy_strerror(result)); + fprintf(stderr, + "please fetch it manually and specify the location with -E\n"); + exit(1); + } + if ( 300 <= cod_l ) { + fprintf(stderr, "error fetching %s: HTTP %ld\n", u3_Host.ops_u.sap_c, cod_l); + fprintf(stderr, + "please fetch it manually and specify the location with -E\n"); + exit(1); + } + curl_easy_cleanup(curl); + + u3_noun raw_snap = u3ke_cue(u3m_file(ful_c)); + sap = u3nc(u3_nul, raw_snap); + } + // no snapshot + // else { + printf("dawn: no ethereum snapshot specified\n"); sap = u3_nul; } diff --git a/vere/main.c b/vere/main.c index 90093af95..c908e9ccd 100644 --- a/vere/main.c +++ b/vere/main.c @@ -75,6 +75,7 @@ _main_getopt(c3_i argc, c3_c** argv) u3_Host.ops_u.abo = c3n; u3_Host.ops_u.bat = c3n; + u3_Host.ops_u.can = c3n; u3_Host.ops_u.dem = c3n; u3_Host.ops_u.dry = c3n; u3_Host.ops_u.etn = c3n; @@ -97,7 +98,9 @@ _main_getopt(c3_i argc, c3_c** argv) u3_Host.ops_u.raf_c = 0; u3_Host.ops_u.nam_c = 0; - while ( (ch_i=getopt(argc, argv,"G:B:K:A:H:w:u:j:e:E:f:F:k:p:LabcdgqstvxPDRS")) != -1 ) { + while ( -1 != (ch_i=getopt(argc, argv, + "G:B:K:A:H:w:u:j:e:E:f:F:k:m:p:LabcCdgqstvxPDRS")) ) { + switch ( ch_i ) { case 'B': { u3_Host.ops_u.pil_c = strdup(optarg); @@ -160,6 +163,10 @@ _main_getopt(c3_i argc, c3_c** argv) u3_Host.ops_u.key_c = strdup(optarg); break; } + case 'm': { + u3_Host.ops_u.sap_c = strdup(optarg); + break; + } case 'p': { if ( c3n == _main_readw(optarg, 65536, &arg_w) ) { return c3n; @@ -174,6 +181,7 @@ _main_getopt(c3_i argc, c3_c** argv) case 'a': { u3_Host.ops_u.abo = c3y; break; } case 'b': { u3_Host.ops_u.bat = c3y; break; } case 'c': { u3_Host.ops_u.nuu = c3y; break; } + case 'C': { u3_Host.ops_u.can = c3y; break; } case 'd': { u3_Host.ops_u.dem = c3y; break; } case 'g': { u3_Host.ops_u.gab = c3y; break; } case 'P': { u3_Host.ops_u.pro = c3y; break; } @@ -250,12 +258,47 @@ _main_getopt(c3_i argc, c3_c** argv) if ( u3_Host.ops_u.nuu != c3y && u3_Host.ops_u.url_c != 0 ) { fprintf(stderr, "-u only makes sense when bootstrapping a new instance\n"); return c3n; + } + + if ( u3_Host.ops_u.nuu != c3y && u3_Host.ops_u.sap_c != 0 ) { + fprintf(stderr, "-m only makes sense when bootstrapping a new instance\n"); + return c3n; + } + + if ( u3_Host.ops_u.fak_c != 0 && u3_Host.ops_u.sap_c != 0 ) { + fprintf(stderr, "-m and -F cannot be used together\n"); + return c3n; + } + + if ( u3_Host.ops_u.ets_c != 0 && u3_Host.ops_u.sap_c != 0 ) { + fprintf(stderr, "-m and -E cannot be used together\n"); + return c3n; + } + if ( u3_Host.ops_u.can == c3y && u3_Host.ops_u.sap_c != 0 ) { + fprintf(stderr, "-m and -C cannot be used together\n"); + return c3n; + } + if ( u3_Host.ops_u.can == c3y && u3_Host.ops_u.ets_c != 0 ) { + fprintf(stderr, "-C and -E cannot be used together\n"); + return c3n; + } + + if ( u3_Host.ops_u.sap_c == 0 && u3_Host.ops_u.can == c3n ) { + + u3_Host.ops_u.sap_c = + "https://bootstrap.urbit.org/urbit-" URBIT_VERSION ".snap"; + } + + if ( u3_Host.ops_u.url_c != 0 && u3_Host.ops_u.pil_c != 0 ) { + fprintf(stderr, "-B and -u cannot be used together\n"); + return c3n; } else if ( u3_Host.ops_u.nuu == c3y && u3_Host.ops_u.url_c == 0 && u3_Host.ops_u.git == c3n ) { - u3_Host.ops_u.url_c = "https://bootstrap.urbit.org/urbit-" URBIT_VERSION ".pill"; + u3_Host.ops_u.url_c = + "https://bootstrap.urbit.org/urbit-" URBIT_VERSION ".pill"; } else if ( u3_Host.ops_u.nuu == c3y && u3_Host.ops_u.url_c == 0 From 9fae72717978ce747575c4f6f2d70116537b06fa Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Fri, 11 Jan 2019 13:56:39 -0500 Subject: [PATCH 56/78] fix heap allocation in hash_tests --- tests/hash_tests.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/hash_tests.c b/tests/hash_tests.c index cf25133ed..0720fcc37 100644 --- a/tests/hash_tests.c +++ b/tests/hash_tests.c @@ -63,7 +63,7 @@ _test_mug(void) c3_w byt_w = u3r_met(3, str); c3_w wor_w = u3r_met(5, str); c3_y* str_y = c3_malloc(byt_w); - c3_w* str_w = c3_malloc(wor_w); + c3_w* str_w = c3_malloc(4 * wor_w); c3_d str_d = 0; u3r_bytes(0, byt_w, str_y, str); From 059b13f30e7d5b9959d152cd252ebfe9c321896d Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Fri, 11 Jan 2019 15:05:04 -0800 Subject: [PATCH 57/78] provide default for -e --- include/vere/vere.h | 2 +- vere/dawn.c | 2 +- vere/main.c | 16 ++++------------ 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/include/vere/vere.h b/include/vere/vere.h index 79baaf16f..093982ceb 100644 --- a/include/vere/vere.h +++ b/include/vere/vere.h @@ -606,7 +606,7 @@ c3_c* raf_c; // -r, raft flotilla c3_o has; // -S, Skip battery hashes c3_o git; // -s, pill url from arvo git hash - c3_o etn; // -t, use snapshot exclusively to boot + c3_o etn; // -t, trust snapshot for pre-boot c3_c* url_c; // -u, pill url c3_o vno; // -V, replay without reboots c3_o veb; // -v, verbose (inverse of -q) diff --git a/vere/dawn.c b/vere/dawn.c index 607175525..368d91384 100644 --- a/vere/dawn.c +++ b/vere/dawn.c @@ -328,7 +328,7 @@ u3_dawn_vent(u3_noun seed) // c3_c* url_c = ( 0 != u3_Host.ops_u.eth_c ) ? u3_Host.ops_u.eth_c : - "https://ropsten.infura.io/v3/196a7f37c7d54211b4a07904ec73ad87"; + "https://mainnet.infura.io/v3/196a7f37c7d54211b4a07904ec73ad87"; // pin block number // diff --git a/vere/main.c b/vere/main.c index c908e9ccd..727a8525b 100644 --- a/vere/main.c +++ b/vere/main.c @@ -218,18 +218,6 @@ _main_getopt(c3_i argc, c3_c** argv) c3_t imp_t = ( (0 != u3_Host.ops_u.who_c) && (4 == strlen(u3_Host.ops_u.who_c)) ); - if ( u3_Host.ops_u.ets_c == 0 && c3y == u3_Host.ops_u.etn ) { - fprintf(stderr, "can't trust Ethereum snapshot without specifying " - "snapshot with -E\n"); - return c3n; - } - - if ( (0 == u3_Host.ops_u.fak_c) && (0 == u3_Host.ops_u.eth_c) && imp_t ) { - fprintf(stderr, "can't create a new galaxy without specifying " - "the Ethereum gateway with -e\n"); - return c3n; - } - if ( u3_Host.ops_u.gen_c != 0 && u3_Host.ops_u.nuu == c3n ) { fprintf(stderr, "-G only makes sense when bootstrapping a new instance\n"); return c3n; @@ -283,6 +271,10 @@ _main_getopt(c3_i argc, c3_c** argv) return c3n; } + if ( u3_Host.ops_u.eth_c == 0 && imp_t ) { + u3_Host.ops_u.eth_c = "http://eth-mainnet.urbit.org:8545"; + } + if ( u3_Host.ops_u.sap_c == 0 && u3_Host.ops_u.can == c3n ) { u3_Host.ops_u.sap_c = From b13f4448091d6f83c061d02b3c984c28702bdb72 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Fri, 11 Jan 2019 17:40:09 -0800 Subject: [PATCH 58/78] mine a comet under a list of stars that we download --- vere/dawn.c | 190 +++++++++++++++++++++++++--------------------------- 1 file changed, 91 insertions(+), 99 deletions(-) diff --git a/vere/dawn.c b/vere/dawn.c index 607175525..2736253d5 100644 --- a/vere/dawn.c +++ b/vere/dawn.c @@ -8,6 +8,40 @@ #include "all.h" #include "vere/vere.h" +/* _dawn_oct_to_buf(): +octs to uv_buf_t +*/ +static uv_buf_t +_dawn_oct_to_buf(u3_noun oct) +{ + if ( c3n == u3a_is_cat(u3h(oct)) ) { + u3_lo_bail(); + } + + c3_w len_w = u3h(oct); + c3_y* buf_y = c3_malloc(1 + len_w); + buf_y[len_w] = 0; + + u3r_bytes(0, len_w, buf_y, u3t(oct)); + + u3z(oct); + return uv_buf_init((void*)buf_y, len_w); +} + +/* _dawn_buf_to_oct(): uv_buf_t to +octs +*/ +static u3_noun +_dawn_buf_to_oct(uv_buf_t buf_u) +{ + u3_noun len = u3i_words(1, (c3_w*)&buf_u.len); + + if ( c3n == u3a_is_cat(len) ) { + u3_lo_bail(); + } + + return u3nc(len, u3i_bytes(buf_u.len, (const c3_y*)buf_u.base)); +} + + /* _dawn_curl_alloc(): allocate a response buffer for curl */ static size_t @@ -74,37 +108,51 @@ _dawn_post_json(c3_c* url_c, uv_buf_t lod_u) return buf_u; } -/* _dawn_oct_to_buf(): +octs to uv_buf_t -*/ -static uv_buf_t -_dawn_oct_to_buf(u3_noun oct) -{ - if ( c3n == u3a_is_cat(u3h(oct)) ) { - u3_lo_bail(); - } - - c3_w len_w = u3h(oct); - c3_y* buf_y = c3_malloc(1 + len_w); - buf_y[len_w] = 0; - - u3r_bytes(0, len_w, buf_y, u3t(oct)); - - u3z(oct); - return uv_buf_init((void*)buf_y, len_w); -} - -/* _dawn_buf_to_oct(): uv_buf_t to +octs +/* _dawn_get_jam(): GET a jammed noun from url_c */ static u3_noun -_dawn_buf_to_oct(uv_buf_t buf_u) +_dawn_get_jam(c3_c* url_c) { - u3_noun len = u3i_words(1, (c3_w*)&buf_u.len); + CURL *curl; + CURLcode result; + long cod_l; - if ( c3n == u3a_is_cat(len) ) { + uv_buf_t buf_u = uv_buf_init(c3_malloc(1), 0); + + if ( !(curl = curl_easy_init()) ) { + fprintf(stderr, "failed to initialize libcurl\n"); u3_lo_bail(); } - return u3nc(len, u3i_bytes(buf_u.len, (const c3_y*)buf_u.base)); + // XX require TLS, pin default cert? + + curl_easy_setopt(curl, CURLOPT_URL, url_c); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, _dawn_curl_alloc); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*)&buf_u); + + result = curl_easy_perform(curl); + curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &cod_l); + + // XX retry? + if ( CURLE_OK != result ) { + fprintf(stderr, "failed to fetch %s: %s\n", + url_c, curl_easy_strerror(result)); + u3_lo_bail(); + } + if ( 300 <= cod_l ) { + fprintf(stderr, "error fetching %s: HTTP %ld\n", url_c, cod_l); + u3_lo_bail(); + } + + curl_easy_cleanup(curl); + + // throw away the length from the octs + // + u3_noun octs = _dawn_buf_to_oct(buf_u); + u3_noun jammed = u3k(u3t(octs)); + u3z(octs); + + return u3ke_cue(jammed); } /* _dawn_eth_rpc(): ethereum JSON RPC with request/response as +octs @@ -268,51 +316,8 @@ u3_dawn_vent(u3_noun seed) } // load snapshot from HTTP URL // - // note: some duplicate code with _boot_home() in noun/manage.c - // else if ( 0 != u3_Host.ops_u.sap_c ) { - c3_c ful_c[2048]; - CURL *curl; - CURLcode result; - FILE *file; - long cod_l; - - snprintf(ful_c, 2048, "%s/.urb/ethereum.snap", u3_Host.dir_c); - printf("dawn: downloading ethereum snapshot: fetching %s to %s\r\n", - u3_Host.ops_u.sap_c, ful_c); - fflush(stdout); - - if ( !(curl = curl_easy_init()) ) { - fprintf(stderr, "failed to initialize libcurl\n"); - fflush(stderr); - exit(1); - } - if ( !(file = fopen(ful_c, "w")) ) { - fprintf(stderr, "failed to open %s\n", ful_c); - fflush(stderr); - exit(1); - } - curl_easy_setopt(curl, CURLOPT_URL, u3_Host.ops_u.sap_c); - curl_easy_setopt(curl, CURLOPT_WRITEDATA, file); - result = curl_easy_perform(curl); - curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &cod_l); - fclose(file); - if ( CURLE_OK != result ) { - fprintf(stderr, "failed to fetch %s: %s\n", - u3_Host.ops_u.sap_c, curl_easy_strerror(result)); - fprintf(stderr, - "please fetch it manually and specify the location with -E\n"); - exit(1); - } - if ( 300 <= cod_l ) { - fprintf(stderr, "error fetching %s: HTTP %ld\n", u3_Host.ops_u.sap_c, cod_l); - fprintf(stderr, - "please fetch it manually and specify the location with -E\n"); - exit(1); - } - curl_easy_cleanup(curl); - - u3_noun raw_snap = u3ke_cue(u3m_file(ful_c)); + u3_noun raw_snap = _dawn_get_jam(u3_Host.ops_u.sap_c); sap = u3nc(u3_nul, raw_snap); } // no snapshot @@ -351,7 +356,7 @@ u3_dawn_vent(u3_noun seed) } { - // +point:constitution:ethe: on-chain state + // +point:azimuth: on-chain state // u3_noun pot; @@ -365,7 +370,7 @@ u3_dawn_vent(u3_noun seed) else if ( c3__pawn == rank ) { // irrelevant, just bunt +point // - pot = u3v_wish("*point:constitution:ethe"); + pot = u3v_wish("*point:azimuth"); } else { u3_noun who; @@ -478,36 +483,12 @@ u3_dawn_vent(u3_noun seed) return u3nc(c3__dawn, u3nq(seed, pon, zar, u3nq(tuf, bok, url, sap))); } -/* u3_dawn_come(): mine a comet under star (unit) +/* _dawn_come(): mine a comet under a list of stars */ -u3_noun -u3_dawn_come(u3_noun star) +static u3_noun +_dawn_come(u3_noun stars) { u3_noun seed; - - if ( u3_nul == star ) { - // XX ~marzod hardcoded - // choose from list, at random, &c - // - star = 256; - } - else { - // XX parse and validate - // - u3_noun tar = u3k(u3t(star)); - u3z(star); - star = tar; - } - - { - u3_noun sar = u3dc("scot", 'p', u3k(star)); - c3_c* tar_c = u3r_string(sar); - - fprintf(stderr, "boot: mining a comet under %s\r\n", tar_c); - free(tar_c); - u3z(sar); - } - { c3_w eny_w[16]; u3_noun eny; @@ -515,7 +496,9 @@ u3_dawn_come(u3_noun star) c3_rand(eny_w); eny = u3i_words(16, eny_w); - seed = u3dc("come:dawn", u3k(star), u3k(eny)); + fprintf(stderr, "boot: mining a comet\r\n"); + + seed = u3dc("come:dawn", u3k(stars), u3k(eny)); u3z(eny); } @@ -528,7 +511,16 @@ u3_dawn_come(u3_noun star) u3z(who); } - u3z(star); + u3z(stars); return seed; } + +/* u3_dawn_come(): mine a comet under a list of stars we download +*/ +u3_noun +u3_dawn_come() +{ + return _dawn_come( + _dawn_get_jam("https://bootstrap.urbit.org/comet-stars.jam")); +} From c2ebf77ae279ad0eee14f3e2e89de4fbb4f64723 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Fri, 11 Jan 2019 17:53:02 -0800 Subject: [PATCH 59/78] Fix u3_dawn_come() call signature and call sites --- include/vere/vere.h | 6 +++--- vere/dawn.c | 2 +- vere/sist.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/vere/vere.h b/include/vere/vere.h index 79baaf16f..2c60bf5f4 100644 --- a/include/vere/vere.h +++ b/include/vere/vere.h @@ -1201,12 +1201,12 @@ u3_cttp_io_exit(void); - /* u3_dawn_come(): mine a comet under star (unit) + /* u3_dawn_come(): mine a comet */ u3_noun - u3_dawn_come(u3_noun star); + u3_dawn_come(void); - /* u3_dawn_vent(): validatated boot event + /* u3_dawn_vent(): validated boot event */ u3_noun u3_dawn_vent(u3_noun seed); diff --git a/vere/dawn.c b/vere/dawn.c index 2736253d5..81d9dcd81 100644 --- a/vere/dawn.c +++ b/vere/dawn.c @@ -297,7 +297,7 @@ _dawn_turf(c3_c* dns_c) return tuf; } -/* u3_dawn_vent(): validatated boot event +/* u3_dawn_vent(): validated boot event */ u3_noun u3_dawn_vent(u3_noun seed) diff --git a/vere/sist.c b/vere/sist.c index 88f6e61df..e6c98da07 100644 --- a/vere/sist.c +++ b/vere/sist.c @@ -1245,7 +1245,7 @@ u3_sist_boot(void) sed = sist_key(des); } else { - sed = u3_dawn_come(u3_nul); + sed = u3_dawn_come(); } u3A->fak = c3n; From 7ade54973d38b9f4f0ef504d5bd39c1cafbaecc2 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Fri, 11 Jan 2019 18:01:54 -0800 Subject: [PATCH 60/78] add a warning printf about slowness --- vere/dawn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vere/dawn.c b/vere/dawn.c index 81d9dcd81..572aeece9 100644 --- a/vere/dawn.c +++ b/vere/dawn.c @@ -496,7 +496,7 @@ _dawn_come(u3_noun stars) c3_rand(eny_w); eny = u3i_words(16, eny_w); - fprintf(stderr, "boot: mining a comet\r\n"); + fprintf(stderr, "boot: mining a comet. May take up to 30 minutes.\r\n"); seed = u3dc("come:dawn", u3k(stars), u3k(eny)); u3z(eny); From afd3236cdbeff2505cc5a8c20bfda5c9e84665d7 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Fri, 11 Jan 2019 18:31:21 -0800 Subject: [PATCH 61/78] warn harder, with snark --- vere/dawn.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vere/dawn.c b/vere/dawn.c index 572aeece9..9485e367c 100644 --- a/vere/dawn.c +++ b/vere/dawn.c @@ -496,7 +496,8 @@ _dawn_come(u3_noun stars) c3_rand(eny_w); eny = u3i_words(16, eny_w); - fprintf(stderr, "boot: mining a comet. May take up to 30 minutes.\r\n"); + fprintf(stderr, "boot: mining a comet. May take up to an hour.\r\n"); + fprintf(stderr, "If you want to boot faster, get an Azimuth point.\r\n"); seed = u3dc("come:dawn", u3k(stars), u3k(eny)); u3z(eny); From 3e7d344c01eecc8991bcb48f89ea761ba1aa2e29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C5=8Dshin?= Date: Sun, 13 Jan 2019 22:40:03 -0800 Subject: [PATCH 62/78] Minor file-head cleanup I removed anything that was in portable.h, specified proper path names, and removed some now-wrong (?) public domain notices. --- vere/ames.c | 8 +------- vere/behn.c | 9 +-------- vere/cttp.c | 7 ++----- vere/dawn.c | 2 +- vere/http.c | 14 +++++--------- vere/loop.c | 8 +------- vere/main.c | 12 ++---------- vere/raft.c | 6 +----- vere/reck.c | 9 +-------- vere/save.c | 8 +------- vere/sist.c | 6 +----- vere/term.c | 9 ++------- vere/time.c | 9 +-------- vere/unix.c | 13 ++----------- vere/walk.c | 9 +-------- 15 files changed, 23 insertions(+), 106 deletions(-) diff --git a/vere/ames.c b/vere/ames.c index ad9094a79..9c5afb185 100644 --- a/vere/ames.c +++ b/vere/ames.c @@ -1,15 +1,9 @@ -/* v/http.c +/* vere/ames.c ** */ -#include -#include #include #include #include -#include -#include -#include -#include #include #include #include diff --git a/vere/behn.c b/vere/behn.c index 9d7bd8b2d..6ac41c18a 100644 --- a/vere/behn.c +++ b/vere/behn.c @@ -1,17 +1,10 @@ -/* v/behn.c +/* vere/behn.c ** -** This file is in the public domain. */ -#include -#include #include #include #include -#include -#include -#include #include -#include #include #include #include diff --git a/vere/cttp.c b/vere/cttp.c index 98b463fa4..2a892cd4b 100644 --- a/vere/cttp.c +++ b/vere/cttp.c @@ -1,19 +1,16 @@ -/* v/cttp.c +/* vere/cttp.c ** */ -#include -#include #include #include #include -#include -#include #include #include #include #include #include #include + #include "all.h" #include "vere/vere.h" diff --git a/vere/dawn.c b/vere/dawn.c index 70575f022..2ca5fbc60 100644 --- a/vere/dawn.c +++ b/vere/dawn.c @@ -2,9 +2,9 @@ ** ** ethereum-integrated pre-boot validation */ -#include #include #include + #include "all.h" #include "vere/vere.h" diff --git a/vere/http.c b/vere/http.c index 8baf7f729..2d72c762b 100644 --- a/vere/http.c +++ b/vere/http.c @@ -1,27 +1,23 @@ -/* v/http.c +/* vere/http.c ** */ -#include -#include #include #include #include -#include -#include #include #include #include #include #include #include - #include +#include #include -#include "all.h" -#include "vere/vere.h" - #include #include +#include "all.h" +#include "vere/vere.h" + typedef struct _u3_h2o_serv { h2o_globalconf_t fig_u; // h2o global config h2o_context_t ctx_u; // h2o ctx diff --git a/vere/loop.c b/vere/loop.c index a8f9a0bdd..824b2533d 100644 --- a/vere/loop.c +++ b/vere/loop.c @@ -1,17 +1,11 @@ -/* v/loop.c +/* vere/loop.c ** */ -#include -#include #include #include #include #include -#include -#include -#include #include -#include #include #include #include diff --git a/vere/main.c b/vere/main.c index 727a8525b..ff23c45b4 100644 --- a/vere/main.c +++ b/vere/main.c @@ -1,16 +1,9 @@ -/* v/main.c +/* vere/main.c ** */ -#include -#include #include #include #include -#include -#include -#include -#include -#include #include #include #include @@ -20,8 +13,7 @@ #include #include #include - -#include "h2o.h" +#include #define U3_GLOBAL #define C3_GLOBAL diff --git a/vere/raft.c b/vere/raft.c index 6bf9d34d4..63a316fc1 100644 --- a/vere/raft.c +++ b/vere/raft.c @@ -1,10 +1,6 @@ -/* v/raft.c +/* vere/raft.c ** */ -#include -#include -#include -#include #include #include "all.h" diff --git a/vere/reck.c b/vere/reck.c index 6766b5355..c0c4e5e34 100644 --- a/vere/reck.c +++ b/vere/reck.c @@ -1,17 +1,10 @@ -/* v/reck.c +/* vere/reck.c ** -** This file is in the public domain. */ -#include -#include #include #include #include -#include -#include -#include #include -#include #include #include #include diff --git a/vere/save.c b/vere/save.c index e4d25fa3e..0768c2b35 100644 --- a/vere/save.c +++ b/vere/save.c @@ -1,16 +1,10 @@ -/* v/save.c +/* vere/save.c ** */ -#include -#include #include #include #include #include -#include -#include -#include -#include #include #include diff --git a/vere/sist.c b/vere/sist.c index e6c98da07..6a938703c 100644 --- a/vere/sist.c +++ b/vere/sist.c @@ -1,12 +1,8 @@ -/* v/sist.c +/* vere/sist.c ** */ #include #include -#include -#include -#include -#include #include #include "all.h" diff --git a/vere/term.c b/vere/term.c index 3afa308db..453b4fd43 100644 --- a/vere/term.c +++ b/vere/term.c @@ -1,15 +1,9 @@ -/* v/term.c +/* vere/term.c ** */ -#include -#include #include #include #include -#include -#include -#include -#include #include #include #include @@ -17,6 +11,7 @@ #include #include #include + #include "all.h" #include "vere/vere.h" diff --git a/vere/time.c b/vere/time.c index 8c37cbf79..d39efd9fe 100644 --- a/vere/time.c +++ b/vere/time.c @@ -1,17 +1,10 @@ -/* v/time.c +/* vere/time.c ** -** This file is in the public domain. */ -#include -#include #include #include #include -#include -#include -#include #include -#include #include #include #include diff --git a/vere/unix.c b/vere/unix.c index 0b5f9002f..8bb92ffee 100644 --- a/vere/unix.c +++ b/vere/unix.c @@ -1,20 +1,10 @@ -/* v/unix.c +/* vere/unix.c ** -** This file is in the public domain. */ - -#include "all.h" - -#include -#include #include #include #include -#include -#include -#include #include -#include #include #include #include @@ -22,6 +12,7 @@ #include #include +#include "all.h" #include "vere/vere.h" /* _unix_down(): descend path. diff --git a/vere/walk.c b/vere/walk.c index efe0d9023..903623085 100644 --- a/vere/walk.c +++ b/vere/walk.c @@ -1,17 +1,10 @@ -/* v/walk.c +/* vere/walk.c ** -** This file is in the public domain. */ -#include -#include #include #include #include -#include -#include -#include #include -#include #include #include #include From 31b333894aee48893c57da2f4b3475d0a44988f7 Mon Sep 17 00:00:00 2001 From: Anthony Arroyo Date: Mon, 14 Jan 2019 13:56:41 -0800 Subject: [PATCH 63/78] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2ea009481..7d6dc9891 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ +> The Urbit address space is now live on the Ethereum blockchain. We’re calling it ‘Azimuth’ and you can find it at [`0x223c067f8cf28ae173ee5cafea60ca44c335fecb`](https://etherscan.io/address/0x223c067f8cf28ae173ee5cafea60ca44c335fecb) or [`azimuth.eth`](https://etherscan.io/address/azimuth.eth). Owners of Azimuth ‘points’ (galaxies, stars or planets) can use [Bridge](https://github.com/urbit/bridge/releases) to manage them and view their balance now. Sometime in the next few days, owners of Azimuth points will be able to boot Arvo, the Urbit OS, from their Azimuth point and request access to one of our ‘cities’: private communities for chat and discussion. These new cities use Landscape, a brand new UI for using Urbit in the browser. + # Install instructions To install and run Urbit please follow the instructions at -[urbit.org/docs/using/install](http://urbit.org/docs/using/install). Packages +[urbit.org/docs/getting-started/installation](http://urbit.org/docs/getting-started/installation). Packages and source tarballs are available there. You'll be on the live network in a few minutes. From 4674945e974be6205474f45990e2a2f553d673a1 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 15 Jan 2019 13:22:25 -0500 Subject: [PATCH 64/78] corrects links in README --- README.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 7d6dc9891..3bb348b97 100644 --- a/README.md +++ b/README.md @@ -3,15 +3,15 @@ # Install instructions To install and run Urbit please follow the instructions at -[urbit.org/docs/getting-started/installation](http://urbit.org/docs/getting-started/installation). Packages -and source tarballs are available there. You'll be on the live network in a few -minutes. +[urbit.org/docs/getting-started/](https://urbit.org/docs/getting-started/). +Packages and source tarballs are available there. You'll be on the live network +in a few minutes. If you're doing development on Urbit, keep reading. # Build instructions -[![Build Status](https://travis-ci.org/urbit/urbit.svg?branch=maint-0.4)](https://travis-ci.org/urbit/urbit) +[![Build Status](https://travis-ci.org/urbit/urbit.svg?branch=master)](https://travis-ci.org/urbit/urbit) ## External dependencies @@ -100,7 +100,6 @@ following steps: If you have any questions, problems, patches, or proposals for patches, please feel free to get in touch in whatever way is most convenient: -- Post to `/urbit-meta` on Urbit `:talk`. (You can do this via -[urbit.org/stream](https://urbit.org/stream) without a running Urbit). +- Post to `/urbit-meta` on Urbit [`:talk`](https://urbit.org/docs/learn/arvo/arvo-internals/messaging/). - Post to [urbit.org/fora](https://urbit.org/fora/). -- Email us directly [questions@urbit.org](mailto:questions@urbit.org). +- Email us directly [questions@urbit.org](mailto:questions@urbit.org). From 2a5757ab9df6d013444bf1fa75af764b27417603 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 15 Jan 2019 13:22:47 -0500 Subject: [PATCH 65/78] corrects build/dependency sections of README --- README.md | 33 +++++---------------------------- 1 file changed, 5 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 3bb348b97..0aeeb2ef6 100644 --- a/README.md +++ b/README.md @@ -25,24 +25,22 @@ If you're doing development on Urbit, keep reading. - [libcurl](https://curl.haxx.se/libcurl/) - [libuv](http://libuv.org) - curses implementation (ncurses on Linux distributions, OS curses otherwise) -- [re2c](http://re2c.org) Most of these dependencies are unfortunate; we aim to drastically shrink the list in upcoming versions. `vere` proper makes use of GMP, OpenSSL, libcurl, and -libsigsegv. The multiple build tools are a result of bundled libraries, slated -for future unbundling or removal wherever possible. +libsigsegv. ## Building Urbit uses Meson build system. Some libraries which are not found in major distributions: + - ed25519 -- http-parser legacy version 0.1.0 +- libh2o - murmur3 - softfloat3 -- urbit-scrypt -- commonmark legacy version 0.12.0 +- scrypt are included as git submodules. To build urbit from source, perform the following steps: @@ -65,6 +63,7 @@ To set a prefix for installation use ## Configuration & compilation for legacy meson The syntax for legacy meson (Version `0.29`) is a bit different. + 1. Manually create `build` directory and invoke meson as `meson . ./build` 2. If you want to set options, this is done in one step. Use `meson -D [options] . ./build` to prepare customized build. @@ -73,28 +72,6 @@ Once the project is configured, use `ninja` to build it. To install it into the default prefix, use `ninja install`. If you want to specify custom `DESTDIR`, use `DESTDIR=... ninja install`. -## Building the Debian Package - -To build a .deb file for installation on Debian platforms, perform the -following steps: -+ Run `sudo apt install devscripts` to install the `debuild` utility. -+ Update the `debian/changelog` to reflect the changes in this release. -+ If necessary, update the year of the copyright in `debian/copyright`. -+ Clean any build artifacts: Run `make clean` and delete the `bin` directory, -if it exists. -+ Run `tar -xcvf ../urbit-x.y.z.orig.tar.gz .` from the top-level folder in -the repo. This command will create an archive in the directory above the -current directory, which will be used in packaging. -+ Run `debuild -us -uc`, also from the top-level folder in the repo. This -creates a .deb file in the folder above the current directory. - -The resulting .deb file should now exist in the folder above the current -directory. To test that the .deb file works properly, you can perform the -following steps: -+ Uninstall urbit: `sudo apt remove urbit`. -+ Run `sudo dpkg -i ../urbit-x.y.z_amd64.deb` to install the new version. -+ Boot up a ship using the `urbit` command. - ## Contact If you have any questions, problems, patches, or proposals for patches, please From 16c99e75af47c44eadd4c6ed1a894d58b3c70b86 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 15 Jan 2019 13:23:11 -0500 Subject: [PATCH 66/78] corrects usage instructions --- vere/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vere/main.c b/vere/main.c index ff23c45b4..ac3e05435 100644 --- a/vere/main.c +++ b/vere/main.c @@ -355,7 +355,7 @@ u3_ve_usage(c3_i argc, c3_c** argv) "where ship_name is a @p phonetic representation of an urbit address\n", "without the leading '~', and options is some subset of the following:\n", "\n", - "-A dir Use dir for initial galaxy sync\n", + "-A dir Use dir for initial arvo sync\n", "-B pill Bootstrap from this pill\n", "-b Batch create\n", "-c pier Create a new urbit in pier/\n", @@ -388,8 +388,8 @@ u3_ve_usage(c3_i argc, c3_c** argv) " https://github.com/urbit/urbit/blob/master/CONTRIBUTING.md\n", "\n", "Simple Usage: \n", - " %s -c to create a comet (anonymous urbit)\n", - " %s -w -t if you have a ticket\n", + " %s -c to create a comet (anonymous urbit)\n", + " %s -w -k if you own a planet\n", " %s to restart an existing urbit\n", 0 }; From 449b2c1a5dfff1e08acbbac3b2a3b382e464cb28 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 15 Jan 2019 14:28:55 -0500 Subject: [PATCH 67/78] exit cleanly if $galaxy is already running (fake or real) --- vere/ames.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vere/ames.c b/vere/ames.c index 9c5afb185..a4e199905 100644 --- a/vere/ames.c +++ b/vere/ames.c @@ -414,7 +414,7 @@ _ames_io_start() uL(fprintf(uH, " ...perhaps you've got two copies of vere running?\n")); } - exit(1); + u3_lo_bail(); } uv_udp_getsockname(&sam_u->wax_u, (struct sockaddr *)&add_u, &add_i); From c0138ad0d3ee7355ed381db86d1ef309c19d7e7b Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 15 Jan 2019 16:03:37 -0500 Subject: [PATCH 68/78] updates CONTRIBUTING.md, removing obsolete instructions --- CONTRIBUTING.md | 175 ++++++++++++++++++++++-------------------------- 1 file changed, 81 insertions(+), 94 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e821af354..7c4fefd6f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,49 +2,35 @@ Thank you for your interest in contributing to urbit. -## Fake `~zod`s +See [urbit.org/docs/getting-started](https://urbit.org/docs/getting-started/#arvo) +for basic orientation and usage instructions. + +## Fake ships You may have an identity on the live network, but doing all your development on the live network would be cumbersome and unnecessary. -Standard practice in urbit development is to work on a fake `~zod`. A -fake `~zod` will get its initial files from a directory you specify -rather than trying to sync them over the network, which is invaluable -for working in Hoon. Also, a fake `~zod` or any fake urbit instances you -start do not talk to the live network, but to a fake network that exists -only on your computer. +Standard practice in urbit development is to work on a fake `~zod`. +Fake ships use deterministic keys (derived from the ship address) +and don't talk to the live network. They can talk to each other over +the local loopback. -First, you'll want to check out the Arvo repository. Arvo is kept in its -own repository, and changes more rapidly than the main C project does. +To start a fake ship, simply specify the name with `-F`: - git clone https://github.com/urbit/arvo +``` +$ urbit -F zod +``` -The arvo repository can live safely inside the main urbit repository if -you want, since it's listed in .gitignore. However, vere will use the -path you specify on the command line with the `-A` option. +You can also pass a name for the *pier* (or ship directory): -To start a fake `~zod`, the command is: +``` +$ urbit -F zod my-fake-zod +``` - $ urbit -c -F zod -A [arvo checkout] [pier directory] +To resume a fake ship, just pass the name of the pier: -To resume one that was already created, just as on the live network, -remove `-c` and `-A [arvo checkout]` (but leave the rest of the options -there). `-F` uses the fake network. - -## Kernel development - -Working on either C or non-kernel Hoon should not bring any surprises, -but the Hoon kernel (anything under `arvo/arvo/`) is bootstrapped -from `urbit.pill`, and must be recompiled if any changes are made. This -should happen automatically when you make changes, but if it doesn't, -the command to manually recompile the kernel and install the new kernel -is `|reset` in `dojo`. This rebuilds from the `arvo` directory in the -`home` desk in `%clay`. Currently, `|reset` does not reload apps like -`dojo` itself, which will still reference the old kernel. To force them -to reload, make a trivial edit to their main source file (under the -`app` directory) in `%clay`. - -If you do any kernel development, be sure to read the section below about -pills. +``` +$ urbit fake-zod/ +``` ## Git practice @@ -54,16 +40,22 @@ what you are doing, skip down to the Style section. Start by cloning the repository on your work machine: - git clone https://github.com/urbit/urbit +``` +$ git clone https://github.com/urbit/urbit +``` And, additionally, fork the repository on GitHub by clicking the "Fork" button. Add your fork as a remote: - git remote add [username] https://github.com/[username]/urbit +``` +$ git remote add [username] https://github.com/[username]/urbit +``` and set it as the default remote to push to: - git config --local remote.pushDefault [username] +``` +$ git config --local remote.pushDefault [username] +``` This is good practice for any project that uses git. You will pull upstream branches from urbit/urbit and push to your personal urbit fork @@ -73,12 +65,16 @@ Next, start a new branch to do your work on. For `urbit`, please use the latest tagged release as your starting point. For other repositories, anywhere pointed to by `master` is alright to start from. - git checkout -b [branch name] [starting point] +``` +$ git checkout -b [branch name] [starting point] +``` Now you are free to do your work on this branch. When finished, you may want to clean up your commits: - git rebase -i [starting point] +``` +$ git rebase -i [starting point] +``` Then you can push to your public fork with `git push` and make a pull request via the GitHub UI. @@ -96,73 +92,66 @@ compound statement. One thing to watch out for is top-level sections in source files that are denoted by comments and are actually indented one level. -Hoon will be a less familiar language to many contributors. Some of our -less obvious stylistic rules are: +Hoon will be a less familiar language to many contributors. More details +are forthcoming; for now, the `%ford` vane (in +[`sys/vane/ford.hoon`](https://github.com/urbit/arvo/blob/master/sys/vane/ford.hoon)) +is the highest quality code in the kernel. -- Keep your source files 80 characters or less wide. Many urbit - developers use 80 character terminals/tmux panes/&c. -- Tab characters are actually a syntax error, so be extra sure your - editor is not inserting any. Trailing whitespace is *usually* not a - syntax error, but avoiding it is encouraged. -- The kernel convention is that line comments start at column 57 with - the `::` followed by 2 spaces. This leaves 20 characters for the - comment. Outside the kernel, things are less strict. -- Tall arms within a core are conventionally separated by empty comments - (just `::`) at the same indentation level as the initial `++` or `+-`. - The last arm in a core is not followed by an empty comment, because it - is visually closed by the `--` that closes the core. The empty comment - is also sometimes omitted in data structure definitions. +## Kernel development + +Working on either C or non-kernel Hoon should not bring any surprises, but +the Hoon kernel (anything under `sys/` in [urbit/arvo](https://github.com/urbit/arvo)) +is bootstrapped from `urbit.pill`, and must be recompiled if any changes are +made. This should happen automatically when you make changes, but if it doesn't, +the command to manually recompile the kernel and install the new kernel +is `|reset` in `dojo`. This rebuilds from the `sys` directory in the +`home` desk in `%clay`. Currently, `|reset` does not reload apps like +`dojo` itself, which will still reference the old kernel. To force them +to reload, make a trivial edit to their main source file (under the +`app` directory) in `%clay`. ## The kernel and pills urbit bootstraps itself using a binary blob called `urbit.pill`. You probably remember it being fetched from `bootstrap.urbit.org` before -your first boot. This is just the compiled version of the kernel, which -you can find in the `arvo/arvo/` directory - `hoon.hoon`, `zuse.hoon`, -and so on. +your first boot. This is the compiled version of the kernel (which +you can find in the `sys` directory of [urbit/arvo](https://github.com/urbit/arvo)), +along with a complete copy of the Arvo repository as source. The procedure for creating `urbit.pill` is often called "soliding". It is somewhat similar to `|reset`, but instead of replacing your running kernel, it writes the compiled kernel to a file. The command to solid -is, on a fakezod: +is: - .urbit/pill +solid +``` +> .urbit/pill +solid +``` When the compilation finishes, your `urbit.pill` will be found in the `[pier]/.urb/put/` directory. +You can boot a new ship from your local pill with `-B`: + +``` +$ urbit -F zod -B path/to/urbit.pill fake-zod +``` + Ordinarily, `http://bootstrap.urbit.org/latest.pill` will be updated to match whatever's on `master` in the `arvo` repository with every -merge to `master`. Older pills will be stored with the `git` SHA1 of the -relevant commit as `[sha1].pill`. +merge to `master`. Older pills will be stored with the first 10 +characters of the `git` SHA1 of the relevant commit as `git-[sha1].pill`. -If you're doing heavy kernel hacking and want to submit intermediate -pills for your branch, please include them with your pull request, and -they'll be uploaded to `bootstrap.urbit.org` when your branch is merged. +The continuous-integration build of the `urbit/arvo` repository +uploads these pills for any successful build (if the commit or pull-request +affects the `sys/` directory). -## Debug urbit with `gdb` +You can boot from one of these pills by passing the path to an Arvo +working copy with `-A` (and `-s` for *search*): -Follow the build instructions in README.md but run `make` with argument `DEBUG=yes`: - -(If you've already built urbit first run `make clean`.) - - make DEBUG=yes - -Run `gdb`, while loading `bin/urbit` and its symbol table: - - gdb bin/urbit - -Set a breakpoint on `main()` (optional): - - break main - -Run your urbit comet `mycomet`: - - run mycomet - -Continue from the breakpoint on `main()`: - - continue +``` +$ git clone https://github.com/urbit/arvo +$ urbit -F zod -A path/to/arvo -s fake-zod +``` ## What to work on @@ -180,12 +169,10 @@ eager to have outside contributions on. Check here first! ## Staying in touch The urbit developers communicate on urbit itself. Joining the -`urbit-meta` channel on `talk` is highly recommended, as is reading the -forums at [http://urbit.org/fora](http://urbit.org/fora). Subscribing to -`urbit-dev` on Google Groups is also recommended, since this is where -continuity breach notifications are sent. +`urbit-meta` channel on +[`:talk`](https://urbit.org/docs/learn/arvo/arvo-internals/messaging/) +is highly recommended, as is reading the forums at +[http://urbit.org/fora](http://urbit.org/fora). -Pull requests in non-GitHub forms can go to Raymond Pasco -([ray@the.ug](mailto:ray@the.ug)). Questions or other communications -about contributing to Urbit can go to Raymond Pasco or Philip Monk -([philip.monk@tlon.io](mailto:philip.monk@tlon.io)). +Questions or other communications about contributing to Urbit can go to +[support@urbit.org](mailto:support@urbit.org). From e22884ef7ee4b767612a15387140d875898feb08 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Tue, 15 Jan 2019 18:08:21 -0800 Subject: [PATCH 69/78] WIP compiles but crashes --- noun/retrieve.c | 178 ++++++++++++++++++++++++++++++++++++++++++------ vere/sist.c | 5 +- 2 files changed, 160 insertions(+), 23 deletions(-) diff --git a/noun/retrieve.c b/noun/retrieve.c index f6941117a..ea645b045 100644 --- a/noun/retrieve.c +++ b/noun/retrieve.c @@ -1554,31 +1554,10 @@ u3r_mug_cell(u3_noun hed, return u3r_mug_both(lus_w, biq_w); } -/* u3r_mug_trel(): Compute the mug of `[a b c]`. -*/ -c3_w -u3r_mug_trel(u3_noun a, - u3_noun b, - u3_noun c) -{ - return u3r_mug_both(u3r_mug(a), u3r_mug_cell(b, c)); -} - -/* u3r_mug_qual(): Compute the mug of `[a b c d]`. -*/ -c3_w -u3r_mug_qual(u3_noun a, - u3_noun b, - u3_noun c, - u3_noun d) -{ - return u3r_mug_both(u3r_mug(a), u3r_mug_trel(b, c, d)); -} - /* u3r_mug(): MurmurHash3 on a noun. */ c3_w -u3r_mug(u3_noun veb) +u3r_mug_old(u3_noun veb) { c3_assert(u3_none != veb); @@ -1610,3 +1589,158 @@ u3r_mug(u3_noun veb) return mug_w; } } + +// mugframe: head and tail mugs of veb, 0 if uncalculated +// +typedef struct mugframe +{ + u3_noun veb; + c3_w a; + c3_w b; +} mugframe; + +static inline mugframe* +_mug_push(c3_ys mov, c3_ys off, u3_noun veb) +{ + u3R->cap_p += mov; + mugframe* cur = u3to(mugframe, u3R->cap_p + off); + cur->veb = veb; + cur->a = 0; + cur->b = 0; + return cur; +} + +static inline mugframe* +_mug_pop(c3_ys mov, c3_ys off, c3_w mug_w) +{ + u3R->cap_p -= mov; + mugframe* fam = u3to(mugframe, u3R->cap_p + off); + // place return value in head of previous frame if not already calculated + // + if ( 0 == fam->a ) { + fam->a = mug_w; + } + // otherwise, place the return value in the tail + // + else if ( 0 == fam->b ) { + fam->b = mug_w; + } + // shouldn't reach + else { + c3_assert(0); + } + return fam; +} + +// _mug_cat(): return the mug of a direct atom +// +static c3_w +_mug_cat(u3_atom veb) +{ + c3_w len_w = u3r_met(3, veb); + return u3r_mug_bytes((c3_y*)&veb, len_w); +} + +/* _mug_pug(): statefully mug an indirect atom +*/ +static c3_w +_mug_pug(u3_atom veb) +{ + u3a_atom* vat_u = (u3a_atom*)(u3a_to_ptr(veb)); + c3_w len_w = u3r_met(3, veb); + + c3_w mug_w = u3r_mug_bytes((c3_y*)vat_u->buf_w, len_w); + vat_u->mug_w = mug_w; + return mug_w; +} + +// u3r_mug(): statefully mug a noun +// +c3_w +u3r_mug(u3_noun veb) +{ + u3a_noun* veb_u; + + c3_assert( u3_none != veb ); + + // direct atom + // + if ( _(u3a_is_cat(veb)) ) { + return _mug_cat(veb); + } + + // indirect atom + // + if ( _(u3a_is_pug(veb)) ) { + return _mug_pug(veb); + } + + // cell; dive into it depth-first + // + veb_u = u3a_to_ptr(veb); + + // already has mug + // + if ( veb_u->mug_w ) { + return veb_u->mug_w; + } + + c3_y wis_y = c3_wiseof(mugframe); + c3_o nor_o = u3a_is_north(u3R); + c3_ys mov = ( c3y == nor_o ? -wis_y : wis_y ); + c3_ys off = ( c3y == nor_o ? 0 : -wis_y ); + + u3p(mugframe) empty = u3R->cap_p; + mugframe* fam = _mug_push(mov, off, veb); + mugframe* don = u3to(mugframe, empty + off); + + c3_w mug_w; + c3_w a; + c3_w b; + + while ( don != fam ) { + a = fam->a; + b = fam->b; + veb = fam->veb; + veb_u = u3a_to_ptr(veb); + + // already mugged; pop stack + // + if ( veb_u->mug_w ) { + mug_w = veb_u->mug_w; + fam = _mug_pop(mov, off, mug_w); + } + // both head and tail are mugged; combine them and pop stack + // + else if ( (0 != a) && (0 != b) ) { + mug_w = u3r_mug_both(a, b); + veb_u->mug_w = mug_w; + fam = _mug_pop(mov, off, mug_w); + } + // head is mugged, but not tail; push tail onto stack + // + else if ( (0 != a) && (0 == b) ) { + fam = _mug_push(mov, off, u3t(veb)); + } + // direct atom; calculate and pop stack + // + else if ( _(u3a_is_cat(veb)) ) { + mug_w = _mug_cat(veb); + fam = _mug_pop(mov, off, mug_w); + } + // indirect atom; calculate and pop stack + // + else if ( _(u3a_is_pug(veb)) ) { + mug_w = _mug_pug(veb); + fam = _mug_pop(mov, off, mug_w); + } + // cell, and neither head nor tail is mugged; push head onto stack + // + else { + c3_assert(_(u3a_is_cell(veb))); + fam = _mug_push(mov, off, u3h(veb)); + } + } + u3R->cap_p = empty; + return mug_w; +} diff --git a/vere/sist.c b/vere/sist.c index 6a938703c..63e5eb1ab 100644 --- a/vere/sist.c +++ b/vere/sist.c @@ -683,7 +683,10 @@ _sist_rest_nuu(u3_ulog* lug_u, u3_uled led_u, c3_c* old_c) lar_u.ent_d = ent_d; lar_u.tem_w = 0; lar_u.typ_w = c3__ov; - lar_u.mug_w = u3r_mug_trel(ovo, u3_nul, c3__ov); + + u3_noun moo = u3nt(u3k(ovo), u3_nul, c3__ov); + lar_u.mug_w = u3r_mug(moo); + u3z(moo); img_w = c3_malloc(lar_u.len_w << 2); u3r_words(0, lar_u.len_w, img_w, ovo); From b105e5e6db7a73b1c9322fe06e2af4f0fa1365a5 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Tue, 15 Jan 2019 18:58:28 -0800 Subject: [PATCH 70/78] WIP testing and printing --- noun/retrieve.c | 15 +++++++++++++-- tests/hash_tests.c | 13 ++++++++++++- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/noun/retrieve.c b/noun/retrieve.c index ea645b045..95b2c5b4c 100644 --- a/noun/retrieve.c +++ b/noun/retrieve.c @@ -1627,7 +1627,9 @@ _mug_pop(c3_ys mov, c3_ys off, c3_w mug_w) } // shouldn't reach else { - c3_assert(0); + fprintf(stderr, "oh no\r\n"); + fflush(stderr); + c3_assert(0); } return fam; } @@ -1691,8 +1693,8 @@ u3r_mug(u3_noun veb) c3_ys off = ( c3y == nor_o ? 0 : -wis_y ); u3p(mugframe) empty = u3R->cap_p; - mugframe* fam = _mug_push(mov, off, veb); mugframe* don = u3to(mugframe, empty + off); + mugframe* fam = _mug_push(mov, off, veb); c3_w mug_w; c3_w a; @@ -1703,16 +1705,19 @@ u3r_mug(u3_noun veb) b = fam->b; veb = fam->veb; veb_u = u3a_to_ptr(veb); + fprintf(stderr, "ran ptr\r\n"); // already mugged; pop stack // if ( veb_u->mug_w ) { + fprintf(stderr, "already mugged\r\n"); mug_w = veb_u->mug_w; fam = _mug_pop(mov, off, mug_w); } // both head and tail are mugged; combine them and pop stack // else if ( (0 != a) && (0 != b) ) { + fprintf(stderr, "combining head and tail mugs\r\n"); mug_w = u3r_mug_both(a, b); veb_u->mug_w = mug_w; fam = _mug_pop(mov, off, mug_w); @@ -1720,25 +1725,31 @@ u3r_mug(u3_noun veb) // head is mugged, but not tail; push tail onto stack // else if ( (0 != a) && (0 == b) ) { + fprintf(stderr, "pushing tail\r\n"); fam = _mug_push(mov, off, u3t(veb)); } // direct atom; calculate and pop stack // else if ( _(u3a_is_cat(veb)) ) { + fprintf(stderr, "mugging cat\r\n"); mug_w = _mug_cat(veb); fam = _mug_pop(mov, off, mug_w); } // indirect atom; calculate and pop stack // else if ( _(u3a_is_pug(veb)) ) { + fprintf(stderr, "mugging pug\r\n"); mug_w = _mug_pug(veb); fam = _mug_pop(mov, off, mug_w); } // cell, and neither head nor tail is mugged; push head onto stack // else { + fprintf(stderr, "asserting cell\r\n"); c3_assert(_(u3a_is_cell(veb))); + fprintf(stderr, "pushing head\r\n"); fam = _mug_push(mov, off, u3h(veb)); + fprintf(stderr, "pushed head\r\n"); } } u3R->cap_p = empty; diff --git a/tests/hash_tests.c b/tests/hash_tests.c index 0720fcc37..042add950 100644 --- a/tests/hash_tests.c +++ b/tests/hash_tests.c @@ -54,7 +54,18 @@ _test_mug(void) exit(1); } - { + c3_w mug_w; +// u3_noun a = u3qb_reap(0x7FFFFF, 0); +// mug_w = u3r_mug(a); +// u3z(a); +// fprintf(stderr, "mug_w1 %08x\r\n", mug_w); + + u3_noun b = u3nc(u3nc(c3__doze, c3__doze), c3__doze); + mug_w = u3r_mug(b); + u3z(b); + fprintf(stderr, "mug_w2 %08x\r\n", mug_w); + + { // stick some zero bytes in a string u3_noun str = u3kc_lsh(3, 1, u3kc_mix(u3qc_bex(212), From 63ccf3ad7ec570daa25427d31ff721e15c0fed02 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Tue, 15 Jan 2019 19:29:11 -0800 Subject: [PATCH 71/78] WIP still dying --- noun/retrieve.c | 83 +++++++++++++++++++--------------------------- tests/hash_tests.c | 13 ++++++++ 2 files changed, 47 insertions(+), 49 deletions(-) diff --git a/noun/retrieve.c b/noun/retrieve.c index 95b2c5b4c..8ed4eeaf6 100644 --- a/noun/retrieve.c +++ b/noun/retrieve.c @@ -1628,6 +1628,7 @@ _mug_pop(c3_ys mov, c3_ys off, c3_w mug_w) // shouldn't reach else { fprintf(stderr, "oh no\r\n"); + u3m_p("dying", fam->veb); fflush(stderr); c3_assert(0); } @@ -1656,35 +1657,28 @@ _mug_pug(u3_atom veb) return mug_w; } +/* _mug_atom(): mug an atom, either direct or indirect +*/ +static c3_w +_mug_atom(u3_atom veb) +{ + if ( _(u3a_is_cat(veb)) ) { + return _mug_cat(veb); + } + else { + return _mug_pug(veb); + } +} + // u3r_mug(): statefully mug a noun // c3_w u3r_mug(u3_noun veb) { - u3a_noun* veb_u; - c3_assert( u3_none != veb ); - // direct atom - // - if ( _(u3a_is_cat(veb)) ) { - return _mug_cat(veb); - } - - // indirect atom - // - if ( _(u3a_is_pug(veb)) ) { - return _mug_pug(veb); - } - - // cell; dive into it depth-first - // - veb_u = u3a_to_ptr(veb); - - // already has mug - // - if ( veb_u->mug_w ) { - return veb_u->mug_w; + if ( _(u3a_is_atom(veb)) ) { + return _mug_atom(veb); } c3_y wis_y = c3_wiseof(mugframe); @@ -1699,25 +1693,22 @@ u3r_mug(u3_noun veb) c3_w mug_w; c3_w a; c3_w b; + u3a_noun* veb_u; while ( don != fam ) { a = fam->a; b = fam->b; veb = fam->veb; veb_u = u3a_to_ptr(veb); - fprintf(stderr, "ran ptr\r\n"); - - // already mugged; pop stack - // - if ( veb_u->mug_w ) { - fprintf(stderr, "already mugged\r\n"); - mug_w = veb_u->mug_w; + + if ( _(u3a_is_atom(veb)) ) { + mug_w = _mug_atom(veb); fam = _mug_pop(mov, off, mug_w); } // both head and tail are mugged; combine them and pop stack // else if ( (0 != a) && (0 != b) ) { - fprintf(stderr, "combining head and tail mugs\r\n"); + //fprintf(stderr, "combining head and tail mugs\r\n"); mug_w = u3r_mug_both(a, b); veb_u->mug_w = mug_w; fam = _mug_pop(mov, off, mug_w); @@ -1725,31 +1716,25 @@ u3r_mug(u3_noun veb) // head is mugged, but not tail; push tail onto stack // else if ( (0 != a) && (0 == b) ) { - fprintf(stderr, "pushing tail\r\n"); + //fprintf(stderr, "pushing tail\r\n"); fam = _mug_push(mov, off, u3t(veb)); } - // direct atom; calculate and pop stack - // - else if ( _(u3a_is_cat(veb)) ) { - fprintf(stderr, "mugging cat\r\n"); - mug_w = _mug_cat(veb); - fam = _mug_pop(mov, off, mug_w); - } - // indirect atom; calculate and pop stack - // - else if ( _(u3a_is_pug(veb)) ) { - fprintf(stderr, "mugging pug\r\n"); - mug_w = _mug_pug(veb); - fam = _mug_pop(mov, off, mug_w); - } // cell, and neither head nor tail is mugged; push head onto stack // else { - fprintf(stderr, "asserting cell\r\n"); + //fprintf(stderr, "asserting cell\r\n"); c3_assert(_(u3a_is_cell(veb))); - fprintf(stderr, "pushing head\r\n"); - fam = _mug_push(mov, off, u3h(veb)); - fprintf(stderr, "pushed head\r\n"); + // already mugged; pop stack + // + if ( veb_u->mug_w ) { + //fprintf(stderr, "already mugged\r\n"); + mug_w = veb_u->mug_w; + fam = _mug_pop(mov, off, mug_w); + } + else { + //fprintf(stderr, "pushing head\r\n"); + fam = _mug_push(mov, off, u3h(veb)); + } } } u3R->cap_p = empty; diff --git a/tests/hash_tests.c b/tests/hash_tests.c index 042add950..b22d5ff16 100644 --- a/tests/hash_tests.c +++ b/tests/hash_tests.c @@ -65,6 +65,19 @@ _test_mug(void) u3z(b); fprintf(stderr, "mug_w2 %08x\r\n", mug_w); + u3_noun c = u3nc(u3_nul, u3nc(u3nt(u3nc(107, 141), u3nc(1, u3_nul), u3_nul), u3_nul)); + mug_w = u3r_mug(c); + u3z(c); + fprintf(stderr, "mug_w3 %08x\r\n", mug_w); + + u3_noun set = u3_nul; + c3_w len_w = 0; + while ( 0xf > len_w ) { + set = u3qdi_put(set, len_w++); + } + u3r_mug(set); + u3z(set); + { // stick some zero bytes in a string u3_noun str = u3kc_lsh(3, 1, From e815ad4be711a27a94be51baeb868ba031551239 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Tue, 15 Jan 2019 19:42:40 -0800 Subject: [PATCH 72/78] WIP refactored but still dying --- noun/retrieve.c | 34 ++++++++++++++++++++++------------ tests/hash_tests.c | 2 +- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/noun/retrieve.c b/noun/retrieve.c index 8ed4eeaf6..33cd75225 100644 --- a/noun/retrieve.c +++ b/noun/retrieve.c @@ -1701,14 +1701,10 @@ u3r_mug(u3_noun veb) veb = fam->veb; veb_u = u3a_to_ptr(veb); - if ( _(u3a_is_atom(veb)) ) { - mug_w = _mug_atom(veb); - fam = _mug_pop(mov, off, mug_w); - } // both head and tail are mugged; combine them and pop stack // - else if ( (0 != a) && (0 != b) ) { - //fprintf(stderr, "combining head and tail mugs\r\n"); + if ( (0 != a) && (0 != b) ) { + fprintf(stderr, "combining head and tail mugs\r\n"); mug_w = u3r_mug_both(a, b); veb_u->mug_w = mug_w; fam = _mug_pop(mov, off, mug_w); @@ -1716,24 +1712,38 @@ u3r_mug(u3_noun veb) // head is mugged, but not tail; push tail onto stack // else if ( (0 != a) && (0 == b) ) { - //fprintf(stderr, "pushing tail\r\n"); - fam = _mug_push(mov, off, u3t(veb)); + if ( _(u3a_is_atom(u3t(veb))) ) { + fprintf(stderr, "tail is atom\r\n"); + mug_w = _mug_atom(u3t(veb)); + fam->b = mug_w; + } + else { + fprintf(stderr, "pushing tail\r\n"); + fam = _mug_push(mov, off, u3t(veb)); + } } // cell, and neither head nor tail is mugged; push head onto stack // else { - //fprintf(stderr, "asserting cell\r\n"); + fprintf(stderr, "asserting cell\r\n"); c3_assert(_(u3a_is_cell(veb))); // already mugged; pop stack // if ( veb_u->mug_w ) { - //fprintf(stderr, "already mugged\r\n"); + fprintf(stderr, "already mugged\r\n"); mug_w = veb_u->mug_w; fam = _mug_pop(mov, off, mug_w); } else { - //fprintf(stderr, "pushing head\r\n"); - fam = _mug_push(mov, off, u3h(veb)); + if ( _(u3a_is_atom(u3h(veb))) ) { + fprintf(stderr, "head is atom\r\n"); + mug_w = _mug_atom(u3h(veb)); + fam->a = mug_w; + } + else { + fprintf(stderr, "pushing head\r\n"); + fam = _mug_push(mov, off, u3h(veb)); + } } } } diff --git a/tests/hash_tests.c b/tests/hash_tests.c index b22d5ff16..10a87730d 100644 --- a/tests/hash_tests.c +++ b/tests/hash_tests.c @@ -72,7 +72,7 @@ _test_mug(void) u3_noun set = u3_nul; c3_w len_w = 0; - while ( 0xf > len_w ) { + while ( 0x1 > len_w ) { set = u3qdi_put(set, len_w++); } u3r_mug(set); From 6d70ad19ddd68343a6a1178cdaffab712c0a99d0 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Tue, 15 Jan 2019 20:03:24 -0800 Subject: [PATCH 73/78] WIP simplified conditionals, still dies, appears stateful? --- noun/retrieve.c | 73 +++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 39 deletions(-) diff --git a/noun/retrieve.c b/noun/retrieve.c index 33cd75225..5565aaf10 100644 --- a/noun/retrieve.c +++ b/noun/retrieve.c @@ -1694,58 +1694,53 @@ u3r_mug(u3_noun veb) c3_w a; c3_w b; u3a_noun* veb_u; + u3_noun hed, tal; while ( don != fam ) { a = fam->a; b = fam->b; veb = fam->veb; veb_u = u3a_to_ptr(veb); + //u3m_p("veb", veb); + c3_assert(_(u3a_is_cell(veb))); + // already mugged; pop stack + // + if ( veb_u->mug_w ) { + //fprintf(stderr, "already mugged\r\n"); + mug_w = veb_u->mug_w; + fam = _mug_pop(mov, off, mug_w); + } + // neither head nor tail are mugged; start with head + // + else if ( 0 == a ) { + hed = u3h(veb); + if ( _(u3a_is_atom(hed)) ) { + fam->a = _mug_atom(hed); + } + else { + fam = _mug_push(mov, off, hed); + } + } + // head is mugged, but not tail; mug tail or push tail onto stack + // + else if ( 0 == b ) { + tal = u3t(veb); + if ( _(u3a_is_atom(tal)) ) { + fam->b = _mug_atom(tal); + } + else { + fam = _mug_push(mov, off, tal); + } + } // both head and tail are mugged; combine them and pop stack // - if ( (0 != a) && (0 != b) ) { - fprintf(stderr, "combining head and tail mugs\r\n"); + else { + //fprintf(stderr, "combining head and tail mugs\r\n"); mug_w = u3r_mug_both(a, b); veb_u->mug_w = mug_w; fam = _mug_pop(mov, off, mug_w); } - // head is mugged, but not tail; push tail onto stack - // - else if ( (0 != a) && (0 == b) ) { - if ( _(u3a_is_atom(u3t(veb))) ) { - fprintf(stderr, "tail is atom\r\n"); - mug_w = _mug_atom(u3t(veb)); - fam->b = mug_w; - } - else { - fprintf(stderr, "pushing tail\r\n"); - fam = _mug_push(mov, off, u3t(veb)); - } - } - // cell, and neither head nor tail is mugged; push head onto stack - // - else { - fprintf(stderr, "asserting cell\r\n"); - c3_assert(_(u3a_is_cell(veb))); - // already mugged; pop stack - // - if ( veb_u->mug_w ) { - fprintf(stderr, "already mugged\r\n"); - mug_w = veb_u->mug_w; - fam = _mug_pop(mov, off, mug_w); - } - else { - if ( _(u3a_is_atom(u3h(veb))) ) { - fprintf(stderr, "head is atom\r\n"); - mug_w = _mug_atom(u3h(veb)); - fam->a = mug_w; - } - else { - fprintf(stderr, "pushing head\r\n"); - fam = _mug_push(mov, off, u3h(veb)); - } - } - } } u3R->cap_p = empty; return mug_w; From 76fa2487007a317082acadb70423c7d34b0d9ad6 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 15 Jan 2019 23:49:03 -0500 Subject: [PATCH 74/78] adds a u3_none explicit bottom stack frame to u3r_mug --- noun/retrieve.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/noun/retrieve.c b/noun/retrieve.c index 5565aaf10..485520a29 100644 --- a/noun/retrieve.c +++ b/noun/retrieve.c @@ -1615,6 +1615,13 @@ _mug_pop(c3_ys mov, c3_ys off, c3_w mug_w) { u3R->cap_p -= mov; mugframe* fam = u3to(mugframe, u3R->cap_p + off); + + // the bottom of the stack + // + if ( u3_none == fam->veb ) { + return fam; + } + // place return value in head of previous frame if not already calculated // if ( 0 == fam->a ) { @@ -1626,10 +1633,8 @@ _mug_pop(c3_ys mov, c3_ys off, c3_w mug_w) fam->b = mug_w; } // shouldn't reach + // else { - fprintf(stderr, "oh no\r\n"); - u3m_p("dying", fam->veb); - fflush(stderr); c3_assert(0); } return fam; @@ -1686,8 +1691,12 @@ u3r_mug(u3_noun veb) c3_ys mov = ( c3y == nor_o ? -wis_y : wis_y ); c3_ys off = ( c3y == nor_o ? 0 : -wis_y ); + // stash the current stack pointer + // u3p(mugframe) empty = u3R->cap_p; - mugframe* don = u3to(mugframe, empty + off); + // set the bottom of our stack + // + mugframe* don = _mug_push(mov, off, u3_none); mugframe* fam = _mug_push(mov, off, veb); c3_w mug_w; @@ -1701,13 +1710,11 @@ u3r_mug(u3_noun veb) b = fam->b; veb = fam->veb; veb_u = u3a_to_ptr(veb); - //u3m_p("veb", veb); c3_assert(_(u3a_is_cell(veb))); // already mugged; pop stack // if ( veb_u->mug_w ) { - //fprintf(stderr, "already mugged\r\n"); mug_w = veb_u->mug_w; fam = _mug_pop(mov, off, mug_w); } @@ -1736,12 +1743,12 @@ u3r_mug(u3_noun veb) // both head and tail are mugged; combine them and pop stack // else { - //fprintf(stderr, "combining head and tail mugs\r\n"); mug_w = u3r_mug_both(a, b); veb_u->mug_w = mug_w; fam = _mug_pop(mov, off, mug_w); } } + u3R->cap_p = empty; return mug_w; } From e655b07ecb1862e8698afcb90b2d7bc301c6283c Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 15 Jan 2019 23:57:45 -0500 Subject: [PATCH 75/78] adds assertions to protect u3r_mug against stack overflow --- noun/retrieve.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/noun/retrieve.c b/noun/retrieve.c index 485520a29..8f16a3aea 100644 --- a/noun/retrieve.c +++ b/noun/retrieve.c @@ -1603,6 +1603,17 @@ static inline mugframe* _mug_push(c3_ys mov, c3_ys off, u3_noun veb) { u3R->cap_p += mov; + + // ensure we haven't overflowed the stack + // (off==0 means we're on a north road) + // + if ( 0 == off ) { + c3_assert(u3R->cap_p > u3R->hat_p); + } + else { + c3_assert(u3R->cap_p < u3R->hat_p); + } + mugframe* cur = u3to(mugframe, u3R->cap_p + off); cur->veb = veb; cur->a = 0; From ee835ee87faf9c06babc299d291d0b2e9844e85e Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 15 Jan 2019 23:58:16 -0500 Subject: [PATCH 76/78] removes temporary u3r_mug tests --- tests/hash_tests.c | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/tests/hash_tests.c b/tests/hash_tests.c index 10a87730d..5b6c169d2 100644 --- a/tests/hash_tests.c +++ b/tests/hash_tests.c @@ -54,32 +54,9 @@ _test_mug(void) exit(1); } - c3_w mug_w; -// u3_noun a = u3qb_reap(0x7FFFFF, 0); -// mug_w = u3r_mug(a); -// u3z(a); -// fprintf(stderr, "mug_w1 %08x\r\n", mug_w); - - u3_noun b = u3nc(u3nc(c3__doze, c3__doze), c3__doze); - mug_w = u3r_mug(b); - u3z(b); - fprintf(stderr, "mug_w2 %08x\r\n", mug_w); - - u3_noun c = u3nc(u3_nul, u3nc(u3nt(u3nc(107, 141), u3nc(1, u3_nul), u3_nul), u3_nul)); - mug_w = u3r_mug(c); - u3z(c); - fprintf(stderr, "mug_w3 %08x\r\n", mug_w); - - u3_noun set = u3_nul; - c3_w len_w = 0; - while ( 0x1 > len_w ) { - set = u3qdi_put(set, len_w++); - } - u3r_mug(set); - u3z(set); - { - // stick some zero bytes in a string + // stick some zero bytes in a string + // u3_noun str = u3kc_lsh(3, 1, u3kc_mix(u3qc_bex(212), u3i_string("abcdefjhijklmnopqrstuvwxyz"))); From 18ba2999129827bbf1d44bb342a2bc248b875b3c Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 15 Jan 2019 23:58:29 -0500 Subject: [PATCH 77/78] renames test-hash --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index da71dbfeb..17c5895c9 100644 --- a/meson.build +++ b/meson.build @@ -381,4 +381,4 @@ link_args: os_link_flags, dependencies: deps + os_deps, install: false) -test('test_hash', test_hash) +test('test-hash', test_hash) From 86ccb0b17314eba7f9ac27577ab3107ffaa7c437 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Tue, 15 Jan 2019 21:09:05 -0800 Subject: [PATCH 78/78] remove old version of u3r_mug() --- noun/retrieve.c | 38 +------------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/noun/retrieve.c b/noun/retrieve.c index 8f16a3aea..93c79c23d 100644 --- a/noun/retrieve.c +++ b/noun/retrieve.c @@ -1554,42 +1554,6 @@ u3r_mug_cell(u3_noun hed, return u3r_mug_both(lus_w, biq_w); } -/* u3r_mug(): MurmurHash3 on a noun. -*/ -c3_w -u3r_mug_old(u3_noun veb) -{ - c3_assert(u3_none != veb); - - if ( _(u3a_is_cat(veb)) ) { - c3_w len_w = u3r_met(3, veb); - return u3r_mug_bytes((c3_y*)&veb, len_w); - } - else { - c3_w mug_w; - - u3a_noun* veb_u = u3a_to_ptr(veb); - - if ( veb_u->mug_w ) { - return veb_u->mug_w; - } - - if ( _(u3a_is_cell(veb)) ) { - mug_w = u3r_mug_cell(u3h(veb), u3t(veb)); - } - else { - u3a_atom* vat_u = (u3a_atom*)veb_u; - c3_w len_w = u3r_met(3, veb); - - mug_w = u3r_mug_bytes((c3_y*)vat_u->buf_w, len_w); - } - - veb_u->mug_w = mug_w; - - return mug_w; - } -} - // mugframe: head and tail mugs of veb, 0 if uncalculated // typedef struct mugframe @@ -1686,7 +1650,7 @@ _mug_atom(u3_atom veb) } } -// u3r_mug(): statefully mug a noun +// u3r_mug(): statefully mug a noun using a 31-bit MurmurHash3 // c3_w u3r_mug(u3_noun veb)