diff --git a/Makefile b/Makefile index 7e8fa54ae..d7a910ea6 100644 --- a/Makefile +++ b/Makefile @@ -168,7 +168,6 @@ J164_4_OFILES=\ J164_5_OFILES=\ gen164/5/aesc.o \ - gen164/5/co.o \ gen164/5/cue.o \ gen164/5/ed.o \ gen164/5/jam.o \ @@ -242,7 +241,6 @@ J164_6_OFILES_UT=\ gen164/6/ut_repo.o \ gen164/6/ut_rest.o \ gen164/6/ut_seek.o \ - gen164/6/ut_sift.o \ gen164/6/ut_swab.o \ gen164/6/ut_tack.o \ gen164/6/ut_tock.o \ @@ -330,27 +328,10 @@ $(BIN)/vere: $(LIBCRE) $(VERE_OFILES) $(LIBUV) $(LIBRE2) $(LIBED25519) $(BPT_O) meme: $(BIN)/meme -MEME_OFILES=f/meme.o \ - gen164/1/add.o \ - gen164/1/dec.o \ - gen164/1/gth.o \ - gen164/1/sub.o \ - gen164/2/flop.o \ - gen164/3/bex.o \ - gen164/3/cat.o \ - gen164/3/cut.o \ - gen164/3/can.o \ - gen164/3/end.o \ - gen164/3/mix.o \ - gen164/3/met.o \ - gen164/3/lsh.o \ - gen164/5/rub.o \ - gen164/5/mat.o \ - gen164/5/cue.o \ - gen164/5/jam.o +MEME_OFILES=f/meme.o $(J164_OFILES) $(CRE2_OFILES) -$(BIN)/meme: $(MEME_OFILES) - $(CLD) -g $(CLDOSFLAGS) -o $(BIN)/meme $(MEME_OFILES) -lgmp +$(BIN)/meme: $(MEME_OFILES) $(LIBED25519) + $(CLD) -g $(CLDOSFLAGS) -o $(BIN)/meme $(MEME_OFILES) $(LIBRE2) $(LIBED25519) -lgmp tags: ctags -R -f .tags --exclude=root diff --git a/f/meme.c b/f/meme.c index 2e18c76b3..385ca1243 100644 --- a/f/meme.c +++ b/f/meme.c @@ -1655,6 +1655,17 @@ u2_ci_molt(u2_noun som, ...) return pro; } +/* u2_cx_good(): test for u2_none. +*/ +u2_noun +u2_cx_good(u2_weak som) +{ + if ( u2_none == som ) { + return u2_cm_bail(c3__exit); + } + else return som; +} + /* u2_cx_at (u2at): fragment. */ u2_noun @@ -3412,6 +3423,564 @@ u2_ch_free(u2_ch_root* har_u) u2_ca_free(har_u); } +/* u2_cz_find(): find in memo cache. Arguments retained. +*/ +u2_weak +u2_cz_find(u2_mote fun, u2_noun one) +{ + u2_noun key = u2nc(fun, u2k(one)); + u2_noun val; + + val = u2_ch_get(u2R->cax.sav, key); + u2z(key); + return val; +} +u2_weak +u2_cz_find_2(u2_mote fun, u2_noun one, u2_noun two) +{ + u2_noun key = u2nt(fun, u2k(one), u2k(two)); + u2_noun val; + + val = u2_ch_get(u2R->cax.sav, key); + u2z(key); + return val; +} +u2_weak +u2_cz_find_3(u2_mote fun, u2_noun one, u2_noun two, u2_noun tri) +{ + u2_noun key = u2nq(fun, u2k(one), u2k(two), u2k(tri)); + u2_noun val; + + val = u2_ch_get(u2R->cax.sav, key); + u2z(key); + return val; +} +u2_weak +u2_cz_find_4(u2_mote fun, u2_noun one, u2_noun two, u2_noun tri, u2_noun qua) +{ + u2_noun key = u2nc(fun, u2nq(u2k(one), u2k(two), u2k(tri), u2k(qua))); + u2_noun val; + + val = u2_ch_get(u2R->cax.sav, key); + u2z(key); + return val; +} + +/* u2_cz_save*(): save in memo cache. +*/ +u2_noun +u2_cz_save(u2_mote fun, u2_noun one, u2_noun val) +{ + u2_noun key = u2nc(fun, u2k(one)); + + u2_ch_put(u2R->cax.sav, key, u2k(val)); + u2z(key); + return val; +} +u2_noun +u2_cz_save_2(u2_mote fun, u2_noun one, u2_noun two, u2_noun val) +{ + u2_noun key = u2nt(fun, u2k(one), u2k(two)); + + u2_ch_put(u2R->cax.sav, key, u2k(val)); + u2z(key); + return val; +} +u2_noun +u2_cz_save_3(u2_mote fun, u2_noun one, u2_noun two, u2_noun tri, u2_noun val) +{ + u2_noun key = u2nq(fun, u2k(one), u2k(two), u2k(tri)); + + u2_ch_put(u2R->cax.sav, key, u2k(val)); + u2z(key); + return val; +} +u2_noun +u2_cz_save_4(u2_mote fun, + u2_noun one, + u2_noun two, + u2_noun tri, + u2_noun qua, + u2_noun val) +{ + u2_noun key = u2nc(fun, u2nq(u2k(one), u2k(two), u2k(tri), u2k(qua))); + + u2_ch_put(u2R->cax.sav, key, u2k(val)); + u2z(key); + return val; +} + +/* u2_cz_uniq(): uniquify with memo cache. +*/ +u2_noun +u2_cz_uniq(u2_noun som) +{ + u2_noun key = u2nc(c3__uniq, u2k(som)); + u2_noun val = u2_ch_get(u2R->cax.sav, key); + + if ( u2_none != val ) { + u2z(key); u2z(som); return val; + } + else { + u2_ch_put(u2R->cax.sav, key, u2k(som)); + return som; + } +} + +/* u2_ct_push(): push on trace stack. +*/ +void +u2_ct_push(u2_noun mon) +{ +} + +/* u2_ct_mean(): push `[%mean roc]` on trace stack. +*/ +void +u2_ct_mean(u2_noun roc) +{ +} + +/* u2_ct_drop(): drop from meaning stack. +*/ +void +u2_ct_drop(void); + +/* u2_ct_slog(): print directly. +*/ +void +u2_ct_slog(u2_noun hod); + +/* _cn_hint(): process hint. +*/ +static u2_noun +_cn_hint(u2_noun zep, + u2_noun hod, + u2_noun bus, + u2_noun nex) +{ + switch ( zep ) { + default: { + u2_ca_lose(zep); + u2_ca_lose(hod); + + return u2_cn_nock_on(bus, nex); + } + + case c3__hunk: + case c3__lose: + case c3__mean: + case c3__spot: { + u2_noun tac = u2nc(zep, hod); + u2_noun pro; + + u2_ct_push(tac); +#if 0 + if ( c3__spot == zep ) { + printf("spot %d/%d : %d/%d\n", + u2h(u2h(u2t(hod))), + u2t(u2h(u2t(hod))), + u2h(u2t(u2t(hod))), + u2t(u2t(u2t(hod)))); + } +#endif + pro = u2_cn_nock_on(bus, nex); + u2_ct_drop(); + + return pro; + } + + case c3__slog: { + u2_ct_slog(hod); + return u2_cn_nock_on(bus, nex); + } + + case c3__germ: { + u2_noun pro = u2_cn_nock_on(bus, nex); + + if ( u2_yes == u2_cr_sing(pro, hod) ) { + u2z(pro); return hod; + } else { + u2z(hod); return pro; + } + } + + case c3__fast: { + u2_noun pro = u2_cn_nock_on(bus, nex); + + /* XX: translate hod to old clue form. + */ + { + u2_noun p_hod, q_hod, r_hod; + + if ( u2_no == u2_cr_trel(hod, &p_hod, &q_hod, &r_hod) ) { + u2z(hod); + return pro; + } + else { + u2_noun xod; + + if ( u2_yes == u2du(q_hod) && + (1 == u2h(q_hod)) && + (0 == u2t(q_hod)) ) { + q_hod = 0; + } + xod = u2nt(u2k(q_hod), u2k(p_hod), u2k(r_hod)); + u2z(hod); + hod = xod; + } + } + return u2_cj_mine(hod, pro); + } + + case c3__memo: { + u2z(hod); + { + u2_noun pro = u2_cz_find_2(c3__nock, bus, nex); + + if ( pro != u2_none ) { + u2z(bus); u2z(nex); + return pro; + } + pro = u2_cn_nock_on(bus, nex); + + u2_cz_save_2(c3__nock, bus, nex, pro); + u2z(bus); u2z(nex); + } + } + + case c3__sole: { + u2z(hod); + { + u2_noun pro = u2_cn_nock_on(bus, nex); + + return u2_cz_uniq(pro); + } + } + } +} + +/* u2_cn_nock_on(): produce .*(bus fol). Do not virtualize. +*/ +u2_noun +u2_cn_nock_on(u2_noun bus, u2_noun fol) +{ + u2_noun hib, gal; + + while ( 1 ) { + hib = u2h(fol); + gal = u2t(fol); + + if ( u2_yes == u2_cr_du(hib) ) { + u2_noun poz, riv; + + poz = u2_cn_nock_on(u2k(bus), u2k(hib)); + riv = u2_cn_nock_on(bus, u2k(gal)); + + u2_ca_lose(fol); + return u2_ci_cell(poz, riv); + } + else switch ( hib ) { + default: return u2_cm_bail(c3__exit); + + case 0: { + if ( u2_no == u2_cr_ud(gal) ) { + return u2_cm_bail(c3__exit); + } + else { + u2_noun pro = u2k(u2at(gal, bus)); + + u2_ca_lose(bus); u2_ca_lose(fol); + return pro; + } + } + c3_assert(!"not reached"); + + case 1: { + u2_noun pro = u2k(gal); + + u2_ca_lose(bus); u2_ca_lose(fol); + return pro; + } + c3_assert(!"not reached"); + + case 2: { + u2_noun nex = u2_cn_nock_on(u2k(bus), u2k(u2t(gal))); + u2_noun seb = u2_cn_nock_on(bus, u2k(u2h(gal))); + + u2_ca_lose(fol); + bus = seb; + fol = nex; + continue; + } + c3_assert(!"not reached"); + + case 3: { + u2_noun gof, pro; + + gof = u2_cn_nock_on(bus, u2k(gal)); + pro = u2_cr_du(gof); + + u2_ca_lose(gof); u2_ca_lose(fol); + return pro; + } + c3_assert(!"not reached"); + + case 4: { + u2_noun gof, pro; + + gof = u2_cn_nock_on(bus, u2k(gal)); + pro = u2_ci_vint(gof); + + u2_ca_lose(fol); + return pro; + } + c3_assert(!"not reached"); + + case 5: { + u2_noun wim = u2_cn_nock_on(bus, u2k(gal)); + u2_noun pro = u2_cr_sing(u2h(wim), u2t(wim)); + + u2_ca_lose(wim); u2_ca_lose(fol); + return pro; + } + c3_assert(!"not reached"); + + case 6: { + u2_noun b_gal, c_gal, d_gal; + + u2_cx_trel(gal, &b_gal, &c_gal, &d_gal); + { + u2_noun tys = u2_cn_nock_on(u2k(bus), u2k(b_gal)); + u2_noun nex; + + if ( 0 == tys ) { + nex = u2k(c_gal); + } else if ( 1 == tys ) { + nex = u2k(d_gal); + } else return u2_cm_bail(c3__exit); + + u2_ca_lose(fol); + fol = nex; + continue; + } + } + c3_assert(!"not reached"); + + case 7: { + u2_noun b_gal, c_gal; + + u2_cx_cell(gal, &b_gal, &c_gal); + { + u2_noun bod = u2_cn_nock_on(bus, u2k(b_gal)); + u2_noun nex = u2k(c_gal); + + u2_ca_lose(fol); + bus = bod; + fol = nex; + continue; + } + } + c3_assert(!"not reached"); + + case 8: { + u2_noun b_gal, c_gal; + + u2_cx_cell(gal, &b_gal, &c_gal); + { + u2_noun heb = u2_cn_nock_on(u2k(bus), u2k(b_gal)); + u2_noun bod = u2nc(heb, bus); + u2_noun nex = u2k(c_gal); + + u2_ca_lose(fol); + bus = bod; + fol = nex; + continue; + } + } + c3_assert(!"not reached"); + + case 9: { + u2_noun b_gal, c_gal; + + u2_cx_cell(gal, &b_gal, &c_gal); + if ( u2_no == u2_cr_ud(b_gal) ) { + return u2_cm_bail(c3__exit); + } + else { + u2_noun seb = u2_cn_nock_on(bus, u2k(c_gal)); + u2_weak xip; + + xip = u2_cj_find(u2k(seb)); + + if ( u2_none != xip ) { + u2_noun pro = u2_cj_kick(xip, seb, b_gal); + + u2_ca_lose(fol); + return pro; + } + else { + u2_noun nex = u2k(u2at(b_gal, seb)); + + u2_ca_lose(fol); + bus = seb; + fol = nex; + continue; + } + } + } + c3_assert(!"not reached"); + + case 10: { + u2_noun p_gal, q_gal; + + u2_cx_cell(gal, &p_gal, &q_gal); + { + u2_noun zep, hod, nex; + + if ( u2_yes == u2_cr_du(p_gal) ) { + u2_noun b_gal = u2h(p_gal); + u2_noun c_gal = u2t(p_gal); + u2_noun d_gal = q_gal; + + zep = u2k(b_gal); + hod = u2_cn_nock_on(u2k(bus), u2k(c_gal)); + nex = u2k(d_gal); + } + else { + u2_noun b_gal = p_gal; + u2_noun c_gal = q_gal; + + zep = u2k(b_gal); + hod = u2_nul; + nex = u2k(c_gal); + } + + u2_ca_lose(fol); + return _cn_hint(zep, hod, bus, nex); + } + } + + case 11: { + c3_assert(!"11 remains stubbed out"); + } + c3_assert(!"not reached"); + } + } +} + +/* u2_cn_kick_on(): fire `gat` without changing the sample. +*/ +u2_noun +u2_cn_kick_on(u2_noun gat) +{ + u2_noun xip; + + if ( u2_none != (xip = u2_cj_find(gat)) ) { + return u2_cj_kick(xip, gat, 2); + } + else { + return u2_cn_nock_on(gat, u2k(u2h(gat))); + } +} + +/* u2_cn_slam_on(): produce (gat sam). +*/ +u2_noun +u2_cn_slam_on(u2_noun gat, u2_noun sam) +{ + u2_noun cor = u2nc(u2k(u2h(gat)), u2nc(sam, u2k(u2t(u2t(gat))))); + + u2z(gat); + return u2_cn_kick_on(cor); +} + +/* u2_cn_nock_un(): produce .*(bus fol), as ++toon. +*/ +u2_noun +u2_cn_nock_un(u2_noun bus, u2_noun fol) +{ + u2_noun ton; + + u2_cm_leap(); + if ( u2_no == u2_cm_trap() ) { + u2_noun ton; + + if ( 0 != u2R->net.nyd ) { + ton = u2nc(1, u2R->net.nyd); + } else { + ton = u2nc(2, u2R->bug.tax); + } + u2_cm_fall(); + ton = u2_ca_gain(ton); + u2_cm_flog(0); + } + else { + u2_noun pro = u2_cn_nock_on(bus, fol); + + u2_cm_fall(); + ton = u2nc(0, u2_ca_gain(pro)); + } + u2z(bus); u2z(fol); return ton; +} + +/* u2_cn_slam_un(): produce (gat sam), as ++toon. +*/ +u2_noun +u2_cn_slam_un(u2_noun gat, u2_noun sam) +{ + u2_noun ton; + + u2_cm_leap(); + if ( u2_no == u2_cm_trap() ) { + u2_noun ton; + + if ( 0 != u2R->net.nyd ) { + ton = u2nc(1, u2R->net.nyd); + } else { + ton = u2nc(2, u2R->bug.tax); + } + u2_cm_fall(); + ton = u2_ca_gain(ton); + u2_cm_flog(0); + } + else { + u2_noun pro = u2_cn_slam_on(gat, sam); + + u2_cm_fall(); + ton = u2nc(0, u2_ca_gain(pro)); + } + u2z(gat); u2z(sam); return ton; +} + +/* u2_cn_nock_in(): produce .*(bus fol), as ++toon, in namespace. +*/ +u2_noun +u2_cn_nock_in(u2_noun fly, u2_noun bus, u2_noun fol) +{ + // XX implement 11 + // + u2z(fly); return u2_cn_nock_un(bus, fol); +} + +/* u2_cn_slam_in(): produce (gat sam), as ++toon, in namespace. +*/ +u2_noun +u2_cn_slam_in(u2_noun fly, u2_noun gat, u2_noun sam) +{ + // XX implement 11 + // + u2z(fly); return u2_cn_slam_un(gat, sam); +} + +/* u2_cn_nock_an(): as slam_in(), but with empty fly. +*/ +u2_noun +u2_cn_nock_an(u2_noun bus, u2_noun fol) +{ + return u2_cn_nock_un(bus, fol); +} + #if 0 static c3_w* _test_walloc(c3_w siz_w) @@ -3538,7 +4107,6 @@ u2_cka_add(u2_noun a, u2_noun b) return c; } -#if 0 /* u2_cka_sub(): a + b. */ u2_noun @@ -3650,7 +4218,7 @@ u2_ckd_by_get(u2_noun a, u2_noun b) u2z(c); return u2_none; } else { - u2_noun pro = u2_ct(u2t(c)); + u2_noun pro = u2k(u2t(c)); u2z(c); return pro; @@ -3754,7 +4322,6 @@ u2_ckd_in_tap(u2_noun a, u2_noun b) } else return c; } -#endif /* u2_cke_cue(): expand saved pill. */ @@ -3779,7 +4346,6 @@ u2_cke_jam(u2_noun a) return b; } -#if 0 /* u2_cke_trip(): atom to tape. */ u2_atom @@ -3790,20 +4356,6 @@ u2_cke_trip(u2_noun a) u2z(a); return b; } -#endif - -#if 0 -static c3_w -_depth(u2_noun som) -{ - if ( u2_so(u2_co_is_atom(som)) ) { - return 1; - } - else { - return c3_max(1 + _depth(u2_co_h(som)), 1 + _depth(u2_co_t(som))); - } -} -#endif // Wordy. diff --git a/f/zock.c b/f/zock.c index 9841c7873..98adb9c38 100644 --- a/f/zock.c +++ b/f/zock.c @@ -5,432 +5,3 @@ #include "f/meme.h" -/* _cn_hint(): process hint. -*/ -static u2_noun -_cn_hint(u2_noun zep, - u2_noun hod, - u2_noun bus, - u2_noun nex) -{ - switch ( zep ) { - default: { - u2_ca_lose(zep); - u2_ca_lose(hod); - - return u2_ca_nock_on(bus, nex); - } - - case c3__hunk: - case c3__lose: - case c3__mean: - case c3__spot: { - u2_noun tac = u2nc(zep, hod); - u2_noun pro; - - u2_ct_push(tac); -#if 0 - if ( c3__spot == zep ) { - printf("spot %d/%d : %d/%d\n", - u2h(u2h(u2t(hod))), - u2t(u2h(u2t(hod))), - u2h(u2t(u2t(hod))), - u2t(u2t(u2t(hod)))); - } -#endif - pro = u2_ca_nock_on(bus, nex); - u2_ct_drop(); - - return pro; - } - - case c3__slog: { - u2_ct_slog(hod); - return u2_ca_nock_on(bus, nex); - } - - case c3__germ: { - pro = u2_ca_nock_on(bus, nex); - - if ( u2_yes == u2_sing(pro, hod) ) { - u2z(pro); return hod; - } else { - u2z(hod); return pro; - } - } - - case c3__fast: { - u2_noun pro = u2_ca_nock_on(bus, nex); - - /* XX: translate hod to old clue form. - */ - { - u2_noun p_hod, q_hod, r_hod; - - if ( u2_no == u2_as_trel(hod, &p_hod, &q_hod, &r_hod) ) { - u2z(hod); - return pro; - } - else { - u2_noun xod; - - if ( u2_yes == u2_dust(q_hod) && - (_1 == u2_h(q_hod)) && - (_0 == u2_t(q_hod)) ) { - q_hod = 0; - } - xod = u2nt(u2k(q_hod), u2k(p_hod), u2k(r_hod)); - u2z(hod); - hod = xod; - } - } - return u2_cj_mine(hod, pro); - } - - case c3__memo: { - u2z(hod); - { - u2_noun pro = u2_cz_find_2(c3__nock, bus, nex); - - if ( pro != u2_none ) { - u2z(bus); u2z(nex); - return pro; - } - pro = u2_ca_nock_on(bus, nex); - - u2_cz_save_2(c3__nock, bus, nex, pro); - u2z(bus); u2z(nex); - } - } - - case c3__sole: { - u2z(hod); - { - u2_noun pro = u2_ca_nock_on(bus, nex); - - return u2_cz_uniq(pro); - } - } - } -} - -/* u2_cn_nock_on(): produce .*(bus fol). Do not virtualize. -*/ -u2_noun -u2_cn_nock_on(u2_noun bus, u2_noun fol) -{ - u2_noun hib, gal; - - while ( 1 ) { - hib = u2h(fol); - gal = u2t(fol); - - if ( u2_yes == u2_cr_du(hib) ) { - u2_noun poz, riv; - - poz = u2_cn_nock_on(u2k(bus), u2k(hib)); - riv = u2_cn_nock_on(bus, u2k(gal)); - - u2_ca_lose(fol); - return u2_cn_cell(poz, riv); - } - else switch ( hib ) { - default: return u2_cm_bail(c3__exit); - - case 0: { - if ( u2_no == u2_cr_ud(gal) ) { - return u2_cm_bail(c3__exit); - } - else { - u2_noun pro = u2k(u2at(gal, bus)); - - u2_ca_lose(bus); u2_ca_lose(fol); - return pro; - } - } - c3_assert(!"not reached"); - - case 1: { - u2_noun pro = u2k(gal); - - u2_ca_lose(bus); u2_ca_lose(fol); - return pro; - } - c3_assert(!"not reached"); - - case 2: { - u2_noun nex = u2_cn_nock_on(u2k(bus), u2k(u2t(gal))); - u2_noun seb = u2_cn_nock_on(bus, u2k(u2h(gal))); - - u2_ca_lose(fol); - bus = seb; - fol = nex; - continue; - } - c3_assert(!"not reached"); - - case 3: { - u2_noun gof, pro; - - gof = u2_cn_nock_on(bus, u2k(gal)); - pro = u2_cr_du(gof); - - u2_ca_lose(gof); u2_ca_lose(fol); - return pro; - } - c3_assert(!"not reached"); - - case 4: { - u2_noun gof, pro; - - gof = u2_cn_nock_on(bus, u2k(gal)); - pro = u2_ci_vint(u2_Wire, gof); - - u2_ca_lose(gof); u2_ca_lose(fol); - return pro; - } - c3_assert(!"not reached"); - - case 5: { - u2_noun wim = u2_cn_nock_on(bus, u2k(gal)); - u2_noun pro = u2_cr_sing(u2h(wim), u2t(wim)); - - u2_ca_lose(wim); u2_ca_lose(fol); - return pro; - } - c3_assert(!"not reached"); - - case 6: { - u2_noun b_gal, c_gal, d_gal; - - u2_cx_trel(gal, &b_gal, &c_gal, &d_gal); - { - u2_noun tys = u2_cn_nock_on(u2k(bus), u2k(b_gal)); - u2_noun nex; - - if ( 0 == tys ) { - nex = u2k(c_gal); - } else if ( 1 == tys ) { - nex = u2k(d_gal); - } else return u2_cm_bail(c3__exit); - - u2_ca_lose(fol); - fol = nex; - continue; - } - } - c3_assert(!"not reached"); - - case 7: { - u2_noun b_gal, c_gal; - - u2_cx_cell(gal, &b_gal, &c_gal); - { - u2_noun bod = u2_cn_nock_on(bus, u2k(b_gal)); - u2_noun nex = u2k(c_gal); - - u2_ca_lose(fol); - bus = bod; - fol = nex; - continue; - } - } - c3_assert(!"not reached"); - - case 8: { - u2_noun b_gal, c_gal; - - u2_cx_cell(gal, &b_gal, &c_gal); - { - u2_noun heb = u2_cn_nock_on(u2k(bus), u2k(b_gal)); - u2_noun bod = u2nc(heb, bus); - u2_noun nex = u2k(c_gal); - - u2_ca_lose(fol); - bus = bod; - fol = nex; - continue; - } - } - c3_assert(!"not reached"); - - case 9: { - u2_noun b_gal, c_gal; - - u2_cx_cell(gal, &b_gal, &c_gal); - if ( u2_no == u2_cr_ud(b_gal) ) { - return u2_cm_bail(c3__exit); - } - else { - u2_noun seb = u2_cn_nock_on(bus, u2k(c_gal)); - u2_weak xip; - - xip = u2_cj_find(u2k(seb)); - - if ( u2_none != xip ) { - u2_noun pro = u2_cj_kick(xip, seb, b_gal); - - u2_ca_lose(fol); - return pro; - } - else { - u2_noun nex = u2k(u2at(b_gal, seb)); - - u2_ca_lose(fol); - bus = seb; - fol = nex; - continue; - } - } - } - c3_assert(!"not reached"); - - case 10: { - u2_noun p_gal, q_gal; - - u2_cx_cell(gal, &p_gal, &q_gal); - { - u2_noun zep, hod, nex, pro; - - if ( u2_yes == u2_cr_du(p_gal) ) { - u2_noun b_gal = u2h(p_gal); - u2_noun c_gal = u2t(p_gal); - u2_noun d_gal = q_gal; - - zep = u2k(b_gal); - hod = u2_cn_nock_on(u2k(bus), u2k(c_gal)); - nex = u2k(d_gal); - } - else { - u2_noun b_gal = p_gal; - u2_noun c_gal = q_gal; - - zep = u2k(b_gal); - hod = u2_nul; - nex = u2k(c_gal); - } - - u2_ca_lose(fol); - pro = _cn_hint(zep, hod, bus, nex, 0); - return pro; - } - } - - case 11: { - c3_assert(!"11 remains stubbed out"); - } - c3_assert(!"not reached"); - } - } -} - -/* u2_cn_kick_on(): fire `gat` without changing the sample. -*/ -u2_noun -u2_cn_kick_on(u2_noun gat) -{ - if ( u2_none != (xip = u2_cj_find(gat)) ) { - return u2_cj_kick(xip, gat, 2); - } - else { - return u2_cn_nock_on(gat, u2k(u2h(gat))); - } -} - -/* u2_cn_slam_on(): produce (gat sam). -*/ -u2_noun -u2_cn_slam_on(u2_noun gat, u2_noun sam) -{ - u2_noun cor, xip; - - cor = u2nc(u2k(u2h(gat)), u2nc(sam, u2k(u2t(u2t(gat))))); - u2z(gat); - return u2_cn_kick_on(cor); -} - -/* u2_cn_nock_un(): produce .*(bus fol), as ++toon. -*/ -u2_noun -u2_cn_nock_un(u2_noun bus, u2_noun fol) -{ - u2_noun ton; - - u2_cm_leap(); - if ( u2_no == u2_cm_trap() ) { - u2_noun ton; - - if ( 0 != u2R->net.nyd ) { - ton = u2nc(1, u2R->net.nyd); - } else { - ton = u2nc(2, u2R->bug.tax); - } - u2_cm_fall(); - ton = u2_ca_gain(ton); - u2_cm_flog(0); - } - else { - u2_noun pro = u2_cn_nock_on(bus, fol); - - u2_cm_fall(); - ton = u2nc(0, u2_ca_gain(pro); - } - u2z(bus); u2z(fol); return ton; -} - -/* u2_cn_slam_un(): produce (gat sam), as ++toon. -*/ -u2_noun -u2_cn_slam_un(u2_noun gat, u2_noun sam) -{ - u2_noun ton; - - u2_cm_leap(); - if ( u2_no == u2_cm_trap() ) { - u2_noun ton; - - if ( 0 != u2R->net.nyd ) { - ton = u2nc(1, u2R->net.nyd); - } else { - ton = u2nc(2, u2R->bug.tax); - } - u2_cm_fall(); - ton = u2_ca_gain(ton); - u2_cm_flog(0); - } - else { - u2_noun pro = u2_cn_slam_on(gat, sam); - - u2_cm_fall(); - ton = u2nc(0, u2_ca_gain(pro); - } - u2z(gat); u2z(sam); return ton; -} - -/* u2_cn_nock_in(): produce .*(bus fol), as ++toon, in namespace. -*/ -u2_noun -u2_cn_nock_in(u2_noun fly, u2_noun bus, u2_noun fol) -{ - // XX implement 11 - // - u2z(fly); return u2_cn_nock_un(bus, fol); -} - -/* u2_cn_slam_in(): produce (gat sam), as ++toon, in namespace. -*/ -u2_noun -u2_cn_slam_in(u2_noun fly, u2_noun gat, u2_noun sam) -{ - // XX implement 11 - // - u2z(fly); return u2_cn_slam_un(bus, fol); -} - -/* u2_cn_nock_an(): as slam_in(), but with empty fly. -*/ -u2_noun -u2_cn_nock_an(u2_noun bus, u2_noun fol) -{ - return u2_cn_nock_un(bus, fol); -} diff --git a/gen164/5/co_emco.c b/gen164/5/co_emco.c index 0ec00a5fe..96a053914 100644 --- a/gen164/5/co_emco.c +++ b/gen164/5/co_emco.c @@ -13,6 +13,7 @@ [[bas=@ min=@] [par=$+([? @ tape] tape)]] */ +#if 0 u2_weak j2_md(Pt5, coco, co, emco)( u2_noun cor) @@ -52,6 +53,7 @@ // rex (par =(0 dar) rad rex) } } + /* structures */ u2_ho_jet @@ -59,3 +61,4 @@ { ".2", c3__lite, j2_md(Pt5, coco, co, emco), u2_jet_dead, u2_none, u2_none }, { } }; +#endif diff --git a/gen164/6/ut.c b/gen164/6/ut.c index 9e21117f4..d0e80e487 100644 --- a/gen164/6/ut.c +++ b/gen164/6/ut.c @@ -138,9 +138,9 @@ extern u2_ho_jet j2_mcj(Pt6, ut, firm)[]; extern u2_ho_jet j2_mcj(Pt6, ut, fish)[]; extern u2_ho_jet j2_mcj(Pt6, ut, fuse)[]; - extern u2_ho_jet j2_mcj(Pt6, ut, gain)[]; + // extern u2_ho_jet j2_mcj(Pt6, ut, gain)[]; extern u2_ho_jet j2_mcj(Pt6, ut, heal)[]; - extern u2_ho_jet j2_mcj(Pt6, ut, lose)[]; + // extern u2_ho_jet j2_mcj(Pt6, ut, lose)[]; extern u2_ho_jet j2_mcj(Pt6, ut, mint)[]; extern u2_ho_jet j2_mcj(Pt6, ut, mull)[]; extern u2_ho_jet j2_mcj(Pt6, ut, nest)[]; @@ -149,8 +149,8 @@ extern u2_ho_jet j2_mcj(Pt6, ut, play)[]; extern u2_ho_jet j2_mcj(Pt6, ut, rest)[]; extern u2_ho_jet j2_mcj(Pt6, ut, seek)[]; - extern u2_ho_jet j2_mcj(Pt6, ut, sift)[]; - extern u2_ho_jet j2_mcj(Pt6, ut, tack)[]; + // extern u2_ho_jet j2_mcj(Pt6, ut, sift)[]; + // extern u2_ho_jet j2_mcj(Pt6, ut, tack)[]; extern u2_ho_jet j2_mcj(Pt6, ut, tock)[]; /* structures @@ -167,9 +167,9 @@ { j2_sc(Pt6, ut, firm), j2_mcj(Pt6, ut, firm), 0, 0, u2_none }, { j2_sc(Pt6, ut, fish), j2_mcj(Pt6, ut, fish), 0, 0, u2_none }, { j2_sc(Pt6, ut, fuse), j2_mcj(Pt6, ut, fuse), 0, 0, u2_none }, - { j2_sc(Pt6, ut, gain), j2_mcj(Pt6, ut, gain), 0, 0, u2_none }, + // { j2_sc(Pt6, ut, gain), j2_mcj(Pt6, ut, gain), 0, 0, u2_none }, { j2_sc(Pt6, ut, heal), j2_mcj(Pt6, ut, heal), 0, 0, u2_none }, - { j2_sc(Pt6, ut, lose), j2_mcj(Pt6, ut, lose), 0, 0, u2_none }, + // { j2_sc(Pt6, ut, lose), j2_mcj(Pt6, ut, lose), 0, 0, u2_none }, { j2_sc(Pt6, ut, mint), j2_mcj(Pt6, ut, mint), 0, 0, u2_none }, { j2_sc(Pt6, ut, mull), j2_mcj(Pt6, ut, mull), 0, 0, u2_none }, { j2_sc(Pt6, ut, nest), j2_mcj(Pt6, ut, nest), 0, 0, u2_none }, @@ -178,8 +178,8 @@ { j2_sc(Pt6, ut, play), j2_mcj(Pt6, ut, play), 0, 0, u2_none }, { j2_sc(Pt6, ut, rest), j2_mcj(Pt6, ut, rest), 0, 0, u2_none }, { j2_sc(Pt6, ut, seek), j2_mcj(Pt6, ut, seek), 0, 0, u2_none }, - { j2_sc(Pt6, ut, sift), j2_mcj(Pt6, ut, sift), 0, 0, u2_none }, - { j2_sc(Pt6, ut, tack), j2_mcj(Pt6, ut, tack), 0, 0, u2_none }, + // { j2_sc(Pt6, ut, sift), j2_mcj(Pt6, ut, sift), 0, 0, u2_none }, + // { j2_sc(Pt6, ut, tack), j2_mcj(Pt6, ut, tack), 0, 0, u2_none }, { j2_sc(Pt6, ut, tock), j2_mcj(Pt6, ut, tock), 0, 0, u2_none }, { } }; diff --git a/gen164/6/ut_busk.c b/gen164/6/ut_busk.c index a9b43ed50..f51efaec4 100644 --- a/gen164/6/ut_busk.c +++ b/gen164/6/ut_busk.c @@ -29,8 +29,7 @@ /* boilerplate */ u2_noun // transfer - j2_mc(Pt6, ut, busk)( - u2_noun cor) // retain + j2_mc(Pt6, ut, busk)(u2_noun cor) // retain { u2_noun sut, cog, hyp, van; @@ -47,66 +46,17 @@ } } - u2_weak // transfer - j2_mci(Pt6, ut, busk)( - u2_noun van, // retain - u2_noun sut, // retain - u2_noun cog, // retain - u2_noun hyp) // retain - { - u2_weak hoc = u2_cj_look(u2k(van), "busk"); - - if ( u2_none == hoc ) { - c3_assert(!"register busk"); - return u2_none; - } else { - u2_weak von = u2_ci_molt(u2k(van), u2_cv_sam, u2k(sut), 0); - u2_weak gat = u2_cn_nock_on(von, hoc); - u2_weak cor = u2_ci_molt(u2k(gat), u2_cv_sam_2, u2k(cog), - u2_cv_sam_3, u2k(hyp), 0); - - if ( (u2_none == j2_mcj(Pt6, ut, busk)[0].xip) ) { - u2_noun xip = u2_cj_find(u2k(cor)); - - c3_assert(u2_none != xip); - j2_mcj(Pt6, ut, busk)[0].xip = xip; - } - u2z(gat); - return cor; - } - } - u2_noun // transfer - j2_mcy(Pt6, ut, busk)( - u2_noun van, // retain + j2_mcy(Pt6, ut, busk)(u2_noun van, // retain u2_noun sut, // retain u2_noun cog, // retain u2_noun hyp) // retain { - u2_ho_jet *jet_j = &j2_mcj(Pt6, ut, busk)[0]; - - if ( (jet_j->sat_s & u2_jet_live) && !(jet_j->sat_s & u2_jet_test) ) { - return j2_mcx(Pt6, ut, busk)(van, sut, cog, hyp); - } - else { - u2_noun cor, fol, pro; - - cor = j2_mci(Pt6, ut, busk)(van, sut, cog, hyp); - fol = u2h(cor); - - pro = u2_ho_use(jet_j, cor, fol); - if ( u2_none == pro ) return u2_cm_bail(c3__fail); - - u2z(cor); - u2z(fol); - - return pro; - } + return j2_mcx(Pt6, ut, busk)(van, sut, cog, hyp); } u2_weak - j2_mck(Pt6, ut, busk)( - u2_noun cor) + j2_mck(Pt6, ut, busk)(u2_noun cor) { u2_noun sut, hyp, van; diff --git a/gen164/6/ut_bust.c b/gen164/6/ut_bust.c index e1df12a02..48d34c266 100644 --- a/gen164/6/ut_bust.c +++ b/gen164/6/ut_bust.c @@ -39,8 +39,7 @@ j2_mcj(Pt6, ut, bust)[]; u2_noun // transfer - j2_mc(Pt6, ut, bust)( - u2_noun cor) // retain + j2_mc(Pt6, ut, bust)(u2_noun cor) // retain { u2_noun sut, dib, van; @@ -53,78 +52,30 @@ } } - u2_weak // transfer - j2_mci(Pt6, ut, bust)( - u2_noun van, // retain - u2_noun sut, // retain - u2_noun dib) // retain - { - u2_weak hoc = u2_cj_look(u2k(van), "bust"); - - if ( u2_none == hoc ) { - c3_assert(!"register bust"); - return u2_none; - } else { - u2_weak von = u2_ci_molt(u2k(van), u2_cv_sam, u2k(sut), 0); - u2_weak gat = u2_cn_nock_on(von, hoc); - u2_weak cor = u2_ci_molt(u2k(gat), u2_cv_sam, u2k(dib), 0); - - if ( (u2_none == j2_mcj(Pt6, ut, bust)[0].xip) ) { - u2_noun xip = u2_cj_find(u2k(cor)); - - c3_assert(u2_none != xip); - j2_mcj(Pt6, ut, bust)[0].xip = xip; - } - u2z(gat); - return cor; - } - } - u2_noun // transfer - j2_mcy(Pt6, ut, bust)( - u2_noun van, // retain + j2_mcy(Pt6, ut, bust)(u2_noun van, // retain u2_noun sut, // retain u2_noun dib) // retain { - u2_ho_jet *jet_j = &j2_mcj(Pt6, ut, bust)[0]; - - if ( (jet_j->sat_s & u2_jet_live) && !(jet_j->sat_s & u2_jet_test) ) { - if ( !(jet_j->sat_s & u2_jet_memo) ) { - return j2_mcx(Pt6, ut, bust)(van, sut, dib); - } - else { - c3_m fun_m = c3__bust; - u2_noun pro = u2_cz_find_2(fun_m, sut, dib); - - if ( u2_none != pro ) { - return pro; - } - else { - pro = j2_mcx(Pt6, ut, bust)(van, sut, dib); - - return u2_cz_save_2(fun_m, sut, dib, pro); - } - } - } - else { - u2_noun cor, fol, pro; - - cor = j2_mci(Pt6, ut, bust)(van, sut, dib); - fol = u2h(cor); - - pro = u2_ho_use(jet_j, cor, fol); - if ( u2_none == pro ) return u2_cm_bail(c3__fail); - - u2z(cor); - u2z(fol); +#if 1 + return j2_mcx(Pt6, ut, bust)(van, sut, dib); +#else + c3_m fun_m = c3__bust; + u2_noun pro = u2_cz_find_2(fun_m, sut, dib); + if ( u2_none != pro ) { return pro; } + else { + pro = j2_mcx(Pt6, ut, bust)(van, sut, dib); + + return u2_cz_save_2(fun_m, sut, dib, pro); + } +#endif } u2_weak - j2_mck(Pt6, ut, bust)( - u2_noun cor) + j2_mck(Pt6, ut, bust)(u2_noun cor) { u2_noun sut, dib, van; diff --git a/gen164/6/ut_conk.c b/gen164/6/ut_conk.c index 0e542b523..f195c1554 100644 --- a/gen164/6/ut_conk.c +++ b/gen164/6/ut_conk.c @@ -61,8 +61,7 @@ j2_mcj(Pt6, ut, conk)[]; u2_noun // transfer - j2_mc(Pt6, ut, conk)( - u2_noun cor) // retain + j2_mc(Pt6, ut, conk)(u2_noun cor) // retain { u2_noun sut, got, van; @@ -77,60 +76,12 @@ } } - u2_bean - j2_mci(Pt6, ut, conk)( - u2_noun van, // retain - u2_noun sut, // retain - u2_noun got) // retain - { - u2_weak hoc = u2_cj_look(u2k(van), "conk"); - - if ( u2_none == hoc ) { - c3_assert(!"register conk"); - return u2_none; - } else { - u2_weak von = u2_ci_molt(u2k(van), u2_cv_sam, u2k(sut), 0); - u2_weak gat = u2_cn_nock_on(von, hoc); - u2_weak cor = u2_ci_molt(u2k(gat), - u2_cv_sam, u2k(got), - 0); - - if ( (u2_none == j2_mcj(Pt6, ut, conk)[0].xip) ) { - u2_noun xip = u2_cj_find(u2k(cor)); - - c3_assert(u2_none != xip); - j2_mcj(Pt6, ut, conk)[0].xip = xip; - } - u2z(gat); - return cor; - } - } - u2_noun // transfer - j2_mcy(Pt6, ut, conk)( - u2_noun van, // retain + j2_mcy(Pt6, ut, conk)(u2_noun van, // retain u2_noun sut, // retain u2_noun got) // retain { - u2_ho_jet *jet_j = &j2_mcj(Pt6, ut, conk)[0]; - - if ( jet_j->sat_s == u2_jet_live ) { - return j2_mcx(Pt6, ut, conk)(van, sut, got); - } - else { - u2_noun cor, fol, pro; - - cor = j2_mci(Pt6, ut, conk)(van, sut, got); - fol = u2h(cor); - - pro = u2_ho_use(jet_j, cor, fol); - if ( u2_none == pro ) return u2_cm_bail(c3__fail); - - u2z(cor); - u2z(fol); - - return pro; - } + return j2_mcx(Pt6, ut, conk)(van, sut, got); } /* structures diff --git a/gen164/6/ut_crop.c b/gen164/6/ut_crop.c index 12cf99991..cae0f2433 100644 --- a/gen164/6/ut_crop.c +++ b/gen164/6/ut_crop.c @@ -247,78 +247,26 @@ } } - u2_weak // transfer - j2_mci(Pt6, ut, crop)( - u2_noun van, // retain - u2_noun sut, // retain - u2_noun ref) // retain - { - u2_weak hoc = u2_cj_look(u2k(van), "crop"); - - if ( u2_none == hoc ) { - c3_assert(!"register crop"); - return u2_none; - } else { - u2_weak von = u2_ci_molt(u2k(van), u2_cv_sam, u2k(sut), 0); - u2_weak gat = u2_cn_nock_on(von, hoc); - u2_weak cor = u2_ci_molt(u2k(gat), u2_cv_sam, u2k(ref), 0); - - if ( (u2_none == j2_mcj(Pt6, ut, crop)[0].xip) ) { - u2_noun xip = u2_cj_find(u2k(cor)); - - c3_assert(u2_none != xip); - j2_mcj(Pt6, ut, crop)[0].xip = xip; - } - u2z(gat); - return cor; - } - } - u2_noun // transfer - j2_mcy(Pt6, ut, crop)( - u2_noun van, // retain + j2_mcy(Pt6, ut, crop)(u2_noun van, // retain u2_noun sut, // retain u2_noun ref) // retain { - u2_ho_jet *jet_j = &j2_mcj(Pt6, ut, crop)[0]; + c3_m fun_m = c3__crop; + u2_noun pro = u2_cz_find_2(fun_m, sut, ref); - if ( (jet_j->sat_s & u2_jet_live) && !(jet_j->sat_s & u2_jet_test) ) { - if ( !(jet_j->sat_s & u2_jet_memo) ) { - return j2_mcx(Pt6, ut, crop)(van, sut, ref); - } - else { - c3_m fun_m = c3__crop; - u2_noun pro = u2_cz_find_2(fun_m, sut, ref); - - if ( u2_none != pro ) { - return pro; - } - else { - pro = j2_mcx(Pt6, ut, crop)(van, sut, ref); - - return u2_cz_save_2(fun_m, sut, ref, pro); - } - } + if ( u2_none != pro ) { + return pro; } else { - u2_noun cor, fol, pro; + pro = j2_mcx(Pt6, ut, crop)(van, sut, ref); - cor = j2_mci(Pt6, ut, crop)(van, sut, ref); - fol = u2h(cor); - - pro = u2_ho_use(jet_j, cor, fol); - if ( u2_none == pro ) return u2_cm_bail(c3__fail); - - u2z(cor); - u2z(fol); - - return pro; + return u2_cz_save_2(fun_m, sut, ref, pro); } } u2_weak - j2_mck(Pt6, ut, crop)( - u2_noun cor) + j2_mck(Pt6, ut, crop)(u2_noun cor) { u2_noun sut, ref, van; diff --git a/gen164/6/ut_cull.c b/gen164/6/ut_cull.c index f6e49d615..968acfd46 100644 --- a/gen164/6/ut_cull.c +++ b/gen164/6/ut_cull.c @@ -176,8 +176,7 @@ j2_mcj(Pt6, ut, cull)[]; u2_noun // transfer - j2_mc(Pt6, ut, cull)( - u2_noun cor) // retain + j2_mc(Pt6, ut, cull)(u2_noun cor) // retain { u2_noun sut, axe, pol, ref, van; @@ -194,86 +193,28 @@ } } - u2_weak // transfer - j2_mci(Pt6, ut, cull)( - u2_noun van, // retain - u2_noun sut, // retain - u2_bean pol, // retain - u2_atom axe, // retain - u2_noun ref) // retain - { - u2_weak hoc = u2_cj_look(u2k(van), "cull"); - - if ( u2_none == hoc ) { - c3_assert(!"register cull"); - return u2_none; - } else { - u2_weak von = u2_ci_molt(u2k(van), u2_cv_sam, u2k(sut), 0); - u2_weak gat = u2_cn_nock_on(von, hoc); - u2_weak cor = u2_ci_molt(u2k(gat), - u2_cv_sam_2, pol, - u2_cv_sam_6, u2k(axe), - u2_cv_sam_7, u2k(ref), - 0); - - if ( (u2_none == j2_mcj(Pt6, ut, cull)[0].xip) ) { - u2_noun xip = u2_cj_find(u2k(cor)); - - c3_assert(u2_none != xip); - j2_mcj(Pt6, ut, cull)[0].xip = xip; - } - u2z(gat); - return cor; - } - } - u2_noun // transfer - j2_mcy(Pt6, ut, cull)( - u2_noun van, // retain + j2_mcy(Pt6, ut, cull)(u2_noun van, // retain u2_noun sut, // retain u2_bean pol, // retain u2_noun axe, // retain u2_noun ref) // retain { - u2_ho_jet *jet_j = &j2_mcj(Pt6, ut, cull)[0]; + c3_m fun_m = c3__cull; + u2_noun pro = u2_cz_find_4(fun_m, sut, pol, axe, ref); - if ( (jet_j->sat_s & u2_jet_live) && !(jet_j->sat_s & u2_jet_test) ) { - if ( !(jet_j->sat_s & u2_jet_memo) ) { - return j2_mcx(Pt6, ut, cull)(van, sut, pol, axe, ref); - } - else { - c3_m fun_m = c3__cull; - u2_noun pro = u2_cz_find_4(fun_m, sut, pol, axe, ref); - - if ( u2_none != pro ) { - return pro; - } - else { - pro = j2_mcx(Pt6, ut, cull)(van, sut, pol, axe, ref); - - return u2_cz_save_4(fun_m, sut, pol, axe, ref, pro); - } - } + if ( u2_none != pro ) { + return pro; } else { - u2_noun cor, fol, pro; + pro = j2_mcx(Pt6, ut, cull)(van, sut, pol, axe, ref); - cor = j2_mci(Pt6, ut, cull)(van, sut, pol, axe, ref); - fol = u2h(cor); - - pro = u2_ho_use(jet_j, cor, fol); - if ( u2_none == pro ) return u2_cm_bail(c3__fail); - - u2z(cor); - u2z(fol); - - return pro; + return u2_cz_save_4(fun_m, sut, pol, axe, ref, pro); } } u2_weak - j2_mck(Pt6, ut, cull)( - u2_noun cor) + j2_mck(Pt6, ut, cull)(u2_noun cor) { u2_noun sut, pol, axe, ref, van; diff --git a/gen164/6/ut_find.c b/gen164/6/ut_find.c index 39378aa4f..7fe6d5f9d 100644 --- a/gen164/6/ut_find.c +++ b/gen164/6/ut_find.c @@ -714,39 +714,6 @@ } } - u2_weak // transfer - j2_mci(Pt6, ut, fino)( - u2_noun van, // retain - u2_noun sut, // retain - u2_noun dep, // retain - u2_noun way, // retain - u2_noun cog) // retain - { - u2_weak hoc = u2_cj_look(u2k(van), "fino"); - - if ( u2_none == hoc ) { - c3_assert(!"register fino"); - return u2_none; - } else { - u2_weak von = u2_ci_molt(u2k(van), u2_cv_sam, u2k(sut), 0); - u2_weak gat = u2_cn_nock_on(von, hoc); - u2_weak cor = u2_ci_molt(u2k(gat), - u2_cv_sam_2, u2k(dep), - u2_cv_sam_6, u2k(way), - u2_cv_sam_7, u2k(cog), - 0); - - if ( (u2_none == j2_mcj(Pt6, ut, fino)[0].xip) ) { - u2_noun xip = u2_cj_find(u2k(cor)); - - c3_assert(u2_none != xip); - j2_mcj(Pt6, ut, fino)[0].xip = xip; - } - u2z(gat); - return cor; - } - } - u2_noun // transfer j2_mcy(Pt6, ut, fino)( u2_noun van, // retain @@ -755,45 +722,21 @@ u2_noun way, // retain u2_noun cog) // retain { - u2_ho_jet *jet_j = &j2_mcj(Pt6, ut, fino)[0]; + c3_m fun_m = c3__fino; + u2_noun pro = u2_cz_find_4(fun_m, sut, dep, way, cog); - if ( (jet_j->sat_s & u2_jet_live) && !(jet_j->sat_s & u2_jet_test) ) { - if ( !(jet_j->sat_s & u2_jet_memo) ) { - return j2_mcx(Pt6, ut, fino)(van, sut, dep, way, cog); - } - else { - c3_m fun_m = c3__fino; - u2_noun pro = u2_cz_find_4(fun_m, sut, dep, way, cog); - - if ( u2_none != pro ) { - return pro; - } - else { - pro = j2_mcx(Pt6, ut, fino)(van, sut, dep, way, cog); - - return u2_cz_save_4(fun_m, sut, dep, way, cog, pro); - } - } + if ( u2_none != pro ) { + return pro; } else { - u2_noun cor, fol, pro; + pro = j2_mcx(Pt6, ut, fino)(van, sut, dep, way, cog); - cor = j2_mci(Pt6, ut, fino)(van, sut, dep, way, cog); - fol = u2h(cor); - - pro = u2_ho_use(jet_j, cor, fol); - if ( u2_none == pro ) return u2_cm_bail(c3__fail); - - u2z(cor); - u2z(fol); - - return pro; + return u2_cz_save_4(fun_m, sut, dep, way, cog, pro); } } u2_weak - j2_mck(Pt6, ut, fino)( - u2_noun cor) + j2_mck(Pt6, ut, fino)(u2_noun cor) { u2_noun sut, dep, way, cog, van; @@ -851,39 +794,6 @@ } } - u2_weak // transfer - j2_mci(Pt6, ut, find)( - u2_noun van, // retain - u2_noun sut, // retain - u2_noun dep, // retain - u2_noun way, // retain - u2_noun cog) // retain - { - u2_weak hoc = u2_cj_look(u2k(van), "find"); - - if ( u2_none == hoc ) { - c3_assert(!"register find"); - return u2_none; - } else { - u2_weak von = u2_ci_molt(u2k(van), u2_cv_sam, u2k(sut), 0); - u2_weak gat = u2_cn_nock_on(von, hoc); - u2_weak cor = u2_ci_molt(u2k(gat), - u2_cv_sam_2, u2k(dep), - u2_cv_sam_6, u2k(way), - u2_cv_sam_7, u2k(cog), - 0); - - if ( (u2_none == j2_mcj(Pt6, ut, find)[0].xip) ) { - u2_noun xip = u2_cj_find(u2k(cor)); - - c3_assert(u2_none != xip); - j2_mcj(Pt6, ut, find)[0].xip = xip; - } - u2z(gat); - return cor; - } - } - u2_noun // transfer j2_mcy(Pt6, ut, find)( u2_noun van, // retain @@ -892,39 +802,16 @@ u2_noun way, // retain u2_noun cog) // retain { - u2_ho_jet *jet_j = &j2_mcj(Pt6, ut, find)[0]; + c3_m fun_m = c3__find; + u2_noun pro = u2_cz_find_4(fun_m, sut, dep, way, cog); - if ( (jet_j->sat_s & u2_jet_live) && !(jet_j->sat_s & u2_jet_test) ) { - if ( !(jet_j->sat_s & u2_jet_memo) ) { - return j2_mcx(Pt6, ut, find)(van, sut, dep, way, cog); - } - else { - c3_m fun_m = c3__find; - u2_noun pro = u2_cz_find_4(fun_m, sut, dep, way, cog); - - if ( u2_none != pro ) { - return pro; - } - else { - pro = j2_mcx(Pt6, ut, find)(van, sut, dep, way, cog); - - return u2_cz_save_4(fun_m, sut, dep, way, cog, pro); - } - } + if ( u2_none != pro ) { + return pro; } else { - u2_noun cor, fol, pro; + pro = j2_mcx(Pt6, ut, find)(van, sut, dep, way, cog); - cor = j2_mci(Pt6, ut, find)(van, sut, dep, way, cog); - fol = u2h(cor); - - pro = u2_ho_use(jet_j, cor, fol); - if ( u2_none == pro ) return u2_cm_bail(c3__fail); - - u2z(cor); - u2z(fol); - - return pro; + return u2_cz_save_4(fun_m, sut, dep, way, cog, pro); } } diff --git a/gen164/6/ut_fink.c b/gen164/6/ut_fink.c index cf3573c22..f6356d50c 100644 --- a/gen164/6/ut_fink.c +++ b/gen164/6/ut_fink.c @@ -52,8 +52,7 @@ j2_mcj(Pt6, ut, fink)[]; u2_noun // transfer - j2_mc(Pt6, ut, fink)( - u2_noun cor) // retain + j2_mc(Pt6, ut, fink)(u2_noun cor) // retain { u2_noun sut, dep, way, cog, van; @@ -70,39 +69,6 @@ } } - u2_weak // transfer - j2_mci(Pt6, ut, fink)( - u2_noun van, // retain - u2_noun sut, // retain - u2_noun dep, // retain - u2_noun way, // retain - u2_noun cog) // retain - { - u2_weak hoc = u2_cj_look(u2k(van), "fink"); - - if ( u2_none == hoc ) { - c3_assert(!"register fink"); - return u2_none; - } else { - u2_weak von = u2_ci_molt(u2k(van), u2_cv_sam, u2k(sut), 0); - u2_weak gat = u2_cn_nock_on(von, hoc); - u2_weak cor = u2_ci_molt(u2k(gat), - u2_cv_sam_2, u2k(dep), - u2_cv_sam_6, u2k(way), - u2_cv_sam_7, u2k(cog), - 0); - - if ( (u2_none == j2_mcj(Pt6, ut, fink)[0].xip) ) { - u2_noun xip = u2_cj_find(u2k(cor)); - - c3_assert(u2_none != xip); - j2_mcj(Pt6, ut, fink)[0].xip = xip; - } - u2z(gat); - return cor; - } - } - u2_noun // transfer j2_mcy(Pt6, ut, fink)( u2_noun van, // retain @@ -111,45 +77,11 @@ u2_noun way, // retain u2_noun cog) // retain { - u2_ho_jet *jet_j = &j2_mcj(Pt6, ut, fink)[0]; - - if ( (jet_j->sat_s & u2_jet_live) && !(jet_j->sat_s & u2_jet_test) ) { - if ( !(jet_j->sat_s & u2_jet_memo) ) { - return j2_mcx(Pt6, ut, fink)(van, sut, dep, way, cog); - } - else { - c3_m fun_m = c3__fink; - u2_noun pro = u2_cz_find_4(fun_m, sut, dep, way, cog); - - if ( u2_none != pro ) { - return pro; - } - else { - pro = j2_mcx(Pt6, ut, fink)(van, sut, dep, way, cog); - - return u2_cz_save_4(fun_m, sut, dep, way, cog, pro); - } - } - } - else { - u2_noun cor, fol, pro; - - cor = j2_mci(Pt6, ut, fink)(van, sut, dep, way, cog); - fol = u2h(cor); - - pro = u2_ho_use(jet_j, cor, fol); - if ( u2_none == pro ) return u2_cm_bail(c3__fail); - - u2z(cor); - u2z(fol); - - return pro; - } + return j2_mcx(Pt6, ut, fink)(van, sut, dep, way, cog); } u2_weak - j2_mck(Pt6, ut, fink)( - u2_noun cor) + j2_mck(Pt6, ut, fink)(u2_noun cor) { u2_noun sut, dep, way, cog, van; diff --git a/gen164/6/ut_fire.c b/gen164/6/ut_fire.c index e2af57003..567bfcefe 100644 --- a/gen164/6/ut_fire.c +++ b/gen164/6/ut_fire.c @@ -8,8 +8,7 @@ /* logic */ static u2_bean - _fire_mull( - u2_noun van, + _fire_mull(u2_noun van, u2_noun sut, u2_noun dox, u2_noun gen) @@ -38,8 +37,7 @@ } static u2_noun - _fire_each( - u2_noun van, + _fire_each(u2_noun van, u2_noun vet, u2_noun typ, u2_noun gat) @@ -172,58 +170,12 @@ } } - u2_weak // transfer - j2_mci(Pt6, ut, fire)( - u2_noun van, // retain - u2_noun sut, // retain - u2_noun hag) // retain - { - u2_weak hoc = u2_cj_look(u2k(van), "fire"); - - if ( u2_none == hoc ) { - c3_assert(!"register fire"); - return u2_none; - } else { - u2_weak von = u2_ci_molt(u2k(van), u2_cv_sam, u2k(sut), 0); - u2_weak gat = u2_cn_nock_on(von, hoc); - u2_weak cor = u2_ci_molt(u2k(gat), u2_cv_sam, u2k(hag), 0); - - if ( (u2_none == j2_mcj(Pt6, ut, fire)[0].xip) ) { - u2_noun xip = u2_cj_find(u2k(cor)); - - c3_assert(u2_none != xip); - j2_mcj(Pt6, ut, fire)[0].xip = xip; - } - u2z(gat); - return cor; - } - } - u2_noun // transfer - j2_mcy(Pt6, ut, fire)( - u2_noun van, // retain + j2_mcy(Pt6, ut, fire)(u2_noun van, // retain u2_noun sut, // retain u2_noun hag) // retain { - u2_ho_jet *jet_j = &j2_mcj(Pt6, ut, fire)[0]; - - if ( jet_j->sat_s == u2_jet_live ) { - return j2_mcx(Pt6, ut, fire)(van, sut, hag); - } - else { - u2_noun cor, fol, pro; - - cor = j2_mci(Pt6, ut, fire)(van, sut, hag); - fol = u2h(cor); - - pro = u2_ho_use(jet_j, cor, fol); - if ( u2_none == pro ) return u2_cm_bail(c3__fail); - - u2z(cor); - u2z(fol); - - return pro; - } + return j2_mcx(Pt6, ut, fire)(van, sut, hag); } /* structures diff --git a/gen164/6/ut_firm.c b/gen164/6/ut_firm.c index 8743db800..be7810078 100644 --- a/gen164/6/ut_firm.c +++ b/gen164/6/ut_firm.c @@ -111,78 +111,16 @@ } } - u2_weak // transfer - j2_mci(Pt6, ut, firm)( - u2_noun van, // retain - u2_noun sut, // retain - u2_noun dib) // retain - { - u2_weak hoc = u2_cj_look(u2k(van), "firm"); - - if ( u2_none == hoc ) { - c3_assert(!"register firm"); - return u2_none; - } else { - u2_weak von = u2_ci_molt(u2k(van), u2_cv_sam, u2k(sut), 0); - u2_weak gat = u2_cn_nock_on(von, hoc); - u2_weak cor = u2_ci_molt(u2k(gat), u2_cv_sam, u2k(dib), 0); - - if ( (u2_none == j2_mcj(Pt6, ut, firm)[0].xip) ) { - u2_noun xip = u2_cj_find(u2k(cor)); - - c3_assert(u2_none != xip); - j2_mcj(Pt6, ut, firm)[0].xip = xip; - } - u2z(gat); - return cor; - } - } - u2_noun // transfer - j2_mcy(Pt6, ut, firm)( - u2_noun van, // retain + j2_mcy(Pt6, ut, firm)(u2_noun van, // retain u2_noun sut, // retain u2_noun dib) // retain { - u2_ho_jet *jet_j = &j2_mcj(Pt6, ut, firm)[0]; - - if ( (jet_j->sat_s & u2_jet_live) && !(jet_j->sat_s & u2_jet_test) ) { - if ( !(jet_j->sat_s & u2_jet_memo) ) { - return j2_mcx(Pt6, ut, firm)(van, sut, dib); - } - else { - c3_m fun_m = c3__firm; - u2_noun pro = u2_cz_find_2(fun_m, sut, dib); - - if ( u2_none != pro ) { - return pro; - } - else { - pro = j2_mcx(Pt6, ut, firm)(van, sut, dib); - - return u2_cz_save_2(fun_m, sut, dib, pro); - } - } - } - else { - u2_noun cor, fol, pro; - - cor = j2_mci(Pt6, ut, firm)(van, sut, dib); - fol = u2h(cor); - - pro = u2_ho_use(jet_j, cor, fol); - if ( u2_none == pro ) return u2_cm_bail(c3__fail); - - u2z(cor); - u2z(fol); - - return pro; - } + return j2_mcx(Pt6, ut, firm)(van, sut, dib); } u2_weak - j2_mck(Pt6, ut, firm)( - u2_noun cor) + j2_mck(Pt6, ut, firm)(u2_noun cor) { u2_noun sut, dib, van; diff --git a/gen164/6/ut_fish.c b/gen164/6/ut_fish.c index 2a750b44a..b38a286d3 100644 --- a/gen164/6/ut_fish.c +++ b/gen164/6/ut_fish.c @@ -153,72 +153,21 @@ } } - u2_weak // transfer - j2_mci(Pt6, ut, fish)( - u2_noun van, // retain - u2_noun sut, // retain - u2_noun axe) // retain - { - u2_weak hoc = u2_cj_look(u2k(van), "fish"); - - if ( u2_none == hoc ) { - c3_assert(!"register fish"); - return u2_none; - } else { - u2_weak von = u2_ci_molt(u2k(van), u2_cv_sam, u2k(sut), 0); - u2_weak gat = u2_cn_nock_on(von, hoc); - u2_weak cor = u2_ci_molt(u2k(gat), u2_cv_sam, u2k(axe), 0); - - if ( (u2_none == j2_mcj(Pt6, ut, fish)[0].xip) ) { - u2_noun xip = u2_cj_find(u2k(cor)); - - c3_assert(u2_none != xip); - j2_mcj(Pt6, ut, fish)[0].xip = xip; - } - u2z(gat); - return cor; - } - } - u2_noun // transfer - j2_mcy(Pt6, ut, fish)( - u2_noun van, // retain + j2_mcy(Pt6, ut, fish)(u2_noun van, // retain u2_noun sut, // retain u2_noun axe) // retain { - u2_ho_jet *jet_j = &j2_mcj(Pt6, ut, fish)[0]; + c3_m fun_m = c3__fish; + u2_noun pro = u2_cz_find_2(fun_m, sut, axe); - if ( (jet_j->sat_s & u2_jet_live) && !(jet_j->sat_s & u2_jet_test) ) { - if ( !(jet_j->sat_s & u2_jet_memo) ) { - return j2_mcx(Pt6, ut, fish)(van, sut, axe); - } - else { - c3_m fun_m = c3__fish; - u2_noun pro = u2_cz_find_2(fun_m, sut, axe); - - if ( u2_none != pro ) { - return pro; - } - else { - pro = j2_mcx(Pt6, ut, fish)(van, sut, axe); - - return u2_cz_save_2(fun_m, sut, axe, pro); - } - } + if ( u2_none != pro ) { + return pro; } else { - u2_noun cor, fol, pro; + pro = j2_mcx(Pt6, ut, fish)(van, sut, axe); - cor = j2_mci(Pt6, ut, fish)(van, sut, axe); - fol = u2h(cor); - - pro = u2_ho_use(jet_j, cor, fol); - if ( u2_none == pro ) return u2_cm_bail(c3__fail); - - u2z(cor); - u2z(fol); - - return pro; + return u2_cz_save_2(fun_m, sut, axe, pro); } } diff --git a/gen164/6/ut_fuse.c b/gen164/6/ut_fuse.c index e985c6586..3c7ab48cc 100644 --- a/gen164/6/ut_fuse.c +++ b/gen164/6/ut_fuse.c @@ -186,78 +186,26 @@ } } - u2_weak // transfer - j2_mci(Pt6, ut, fuse)( - u2_noun van, // retain - u2_noun sut, // retain - u2_noun ref) // retain - { - u2_weak hoc = u2_cj_look(u2k(van), "fuse"); - - if ( u2_none == hoc ) { - c3_assert(!"register fuse"); - return u2_none; - } else { - u2_weak von = u2_ci_molt(u2k(van), u2_cv_sam, u2k(sut), 0); - u2_weak gat = u2_cn_nock_on(von, hoc); - u2_weak cor = u2_ci_molt(u2k(gat), u2_cv_sam, u2k(ref), 0); - - if ( (u2_none == j2_mcj(Pt6, ut, fuse)[0].xip) ) { - u2_noun xip = u2_cj_find(u2k(cor)); - - c3_assert(u2_none != xip); - j2_mcj(Pt6, ut, fuse)[0].xip = xip; - } - u2z(gat); - return cor; - } - } - u2_noun // transfer - j2_mcy(Pt6, ut, fuse)( - u2_noun van, // retain + j2_mcy(Pt6, ut, fuse)(u2_noun van, // retain u2_noun sut, // retain u2_noun ref) // retain { - u2_ho_jet *jet_j = &j2_mcj(Pt6, ut, fuse)[0]; + c3_m fun_m = c3__fuse; + u2_noun pro = u2_cz_find_2(fun_m, sut, ref); - if ( (jet_j->sat_s & u2_jet_live) && !(jet_j->sat_s & u2_jet_test) ) { - if ( !(jet_j->sat_s & u2_jet_memo) ) { - return j2_mcx(Pt6, ut, fuse)(van, sut, ref); - } - else { - c3_m fun_m = c3__fuse; - u2_noun pro = u2_cz_find_2(fun_m, sut, ref); - - if ( u2_none != pro ) { - return pro; - } - else { - pro = j2_mcx(Pt6, ut, fuse)(van, sut, ref); - - return u2_cz_save_2(fun_m, sut, ref, pro); - } - } + if ( u2_none != pro ) { + return pro; } else { - u2_noun cor, fol, pro; + pro = j2_mcx(Pt6, ut, fuse)(van, sut, ref); - cor = j2_mci(Pt6, ut, fuse)(van, sut, ref); - fol = u2h(cor); - - pro = u2_ho_use(jet_j, cor, fol); - if ( u2_none == pro ) return u2_cm_bail(c3__fail); - - u2z(cor); - u2z(fol); - - return pro; + return u2_cz_save_2(fun_m, sut, ref, pro); } } u2_weak - j2_mck(Pt6, ut, fuse)( - u2_noun cor) + j2_mck(Pt6, ut, fuse)(u2_noun cor) { u2_noun sut, ref, van; diff --git a/gen164/6/ut_gain.c b/gen164/6/ut_gain.c index 5c161d6b6..aa350919f 100644 --- a/gen164/6/ut_gain.c +++ b/gen164/6/ut_gain.c @@ -5,107 +5,8 @@ #include "all.h" #include "../pit.h" -/* logic -*/ - u2_noun - j2_mcx(Pt6, ut, gain)(u2_noun, u2_noun, u2_noun); - - static u2_noun // produce - _gain_wtpm( - u2_noun van, // retain - u2_noun sut, // retain - u2_noun p_gen) // retain - { - if ( u2_no == u2du(p_gen) ) { - return u2k(sut); - } - else { - u2_noun ip_gen = u2h(p_gen); - u2_noun tp_gen = u2t(p_gen); - u2_noun lev = j2_mcx(Pt6, ut, gain)(van, sut, ip_gen); - u2_noun pro = _gain_wtpm(van, lev, tp_gen); - - u2z(lev); - return pro; - } - } - - static u2_noun // produce - _gain_in( - u2_noun van, // retain - u2_noun sut, // retain - u2_noun gen) // retain - { - u2_noun p_gen, q_gen; - - if ( u2_no == u2du(gen) ) { - return u2k(sut); - } else switch ( u2h(gen) ) { - default: return u2k(sut); - - case c3__wtts: { - if ( u2_no == u2_cr_mean(gen, 6, &p_gen, 7, &q_gen, 0) ) { - return u2_cm_bail(c3__fail); - } else { - u2_noun rac = j2_mcy(Pt6, ap, rake)(q_gen); - u2_noun hap = j2_mcy(Pt6, ut, play)(van, sut, p_gen); - u2_noun guz = j2_mcy(Pt6, ut, seek)(van, sut, c3__read, rac); - u2_noun axe = u2h(guz); - u2_noun ret = j2_mcy(Pt6, ut, cull) - (van, sut, u2_yes, axe, hap); - - u2z(guz); - u2z(hap); - u2z(rac); - - return ret; - } - } - case c3__wtpm: { - return _gain_wtpm(van, sut, u2t(gen)); - } - case c3__zpcb: u2_cx_cell(u2t(gen), &p_gen, &q_gen); - { - return j2_mcx(Pt6, ut, gain)(van, sut, q_gen); - } - case c3__zphs: p_gen = u2t(gen); - { - return j2_mcx(Pt6, ut, gain)(van, sut, p_gen); - } - } - } - u2_noun // transfer - j2_mcx(Pt6, ut, gain)( - u2_noun van, // retain - u2_noun sut, // retain - u2_noun gen) // retain - { - return _gain_in(van, sut, gen); - } - -/* boilerplate -*/ - u2_ho_jet - j2_mcj(Pt6, ut, gain)[]; - - u2_noun // transfer - j2_mc(Pt6, ut, gain)( - u2_noun cor) // retain - { - u2_noun sut, gen, van; - - if ( (u2_no == u2_cr_mean(cor, u2_cv_sam, &gen, u2_cv_con, &van, 0)) || - (u2_none == (sut = u2_cr_at(u2_cv_sam, van))) ) - { - return u2_cm_bail(c3__fail); - } else { - return j2_mcx(Pt6, ut, gain)(van, sut, gen); - } - } - u2_weak // transfer - j2_mci(Pt6, ut, gain)( - u2_noun van, // retain + j2_mci(Pt6, ut, gain)(u2_noun van, // retain u2_noun sut, // retain u2_noun gen) // retain { @@ -117,54 +18,16 @@ } else { u2_weak von = u2_ci_molt(u2k(van), u2_cv_sam, u2k(sut), 0); u2_weak gat = u2_cn_nock_on(von, hoc); - u2_weak cor = u2_ci_molt(u2k(gat), u2_cv_sam, u2k(gen), 0); + u2_weak cor = u2_ci_molt(gat, u2_cv_sam, u2k(gen), 0); - if ( (u2_none == j2_mcj(Pt6, ut, gain)[0].xip) ) { - u2_noun xip = u2_cj_find(u2k(cor)); - - c3_assert(u2_none != xip); - j2_mcj(Pt6, ut, gain)[0].xip = xip; - } - u2z(gat); return cor; } } u2_noun // transfer - j2_mcy(Pt6, ut, gain)( - u2_noun van, // retain + j2_mcy(Pt6, ut, gain)(u2_noun van, // retain u2_noun sut, // retain u2_noun gen) // retain { - u2_ho_jet *jet_j = &j2_mcj(Pt6, ut, gain)[0]; - - if ( jet_j->sat_s == u2_jet_live ) { - return j2_mcx(Pt6, ut, gain)(van, sut, gen); - } - else { - u2_noun cor, fol, pro; - - cor = j2_mci(Pt6, ut, gain)(van, sut, gen); - fol = u2h(cor); - - pro = u2_ho_use(jet_j, cor, fol); - if ( u2_none == pro ) return u2_cm_bail(c3__fail); - - u2z(cor); - u2z(fol); - - return pro; - } + return u2_cn_kick_on(j2_mci(Pt6, ut, gain)(van, sut, gen)); } - -/* structures -*/ - u2_ho_jet - j2_mcj(Pt6, ut, gain)[] = { - // Dead for the moment because wtts behavior is wrong & bore is not - // available. - // - // { ".2", c3__hevy, j2_mc(Pt6, ut, gain), Tier6_c, u2_none, u2_none }, - { ".2", c3__hevy, j2_mc(Pt6, ut, gain), u2_jet_dead, u2_none, u2_none }, - { } - }; diff --git a/gen164/6/ut_heal.c b/gen164/6/ut_heal.c index bf8d6a471..a683eab59 100644 --- a/gen164/6/ut_heal.c +++ b/gen164/6/ut_heal.c @@ -237,85 +237,18 @@ } } - u2_weak // transfer - j2_mci(Pt6, ut, heal)( - u2_noun van, // retain - u2_noun sut, // retain - u2_noun qog, // retain - u2_noun axe, // retain - u2_noun ref) // retain - { - u2_weak hoc = u2_cj_look(u2k(van), "heal"); - - if ( u2_none == hoc ) { - c3_assert(!"register heal"); - return u2_none; - } else { - u2_weak von = u2_ci_molt(u2k(van), u2_cv_sam, u2k(sut), 0); - u2_weak gat = u2_cn_nock_on(von, hoc); - u2_weak cor = u2_ci_molt(u2k(gat), u2_cv_sam_2, u2k(qog), - u2_cv_sam_6, u2k(axe), - u2_cv_sam_7, u2k(ref), - 0); - - if ( (u2_none == j2_mcj(Pt6, ut, heal)[0].xip) ) { - u2_noun xip = u2_cj_find(u2k(cor)); - - c3_assert(u2_none != xip); - j2_mcj(Pt6, ut, heal)[0].xip = xip; - } - u2z(gat); - return cor; - } - } - u2_noun // transfer - j2_mcy(Pt6, ut, heal)( - u2_noun van, // retain + j2_mcy(Pt6, ut, heal)(u2_noun van, // retain u2_noun sut, // retain u2_noun qog, // retain u2_noun axe, // retain u2_noun ref) // retain { - u2_ho_jet *jet_j = &j2_mcj(Pt6, ut, heal)[0]; - - if ( (jet_j->sat_s & u2_jet_live) && !(jet_j->sat_s & u2_jet_test) ) { - if ( !(jet_j->sat_s & u2_jet_memo) ) { - return j2_mcx(Pt6, ut, heal)(van, sut, qog, axe, ref); - } - else { - c3_m fun_m = c3__heal; - u2_noun pro = u2_cz_find_4(fun_m, sut, qog, axe, ref); - - if ( u2_none != pro ) { - return pro; - } - else { - pro = j2_mcx(Pt6, ut, heal)(van, sut, qog, axe, ref); - - return u2_cz_save_4(fun_m, sut, qog, axe, ref, pro); - } - } - } - else { - u2_noun cor, fol, pro; - - cor = j2_mci(Pt6, ut, heal)(van, sut, qog, axe, ref); - fol = u2h(cor); - - pro = u2_ho_use(jet_j, cor, fol); - if ( u2_none == pro ) return u2_cm_bail(c3__fail); - - u2z(cor); - u2z(fol); - - return pro; - } + return j2_mcx(Pt6, ut, heal)(van, sut, qog, axe, ref); } u2_weak - j2_mck(Pt6, ut, heal)( - u2_noun cor) + j2_mck(Pt6, ut, heal)(u2_noun cor) { u2_noun sut, qog, axe, ref, van; diff --git a/gen164/6/ut_lose.c b/gen164/6/ut_lose.c index c76aca682..78563faa5 100644 --- a/gen164/6/ut_lose.c +++ b/gen164/6/ut_lose.c @@ -5,107 +5,8 @@ #include "all.h" #include "../pit.h" -/* logic -*/ - u2_noun - j2_mcx(Pt6, ut, lose)(u2_noun, u2_noun, u2_noun); - - static u2_noun // produce - _lose_wtbr( - u2_noun van, // retain - u2_noun sut, // retain - u2_noun p_gen) // retain - { - if ( u2_no == u2du(p_gen) ) { - return u2k(sut); - } - else { - u2_noun ip_gen = u2h(p_gen); - u2_noun tp_gen = u2t(p_gen); - u2_noun lev = j2_mcx(Pt6, ut, lose)(van, sut, ip_gen); - u2_noun pro = _lose_wtbr(van, lev, tp_gen); - - u2z(lev); - return pro; - } - } - - static u2_noun // produce - _lose_in( - u2_noun van, // retain - u2_noun sut, // retain - u2_noun gen) // retain - { - u2_noun p_gen, q_gen; - - if ( u2_no == u2du(gen) ) { - return u2k(sut); - } else switch ( u2h(gen) ) { - default: return u2k(sut); - - case c3__wtts: { - if ( u2_no == u2_cr_mean(gen, 6, &p_gen, 7, &q_gen, 0) ) { - return u2_cm_bail(c3__fail); - } else { - u2_noun rac = j2_mcy(Pt6, ap, rake)(q_gen); - u2_noun hap = j2_mcy(Pt6, ut, play)(van, sut, p_gen); - u2_noun guz = j2_mcy(Pt6, ut, seek)(van, sut, c3__read, rac); - u2_noun axe = u2h(guz); - u2_noun ret = j2_mcy(Pt6, ut, cull) - (van, sut, u2_no, axe, hap); - - u2z(guz); - u2z(hap); - u2z(rac); - - return ret; - } - } - case c3__wtbr: { - return _lose_wtbr(van, sut, u2t(gen)); - } - case c3__zpcb: u2_cx_cell(u2t(gen), &p_gen, &q_gen); - { - return j2_mcx(Pt6, ut, lose)(van, sut, q_gen); - } - case c3__zphs: p_gen = u2t(gen); - { - return j2_mcx(Pt6, ut, lose)(van, sut, p_gen); - } - } - } - u2_noun // transfer - j2_mcx(Pt6, ut, lose)( - u2_noun van, // retain - u2_noun sut, // retain - u2_noun gen) // retain - { - return _lose_in(van, sut, gen); - } - -/* boilerplate -*/ - u2_ho_jet - j2_mcj(Pt6, ut, lose)[]; - - u2_noun // transfer - j2_mc(Pt6, ut, lose)( - u2_noun cor) // retain - { - u2_noun sut, gen, van; - - if ( (u2_no == u2_cr_mean(cor, u2_cv_sam, &gen, u2_cv_con, &van, 0)) || - (u2_none == (sut = u2_cr_at(u2_cv_sam, van))) ) - { - return u2_cm_bail(c3__fail); - } else { - return j2_mcx(Pt6, ut, lose)(van, sut, gen); - } - } - u2_weak // transfer - j2_mci(Pt6, ut, lose)( - u2_noun van, // retain + j2_mci(Pt6, ut, lose)(u2_noun van, // retain u2_noun sut, // retain u2_noun gen) // retain { @@ -117,54 +18,18 @@ } else { u2_weak von = u2_ci_molt(u2k(van), u2_cv_sam, u2k(sut), 0); u2_weak gat = u2_cn_nock_on(von, hoc); - u2_weak cor = u2_ci_molt(u2k(gat), u2_cv_sam, u2k(gen), 0); + u2_weak cor = u2_ci_molt(gat, u2_cv_sam, u2k(gen), 0); - if ( (u2_none == j2_mcj(Pt6, ut, lose)[0].xip) ) { - u2_noun xip = u2_cj_find(u2k(cor)); - - c3_assert(u2_none != xip); - j2_mcj(Pt6, ut, lose)[0].xip = xip; - } - u2z(gat); return cor; } } u2_noun // transfer - j2_mcy(Pt6, ut, lose)( - u2_noun van, // retain + j2_mcy(Pt6, ut, lose)(u2_noun van, // retain u2_noun sut, // retain u2_noun gen) // retain { - u2_ho_jet *jet_j = &j2_mcj(Pt6, ut, lose)[0]; + u2_noun cor = j2_mci(Pt6, ut, lose)(van, sut, gen); - if ( jet_j->sat_s == u2_jet_live ) { - return j2_mcx(Pt6, ut, lose)(van, sut, gen); - } - else { - u2_noun cor, fol, pro; - - cor = j2_mci(Pt6, ut, lose)(van, sut, gen); - fol = u2h(cor); - - pro = u2_ho_use(jet_j, cor, fol); - if ( u2_none == pro ) return u2_cm_bail(c3__fail); - - u2z(cor); - u2z(fol); - - return pro; - } + return u2_cn_kick_on(cor); } - -/* structures -*/ - u2_ho_jet - j2_mcj(Pt6, ut, lose)[] = { - // Dead for the moment because wtts behavior is wrong & bore is not - // available. - // - // { ".2", c3__hevy, j2_mc(Pt6, ut, lose), Tier6_c, u2_none, u2_none }, - { ".2", c3__hevy, j2_mc(Pt6, ut, lose), u2_jet_dead, u2_none, u2_none }, - { } - }; diff --git a/gen164/6/ut_mint.c b/gen164/6/ut_mint.c index 428a0ae97..13b8957cd 100644 --- a/gen164/6/ut_mint.c +++ b/gen164/6/ut_mint.c @@ -880,7 +880,7 @@ int FOO; u2_noun p_vos = u2h(vos); u2_noun q_vos = u2t(vos); u2_noun waz = u2nc(1, u2k(p_vos)); - u2_noun sif = j2_mcy(Pt6, ut, sift)(van, sut, zur); + u2_noun sif = u2k(zur); u2_noun cig = j2_mby(Pt6, cell)(sif, p_vos); u2_noun ret; @@ -933,8 +933,7 @@ int FOO; j2_mcj(Pt6, ut, mint)[]; u2_noun // produce - j2_mc(Pt6, ut, mint)( - u2_noun cor) // retain + j2_mc(Pt6, ut, mint)(u2_noun cor) // retain { u2_noun sut, gol, gen, van; @@ -950,86 +949,30 @@ int FOO; } } - u2_weak // produce - j2_mci(Pt6, ut, mint)( - u2_noun van, // retain - u2_noun sut, // retain - u2_noun gol, // retain - u2_noun gen) // retain - { - u2_weak hoc = u2_cj_look(u2k(van), "mint"); - - if ( u2_none == hoc ) { - c3_assert(!"register mint"); - return u2_none; - } else { - u2_weak von = u2_ci_molt(u2k(van), u2_cv_sam, u2k(sut), 0); - u2_weak gat = u2_cn_nock_on(von, hoc); - u2_weak cor = u2_ci_molt(u2k(gat), - u2_cv_sam_2, u2k(gol), - u2_cv_sam_3, u2k(gen), - 0); - - if ( (u2_none == j2_mcj(Pt6, ut, mint)[0].xip) ) { - u2_noun xip = u2_cj_find(u2k(cor)); - - c3_assert(u2_none != xip); - j2_mcj(Pt6, ut, mint)[0].xip = xip; - } - u2z(gat); - return cor; - } - } - u2_noun // produce - j2_mcy(Pt6, ut, mint)( - u2_noun van, // retain + j2_mcy(Pt6, ut, mint)(u2_noun van, // retain u2_noun sut, // retain u2_noun gol, // retain u2_noun gen) // retain { - u2_ho_jet *jet_j = &j2_mcj(Pt6, ut, mint)[0]; + c3_m fun_m = c3__mint; + u2_noun vrf = u2_cr_at(j2_ut_van_vrf, van); + u2_noun pro = u2_cz_find_4(fun_m, vrf, sut, gol, gen); - if ( (jet_j->sat_s & u2_jet_live) && !(jet_j->sat_s & u2_jet_test) ) { - if ( !(jet_j->sat_s & u2_jet_memo) ) { - return j2_mcx(Pt6, ut, mint)(van, sut, gol, gen); - } - else { - c3_m fun_m = c3__mint; - u2_noun vrf = u2_cr_at(j2_ut_van_vrf, van); - u2_noun pro = u2_cz_find_4(fun_m, vrf, sut, gol, gen); - - if ( u2_none != pro ) { - return pro; - } - else { - pro = j2_mcx(Pt6, ut, mint)(van, sut, gol, gen); - - return u2_cz_save_4(fun_m, vrf, sut, gol, gen, pro); - } - } + if ( u2_none != pro ) { + return pro; } else { - u2_noun cor, fol, pro; + pro = j2_mcx(Pt6, ut, mint)(van, sut, gol, gen); - cor = j2_mci(Pt6, ut, mint)(van, sut, gol, gen); - fol = u2h(cor); - - pro = u2_ho_use(jet_j, cor, fol); - if ( u2_none == pro ) return u2_cm_bail(c3__fail); - - u2z(cor); - u2z(fol); - - return pro; + return u2_cz_save_4(fun_m, vrf, sut, gol, gen, pro); } } /* structures */ u2_weak - j2_mck(Pt6, ut, mint)( - u2_noun cor) + j2_mck(Pt6, ut, mint)(u2_noun cor) { u2_noun sut, gol, gen, van; diff --git a/gen164/6/ut_mull.c b/gen164/6/ut_mull.c index b581df4ed..de263754a 100644 --- a/gen164/6/ut_mull.c +++ b/gen164/6/ut_mull.c @@ -852,88 +852,30 @@ } } - u2_weak // transfer - j2_mci(Pt6, ut, mull)( - u2_noun van, // retain - u2_noun sut, // retain - u2_noun gol, // retain - u2_noun dox, // retain - u2_noun gen) // retain - { - u2_weak hoc = u2_cj_look(u2k(van), "mull"); - - if ( u2_none == hoc ) { - c3_assert(!"register mull"); - return u2_none; - } else { - u2_weak von = u2_ci_molt(u2k(van), u2_cv_sam, u2k(sut), 0); - u2_weak gat = u2_cn_nock_on(von, hoc); - u2_weak cor = u2_ci_molt(u2k(gat), - u2_cv_sam_2, u2k(gol), - u2_cv_sam_6, u2k(dox), - u2_cv_sam_7, u2k(gen), - 0); - - if ( (u2_none == j2_mcj(Pt6, ut, mull)[0].xip) ) { - u2_noun xip = u2_cj_find(u2k(cor)); - - c3_assert(u2_none != xip); - j2_mcj(Pt6, ut, mull)[0].xip = xip; - } - u2z(gat); - return cor; - } - } - u2_noun // transfer - j2_mcy(Pt6, ut, mull)( - u2_noun van, // retain + j2_mcy(Pt6, ut, mull)(u2_noun van, // retain u2_noun sut, // retain u2_noun gol, // retain u2_noun dox, // retain u2_noun gen) // retain { - u2_ho_jet *jet_j = &j2_mcj(Pt6, ut, mull)[0]; + c3_m fun_m = c3__mull; + u2_noun pro = u2_cz_find_4(fun_m, sut, gol, dox, gen); - if ( (jet_j->sat_s & u2_jet_live) && !(jet_j->sat_s & u2_jet_test) ) { - if ( !(jet_j->sat_s & u2_jet_memo) ) { - return j2_mcx(Pt6, ut, mull)(van, sut, gol, dox, gen); - } - else { - c3_m fun_m = c3__mull; - u2_noun pro = u2_cz_find_4(fun_m, sut, gol, dox, gen); - - if ( u2_none != pro ) { - return pro; - } - else { - pro = j2_mcx(Pt6, ut, mull)(van, sut, gol, dox, gen); - - return u2_cz_save_4(fun_m, sut, gol, dox, gen, pro); - } - } + if ( u2_none != pro ) { + return pro; } else { - u2_noun cor, fol, pro; + pro = j2_mcx(Pt6, ut, mull)(van, sut, gol, dox, gen); - cor = j2_mci(Pt6, ut, mull)(van, sut, gol, dox, gen); - fol = u2h(cor); - - pro = u2_ho_use(jet_j, cor, fol); - if ( u2_none == pro ) return u2_cm_bail(c3__fail); - - u2z(cor); - u2z(fol); - - return pro; + return u2_cz_save_4(fun_m, sut, gol, dox, gen, pro); } } /* structures */ u2_weak - j2_mck(Pt6, ut, mull)( - u2_noun cor) + j2_mck(Pt6, ut, mull)(u2_noun cor) { u2_noun sut, gol, dox, gen, van; @@ -946,11 +888,7 @@ { return u2_none; } else { - return u2nq - (u2k(sut), - u2k(gol), - u2k(dox), - u2k(gen)); + return u2nq(u2k(sut), u2k(gol), u2k(dox), u2k(gen)); } } @@ -958,7 +896,7 @@ j2_mcj(Pt6, ut, mull)[] = { { ".2", c3__hevy, j2_mc(Pt6, ut, mull), - Tier6_b, + Tier6_b_memo, u2_none, u2_none, j2_mck(Pt6, ut, mull), c3__mull, }, diff --git a/gen164/6/ut_nest.c b/gen164/6/ut_nest.c index 5a3c8fb2f..2dc3c01e5 100644 --- a/gen164/6/ut_nest.c +++ b/gen164/6/ut_nest.c @@ -470,8 +470,7 @@ /* boilerplate */ u2_noun // transfer - j2_mc(Pt6, ut, nest)( - u2_noun cor) // retain + j2_mc(Pt6, ut, nest)(u2_noun cor) // retain { u2_noun sut, tel, ref, van; @@ -488,66 +487,17 @@ } } - u2_weak // transfer - j2_mci(Pt6, ut, nest)( - u2_noun van, // retain - u2_noun sut, // retain - u2_bean tel, // retain - u2_noun ref) // retain - { - u2_weak hoc = u2_cj_look(u2k(van), "nest"); - - if ( u2_none == hoc ) { - c3_assert(!"register nest"); - return u2_none; - } else { - u2_weak von = u2_ci_molt(u2k(van), u2_cv_sam, u2k(sut), 0); - u2_weak gat = u2_cn_nock_on(von, hoc); - u2_weak cor = u2_ci_molt(u2k(gat), u2_cv_sam_2, tel, - u2_cv_sam_3, u2k(ref), 0); - - if ( (u2_none == j2_mcj(Pt6, ut, nest)[0].xip) ) { - u2_noun xip = u2_cj_find(u2k(cor)); - - c3_assert(u2_none != xip); - j2_mcj(Pt6, ut, nest)[0].xip = xip; - } - u2z(gat); - return cor; - } - } - u2_noun // transfer - j2_mcy(Pt6, ut, nest)( - u2_noun van, // retain + j2_mcy(Pt6, ut, nest)(u2_noun van, // retain u2_noun sut, // retain u2_bean tel, // retain u2_noun ref) // retain { - u2_ho_jet *jet_j = &j2_mcj(Pt6, ut, nest)[0]; - - if ( (jet_j->sat_s & u2_jet_live) && !(jet_j->sat_s & u2_jet_test) ) { - return j2_mcx(Pt6, ut, nest)(van, sut, tel, ref); - } - else { - u2_noun cor, fol, pro; - - cor = j2_mci(Pt6, ut, nest)(van, sut, tel, ref); - fol = u2h(cor); - - pro = u2_ho_use(jet_j, cor, fol); - if ( u2_none == pro ) return u2_cm_bail(c3__fail); - - u2z(cor); - u2z(fol); - - return pro; - } + return j2_mcx(Pt6, ut, nest)(van, sut, tel, ref); } u2_weak - j2_mck(Pt6, ut, nest)( - u2_noun cor) + j2_mck(Pt6, ut, nest)(u2_noun cor) { u2_noun sut, ref, van; diff --git a/gen164/6/ut_park.c b/gen164/6/ut_park.c index 512402ae9..f89b2e77b 100644 --- a/gen164/6/ut_park.c +++ b/gen164/6/ut_park.c @@ -85,63 +85,13 @@ } } - u2_bean - j2_mci(Pt6, ut, park)( - u2_noun van, // retain - u2_noun sut, // retain - u2_noun way, // retain - u2_noun axe) // retain - { - u2_weak hoc = u2_cj_look(u2k(van), "park"); - - if ( u2_none == hoc ) { - c3_assert(!"register park"); - return u2_none; - } else { - u2_weak von = u2_ci_molt(u2k(van), u2_cv_sam, u2k(sut), 0); - u2_weak gat = u2_cn_nock_on(von, hoc); - u2_weak cor = u2_ci_molt(u2k(gat), - u2_cv_sam_2, u2k(way), - u2_cv_sam_3, u2k(axe), - 0); - - if ( (u2_none == j2_mcj(Pt6, ut, park)[0].xip) ) { - u2_noun xip = u2_cj_find(u2k(cor)); - - c3_assert(u2_none != xip); - j2_mcj(Pt6, ut, park)[0].xip = xip; - } - u2z(gat); - return cor; - } - } - u2_noun // transfer - j2_mcy(Pt6, ut, park)( - u2_noun van, // retain + j2_mcy(Pt6, ut, park)(u2_noun van, // retain u2_noun sut, // retain u2_noun way, // retain u2_noun axe) // retain { - u2_ho_jet *jet_j = &j2_mcj(Pt6, ut, park)[0]; - - if ( jet_j->sat_s == u2_jet_live ) { - return j2_mcx(Pt6, ut, park)(van, sut, way, axe); - } - else { - u2_noun cor, fol, pro; - - cor = j2_mci(Pt6, ut, park)(van, sut, way, axe); - fol = u2h(cor); - - pro = u2_ho_use(jet_j, cor, fol); - if ( u2_none == pro ) return u2_cm_bail(c3__fail); - - u2z(cor); - u2z(fol); - - return pro; - } + return j2_mcx(Pt6, ut, park)(van, sut, way, axe); } /* structures diff --git a/gen164/6/ut_peek.c b/gen164/6/ut_peek.c index 6e8f90f20..b081ce83b 100644 --- a/gen164/6/ut_peek.c +++ b/gen164/6/ut_peek.c @@ -184,83 +184,27 @@ } } - u2_weak // transfer - j2_mci(Pt6, ut, peek)( - u2_noun van, // retain - u2_noun sut, // retain - u2_noun way, // retain - u2_noun axe) // retain - { - u2_weak hoc = u2_cj_look(u2k(van), "peek"); - - if ( u2_none == hoc ) { - c3_assert(!"register peek"); - return u2_none; - } else { - u2_weak von = u2_ci_molt(u2k(van), u2_cv_sam, u2k(sut), 0); - u2_weak gat = u2_cn_nock_on(von, hoc); - u2_weak cor = u2_ci_molt(u2k(gat), - u2_cv_sam_2, u2k(way), - u2_cv_sam_3, u2k(axe), - 0); - - if ( (u2_none == j2_mcj(Pt6, ut, peek)[0].xip) ) { - u2_noun xip = u2_cj_find(u2k(cor)); - - c3_assert(u2_none != xip); - j2_mcj(Pt6, ut, peek)[0].xip = xip; - } - u2z(gat); - return cor; - } - } - u2_noun // transfer - j2_mcy(Pt6, ut, peek)( - u2_noun van, // retain + j2_mcy(Pt6, ut, peek)(u2_noun van, // retain u2_noun sut, // retain u2_noun way, // retain u2_noun axe) // retain { - u2_ho_jet *jet_j = &j2_mcj(Pt6, ut, peek)[0]; + c3_m fun_m = c3__peek; + u2_noun pro = u2_cz_find_3(fun_m, sut, way, axe); - if ( (jet_j->sat_s & u2_jet_live) && !(jet_j->sat_s & u2_jet_test) ) { - if ( !(jet_j->sat_s & u2_jet_memo) ) { - return j2_mcx(Pt6, ut, peek)(van, sut, way, axe); - } - else { - c3_m fun_m = c3__peek; - u2_noun pro = u2_cz_find_3(fun_m, sut, way, axe); - - if ( u2_none != pro ) { - return pro; - } - else { - pro = j2_mcx(Pt6, ut, peek)(van, sut, way, axe); - - return u2_cz_save_3(fun_m, sut, way, axe, pro); - } - } + if ( u2_none != pro ) { + return pro; } else { - u2_noun cor, fol, pro; + pro = j2_mcx(Pt6, ut, peek)(van, sut, way, axe); - cor = j2_mci(Pt6, ut, peek)(van, sut, way, axe); - fol = u2h(cor); - - pro = u2_ho_use(jet_j, cor, fol); - if ( u2_none == pro ) return u2_cm_bail(c3__fail); - - u2z(cor); - u2z(fol); - - return pro; + return u2_cz_save_3(fun_m, sut, way, axe, pro); } } u2_weak - j2_mck(Pt6, ut, peek)( - u2_noun cor) + j2_mck(Pt6, ut, peek)(u2_noun cor) { u2_noun sut, way, axe, van; diff --git a/gen164/6/ut_play.c b/gen164/6/ut_play.c index 6bd0ac3ab..22d3a8afb 100644 --- a/gen164/6/ut_play.c +++ b/gen164/6/ut_play.c @@ -535,58 +535,12 @@ } } - u2_weak // transfer - j2_mci(Pt6, ut, play)( - u2_noun van, // retain - u2_noun sut, // retain - u2_noun gen) // retain - { - u2_weak hoc = u2_cj_look(u2k(van), "play"); - - if ( u2_none == hoc ) { - c3_assert(!"register play"); - return u2_none; - } else { - u2_weak von = u2_ci_molt(u2k(van), u2_cv_sam, u2k(sut), 0); - u2_weak gat = u2_cn_nock_on(von, hoc); - u2_weak cor = u2_ci_molt(u2k(gat), u2_cv_sam, u2k(gen), 0); - - if ( (u2_none == j2_mcj(Pt6, ut, play)[0].xip) ) { - u2_noun xip = u2_cj_find(u2k(cor)); - - c3_assert(u2_none != xip); - j2_mcj(Pt6, ut, play)[0].xip = xip; - } - u2z(gat); - return cor; - } - } - u2_noun // transfer - j2_mcy(Pt6, ut, play)( - u2_noun van, // retain + j2_mcy(Pt6, ut, play)(u2_noun van, // retain u2_noun sut, // retain u2_noun gen) // retain { - u2_ho_jet *jet_j = &j2_mcj(Pt6, ut, play)[0]; - - if ( jet_j->sat_s == u2_jet_live ) { - return j2_mcx(Pt6, ut, play)(van, sut, gen); - } - else { - u2_noun cor, fol, pro; - - cor = j2_mci(Pt6, ut, play)(van, sut, gen); - fol = u2h(cor); - - pro = u2_ho_use(jet_j, cor, fol); - if ( u2_none == pro ) return u2_cm_bail(c3__fail); - - u2z(cor); - u2z(fol); - - return pro; - } + return j2_mcx(Pt6, ut, play)(van, sut, gen); } /* structures diff --git a/gen164/6/ut_rest.c b/gen164/6/ut_rest.c index 1455afdce..1abfd3145 100644 --- a/gen164/6/ut_rest.c +++ b/gen164/6/ut_rest.c @@ -124,78 +124,26 @@ } } - u2_weak // transfer - j2_mci(Pt6, ut, rest)( - u2_noun van, // retain - u2_noun sut, // retain - u2_noun leg) // retain - { - u2_weak hoc = u2_cj_look(u2k(van), "rest"); - - if ( u2_none == hoc ) { - c3_assert(!"register rest"); - return u2_none; - } else { - u2_weak von = u2_ci_molt(u2k(van), u2_cv_sam, u2k(sut), 0); - u2_weak gat = u2_cn_nock_on(von, hoc); - u2_weak cor = u2_ci_molt(u2k(gat), u2_cv_sam, u2k(leg), 0); - - if ( (u2_none == j2_mcj(Pt6, ut, rest)[0].xip) ) { - u2_noun xip = u2_cj_find(u2k(cor)); - - c3_assert(u2_none != xip); - j2_mcj(Pt6, ut, rest)[0].xip = xip; - } - u2z(gat); - return cor; - } - } - u2_noun // transfer - j2_mcy(Pt6, ut, rest)( - u2_noun van, // retain + j2_mcy(Pt6, ut, rest)(u2_noun van, // retain u2_noun sut, // retain u2_noun leg) // retain { - u2_ho_jet *jet_j = &j2_mcj(Pt6, ut, rest)[0]; + c3_m fun_m = c3__rest; + u2_noun pro = u2_cz_find_2(fun_m, sut, leg); - if ( (jet_j->sat_s & u2_jet_live) && !(jet_j->sat_s & u2_jet_test) ) { - if ( !(jet_j->sat_s & u2_jet_memo) ) { - return j2_mcx(Pt6, ut, rest)(van, sut, leg); - } - else { - c3_m fun_m = c3__rest; - u2_noun pro = u2_cz_find_2(fun_m, sut, leg); - - if ( u2_none != pro ) { - return pro; - } - else { - pro = j2_mcx(Pt6, ut, rest)(van, sut, leg); - - return u2_cz_save_2(fun_m, sut, leg, pro); - } - } + if ( u2_none != pro ) { + return pro; } else { - u2_noun cor, fol, pro; + pro = j2_mcx(Pt6, ut, rest)(van, sut, leg); - cor = j2_mci(Pt6, ut, rest)(van, sut, leg); - fol = u2h(cor); - - pro = u2_ho_use(jet_j, cor, fol); - if ( u2_none == pro ) return u2_cm_bail(c3__fail); - - u2z(cor); - u2z(fol); - - return pro; + return u2_cz_save_2(fun_m, sut, leg, pro); } } u2_weak - j2_mck(Pt6, ut, rest)( - u2_noun cor) + j2_mck(Pt6, ut, rest)(u2_noun cor) { u2_noun sut, leg, van; diff --git a/gen164/6/ut_seek.c b/gen164/6/ut_seek.c index cfe7c74db..a70ae3c69 100644 --- a/gen164/6/ut_seek.c +++ b/gen164/6/ut_seek.c @@ -240,83 +240,27 @@ } } - u2_weak // transfer - j2_mci(Pt6, ut, seek)( - u2_noun van, // retain - u2_noun sut, // retain - u2_noun way, // retain - u2_noun hyp) // retain - { - u2_weak hoc = u2_cj_look(u2k(van), "seek"); - - if ( u2_none == hoc ) { - c3_assert(!"register seek"); - return u2_none; - } else { - u2_weak von = u2_ci_molt(u2k(van), u2_cv_sam, u2k(sut), 0); - u2_weak gat = u2_cn_nock_on(von, hoc); - u2_weak cor = u2_ci_molt(u2k(gat), - u2_cv_sam_2, u2k(way), - u2_cv_sam_3, u2k(hyp), - 0); - - if ( (u2_none == j2_mcj(Pt6, ut, seek)[0].xip) ) { - u2_noun xip = u2_cj_find(u2k(cor)); - - c3_assert(u2_none != xip); - j2_mcj(Pt6, ut, seek)[0].xip = xip; - } - u2z(gat); - return cor; - } - } - u2_noun // transfer - j2_mcy(Pt6, ut, seek)( - u2_noun van, // retain + j2_mcy(Pt6, ut, seek)(u2_noun van, // retain u2_noun sut, // retain u2_noun way, // retain u2_noun hyp) // retain { - u2_ho_jet *jet_j = &j2_mcj(Pt6, ut, seek)[0]; - - if ( (jet_j->sat_s & u2_jet_live) && !(jet_j->sat_s & u2_jet_test) ) { - if ( !(jet_j->sat_s & u2_jet_memo) ) { - return j2_mcx(Pt6, ut, seek)(van, sut, way, hyp); - } - else { - c3_m fun_m = c3__seek; - u2_noun pro = u2_cz_find_3(fun_m, sut, way, hyp); - - if ( u2_none != pro ) { - return pro; - } - else { - pro = j2_mcx(Pt6, ut, seek)(van, sut, way, hyp); - - return u2_cz_save_3(fun_m, sut, way, hyp, pro); - } - } - } - else { - u2_noun cor, fol, pro; - - cor = j2_mci(Pt6, ut, seek)(van, sut, way, hyp); - fol = u2h(cor); - - pro = u2_ho_use(jet_j, cor, fol); - if ( u2_none == pro ) return u2_cm_bail(c3__fail); - - u2z(cor); - u2z(fol); + c3_m fun_m = c3__seek; + u2_noun pro = u2_cz_find_3(fun_m, sut, way, hyp); + if ( u2_none != pro ) { return pro; } + else { + pro = j2_mcx(Pt6, ut, seek)(van, sut, way, hyp); + + return u2_cz_save_3(fun_m, sut, way, hyp, pro); + } } u2_noun // transfer - j2_mcy(Pt6, ut, seep)( - u2_noun van, // retain + j2_mcy(Pt6, ut, seep)(u2_noun van, // retain u2_noun sut, // retain u2_noun way, // retain u2_noun hyp) // retain diff --git a/gen164/6/ut_sift.c b/gen164/6/ut_sift.c index a998ba977..3b73c3e37 100644 --- a/gen164/6/ut_sift.c +++ b/gen164/6/ut_sift.c @@ -55,49 +55,11 @@ } u2_noun // transfer - j2_mcy(Pt6, ut, sift)( - u2_noun van, // retain + j2_mcy(Pt6, ut, sift)(u2_noun van, // retain u2_noun sut, // retain u2_noun ref) // retain { return u2k(ref); - -#if 0 - u2_ho_jet *jet_j = &j2_mcj(Pt6, ut, sift)[0]; - - if ( (jet_j->sat_s & u2_jet_live) && !(jet_j->sat_s & u2_jet_test) ) { - if ( !(jet_j->sat_s & u2_jet_memo) ) { - return j2_mcx(Pt6, ut, sift)(van, sut, ref); - } - else { - c3_m fun_m = c3__sift; - u2_noun pro = u2_cz_find_3(fun_m, sut, ref); - - if ( u2_none != pro ) { - return pro; - } - else { - pro = j2_mcx(Pt6, ut, sift)(van, sut, ref); - - return u2_cz_save_3(fun_m, sut, ref, pro); - } - } - return pro; - } else -#else - { - u2_noun cor, pro; - - cor = j2_mci(Pt6, ut, sift)(van, sut, ref); - - pro = u2_cn_nock_on(u2k(cor), u2k(u2h(cor))); - if ( u2_none == pro ) return u2_cm_bail(c3__fail); - - u2z(cor); - - return pro; -#endif - } } u2_weak diff --git a/gen164/6/ut_swab.c b/gen164/6/ut_swab.c index 44ef4ef44..c292e72f4 100644 --- a/gen164/6/ut_swab.c +++ b/gen164/6/ut_swab.c @@ -11,8 +11,7 @@ /* functions */ u2_noun // produce - j2_mcx(Pt6, ut, snub)( - u2_noun van, // retain + j2_mcx(Pt6, ut, snub)(u2_noun van, // retain u2_noun sut, // retain u2_noun har) // retain { @@ -54,59 +53,12 @@ } } - u2_weak // transfer - j2_mci(Pt6, ut, snub)( - u2_noun van, // retain - u2_noun sut, // retain - u2_noun har) // retain - { - u2_weak hoc = u2_cj_look(u2k(van), "snub"); - - if ( u2_none == hoc ) { - c3_assert(!"register snub"); - return u2_none; - } else { - u2_weak von = u2_ci_molt(u2k(van), u2_cv_sam, u2k(sut), 0); - u2_weak gat = u2_cn_nock_on(von, hoc); - u2_weak cor = u2_ci_molt(u2k(gat), u2_cv_sam, u2k(har), - 0); - - if ( (u2_none == j2_mcj(Pt6, ut, snub)[0].xip) ) { - u2_noun xip = u2_cj_find(u2k(cor)); - - c3_assert(u2_none != xip); - j2_mcj(Pt6, ut, snub)[0].xip = xip; - } - u2z(gat); - return cor; - } - } - u2_noun // transfer - j2_mcy(Pt6, ut, snub)( - u2_noun van, // retain + j2_mcy(Pt6, ut, snub)(u2_noun van, // retain u2_noun sut, // retain u2_noun har) // retain { - u2_ho_jet *jet_j = &j2_mcj(Pt6, ut, snub)[0]; - - if ( jet_j->sat_s == u2_jet_live ) { - return j2_mcx(Pt6, ut, snub)(van, sut, har); - } - else { - u2_noun cor, fol, pro; - - cor = j2_mci(Pt6, ut, snub)(van, sut, har); - fol = u2h(cor); - - pro = u2_ho_use(jet_j, cor, fol); - if ( u2_none == pro ) return u2_cm_bail(c3__fail); - - u2z(cor); - u2z(fol); - - return pro; - } + return j2_mcx(Pt6, ut, snub)(van, sut, har); } /* structures diff --git a/gen164/6/ut_tack.c b/gen164/6/ut_tack.c index b9000599c..359b5266a 100644 --- a/gen164/6/ut_tack.c +++ b/gen164/6/ut_tack.c @@ -5,113 +5,8 @@ #include "all.h" #include "../pit.h" - static u2_noun - _tack_in(u2_noun, u2_noun, u2_noun, u2_noun, u2_atom); - - -/* internals -*/ - static u2_noun // transfer - _tack_in( - u2_noun van, // retain - u2_noun sut, // retain - u2_noun peh, // retain - u2_noun mur, // retain - u2_atom axe) // retain - { - c3_assert(0); - - if ( u2_no == u2du(peh) ) { - return u2nc(u2k(axe), u2k(mur)); - } - else { - u2_noun i_peh = u2h(peh); - u2_noun t_peh = u2t(peh); - - if ( (u2_yes == u2ud(i_peh)) || (u2_no == u2h(i_peh)) ) - { - u2_noun pi_peh = (u2_yes == u2ud(i_peh)) ? 0 : u2h(u2t(i_peh)); - u2_noun qi_peh = (u2_yes == u2ud(i_peh)) ? i_peh : u2t(u2t(i_peh)); - u2_noun pok = j2_mcy(Pt6, ut, fink) - (van, sut, pi_peh, c3__rite, qi_peh); - u2_noun wuf = j2_mby(Pt6, flay)(pok); - u2_noun p_wuf = u2h(wuf); - u2_noun q_wuf = u2t(wuf); - u2_noun nax = j2_mbc(Pt3, peg)(axe, p_wuf); - u2_noun gav = _tack_in(van, q_wuf, t_peh, mur, nax); - u2_noun p_gav = u2h(gav); - u2_noun q_gav = u2t(gav); - u2_noun qog = u2nc(u2_nul, u2k(qi_peh)); - u2_noun ret = u2nc - (u2k(p_gav), - j2_mcy(Pt6, ut, heal)(van, sut, qog, p_wuf, q_gav)); - - u2z(qog); - u2z(gav); - u2z(nax); - u2z(wuf); - u2z(pok); - - return ret; - } - else { - u2_noun bax = u2t(i_peh); - u2_noun vas = j2_mcy(Pt6, ut, peek)(van, sut, c3__rite, bax); - u2_noun nax = j2_mbc(Pt3, peg)(axe, bax); - u2_noun gav = _tack_in(van, vas, t_peh, mur, nax); - u2_noun p_gav = u2h(gav); - u2_noun q_gav = u2t(gav); - u2_noun ret = u2nc - (u2k(p_gav), - j2_mcy(Pt6, ut, heal)(van, sut, u2_nul, bax, q_gav)); - - u2z(gav); - u2z(nax); - u2z(vas); - - return ret; - } - } - } - -/* functions -*/ - u2_noun // transfer - j2_mcx(Pt6, ut, tack)( - u2_noun van, // retain - u2_noun sut, // retain - u2_noun peh, // retain - u2_noun mur) // retain - { - return _tack_in(van, sut, peh, mur, 1); - } - -/* boilerplate -*/ - u2_ho_jet - j2_mcj(Pt6, ut, tack)[]; - - u2_noun // transfer - j2_mc(Pt6, ut, tack)( - u2_noun cor) // retain - { - u2_noun van, sut, peh, mur; - - if ( (u2_no == u2_cr_mean(cor, u2_cv_sam_2, &peh, - u2_cv_sam_3, &mur, - u2_cv_con, &van, - 0)) || - (u2_none == (sut = u2_cr_at(u2_cv_sam, van))) ) - { - return u2_cm_bail(c3__fail); - } else { - return j2_mcx(Pt6, ut, tack)(van, sut, peh, mur); - } - } - u2_weak // transfer - j2_mci(Pt6, ut, tack)( - u2_noun van, // retain + j2_mci(Pt6, ut, tack)(u2_noun van, // retain u2_noun sut, // retain u2_noun peh, // retain u2_noun mur) // retain @@ -124,56 +19,18 @@ } else { u2_weak von = u2_ci_molt(u2k(van), u2_cv_sam, u2k(sut), 0); u2_weak gat = u2_cn_nock_on(von, hoc); - u2_weak cor = u2_ci_molt(u2k(gat), u2_cv_sam_2, u2k(peh), - u2_cv_sam_3, u2k(mur), - 0); - - if ( (u2_none == j2_mcj(Pt6, ut, tack)[0].xip) ) { - u2_noun xip = u2_cj_find(u2k(cor)); - - c3_assert(u2_none != xip); - j2_mcj(Pt6, ut, tack)[0].xip = xip; - } - u2z(gat); + u2_weak cor = u2_ci_molt(gat, u2_cv_sam_2, u2k(peh), + u2_cv_sam_3, u2k(mur), + 0); return cor; } } u2_noun // transfer - j2_mcy(Pt6, ut, tack)( - u2_noun van, // retain + j2_mcy(Pt6, ut, tack)(u2_noun van, // retain u2_noun sut, // retain u2_noun peh, // retain u2_noun mur) // retain { - u2_ho_jet *jet_j = &j2_mcj(Pt6, ut, tack)[0]; - - if ( jet_j->sat_s == u2_jet_live ) { - return j2_mcx(Pt6, ut, tack)(van, sut, peh, mur); - } - else { - u2_noun cor, fol, pro; - - cor = j2_mci(Pt6, ut, tack)(van, sut, peh, mur); - fol = u2h(cor); - - pro = u2_ho_use(jet_j, cor, fol); - if ( u2_none == pro ) return u2_cm_bail(c3__fail); - - u2z(cor); - u2z(fol); - - return pro; - } + return u2_cn_kick_on(j2_mci(Pt6, ut, tack)(van, sut, peh, mur)); } - -/* structures -*/ - u2_ho_jet - j2_mcj(Pt6, ut, tack)[] = { - { ".2", c3__hevy, j2_mc(Pt6, ut, tack), - u2_jet_dead, - // Tier6_b, - u2_none, u2_none }, - { } - }; diff --git a/gen164/6/ut_tock.c b/gen164/6/ut_tock.c index 2de9bc2e1..3192c5e49 100644 --- a/gen164/6/ut_tock.c +++ b/gen164/6/ut_tock.c @@ -96,65 +96,14 @@ } } - u2_weak // transfer - j2_mci(Pt6, ut, tock)( - u2_noun van, // retain - u2_noun sut, // retain - u2_noun peh, // retain - u2_noun mur, // retain - u2_noun men) // retain - { - u2_weak hoc = u2_cj_look(u2k(van), "tock"); - - if ( u2_none == hoc ) { - c3_assert(!"register tock"); - return u2_none; - } else { - u2_weak von = u2_ci_molt(u2k(van), u2_cv_sam, u2k(sut), 0); - u2_weak gat = u2_cn_nock_on(von, hoc); - u2_weak cor = u2_ci_molt(u2k(gat), u2_cv_sam_2, u2k(peh), - u2_cv_sam_6, u2k(mur), - u2_cv_sam_7, u2k(men), - 0); - - if ( (u2_none == j2_mcj(Pt6, ut, tock)[0].xip) ) { - u2_noun xip = u2_cj_find(u2k(cor)); - - c3_assert(u2_none != xip); - j2_mcj(Pt6, ut, tock)[0].xip = xip; - } - u2z(gat); - return cor; - } - } - u2_noun // transfer - j2_mcy(Pt6, ut, tock)( - u2_noun van, // retain + j2_mcy(Pt6, ut, tock)(u2_noun van, // retain u2_noun sut, // retain u2_noun peh, // retain u2_noun mur, // retain u2_noun men) // retain { - u2_ho_jet *jet_j = &j2_mcj(Pt6, ut, tock)[0]; - - if ( jet_j->sat_s == u2_jet_live ) { - return j2_mcx(Pt6, ut, tock)(van, sut, peh, mur, men); - } - else { - u2_noun cor, fol, pro; - - cor = j2_mci(Pt6, ut, tock)(van, sut, peh, mur, men); - fol = u2h(cor); - - pro = u2_ho_use(jet_j, cor, fol); - if ( u2_none == pro ) return u2_cm_bail(c3__fail); - - u2z(cor); - u2z(fol); - - return pro; - } + return j2_mcx(Pt6, ut, tock)(van, sut, peh, mur, men); } /* structures diff --git a/gen164/6/ut_wrap.c b/gen164/6/ut_wrap.c index e9195f729..218a9b8b7 100644 --- a/gen164/6/ut_wrap.c +++ b/gen164/6/ut_wrap.c @@ -74,73 +74,12 @@ } } - u2_weak // transfer - j2_mci(Pt6, ut, wrap)( - u2_noun van, // retain - u2_noun sut, // retain - u2_noun yoz) // retain - { - u2_weak hoc = u2_cj_look(u2k(van), "wrap"); - - if ( u2_none == hoc ) { - c3_assert(!"register wrap"); - return u2_none; - } else { - u2_weak von = u2_ci_molt(u2k(van), u2_cv_sam, u2k(sut), 0); - u2_weak gat = u2_cn_nock_on(von, hoc); - u2_weak cor = u2_ci_molt(u2k(gat), u2_cv_sam, u2k(yoz), 0); - - if ( (u2_none == j2_mcj(Pt6, ut, wrap)[0].xip) ) { - u2_noun xip = u2_cj_find(u2k(cor)); - - c3_assert(u2_none != xip); - j2_mcj(Pt6, ut, wrap)[0].xip = xip; - } - u2z(gat); - return cor; - } - } - u2_noun // transfer - j2_mcy(Pt6, ut, wrap)( - u2_noun van, // retain + j2_mcy(Pt6, ut, wrap)(u2_noun van, // retain u2_noun sut, // retain u2_noun yoz) // retain { - u2_ho_jet *jet_j = &j2_mcj(Pt6, ut, wrap)[0]; - - if ( (jet_j->sat_s & u2_jet_live) && !(jet_j->sat_s & u2_jet_test) ) { - if ( !(jet_j->sat_s & u2_jet_memo) ) { - return j2_mcx(Pt6, ut, wrap)(van, sut, yoz); - } - else { - c3_m fun_m = c3__wrap; - u2_noun pro = u2_cz_find_2(fun_m, sut, yoz); - - if ( u2_none != pro ) { - return pro; - } - else { - pro = j2_mcx(Pt6, ut, wrap)(van, sut, yoz); - - return u2_cz_save_2(fun_m, sut, yoz, pro); - } - } - } - else { - u2_noun cor, fol, pro; - - cor = j2_mci(Pt6, ut, wrap)(van, sut, yoz); - fol = u2h(cor); - - pro = u2_ho_use(jet_j, cor, fol); - if ( u2_none == pro ) return u2_cm_bail(c3__fail); - - u2z(cor); - u2z(fol); - - return pro; - } + return j2_mcx(Pt6, ut, wrap)(van, sut, yoz); } /* structures diff --git a/gen164/watt.c b/gen164/watt.c index 40ff5ce25..72843fc53 100644 --- a/gen164/watt.c +++ b/gen164/watt.c @@ -103,7 +103,7 @@ extern u2_ho_driver j2_mbd(Pt5, comp)[]; extern u2_ho_driver j2_mbd(Pt5, cook)[]; extern u2_ho_driver j2_mbd(Pt5, easy)[]; - extern u2_ho_driver j2_mbd(Pt5, coco)[]; + // extern u2_ho_driver j2_mbd(Pt5, coco)[]; extern u2_ho_driver j2_mbd(Pt5, coed)[]; extern u2_ho_driver j2_mbd(Pt5, glue)[]; extern u2_ho_driver j2_mbd(Pt5, here)[]; @@ -221,7 +221,9 @@ { j2_sb(Pt4, by), 0, j2_mbd(Pt4, by), 0, u2_none }, { j2_sb(Pt5, aesc), 0, j2_mbd(Pt5, aesc), 0, u2_none }, { j2_sb(Pt5, bend), 0, j2_mbd(Pt5, bend), 0, u2_none }, +#if 0 { j2_sb(Pt5, coco), 0, j2_mbd(Pt5, coco), 0, u2_none }, +#endif { j2_sb(Pt5, coed), 0, j2_mbd(Pt5, coed), 0, u2_none }, { j2_sb(Pt5, cold), 0, j2_mbd(Pt5, cold), 0, u2_none }, { j2_sb(Pt5, comp), 0, j2_mbd(Pt5, comp), 0, u2_none }, diff --git a/include/c/motes.h b/include/c/motes.h index 6c9e99473..73b5af256 100644 --- a/include/c/motes.h +++ b/include/c/motes.h @@ -1080,6 +1080,7 @@ # define c3__ud c3_s2('u','d') # define c3__ulib c3_s4('u','l','i','b') # define c3__un c3_s2('u','n') +# define c3__uniq c3_s4('u','n','i','q') # define c3__unix c3_s4('u','n','i','x') # define c3__unt c3_s3('u','n','t') # define c3__up c3_s2('u','p')