diff --git a/Makefile b/Makefile index a4b0eb111a..a5144b4e94 100644 --- a/Makefile +++ b/Makefile @@ -175,7 +175,6 @@ N_OFILES=\ noun/vortex.o \ noun/zave.o - J_A_OFILES=\ jets/a/add.o \ jets/a/dec.o \ @@ -275,6 +274,7 @@ J_E_OFILES=\ jets/e/rd.o \ jets/e/rq.o \ jets/e/rs.o \ + jets/e/rh.o \ jets/e/rub.o \ jets/e/scr.o \ jets/e/shax.o \ @@ -302,8 +302,10 @@ J_F_OFILES=\ jets/f/flip.o \ jets/f/flor.o \ jets/f/fork.o \ + jets/f/help.o \ jets/f/hike.o \ jets/f/look.o \ + jets/f/loot.o J_F_OFILES_UT=\ jets/f/ut.o \ @@ -321,7 +323,7 @@ J_F_OFILES_UT=\ jets/f/ut_mull.o \ jets/f/ut_nest.o \ jets/f/ut_peek.o \ - jets/f/ut_perk.o \ + jets/f/ut_peel.o \ jets/f/ut_play.o \ jets/f/ut_repo.o \ jets/f/ut_rest.o \ @@ -344,178 +346,7 @@ J_OFILES=\ $(J_G_OFILES) \ jets/tree.o -M_A_OFILES=\ - mets/a/add.o \ - mets/a/dec.o \ - mets/a/div.o \ - mets/a/gte.o \ - mets/a/gth.o \ - mets/a/lte.o \ - mets/a/lth.o \ - mets/a/mod.o \ - mets/a/mul.o \ - mets/a/sub.o - -M_B_OFILES=\ - mets/b/bind.o \ - mets/b/clap.o \ - mets/b/drop.o \ - mets/b/flop.o \ - mets/b/lent.o \ - mets/b/levy.o \ - mets/b/lien.o \ - mets/b/murn.o \ - mets/b/need.o \ - mets/b/reap.o \ - mets/b/reel.o \ - mets/b/roll.o \ - mets/b/skid.o \ - mets/b/skim.o \ - mets/b/skip.o \ - mets/b/scag.o \ - mets/b/slag.o \ - mets/b/snag.o \ - mets/b/sort.o \ - mets/b/turn.o \ - mets/b/weld.o - -M_C_OFILES=\ - mets/c/bex.o \ - mets/c/xeb.o \ - mets/c/can.o \ - mets/c/cap.o \ - mets/c/cat.o \ - mets/c/con.o \ - mets/c/cut.o \ - mets/c/dor.o \ - mets/c/dvr.o \ - mets/c/dis.o \ - mets/c/end.o \ - mets/c/gor.o \ - mets/c/hor.o \ - mets/c/lsh.o \ - mets/c/mas.o \ - mets/c/met.o \ - mets/c/mix.o \ - mets/c/mug.o \ - mets/c/muk.o \ - mets/c/peg.o \ - mets/c/po.o \ - mets/c/pow.o \ - mets/c/rap.o \ - mets/c/rep.o \ - mets/c/rip.o \ - mets/c/rsh.o \ - mets/c/sqt.o \ - mets/c/vor.o - -M_D_OFILES=\ - mets/d/in_has.o \ - mets/d/in_int.o \ - mets/d/in_gas.o \ - mets/d/in_mer.o \ - mets/d/in_put.o \ - mets/d/in_tap.o \ - mets/d/in_uni.o \ - mets/d/in_wyt.o \ - mets/d/in_bif.o \ - mets/d/in_dif.o \ - mets/d/by_gas.o \ - mets/d/by_get.o \ - mets/d/by_has.o \ - mets/d/by_int.o \ - mets/d/by_put.o \ - mets/d/by_uni.o \ - mets/d/by_bif.o \ - mets/d/by_dif.o - -M_E_OFILES=\ - mets/e/aes_ecb.o \ - mets/e/aes_cbc.o \ - mets/e/aesc.o \ - mets/e/cue.o \ - mets/e/fl.o \ - mets/e/jam.o \ - mets/e/mat.o \ - mets/e/mink.o \ - mets/e/mule.o \ - mets/e/parse.o \ - mets/e/rd.o \ - mets/e/rq.o \ - mets/e/rs.o \ - mets/e/rh.o \ - mets/e/rub.o \ - mets/e/scr.o \ - mets/e/shax.o \ - mets/e/lore.o \ - mets/e/loss.o \ - mets/e/lune.o \ - mets/e/trip.o - -M_E_OFILES_ED=\ - mets/e/ed_puck.o \ - mets/e/ed_sign.o \ - mets/e/ed_veri.o \ - mets/e/ed_shar.o - -M_F_OFILES=\ - mets/f/al.o \ - mets/f/ap.o \ - mets/f/cell.o \ - mets/f/comb.o \ - mets/f/cons.o \ - mets/f/core.o \ - mets/f/face.o \ - mets/f/fitz.o \ - mets/f/flan.o \ - mets/f/flip.o \ - mets/f/flor.o \ - mets/f/fork.o \ - mets/f/help.o \ - mets/f/hike.o \ - mets/f/look.o \ - mets/f/loot.o - -M_F_OFILES_UT=\ - mets/f/ut.o \ - mets/f/ut_burn.o \ - mets/f/ut_buss.o \ - mets/f/ut_conk.o \ - mets/f/ut_crop.o \ - mets/f/ut_find.o \ - mets/f/ut_fire.o \ - mets/f/ut_fish.o \ - mets/f/ut_fuse.o \ - mets/f/ut_gain.o \ - mets/f/ut_lose.o \ - mets/f/ut_mint.o \ - mets/f/ut_mull.o \ - mets/f/ut_nest.o \ - mets/f/ut_peek.o \ - mets/f/ut_peel.o \ - mets/f/ut_play.o \ - mets/f/ut_repo.o \ - mets/f/ut_rest.o \ - mets/f/ut_tack.o \ - mets/f/ut_toss.o \ - mets/f/ut_wrap.o - -M_G_OFILES=\ - mets/g/down.o - -M_OFILES=\ - $(M_A_OFILES) \ - $(M_B_OFILES) \ - $(M_C_OFILES) \ - $(M_D_OFILES) \ - $(M_E_OFILES) \ - $(M_E_OFILES_ED) \ - $(M_F_OFILES) \ - $(M_F_OFILES_UT) \ - $(M_G_OFILES) \ - mets/tree.o - -BASE_OFILES=$(N_OFILES) $(J_OFILES) $(M_OFILES) +BASE_OFILES=$(N_OFILES) $(J_OFILES) OUT_OFILES=\ outside/jhttp/http_parser.o \ diff --git a/include/all.h b/include/all.h index cb259812a1..b671d8efcc 100644 --- a/include/all.h +++ b/include/all.h @@ -31,7 +31,3 @@ # include "jets/k.h" // u3k: jets (transfer, args) # include "jets/q.h" // u3q: jets (retain, args) # include "jets/w.h" // u3w: jets (retain, core) - -# include "jets/l.h" // u3k: jets (transfer, args) -# include "jets/g.h" // u3q: jets (retain, args) -# include "jets/y.h" // u3w: jets (retain, core) diff --git a/include/jets/k.h b/include/jets/k.h index 372e2ba233..d9171a511a 100644 --- a/include/jets/k.h +++ b/include/jets/k.h @@ -68,7 +68,7 @@ /* u3kdi_tap(): map/set convert to list. (solves by_tap also.) */ u3_noun - u3kdi_tap(u3_noun a, u3_noun b); + u3kdi_tap(u3_noun a); /* u3kdi_put(): put in set. */ @@ -80,7 +80,7 @@ u3_noun u3kdi_uni(u3_noun a, u3_noun b); -# define u3kdb_tap(a, b) u3kdi_tap(a, b) +# define u3kdb_tap(a) u3kdi_tap(a) /* u3ke: tier 5 functions */ @@ -104,6 +104,11 @@ u3_noun u3kf_fork(u3_noun yed); + /* u3kz_fork(): build %fork span. + */ + u3_noun + u3kz_fork(u3_noun yed); + /* u3kfu_repo(): */ u3_noun diff --git a/include/jets/q.h b/include/jets/q.h index 3181a9e2ec..6fd6e21dac 100644 --- a/include/jets/q.h +++ b/include/jets/q.h @@ -88,7 +88,7 @@ u3_noun u3qdi_int(u3_noun, u3_noun); u3_noun u3qdi_mer(u3_noun, u3_noun); u3_noun u3qdi_put(u3_noun, u3_noun); - u3_noun u3qdi_tap(u3_noun, u3_noun); + u3_noun u3qdi_tap(u3_noun); u3_noun u3qdi_uni(u3_noun, u3_noun); u3_noun u3qdi_wyt(u3_noun); @@ -174,6 +174,18 @@ u3_noun u3qeq_gte(u3_atom, u3_atom); u3_noun u3qeq_gth(u3_atom, u3_atom); + u3_noun u3qes_add(u3_atom, u3_atom, u3_atom); + u3_noun u3qes_sub(u3_atom, u3_atom, u3_atom); + u3_noun u3qes_mul(u3_atom, u3_atom, u3_atom); + u3_noun u3qes_div(u3_atom, u3_atom, u3_atom); + u3_noun u3qes_sqt(u3_atom, u3_atom); + u3_noun u3qes_fma(u3_atom, u3_atom, u3_atom, u3_atom); + u3_noun u3qes_lth(u3_atom, u3_atom); + u3_noun u3qes_lte(u3_atom, u3_atom); + u3_noun u3qes_equ(u3_atom, u3_atom); + u3_noun u3qes_gte(u3_atom, u3_atom); + u3_noun u3qes_gth(u3_atom, u3_atom); + /** Tier 6. **/ u3_noun u3qf_bull(u3_noun, u3_noun); @@ -192,8 +204,10 @@ u3_noun u3qf_forq(u3_noun, u3_noun); u3_noun u3qf_fork(u3_noun); u3_noun u3qf_grof(u3_noun); + u3_noun u3qf_help(u3_noun, u3_noun); u3_noun u3qf_hike(u3_noun, u3_noun); u3_noun u3qf_look(u3_noun, u3_noun); + u3_noun u3qf_loot(u3_noun, u3_noun); u3_noun u3qf_slot(u3_atom, u3_noun); u3_noun u3qf_type(u3_noun); @@ -212,6 +226,7 @@ # define u3qfu_van_fab 119 u3_noun u3qfu_burn(u3_noun, u3_noun); + u3_noun u3qfu_busk(u3_noun, u3_noun, u3_noun); u3_noun u3qfu_buss(u3_noun, u3_noun, u3_noun, u3_noun); u3_noun u3qfu_bust(u3_noun, u3_noun, u3_noun); u3_noun u3qfu_conk(u3_noun, u3_noun, u3_noun); @@ -237,7 +252,7 @@ u3_noun u3qfu_nost(u3_noun, u3_noun, u3_noun, u3_noun); u3_noun u3qfu_orth(u3_noun, u3_noun, u3_noun); u3_noun u3qfu_peek(u3_noun, u3_noun, u3_noun, u3_noun); - u3_noun u3qfu_perk(u3_noun, u3_noun, u3_noun, u3_noun); + u3_noun u3qfu_peel(u3_noun, u3_noun, u3_noun, u3_noun); u3_noun u3qfu_play(u3_noun, u3_noun, u3_noun); u3_noun u3qfu_repo(u3_noun, u3_noun); u3_noun u3qfu_rest(u3_noun, u3_noun, u3_noun); @@ -248,3 +263,81 @@ u3_noun u3qfu_tack(u3_noun, u3_noun, u3_noun, u3_noun); 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 u3qz_bull(u3_noun, u3_noun); + u3_noun u3qz_cell(u3_noun, u3_noun); + u3_noun u3qz_comb(u3_noun, u3_noun); + u3_noun u3qz_cons(u3_noun, u3_noun); + u3_noun u3qz_core(u3_noun, u3_noun); + u3_noun u3qz_cube(u3_noun, u3_noun); + u3_noun u3qz_face(u3_noun, u3_noun); + u3_noun u3qz_fine(u3_noun, u3_noun, u3_noun); + u3_noun u3qz_fitz(u3_noun, u3_noun); + u3_noun u3qz_flan(u3_noun, u3_noun); + u3_noun u3qz_flay(u3_noun); + u3_noun u3qz_flip(u3_noun); + u3_noun u3qz_flor(u3_noun, u3_noun); + u3_noun u3qz_forq(u3_noun, u3_noun); + u3_noun u3qz_fork(u3_noun); + u3_noun u3qz_grof(u3_noun); + u3_noun u3qz_help(u3_noun, u3_noun); + u3_noun u3qz_hike(u3_noun, u3_noun); + u3_noun u3qz_look(u3_noun, u3_noun); + u3_noun u3qz_loot(u3_noun, u3_noun); + u3_noun u3qz_slot(u3_atom, u3_noun); + u3_noun u3qz_type(u3_noun); + + u3_noun u3qzl_bunt(u3_noun, u3_noun); + u3_noun u3qzl_whip(u3_noun, u3_noun, u3_noun); + + u3_noun u3qzp_hack(u3_noun, u3_noun); + u3_noun u3qzp_late(u3_noun); + u3_noun u3qzp_open(u3_noun, u3_noun); + u3_noun u3qzp_rake(u3_noun); + +# define u3qzu_van_fan 28 +# define u3qzu_van_rib 58 +# define u3qzu_van_vrf 59 +# define u3qzu_van_vet 118 +# define u3qzu_van_fab 119 + + u3_noun u3qzu_burn(u3_noun, u3_noun); + u3_noun u3qzu_busk(u3_noun, u3_noun, u3_noun); + u3_noun u3qzu_buss(u3_noun, u3_noun, u3_noun, u3_noun); + u3_noun u3qzu_bust(u3_noun, u3_noun, u3_noun); + u3_noun u3qzu_conk(u3_noun, u3_noun, u3_noun); + u3_noun u3qzu_crop(u3_noun, u3_noun, u3_noun); + u3_noun u3qzu_cull(u3_noun, u3_noun, u3_noun, u3_atom, u3_noun); + u3_noun u3qzu_duck(u3_noun, u3_noun); + u3_noun u3qzu_dung(u3_noun, u3_noun cap, u3_noun); + u3_noun u3qzu_dunq(u3_noun, const c3_c*, u3_noun); + void u3qzu_dump(u3_noun, const c3_c*, u3_noun); + u3_noun u3qzu_fond(u3_noun, u3_noun, u3_noun, u3_noun); + u3_noun u3qzu_finc(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); + u3_noun u3qzu_fink(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); + u3_noun u3qzu_fire(u3_noun, u3_noun, u3_noun); + u3_noun u3qzu_firm(u3_noun, u3_noun, u3_noun); + u3_noun u3qzu_fish(u3_noun, u3_noun, u3_atom); + u3_noun u3qzu_fuse(u3_noun, u3_noun, u3_noun); + u3_noun u3qzu_gain(u3_noun, u3_noun, u3_noun); + u3_noun u3qzu_heal(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); + u3_noun u3qzu_lose(u3_noun, u3_noun, u3_noun); + u3_noun u3qzu_mint(u3_noun, u3_noun, u3_noun, u3_noun); + u3_noun u3qzu_mull(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); + u3_noun u3qzu_nest(u3_noun, u3_noun, u3_noun, u3_noun); + u3_noun u3qzu_nost(u3_noun, u3_noun, u3_noun, u3_noun); + u3_noun u3qzu_orth(u3_noun, u3_noun, u3_noun); + u3_noun u3qzu_peek(u3_noun, u3_noun, u3_noun, u3_noun); + u3_noun u3qzu_peel(u3_noun, u3_noun, u3_noun, u3_noun); + u3_noun u3qzu_play(u3_noun, u3_noun, u3_noun); + u3_noun u3qzu_repo(u3_noun, u3_noun); + u3_noun u3qzu_rest(u3_noun, u3_noun, u3_noun); + u3_noun u3qzu_shep(u3_noun, const c3_c*, u3_noun, u3_noun); + u3_noun u3qzu_shew(u3_noun, u3_noun); + u3_noun u3qzu_sift(u3_noun, u3_noun, u3_noun); + u3_noun u3qzu_snub(u3_noun, u3_noun, u3_noun); + u3_noun u3qzu_tack(u3_noun, u3_noun, u3_noun, u3_noun); + u3_noun u3qzu_toss(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); + u3_noun u3qzu_wrap(u3_noun, u3_noun, u3_noun); + diff --git a/include/jets/w.h b/include/jets/w.h index fe29482a95..693cff4bac 100644 --- a/include/jets/w.h +++ b/include/jets/w.h @@ -204,6 +204,18 @@ u3_noun u3weq_gte(u3_noun); u3_noun u3weq_gth(u3_noun); + u3_noun u3wes_add(u3_noun); + u3_noun u3wes_sub(u3_noun); + u3_noun u3wes_mul(u3_noun); + u3_noun u3wes_div(u3_noun); + u3_noun u3wes_sqt(u3_noun); + u3_noun u3wes_fma(u3_noun); + u3_noun u3wes_lth(u3_noun); + u3_noun u3wes_lte(u3_noun); + u3_noun u3wes_equ(u3_noun); + u3_noun u3wes_gte(u3_noun); + u3_noun u3wes_gth(u3_noun); + /** Tier 6. **/ u3_noun u3wf_bull(u3_noun); @@ -221,8 +233,10 @@ u3_noun u3wf_flor(u3_noun); u3_noun u3wf_forq(u3_noun); u3_noun u3wf_fork(u3_noun); + u3_noun u3wf_help(u3_noun); u3_noun u3wf_hike(u3_noun); u3_noun u3wf_look(u3_noun); + u3_noun u3wf_loot(u3_noun); u3_noun u3wfl_bunt(u3_noun); u3_noun u3wfl_whip(u3_noun); @@ -251,7 +265,7 @@ u3_noun u3wfu_mull(u3_noun); u3_noun u3wfu_nest(u3_noun); u3_noun u3wfu_peek(u3_noun); - u3_noun u3wfu_perk(u3_noun); + u3_noun u3wfu_peel(u3_noun); u3_noun u3wfu_play(u3_noun); u3_noun u3wfu_repo(u3_noun); u3_noun u3wfu_rest(u3_noun); @@ -259,6 +273,60 @@ u3_noun u3wfu_toss(u3_noun); u3_noun u3wfu_wrap(u3_noun); + u3_noun u3wz_bull(u3_noun); + u3_noun u3wz_cell(u3_noun); + u3_noun u3wz_comb(u3_noun); + u3_noun u3wz_cons(u3_noun); + u3_noun u3wz_core(u3_noun); + u3_noun u3wz_cube(u3_noun); + u3_noun u3wz_face(u3_noun); + u3_noun u3wz_fine(u3_noun); + u3_noun u3wz_fitz(u3_noun); + u3_noun u3wz_flan(u3_noun); + u3_noun u3wz_flay(u3_noun); + u3_noun u3wz_flip(u3_noun); + u3_noun u3wz_flor(u3_noun); + u3_noun u3wz_forq(u3_noun); + u3_noun u3wz_fork(u3_noun); + u3_noun u3wz_help(u3_noun); + u3_noun u3wz_hike(u3_noun); + u3_noun u3wz_look(u3_noun); + u3_noun u3wz_loot(u3_noun); + + u3_noun u3wzl_bunt(u3_noun); + u3_noun u3wzl_whip(u3_noun); + + u3_noun u3wzp_hack(u3_noun); + u3_noun u3wzp_late(u3_noun); + u3_noun u3wzp_open(u3_noun); + u3_noun u3wzp_rake(u3_noun); + + u3_noun u3wzu_burn(u3_noun); + u3_noun u3wzu_busk(u3_noun); + u3_noun u3wzu_bust(u3_noun); + u3_noun u3wzu_conk(u3_noun); + u3_noun u3wzu_crop(u3_noun); + u3_noun u3wzu_cull(u3_noun); + u3_noun u3wzu_duck(u3_noun); + u3_noun u3wzu_find(u3_noun); + u3_noun u3wzu_fond(u3_noun); + u3_noun u3wzu_fink(u3_noun); + u3_noun u3wzu_fire(u3_noun); + u3_noun u3wzu_firm(u3_noun); + u3_noun u3wzu_fish(u3_noun); + u3_noun u3wzu_fuse(u3_noun); + u3_noun u3wzu_heal(u3_noun); + u3_noun u3wzu_mint(u3_noun); + u3_noun u3wzu_mull(u3_noun); + u3_noun u3wzu_nest(u3_noun); + u3_noun u3wzu_peek(u3_noun); + u3_noun u3wzu_peel(u3_noun); + u3_noun u3wzu_play(u3_noun); + u3_noun u3wzu_repo(u3_noun); + u3_noun u3wzu_rest(u3_noun); + u3_noun u3wzu_snub(u3_noun); + u3_noun u3wzu_toss(u3_noun); + u3_noun u3wzu_wrap(u3_noun); /** Tier 7. **/ diff --git a/jets/d/by_bif.c b/jets/d/by_bif.c index 8afa2aac83..3e53ba6d63 100644 --- a/jets/d/by_bif.c +++ b/jets/d/by_bif.c @@ -5,6 +5,7 @@ /* internal functions */ + static u3_noun _b_bif_putroot(u3_noun a, u3_noun b) { diff --git a/jets/d/by_dif.c b/jets/d/by_dif.c index 3942a82022..7973a4f343 100644 --- a/jets/d/by_dif.c +++ b/jets/d/by_dif.c @@ -5,6 +5,7 @@ /* internal functions */ + static u3_noun _b_dif_join(u3_noun d, u3_noun e) { diff --git a/jets/d/in_bif.c b/jets/d/in_bif.c index 5abace47ad..4c5bdbeb91 100644 --- a/jets/d/in_bif.c +++ b/jets/d/in_bif.c @@ -5,6 +5,7 @@ /* internal functions */ + static u3_noun _i_bif_putroot(u3_noun a, u3_noun b) { diff --git a/jets/d/in_dif.c b/jets/d/in_dif.c index 1a861b5a60..389cc1fa54 100644 --- a/jets/d/in_dif.c +++ b/jets/d/in_dif.c @@ -5,6 +5,7 @@ /* internal functions */ + static u3_noun _i_dif_join(u3_noun d, u3_noun e) { diff --git a/jets/d/in_tap.c b/jets/d/in_tap.c index c31fdff778..f82d5e4a0e 100644 --- a/jets/d/in_tap.c +++ b/jets/d/in_tap.c @@ -27,31 +27,29 @@ } u3_noun - u3qdi_tap(u3_noun a, - u3_noun b) + u3qdi_tap(u3_noun a) { - return _tap_in(a, u3k(b)); + return _tap_in(a, u3_nul); } u3_noun u3wdi_tap(u3_noun cor) { - u3_noun a, b; + u3_noun a; - if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) ) { + if ( c3n == u3r_mean(cor, u3x_con_sam, &a, 0) ) { return u3m_bail(c3__exit); } else { - return u3qdi_tap(a, b); + return u3qdi_tap(a); } } u3_noun - u3kdi_tap(u3_noun a, - u3_noun b) + u3kdi_tap(u3_noun a) { - u3_weak c = u3qdi_tap(a, b); + u3_weak b = u3qdi_tap(a); - u3z(a); u3z(b); - if ( u3_none == c ) { + u3z(a); + if ( u3_none == b ) { return u3m_bail(c3__exit); } - else return c; + else return b; } diff --git a/jets/e/parse.c b/jets/e/parse.c index f467c59051..31b9fd5d30 100644 --- a/jets/e/parse.c +++ b/jets/e/parse.c @@ -78,7 +78,7 @@ /* bend */ - u3_noun + static u3_noun _cqe_bend_fun(u3_noun raq, u3_noun vex, u3_noun sab) @@ -148,7 +148,7 @@ /* cold */ - u3_noun + static u3_noun _cqe_cold_fun(u3_noun cus, u3_noun sef, u3_noun tub) @@ -193,7 +193,7 @@ /* cook */ - u3_noun + static u3_noun _cqe_cook_fun(u3_noun poq, u3_noun sef, u3_noun tub) @@ -240,7 +240,7 @@ /* comp */ - u3_noun + static u3_noun _cqe_comp_fun(u3_noun raq, u3_noun vex, u3_noun sab) @@ -301,7 +301,7 @@ /* easy */ - u3_noun + static u3_noun _cqe_easy_fun(u3_noun huf, u3_noun tub) { @@ -313,8 +313,9 @@ u3k(huf), u3k(tub)); } + u3_noun -u3we_easy_fun(u3_noun cor) + u3we_easy_fun(u3_noun cor) { u3_noun van, huf, tub; @@ -329,7 +330,7 @@ u3we_easy_fun(u3_noun cor) /* glue */ - u3_noun + static u3_noun _cqe_glue_fun(u3_noun bus, u3_noun vex, u3_noun sab) @@ -406,7 +407,7 @@ u3we_easy_fun(u3_noun cor) /* here */ - u3_noun + static u3_noun _cqe_here_fun(u3_noun hez, u3_noun sef, u3_noun tub) @@ -462,7 +463,7 @@ u3we_easy_fun(u3_noun cor) /* just */ - u3_noun + static u3_noun _cqe_just_fun(u3_noun daf, u3_noun tub) { @@ -498,7 +499,7 @@ u3we_easy_fun(u3_noun cor) /* mask */ - u3_noun + static u3_noun _cqe_mask_fun(u3_noun bud, u3_noun tub) { @@ -536,7 +537,7 @@ u3we_easy_fun(u3_noun cor) } /* pfix */ - u3_noun + static u3_noun _cqe_pfix(u3_noun vex, u3_noun sab) { @@ -577,7 +578,7 @@ u3we_easy_fun(u3_noun cor) /* plug */ - u3_noun + static u3_noun _cqe_plug(u3_noun vex, u3_noun sab) { @@ -668,7 +669,7 @@ u3we_easy_fun(u3_noun cor) /* sfix */ - u3_noun + static u3_noun _cqe_sfix(u3_noun vex, u3_noun sab) { @@ -722,7 +723,7 @@ u3we_easy_fun(u3_noun cor) /* shim */ - u3_noun + static u3_noun _cqe_shim_fun(u3_noun zep, u3_noun tub) { @@ -768,7 +769,7 @@ u3we_easy_fun(u3_noun cor) /* stag */ - u3_noun + static u3_noun _cqe_stag_fun(u3_noun gob, u3_noun sef, u3_noun tub) @@ -840,7 +841,7 @@ u3we_easy_fun(u3_noun cor) } } - u3_noun + static u3_noun _cqe_stew_fun(u3_noun hel, u3_noun tub) { @@ -911,7 +912,7 @@ u3we_easy_fun(u3_noun cor) /* stir */ - u3_noun + static u3_noun _cqe_stir_fun(u3_noun rud, u3_noun raq, u3_noun fel, diff --git a/jets/e/scr.c b/jets/e/scr.c index b630389e6a..9111f8a6cc 100644 --- a/jets/e/scr.c +++ b/jets/e/scr.c @@ -7,7 +7,7 @@ #include #include -int _crypto_scrypt(const uint8_t *, size_t, const uint8_t *, size_t, +static int _crypto_scrypt(const uint8_t *, size_t, const uint8_t *, size_t, uint64_t, uint32_t, uint32_t, uint8_t *, size_t); /* functions @@ -208,7 +208,7 @@ int _crypto_scrypt(const uint8_t *, size_t, const uint8_t *, size_t, * * Return 0 on success; or -1 on error. */ -int +static int _crypto_scrypt(const uint8_t * passwd, size_t passwdlen, const uint8_t * salt, size_t saltlen, uint64_t N, uint32_t r, uint32_t p, uint8_t * buf, size_t buflen) diff --git a/jets/f/ap.c b/jets/f/ap.c index 7fdc6009ff..1ad3180722 100644 --- a/jets/f/ap.c +++ b/jets/f/ap.c @@ -590,7 +590,7 @@ _open_do_pqrs(sgcn) // ~% { return u3nt(c3__sggl, - u3nq(c3__fast, + u3nq(c3__sgcn, c3__clls, u3nt(c3__dtzz, u3_blip, u3k(p_gen)), u3nt(u3nc(c3__zpts, u3k(q_gen)), @@ -609,7 +609,7 @@ _open_do_pq(sgls) // ~+ { return u3nt(c3__sggr, - u3nq(c3__memo, c3__dtzz, u3_blip, u3k(p_gen)), + u3nq(c3__sgls, c3__dtzz, u3_blip, u3k(p_gen)), u3k(q_gen)); } _open_do_pqr(sgpm) // ~& @@ -987,7 +987,7 @@ /* boilerplate */ - u3_noun + static u3_noun _ap_core(u3_noun ter, u3_noun gen) { diff --git a/jets/f/look.c b/jets/f/look.c index 09c8d88303..eb1fb2ec9c 100644 --- a/jets/f/look.c +++ b/jets/f/look.c @@ -108,6 +108,8 @@ } } + + /* functions */ diff --git a/jets/f/ut.c b/jets/f/ut.c index 9d5eeece8a..7b07aa5341 100644 --- a/jets/f/ut.c +++ b/jets/f/ut.c @@ -4,7 +4,7 @@ #include "all.h" extern void - u3_lo_tank(c3_l tab_l, u3_noun tac); + u3_pier_tank(c3_l tab_l, u3_noun tac); // duck: create a duck core for mean. @@ -66,8 +66,9 @@ sprintf(ugh_c, "%s: %s: 0x%8x:", paz_c, pfix_c, u3r_mug(typ)); - - u3_lo_tank(0, u3n_kick_on(u3qfu_dunq(van, ugh_c, typ))); +#if 0 + u3_pier_tank(0, u3n_kick_on(u3qfu_dunq(van, ugh_c, typ))); +#endif } // shew: create a show core for mean diff --git a/jets/f/ut_burn.c b/jets/f/ut_burn.c index 2af7d4b481..f7da4d6b21 100644 --- a/jets/f/ut_burn.c +++ b/jets/f/ut_burn.c @@ -53,7 +53,7 @@ u3_noun sut, u3_noun gil) { - u3_noun p_sut, q_sut, pq_sut, qq_sut, rq_sut, prq_sut, qrq_sut; + u3_noun p_sut, q_sut, pq_sut, qq_sut, rq_sut, sq_sut, psq_sut, qsq_sut; if ( c3n == u3du(sut) ) switch ( sut ) { default: return u3m_bail(c3__fail); @@ -98,8 +98,8 @@ } } case c3__core: u3x_cell(u3t(sut), &p_sut, &q_sut); - u3x_trel(q_sut, &pq_sut, &qq_sut, &rq_sut); - u3x_cell(rq_sut, &prq_sut, &qrq_sut); + u3x_qual(q_sut, &pq_sut, &qq_sut, &rq_sut, &sq_sut); + u3x_cell(sq_sut, &psq_sut, &qsq_sut); { u3_noun pay = _burn_in(van, p_sut, gil); @@ -107,19 +107,20 @@ return u3_nul; } else { - u3_noun ret = u3nt(u3_nul, u3k(prq_sut), u3k(u3t(pay))); + u3_noun ret = u3nt(u3_nul, u3k(psq_sut), u3k(u3t(pay))); u3z(pay); return ret; } } + case c3__help: case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut); { return _burn_in(van, q_sut, gil); } case c3__fork: p_sut = u3t(sut); { - u3_noun yed = u3qdi_tap(p_sut, u3_nul); + u3_noun yed = u3qdi_tap(p_sut); u3_noun ret = _burn_fork(van, yed, gil); u3z(yed); @@ -144,7 +145,7 @@ } } - u3_noun + static u3_noun _cqfu_burn(u3_noun van, u3_noun sut) { @@ -165,7 +166,7 @@ u3qfu_burn(u3_noun van, u3_noun sut) { - c3_m fun_m = c3__burn + !!u3r_at(u3qfu_van_vet, van); + c3_m fun_m = 144 + c3__burn + ((!!u3r_at(u3qfu_van_vet, van)) << 8); u3_noun pro = u3z_find(fun_m, sut); if ( u3_none != pro ) { diff --git a/jets/f/ut_buss.c b/jets/f/ut_buss.c index 89478b2448..df62f73676 100644 --- a/jets/f/ut_buss.c +++ b/jets/f/ut_buss.c @@ -6,7 +6,7 @@ /* logic */ - u3_noun + static u3_noun _cqfu_buss(u3_noun van, u3_noun sut, u3_noun cog, @@ -23,6 +23,20 @@ 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_hook(von, "busk"); + + return u3n_kick_on(u3i_molt(gat, + u3x_sam, + u3k(gen), + 0)); + } + /* boilerplate */ u3_noun @@ -51,3 +65,29 @@ { 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/f/ut_conk.c b/jets/f/ut_conk.c index b2142a2c44..acf8b0ff0e 100644 --- a/jets/f/ut_conk.c +++ b/jets/f/ut_conk.c @@ -6,13 +6,17 @@ /* logic */ - u3_noun + static u3_noun _cqfu_conk(u3_noun van, u3_noun sut, u3_noun got) { if ( c3y == u3ud(got) ) { - return u3qf_face(got, sut); + u3_noun nux = u3nc(u3_nul, u3k(got)); + u3_noun ret = u3qf_face(nux, sut); + + u3z(nux); + return ret; } else switch ( u3h(got) ) { default: return u3m_bail(c3__fail); @@ -22,8 +26,10 @@ } case 1: { u3_noun cok = _cqfu_conk(van, sut, u3t(u3t(got))); - u3_noun ret = u3qf_face(u3h(u3t(got)), cok); + u3_noun nux = u3k(u3h(u3t(got))); + u3_noun ret = u3qf_face(nux, cok); + u3z(nux); u3z(cok); return ret; } diff --git a/jets/f/ut_crop.c b/jets/f/ut_crop.c index 8aaa65089d..15b9cf2d2e 100644 --- a/jets/f/ut_crop.c +++ b/jets/f/ut_crop.c @@ -142,6 +142,14 @@ } else return _crop_sint(van, sut, ref, bix); } + case c3__help: u3x_cell(u3t(sut), &p_sut, &q_sut); + { + u3_noun foz = _crop_dext(van, q_sut, ref, bix); + u3_noun ret = u3qf_help(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); @@ -152,7 +160,7 @@ } case c3__fork: p_sut = u3t(sut); { - u3_noun yed = u3qdi_tap(p_sut, u3_nul); + u3_noun yed = u3qdi_tap(p_sut); u3_noun ret = u3kf_fork(_crop_dext_fork(van, yed, ref, bix)); u3z(yed); @@ -196,13 +204,14 @@ default: return u3m_bail(c3__fail); case c3__core: + case c3__help: 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_nul); + u3_noun yed = u3qdi_tap(p_ref); u3_noun ret = _crop_sint_fork(van, sut, yed, bix); u3z(yed); @@ -219,7 +228,7 @@ } } - u3_noun + static u3_noun _cqfu_crop(u3_noun van, u3_noun sut, u3_noun ref) @@ -248,7 +257,7 @@ u3_noun sut, u3_noun ref) { - c3_m fun_m = c3__crop + !!u3r_at(u3qfu_van_vet, van); + c3_m fun_m = 144 + 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/f/ut_find.c b/jets/f/ut_find.c index 55cfb4dc9c..700c46a989 100644 --- a/jets/f/ut_find.c +++ b/jets/f/ut_find.c @@ -71,17 +71,29 @@ if ( 0 == p_heg ) { return u3nq (c3y, + u3_nul, u3nt(u3_nul, u3nc(u3_nul, u3k(axe)), u3k(lon)), - c3y, - u3k(sut)); + u3nc(c3y, u3k(sut))); } else { return u3nt (c3n, c3y, u3qa_dec(p_heg)); } } + + static u3_noun + _find_join(u3_noun a, + u3_noun b) + { + if ( c3y == u3r_sing(a, b) ) { + return u3k(a); + } else { + return u3kb_weld(u3k(a), u3nc(c3_s2('|', '|'), u3k(b))); + } + } + static u3_noun _find_buck_lose(u3_noun van, u3_noun sut, @@ -161,17 +173,17 @@ u3_noun lon, u3_noun gil) { - u3_noun p_sut, q_sut, pq_sut, qq_sut, rq_sut, prq_sut, qrq_sut; + u3_noun p_sut, q_sut, pq_sut, qq_sut, rq_sut, sq_sut, psq_sut, qsq_sut; u3x_cell(u3t(sut), &p_sut, &q_sut); - u3x_trel(q_sut, &pq_sut, &qq_sut, &rq_sut); - u3x_cell(rq_sut, &prq_sut, &qrq_sut); + u3x_qual(q_sut, &pq_sut, &qq_sut, &rq_sut, &sq_sut); + u3x_cell(sq_sut, &psq_sut, &qsq_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_look(u3t(q_heg), qrq_sut); + u3_noun zem = u3qf_loot(u3t(q_heg), qsq_sut); if ( (u3_nul != zem) && (0 != p_heg) ) { u3_noun ped; @@ -187,27 +199,31 @@ u3_noun u_zem = u3t(zem); u3_noun pu_zem = u3h(u_zem); u3_noun qu_zem = u3t(u_zem); + u3_noun pqu_zem = u3h(qu_zem); + u3_noun qqu_zem = u3t(qu_zem); u3_noun mut; u3_noun pro; mut = u3nt(c3__core, u3k(p_sut), - u3nt(c3__gold, + u3nq(c3__gold, u3k(qq_sut), - u3k(rq_sut))); + u3k(rq_sut), + u3k(sq_sut))); - pro = u3nt + pro = u3nq (c3y, + u3k(pqu_zem), u3nc(u3nc(u3_nul, u3k(axe)), u3k(lon)), u3nt(c3n, u3qc_peg(2, pu_zem), - u3nt(u3nc(mut, u3k(qu_zem)), u3_nul, u3_nul))); + u3nt(u3nc(mut, u3k(qqu_zem)), u3_nul, u3_nul))); u3z(zem); return pro; } else { - u3_noun pec = u3qfu_perk(van, sut, way, pq_sut); + u3_noun pec = u3qfu_peel(van, sut, way, pq_sut); u3_noun pro; if ( c3n == u3h(pec) ) { @@ -262,18 +278,24 @@ 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 = u3h(pp_hax); // nock - u3_noun qpp_yor = u3h(pp_yor); // nock + u3_noun ppp_hax = u3h(pp_hax); // wain + u3_noun ppp_yor = u3h(pp_yor); // wain + u3_noun qpp_hax = u3t(pp_hax); + u3_noun qpp_yor = u3t(pp_yor); + u3_noun pqpp_hax = u3h(qpp_hax); // span + u3_noun pqpp_yor = u3h(qpp_yor); // span + u3_noun qqpp_hax = u3t(qpp_hax); // nock + u3_noun qqpp_yor = u3t(qpp_yor); // nock - if ( c3n == u3r_sing(qpp_hax, qpp_yor) ) { + if ( c3n == u3r_sing(qqpp_hax, qqpp_yor) ) { return u3m_error("find-fork-c"); } return u3nq(c3n, c3n, - u3kf_fork(u3nt(u3k(ppp_hax), u3k(ppp_yor), u3_nul)), - u3k(qpp_hax)); + _find_join(ppp_hax, ppp_yor), + u3nc( + u3kf_fork(u3nt(u3k(pqpp_hax), u3k(pqpp_yor), u3_nul)), + u3k(qqpp_hax))); } } } @@ -282,46 +304,52 @@ 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 + u3_noun p_hax = u3t(hax); // {wain vein opal} + u3_noun p_yor = u3t(yor); // {wain vein opal} + u3_noun pp_hax = u3h(p_hax); // wain + u3_noun pp_yor = u3h(p_yor); // wain + u3_noun qp_hax = u3t(p_hax); // {vein opal} + u3_noun qp_yor = u3t(p_yor); // {vein opal} + u3_noun pqp_hax = u3h(qp_hax); // vein + u3_noun pqp_yor = u3h(qp_yor); // vein + u3_noun qqp_hax = u3t(qp_hax); // opal + u3_noun qqp_yor = u3t(qp_yor); // opal - if ( c3n == u3r_sing(pp_hax, pp_yor) ) { + if ( c3n == u3r_sing(pqp_hax, pqp_yor) ) { return u3m_error("find-fork-e"); } else { - if ( c3y == u3h(qp_hax) ) { - if ( c3y != u3h(qp_yor) ) { + if ( c3y == u3h(qqp_hax) ) { + if ( c3y != u3h(qqp_yor) ) { return u3m_error("find-fork-f"); } else { - u3_noun pqp_hax = u3t(qp_hax); // span - u3_noun pqp_yor = u3t(qp_yor); // span + u3_noun pqqp_hax = u3t(qqp_hax); // span + u3_noun pqqp_yor = u3t(qqp_yor); // span return u3nq(c3y, - u3k(pp_hax), - c3y, - u3kf_fork(u3nt(u3k(pqp_hax), u3k(pqp_yor), u3_nul))); + _find_join(pp_hax, pp_yor), + u3k(pqp_hax), + u3nc(c3y, u3kf_fork + (u3nt(u3k(pqqp_hax), u3k(pqqp_yor), u3_nul)))); } } - else if ( c3n != u3h(qp_yor) ) { + else if ( c3n != u3h(qqp_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 {span foot}) - u3_noun qqp_yor = u3t(u3t(qp_yor)); // (set {span foot}) + u3_noun pqqp_hax = u3h(u3t(qqp_hax)); // axis + u3_noun pqqp_yor = u3h(u3t(qqp_yor)); // axis + u3_noun qqqp_hax = u3t(u3t(qqp_hax)); // (set {span foot}) + u3_noun qqqp_yor = u3t(u3t(qqp_yor)); // (set {span foot}) - if ( c3n == u3r_sing(pqp_hax, pqp_yor) ) { + if ( c3n == u3r_sing(pqqp_hax, pqqp_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))); + u3nq(c3y, + u3_nul, + u3k(pqp_hax), + u3nt(c3n, u3k(pqqp_hax), u3qdi_uni(qqqp_hax, qqqp_yor))); } } } @@ -385,7 +413,7 @@ u3_noun gil) { u3_noun p_sut = u3t(sut); - u3_noun yed = u3qdi_tap(p_sut, u3_nul); + u3_noun yed = u3qdi_tap(p_sut); u3_noun wiz; u3_noun ret; @@ -411,6 +439,7 @@ u3_noun gil) { if ( u3_nul == qp_sut ) { + // if ( 1 ) { 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); @@ -419,8 +448,8 @@ else { u3_noun iqp_sut = u3h(qp_sut); // twig u3_noun tiv = u3qfu_mint // (pair span nock) - (van, sut, c3__noun, iqp_sut); - u3_noun tqp_sut = u3t(qp_sut); // (list (pair span nock)) + (van, q_sut, c3__noun, iqp_sut); + u3_noun tqp_sut = u3t(qp_sut); // (list twig) u3_noun p_tiv = u3h(tiv); // span u3_noun q_tiv = u3t(tiv); // nock u3_noun fid = _find_buck // pony @@ -434,7 +463,7 @@ u3_noun ret; ret = _find_buck_face_next - (van, sut, q_sut, tqp_sut, way, p_heg, q_heg, u3t(u3t(fid)), lon, gil); + (van, sut, q_sut, tqp_sut, way, u3t(u3t(fid)), q_heg, axe, lon, gil); u3z(fid); u3z(tiv); return ret; @@ -444,22 +473,25 @@ u3_noun vat; // (pair span nock) u3_noun ret; u3_noun dog = u3nc(0, u3k(axe)); // nock + u3_noun wan; if ( c3y == u3h(fid) ) { - tor = u3k(fid); + wan = u3k(u3h(u3t(fid))); + tor = u3nc(c3y, u3k(u3t(u3t(fid)))); } else { + wan = u3k(u3h(u3t(u3t(fid)))); tor = u3nc(c3n, u3k(u3t(u3t(fid)))); } u3z(fid); - vat = u3qfu_fine(van, q_sut, tor); + vat = u3qfu_fine(van, sut, tor); u3z(tor); ret = u3nq (c3n, c3n, - u3k(u3h(vat)), - u3qf_comb(u3t(vat), u3qf_comb(dog, q_tiv))); + wan, + u3nc(u3k(u3h(vat)), u3qf_comb(u3qf_comb(dog, q_tiv), u3t(vat)))); u3z(vat); u3z(dog); @@ -481,8 +513,10 @@ u3_noun gil) { u3_noun p_sut, q_sut; + u3_noun pp_sut, qp_sut; u3x_cell(u3t(sut), &p_sut, &q_sut); + u3x_cell(p_sut, &pp_sut, &qp_sut); if ( u3_nul == q_heg ) { return _find_buck_here(van, q_sut, way, p_heg, q_heg, axe, lon, gil); @@ -490,8 +524,8 @@ else { u3_noun uq_heg = u3t(q_heg); // term - if ( c3y == u3ud(p_sut) ) { - if ( c3y == u3r_sing(p_sut, uq_heg) ) { + if ( c3y == u3ud(qp_sut) ) { + if ( c3y == u3r_sing(qp_sut, uq_heg) ) { return _find_buck_here(van, q_sut, way, p_heg, q_heg, axe, lon, gil); } else { @@ -499,18 +533,20 @@ } } else { - u3_noun pp_sut = u3h(p_sut); // (map term (unit port)) - u3_noun qp_sut = u3t(p_sut); // (list (pair span nock)) - u3_noun tyr = u3qdb_get(pp_sut, uq_heg); // (unit (unit port)) + u3_noun pqp_sut = u3h(qp_sut); // (map term {wain (unit twig)}) + u3_noun qqp_sut = u3t(qp_sut); // (list (pair span nock)) + u3_noun tyr = u3qdb_get(pqp_sut, uq_heg); // (unit {wain (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); + (van, sut, q_sut, qqp_sut, way, p_heg, q_heg, axe, lon, gil); } else { - u3_noun u_tyr = u3t(tyr); // (unit port) + u3_noun u_tyr = u3t(tyr); // (pair wain (unit twig)) + u3_noun pu_tyr = u3h(u_tyr); + u3_noun qu_tyr = u3t(u_tyr); - if ( u3_nul == u_tyr ) { + if ( u3_nul == qu_tyr ) { u3_noun nol = u3nc(u3_nul, u3k(lon)); u3_noun dep = u3qa_inc(p_heg); u3_noun ret = _find_buck @@ -522,8 +558,8 @@ return ret; } else { - u3_noun uu_tyr = u3t(u_tyr); - u3_noun tor = u3qfu_fund(van, sut, way, uu_tyr); + u3_noun uqu_tyr = u3t(qu_tyr); + u3_noun tor = u3qfu_fund(van, sut, way, uqu_tyr); if ( c3y == u3h(tor) ) { u3_noun p_tor = u3t(tor); // (pair vein opal) @@ -533,7 +569,7 @@ u3nt(u3_nul, u3nc(u3_nul, u3k(axe)), u3k(lon)); u3_noun ret; - ret = u3nt(c3y, u3qb_weld(pp_tor, nol), u3k(qp_tor)); + ret = u3nq(c3y, u3_nul, u3qb_weld(pp_tor, nol), u3k(qp_tor)); u3z(nol); u3z(tor); u3z(tyr); @@ -546,7 +582,10 @@ u3_noun dog = u3nc(0, u3k(axe)); // nock u3_noun ret; - ret = u3nq(c3n, c3n, u3k(pp_tor), u3qf_comb(dog, qp_tor)); + ret = u3nq(c3n, + c3n, + u3k(pu_tyr), + u3nc(u3k(pp_tor), u3qf_comb(dog, qp_tor))); u3z(dog); u3z(tor); u3z(tyr); @@ -600,6 +639,13 @@ // fprintf(stderr, "core\r\n"); return _find_buck_core(van, sut, way, p_heg, q_heg, axe, lon, gil); } + case c3__help: + { + 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"); @@ -636,13 +682,14 @@ u3_noun sut, // span u3_noun way, // ?(%read %rite %free %both) u3_noun i_hyp, // limb - u3_noun p_mor) // palo + u3_noun p_mor) // {wain palo} { - u3_noun pp_mor = u3h(p_mor); // vein - u3_noun qp_mor = u3t(p_mor); // opal + u3_noun qp_mor = u3t(p_mor); // palo + u3_noun pqp_mor = u3h(qp_mor); // vein + u3_noun qqp_mor = u3t(qp_mor); // opal { - u3_noun ref = u3qfu_felt(van, sut, qp_mor); - u3_noun lon = u3k(pp_mor); + u3_noun ref = u3qfu_felt(van, sut, qqp_mor); + u3_noun lon = u3k(pqp_mor); u3_noun heg = (c3y == u3du(i_hyp)) ? u3k(i_hyp) : u3nq(c3n, 0, u3_nul, u3k(i_hyp)); @@ -653,9 +700,9 @@ ret = u3nq (c3y, + u3_nul, u3nc(u3nc(u3_nul, u3k(p_heg)), u3k(lon)), - c3y, - u3qfu_peek(van, ref, way, p_heg)); + u3nc(c3y, u3qfu_peek(van, ref, way, p_heg))); } else { u3_noun p_heg = u3h(u3t(heg)); // @ud @@ -679,7 +726,7 @@ u3_noun hyp) { if ( u3_nul == hyp ) { - return u3nq(c3y, u3_nul, c3y, u3k(sut)); + return u3nq(c3y, u3_nul, u3_nul, u3nc(c3y, u3k(sut))); } else { u3_noun i_hyp = u3h(hyp); @@ -693,15 +740,18 @@ return mor; } else { - u3_noun pp_mor = u3t(p_mor); // {span nock} - u3_noun ppp_mor = u3h(pp_mor); // span - u3_noun qpp_mor = u3h(pp_mor); // nock + u3_noun pp_mor = u3t(p_mor); // {wain span nock} + u3_noun ppp_mor = u3h(pp_mor); + u3_noun qpp_mor = u3t(pp_mor); + u3_noun pqpp_mor = u3h(qpp_mor); // span + u3_noun qqpp_mor = u3t(qpp_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_mint(van, pqpp_mor, c3__noun, gen); u3_noun ret = u3nq(c3n, c3n, - u3k(u3h(fex)), - u3qf_comb(qpp_mor, u3t(fex))); + u3k(ppp_mor), + u3nc(u3k(u3h(fex)), + u3qf_comb(qqpp_mor, u3t(fex)))); u3z(fex); u3z(gen); u3z(mor); @@ -725,10 +775,14 @@ u3_noun way, u3_noun hyp) { - return _find_pony(van, sut, way, hyp); + u3_noun taf; + + taf = _find_pony(van, sut, way, hyp); + + return taf; } - u3_noun + static u3_noun _cqfu_find(u3_noun van, u3_noun sut, u3_noun way, @@ -741,11 +795,14 @@ } else { if ( c3y == u3h(taf) ) { - return taf; + u3_noun fat = u3nc(c3y, u3k(u3t(u3t(taf)))); + + u3z(taf); + return fat; } else { if ( c3n == u3h(u3t(taf)) ) { - u3_noun fat = u3nc(c3n, u3k(u3t(u3t(taf)))); + u3_noun fat = u3nc(c3n, u3k(u3t(u3t(u3t(taf))))); u3z(taf); return fat; @@ -787,7 +844,7 @@ u3_noun way, u3_noun hyp) { - c3_m fun_m = c3__find + !!u3r_at(u3qfu_van_vet, van); + c3_m fun_m = 144 + c3__find + ((!!u3r_at(u3qfu_van_vet, van)) << 8); u3_noun pro = u3z_find_3(fun_m, sut, way, hyp); if ( u3_none != pro ) { @@ -825,7 +882,7 @@ u3_noun way, u3_noun hyp) { - c3_m fun_m = c3__fond + !!u3r_at(u3qfu_van_vet, van); + c3_m fun_m = 144 + 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/f/ut_fire.c b/jets/f/ut_fire.c index 29816a4847..e102e03634 100644 --- a/jets/f/ut_fire.c +++ b/jets/f/ut_fire.c @@ -140,7 +140,8 @@ } } } - u3_noun + + static u3_noun _cqfu_fire(u3_noun van, u3_noun sut, u3_noun hag) diff --git a/jets/f/ut_fish.c b/jets/f/ut_fish.c index 7d3f1cf6ad..755c73b519 100644 --- a/jets/f/ut_fish.c +++ b/jets/f/ut_fish.c @@ -92,6 +92,7 @@ case c3__core: { return u3nc(0, 0); } + case c3__help: case c3__face: { if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { return u3m_bail(c3__fail); @@ -101,7 +102,7 @@ } case c3__fork: p_sut = u3t(sut); { - u3_noun yed = u3qdi_tap(p_sut, u3_nul); + u3_noun yed = u3qdi_tap(p_sut); u3_noun ret = _fish_fork(van, yed, axe, vit); u3z(yed); @@ -133,7 +134,8 @@ } } } - u3_noun + + static u3_noun _cqfu_fish(u3_noun van, u3_noun sut, u3_atom axe) @@ -164,7 +166,7 @@ u3_noun sut, u3_noun axe) { - c3_m fun_m = c3__fish + !!u3r_at(u3qfu_van_vet, van); + c3_m fun_m = 144 + 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/f/ut_fuse.c b/jets/f/ut_fuse.c index 7ea0733862..da3f0204a1 100644 --- a/jets/f/ut_fuse.c +++ b/jets/f/ut_fuse.c @@ -124,6 +124,14 @@ { return _fuse_repo(van, sut, ref, bix); } + case c3__help: u3x_cell(u3t(sut), &p_sut, &q_sut); + { + u3_noun vot = _fuse_in(van, q_sut, ref, bix); + u3_noun ret = u3qf_help(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); @@ -134,7 +142,7 @@ } case c3__fork: p_sut = u3t(sut); { - u3_noun yed = u3qdi_tap(p_sut, u3_nul); + u3_noun yed = u3qdi_tap(p_sut); u3_noun ret = u3kf_fork(_fuse_in_fork(van, yed, ref, bix)); u3z(yed); @@ -164,7 +172,7 @@ } } - u3_noun + static u3_noun _cqfu_fuse(u3_noun van, u3_noun sut, u3_noun ref) @@ -193,7 +201,7 @@ u3_noun sut, u3_noun ref) { - c3_m fun_m = c3__fuse + !!u3r_at(u3qfu_van_vet, van); + c3_m fun_m = 144 + 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/f/ut_mint.c b/jets/f/ut_mint.c index 38982760c0..2db880caf9 100644 --- a/jets/f/ut_mint.c +++ b/jets/f/ut_mint.c @@ -148,17 +148,17 @@ return u3m_bail(c3__fail); } else { - u3_noun qn_dab = u3t(n_dab); + u3_noun qqn_dab = u3t(u3t(n_dab)); u3_noun vad; - switch ( u3h(qn_dab) ) { + switch ( u3h(qqn_dab) ) { default: return u3m_bail(c3__exit); case c3__ash: { - vad = _mint_brew(van, sut, c3y, u3t(qn_dab)); + vad = _mint_brew(van, sut, c3y, u3t(qqn_dab)); break; } case c3__elm: { - vad = _mint_brew(van, sut, c3n, u3t(qn_dab)); + vad = _mint_brew(van, sut, c3n, u3t(qqn_dab)); break; } } @@ -181,29 +181,71 @@ } } + static u3_noun + _mint_hope(u3_noun van, + u3_noun sut, + u3_noun dom) + { + if ( (u3_nul == dom) ) { + return 0; + } + 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 dov; + + dov = _mint_harp(van, sut, qqn_dom); + + if ( (u3_nul == l_dom) && (u3_nul == r_dom) ) { + return dov; + } + else if ( (u3_nul == l_dom) ) { + return u3nc(dov, _mint_hope(van, sut, r_dom)); + } + else if ( (u3_nul == r_dom) ) { + return u3nc(dov, _mint_hope(van, sut, l_dom)); + } + else { + return u3nt(dov, + _mint_hope(van, sut, l_dom), + _mint_hope(van, sut, r_dom)); + } + } + } + } + static u3_noun _mint_grow(u3_noun van, u3_noun sut, u3_noun gol, u3_atom mel, u3_noun ruf, - u3_noun dab) + u3_noun wan, + 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 toc = _mint_core(u3k(p_dan), - u3nt(c3__gold, + u3nq(c3__gold, u3k(p_dan), + u3k(wan), u3nc(u3_nul, - u3k(dab)))); - u3_noun dez = _mint_harp(van, toc, dab); + u3k(dom)))); + u3_noun dez = _mint_hope(van, toc, dom); u3_noun zod = u3nc(1, dez); u3_noun cot = _mint_core(u3k(p_dan), - u3nt(mel, + u3nq(mel, u3k(p_dan), + u3k(wan), u3nc(u3k(dez), - u3k(dab)))); + u3k(dom)))); u3_noun ret = u3nc(_mint_nice(van, gol, cot), u3qf_cons(zod, q_dan)); @@ -392,7 +434,7 @@ return ret; } - case c3__fits: u3x_cell(u3t(gen), &p_gen, &q_gen); + case c3__wtts: u3x_cell(u3t(gen), &p_gen, &q_gen); _mint_used(); { u3_noun heb = u3nc(c3__herb, u3k(p_gen)); @@ -415,7 +457,7 @@ return ret; } - case c3__if: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); + case c3__wtcl: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); _mint_used(); { u3_noun bol = _mint_bean(); @@ -448,7 +490,7 @@ return ret; } - case c3__cons: u3x_cell(u3t(gen), &p_gen, &q_gen); + case c3__clhp: u3x_cell(u3t(gen), &p_gen, &q_gen); _mint_used(); { u3_noun hed = _mint_in(van, sut, c3__noun, p_gen); @@ -465,7 +507,7 @@ return ret; } - case c3__same: u3x_cell(u3t(gen), &p_gen, &q_gen); + case c3__dtts: u3x_cell(u3t(gen), &p_gen, &q_gen); _mint_used(); { u3_noun typ = _mint_nice(van, gol, _mint_bean()); @@ -486,7 +528,7 @@ return ret; } - case c3__deep: p_gen = u3t(gen); + case c3__dtwt: p_gen = u3t(gen); _mint_used(); { u3_noun typ = _mint_nice(van, gol, _mint_bean()); @@ -495,7 +537,7 @@ u3nc(3, _mint_corn(van, sut, p_gen))); } - case c3__wish: u3x_cell(u3t(gen), &p_gen, &q_gen); + case c3__dtkt: u3x_cell(u3t(gen), &p_gen, &q_gen); _mint_used(); { u3_noun nog = u3nc(c3__bunt, u3k(p_gen)); @@ -511,7 +553,7 @@ return ret; } - case c3__bump: p_gen = u3t(gen); + case c3__dtls: p_gen = u3t(gen); _mint_used(); { u3_noun tom = u3nt(c3__atom, u3_blip, u3_nul); @@ -534,7 +576,7 @@ return ret; } - case c3__nock: u3x_cell(u3t(gen), &p_gen, &q_gen); + case c3__dttr: u3x_cell(u3t(gen), &p_gen, &q_gen); _mint_used(); { u3_noun one = _mint_corn(van, sut, p_gen); @@ -560,7 +602,7 @@ return u3k(u3t(gen)); } - case c3__iron: p_gen = u3t(gen); + case c3__ktbr: p_gen = u3t(gen); _mint_used(); { u3_noun ryd = _mint_in(van, sut, gol, p_gen); @@ -571,7 +613,7 @@ return pro; } - case c3__zinc: p_gen = u3t(gen); + case c3__ktpm: p_gen = u3t(gen); _mint_used(); { u3_noun ryd = _mint_in(van, sut, gol, p_gen); @@ -582,7 +624,7 @@ return pro; } - case c3__lead: p_gen = u3t(gen); + case c3__ktwt: p_gen = u3t(gen); _mint_used(); { u3_noun ryd = _mint_in(van, sut, gol, p_gen); @@ -593,7 +635,18 @@ return pro; } - case c3__name: u3x_cell(u3t(gen), &p_gen, &q_gen); + case c3__help: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mint_used(); + { + u3_noun hum = _mint_in(van, sut, gol, q_gen); + + u3_noun ret = u3nc(u3qf_help(p_gen, u3k(u3h(hum))), + u3k(u3t(hum))); + u3z(hum); + return ret; + } + + case c3__ktts: u3x_cell(u3t(gen), &p_gen, &q_gen); _mint_used(); { u3_noun vat = _mint_in(van, sut, gol, q_gen); @@ -605,7 +658,13 @@ return ret; } - case c3__burn: p_gen = u3t(gen); + case c3__tune: p_gen = u3t(gen); + _mint_used(); + { + return u3nc(u3qf_face(p_gen, sut), u3nc(0, 1)); + } + + case c3__ktsg: p_gen = u3t(gen); _mint_used(); { u3_noun nef = _mint_in(van, sut, gol, p_gen); @@ -630,7 +689,7 @@ return ret; } - case c3__like: u3x_cell(u3t(gen), &p_gen, &q_gen); + case c3__ktls: u3x_cell(u3t(gen), &p_gen, &q_gen); _mint_used(); { u3_noun huz = u3qfu_play(van, sut, p_gen); @@ -642,7 +701,7 @@ return ret; } - case c3__per: u3x_cell(u3t(gen), &p_gen, &q_gen); + case c3__tsgr: u3x_cell(u3t(gen), &p_gen, &q_gen); _mint_used(); { u3_noun fid = _mint_in(van, sut, c3__noun, p_gen); @@ -660,7 +719,7 @@ return ret; } - case c3__aka: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); + case c3__tstr: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); _mint_used(); { u3_noun boc = u3qfu_buss(van, sut, p_gen, q_gen); @@ -670,24 +729,34 @@ return ret; } - case c3__make: u3x_cell(u3t(gen), &p_gen, &q_gen); + 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__core: p_gen = u3t(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, ruf, p_gen); + ret = _mint_grow(van, sut, gol, c3__gold, ruf, p_gen, q_gen); u3z(ruf); return ret; } - case c3__peep: u3x_cell(u3t(gen), &p_gen, &q_gen); + case c3__sgzp: u3x_cell(u3t(gen), &p_gen, &q_gen); _mint_used(); { u3_noun typ = u3qfu_play(van, sut, p_gen); @@ -703,7 +772,7 @@ return ret; } - case c3__hint: u3x_cell(u3t(gen), &p_gen, &q_gen); + case c3__sggr: u3x_cell(u3t(gen), &p_gen, &q_gen); _mint_used(); { u3_noun hum = _mint_in(van, sut, gol, q_gen); @@ -722,7 +791,7 @@ return ret; } - case c3__code: p_gen = u3t(gen); + case c3__zpts: p_gen = u3t(gen); _mint_used(); { u3_noun von = u3i_molt(u3k(van), u3qfu_van_vet, c3n, 0); @@ -732,7 +801,7 @@ return u3nc(c3__noun, u3nc(1, sev)); } - case c3__cool: p_gen = u3t(gen); + case c3__ktcn: p_gen = u3t(gen); _mint_used(); { u3_noun von = u3i_molt(u3k(van), u3qfu_van_fab, c3n, 0); @@ -742,7 +811,7 @@ return ret; } - case c3__twig: u3x_cell(u3t(gen), &p_gen, &q_gen); + case c3__zpcm: u3x_cell(u3t(gen), &p_gen, &q_gen); _mint_used(); { return u3nc(_mint_nice(van, @@ -765,7 +834,7 @@ return ret; } - case c3__spit: u3x_cell(u3t(gen), &p_gen, &q_gen); + case c3__zpsm: u3x_cell(u3t(gen), &p_gen, &q_gen); _mint_used(); { u3_noun vos = _mint_in(van, sut, c3__noun, q_gen); @@ -804,6 +873,7 @@ } case c3__fail: + case c3__zpzp: _mint_used(); { return u3nt(c3__void, 0, 0); @@ -811,7 +881,7 @@ } } - u3_noun + static u3_noun _cqfu_mint(u3_noun van, u3_noun sut, u3_noun gol, @@ -845,7 +915,7 @@ u3_noun gol, u3_noun gen) { - c3_m fun_m = c3__mint; + c3_m fun_m = 144 + c3__mint; u3_noun vrf = u3r_at(u3qfu_van_vrf, van); u3_noun pro = u3z_find_4(fun_m, vrf, sut, gol, gen); diff --git a/jets/f/ut_mull.c b/jets/f/ut_mull.c index a8029ea8bf..b9f30b2357 100644 --- a/jets/f/ut_mull.c +++ b/jets/f/ut_mull.c @@ -98,13 +98,13 @@ u3m_bail(c3__fail); } else { - u3_noun qn_dab = u3t(n_dab); + u3_noun qqn_dab = u3t(u3t(n_dab)); u3_noun vad; - switch ( u3h(qn_dab) ) { + switch ( u3h(qqn_dab) ) { default: u3m_bail(c3__exit); case c3__ash: { - vad = _mull_in(van, sut, c3__noun, dox, u3t(qn_dab)); + vad = _mull_in(van, sut, c3__noun, dox, u3t(qqn_dab)); break; } case c3__elm: { @@ -131,6 +131,41 @@ } } + static void + _mull_balk(u3_noun van, + u3_noun sut, + u3_noun dox, + u3_noun dom) + { + if ( u3_nul != dom ) { + u3_noun n_dom, l_dom, r_dom; + + u3r_trel(dom, &n_dom, &l_dom, &r_dom); + if ( c3n == u3du(n_dom) ) { + u3m_bail(c3__fail); + } + else { + u3_noun qqn_dom = u3t(u3t(n_dom)); + + _mull_bake(van, sut, dox, qqn_dom); + + if ( (u3_nul == l_dom) && (u3_nul == r_dom) ) { + return; + } + else if ( (u3_nul == l_dom) ) { + _mull_balk(van, sut, dox, r_dom); + } + else if ( (u3_nul == r_dom) ) { + _mull_balk(van, sut, dox, l_dom); + } + else { + _mull_balk(van, sut, dox, l_dom); + _mull_balk(van, sut, dox, r_dom); + } + } + } + } + static u3_noun _mull_grow(u3_noun van, u3_noun sut, @@ -138,32 +173,37 @@ u3_noun dox, u3_atom mel, u3_noun ruf, - u3_noun dab) + u3_noun wan, + 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 p_toc = _mull_core(u3k(p_dan), - u3nt(c3__gold, + u3nq(c3__gold, u3k(p_dan), - u3nc(u3_nul, u3k(dab)))); + u3k(wan), + u3nc(u3_nul, u3k(dom)))); u3_noun q_toc = _mull_core(u3k(q_dan), - u3nt(c3__gold, + u3nq(c3__gold, u3k(q_dan), - u3nc(u3_nul, u3k(dab)))); + u3k(wan), + u3nc(u3_nul, u3k(dom)))); u3_noun p_ret = _mull_core(u3k(p_dan), - u3nt(u3k(mel), + u3nq(u3k(mel), u3k(p_dan), + u3k(wan), u3nc(u3nc(u3_nul, u3_nul), - u3k(dab)))); + u3k(dom)))); u3_noun q_ret = _mull_core(u3k(q_dan), - u3nt(u3k(mel), + u3nq(u3k(mel), u3k(q_dan), + u3k(wan), u3nc(u3nc(u3_nul, u3_nul), - u3k(dab)))); + u3k(dom)))); u3_noun ret = u3nc(_mull_nice(van, gol, p_ret), q_ret); - _mull_bake(van, p_toc, q_toc, dab); + _mull_balk(van, p_toc, q_toc, dom); u3z(q_toc); u3z(p_toc); @@ -345,7 +385,7 @@ return ret; } - case c3__fits: u3x_cell(u3t(gen), &p_gen, &q_gen); + case c3__wtts: u3x_cell(u3t(gen), &p_gen, &q_gen); _mull_used(); { u3_noun heb = u3nc(c3__herb, u3k(p_gen)); @@ -373,7 +413,7 @@ return _mull_both(van, gol, _mull_bean()); } - case c3__if: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); + case c3__wtcl: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); _mull_used(); { u3_noun bol = _mull_bean(); @@ -423,7 +463,7 @@ return ret; } - case c3__cons: u3x_cell(u3t(gen), &p_gen, &q_gen); + 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); @@ -438,7 +478,7 @@ return ret; } - case c3__same: u3x_cell(u3t(gen), &p_gen, &q_gen); + 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); @@ -450,7 +490,7 @@ return _mull_both(van, gol, _mull_bean()); } - case c3__deep: p_gen = u3t(gen); + case c3__dtwt: p_gen = u3t(gen); _mull_used(); { u3_noun vay = _mull_in(van, sut, c3__noun, dox, p_gen); @@ -459,7 +499,7 @@ return _mull_both(van, gol, _mull_bean()); } - case c3__wish: u3x_cell(u3t(gen), &p_gen, &q_gen); + case c3__dtkt: u3x_cell(u3t(gen), &p_gen, &q_gen); _mull_used(); { u3_noun nog = u3nc(c3__bunt, u3k(p_gen)); @@ -472,7 +512,7 @@ return ret; } - case c3__bump: p_gen = u3t(gen); + case c3__dtls: p_gen = u3t(gen); _mull_used(); { u3_noun wuq = u3nt(c3__atom, u3_blip, u3_nul); @@ -490,7 +530,7 @@ return _mull_both(van, gol, typ); } - case c3__nock: u3x_cell(u3t(gen), &p_gen, &q_gen); + 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); @@ -515,7 +555,7 @@ return u3nc(u3k(p_gen), u3k(p_gen)); } - case c3__iron: p_gen = u3t(gen); + case c3__ktbr: p_gen = u3t(gen); _mull_used(); { u3_noun vat = _mull_in(van, sut, gol, dox, p_gen); @@ -530,7 +570,7 @@ return pro; } - case c3__zinc: p_gen = u3t(gen); + case c3__ktpm: p_gen = u3t(gen); _mull_used(); { u3_noun vat = _mull_in(van, sut, gol, dox, p_gen); @@ -545,7 +585,7 @@ return pro; } - case c3__lead: p_gen = u3t(gen); + case c3__ktwt: p_gen = u3t(gen); _mull_used(); { u3_noun vat = _mull_in(van, sut, gol, dox, p_gen); @@ -560,7 +600,18 @@ return pro; } - case c3__name: u3x_cell(u3t(gen), &p_gen, &q_gen); + case c3__help: u3x_cell(u3t(gen), &p_gen, &q_gen); + _mull_used(); + { + u3_noun vat = _mull_in(van, sut, gol, dox, q_gen); + u3_noun ret = u3nc(u3qf_help(p_gen, u3h(vat)), + u3qf_help(p_gen, u3t(vat))); + + u3z(vat); + return ret; + } + + case c3__ktts: u3x_cell(u3t(gen), &p_gen, &q_gen); _mull_used(); { u3_noun vat = _mull_in(van, sut, gol, dox, q_gen); @@ -571,13 +622,20 @@ return ret; } - case c3__burn: p_gen = u3t(gen); + 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__like: u3x_cell(u3t(gen), &p_gen, &q_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)); @@ -589,7 +647,7 @@ return ret; } - case c3__per: u3x_cell(u3t(gen), &p_gen, &q_gen); + case c3__tsgr: u3x_cell(u3t(gen), &p_gen, &q_gen); _mull_used(); { u3_noun lem = _mull_in(van, sut, c3__noun, dox, p_gen); @@ -601,7 +659,7 @@ return ret; } - case c3__aka: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); + case c3__tstr: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); _mull_used(); { u3_noun boc = u3qfu_buss(van, sut, p_gen, q_gen); @@ -614,24 +672,37 @@ return ret; } - case c3__make: u3x_cell(u3t(gen), &p_gen, &q_gen); + 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__core: p_gen = u3t(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, ruf, p_gen); + ret = _mull_grow(van, sut, gol, dox, c3__gold, ruf, p_gen, q_gen); u3z(ruf); return ret; } - case c3__peep: u3x_cell(u3t(gen), &p_gen, &q_gen); + case c3__sgzp: u3x_cell(u3t(gen), &p_gen, &q_gen); _mull_used(); { u3_noun typ = u3qfu_play(van, sut, p_gen); @@ -648,13 +719,13 @@ return ret; } - case c3__hint: u3x_cell(u3t(gen), &p_gen, &q_gen); + case c3__sggr: u3x_cell(u3t(gen), &p_gen, &q_gen); _mull_used(); { return _mull_in(van, sut, gol, dox, q_gen); } - case c3__twig: u3x_cell(u3t(gen), &p_gen, &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); @@ -676,13 +747,13 @@ return ret; } - case c3__code: p_gen = u3t(gen); + case c3__zpts: p_gen = u3t(gen); _mull_used(); { return _mull_both(van, gol, c3__noun); } - case c3__cool: p_gen = u3t(gen); + case c3__ktcn: p_gen = u3t(gen); _mull_used(); { u3_noun von = u3i_molt(u3k(van), u3qfu_van_fab, c3n, 0); @@ -692,7 +763,7 @@ return ret; } - case c3__spit: u3x_cell(u3t(gen), &p_gen, &q_gen); + case c3__zpsm: u3x_cell(u3t(gen), &p_gen, &q_gen); _mull_used(); { u3_noun p_zur = u3qfu_play(van, sut, p_gen); @@ -711,6 +782,7 @@ case c3__lost: case c3__fail: + case c3__zpzp: _mull_used(); { return u3nc(c3__void, c3__void); @@ -718,7 +790,7 @@ } } - u3_noun + static u3_noun _cqfu_mull(u3_noun van, u3_noun sut, u3_noun gol, @@ -755,7 +827,7 @@ u3_noun dox, u3_noun gen) { - c3_m fun_m = c3__mull + !!u3r_at(u3qfu_van_vet, van); + c3_m fun_m = 144 + 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/f/ut_nest.c b/jets/f/ut_nest.c index 897adacae6..cab474fd08 100644 --- a/jets/f/ut_nest.c +++ b/jets/f/ut_nest.c @@ -13,7 +13,7 @@ _nest_dext(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun, u3_noun, u3_noun); static u3_noun - _nest_clip(u3_noun van, + _nest_deep(u3_noun van, u3_noun sut, u3_noun tel, u3_noun ref, @@ -28,36 +28,36 @@ } 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; + u3_noun pn_hem, pqn_hem, qqn_hem, pn_dab, pqn_dab, qqn_dab; u3x_trel(dab, &n_dab, &l_dab, &r_dab); u3x_trel(hem, &n_hem, &l_hem, &r_hem); - if ( (c3n == _nest_clip(van, sut, tel, ref, l_dab, l_hem, gil)) || - (c3n == _nest_clip(van, sut, tel, ref, r_dab, r_hem, gil)) ) + 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); + u3x_trel(n_dab, &pn_dab, &pqn_dab, &qqn_dab); + u3x_trel(n_hem, &pn_hem, &pqn_hem, &qqn_hem); if ( c3n == u3r_sing(pn_dab, pn_hem) ) { return c3n; } else { - if ( (c3n == u3du(qn_dab)) || (c3n == u3du(qn_hem)) ) { + if ( (c3n == u3du(qqn_dab)) || (c3n == u3du(qqn_hem)) ) { return u3m_bail(c3__fail); } - else switch ( u3h(qn_dab) ) { + else switch ( u3h(qqn_dab) ) { default: return u3m_bail(c3__exit); case c3__ash: { - if ( c3__ash != u3h(qn_hem) ) { + if ( c3__ash != u3h(qqn_hem) ) { return c3n; } else { - u3_noun pqn_dab = u3t(qn_dab); - u3_noun pqn_hem = u3t(qn_hem); - u3_noun vis = u3qfu_play(van, sut, pqn_dab); - u3_noun lon = u3qfu_play(van, ref, pqn_hem); - + u3_noun qqqn_dab = u3t(qqn_dab); + u3_noun qqqn_hem = u3t(qqn_hem); + u3_noun vis = u3qfu_play(van, sut, qqqn_dab); + u3_noun lon = u3qfu_play(van, ref, qqqn_hem); + u3_noun ret = _nest_dext(van, vis, tel, lon, u3_nul, u3_nul, gil); u3z(vis); @@ -66,13 +66,50 @@ } } case c3__elm: { - return u3r_sing(qn_dab, qn_hem); + return u3r_sing(qqn_dab, qqn_hem); } } } } } + 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, pqn_vim, qqn_vim, pn_dom, 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_trel(n_dom, &pn_dom, &pqn_dom, &qqn_dom); + u3x_trel(n_vim, &pn_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, @@ -81,19 +118,19 @@ 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 pq_sut, qq_sut, rq_sut, sq_sut; + u3_noun pq_ref, qq_ref, rq_ref, sq_ref; + u3_noun psq_sut, qsq_sut, psq_ref, qsq_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_qual(q_sut, &pq_sut, &qq_sut, &rq_sut, &sq_sut); + u3x_qual(q_ref, &pq_ref, &qq_ref, &rq_ref, &sq_ref); - u3x_cell(rq_sut, &prq_sut, &qrq_sut); - u3x_cell(rq_ref, &prq_ref, &qrq_ref); + u3x_cell(sq_sut, &psq_sut, &qsq_sut); + u3x_cell(sq_ref, &psq_ref, &qsq_ref); if ( c3y == u3r_sing(q_sut, q_ref) ) { return _nest_dext(van, p_sut, tel, p_ref, u3_nul, u3_nul, gil); @@ -134,7 +171,7 @@ u3nc(c3__gold, u3k(u3t(q_ref)))); - ret = _nest_clip(van, tus, tel, fer, qrq_sut, qrq_ref, zoc); + ret = _nest_dope(van, tus, tel, fer, qsq_sut, qsq_ref, zoc); u3z(fer); u3z(tus); u3z(zoc); @@ -246,6 +283,7 @@ else return _nest_sint(van, sut, tel, ref, seg, reg, gil); } } + case c3__help: case c3__face: { if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { return u3m_bail(c3__fail); @@ -271,7 +309,7 @@ } { - u3_noun dey = u3qdi_tap(p_sut, u3_nul); + u3_noun dey = u3qdi_tap(p_sut); u3_noun yed = dey; while ( u3_nul != yed ) { @@ -357,7 +395,7 @@ } { - c3_m fun_m = c3__nest + !!u3r_at(u3qfu_van_vet, van); + c3_m fun_m = 144 + c3__nest + ((!!u3r_at(u3qfu_van_vet, van)) << 8); u3_noun pro = u3z_find_2(fun_m, sut, ref); if ( u3_none != pro ) { @@ -409,6 +447,7 @@ u3z(gam); return hiv; } + case c3__help: case c3__face: { if ( c3n == u3r_trel(ref, 0, &p_ref, &q_ref) ) { return u3m_bail(c3__fail); @@ -418,7 +457,7 @@ } case c3__fork: p_ref = u3t(ref); { - u3_noun dey = u3qdi_tap(p_ref, u3_nul); + u3_noun dey = u3qdi_tap(p_ref); u3_noun yed = dey; while ( u3_nul != yed ) { @@ -465,7 +504,7 @@ } } - u3_noun + static u3_noun _cqfu_nest(u3_noun van, u3_noun sut, u3_noun tel, diff --git a/jets/f/ut_peek.c b/jets/f/ut_peek.c index f52a5d9d4c..cf02f18da8 100644 --- a/jets/f/ut_peek.c +++ b/jets/f/ut_peek.c @@ -6,7 +6,7 @@ /* logic */ - u3_noun + static u3_noun _cqfu_peek(u3_noun, u3_noun, u3_noun, u3_atom); static u3_noun @@ -83,7 +83,7 @@ u3_atom lat = u3qc_mas(axe); if ( 3 == now ) { - u3_noun pec = u3qfu_perk(van, sut, way, pq_sut); + u3_noun pec = u3qfu_peel(van, sut, way, pq_sut); u3_noun sam = u3h(pec); u3_noun con = u3t(pec); @@ -128,6 +128,7 @@ return pro; } } + case c3__help: case c3__face: { if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) { return u3m_bail(c3__fail); @@ -137,7 +138,7 @@ } case c3__fork: p_sut = u3t(sut); { - u3_noun yed = u3qdi_tap(p_sut, u3_nul); + u3_noun yed = u3qdi_tap(p_sut); u3_noun ret = u3kf_fork(_peek_fork(van, yed, way, axe, gil)); u3z(yed); @@ -161,7 +162,7 @@ } } - u3_noun + static u3_noun _cqfu_peek(u3_noun van, u3_noun sut, u3_noun way, @@ -199,7 +200,7 @@ u3_noun way, u3_noun axe) { - c3_m fun_m = c3__peek + !!u3r_at(u3qfu_van_vet, van); + c3_m fun_m = 144 + 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/f/ut_perk.c b/jets/f/ut_perk.c deleted file mode 100644 index cf326e7b82..0000000000 --- a/jets/f/ut_perk.c +++ /dev/null @@ -1,55 +0,0 @@ -/* j/6/ut_perk.c -** -*/ -#include "all.h" - - -/* logic -*/ - u3_noun - _cqfu_perk(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_perk(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_perk(van, sut, way, met); - } - } - - u3_noun - u3qfu_perk(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun met) - { - return _cqfu_perk(van, sut, way, met); - } - diff --git a/jets/f/ut_play.c b/jets/f/ut_play.c index 6a4a3026d5..c3c9672f43 100644 --- a/jets/f/ut_play.c +++ b/jets/f/ut_play.c @@ -148,15 +148,17 @@ u3_noun sut, u3_atom mel, u3_noun ruf, - u3_noun dab) + u3_noun wan, + u3_noun dom) { u3_noun dan = _play_in(van, sut, ruf); return _play_core(dan, - u3nt(u3k(mel), + u3nq(u3k(mel), u3k(dan), + u3k(wan), u3nc(u3nc(u3_nul, u3_nul), - u3k(dab)))); + u3k(dom)))); } static u3_noun @@ -202,7 +204,7 @@ u3_noun zix = u3qfu_shep(van, "gene", 'q', u3k(gen)); u3t_push(u3nc(c3__mean, zix)); - return u3m_error("play-open"); + return u3m_error("play-open-z"); } ret = _play_x(van, sut, rex); u3z(rex); @@ -225,13 +227,13 @@ else switch ( u3h(gen) ) { default: goto open; - case c3__fits: u3x_cell(u3t(gen), &p_gen, &q_gen); + case c3__wtts: u3x_cell(u3t(gen), &p_gen, &q_gen); _play_used(); { return _play_bean(); } - case c3__if: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); + case c3__wtcl: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); _play_used(); { u3_noun fex = u3qfu_gain(van, sut, p_gen); @@ -247,7 +249,7 @@ return ret; } - case c3__cons: u3x_cell(u3t(gen), &p_gen, &q_gen); + case c3__clhp: u3x_cell(u3t(gen), &p_gen, &q_gen); _play_used(); { u3_noun dis = _play_x(van, sut, p_gen); @@ -259,7 +261,7 @@ return ret; } - case c3__wish: u3x_cell(u3t(gen), &p_gen, &q_gen); + case c3__dtkt: u3x_cell(u3t(gen), &p_gen, &q_gen); _play_used(); { u3_noun nog = u3nc(c3__bunt, u3k(p_gen)); @@ -269,19 +271,19 @@ return ret; } - case c3__deep: p_gen = u3t(gen); + case c3__dtwt: p_gen = u3t(gen); _play_used(); { return _play_bean(); } - case c3__same: u3x_cell(u3t(gen), &p_gen, &q_gen); + case c3__dtts: u3x_cell(u3t(gen), &p_gen, &q_gen); _play_used(); { return _play_bean(); } - case c3__bump: p_gen = u3t(gen); + case c3__dtls: p_gen = u3t(gen); _play_used(); { return u3nt(c3__atom, u3_blip, u3_nul); @@ -293,7 +295,7 @@ return _play_rock(p_gen, q_gen); } - case c3__nock: u3x_cell(u3t(gen), &p_gen, &q_gen); + case c3__dttr: u3x_cell(u3t(gen), &p_gen, &q_gen); _play_used(); { return c3__noun; @@ -311,7 +313,7 @@ return u3k(p_gen); } - case c3__iron: p_gen = u3t(gen); + case c3__ktbr: p_gen = u3t(gen); _play_used(); { u3_noun boc = _play_x(van, sut, p_gen); @@ -321,7 +323,7 @@ return pro; } - case c3__zinc: p_gen = u3t(gen); + case c3__ktpm: p_gen = u3t(gen); _play_used(); { u3_noun boc = _play_x(van, sut, p_gen); @@ -331,7 +333,7 @@ return pro; } - case c3__lead: p_gen = u3t(gen); + case c3__ktwt: p_gen = u3t(gen); _play_used(); { u3_noun boc = _play_x(van, sut, p_gen); @@ -341,7 +343,17 @@ return pro; } - case c3__name: u3x_cell(u3t(gen), &p_gen, &q_gen); + case c3__help: u3x_cell(u3t(gen), &p_gen, &q_gen); + _play_used(); + { + u3_noun boc = _play_x(van, sut, q_gen); + u3_noun ret = u3qf_help(p_gen, boc); + + u3z(boc); + return ret; + } + + case c3__ktts: u3x_cell(u3t(gen), &p_gen, &q_gen); _play_used(); { u3_noun boc = _play_x(van, sut, q_gen); @@ -351,19 +363,25 @@ return ret; } - case c3__burn: p_gen = u3t(gen); + 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__like: u3x_cell(u3t(gen), &p_gen, &q_gen); + case c3__ktls: u3x_cell(u3t(gen), &p_gen, &q_gen); _play_used(); { return _play_x(van, sut, p_gen); } - case c3__per: u3x_cell(u3t(gen), &p_gen, &q_gen); + case c3__tsgr: u3x_cell(u3t(gen), &p_gen, &q_gen); _play_used(); { u3_noun boc = _play_x(van, sut, p_gen); @@ -373,7 +391,7 @@ return ret; } - case c3__aka: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); + case c3__tstr: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); _play_used(); { u3_noun boc = u3qfu_buss(van, sut, p_gen, q_gen); @@ -383,23 +401,33 @@ return ret; } - case c3__make: u3x_cell(u3t(gen), &p_gen, &q_gen); + 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__core: p_gen = u3t(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, ruf, p_gen); + u3_noun ret = _play_grow(van, sut, c3__gold, ruf, p_gen, q_gen); u3z(ruf); return ret; } - case c3__peep: u3x_cell(u3t(gen), &p_gen, &q_gen); + case c3__sgzp: u3x_cell(u3t(gen), &p_gen, &q_gen); _play_used(); { u3_noun typ = u3qfu_play(van, sut, p_gen); @@ -416,19 +444,19 @@ return ret; } - case c3__hint: u3x_cell(u3t(gen), &p_gen, &q_gen); + case c3__sggr: u3x_cell(u3t(gen), &p_gen, &q_gen); _play_used(); { return _play_x(van, sut, q_gen); } - case c3__code: p_gen = u3t(gen); + case c3__zpts: p_gen = u3t(gen); _play_used(); { return c3__noun; } - case c3__cool: p_gen = u3t(gen); + 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); @@ -437,7 +465,7 @@ return ret; } - case c3__twig: u3x_cell(u3t(gen), &p_gen, &q_gen); + case c3__zpcm: u3x_cell(u3t(gen), &p_gen, &q_gen); _play_used(); { return _play_x(van, sut, p_gen); @@ -455,7 +483,7 @@ return ret; } - case c3__spit: u3x_cell(u3t(gen), &p_gen, &q_gen); + case c3__zpsm: u3x_cell(u3t(gen), &p_gen, &q_gen); _play_used(); { u3_noun zur = _play_x(van, sut, p_gen); @@ -470,6 +498,7 @@ case c3__lost: case c3__fail: + case c3__zpzp: _play_used(); { return c3__void; @@ -477,7 +506,7 @@ } } - u3_noun + static u3_noun _cqfu_play(u3_noun van, u3_noun sut, u3_noun gen) diff --git a/jets/f/ut_repo.c b/jets/f/ut_repo.c index 8f296c897f..c2807dfc21 100644 --- a/jets/f/ut_repo.c +++ b/jets/f/ut_repo.c @@ -34,6 +34,7 @@ return u3nt(c3__cell, c3__noun, u3k(p_sut)); } } + case c3__help: case c3__face: { if ( c3n == u3r_cell(u3t(sut), &p_sut, &q_sut)) { return u3m_bail(c3__fail); diff --git a/jets/f/ut_rest.c b/jets/f/ut_rest.c index 5cffc9f797..a2ef1250f6 100644 --- a/jets/f/ut_rest.c +++ b/jets/f/ut_rest.c @@ -26,7 +26,7 @@ u3_noun gar) { u3_noun gun = u3qdi_gas(u3_nul, gar); - u3_noun yed = u3qdi_tap(gun, u3_nul); + u3_noun yed = u3qdi_tap(gun); u3z(gun); return yed; @@ -58,20 +58,17 @@ } } - u3_noun + static u3_noun _cqfu_rest(u3_noun van, u3_noun sut, u3_noun leg) { u3_noun fan = u3r_at(u3qfu_van_fan, van); -#if 1 if ( c3y == _rest_hit_fan(fan, leg) ) { return u3m_error("rest-loop"); } - else -#endif - { + 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); @@ -103,7 +100,7 @@ u3_noun sut, u3_noun leg) { - c3_m fun_m = c3__rest + !!u3r_at(u3qfu_van_vet, van); + c3_m fun_m = 144 + 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/f/ut_toss.c b/jets/f/ut_toss.c index 3ebd95c0ee..15973cf581 100644 --- a/jets/f/ut_toss.c +++ b/jets/f/ut_toss.c @@ -45,7 +45,7 @@ /* functions */ - static u3_noun + u3_noun _cqfu_toss(u3_noun van, u3_noun sut, u3_noun peh, diff --git a/jets/f/ut_wrap.c b/jets/f/ut_wrap.c index 71e01910e7..29c78883e6 100644 --- a/jets/f/ut_wrap.c +++ b/jets/f/ut_wrap.c @@ -32,9 +32,9 @@ case c3__core: u3x_cell(u3t(sut), &p_sut, &q_sut); { - u3_noun pq_sut, qq_sut, rq_sut; + u3_noun pq_sut, qq_sut, rq_sut, sq_sut; - if ( c3n == u3r_trel(q_sut, &pq_sut, &qq_sut, &rq_sut) ) { + if ( c3n == u3r_qual(q_sut, &pq_sut, &qq_sut, &rq_sut, &sq_sut) ) { return u3m_bail(c3__fail); } else if ( c3__gold != pq_sut ) { @@ -43,14 +43,15 @@ else { return u3nt(c3__core, u3k(p_sut), - u3nt(u3k(yoz), + u3nq(u3k(yoz), u3k(qq_sut), - u3k(rq_sut))); + u3k(rq_sut), + u3k(sq_sut))); } } case c3__fork: p_sut = u3t(sut); { - u3_noun yed = u3qdi_tap(p_sut, u3_nul); + u3_noun yed = u3qdi_tap(p_sut); u3_noun ret = u3kf_fork(_wrap_fork(van, yed, yoz)); u3z(yed); diff --git a/jets/g/down.c b/jets/g/down.c index a540da9e7d..5f80290fb6 100644 --- a/jets/g/down.c +++ b/jets/g/down.c @@ -6,9 +6,9 @@ #include #include -u3_noun node_to_noun(cmark_node * nod); +static u3_noun node_to_noun(cmark_node * nod); -u3_noun list_elems_to_noun(cmark_node * nod) +static u3_noun list_elems_to_noun(cmark_node * nod) { u3_noun elems = u3_nul; @@ -20,17 +20,17 @@ u3_noun list_elems_to_noun(cmark_node * nod) return elems; } -u3_noun document_to_noun(cmark_node * nod) +static u3_noun document_to_noun(cmark_node * nod) { return list_elems_to_noun(nod); } -u3_noun block_quote_to_noun(cmark_node * nod) +static u3_noun block_quote_to_noun(cmark_node * nod) { return u3nc(u3nc(c3__bloq,u3_nul),list_elems_to_noun(nod)); } -u3_noun list_to_noun(cmark_node * nod) +static u3_noun list_to_noun(cmark_node * nod) { return u3nc( @@ -46,12 +46,12 @@ u3_noun list_to_noun(cmark_node * nod) list_elems_to_noun(nod)); } -u3_noun list_item_to_noun(cmark_node * nod) +static u3_noun list_item_to_noun(cmark_node * nod) { return u3nc(u3nc(c3__item,u3_nul),list_elems_to_noun(nod)); } -u3_noun code_block_to_noun(cmark_node * nod) +static u3_noun code_block_to_noun(cmark_node * nod) { u3_atom str = u3i_string((c3_c *) nod->string_content.ptr); /* XX u3i_bytes */ u3_noun res = @@ -70,7 +70,7 @@ u3_noun code_block_to_noun(cmark_node * nod) return res; } -u3_noun html_to_noun(cmark_node * nod) +static u3_noun html_to_noun(cmark_node * nod) { u3_atom str = u3i_string((c3_c *) nod->string_content.ptr); /* XX u3i_bytes */ u3_noun res = u3nc(c3__html, u3qe_lore(str)); @@ -78,63 +78,63 @@ u3_noun html_to_noun(cmark_node * nod) return res; } -u3_noun paragraph_to_noun(cmark_node * nod) +static u3_noun paragraph_to_noun(cmark_node * nod) { return u3nc(c3__para, list_elems_to_noun(nod)); } -u3_noun header_to_noun(cmark_node * nod) +static u3_noun header_to_noun(cmark_node * nod) { /* see also nod->as.header.setext */ return u3nt(c3__head, nod->as.header.level, list_elems_to_noun(nod)); } -u3_noun hrule_to_noun(cmark_node * nod) +static u3_noun hrule_to_noun(cmark_node * nod) { return u3nc(c3__hrul, u3_nul); } -u3_noun reference_def_to_noun(cmark_node * nod) +static u3_noun reference_def_to_noun(cmark_node * nod) { return u3nc(c3__defn, u3_nul); } -u3_noun text_to_noun(cmark_node * nod) +static u3_noun text_to_noun(cmark_node * nod) { return u3nc(u3_blip, u3i_tape((c3_c *) cmark_chunk_to_cstr(&nod->as.literal))); } -u3_noun softbreak_to_noun(cmark_node * nod) // XXX +static u3_noun softbreak_to_noun(cmark_node * nod) // XXX { return u3nt(0, 10, 0); } -u3_noun linebreak_to_noun(cmark_node * nod) +static u3_noun linebreak_to_noun(cmark_node * nod) { return u3nc(c3__line, u3_nul); } -u3_noun inline_code_to_noun(cmark_node * nod) +static u3_noun inline_code_to_noun(cmark_node * nod) { return u3nc(c3__code, u3i_tape((c3_c *) cmark_chunk_to_cstr(&nod->as.literal))); } -u3_noun inline_html_to_noun(cmark_node * nod) // XXX +static u3_noun inline_html_to_noun(cmark_node * nod) // XXX { return u3nc(c3__htmt, u3i_string((c3_c *) cmark_chunk_to_cstr(&nod->as.literal))); } -u3_noun emph_to_noun(cmark_node * nod) +static u3_noun emph_to_noun(cmark_node * nod) { return u3nc(u3nc(c3__emph, c3n), list_elems_to_noun(nod)); } -u3_noun strong_to_noun(cmark_node * nod) +static u3_noun strong_to_noun(cmark_node * nod) { return u3nc(u3nc(c3__emph, c3y), list_elems_to_noun(nod)); } -u3_noun link_to_noun(cmark_node * nod) +static u3_noun link_to_noun(cmark_node * nod) { return u3nc(u3nt(c3__link, nod->as.link.url @@ -146,7 +146,7 @@ u3_noun link_to_noun(cmark_node * nod) list_elems_to_noun(nod)); } -u3_noun image_to_noun(cmark_node * nod) +static u3_noun image_to_noun(cmark_node * nod) { return u3nc(u3nt(c3__blot, u3i_tape((c3_c *) nod->as.link.url), @@ -156,7 +156,7 @@ u3_noun image_to_noun(cmark_node * nod) list_elems_to_noun(nod)); } -u3_noun node_to_noun(cmark_node * nod) +static u3_noun node_to_noun(cmark_node * nod) { if (!nod) { fprintf(stderr, "markdown null node"); diff --git a/jets/tree.c b/jets/tree.c index 3ccbc40eeb..15481f8d5f 100644 --- a/jets/tree.c +++ b/jets/tree.c @@ -1,639 +1,621 @@ -/* j/dash.c -** +/* j/tree.c */ #include "all.h" -static u3j_harm _mood__hoon_add_a[] = {{".2", u3wa_add, c3y}, {}}; -static u3j_harm _mood__hoon_dec_a[] = {{".2", u3wa_dec, c3y}, {}}; -static u3j_harm _mood__hoon_div_a[] = {{".2", u3wa_div, c3y}, {}}; -static u3j_harm _mood__hoon_gte_a[] = {{".2", u3wa_gte, c3y}, {}}; -static u3j_harm _mood__hoon_gth_a[] = {{".2", u3wa_gth, c3y}, {}}; -static u3j_harm _mood__hoon_lte_a[] = {{".2", u3wa_lte, c3y}, {}}; -static u3j_harm _mood__hoon_lth_a[] = {{".2", u3wa_lth, c3y}, {}}; -static u3j_harm _mood__hoon_mod_a[] = {{".2", u3wa_mod, c3y}, {}}; -static u3j_harm _mood__hoon_mul_a[] = {{".2", u3wa_mul, c3y}, {}}; -static u3j_harm _mood__hoon_sub_a[] = {{".2", u3wa_sub, c3y}, {}}; + static u3j_harm _143_hex_down_mark_a[] = {{".2", u3wg_down, c3y}, {}}; + static u3j_core _143_hex_down_d[] = + { { "mark", _143_hex_down_mark_a }, + {} + }; -static u3j_harm _mood__hoon_bind_a[] = {{".2", u3wb_bind, c3y}, {}}; -static u3j_harm _mood__hoon_clap_a[] = {{".2", u3wb_clap, c3y}, {}}; -static u3j_harm _mood__hoon_drop_a[] = {{".2", u3wb_drop, c3y}, {}}; -static u3j_harm _mood__hoon_flop_a[] = {{".2", u3wb_flop, c3y}, {}}; -static u3j_harm _mood__hoon_lent_a[] = {{".2", u3wb_lent, c3y}, {}}; -static u3j_harm _mood__hoon_levy_a[] = {{".2", u3wb_levy, c3y}, {}}; -static u3j_harm _mood__hoon_lien_a[] = {{".2", u3wb_lien, c3y}, {}}; -static u3j_harm _mood__hoon_murn_a[] = {{".2", u3wb_murn, c3y}, {}}; -static u3j_harm _mood__hoon_need_a[] = {{".2", u3wb_need, c3y}, {}}; -static u3j_harm _mood__hoon_reap_a[] = {{".2", u3wb_reap, c3y}, {}}; -static u3j_harm _mood__hoon_reel_a[] = {{".2", u3wb_reel, c3y}, {}}; -static u3j_harm _mood__hoon_roll_a[] = {{".2", u3wb_roll, c3y}, {}}; -static u3j_harm _mood__hoon_skid_a[] = {{".2", u3wb_skid, c3y}, {}}; -static u3j_harm _mood__hoon_skim_a[] = {{".2", u3wb_skim, c3y}, {}}; -static u3j_harm _mood__hoon_skip_a[] = {{".2", u3wb_skip, c3y}, {}}; -static u3j_harm _mood__hoon_scag_a[] = {{".2", u3wb_scag, c3y}, {}}; -static u3j_harm _mood__hoon_slag_a[] = {{".2", u3wb_slag, c3y}, {}}; -static u3j_harm _mood__hoon_snag_a[] = {{".2", u3wb_snag, c3y}, {}}; -// static u3j_harm _mood__hoon_sort_a[] = {{".2", u3wb_sort, c3y}, {}}; -static u3j_harm _mood__hoon_turn_a[] = {{".2", u3wb_turn, c3y}, {}}; -static u3j_harm _mood__hoon_weld_a[] = {{".2", u3wb_weld, c3y}, {}}; + static u3j_harm _143_hex_lore_a[] = {{".2", u3we_lore}, {}}; + static u3j_harm _143_hex_loss_a[] = {{".2", u3we_loss}, {}}; + static u3j_harm _143_hex_lune_a[] = {{".2", u3we_lune}, {}}; -static u3j_harm _mood__hoon_bex_a[] = {{".2", u3wc_bex, c3y}, {}}; -static u3j_harm _mood__hoon_xeb_a[] = {{".2", u3wc_xeb, c3y}, {}}; -static u3j_harm _mood__hoon_can_a[] = {{".2", u3wc_can, c3y}, {}}; -static u3j_harm _mood__hoon_cap_a[] = {{".2", u3wc_cap, c3y}, {}}; -static u3j_harm _mood__hoon_cat_a[] = {{".2", u3wc_cat, c3y}, {}}; -static u3j_harm _mood__hoon_con_a[] = {{".2", u3wc_con, c3y}, {}}; -static u3j_harm _mood__hoon_cut_a[] = {{".2", u3wc_cut, c3y}, {}}; -static u3j_harm _mood__hoon_dis_a[] = {{".2", u3wc_dis, c3y}, {}}; -static u3j_harm _mood__hoon_dor_a[] = {{".2", u3wc_dor, c3y}, {}}; -static u3j_harm _mood__hoon_dvr_a[] = {{".2", u3wc_dvr, c3y}, {}}; -static u3j_harm _mood__hoon_end_a[] = {{".2", u3wc_end, c3y}, {}}; -static u3j_harm _mood__hoon_gor_a[] = {{".2", u3wc_gor, c3y}, {}}; -static u3j_harm _mood__hoon_hor_a[] = {{".2", u3wc_hor, c3y}, {}}; -static u3j_harm _mood__hoon_lsh_a[] = {{".2", u3wc_lsh, c3y}, {}}; -static u3j_harm _mood__hoon_mas_a[] = {{".2", u3wc_mas, c3y}, {}}; -static u3j_harm _mood__hoon_met_a[] = {{".2", u3wc_met, c3y}, {}}; -static u3j_harm _mood__hoon_mix_a[] = {{".2", u3wc_mix, c3y}, {}}; -static u3j_harm _mood__hoon_mug_a[] = {{".2", u3wc_mug, c3y}, {}}; -static u3j_harm _mood__hoon_muk_a[] = {{".2", u3wc_muk, c3y}, {}}; -static u3j_harm _mood__hoon_peg_a[] = {{".2", u3wc_peg, c3y}, {}}; -static u3j_harm _mood__hoon_pow_a[] = {{".2", u3wc_pow, c3y}, {}}; -static u3j_harm _mood__hoon_rap_a[] = {{".2", u3wc_rap, c3y}, {}}; -static u3j_harm _mood__hoon_rep_a[] = {{".2", u3wc_rep, c3y}, {}}; -static u3j_harm _mood__hoon_rip_a[] = {{".2", u3wc_rip, c3y}, {}}; -static u3j_harm _mood__hoon_rsh_a[] = {{".2", u3wc_rsh, c3y}, {}}; -static u3j_harm _mood__hoon_sqt_a[] = {{".2", u3wc_sqt, c3y}, {}}; -static u3j_harm _mood__hoon_vor_a[] = {{".2", u3wc_vor, c3y}, {}}; + static u3j_harm _143_hex_coed__ed_puck_a[] = {{".2", u3wee_puck}, {}}; + static u3j_harm _143_hex_coed__ed_sign_a[] = {{".2", u3wee_sign}, {}}; + static u3j_harm _143_hex_coed__ed_veri_a[] = {{".2", u3wee_veri}, {}}; + static u3j_harm _143_hex_coed__ed_shar_a[] = {{".2", u3wee_shar}, {}}; -static u3j_harm _mood__hoon__po_ind_a[] = {{".2", u3wcp_ind}, {}}; -static u3j_harm _mood__hoon__po_ins_a[] = {{".2", u3wcp_ins}, {}}; -static u3j_harm _mood__hoon__po_tod_a[] = {{".2", u3wcp_tod}, {}}; -static u3j_harm _mood__hoon__po_tos_a[] = {{".2", u3wcp_tos}, {}}; -static u3j_core _mood__hoon__po_d[] = - { { "ind", _mood__hoon__po_ind_a }, - { "ins", _mood__hoon__po_ins_a }, - { "tod", _mood__hoon__po_tod_a }, - { "tos", _mood__hoon__po_tos_a }, + static u3j_core _143_hex_coed__ed_d[] = + { { "sign", _143_hex_coed__ed_sign_a }, + { "puck", _143_hex_coed__ed_puck_a }, + { "veri", _143_hex_coed__ed_veri_a }, + { "shar", _143_hex_coed__ed_shar_a }, + {} + }; +static u3j_core _143_hex_coed_d[] = + { { "ed", 0, _143_hex_coed__ed_d }, {} }; -static u3j_harm _mood__hoon__by_bif_a[] = {{".2", u3wdb_bif, c3y}, {}}; -static u3j_harm _mood__hoon__by_dif_a[] = {{".2", u3wdb_dif, c3y}, {}}; -static u3j_harm _mood__hoon__by_gas_a[] = {{".2", u3wdb_gas, c3y}, {}}; -static u3j_harm _mood__hoon__by_get_a[] = {{".2", u3wdb_get, c3y}, {}}; -static u3j_harm _mood__hoon__by_has_a[] = {{".2", u3wdb_has, c3y}, {}}; -// static u3j_harm _mood__hoon__by_int_a[] = {{".2", u3wdb_int, c3y}, {}}; -static u3j_harm _mood__hoon__by_put_a[] = {{".2", u3wdb_put, c3y}, {}}; -static u3j_harm _mood__hoon__by_tap_a[] = {{".2", u3wdb_tap, c3y}, {}}; -//static u3j_harm _mood__hoon__by_uni_a[] = {{".2", u3wdb_uni, c3y}, {}}; -static u3j_core _mood__hoon__by_d[] = - { { "bif", _mood__hoon__by_bif_a }, - { "dif", _mood__hoon__by_dif_a }, - { "gas", _mood__hoon__by_gas_a }, - { "get", _mood__hoon__by_get_a }, - { "has", _mood__hoon__by_has_a }, - // { "int", _mood__hoon__by_int_a }, - { "put", _mood__hoon__by_put_a }, - { "tap", _mood__hoon__by_tap_a }, - // { "uni", _mood__hoon__by_uni_a }, +static u3j_core _143_hex_d[] = + { { "down", 0, _143_hex_down_d }, + { "lore", _143_hex_lore_a }, + { "loss", _143_hex_loss_a }, + { "lune", _143_hex_lune_a }, + { "coed", 0, _143_hex_coed_d }, {} }; -static u3j_harm _mood__hoon__in_bif_a[] = {{".2", u3wdi_bif}, {}}; -static u3j_harm _mood__hoon__in_dif_a[] = {{".2", u3wdi_dif}, {}}; -static u3j_harm _mood__hoon__in_gas_a[] = {{".2", u3wdi_gas}, {}}; -static u3j_harm _mood__hoon__in_has_a[] = {{".2", u3wdi_has}, {}}; -static u3j_harm _mood__hoon__in_mer_a[] = {{".2", u3wdi_mer}, {}}; -// static u3j_harm _mood__hoon__in_int_a[] = {{".2", u3wdi_int}, {}}; -static u3j_harm _mood__hoon__in_put_a[] = {{".2", u3wdi_put}, {}}; -static u3j_harm _mood__hoon__in_tap_a[] = {{".2", u3wdi_tap}, {}}; -static u3j_harm _mood__hoon__in_wyt_a[] = {{".2", u3wdi_wyt}, {}}; -static u3j_harm _mood__hoon__in_uni_a[] = {{".2", u3wdi_uni}, {}}; -static u3j_core _mood__hoon__in_d[] = - { { "bif", _mood__hoon__in_bif_a }, - { "dif", _mood__hoon__in_dif_a }, - { "gas", _mood__hoon__in_gas_a }, - { "has", _mood__hoon__in_has_a }, - { "mer", _mood__hoon__in_mer_a }, - // { "int", _mood__hoon__in_int_a }, - { "put", _mood__hoon__in_put_a }, - { "tap", _mood__hoon__in_tap_a }, - { "wyt", _mood__hoon__in_wyt_a }, - { "uni", _mood__hoon__in_uni_a }, - {} - }; +/* layer five +*/ + static u3j_harm _143_pen_cell_a[] = {{".2", u3wf_cell}, {}}; + static u3j_harm _143_pen_comb_a[] = {{".2", u3wf_comb}, {}}; + static u3j_harm _143_pen_cons_a[] = {{".2", u3wf_cons}, {}}; + static u3j_harm _143_pen_core_a[] = {{".2", u3wf_core}, {}}; + static u3j_harm _143_pen_help_a[] = {{".2", u3wf_help}, {}}; + static u3j_harm _143_pen_face_a[] = {{".2", u3wf_face}, {}}; + static u3j_harm _143_pen_fitz_a[] = {{".2", u3wf_fitz}, {}}; + static u3j_harm _143_pen_flan_a[] = {{".2", u3wf_flan}, {}}; + static u3j_harm _143_pen_flip_a[] = {{".2", u3wf_flip}, {}}; + static u3j_harm _143_pen_flor_a[] = {{".2", u3wf_flor}, {}}; + static u3j_harm _143_pen_fork_a[] = {{".2", u3wf_fork}, {}}; + static u3j_harm _143_pen_hike_a[] = {{".2", u3wf_hike}, {}}; + static u3j_harm _143_pen_look_a[] = {{".2", u3wf_look}, {}}; + static u3j_harm _143_pen_loot_a[] = {{".2", u3wf_loot}, {}}; -static u3j_harm _mood__hoon_cue_a[] = {{".2", u3we_cue}, {}}; -static u3j_harm _mood__hoon_jam_a[] = {{".2", u3we_jam}, {}}; -static u3j_harm _mood__hoon_mat_a[] = {{".2", u3we_mat}, {}}; -static u3j_harm _mood__hoon_rub_a[] = {{".2", u3we_rub}, {}}; -static u3j_harm _mood__hoon_lore_a[] = {{".2", u3we_lore}, {}}; -static u3j_harm _mood__hoon_loss_a[] = {{".2", u3we_loss}, {}}; -static u3j_harm _mood__hoon_lune_a[] = {{".2", u3we_lune}, {}}; -static u3j_harm _mood__hoon_mink_a[] = {{".2", u3we_mink}, {}}; -static u3j_harm _mood__hoon_mule_a[] = {{".2", u3we_mule}, {}}; -static u3j_harm _mood__hoon_trip_a[] = {{".2", u3we_trip}, {}}; - -static u3j_harm _mood__hoon__aesc_en_a[] = {{".2", u3wea_en}, {}}; -static u3j_harm _mood__hoon__aesc_de_a[] = {{".2", u3wea_de}, {}}; -static u3j_core _mood__hoon__aesc_d[] = - { { "en", _mood__hoon__aesc_en_a }, - { "de", _mood__hoon__aesc_de_a }, - {} - }; - -static u3j_harm _mood__hoon__bend_fun_a[] = {{".2", u3we_bend_fun}, {}}; -static u3j_core _mood__hoon__bend_d[] = - { { "fun", _mood__hoon__bend_fun_a }, - {} - }; -static u3j_harm _mood__hoon__cold_fun_a[] = {{".2", u3we_cold_fun}, {}}; -static u3j_core _mood__hoon__cold_d[] = - { { "fun", _mood__hoon__cold_fun_a }, - {} - }; -static u3j_harm _mood__hoon__cook_fun_a[] = {{".2", u3we_cook_fun}, {}}; -static u3j_core _mood__hoon__cook_d[] = - { { "fun", _mood__hoon__cook_fun_a }, - {} - }; -static u3j_harm _mood__hoon__comp_fun_a[] = {{".2", u3we_comp_fun}, {}}; -static u3j_core _mood__hoon__comp_d[] = - { { "fun", _mood__hoon__comp_fun_a }, - {} - }; -static u3j_harm _mood__hoon__easy_fun_a[] = {{".2", u3we_easy_fun}, {}}; -static u3j_core _mood__hoon__easy_d[] = - { { "fun", _mood__hoon__easy_fun_a }, - {} - }; -static u3j_harm _mood__hoon__glue_fun_a[] = {{".2", u3we_glue_fun}, {}}; -static u3j_core _mood__hoon__glue_d[] = - { { "fun", _mood__hoon__glue_fun_a }, - {} - }; -static u3j_harm _mood__hoon__here_fun_a[] = {{".2", u3we_here_fun}, {}}; -static u3j_core _mood__hoon__here_d[] = - { { "fun", _mood__hoon__here_fun_a }, - {} - }; -static u3j_harm _mood__hoon__just_fun_a[] = {{".2", u3we_just_fun}, {}}; -static u3j_core _mood__hoon__just_d[] = - { { "fun", _mood__hoon__just_fun_a }, - {} - }; -static u3j_harm _mood__hoon__mask_fun_a[] = {{".2", u3we_mask_fun}, {}}; -static u3j_core _mood__hoon__mask_d[] = - { { "fun", _mood__hoon__mask_fun_a }, - {} - }; -static u3j_harm _mood__hoon__shim_fun_a[] = {{".2", u3we_shim_fun}, {}}; -static u3j_core _mood__hoon__shim_d[] = - { { "fun", _mood__hoon__shim_fun_a }, - {} - }; -static u3j_harm _mood__hoon__stag_fun_a[] = {{".2", u3we_stag_fun}, {}}; -static u3j_core _mood__hoon__stag_d[] = - { { "fun", _mood__hoon__stag_fun_a }, - {} - }; -static u3j_harm _mood__hoon__stew_fun_a[] = {{".2", u3we_stew_fun}, {}}; -static u3j_core _mood__hoon__stew_d[] = - { { "fun", _mood__hoon__stew_fun_a }, - {} - }; -static u3j_harm _mood__hoon__stir_fun_a[] = {{".2", u3we_stir_fun}, {}}; -static u3j_core _mood__hoon__stir_d[] = - { { "fun", _mood__hoon__stir_fun_a }, - {} - }; - -static u3j_harm _mood__hoon__og_raw_a[] = {{".2", u3weo_raw}, {}}; -static u3j_core _mood__hoon__og_d[] = - { { "raw", _mood__hoon__og_raw_a }, - {} - }; - -static u3j_harm _mood__hoon__cofl__drg_a[] = {{".2", u3wef_drg}, {}}; -static u3j_harm _mood__hoon__cofl__lug_a[] = {{".2", u3wef_lug}, {}}; -static u3j_core _mood__hoon__cofl_d[] = - { { "drg", _mood__hoon__cofl__drg_a }, - { "lug", _mood__hoon__cofl__lug_a }, - {} - }; - -static u3j_harm _mood__hoon__rd_add_a[] = {{".2", u3wer_add}, {}}; -static u3j_harm _mood__hoon__rd_sub_a[] = {{".2", u3wer_sub}, {}}; -static u3j_harm _mood__hoon__rd_mul_a[] = {{".2", u3wer_mul}, {}}; -static u3j_harm _mood__hoon__rd_div_a[] = {{".2", u3wer_div}, {}}; -static u3j_harm _mood__hoon__rd_sqt_a[] = {{".2", u3wer_sqt}, {}}; -static u3j_harm _mood__hoon__rd_fma_a[] = {{".2", u3wer_fma}, {}}; -static u3j_harm _mood__hoon__rd_lth_a[] = {{".2", u3wer_lth}, {}}; -static u3j_harm _mood__hoon__rd_lte_a[] = {{".2", u3wer_lte}, {}}; -static u3j_harm _mood__hoon__rd_equ_a[] = {{".2", u3wer_equ}, {}}; -static u3j_harm _mood__hoon__rd_gte_a[] = {{".2", u3wer_gte}, {}}; -static u3j_harm _mood__hoon__rd_gth_a[] = {{".2", u3wer_gth}, {}}; -static u3j_core _mood__hoon__rd_d[] = - { { "add", _mood__hoon__rd_add_a }, - { "sub", _mood__hoon__rd_sub_a }, - { "mul", _mood__hoon__rd_mul_a }, - { "div", _mood__hoon__rd_div_a }, - { "sqt", _mood__hoon__rd_sqt_a }, - { "fma", _mood__hoon__rd_fma_a }, - { "lth", _mood__hoon__rd_lth_a }, - { "lte", _mood__hoon__rd_lte_a }, - { "equ", _mood__hoon__rd_equ_a }, - { "gte", _mood__hoon__rd_gte_a }, - { "gth", _mood__hoon__rd_gth_a }, - {} - }; - -static u3j_harm _mood__hoon__rs_add_a[] = {{".2", u3wet_add}, {}}; -static u3j_harm _mood__hoon__rs_sub_a[] = {{".2", u3wet_sub}, {}}; -static u3j_harm _mood__hoon__rs_mul_a[] = {{".2", u3wet_mul}, {}}; -static u3j_harm _mood__hoon__rs_div_a[] = {{".2", u3wet_div}, {}}; -static u3j_harm _mood__hoon__rs_sqt_a[] = {{".2", u3wet_sqt}, {}}; -static u3j_harm _mood__hoon__rs_fma_a[] = {{".2", u3wet_fma}, {}}; -static u3j_harm _mood__hoon__rs_lth_a[] = {{".2", u3wet_lth}, {}}; -static u3j_harm _mood__hoon__rs_lte_a[] = {{".2", u3wet_lte}, {}}; -static u3j_harm _mood__hoon__rs_equ_a[] = {{".2", u3wet_equ}, {}}; -static u3j_harm _mood__hoon__rs_gte_a[] = {{".2", u3wet_gte}, {}}; -static u3j_harm _mood__hoon__rs_gth_a[] = {{".2", u3wet_gth}, {}}; -static u3j_core _mood__hoon__rs_d[] = - { { "add", _mood__hoon__rs_add_a }, - { "sub", _mood__hoon__rs_sub_a }, - { "mul", _mood__hoon__rs_mul_a }, - { "div", _mood__hoon__rs_div_a }, - { "sqt", _mood__hoon__rs_sqt_a }, - { "fma", _mood__hoon__rs_fma_a }, - { "lth", _mood__hoon__rs_lth_a }, - { "lte", _mood__hoon__rs_lte_a }, - { "equ", _mood__hoon__rs_equ_a }, - { "gte", _mood__hoon__rs_gte_a }, - { "gth", _mood__hoon__rs_gth_a }, - {} - }; - -static u3j_harm _mood__hoon__rq_add_a[] = {{".2", u3weq_add}, {}}; -static u3j_harm _mood__hoon__rq_sub_a[] = {{".2", u3weq_sub}, {}}; -static u3j_harm _mood__hoon__rq_mul_a[] = {{".2", u3weq_mul}, {}}; -static u3j_harm _mood__hoon__rq_div_a[] = {{".2", u3weq_div}, {}}; -static u3j_harm _mood__hoon__rq_sqt_a[] = {{".2", u3weq_sqt}, {}}; -static u3j_harm _mood__hoon__rq_fma_a[] = {{".2", u3weq_fma}, {}}; -static u3j_harm _mood__hoon__rq_lth_a[] = {{".2", u3weq_lth}, {}}; -static u3j_harm _mood__hoon__rq_lte_a[] = {{".2", u3weq_lte}, {}}; -static u3j_harm _mood__hoon__rq_equ_a[] = {{".2", u3weq_equ}, {}}; -static u3j_harm _mood__hoon__rq_gte_a[] = {{".2", u3weq_gte}, {}}; -static u3j_harm _mood__hoon__rq_gth_a[] = {{".2", u3weq_gth}, {}}; -static u3j_core _mood__hoon__rq_d[] = - { { "add", _mood__hoon__rq_add_a }, - { "sub", _mood__hoon__rq_sub_a }, - { "mul", _mood__hoon__rq_mul_a }, - { "div", _mood__hoon__rq_div_a }, - { "sqt", _mood__hoon__rq_sqt_a }, - { "fma", _mood__hoon__rq_fma_a }, - { "lth", _mood__hoon__rq_lth_a }, - { "lte", _mood__hoon__rq_lte_a }, - { "equ", _mood__hoon__rq_equ_a }, - { "gte", _mood__hoon__rq_gte_a }, - { "gth", _mood__hoon__rq_gth_a }, - {} - }; - -static u3j_harm _mood__hoon__coed__ed_puck_a[] = {{".2", u3wee_puck}, {}}; -static u3j_harm _mood__hoon__coed__ed_sign_a[] = {{".2", u3wee_sign}, {}}; -static u3j_harm _mood__hoon__coed__ed_veri_a[] = {{".2", u3wee_veri}, {}}; -static u3j_harm _mood__hoon__coed__ed_shar_a[] = {{".2", u3wee_shar}, {}}; - -static u3j_core _mood__hoon__coed__ed_d[] = - { { "sign", _mood__hoon__coed__ed_sign_a }, - { "puck", _mood__hoon__coed__ed_puck_a }, - { "veri", _mood__hoon__coed__ed_veri_a }, - { "shar", _mood__hoon__coed__ed_shar_a }, - {} - }; -static u3j_core _mood__hoon__coed_d[] = - { { "ed", 0, _mood__hoon__coed__ed_d }, - {} - }; - -static u3j_harm _mood__hoon__scr_hsh_a[] = {{".2", u3wes_hsh}, {}}; -static u3j_harm _mood__hoon__scr_hsl_a[] = {{".2", u3wes_hsl}, {}}; -static u3j_harm _mood__hoon__scr_pbk_a[] = {{".2", u3wes_pbk}, {}}; -static u3j_harm _mood__hoon__scr_pbl_a[] = {{".2", u3wes_pbl}, {}}; -static u3j_core _mood__hoon__scr_d[] = - { { "hsh", _mood__hoon__scr_hsh_a }, - { "hsl", _mood__hoon__scr_hsl_a }, - { "pbk", _mood__hoon__scr_pbk_a }, - { "pbl", _mood__hoon__scr_pbl_a }, - {} - }; - -static u3j_harm _mood__hoon_pfix_a[] = {{".2", u3we_pfix}, {}}; -static u3j_harm _mood__hoon_plug_a[] = {{".2", u3we_plug}, {}}; -static u3j_harm _mood__hoon_pose_a[] = {{".2", u3we_pose}, {}}; -static u3j_harm _mood__hoon_sfix_a[] = {{".2", u3we_sfix}, {}}; -static u3j_harm _mood__hoon_shax_a[] = {{".2", u3we_shax}, {}}; -static u3j_harm _mood__hoon_shay_a[] = {{".2", u3we_shay}, {}}; -static u3j_harm _mood__hoon_shas_a[] = {{".2", u3we_shas}, {}}; -static u3j_harm _mood__hoon_shal_a[] = {{".2", u3we_shal}, {}}; - -static u3j_harm _mood__hoon_cell_a[] = {{".2", u3wf_cell}, {}}; -static u3j_harm _mood__hoon_comb_a[] = {{".2", u3wf_comb}, {}}; -static u3j_harm _mood__hoon_cons_a[] = {{".2", u3wf_cons}, {}}; -static u3j_harm _mood__hoon_core_a[] = {{".2", u3wf_core}, {}}; -static u3j_harm _mood__hoon_face_a[] = {{".2", u3wf_face}, {}}; -static u3j_harm _mood__hoon_fitz_a[] = {{".2", u3wf_fitz}, {}}; -static u3j_harm _mood__hoon_flan_a[] = {{".2", u3wf_flan}, {}}; -static u3j_harm _mood__hoon_flip_a[] = {{".2", u3wf_flip}, {}}; -static u3j_harm _mood__hoon_flor_a[] = {{".2", u3wf_flor}, {}}; -static u3j_harm _mood__hoon_fork_a[] = {{".2", u3wf_fork}, {}}; -static u3j_harm _mood__hoon_hike_a[] = {{".2", u3wf_hike}, {}}; -static u3j_harm _mood__hoon_look_a[] = {{".2", u3wf_look}, {}}; - -static u3j_harm _mood__hoon__ut_burn_a[] = {{".2", u3wfu_burn}, {}}; -static u3j_harm _mood__hoon__ut_conk_a[] = {{".2", u3wfu_conk}, {}}; -static u3j_harm _mood__hoon__ut_crop_a[] = {{".2", u3wfu_crop}, {}}; -// static u3j_harm _mood__hoon__ut_fire_a[] = {{".2", u3wfu_fire}, {}}; -static u3j_harm _mood__hoon__ut_fond_a[] = {{".2", u3wfu_fond}, {}}; -static u3j_harm _mood__hoon__ut_fish_a[] = {{".2", u3wfu_fish}, {}}; -static u3j_harm _mood__hoon__ut_fuse_a[] = {{".2", u3wfu_fuse}, {}}; -static u3j_harm _mood__hoon__ut_mint_a[] = {{".2", u3wfu_mint}, {}}; -static u3j_harm _mood__hoon__ut_mull_a[] = {{".2", u3wfu_mull}, {}}; -static u3j_harm _mood__hoon__ut_nest_a[] = {{".2", u3wfu_nest}, {}}; -static u3j_harm _mood__hoon__ut_peek_a[] = {{".2", u3wfu_peek}, {}}; -static u3j_harm _mood__hoon__ut_perk_a[] = {{".2", u3wfu_perk}, {}}; -static u3j_harm _mood__hoon__ut_play_a[] = {{".2", u3wfu_play}, {}}; -static u3j_harm _mood__hoon__ut_rest_a[] = {{".2", u3wfu_rest}, {}}; -static u3j_harm _mood__hoon__ut_toss_a[] = {{".2", u3wfu_toss}, {}}; -static u3j_harm _mood__hoon__ut_wrap_a[] = {{".2", u3wfu_wrap}, {}}; - -static u3j_core _mood__hoon__ut_d[] = - { - { "burn", _mood__hoon__ut_burn_a }, - { "conk", _mood__hoon__ut_conk_a }, - { "crop", _mood__hoon__ut_crop_a }, - { "fond", _mood__hoon__ut_fond_a }, - // { "fire", _mood__hoon__ut_fire_a }, - { "fish", _mood__hoon__ut_fish_a }, - { "fuse", _mood__hoon__ut_fuse_a }, - { "mint", _mood__hoon__ut_mint_a }, - { "mull", _mood__hoon__ut_mull_a }, - { "nest", _mood__hoon__ut_nest_a }, - { "peek", _mood__hoon__ut_peek_a }, - { "perk", _mood__hoon__ut_perk_a }, - { "play", _mood__hoon__ut_play_a }, - { "rest", _mood__hoon__ut_rest_a }, - { "toss", _mood__hoon__ut_toss_a }, - { "wrap", _mood__hoon__ut_wrap_a }, - {} - }; -static u3j_harm _mood__hoon__ut_a[] = - { {"burn", u3wfu_burn}, - {"repo", u3wfu_repo}, - {} - }; + static u3j_harm _143_pen__ut_burn_a[] = {{".2", u3wfu_burn}, {}}; + static u3j_harm _143_pen__ut_conk_a[] = {{".2", u3wfu_conk}, {}}; + static u3j_harm _143_pen__ut_crop_a[] = {{".2", u3wfu_crop}, {}}; + // static u3j_harm _143_pen__ut_fire_a[] = {{".2", u3wfu_fire}, {}}; + static u3j_harm _143_pen__ut_fond_a[] = {{".2", u3wfu_fond}, {}}; + static u3j_harm _143_pen__ut_fish_a[] = {{".2", u3wfu_fish}, {}}; + static u3j_harm _143_pen__ut_fuse_a[] = {{".2", u3wfu_fuse}, {}}; + static u3j_harm _143_pen__ut_mint_a[] = {{".2", u3wfu_mint}, {}}; + static u3j_harm _143_pen__ut_mull_a[] = {{".2", u3wfu_mull}, {}}; + static u3j_harm _143_pen__ut_nest_a[] = {{".2", u3wfu_nest}, {}}; + static u3j_harm _143_pen__ut_peek_a[] = {{".2", u3wfu_peek}, {}}; + static u3j_harm _143_pen__ut_play_a[] = {{".2", u3wfu_play}, {}}; + static u3j_harm _143_pen__ut_rest_a[] = {{".2", u3wfu_rest}, {}}; + static u3j_harm _143_pen__ut_toss_a[] = {{".2", u3wfu_toss}, {}}; + static u3j_harm _143_pen__ut_wrap_a[] = {{".2", u3wfu_wrap}, {}}; + static u3j_core _143_pen__ut_d[] = + { + { "burn", _143_pen__ut_burn_a }, + { "conk", _143_pen__ut_conk_a }, + { "crop", _143_pen__ut_crop_a }, + { "fond", _143_pen__ut_fond_a }, + // { "fire", _143_pen__ut_fire_a }, + { "fish", _143_pen__ut_fish_a }, + { "fuse", _143_pen__ut_fuse_a }, + { "mint", _143_pen__ut_mint_a }, + { "mull", _143_pen__ut_mull_a }, + { "nest", _143_pen__ut_nest_a }, + { "peek", _143_pen__ut_peek_a }, + { "play", _143_pen__ut_play_a }, + { "rest", _143_pen__ut_rest_a }, + { "toss", _143_pen__ut_toss_a }, + { "wrap", _143_pen__ut_wrap_a }, + {} + }; + static u3j_harm _143_pen__ut_a[] = + { {"burn", u3wfu_burn}, + {"repo", u3wfu_repo}, + {} + }; #if 0 -static u3j_harm _mood__hoon__ap_a[] = - { // {"hack", u3wfp_open}, - // {"late", u3wfp_open}, - {"open", u3wfp_open}, - {"rake", u3wfp_rake}, - {} - }; -static u3j_harm _mood__hoon__al_a[] = - { {"bunt", u3wfl_bunt}, - {"whip", u3wfl_whip}, - {} - }; + static u3j_harm _143_pen__ap_a[] = + { {"open", u3wfp_open}, + {"rake", u3wfp_rake}, + {} + }; + static u3j_harm _143_pen__al_a[] = + { {"bunt", u3wfl_bunt}, + {"whip", u3wfl_whip}, + {} + }; #endif -static u3j_harm _down_mark_a[] = {{".2", u3wg_down, c3y}, {}}; -static u3j_core _down_d[] = - { { "mark", _down_mark_a }, +static u3j_core _143_pen_d[] = + { { "hex", 0, _143_hex_d }, + + { "cell", _143_pen_cell_a }, + { "comb", _143_pen_comb_a }, + { "cons", _143_pen_cons_a }, + { "core", _143_pen_core_a }, + { "face", _143_pen_face_a }, + { "fitz", _143_pen_fitz_a }, + { "flan", _143_pen_flan_a }, + { "flip", _143_pen_flip_a }, + { "flor", _143_pen_flor_a }, + { "fork", _143_pen_fork_a }, + { "help", _143_pen_help_a }, + { "hike", _143_pen_hike_a }, + { "look", _143_pen_look_a }, + { "loot", _143_pen_loot_a }, + + // { "ap", _143_pen__ap_a }, + // { "al", _143_pen__al_a }, + { "ut", _143_pen__ut_a, _143_pen__ut_d }, + {} }; -static u3j_harm _zuse__aes_ecba_en_a[] = {{".2", u3wea_ecba_en}, {}}; -static u3j_harm _zuse__aes_ecba_de_a[] = {{".2", u3wea_ecba_de}, {}}; -static u3j_harm _zuse__aes_ecbb_en_a[] = {{".2", u3wea_ecbb_en}, {}}; -static u3j_harm _zuse__aes_ecbb_de_a[] = {{".2", u3wea_ecbb_de}, {}}; -static u3j_harm _zuse__aes_ecbc_en_a[] = {{".2", u3wea_ecbc_en}, {}}; -static u3j_harm _zuse__aes_ecbc_de_a[] = {{".2", u3wea_ecbc_de}, {}}; - -static u3j_harm _zuse__aes_cbca_en_a[] = {{".2", u3wea_cbca_en}, {}}; -static u3j_harm _zuse__aes_cbca_de_a[] = {{".2", u3wea_cbca_de}, {}}; -static u3j_harm _zuse__aes_cbcb_en_a[] = {{".2", u3wea_cbcb_en}, {}}; -static u3j_harm _zuse__aes_cbcb_de_a[] = {{".2", u3wea_cbcb_de}, {}}; -static u3j_harm _zuse__aes_cbcc_en_a[] = {{".2", u3wea_cbcc_en}, {}}; -static u3j_harm _zuse__aes_cbcc_de_a[] = {{".2", u3wea_cbcc_de}, {}}; - -static u3j_core _zuse__aes_ecba_d[] = - { { "en", _zuse__aes_ecba_en_a }, - { "de", _zuse__aes_ecba_de_a }, - {} - }; - -static u3j_core _zuse__aes_ecbb_d[] = - { { "en", _zuse__aes_ecbb_en_a }, - { "de", _zuse__aes_ecbb_de_a }, - {} - }; - -static u3j_core _zuse__aes_ecbc_d[] = - { { "en", _zuse__aes_ecbc_en_a }, - { "de", _zuse__aes_ecbc_de_a }, - {} - }; - -static u3j_core _zuse__aes_cbca_d[] = - { { "en", _zuse__aes_cbca_en_a }, - { "de", _zuse__aes_cbca_de_a }, - {} - }; - -static u3j_core _zuse__aes_cbcb_d[] = - { { "en", _zuse__aes_cbcb_en_a }, - { "de", _zuse__aes_cbcb_de_a }, - {} - }; - -static u3j_core _zuse__aes_cbcc_d[] = - { { "en", _zuse__aes_cbcc_en_a }, - { "de", _zuse__aes_cbcc_de_a }, - {} - }; - -static u3j_core _zuse__aes_d[] = - { { "ecba", 0, _zuse__aes_ecba_d }, - { "ecbb", 0, _zuse__aes_ecbb_d }, - { "ecbc", 0, _zuse__aes_ecbc_d }, - { "cbca", 0, _zuse__aes_cbca_d }, - { "cbcb", 0, _zuse__aes_cbcb_d }, - { "cbcc", 0, _zuse__aes_cbcc_d }, - {} - }; - -/* -static u3j_core _zuse_d[] = - { { "aes", 0, _zuse__aes_d }, - {} - }; +/* layer four */ + static u3j_harm _143_qua_trip_a[] = {{".2", u3we_trip}, {}}; -static u3j_core _arvo_d[] = - { { "down", 0, _down_d }, - { "aes", 0, _zuse__aes_d }, + static u3j_harm _143_qua__po_ind_a[] = {{".2", u3wcp_ind}, {}}; + static u3j_harm _143_qua__po_ins_a[] = {{".2", u3wcp_ins}, {}}; + static u3j_harm _143_qua__po_tod_a[] = {{".2", u3wcp_tod}, {}}; + static u3j_harm _143_qua__po_tos_a[] = {{".2", u3wcp_tos}, {}}; + static u3j_core _143_qua__po_d[] = + { { "ind", _143_qua__po_ind_a }, + { "ins", _143_qua__po_ins_a }, + { "tod", _143_qua__po_tod_a }, + { "tos", _143_qua__po_tos_a }, + {} + }; + + static u3j_harm _143_qua__bend_fun_a[] = {{".2", u3we_bend_fun}, {}}; + static u3j_core _143_qua__bend_d[] = + { { "fun", _143_qua__bend_fun_a }, + {} + }; + + static u3j_harm _143_qua__cold_fun_a[] = {{".2", u3we_cold_fun}, {}}; + static u3j_core _143_qua__cold_d[] = + { { "fun", _143_qua__cold_fun_a }, + {} + }; + + static u3j_harm _143_qua__cook_fun_a[] = {{".2", u3we_cook_fun}, {}}; + static u3j_core _143_qua__cook_d[] = + { { "fun", _143_qua__cook_fun_a }, + {} + }; + + static u3j_harm _143_qua__comp_fun_a[] = {{".2", u3we_comp_fun}, {}}; + static u3j_core _143_qua__comp_d[] = + { { "fun", _143_qua__comp_fun_a }, + {} + }; + + static u3j_harm _143_qua__easy_fun_a[] = {{".2", u3we_easy_fun}, {}}; + static u3j_core _143_qua__easy_d[] = + { { "fun", _143_qua__easy_fun_a }, + {} + }; + + static u3j_harm _143_qua__glue_fun_a[] = {{".2", u3we_glue_fun}, {}}; + static u3j_core _143_qua__glue_d[] = + { { "fun", _143_qua__glue_fun_a }, + {} + }; + + static u3j_harm _143_qua__here_fun_a[] = {{".2", u3we_here_fun}, {}}; + static u3j_core _143_qua__here_d[] = + { { "fun", _143_qua__here_fun_a }, + {} + }; + + static u3j_harm _143_qua__just_fun_a[] = {{".2", u3we_just_fun}, {}}; + static u3j_core _143_qua__just_d[] = + { { "fun", _143_qua__just_fun_a }, + {} + }; + + static u3j_harm _143_qua__mask_fun_a[] = {{".2", u3we_mask_fun}, {}}; + static u3j_core _143_qua__mask_d[] = + { { "fun", _143_qua__mask_fun_a }, + {} + }; + + static u3j_harm _143_qua__shim_fun_a[] = {{".2", u3we_shim_fun}, {}}; + static u3j_core _143_qua__shim_d[] = + { { "fun", _143_qua__shim_fun_a }, + {} + }; + + static u3j_harm _143_qua__stag_fun_a[] = {{".2", u3we_stag_fun}, {}}; + static u3j_core _143_qua__stag_d[] = + { { "fun", _143_qua__stag_fun_a }, + {} + }; + + static u3j_harm _143_qua__stew_fun_a[] = {{".2", u3we_stew_fun}, {}}; + static u3j_core _143_qua__stew_d[] = + { { "fun", _143_qua__stew_fun_a }, + {} + }; + + static u3j_harm _143_qua__stir_fun_a[] = {{".2", u3we_stir_fun}, {}}; + static u3j_core _143_qua__stir_d[] = + { { "fun", _143_qua__stir_fun_a }, + {} + }; + + static u3j_harm _143_qua_pfix_a[] = {{".2", u3we_pfix}, {}}; + static u3j_harm _143_qua_plug_a[] = {{".2", u3we_plug}, {}}; + static u3j_harm _143_qua_pose_a[] = {{".2", u3we_pose}, {}}; + static u3j_harm _143_qua_sfix_a[] = {{".2", u3we_sfix}, {}}; + + static u3j_harm _143_qua_mink_a[] = {{".2", u3we_mink}, {}}; + static u3j_harm _143_qua_mule_a[] = {{".2", u3we_mule}, {}}; + +static u3j_core _143_qua_d[] = + { { "pen", 0, _143_pen_d }, + + { "po", 0, _143_qua__po_d }, + + { "trip", _143_qua_trip_a }, + + { "bend", 0, _143_qua__bend_d }, + { "cold", 0, _143_qua__cold_d }, + { "comp", 0, _143_qua__comp_d }, + { "cook", 0, _143_qua__cook_d }, + { "easy", 0, _143_qua__easy_d }, + { "glue", 0, _143_qua__glue_d }, + { "here", 0, _143_qua__here_d }, + { "just", 0, _143_qua__just_d }, + { "mask", 0, _143_qua__mask_d }, + { "shim", 0, _143_qua__shim_d }, + { "stag", 0, _143_qua__stag_d }, + { "stew", 0, _143_qua__stew_d }, + { "stir", 0, _143_qua__stir_d }, + + { "pfix", _143_qua_pfix_a }, + { "plug", _143_qua_plug_a }, + { "pose", _143_qua_pose_a }, + { "sfix", _143_qua_sfix_a }, + + { "mink", _143_qua_mink_a }, + { "mule", _143_qua_mule_a }, {} }; -static u3j_core _mood__hoon_d[] = - { { "add", _mood__hoon_add_a }, - { "dec", _mood__hoon_dec_a }, - { "div", _mood__hoon_div_a }, - { "gte", _mood__hoon_gte_a }, - { "gth", _mood__hoon_gth_a }, - { "lte", _mood__hoon_lte_a }, - { "lth", _mood__hoon_lth_a }, - { "mod", _mood__hoon_mod_a }, - { "mul", _mood__hoon_mul_a }, - { "sub", _mood__hoon_sub_a }, -#if 1 - { "bind", _mood__hoon_bind_a }, - { "clap", _mood__hoon_clap_a }, - { "drop", _mood__hoon_drop_a }, - { "flop", _mood__hoon_flop_a }, - { "lent", _mood__hoon_lent_a }, - { "levy", _mood__hoon_levy_a }, - { "lien", _mood__hoon_lien_a }, - { "murn", _mood__hoon_murn_a }, - { "need", _mood__hoon_need_a }, - { "reap", _mood__hoon_reap_a }, - { "reel", _mood__hoon_reel_a }, - { "roll", _mood__hoon_roll_a }, - { "skid", _mood__hoon_skid_a }, - { "skim", _mood__hoon_skim_a }, - { "skip", _mood__hoon_skip_a }, - { "scag", _mood__hoon_scag_a }, - { "slag", _mood__hoon_slag_a }, - { "snag", _mood__hoon_snag_a }, -// { "sort", _mood__hoon_sort_a }, - { "turn", _mood__hoon_turn_a }, - { "weld", _mood__hoon_weld_a }, +/* layer three +*/ + static u3j_harm _143_tri__cofl__drg_a[] = {{".2", u3wef_drg}, {}}; + static u3j_harm _143_tri__cofl__lug_a[] = {{".2", u3wef_lug}, {}}; + static u3j_core _143_tri__cofl_d[] = + { { "drg", _143_tri__cofl__drg_a }, + { "lug", _143_tri__cofl__lug_a }, + {} + }; - { "bex", _mood__hoon_bex_a }, - { "xeb", _mood__hoon_xeb_a }, - { "can", _mood__hoon_can_a }, - { "cap", _mood__hoon_cap_a }, - { "cat", _mood__hoon_cat_a }, - { "con", _mood__hoon_con_a }, - { "cut", _mood__hoon_cut_a }, - { "dis", _mood__hoon_dis_a }, - { "dor", _mood__hoon_dor_a }, - { "dvr", _mood__hoon_dvr_a }, - { "end", _mood__hoon_end_a }, - { "gor", _mood__hoon_gor_a }, - { "hor", _mood__hoon_hor_a }, - { "lsh", _mood__hoon_lsh_a }, - { "mas", _mood__hoon_mas_a }, - { "met", _mood__hoon_met_a }, - { "mix", _mood__hoon_mix_a }, - { "mug", _mood__hoon_mug_a }, - { "muk", _mood__hoon_muk_a }, - { "peg", _mood__hoon_peg_a }, - { "pow", _mood__hoon_pow_a }, - { "rap", _mood__hoon_rap_a }, - { "rep", _mood__hoon_rep_a }, - { "rip", _mood__hoon_rip_a }, - { "rsh", _mood__hoon_rsh_a }, - { "sqt", _mood__hoon_sqt_a }, - { "vor", _mood__hoon_vor_a }, + static u3j_harm _143_tri__rd_add_a[] = {{".2", u3wer_add}, {}}; + static u3j_harm _143_tri__rd_sub_a[] = {{".2", u3wer_sub}, {}}; + static u3j_harm _143_tri__rd_mul_a[] = {{".2", u3wer_mul}, {}}; + static u3j_harm _143_tri__rd_div_a[] = {{".2", u3wer_div}, {}}; + static u3j_harm _143_tri__rd_sqt_a[] = {{".2", u3wer_sqt}, {}}; + static u3j_harm _143_tri__rd_fma_a[] = {{".2", u3wer_fma}, {}}; + static u3j_harm _143_tri__rd_lth_a[] = {{".2", u3wer_lth}, {}}; + static u3j_harm _143_tri__rd_lte_a[] = {{".2", u3wer_lte}, {}}; + static u3j_harm _143_tri__rd_equ_a[] = {{".2", u3wer_equ}, {}}; + static u3j_harm _143_tri__rd_gte_a[] = {{".2", u3wer_gte}, {}}; + static u3j_harm _143_tri__rd_gth_a[] = {{".2", u3wer_gth}, {}}; + static u3j_core _143_tri__rd_d[] = + { { "add", _143_tri__rd_add_a }, + { "sub", _143_tri__rd_sub_a }, + { "mul", _143_tri__rd_mul_a }, + { "div", _143_tri__rd_div_a }, + { "sqt", _143_tri__rd_sqt_a }, + { "fma", _143_tri__rd_fma_a }, + { "lth", _143_tri__rd_lth_a }, + { "lte", _143_tri__rd_lte_a }, + { "equ", _143_tri__rd_equ_a }, + { "gte", _143_tri__rd_gte_a }, + { "gth", _143_tri__rd_gth_a }, + {} + }; + static u3j_harm _143_tri__rs_add_a[] = {{".2", u3wet_add}, {}}; + static u3j_harm _143_tri__rs_sub_a[] = {{".2", u3wet_sub}, {}}; + static u3j_harm _143_tri__rs_mul_a[] = {{".2", u3wet_mul}, {}}; + static u3j_harm _143_tri__rs_div_a[] = {{".2", u3wet_div}, {}}; + static u3j_harm _143_tri__rs_sqt_a[] = {{".2", u3wet_sqt}, {}}; + static u3j_harm _143_tri__rs_fma_a[] = {{".2", u3wet_fma}, {}}; + static u3j_harm _143_tri__rs_lth_a[] = {{".2", u3wet_lth}, {}}; + static u3j_harm _143_tri__rs_lte_a[] = {{".2", u3wet_lte}, {}}; + static u3j_harm _143_tri__rs_equ_a[] = {{".2", u3wet_equ}, {}}; + static u3j_harm _143_tri__rs_gte_a[] = {{".2", u3wet_gte}, {}}; + static u3j_harm _143_tri__rs_gth_a[] = {{".2", u3wet_gth}, {}}; + static u3j_core _143_tri__rs_d[] = + { { "add", _143_tri__rs_add_a }, + { "sub", _143_tri__rs_sub_a }, + { "mul", _143_tri__rs_mul_a }, + { "div", _143_tri__rs_div_a }, + { "sqt", _143_tri__rs_sqt_a }, + { "fma", _143_tri__rs_fma_a }, + { "lth", _143_tri__rs_lth_a }, + { "lte", _143_tri__rs_lte_a }, + { "equ", _143_tri__rs_equ_a }, + { "gte", _143_tri__rs_gte_a }, + { "gth", _143_tri__rs_gth_a }, + {} + }; - { "po", 0, _mood__hoon__po_d }, + static u3j_harm _143_tri__rq_add_a[] = {{".2", u3weq_add}, {}}; + static u3j_harm _143_tri__rq_sub_a[] = {{".2", u3weq_sub}, {}}; + static u3j_harm _143_tri__rq_mul_a[] = {{".2", u3weq_mul}, {}}; + static u3j_harm _143_tri__rq_div_a[] = {{".2", u3weq_div}, {}}; + static u3j_harm _143_tri__rq_sqt_a[] = {{".2", u3weq_sqt}, {}}; + static u3j_harm _143_tri__rq_fma_a[] = {{".2", u3weq_fma}, {}}; + static u3j_harm _143_tri__rq_lth_a[] = {{".2", u3weq_lth}, {}}; + static u3j_harm _143_tri__rq_lte_a[] = {{".2", u3weq_lte}, {}}; + static u3j_harm _143_tri__rq_equ_a[] = {{".2", u3weq_equ}, {}}; + static u3j_harm _143_tri__rq_gte_a[] = {{".2", u3weq_gte}, {}}; + static u3j_harm _143_tri__rq_gth_a[] = {{".2", u3weq_gth}, {}}; + static u3j_core _143_tri__rq_d[] = + { { "add", _143_tri__rq_add_a }, + { "sub", _143_tri__rq_sub_a }, + { "mul", _143_tri__rq_mul_a }, + { "div", _143_tri__rq_div_a }, + { "sqt", _143_tri__rq_sqt_a }, + { "fma", _143_tri__rq_fma_a }, + { "lth", _143_tri__rq_lth_a }, + { "lte", _143_tri__rq_lte_a }, + { "equ", _143_tri__rq_equ_a }, + { "gte", _143_tri__rq_gte_a }, + { "gth", _143_tri__rq_gth_a }, + {} + }; - { "by", 0, _mood__hoon__by_d }, - { "in", 0, _mood__hoon__in_d }, + static u3j_harm _143_tri__rh_add_a[] = {{".2", u3wes_add}, {}}; + static u3j_harm _143_tri__rh_sub_a[] = {{".2", u3wes_sub}, {}}; + static u3j_harm _143_tri__rh_mul_a[] = {{".2", u3wes_mul}, {}}; + static u3j_harm _143_tri__rh_div_a[] = {{".2", u3wes_div}, {}}; + static u3j_harm _143_tri__rh_sqt_a[] = {{".2", u3wes_sqt}, {}}; + static u3j_harm _143_tri__rh_fma_a[] = {{".2", u3wes_fma}, {}}; + static u3j_harm _143_tri__rh_lth_a[] = {{".2", u3wes_lth}, {}}; + static u3j_harm _143_tri__rh_lte_a[] = {{".2", u3wes_lte}, {}}; + static u3j_harm _143_tri__rh_equ_a[] = {{".2", u3wes_equ}, {}}; + static u3j_harm _143_tri__rh_gte_a[] = {{".2", u3wes_gte}, {}}; + static u3j_harm _143_tri__rh_gth_a[] = {{".2", u3wes_gth}, {}}; + static u3j_core _143_tri__rh_d[] = + { { "add", _143_tri__rh_add_a }, + { "sub", _143_tri__rh_sub_a }, + { "mul", _143_tri__rh_mul_a }, + { "div", _143_tri__rh_div_a }, + { "sqt", _143_tri__rh_sqt_a }, + { "fma", _143_tri__rh_fma_a }, + { "lth", _143_tri__rh_lth_a }, + { "lte", _143_tri__rh_lte_a }, + { "equ", _143_tri__rh_equ_a }, + { "gte", _143_tri__rh_gte_a }, + { "gth", _143_tri__rh_gth_a }, + {} + }; - { "cue", _mood__hoon_cue_a }, - { "jam", _mood__hoon_jam_a }, - { "mat", _mood__hoon_mat_a }, - { "rub", _mood__hoon_rub_a }, - { "lore", _mood__hoon_lore_a }, - { "loss", _mood__hoon_loss_a }, - { "lune", _mood__hoon_lune_a }, - { "mink", _mood__hoon_mink_a }, - { "mule", _mood__hoon_mule_a }, - { "trip", _mood__hoon_trip_a }, + static u3j_harm _143_tri__aesc_en_a[] = {{".2", u3wea_en}, {}}; + static u3j_harm _143_tri__aesc_de_a[] = {{".2", u3wea_de}, {}}; + static u3j_core _143_tri__aesc_d[] = + { { "en", _143_tri__aesc_en_a }, + { "de", _143_tri__aesc_de_a }, + {} + }; - { "aesc", 0, _mood__hoon__aesc_d }, - { "bend", 0, _mood__hoon__bend_d }, - { "cold", 0, _mood__hoon__cold_d }, - { "comp", 0, _mood__hoon__comp_d }, - { "cook", 0, _mood__hoon__cook_d }, - { "easy", 0, _mood__hoon__easy_d }, - { "coed", 0, _mood__hoon__coed_d }, - { "glue", 0, _mood__hoon__glue_d }, - { "here", 0, _mood__hoon__here_d }, - { "just", 0, _mood__hoon__just_d }, - { "mask", 0, _mood__hoon__mask_d }, - { "shim", 0, _mood__hoon__shim_d }, - { "stag", 0, _mood__hoon__stag_d }, - { "stew", 0, _mood__hoon__stew_d }, - { "stir", 0, _mood__hoon__stir_d }, + static u3j_harm _143_tri__og_raw_a[] = {{".2", u3weo_raw}, {}}; + static u3j_core _143_tri__og_d[] = + { { "raw", _143_tri__og_raw_a }, + {} + }; - { "cofl", 0, _mood__hoon__cofl_d }, - { "rd", 0, _mood__hoon__rd_d }, - { "rs", 0, _mood__hoon__rs_d }, - { "rq", 0, _mood__hoon__rq_d }, - { "og", 0, _mood__hoon__og_d }, - { "coed", 0, _mood__hoon__coed_d }, - { "scr", 0, _mood__hoon__scr_d }, + static u3j_harm _143_tri_shax_a[] = {{".2", u3we_shax}, {}}; + static u3j_harm _143_tri_shay_a[] = {{".2", u3we_shay}, {}}; + static u3j_harm _143_tri_shas_a[] = {{".2", u3we_shas}, {}}; + static u3j_harm _143_tri_shal_a[] = {{".2", u3we_shal}, {}}; - { "pfix", _mood__hoon_pfix_a }, - { "plug", _mood__hoon_plug_a }, - { "pose", _mood__hoon_pose_a }, - { "sfix", _mood__hoon_sfix_a }, +static u3j_core _143_tri_d[] = + { { "qua", 0, _143_qua_d }, - { "shax", _mood__hoon_shax_a }, - { "shay", _mood__hoon_shay_a }, - { "shas", _mood__hoon_shas_a }, - { "shal", _mood__hoon_shal_a }, + { "cofl", 0, _143_tri__cofl_d }, + { "rd", 0, _143_tri__rd_d }, + { "rs", 0, _143_tri__rs_d }, + { "rq", 0, _143_tri__rq_d }, + { "rh", 0, _143_tri__rh_d }, + { "og", 0, _143_tri__og_d }, + { "shax", _143_tri_shax_a }, + { "shay", _143_tri_shay_a }, + { "shas", _143_tri_shas_a }, + { "shal", _143_tri_shal_a }, + { "aesc", 0, _143_tri__aesc_d }, - { "cell", _mood__hoon_cell_a }, - { "comb", _mood__hoon_comb_a }, - { "cons", _mood__hoon_cons_a }, - { "core", _mood__hoon_core_a }, - { "face", _mood__hoon_face_a }, - { "fitz", _mood__hoon_fitz_a }, - { "flan", _mood__hoon_flan_a }, - { "flip", _mood__hoon_flip_a }, - { "flor", _mood__hoon_flor_a }, - { "fork", _mood__hoon_fork_a }, - { "hike", _mood__hoon_hike_a }, - { "look", _mood__hoon_look_a }, - - // { "ap", _mood__hoon__ap_a }, - // { "al", _mood__hoon__al_a }, - { "ut", _mood__hoon__ut_a, _mood__hoon__ut_d }, - { "arvo", 0, _arvo_d }, -#endif {} }; -static u3j_core _mood_d[] = - { { "hoon", 0, _mood__hoon_d }, - {} +/* layer two +*/ + static u3j_harm _143_two_flop_a[] = {{".2", u3wb_flop, c3y}, {}}; + static u3j_harm _143_two_lent_a[] = {{".2", u3wb_lent, c3y}, {}}; + static u3j_harm _143_two_levy_a[] = {{".2", u3wb_levy, c3y}, {}}; + static u3j_harm _143_two_lien_a[] = {{".2", u3wb_lien, c3y}, {}}; + static u3j_harm _143_two_murn_a[] = {{".2", u3wb_murn, c3y}, {}}; + static u3j_harm _143_two_need_a[] = {{".2", u3wb_need, c3y}, {}}; + static u3j_harm _143_two_reap_a[] = {{".2", u3wb_reap, c3y}, {}}; + static u3j_harm _143_two_reel_a[] = {{".2", u3wb_reel, c3y}, {}}; + static u3j_harm _143_two_roll_a[] = {{".2", u3wb_roll, c3y}, {}}; + static u3j_harm _143_two_skid_a[] = {{".2", u3wb_skid, c3y}, {}}; + static u3j_harm _143_two_skim_a[] = {{".2", u3wb_skim, c3y}, {}}; + static u3j_harm _143_two_skip_a[] = {{".2", u3wb_skip, c3y}, {}}; + static u3j_harm _143_two_scag_a[] = {{".2", u3wb_scag, c3y}, {}}; + static u3j_harm _143_two_slag_a[] = {{".2", u3wb_slag, c3y}, {}}; + static u3j_harm _143_two_snag_a[] = {{".2", u3wb_snag, c3y}, {}}; + // static u3j_harm _143_two_sort_a[] = {{".2", u3wb_sort, c3y}, {}}; + static u3j_harm _143_two_turn_a[] = {{".2", u3wb_turn, c3y}, {}}; + static u3j_harm _143_two_weld_a[] = {{".2", u3wb_weld, c3y}, {}}; + + static u3j_harm _143_two_bex_a[] = {{".2", u3wc_bex, c3y}, {}}; + static u3j_harm _143_two_xeb_a[] = {{".2", u3wc_xeb, c3y}, {}}; + static u3j_harm _143_two_can_a[] = {{".2", u3wc_can, c3y}, {}}; + static u3j_harm _143_two_cat_a[] = {{".2", u3wc_cat, c3y}, {}}; + static u3j_harm _143_two_cut_a[] = {{".2", u3wc_cut, c3y}, {}}; + static u3j_harm _143_two_end_a[] = {{".2", u3wc_end, c3y}, {}}; + static u3j_harm _143_two_lsh_a[] = {{".2", u3wc_lsh, c3y}, {}}; + static u3j_harm _143_two_met_a[] = {{".2", u3wc_met, c3y}, {}}; + static u3j_harm _143_two_rap_a[] = {{".2", u3wc_rap, c3y}, {}}; + static u3j_harm _143_two_rip_a[] = {{".2", u3wc_rip, c3y}, {}}; + static u3j_harm _143_two_rsh_a[] = {{".2", u3wc_rsh, c3y}, {}}; + + static u3j_harm _143_two_con_a[] = {{".2", u3wc_con, c3y}, {}}; + static u3j_harm _143_two_dis_a[] = {{".2", u3wc_dis, c3y}, {}}; + static u3j_harm _143_two_mix_a[] = {{".2", u3wc_mix, c3y}, {}}; + + static u3j_harm _143_two_mug_a[] = {{".2", u3wc_mug, c3y}, {}}; + + static u3j_harm _143_two_dor_a[] = {{".2", u3wc_dor, c3y}, {}}; + static u3j_harm _143_two_gor_a[] = {{".2", u3wc_gor, c3y}, {}}; + static u3j_harm _143_two_hor_a[] = {{".2", u3wc_hor, c3y}, {}}; + static u3j_harm _143_two_vor_a[] = {{".2", u3wc_vor, c3y}, {}}; + + static u3j_harm _143_two_pow_a[] = {{".2", u3wc_pow, c3y}, {}}; + static u3j_harm _143_two_sqt_a[] = {{".2", u3wc_sqt, c3y}, {}}; + + static u3j_harm _143_two__in_bif_a[] = {{".2", u3wdi_bif}, {}}; + static u3j_harm _143_two__in_dif_a[] = {{".2", u3wdi_dif}, {}}; + static u3j_harm _143_two__in_gas_a[] = {{".2", u3wdi_gas}, {}}; + static u3j_harm _143_two__in_has_a[] = {{".2", u3wdi_has}, {}}; + static u3j_harm _143_two__in_mer_a[] = {{".2", u3wdi_mer}, {}}; + // static u3j_harm _143_two__in_int_a[] = {{".2", u3wdi_int}, {}}; + static u3j_harm _143_two__in_put_a[] = {{".2", u3wdi_put}, {}}; + static u3j_harm _143_two__in_tap_a[] = {{".2", u3wdi_tap}, {}}; + static u3j_harm _143_two__in_wyt_a[] = {{".2", u3wdi_wyt}, {}}; + static u3j_harm _143_two__in_uni_a[] = {{".2", u3wdi_uni}, {}}; + static u3j_core _143_two__in_d[] = + { { "bif", _143_two__in_bif_a }, + { "dif", _143_two__in_dif_a }, + { "gas", _143_two__in_gas_a }, + { "has", _143_two__in_has_a }, + { "mer", _143_two__in_mer_a }, + // { "int", _143_two__in_int_a }, + { "put", _143_two__in_put_a }, + { "tap", _143_two__in_tap_a }, + { "wyt", _143_two__in_wyt_a }, + { "uni", _143_two__in_uni_a }, + {} + }; + + static u3j_harm _143_two__by_bif_a[] = {{".2", u3wdb_bif, c3y}, {}}; + static u3j_harm _143_two__by_dif_a[] = {{".2", u3wdb_dif, c3y}, {}}; + static u3j_harm _143_two__by_gas_a[] = {{".2", u3wdb_gas, c3y}, {}}; + static u3j_harm _143_two__by_get_a[] = {{".2", u3wdb_get, c3y}, {}}; + static u3j_harm _143_two__by_has_a[] = {{".2", u3wdb_has, c3y}, {}}; + // static u3j_harm _143_two__by_int_a[] = {{".2", u3wdb_int, c3y}, {}}; + static u3j_harm _143_two__by_put_a[] = {{".2", u3wdb_put, c3y}, {}}; + static u3j_harm _143_two__by_tap_a[] = {{".2", u3wdb_tap, c3y}, {}}; + // static u3j_harm _143_two__by_uni_a[] = {{".2", u3wdb_uni, c3y}, {}}; + static u3j_core _143_two__by_d[] = + { { "bif", _143_two__by_bif_a }, + { "dif", _143_two__by_dif_a }, + { "gas", _143_two__by_gas_a }, + { "get", _143_two__by_get_a }, + { "has", _143_two__by_has_a }, + // { "int", _143_two__by_int_a }, + { "put", _143_two__by_put_a }, + { "tap", _143_two__by_tap_a }, + // { "uni", _143_two__by_uni_a }, + {} + }; + + static u3j_harm _143_two_cue_a[] = {{".2", u3we_cue}, {}}; + static u3j_harm _143_two_jam_a[] = {{".2", u3we_jam}, {}}; + static u3j_harm _143_two_mat_a[] = {{".2", u3we_mat}, {}}; + static u3j_harm _143_two_rub_a[] = {{".2", u3we_rub}, {}}; + +static u3j_core _143_two_d[] = + { { "tri", 0, _143_tri_d }, + { "flop", _143_two_flop_a }, + { "lent", _143_two_lent_a }, + { "levy", _143_two_levy_a }, + { "lien", _143_two_lien_a }, + { "murn", _143_two_murn_a }, + { "need", _143_two_need_a }, + { "reap", _143_two_reap_a }, + { "reel", _143_two_reel_a }, + { "roll", _143_two_roll_a }, + { "skid", _143_two_skid_a }, + { "skim", _143_two_skim_a }, + { "skip", _143_two_skip_a }, + { "scag", _143_two_scag_a }, + { "slag", _143_two_slag_a }, + { "snag", _143_two_snag_a }, +// { "sort", _143_two_sort_a }, + { "turn", _143_two_turn_a }, + { "weld", _143_two_weld_a }, + + { "bex", _143_two_bex_a }, + { "xeb", _143_two_xeb_a }, + { "can", _143_two_can_a }, + { "cat", _143_two_cat_a }, + { "cut", _143_two_cut_a }, + { "end", _143_two_end_a }, + { "lsh", _143_two_lsh_a }, + { "met", _143_two_met_a }, + { "rap", _143_two_rap_a }, + { "rip", _143_two_rip_a }, + { "rsh", _143_two_rsh_a }, + + { "con", _143_two_con_a }, + { "dis", _143_two_dis_a }, + { "mix", _143_two_mix_a }, + + { "mug", _143_two_mug_a }, + + { "dor", _143_two_dor_a }, + { "gor", _143_two_gor_a }, + { "hor", _143_two_hor_a }, + { "vor", _143_two_vor_a }, + + { "pow", _143_two_pow_a }, + { "sqt", _143_two_sqt_a }, + + { "by", 0, _143_two__by_d }, + { "in", 0, _143_two__in_d }, + + { "cue", _143_two_cue_a }, + { "jam", _143_two_jam_a }, + { "mat", _143_two_mat_a }, + { "rub", _143_two_rub_a }, }; -static u3j_core _k151_d[] = - { { "mood", 0, _mood_d }, + +/* layer one +*/ + static u3j_harm _143_one_add_a[] = {{".2", u3wa_add, c3y}, {}}; + static u3j_harm _143_one_dec_a[] = {{".2", u3wa_dec, c3y}, {}}; + static u3j_harm _143_one_div_a[] = {{".2", u3wa_div, c3y}, {}}; + static u3j_harm _143_one_dvr_a[] = {{".2", u3wc_dvr, c3y}, {}}; + static u3j_harm _143_one_gte_a[] = {{".2", u3wa_gte, c3y}, {}}; + static u3j_harm _143_one_gth_a[] = {{".2", u3wa_gth, c3y}, {}}; + static u3j_harm _143_one_lte_a[] = {{".2", u3wa_lte, c3y}, {}}; + static u3j_harm _143_one_lth_a[] = {{".2", u3wa_lth, c3y}, {}}; + static u3j_harm _143_one_mod_a[] = {{".2", u3wa_mod, c3y}, {}}; + static u3j_harm _143_one_mul_a[] = {{".2", u3wa_mul, c3y}, {}}; + static u3j_harm _143_one_sub_a[] = {{".2", u3wa_sub, c3y}, {}}; + + static u3j_harm _143_one_cap_a[] = {{".2", u3wc_cap, c3y}, {}}; + static u3j_harm _143_one_peg_a[] = {{".2", u3wc_peg, c3y}, {}}; + static u3j_harm _143_one_mas_a[] = {{".2", u3wc_mas, c3y}, {}}; + +static u3j_core _143_one_d[] = + { { "two", 0, _143_two_d }, + { "add", _143_one_add_a }, + { "dec", _143_one_dec_a }, + { "div", _143_one_div_a }, + { "dvr", _143_one_dvr_a }, + { "gte", _143_one_gte_a }, + { "gth", _143_one_gth_a }, + { "lte", _143_one_lte_a }, + { "lth", _143_one_lth_a }, + { "mod", _143_one_mod_a }, + { "mul", _143_one_mul_a }, + { "sub", _143_one_sub_a }, + + { "cap", _143_one_cap_a }, + { "mas", _143_one_mas_a }, + { "peg", _143_one_peg_a }, + + {} + }; +u3j_core _k143_d[] = + { { "one", 0, _143_one_d }, {} }; -extern u3j_core _k143_d[]; static u3j_core _d[] = { { "k143", 0, _k143_d}, - { "k151", 0, _k151_d}, {} }; diff --git a/mets/a/add.c b/mets/a/add.c deleted file mode 100644 index fb87d62667..0000000000 --- a/mets/a/add.c +++ /dev/null @@ -1,56 +0,0 @@ -/* j/1/add.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3ga_add(u3_atom a, - u3_atom b) - { - if ( _(u3a_is_cat(a)) && _(u3a_is_cat(b)) ) { - c3_w c = a + b; - - return u3i_words(1, &c); - } - else if ( 0 == a ) { - return u3k(b); - } - else { - mpz_t a_mp, b_mp; - - u3r_mp(a_mp, a); - u3r_mp(b_mp, b); - - mpz_add(a_mp, a_mp, b_mp); - mpz_clear(b_mp); - - return u3i_mp(a_mp); - } - } - u3_noun - u3ya_add(u3_noun cor) - { - u3_noun a, b; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) || - (c3n == u3ud(a)) || - (c3n == u3ud(b) && a != 0) ) - { - return u3m_bail(c3__exit); - } else { - return u3ga_add(a, b); - } - } - - u3_noun - u3la_add(u3_noun a, - u3_noun b) - { - u3_noun c = u3ga_add(a, b); - - u3z(a); u3z(b); - return c; - } diff --git a/mets/a/dec.c b/mets/a/dec.c deleted file mode 100644 index cd8a0f64f1..0000000000 --- a/mets/a/dec.c +++ /dev/null @@ -1,47 +0,0 @@ -/* j/1/dec.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3ga_inc(u3_atom a) - { - return u3i_vint(u3k(a)); - } - - u3_noun - u3ga_dec(u3_atom a) - { - if ( 0 == a ) { - return u3m_error("decrement-underflow"); - } - else { - if ( _(u3a_is_cat(a)) ) { - return a - 1; - } - else { - mpz_t a_mp; - - u3r_mp(a_mp, a); - mpz_sub_ui(a_mp, a_mp, 1); - - return u3i_mp(a_mp); - } - } - } - u3_noun - u3ya_dec(u3_noun cor) - { - u3_noun a; - - if ( (u3_none == (a = u3r_at(u3x_sam, cor))) || - (c3n == u3ud(a)) ) - { - return u3m_bail(c3__exit); - } else { - return u3ga_dec(a); - } - } diff --git a/mets/a/div.c b/mets/a/div.c deleted file mode 100644 index 4936c739b0..0000000000 --- a/mets/a/div.c +++ /dev/null @@ -1,46 +0,0 @@ -/* j/1/div.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3ga_div(u3_atom a, - u3_atom b) - { - if ( 0 == b ) { - return u3m_bail(c3__exit); - } - else { - if ( _(u3a_is_cat(a)) && _(u3a_is_cat(b)) ) { - return a / b; - } - else { - mpz_t a_mp, b_mp; - - u3r_mp(a_mp, a); - u3r_mp(b_mp, b); - - mpz_tdiv_q(a_mp, a_mp, b_mp); - mpz_clear(b_mp); - - return u3i_mp(a_mp); - } - } - } - u3_noun - u3ya_div(u3_noun cor) - { - u3_noun a, b; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) || - (c3n == u3ud(a)) || - (c3n == u3ud(b)) ) - { - return u3m_bail(c3__exit); - } else { - return u3ga_div(a, b); - } - } diff --git a/mets/a/gte.c b/mets/a/gte.c deleted file mode 100644 index 0baae9b6aa..0000000000 --- a/mets/a/gte.c +++ /dev/null @@ -1,44 +0,0 @@ -/* j/1/gte.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3ga_gte(u3_atom a, - u3_atom b) - { - if ( _(u3a_is_cat(a)) && _(u3a_is_cat(b)) ) { - return __(a >= b); - } - else { - mpz_t a_mp, b_mp; - u3_noun cmp; - - u3r_mp(a_mp, a); - u3r_mp(b_mp, b); - - cmp = (mpz_cmp(a_mp, b_mp) >= 0) ? c3y : c3n; - - mpz_clear(a_mp); - mpz_clear(b_mp); - - return cmp; - } - } - u3_noun - u3ya_gte(u3_noun cor) - { - u3_noun a, b; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) || - (c3n == u3ud(a)) || - (c3n == u3ud(b)) ) - { - return u3m_bail(c3__exit); - } else { - return u3ga_gte(a, b); - } - } diff --git a/mets/a/gth.c b/mets/a/gth.c deleted file mode 100644 index a22f7a20a7..0000000000 --- a/mets/a/gth.c +++ /dev/null @@ -1,54 +0,0 @@ -/* j/1/gth.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3ga_gth(u3_atom a, - u3_atom b) - { - if ( _(u3a_is_cat(a)) && _(u3a_is_cat(b)) ) { - return __(a > b); - } - else { - mpz_t a_mp, b_mp; - u3_noun cmp; - - u3r_mp(a_mp, a); - u3r_mp(b_mp, b); - - cmp = (mpz_cmp(a_mp, b_mp) > 0) ? c3y : c3n; - - mpz_clear(a_mp); - mpz_clear(b_mp); - - return cmp; - } - } - u3_noun - u3ya_gth(u3_noun cor) - { - u3_noun a, b; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) || - (c3n == u3ud(a)) || - (c3n == u3ud(b)) ) - { - return u3m_bail(c3__exit); - } else { - return u3ga_gth(a, b); - } - } - - u3_noun - u3la_gth(u3_noun a, - u3_noun b) - { - u3_noun c = u3ga_gth(a, b); - - u3z(a); u3z(b); - return c; - } diff --git a/mets/a/lte.c b/mets/a/lte.c deleted file mode 100644 index 86f8bf9d3d..0000000000 --- a/mets/a/lte.c +++ /dev/null @@ -1,53 +0,0 @@ -/* j/1/lte.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3ga_lte(u3_atom a, - u3_atom b) - { - if ( _(u3a_is_cat(a)) && _(u3a_is_cat(b)) ) { - return __(a <= b); - } - else { - mpz_t a_mp, b_mp; - u3_noun cmp; - - u3r_mp(a_mp, a); - u3r_mp(b_mp, b); - - cmp = (mpz_cmp(a_mp, b_mp) <= 0) ? c3y : c3n; - - mpz_clear(a_mp); - mpz_clear(b_mp); - - return cmp; - } - } - u3_noun - u3ya_lte(u3_noun cor) - { - u3_noun a, b; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) || - (c3n == u3ud(a)) || - (c3n == u3ud(b)) ) - { - return u3m_bail(c3__exit); - } else { - return u3ga_lte(a, b); - } - } - u3_noun - u3la_lte(u3_noun a, - u3_noun b) - { - u3_noun c = u3ga_lte(a, b); - - u3z(a); u3z(b); - return c; - } diff --git a/mets/a/lth.c b/mets/a/lth.c deleted file mode 100644 index 9e1dab8d4c..0000000000 --- a/mets/a/lth.c +++ /dev/null @@ -1,50 +0,0 @@ -/* j/1/lth.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3ga_lth(u3_atom a, - u3_atom b) - { - if ( _(u3a_is_cat(a)) && _(u3a_is_cat(b)) ) { - return __(a < b); - } - else if ( 0 == a ) { - return c3y; - } - else if ( 0 == b ) { - return c3n; - } - else { - mpz_t a_mp, b_mp; - u3_noun cmp; - - u3r_mp(a_mp, a); - u3r_mp(b_mp, b); - - cmp = (mpz_cmp(a_mp, b_mp) < 0) ? c3y : c3n; - - mpz_clear(a_mp); - mpz_clear(b_mp); - - return cmp; - } - } - u3_noun - u3ya_lth(u3_noun cor) - { - u3_noun a, b; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) || - (c3n == u3ud(b) && a != 0) || - (c3n == u3ud(a) && b != 0) ) - { - return u3m_bail(c3__exit); - } else { - return u3ga_lth(a, b); - } - } diff --git a/mets/a/mod.c b/mets/a/mod.c deleted file mode 100644 index d90d5cd5b9..0000000000 --- a/mets/a/mod.c +++ /dev/null @@ -1,48 +0,0 @@ -/* j/1/mod.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3ga_mod(u3_atom a, - u3_atom b) - { -#if 0 - if ( b == 3 && a == 2684227708 ) { - printf("dword at 0x27ff84ff8 is %" PRIu64 "\r\n", *(c3_d *)0x27ff84ff8); - *(c3_d *)0x27ff84ff8 = 25; - printf("see, we modified it\r\n"); - } -#endif - if ( 0 == b ) { - return u3m_bail(c3__exit); - } else { - mpz_t a_mp, b_mp; - - u3r_mp(a_mp, a); - u3r_mp(b_mp, b); - - mpz_tdiv_r(a_mp, a_mp, b_mp); - mpz_clear(b_mp); - - return u3i_mp(a_mp); - } - } - - u3_noun - u3ya_mod(u3_noun cor) - { - u3_noun a, b; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) || - (c3n == u3ud(a)) || - (c3n == u3ud(b)) ) - { - return u3m_bail(c3__exit); - } else { - return u3ga_mod(a, b); - } - } diff --git a/mets/a/mul.c b/mets/a/mul.c deleted file mode 100644 index 4ac9a4e136..0000000000 --- a/mets/a/mul.c +++ /dev/null @@ -1,56 +0,0 @@ -/* j/1/mul.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3ga_mul(u3_atom a, - u3_atom b) - { - if ( _(u3a_is_cat(a)) && _(u3a_is_cat(b)) ) { - c3_d c = ((c3_d) a) * ((c3_d) b); - - return u3i_chubs(1, &c); - } - else if ( 0 == a ) { - return 0; - } - else { - mpz_t a_mp, b_mp; - - u3r_mp(a_mp, a); - u3r_mp(b_mp, b); - - mpz_mul(a_mp, a_mp, b_mp); - mpz_clear(b_mp); - - return u3i_mp(a_mp); - } - } - u3_noun - u3ya_mul(u3_noun cor) - { - u3_noun a, b; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) || - (c3n == u3ud(a)) || - (c3n == u3ud(b) && a != 0) ) - { - return u3m_bail(c3__exit); - } else { - return u3ga_mul(a, b); - } - } - u3_noun - u3la_mul(u3_noun a, - u3_noun b) - { - u3_noun c = u3ga_mul(a, b); - - u3z(a); u3z(b); - return c; - } - diff --git a/mets/a/sub.c b/mets/a/sub.c deleted file mode 100644 index f7901d5733..0000000000 --- a/mets/a/sub.c +++ /dev/null @@ -1,64 +0,0 @@ -/* j/1/sub.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3ga_sub(u3_atom a, - u3_atom b) - { - if ( _(u3a_is_cat(a)) && _(u3a_is_cat(b)) ) { - if ( a < b ) { - return u3m_error("subtract-underflow"); - } - else return (a - b); - } - else if ( 0 == b ) { - return u3k(a); - } - else { - mpz_t a_mp, b_mp; - - u3r_mp(a_mp, a); - u3r_mp(b_mp, b); - - if ( mpz_cmp(a_mp, b_mp) < 0 ) { - mpz_clear(a_mp); - mpz_clear(b_mp); - - return u3m_error("subtract-underflow"); - } - mpz_sub(a_mp, a_mp, b_mp); - mpz_clear(b_mp); - - return u3i_mp(a_mp); - } - } - - u3_noun - u3ya_sub(u3_noun cor) - { - u3_noun a, b; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) || - (c3n == u3ud(b)) || - (c3n == u3ud(a) && b != 0) ) - { - return u3m_bail(c3__exit); - } else { - return u3ga_sub(a, b); - } - } - - u3_noun - u3la_sub(u3_noun a, - u3_noun b) - { - u3_noun c = u3ga_sub(a, b); - - u3z(a); u3z(b); - return c; - } diff --git a/mets/b/bind.c b/mets/b/bind.c deleted file mode 100644 index a24c9e5396..0000000000 --- a/mets/b/bind.c +++ /dev/null @@ -1,30 +0,0 @@ -/* j/2/bind.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gb_bind(u3_noun a, - u3_noun b) - { - if ( 0 == a ) { - return 0; - } else { - return u3nc(0, u3n_slam_on(u3k(b), u3k(u3t(a)))); - } - } - u3_noun - u3yb_bind(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 u3gb_bind(a, b); - } - } - diff --git a/mets/b/clap.c b/mets/b/clap.c deleted file mode 100644 index 4618f4fe73..0000000000 --- a/mets/b/clap.c +++ /dev/null @@ -1,36 +0,0 @@ -/* j/2/clap.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gb_clap(u3_noun a, - u3_noun b, - u3_noun c) - { - if ( 0 == a ) { - return u3k(b); - } - else if ( 0 == b ) { - return u3k(a); - } - else { - return u3nc(0, u3n_slam_on(u3k(c), u3nc(u3k(u3t(a)), u3k(u3t(b))))); - } - } - u3_noun - u3yb_clap(u3_noun cor) - { - u3_noun a, b, c; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, - u3x_sam_6, &b, - u3x_sam_7, &c, 0) ) { - return u3m_bail(c3__exit); - } else { - return u3gb_clap(a, b, c); - } - } diff --git a/mets/b/drop.c b/mets/b/drop.c deleted file mode 100644 index 700880e347..0000000000 --- a/mets/b/drop.c +++ /dev/null @@ -1,30 +0,0 @@ -/* j/2/drop.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gb_drop(u3_noun a) - { - if ( 0 == a ) { - return u3_nul; - } - else { - return u3nc(0, u3k(u3t(a))); - } - } - u3_noun - u3yb_drop(u3_noun cor) - { - u3_noun a; - - if ( u3_none == (a = u3r_at(u3x_sam, cor)) ) { - return u3_none; - } else { - return u3gb_drop(a); - } - } - diff --git a/mets/b/flop.c b/mets/b/flop.c deleted file mode 100644 index 34758d331e..0000000000 --- a/mets/b/flop.c +++ /dev/null @@ -1,48 +0,0 @@ -/* j/2/flop.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gb_flop(u3_noun a) - { - u3_noun b = 0; - - while ( 1 ) { - if ( u3_nul == a ) { - return b; - } - else if ( c3n == u3du(a) ) { - u3z(b); - - return u3m_bail(c3__exit); - } - else { - b = u3nc(u3k(u3h(a)), b); - a = u3t(a); - } - } - } - u3_noun - u3yb_flop(u3_noun cor) - { - u3_noun a; - - if ( u3_none == (a = u3r_at(u3x_sam, cor)) ) { - return u3m_bail(c3__exit); - } else { - return u3gb_flop(a); - } - } - u3_noun - u3lb_flop(u3_noun a) - { - u3_noun b = u3gb_flop(a); - - u3z(a); - return b; - } - diff --git a/mets/b/lent.c b/mets/b/lent.c deleted file mode 100644 index ba6afc65f7..0000000000 --- a/mets/b/lent.c +++ /dev/null @@ -1,47 +0,0 @@ -/* j/2/lent.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gb_lent(u3_noun a) - { - u3_noun len = 0; - - while ( 1 ) { - if ( 0 == a ) { - return len; - } - else if ( c3n == u3du(a) ) { - u3z(len); - return u3m_bail(c3__exit); - } - else { - len = u3i_vint(len); - a = u3t(a); - } - } - } - u3_noun - u3yb_lent(u3_noun cor) - { - u3_noun a; - - if ( u3_none == (a = u3r_at(u3x_sam, cor)) ) { - return u3m_bail(c3__exit); - } else { - return u3gb_lent(a); - } - } - u3_noun - u3lb_lent(u3_noun a) - { - u3_noun b = u3gb_lent(a); - - u3z(a); - return b; - } - diff --git a/mets/b/levy.c b/mets/b/levy.c deleted file mode 100644 index ebc76ebeac..0000000000 --- a/mets/b/levy.c +++ /dev/null @@ -1,39 +0,0 @@ -/* j/2/levy.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gb_levy(u3_noun a, - u3_noun b) - { - if ( 0 == a ) { - return c3y; - } else { - u3_noun loz; - - if ( c3n == u3du(a) ) { - return u3m_bail(c3__exit); - } - else switch ( (loz = u3n_slam_on(u3k(b), u3k(u3h(a)))) ) { - case c3y: return u3gb_levy(u3t(a), b); - case c3n: return c3n; - default: u3z(loz); - return u3m_bail(c3__exit); - } - } - } - u3_noun - u3yb_levy(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 u3gb_levy(a, b); - } - } diff --git a/mets/b/lien.c b/mets/b/lien.c deleted file mode 100644 index 4c7da27f5d..0000000000 --- a/mets/b/lien.c +++ /dev/null @@ -1,39 +0,0 @@ -/* j/2/lien.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gb_lien(u3_noun a, - u3_noun b) - { - if ( 0 == a ) { - return c3n; - } else { - u3_noun loz; - - if ( c3n == u3du(a) ) { - return u3m_bail(c3__exit); - } - else switch ( (loz = u3n_slam_on(u3k(b), u3k(u3h(a)))) ) { - case c3y: return c3y; - case c3n: return u3gb_lien(u3t(a), b); - default: u3z(loz); - return u3m_bail(c3__exit); - } - } - } - u3_noun - u3yb_lien(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 u3gb_lien(a, b); - } - } diff --git a/mets/b/murn.c b/mets/b/murn.c deleted file mode 100644 index 5522fa96dd..0000000000 --- a/mets/b/murn.c +++ /dev/null @@ -1,46 +0,0 @@ -/* j/2/murn.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gb_murn(u3_noun a, u3_noun b) - { - if ( 0 == a ) { - return a; - } - else if ( c3n == u3du(a) ) { - return u3m_bail(c3__exit); - } - else { - u3_noun one = u3n_slam_on(u3k(b), u3k(u3h(a))); - u3_noun two = u3gb_murn(u3t(a), b); - u3_noun nex; - - switch ( u3ud(one) ) { - case c3y: u3z(one); - return two; - case c3n: nex = u3nc(u3k(u3t(one)), two); - u3z(one); - return nex; - default: u3z(one); - u3z(two); - return u3_none; - } - } - } - u3_noun - u3yb_murn(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 u3gb_murn(a, b); - } - } - diff --git a/mets/b/need.c b/mets/b/need.c deleted file mode 100644 index 3fbd480927..0000000000 --- a/mets/b/need.c +++ /dev/null @@ -1,30 +0,0 @@ -/* j/2/need.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gb_need(u3_noun a) - { - if ( 0 == a ) { - return u3m_bail(c3__exit); - } - else { - return u3k(u3t(a)); - } - } - u3_noun - u3yb_need(u3_noun cor) - { - u3_noun a; - - if ( u3_none == (a = u3r_at(u3x_sam, cor)) ) { - return u3m_bail(c3__exit); - } else { - return u3gb_need(a); - } - } - diff --git a/mets/b/reap.c b/mets/b/reap.c deleted file mode 100644 index b713bfe8ad..0000000000 --- a/mets/b/reap.c +++ /dev/null @@ -1,41 +0,0 @@ -/* j/2/reap.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gb_reap(u3_atom a, - u3_noun b) - { - if ( !_(u3a_is_cat(a)) ) { - return u3m_bail(c3__fail); - } - else { - u3_noun acc = u3_nul; - c3_w i_w = a; - - while ( i_w ) { - acc = u3nc(u3k(b), acc); - i_w--; - } - - return acc; - } - } - - u3_noun - u3yb_reap(u3_noun cor) - { - u3_noun a, b; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) || - (c3n == u3ud(a)) ) - { - return u3m_bail(c3__exit); - } else { - return u3gb_reap(a, b); - } - } diff --git a/mets/b/reel.c b/mets/b/reel.c deleted file mode 100644 index bb6521c113..0000000000 --- a/mets/b/reel.c +++ /dev/null @@ -1,36 +0,0 @@ -/* j/2/reel.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gb_reel(u3_noun a, - u3_noun b) - { - if ( 0 == a ) { - return u3k(u3r_at(u3x_sam_3, b)); - } - else if ( c3n == u3du(a) ) { - return u3m_bail(c3__exit); - } - else { - u3_noun gim = u3k(u3h(a)); - u3_noun hur = u3gb_reel(u3t(a), b); - - return u3n_slam_on(u3k(b), u3nc(gim, hur)); - } - } - u3_noun - u3yb_reel(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 u3gb_reel(a, b); - } - } diff --git a/mets/b/roll.c b/mets/b/roll.c deleted file mode 100644 index 7f65a2ee03..0000000000 --- a/mets/b/roll.c +++ /dev/null @@ -1,46 +0,0 @@ -/* j/2/roll.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gb_roll(u3_noun a, - u3_noun b) - { - if ( 0 == a ) { - return u3k(u3r_at(u3x_sam_3, b)); - } - else if ( c3n == u3du(a) ) { - return u3m_bail(c3__exit); - } - else { - u3_noun gim = u3k(u3h(a)); - u3_noun zor = u3k(u3r_at(u3x_sam_3, b)); - u3_noun daz = u3n_slam_on(u3k(b), u3nc(gim, zor)); - u3_noun vel = u3i_molt(u3k(b), u3x_sam_3, daz, 0); - - if ( u3_none == vel ) { - return u3m_bail(c3__exit); - } else { - u3_noun hox = u3gb_roll(u3t(a), vel); - - u3z(vel); - return hox; - } - } - } - u3_noun - u3yb_roll(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 u3gb_roll(a, b); - } - } - diff --git a/mets/b/scag.c b/mets/b/scag.c deleted file mode 100644 index 3580e4410c..0000000000 --- a/mets/b/scag.c +++ /dev/null @@ -1,52 +0,0 @@ -/* j/2/scag.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gb_scag(u3_atom a, - u3_noun b) - { - if ( u3_nul == b ) { - return u3_nul; - } - else if ( !_(u3a_is_cat(a)) ) { - return u3m_bail(c3__fail); - } - else { - u3_noun acc = u3_nul; - c3_w i_w = a; - - if ( !i_w ) - return u3_nul; - - while ( i_w ) { - if ( c3n == u3du(b) ) { - return u3lb_flop(acc); - } - acc = u3nc(u3k(u3h(b)), acc); - b = u3t(b); - i_w--; - } - - return u3lb_flop(acc); - } - } - - u3_noun - u3yb_scag(u3_noun cor) - { - u3_noun a, b; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) || - (c3n == u3ud(a) && u3_nul != b) ) - { - return u3m_bail(c3__exit); - } else { - return u3gb_scag(a, b); - } - } - diff --git a/mets/b/skid.c b/mets/b/skid.c deleted file mode 100644 index 153a660cbc..0000000000 --- a/mets/b/skid.c +++ /dev/null @@ -1,44 +0,0 @@ -/* j/2/skid.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gb_skid(u3_noun a, - u3_noun b) - { - if ( 0 == a ) { - return u3nc(u3_nul, u3_nul); - } - else if ( c3n == u3du(a) ) { - return u3m_bail(c3__exit); - } else { - u3_noun acc = u3gb_skid(u3t(a), b); - u3_noun hoz = u3n_slam_on(u3k(b), u3k(u3h(a))); - - switch ( hoz ) { - case c3y: acc = u3nc(u3nc(u3k(u3h(a)), u3h(acc)), u3t(acc)); - break; - case c3n: acc = u3nc(u3h(acc), u3nc(u3k(u3h(a)), u3t(acc))); - break; - default: u3z(hoz); - return u3m_bail(c3__exit); - } - u3z(hoz); - return acc; - } - } - u3_noun - u3yb_skid(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 u3gb_skid(a, b); - } - } diff --git a/mets/b/skim.c b/mets/b/skim.c deleted file mode 100644 index e6e74f1ba1..0000000000 --- a/mets/b/skim.c +++ /dev/null @@ -1,43 +0,0 @@ -/* j/2/skim.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gb_skim(u3_noun a, - u3_noun b) - { - if ( 0 == a ) { - return a; - } - else if ( c3n == u3du(a) ) { - return u3m_bail(c3__exit); - } else { - u3_noun hoz = u3n_slam_on(u3k(b), u3k(u3h(a))); - u3_noun vyr = u3gb_skim(u3t(a), b); - - switch ( hoz ) { - case c3y: return u3nc(u3k(u3h(a)), vyr); - case c3n: return vyr; - default: u3z(hoz); - u3z(vyr); - return u3m_bail(c3__exit); - } - } - } - u3_noun - u3yb_skim( - 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 u3gb_skim(a, b); - } - } - diff --git a/mets/b/skip.c b/mets/b/skip.c deleted file mode 100644 index d22f25455a..0000000000 --- a/mets/b/skip.c +++ /dev/null @@ -1,42 +0,0 @@ -/* j/2/skip.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gb_skip(u3_noun a, - u3_noun b) - { - if ( 0 == a ) { - return a; - } - else if ( c3n == u3du(a) ) { - return u3_none; - } else { - u3_noun hoz = u3n_slam_on(u3k(b), u3k(u3h(a))); - u3_noun vyr = u3gb_skip(u3t(a), b); - - switch ( hoz ) { - case c3y: return vyr; - case c3n: return u3nc(u3k(u3h(a)), vyr); - default: u3z(hoz); - u3z(vyr); - return u3_none; - } - } - } - u3_noun - u3yb_skip(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) ) { - return u3_none; - } else { - return u3gb_skip(a, b); - } - } - diff --git a/mets/b/slag.c b/mets/b/slag.c deleted file mode 100644 index 989c993199..0000000000 --- a/mets/b/slag.c +++ /dev/null @@ -1,43 +0,0 @@ -/* j/2/slag.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gb_slag(u3_atom a, u3_noun b) - { - if ( u3_nul == b ) { - return u3_nul; - } - else if ( !_(u3a_is_cat(a)) ) { - return u3m_bail(c3__fail); - } - else { - c3_w len_w = a; - - while ( len_w ) { - if ( c3n == u3du(b) ) { - return u3_nul; - } - b = u3t(b); - len_w--; - } - return u3k(b); - } - } - u3_noun - u3yb_slag(u3_noun cor) - { - u3_noun a, b; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) || - (c3n == u3ud(a) && u3_nul != b) ) - { - return u3m_bail(c3__exit); - } else { - return u3gb_slag(a, b); - } - } diff --git a/mets/b/snag.c b/mets/b/snag.c deleted file mode 100644 index af93e40ff9..0000000000 --- a/mets/b/snag.c +++ /dev/null @@ -1,44 +0,0 @@ -/* j/2/snag.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gb_snag(u3_atom a, - u3_noun b) - { - if ( !_(u3a_is_cat(a)) ) { - return u3m_bail(c3__fail); - } - else { - c3_w len_w = a; - - while ( len_w ) { - if ( c3n == u3du(b) ) { - return u3m_bail(c3__exit); - } - b = u3t(b); - len_w--; - } - if ( c3n == u3du(b) ) { - return u3m_bail(c3__exit); - } - return u3k(u3h(b)); - } - } - u3_noun - u3yb_snag(u3_noun cor) - { - u3_noun a, b; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) || - (c3n == u3ud(a)) ) - { - return u3m_bail(c3__exit); - } else { - return u3gb_snag(a, b); - } - } diff --git a/mets/b/sort.c b/mets/b/sort.c deleted file mode 100644 index bb940380a2..0000000000 --- a/mets/b/sort.c +++ /dev/null @@ -1,28 +0,0 @@ -/* j/2/sort.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gb_sort(u3_noun a, - u3_noun b) - { - // must think about - // - return u3m_bail(c3__fail); - } - u3_noun - u3yb_sort(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 u3gb_sort(a, b); - } - } - diff --git a/mets/b/turn.c b/mets/b/turn.c deleted file mode 100644 index ad0fd6ea05..0000000000 --- a/mets/b/turn.c +++ /dev/null @@ -1,36 +0,0 @@ -/* j/2/turn.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gb_turn(u3_noun a, u3_noun b) - { - if ( 0 == a ) { - return a; - } - else if ( c3n == u3du(a) ) { - return u3m_bail(c3__exit); - } - else { - u3_noun one = u3n_slam_on(u3k(b), u3k(u3h(a))); - u3_noun two = u3gb_turn(u3t(a), b); - - return u3nc(one, two); - } - } - u3_noun - u3yb_turn(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 u3gb_turn(a, b); - } - } - diff --git a/mets/b/weld.c b/mets/b/weld.c deleted file mode 100644 index ff9410ddc2..0000000000 --- a/mets/b/weld.c +++ /dev/null @@ -1,43 +0,0 @@ -/* j/2/weld.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gb_weld(u3_noun a, - u3_noun b) - { - if ( 0 == a ) { - return u3k(b); - } - else if ( c3n == u3du(a) ) { - return u3m_bail(c3__exit); - } - else { - return u3nc(u3k(u3h(a)), u3gb_weld(u3t(a), b)); - } - } - u3_noun - u3yb_weld(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 u3gb_weld(a, b); - } - } - u3_noun - u3lb_weld(u3_noun a, - u3_noun b) - { - u3_noun c = u3gb_weld(a, b); - - u3z(a); u3z(b); - return c; - } - diff --git a/mets/c/bex.c b/mets/c/bex.c deleted file mode 100644 index fceadf9585..0000000000 --- a/mets/c/bex.c +++ /dev/null @@ -1,37 +0,0 @@ -/* j/3/bex.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gc_bex(u3_atom a) - { - mpz_t a_mp; - - if ( !_(u3a_is_cat(a)) ) { - return u3m_bail(c3__fail); - } - else { - mpz_init_set_ui(a_mp, 1); - mpz_mul_2exp(a_mp, a_mp, a); - - return u3i_mp(a_mp); - } - } - u3_noun - u3yc_bex(u3_noun cor) - { - u3_noun a; - - if ( (u3_none == (a = u3r_at(u3x_sam, cor))) || - (c3n == u3ud(a)) ) - { - return u3m_bail(c3__exit); - } else { - return u3gc_bex(a); - } - } - diff --git a/mets/c/can.c b/mets/c/can.c deleted file mode 100644 index 7207e187e5..0000000000 --- a/mets/c/can.c +++ /dev/null @@ -1,84 +0,0 @@ -/* j/3/can.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gc_can(u3_atom a, - u3_noun b) - { - if ( !_(u3a_is_cat(a)) || (a >= 32) ) { - return u3m_bail(c3__fail); - } - else { - c3_g a_g = a; - c3_w tot_w = 0; - c3_w* sal_w; - - /* Measure and validate the slab required. - */ - { - u3_noun cab = b; - - while ( 1 ) { - u3_noun i_cab, pi_cab, qi_cab; - - if ( 0 == cab ) { - break; - } - if ( c3n == u3du(cab) ) return u3m_bail(c3__fail); - i_cab = u3h(cab); - if ( c3n == u3du(i_cab) ) return u3m_bail(c3__fail); - pi_cab = u3h(i_cab); - qi_cab = u3t(i_cab); - if ( c3n == u3a_is_cat(pi_cab) ) return u3m_bail(c3__fail); - if ( c3n == u3ud(qi_cab) ) return u3m_bail(c3__fail); - if ( (tot_w + pi_cab) < tot_w ) return u3m_bail(c3__fail); - - tot_w += pi_cab; - cab = u3t(cab); - } - if ( 0 == tot_w ) { - return 0; - } - if ( 0 == (sal_w = u3a_slaq(a_g, tot_w)) ) { - return u3m_bail(c3__fail); - } - } - - /* Chop the list atoms in. - */ - { - u3_noun cab = b; - c3_w pos_w = 0; - - while ( 0 != cab ) { - u3_noun i_cab = u3h(cab); - u3_atom pi_cab = u3h(i_cab); - u3_atom qi_cab = u3t(i_cab); - - u3r_chop(a_g, 0, pi_cab, pos_w, sal_w, qi_cab); - pos_w += pi_cab; - cab = u3t(cab); - } - } - return u3a_malt(sal_w); - } - } - u3_noun - u3yc_can(u3_noun cor) - { - u3_noun a, b; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) || - (c3n == u3ud(a)) ) - { - return u3m_bail(c3__fail); - } else { - return u3gc_can(a, b); - } - } - diff --git a/mets/c/cap.c b/mets/c/cap.c deleted file mode 100644 index 2fa592cfe4..0000000000 --- a/mets/c/cap.c +++ /dev/null @@ -1,36 +0,0 @@ -/* j/3/cap.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gc_cap(u3_atom a) - { - c3_w met_w = u3r_met(0, a); - - if ( met_w < 2 ) { - return u3m_bail(c3__exit); - } - else if ( (1 == u3r_bit((met_w - 2), a)) ) { - return 3; - } else { - return 2; - } - } - u3_noun - u3yc_cap(u3_noun cor) - { - u3_noun a; - - if ( (u3_none == (a = u3r_at(u3x_sam, cor))) || - (c3n == u3ud(a)) ) - { - return u3m_bail(c3__exit); - } else { - return u3gc_cap(a); - } - } - diff --git a/mets/c/cat.c b/mets/c/cat.c deleted file mode 100644 index 8e5bd410a9..0000000000 --- a/mets/c/cat.c +++ /dev/null @@ -1,58 +0,0 @@ -/* j/3/cat.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gc_cat(u3_atom a, - u3_atom b, - u3_atom c) - { - if ( !_(u3a_is_cat(a)) || (a >= 32) ) { - return u3m_bail(c3__fail); - } - else { - c3_g a_g = a; - c3_w lew_w = u3r_met(a_g, b); - c3_w ler_w = u3r_met(a_g, c); - c3_w all_w = (lew_w + ler_w); - - if ( 0 == all_w ) { - return 0; - } else { - c3_w* sal_w = u3a_slaq(a_g, all_w); - - if ( 0 == sal_w ) { - return u3m_bail(c3__fail); - } - else { - u3r_chop(a_g, 0, lew_w, 0, sal_w, b); - u3r_chop(a_g, 0, ler_w, lew_w, sal_w, c); - } - // return u3a_moot(sal_w); - return u3a_malt(sal_w); - } - } - } - - u3_noun - u3yc_cat(u3_noun cor) - { - u3_noun a, b, c; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, - u3x_sam_6, &b, - u3x_sam_7, &c, 0)) || - (c3n == u3ud(a)) || - (c3n == u3ud(b)) || - (c3n == u3ud(c)) ) - { - return u3m_bail(c3__exit); - } else { - return u3gc_cat(a, b, c); - } - } - diff --git a/mets/c/con.c b/mets/c/con.c deleted file mode 100644 index d0e9658583..0000000000 --- a/mets/c/con.c +++ /dev/null @@ -1,51 +0,0 @@ -/* j/3/con.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gc_con(u3_atom a, - u3_atom b) - { - c3_w lna_w = u3r_met(5, a); - c3_w lnb_w = u3r_met(5, b); - - if ( (lna_w == 0) && (lnb_w == 0) ) { - return 0; - } else { - c3_w len_w = c3_max(lna_w, lnb_w); - c3_w* sal_w = u3a_slab(len_w); - - if ( 0 == sal_w ) { - return u3m_bail(c3__fail); - } - else { - c3_w i_w; - - u3r_chop(5, 0, lna_w, 0, sal_w, a); - - for ( i_w = 0; i_w < lnb_w; i_w++ ) { - sal_w[i_w] |= u3r_word(i_w, b); - } - // return u3a_moot(sal_w); - return u3a_malt(sal_w); - } - } - } - u3_noun - u3yc_con(u3_noun cor) - { - u3_noun a, b; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) || - (c3n == u3ud(a)) || - (c3n == u3ud(b)) ) - { - return u3m_bail(c3__exit); - } else { - return u3gc_con(a, b); - } - } diff --git a/mets/c/cut.c b/mets/c/cut.c deleted file mode 100644 index 62f93c96b7..0000000000 --- a/mets/c/cut.c +++ /dev/null @@ -1,71 +0,0 @@ -/* j/3/cut.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gc_cut(u3_atom a, - u3_atom b, - u3_atom c, - u3_atom d) - { - if ( !_(u3a_is_cat(a)) || (a >= 32) ) { - return u3m_bail(c3__fail); - } - if ( !_(u3a_is_cat(b)) ) { - return 0; - } - if ( !_(u3a_is_cat(c)) ) { - c = 0x7fffffff; - } - - { - c3_g a_g = a; - c3_w b_w = b; - c3_w c_w = c; - c3_w len_w = u3r_met(a_g, d); - - if ( (0 == c_w) || (b_w >= len_w) ) { - return 0; - } - if ( b_w + c_w > len_w ) { - c_w = (len_w - b_w); - } - if ( (b_w == 0) && (c_w == len_w) ) { - return u3k(d); - } - else { - c3_w* sal_w = u3a_slaq(a_g, c_w); - - if ( 0 == sal_w ) { - return u3m_bail(c3__fail); - } - u3r_chop(a_g, b_w, c_w, 0, sal_w, d); - - return u3a_malt(sal_w); - } - } - } - u3_noun - u3yc_cut(u3_noun cor) - { - u3_noun a, b, c, d; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, - u3x_sam_12, &b, - u3x_sam_13, &c, - u3x_sam_7, &d, 0)) || - (c3n == u3ud(a)) || - (c3n == u3ud(b)) || - (c3n == u3ud(c)) || - (c3n == u3ud(d)) ) - { - return u3m_bail(c3__exit); - } else { - return u3gc_cut(a, b, c, d); - } - } - diff --git a/mets/c/dis.c b/mets/c/dis.c deleted file mode 100644 index b405f31c8a..0000000000 --- a/mets/c/dis.c +++ /dev/null @@ -1,51 +0,0 @@ -/* j/3/dis.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gc_dis(u3_atom a, - u3_atom b) - { - c3_w lna_w = u3r_met(5, a); - c3_w lnb_w = u3r_met(5, b); - - if ( (lna_w == 0) && (lnb_w == 0) ) { - return 0; - } else { - c3_w len_w = c3_max(lna_w, lnb_w); - c3_w* sal_w = u3a_slab(len_w); - - if ( 0 == sal_w ) { - return u3m_bail(c3__fail); - } - else { - c3_w i_w; - - u3r_chop(5, 0, lna_w, 0, sal_w, a); - - for ( i_w = 0; i_w < len_w; i_w++ ) { - sal_w[i_w] &= (i_w >= lnb_w) ? 0 : u3r_word(i_w, b); - } - return u3a_malt(sal_w); - } - } - } - u3_noun - u3yc_dis(u3_noun cor) - { - u3_noun a, b; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) || - (c3n == u3ud(a)) || - (c3n == u3ud(b)) ) - { - return u3m_bail(c3__exit); - } else { - return u3gc_dis(a, b); - } - } - diff --git a/mets/c/dor.c b/mets/c/dor.c deleted file mode 100644 index 8f3334288a..0000000000 --- a/mets/c/dor.c +++ /dev/null @@ -1,49 +0,0 @@ -/* j/3/dor.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gc_dor(u3_atom a, - u3_atom b) - { - if ( c3y == u3r_sing(a, b) ) { - return c3y; - } - else { - if ( c3y == u3ud(a) ) { - if ( c3y == u3ud(b) ) { - return u3ga_lth(a, b); - } - else { - return c3y; - } - } - else { - if ( c3y == u3ud(b) ) { - return c3n; - } - else { - if ( c3y == u3r_sing(u3h(a), u3h(b)) ) { - return u3gc_dor(u3t(a), u3t(b)); - } - else return u3gc_dor(u3h(a), u3h(b)); - } - } - } - } - u3_noun - u3yc_dor(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 u3gc_dor(a, b); - } - } - diff --git a/mets/c/dvr.c b/mets/c/dvr.c deleted file mode 100644 index 6e1707f6cd..0000000000 --- a/mets/c/dvr.c +++ /dev/null @@ -1,45 +0,0 @@ -/* j/3/dvr.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gc_dvr(u3_atom a, - u3_atom b) - { - if ( 0 == b) { - return u3m_bail(c3__exit); - } - else { - if ( _(u3a_is_cat(a)) && _(u3a_is_cat(b)) ) { - return u3nc(a / b, a % b); - } - else { - mpz_t a_mp, b_mp; - - u3r_mp(a_mp, a); - u3r_mp(b_mp, b); - - mpz_tdiv_qr(a_mp, b_mp, a_mp, b_mp); - - return u3nc(u3k(u3i_mp(a_mp)), u3k(u3i_mp(b_mp))); - } - } - } - u3_noun - u3yc_dvr(u3_noun cor) - { - u3_noun a, b; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) || - (c3n == u3ud(a)) ) - { - return u3m_bail(c3__exit); - } else { - return u3gc_dvr(a, b); - } - } - diff --git a/mets/c/end.c b/mets/c/end.c deleted file mode 100644 index e16afbf075..0000000000 --- a/mets/c/end.c +++ /dev/null @@ -1,60 +0,0 @@ -/* j/3/end.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gc_end(u3_atom a, - u3_atom b, - u3_atom c) - { - if ( !_(u3a_is_cat(a)) || (a >= 32) ) { - return u3m_bail(c3__fail); - } - else if ( !_(u3a_is_cat(b)) ) { - return u3k(c); - } - else { - c3_g a_g = a; - c3_w b_w = b; - c3_w len_w = u3r_met(a_g, c); - - if ( 0 == b_w ) { - return 0; - } - else if ( b_w >= len_w ) { - return u3k(c); - } - else { - c3_w* sal_w = u3a_slaq(a_g, b_w); - - if ( 0 == sal_w ) { - return u3m_bail(c3__fail); - } - u3r_chop(a_g, 0, b_w, 0, sal_w, c); - - return u3a_malt(sal_w); - } - } - } - u3_noun - u3yc_end(u3_noun cor) - { - u3_noun a, b, c; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, - u3x_sam_6, &b, - u3x_sam_7, &c, 0)) || - (c3n == u3ud(a)) || - (c3n == u3ud(b)) || - (c3n == u3ud(c)) ) - { - return u3m_bail(c3__exit); - } else { - return u3gc_end(a, b, c); - } - } - diff --git a/mets/c/gor.c b/mets/c/gor.c deleted file mode 100644 index 1e46867a12..0000000000 --- a/mets/c/gor.c +++ /dev/null @@ -1,32 +0,0 @@ -/* j/3/gor.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gc_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 u3gc_dor(a, b); - } - else return (c_w < d_w) ? c3y : c3n; - } - u3_noun - u3yc_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 u3gc_gor(a, b); - } - } - diff --git a/mets/c/hor.c b/mets/c/hor.c deleted file mode 100644 index b58f75897f..0000000000 --- a/mets/c/hor.c +++ /dev/null @@ -1,46 +0,0 @@ -/* j/3/hor.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gc_hor(u3_noun a, - u3_noun b) - { - if ( c3y == u3ud(a) ) { - if ( c3y == u3ud(b) ) { - return u3gc_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 u3gc_gor(u3t(a), u3t(b)); - } else { - return u3gc_gor(h_a, h_b); - } - } - } - } - u3_noun - u3yc_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 u3gc_hor(a, b); - } - } - diff --git a/mets/c/lsh.c b/mets/c/lsh.c deleted file mode 100644 index f1d2c706b9..0000000000 --- a/mets/c/lsh.c +++ /dev/null @@ -1,71 +0,0 @@ -/* j/3/lsh.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gc_lsh(u3_atom a, - u3_atom b, - u3_atom c) - { - if ( !_(u3a_is_cat(a)) || (a >= 32) ) { - return u3m_bail(c3__fail); - } - else if ( !_(u3a_is_cat(b)) ) { - return u3m_bail(c3__fail); - } - else { - c3_g a_g = a; - c3_w b_w = b; - c3_w len_w = u3r_met(a_g, c); - - if ( 0 == len_w ) { - return 0; - } - else if ( (b_w + len_w) < len_w ) { - return u3m_bail(c3__exit); - } - else { - c3_w* sal_w = u3a_slaq(a_g, (b_w + len_w)); - - if ( 0 == sal_w ) { - return u3m_bail(c3__fail); - } - u3r_chop(a_g, 0, len_w, b_w, sal_w, c); - - // return u3a_moot(sal_w); - return u3a_malt(sal_w); - } - } - } - u3_noun - u3yc_lsh(u3_noun cor) - { - u3_noun a, b, c; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, - u3x_sam_6, &b, - u3x_sam_7, &c, 0)) || - (c3n == u3ud(a)) || - (c3n == u3ud(b)) || - (c3n == u3ud(c)) ) - { - return u3m_bail(c3__exit); - } else { - return u3gc_lsh(a, b, c); - } - } - u3_noun - u3lc_lsh(u3_noun a, - u3_noun b, - u3_noun c) - { - u3_noun d = u3gc_lsh(a, b, c); - - u3z(a); u3z(b); u3z(c); - return d; - } - diff --git a/mets/c/mas.c b/mets/c/mas.c deleted file mode 100644 index 851a25f6ff..0000000000 --- a/mets/c/mas.c +++ /dev/null @@ -1,45 +0,0 @@ -/* j/3/mas.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gc_mas(u3_atom a) - { - c3_w b_w; - u3_atom c, d, e, f; - - b_w = u3r_met(0, a); - if ( b_w < 2 ) { - return u3m_bail(c3__exit); - } - else { - c = u3gc_bex((b_w - 1)); - d = u3gc_bex((b_w - 2)); - e = u3ga_sub(a, c); - f = u3gc_con(e, d); - - u3z(c); - u3z(d); - u3z(e); - - return f; - } - } - u3_noun - u3yc_mas(u3_noun cor) - { - u3_noun a; - - if ( (u3_none == (a = u3r_at(u3x_sam, cor))) || - (c3n == u3ud(a)) ) - { - return u3m_bail(c3__exit); - } else { - return u3gc_mas(a); - } - } - diff --git a/mets/c/met.c b/mets/c/met.c deleted file mode 100644 index eeecd869f9..0000000000 --- a/mets/c/met.c +++ /dev/null @@ -1,42 +0,0 @@ -/* j/3/met.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gc_met(u3_atom a, - u3_atom b) - { - if ( 0 == b ) { - return 0; - } - else if ( !_(u3a_is_cat(a)) || (a >= 32) ) { - return 1; - } - else { - c3_w met_w = u3r_met(a, b); - - if ( !_(u3a_is_cat(met_w)) ) { - return u3i_words(1, &met_w); - } - else return u3r_met(a, b); - } - } - u3_noun - u3yc_met(u3_noun cor) - { - u3_noun a, b; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) || - (c3n == u3ud(b)) || - (c3n == u3ud(a) && 0 != b) ) - { - return u3m_bail(c3__exit); - } else { - return u3gc_met(a, b); - } - } - diff --git a/mets/c/mix.c b/mets/c/mix.c deleted file mode 100644 index 415f21da54..0000000000 --- a/mets/c/mix.c +++ /dev/null @@ -1,51 +0,0 @@ -/* j/3/mix.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gc_mix(u3_atom a, - u3_atom b) - { - c3_w lna_w = u3r_met(5, a); - c3_w lnb_w = u3r_met(5, b); - - if ( (lna_w == 0) && (lnb_w == 0) ) { - return 0; - } else { - c3_w len_w = c3_max(lna_w, lnb_w); - c3_w* sal_w = u3a_slab(len_w); - - if ( 0 == sal_w ) { - return u3m_bail(c3__fail); - } - else { - c3_w i_w; - - u3r_chop(5, 0, lna_w, 0, sal_w, a); - - for ( i_w = 0; i_w < lnb_w; i_w++ ) { - sal_w[i_w] ^= u3r_word(i_w, b); - } - return u3a_malt(sal_w); - } - } - } - u3_noun - u3yc_mix(u3_noun cor) - { - u3_noun a, b; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) || - (c3n == u3ud(a)) || - (c3n == u3ud(b)) ) - { - return u3m_bail(c3__exit); - } else { - return u3gc_mix(a, b); - } - } - diff --git a/mets/c/mug.c b/mets/c/mug.c deleted file mode 100644 index cadfdd3dd8..0000000000 --- a/mets/c/mug.c +++ /dev/null @@ -1,19 +0,0 @@ -/* j/3/mug.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3yc_mug(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/mets/c/muk.c b/mets/c/muk.c deleted file mode 100644 index 2fb0f0a15e..0000000000 --- a/mets/c/muk.c +++ /dev/null @@ -1,54 +0,0 @@ -/* j/c/muk.c -** -*/ -#include "all.h" -#include - -/* functions -*/ - u3_noun - u3gc_muk(u3_atom seed, - u3_atom len, - u3_atom key) - { - c3_w seed_w; - c3_w len_w; - 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); - - 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 { - key_y = 0; - } - u3r_bytes(0, len, key_y, key); - - MurmurHash3_x86_32(key_y, len, seed_w, &out_w); - - u3a_free(key_y); - return u3i_words(1, &out_w); - } - - u3_noun - u3yc_muk(u3_noun cor) - { - u3_noun seed, len, key; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &seed, - u3x_sam_6, &len, - u3x_sam_7, &key, 0)) || - (c3n == u3ud(seed)) || - (c3n == u3ud(len)) || - (c3n == u3ud(key)) ) - { - return u3m_bail(c3__exit); - } else { - return u3gc_muk(seed, len, key); - } - } diff --git a/mets/c/peg.c b/mets/c/peg.c deleted file mode 100644 index 5731629214..0000000000 --- a/mets/c/peg.c +++ /dev/null @@ -1,50 +0,0 @@ -/* j/3/peg.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gc_peg(u3_atom a, - u3_atom b) - { - if ( 1 == b ) { - return u3k(a); - } - - u3_atom c, d, e, f, g, h; - - c = u3r_met(0, b); - d = u3ga_dec(c); - e = u3gc_lsh(0, d, 1); - f = u3ga_sub(b, e); - g = u3gc_lsh(0, d, a); - h = u3ga_add(f, g); - - u3z(c); - u3z(d); - u3z(e); - u3z(f); - u3z(g); - - return h; - } - u3_noun - u3yc_peg(u3_noun cor) - { - u3_noun a, b; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) || - (0 == a) || - (0 == b) || - (c3n == u3ud(b)) || - (c3n == u3ud(a) && b != 1) ) - { - return u3m_bail(c3__exit); - } else { - return u3gc_peg(a, b); - } - } - diff --git a/mets/c/po.c b/mets/c/po.c deleted file mode 100644 index d69807af51..0000000000 --- a/mets/c/po.c +++ /dev/null @@ -1,104 +0,0 @@ -/* j/3/po.c -** -*/ -#include "all.h" - - - // good old linear search - // - static u3_noun - _po_find(u3_noun buf, - u3_noun a) - { - if ( !_(u3a_is_cat(a)) ) { - return u3_nul; - } - else { - c3_w i_w; - c3_w a_w = a; - - for ( i_w = 0; i_w < 256; i_w++ ) { - c3_y byt_y[3]; - c3_w but_w; - - u3r_bytes((i_w * 3), 3, byt_y, buf); - but_w = (byt_y[0] | (byt_y[1] << 8) | (byt_y[2] << 16)); - - if ( but_w == a_w ) { - return u3nc(u3_nul, i_w); - } - } - return u3_nul; - } - } - - u3_noun - u3ycp_ins(u3_noun cor) - { - u3_noun x, a, buf; - - if ( (c3n == u3r_mean(cor, u3x_sam, &a, u3x_con_sam, &x, 0)) || - (c3n == u3du(x)) || - (c3n == u3ud(buf = u3h(x))) || - (c3n == u3ud(a)) ) - { - return u3m_bail(c3__exit); - } else { - return _po_find(buf, a); - } - } - u3_noun - u3ycp_ind(u3_noun cor) - { - u3_noun x, a, buf; - - if ( (c3n == u3r_mean(cor, u3x_sam, &a, u3x_con_sam, &x, 0)) || - (c3n == u3du(x)) || - (c3n == u3ud(buf = u3t(x))) || - (c3n == u3ud(a)) ) - { - return u3m_bail(c3__exit); - } else { - return _po_find(buf, a); - } - } - - u3_noun - u3ycp_tos(u3_noun cor) - { - u3_noun x, a, buf; - - if ( (c3n == u3r_mean(cor, u3x_sam, &a, u3x_con_sam, &x, 0)) || - (c3n == u3du(x)) || - (c3n == u3ud(buf = u3h(x))) || - (c3n == u3ud(a)) || - (a >= 256) ) - { - return u3m_bail(c3__exit); - } - else { - c3_y byt_y[3]; - - u3r_bytes((a * 3), 3, byt_y, buf); - return (byt_y[0] | (byt_y[1] << 8) | (byt_y[2] << 16)); - } - } - u3_noun - u3ycp_tod(u3_noun cor) - { - u3_noun x, a, buf; - - if ( (c3n == u3r_mean(cor, u3x_sam, &a, u3x_con_sam, &x, 0)) || - (c3n == u3du(x)) || - (c3n == u3ud(buf = u3t(x))) || - (c3n == u3ud(a)) || - (a >= 256) ) - { - return u3m_bail(c3__exit); - } else { - c3_y byt_y[3]; - - u3r_bytes((a * 3), 3, byt_y, buf); - return (byt_y[0] | (byt_y[1] << 8) | (byt_y[2] << 16)); - } - } diff --git a/mets/c/pow.c b/mets/c/pow.c deleted file mode 100644 index ea54cf1eff..0000000000 --- a/mets/c/pow.c +++ /dev/null @@ -1,38 +0,0 @@ -/* j/3/pow.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gc_pow(u3_atom a, - u3_atom b) - { - if ( !_(u3a_is_cat(b)) ) { - return u3m_bail(c3__fail); - } - else { - mpz_t a_mp; - - u3r_mp(a_mp, a); - mpz_pow_ui(a_mp, a_mp, b); - - return u3i_mp(a_mp); - } - } - u3_noun - u3yc_pow(u3_noun cor) - { - u3_noun a, b; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) || - (c3n == u3ud(a)) ) - { - return u3m_bail(c3__exit); - } else { - return u3gc_pow(a, b); - } - } - diff --git a/mets/c/rap.c b/mets/c/rap.c deleted file mode 100644 index 55f0319b5b..0000000000 --- a/mets/c/rap.c +++ /dev/null @@ -1,88 +0,0 @@ -/* j/3/rap.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gc_rap(u3_atom a, - u3_noun b) - { - if ( !_(u3a_is_cat(a)) || (a >= 32) ) { - return u3m_bail(c3__exit); - } - else { - c3_g a_g = a; - c3_w tot_w = 0; - c3_w* sal_w; - - /* Measure and validate the slab required. - */ - { - u3_noun cab = b; - - while ( 1 ) { - u3_noun h_cab; - c3_w len_w; - - if ( 0 == cab ) { - break; - } - else if ( c3n == u3du(cab) ) { - return u3m_bail(c3__exit); - } - else if ( c3n == u3ud(h_cab = u3h(cab)) ) { - return u3m_bail(c3__exit); - } - else if ( (tot_w + (len_w = u3r_met(a_g, h_cab))) < tot_w ) { - return u3m_bail(c3__fail); - } - tot_w += len_w; - cab = u3t(cab); - } - if ( 0 == tot_w ) { - return 0; - } - if ( 0 == (sal_w = u3a_slaq(a_g, tot_w)) ) { - return u3m_bail(c3__fail); - } - } - - /* Chop the list atoms in. - */ - { - u3_noun cab = b; - c3_w pos_w = 0; - - while ( 0 != cab ) { - u3_noun h_cab = u3h(cab); - c3_w len_w = u3r_met(a_g, h_cab); - - u3r_chop(a_g, 0, len_w, pos_w, sal_w, h_cab); - pos_w += len_w; - cab = u3t(cab); - } - } - // return u3a_moot(sal_w); - return u3a_malt(sal_w); - } - } - u3_noun - u3yc_rap(u3_noun cor) - { - u3_noun a, b; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) || - (c3n == u3ud(a)) ) - { - return u3m_bail(c3__exit); - } else { - u3_noun pro; - - pro = u3gc_rap(a, b); - return pro; - } - } - diff --git a/mets/c/rep.c b/mets/c/rep.c deleted file mode 100644 index 0ac040f084..0000000000 --- a/mets/c/rep.c +++ /dev/null @@ -1,87 +0,0 @@ -/* j/3/rep.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gc_rep(u3_atom a, - u3_noun b) - { - if ( !_(u3a_is_cat(a)) || (a >= 32) ) { - return u3m_bail(c3__exit); - } - else { - c3_g a_g = a; - c3_w tot_w = 0; - c3_w* sal_w; - - /* Measure and validate the slab required. - */ - { - u3_noun cab = b; - - while ( 1 ) { - u3_noun h_cab; - c3_w len_w; - - if ( 0 == cab ) { - break; - } - else if ( c3n == u3du(cab) ) { - return u3m_bail(c3__exit); - } - else if ( c3n == u3ud(h_cab = u3h(cab)) ) { - return u3m_bail(c3__exit); - } - else if ( (tot_w + (len_w = u3r_met(a_g, h_cab))) < tot_w ) { - return u3m_bail(c3__fail); - } - tot_w++; - cab = u3t(cab); - } - if ( 0 == tot_w ) { - return 0; - } - if ( 0 == (sal_w = u3a_slaq(a_g, tot_w)) ) { - return u3m_bail(c3__fail); - } - } - - /* Chop the list atoms in. - */ - { - u3_noun cab = b; - c3_w pos_w = 0; - - while ( 0 != cab ) { - u3_noun h_cab = u3h(cab); - - u3r_chop(a_g, 0, 1, pos_w, sal_w, h_cab); - pos_w++; - cab = u3t(cab); - } - } - // return u3a_moot(sal_w); - return u3a_malt(sal_w); - } - } - u3_noun - u3yc_rep(u3_noun cor) - { - u3_noun a, b; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) || - (c3n == u3ud(a)) ) - { - return u3m_bail(c3__exit); - } else { - u3_noun pro; - - pro = u3gc_rep(a, b); - return pro; - } - } - diff --git a/mets/c/rip.c b/mets/c/rip.c deleted file mode 100644 index aae5f3e2f8..0000000000 --- a/mets/c/rip.c +++ /dev/null @@ -1,83 +0,0 @@ -/* j/3/rip.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gc_rip(u3_atom a, - u3_atom b) - { - if ( !_(u3a_is_cat(a)) || (a >= 32) ) { - return u3m_bail(c3__fail); - } - else { - u3_noun pir = u3_nul; - c3_g a_g = a; - c3_w i_w; - - if ( a_g < 5 ) { - c3_w met_w = u3r_met(a_g, b); - c3_w mek_w = ((1 << (1 << a_g)) - 1); - - for ( i_w = 0; i_w < met_w; i_w++ ) { - c3_w pat_w = (met_w - (i_w + 1)); - c3_w bit_w = (pat_w << a_g); - c3_w wor_w = (bit_w >> 5); - c3_w sif_w = (bit_w & 31); - c3_w src_w = u3r_word(wor_w, b); - c3_w rip_w = ((src_w >> sif_w) & mek_w); - - pir = u3nc(rip_w, pir); - } - return pir; - } - else { - c3_w met_w = u3r_met(a_g, b); - c3_w len_w = u3r_met(5, b); - c3_g san_g = (a_g - 5); - c3_w san_w = 1 << san_g; - c3_w dif_w = (met_w << san_g) - len_w; - c3_w tub_w = ((dif_w == 0) ? san_w : (san_w - dif_w)); - - for ( i_w = 0; i_w < met_w; i_w++ ) { - c3_w pat_w = (met_w - (i_w + 1)); - c3_w wut_w = (pat_w << san_g); - c3_w sap_w = ((0 == i_w) ? tub_w : san_w); - c3_w* sal_w = u3a_slab(sap_w); - - if ( 0 == sal_w ) { - return u3m_bail(c3__fail); - } else { - c3_w j_w; - u3_atom rip; - - for ( j_w = 0; j_w < sap_w; j_w++ ) { - sal_w[j_w] = u3r_word(wut_w + j_w, b); - } - - rip = u3a_malt(sal_w); - pir = u3nc(rip, pir); - } - len_w -= san_w; - } - } - return pir; - } - } - u3_noun - u3yc_rip(u3_noun cor) - { - u3_noun a, b; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) || - (c3n == u3ud(a)) || - (c3n == u3ud(b)) ) - { - return u3m_bail(c3__exit); - } else { - return u3gc_rip(a, b); - } - } diff --git a/mets/c/rsh.c b/mets/c/rsh.c deleted file mode 100644 index b68693f335..0000000000 --- a/mets/c/rsh.c +++ /dev/null @@ -1,68 +0,0 @@ -/* j/3/rsh.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gc_rsh(u3_atom a, - u3_atom b, - u3_atom c) - { - if ( !_(u3a_is_cat(a)) || (a >= 32) ) { - return u3m_bail(c3__fail); - } - else if ( !_(u3a_is_cat(b)) ) { - return 0; - } - else { - c3_g a_g = a; - c3_w b_w = b; - c3_w len_w = u3r_met(a_g, c); - - if ( b_w >= len_w ) { - return 0; - } - else { - c3_w* sal_w = u3a_slaq(a_g, (len_w - b_w)); - - if ( 0 == sal_w ) { - return u3m_bail(c3__fail); - } - u3r_chop(a_g, b_w, (len_w - b_w), 0, sal_w, c); - - // return u3a_moot(sal_w); - return u3a_malt(sal_w); - } - } - } - u3_noun - u3yc_rsh(u3_noun cor) - { - u3_noun a, b, c; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, - u3x_sam_6, &b, - u3x_sam_7, &c, 0)) || - (c3n == u3ud(a)) || - (c3n == u3ud(b)) || - (c3n == u3ud(c)) ) - { - return u3m_bail(c3__exit); - } else { - return u3gc_rsh(a, b, c); - } - } - u3_noun - u3lc_rsh(u3_noun a, - u3_noun b, - u3_noun c) - { - u3_noun d = u3gc_rsh(a, b, c); - - u3z(a); u3z(b); u3z(c); - return d; - } - diff --git a/mets/c/sqt.c b/mets/c/sqt.c deleted file mode 100644 index d7c9beca8f..0000000000 --- a/mets/c/sqt.c +++ /dev/null @@ -1,33 +0,0 @@ -/* j/3/sqt.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gc_sqt(u3_atom a) - { - mpz_t a_mp, b_mp; - - u3r_mp(a_mp, a); - mpz_init(b_mp); - mpz_sqrtrem(a_mp, b_mp, a_mp); - - return u3nc(u3k(u3i_mp(a_mp)), u3k(u3i_mp(b_mp))); - } - u3_noun - u3yc_sqt(u3_noun cor) - { - u3_noun a; - - if ( (u3_none == (a = u3r_at(u3x_sam, cor))) || - (c3n == u3ud(a)) ) - { - return u3m_bail(c3__exit); - } else { - return u3gc_sqt(a); - } - } - diff --git a/mets/c/vor.c b/mets/c/vor.c deleted file mode 100644 index 586dd4cc49..0000000000 --- a/mets/c/vor.c +++ /dev/null @@ -1,31 +0,0 @@ -/* j/3/vor.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gc_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 u3gc_dor(a, b); - } - else return (c_w < d_w) ? c3y : c3n; - } - u3_noun - u3yc_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 u3gc_vor(a, b); - } - } diff --git a/mets/c/xeb.c b/mets/c/xeb.c deleted file mode 100644 index 915e69a863..0000000000 --- a/mets/c/xeb.c +++ /dev/null @@ -1,42 +0,0 @@ -/* j/3/xeb.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gc_xeb(u3_atom a) - { - mpz_t a_mp; - - if ( __(u3a_is_dog(a)) ) { - u3r_mp(a_mp, a); - c3_d x = mpz_sizeinbase(a_mp, 2); - mpz_t b_mp; - mpz_init_set_ui(b_mp, x); - return u3i_mp(b_mp); - } - else { - mpz_init_set_ui(a_mp, a); - c3_d x = mpz_sizeinbase(a_mp, 2); - mpz_t b_mp; - mpz_init_set_ui(b_mp, x); - return u3i_mp(b_mp); - } - } - u3_noun - u3yc_xeb(u3_noun cor) - { - u3_noun a; - - if ( (u3_none == (a = u3r_at(u3x_sam, cor))) || - (c3n == u3ud(a)) ) - { - return u3m_bail(c3__exit); - } else { - return u3gc_xeb(a); - } - } - diff --git a/mets/d/by_bif.c b/mets/d/by_bif.c deleted file mode 100644 index a3ec692c27..0000000000 --- a/mets/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 == u3gc_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 u3ydb_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 u3gdb_bif(a, b); - } - } - - u3_noun u3gdb_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 u3ldi_bif(u3_noun a, u3_noun b); - */ diff --git a/mets/d/by_dif.c b/mets/d/by_dif.c deleted file mode 100644 index acfe873efe..0000000000 --- a/mets/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 == u3gc_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 u3ydb_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 u3gdb_dif(a, b); - } - } - - u3_noun u3gdb_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 = u3gdb_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 = u3gdb_dif(l_c, l_b); - e = u3gdb_dif(r_c, r_b); - u3z(c); - - return _b_dif_join(d, e); - } - } - } - } - - /* - u3_weak u3ldb_dif(u3_noun a, u3_noun b); - */ diff --git a/mets/d/by_gas.c b/mets/d/by_gas.c deleted file mode 100644 index 8937337ba7..0000000000 --- a/mets/d/by_gas.c +++ /dev/null @@ -1,65 +0,0 @@ -/* j/4/gas.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gdb_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 = u3gdb_put(a, pi_b, qi_b)) ) { - return u3m_bail(c3__exit); - } else { - u3_noun d = u3gdb_gas(c, t_b); - - u3z(c); - return d; - } - } - } - } - } - u3_noun - u3ydb_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 u3gdb_gas(a, b); - } - } - u3_noun - u3ldb_gas(u3_noun a, - u3_noun b) - { - u3_weak c = u3gdb_gas(a, b); - - u3z(a); u3z(b); - if ( u3_none == c ) { - return u3m_bail(c3__exit); - } - else return c; - } - diff --git a/mets/d/by_get.c b/mets/d/by_get.c deleted file mode 100644 index 07d14d30e3..0000000000 --- a/mets/d/by_get.c +++ /dev/null @@ -1,77 +0,0 @@ -/* j/4/by_get.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gdb_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 == u3gc_gor(b, pn_a) ) { - return u3gdb_get(l_a, b); - } - else return u3gdb_get(r_a, b); - } - } - } - } - u3_noun - u3ydb_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 u3gdb_get(a, b); - } - } - u3_weak - u3ldb_get(u3_noun a, - u3_noun b) - { - u3_noun c = u3gdb_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 - u3ldb_got(u3_noun a, - u3_noun b) - { - u3_weak c = u3ldb_get(a, b); - - if ( u3_none == c ) { - return u3m_bail(c3__exit); - } - else return c; - } - diff --git a/mets/d/by_has.c b/mets/d/by_has.c deleted file mode 100644 index 3af45583f4..0000000000 --- a/mets/d/by_has.c +++ /dev/null @@ -1,61 +0,0 @@ -/* j/4/by_has.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gdb_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 == u3gc_gor(b, pn_a) ) { - return u3gdb_has(l_a, b); - } - else return u3gdb_has(r_a, b); - } - } - } - } - u3_noun - u3ydb_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 u3gdb_has(a, b); - } - } - u3_noun - u3ldb_has(u3_noun a, - u3_noun b) - { - u3_weak c = u3gdb_has(a, b); - - u3z(a); u3z(b); - if ( u3_none == c ) { - return u3m_bail(c3__exit); - } - else return c; - } - diff --git a/mets/d/by_int.c b/mets/d/by_int.c deleted file mode 100644 index e484554131..0000000000 --- a/mets/d/by_int.c +++ /dev/null @@ -1,105 +0,0 @@ -/* j/4/by_int.c -** XXX THIS IS DISABLED -** specifically, s/hor/gor/g (already done?) -** and eliminate memory leaks -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gdb_int(u3_noun a, - u3_noun b) - { - if ( u3_nul == a ) { - return u3k(u3_nul); - } - else if ( u3_nul == b ) { - return u3k(u3_nul); - } - else { - u3_noun l_a, n_a, r_a, lr_a, p_n_a, q_n_a; - u3_noun l_b, n_b, r_b, lr_b, p_n_b, q_n_b; - - 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 ( 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 ( c3n == u3r_cell(n_a, &p_n_a, &q_n_a) ) { - return u3m_bail(c3__exit); - } - else if ( c3n == u3r_cell(n_b, &p_n_b, &q_n_b) ) { - return u3m_bail(c3__exit); - } - else if ( c3y == u3gc_vor(p_n_a, p_n_b) ) { - if ( c3y == u3r_sing(p_n_a, p_n_b) ) { - return u3nt( - u3k(n_b), - u3gdb_int(u3k(l_a), u3k(l_b)), - u3gdb_int(u3k(r_a), u3k(r_b))); - } - else if ( c3y == u3gc_gor(p_n_b, p_n_a) ) { - return u3gdb_uni( - u3gdb_int(u3k(l_a), - u3nt(u3k(n_b), - u3k(l_b), - u3k(u3_nul))), - u3gdb_int(u3k(a), - u3k(r_b))); - } - else { - return u3gdb_uni( - u3gdb_int(u3k(r_a), - u3nt(u3k(n_b), - u3k(u3_nul), - u3k(r_b))), - u3gdb_int(u3k(a), - u3k(l_b))); - } - } - else if ( c3y == u3r_sing(p_n_b, p_n_a) ) { - return u3nt( - u3k(n_b), - u3gdb_int(u3k(l_b), u3k(l_a)), - u3gdb_int(u3k(r_b), u3k(r_a))); - } - else if ( c3y == u3gc_gor(p_n_a, p_n_b) ) { - return u3gdb_uni( - u3gdb_int(u3k(l_b), - u3nt(u3k(n_a), - u3k(l_a), - u3k(u3_nul))), - u3gdb_int(u3k(a), - u3k(r_a))); - } - else { - return u3gdb_uni( - u3gdb_int(u3k(r_b), - u3nt(u3k(n_a), - u3k(u3_nul), - u3k(r_a))), - u3gdb_int(u3k(a), - u3k(l_a))); - } - } - } - u3_noun - u3ydb_int(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 u3gdb_int(a, b); - } - } diff --git a/mets/d/by_put.c b/mets/d/by_put.c deleted file mode 100644 index 8265ede28b..0000000000 --- a/mets/d/by_put.c +++ /dev/null @@ -1,117 +0,0 @@ -/* j/4/put.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gdb_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 == u3gc_gor(b, pn_a) ) { - d = u3gdb_put(l_a, b, c); - - if ( c3y == u3gc_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 = u3gdb_put(r_a, b, c); - - if ( c3y == u3gc_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 - u3ydb_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 u3gdb_put(a, b, c); - } - } - u3_weak - u3ldb_put(u3_noun a, - u3_noun b, - u3_noun c) - { - // Bizarre asymmetry in old jets. - // - // (Mysterious comment in old glue code.) - // - u3_noun pro = u3gdb_put(a, b, c); - - u3z(a); u3z(b); u3z(c); - return pro; - } - diff --git a/mets/d/by_uni.c b/mets/d/by_uni.c deleted file mode 100644 index 641c595232..0000000000 --- a/mets/d/by_uni.c +++ /dev/null @@ -1,109 +0,0 @@ -/* j/4/by_uni.c -** XXX THIS IS DISABLED -** specifically, s/hor/gor/g (already done?) -** and eliminate memory leaks -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gdb_uni(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, p_n_a, q_n_a; - u3_noun l_b, n_b, r_b, lr_b, p_n_b, q_n_b; - - 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 ( (c3n == u3r_cell(n_a, &p_n_a, &q_n_a)) ) { - return u3m_bail(c3__exit); - } - else if ( (c3n == u3r_cell(n_b, &p_n_b, &q_n_b)) ) { - return u3m_bail(c3__exit); - } - else 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 == u3gc_vor(p_n_a, p_n_b) ) { - if ( c3y == u3r_sing(p_n_a, p_n_b) ) { - return u3nt(u3k(n_b), - u3gdb_uni(u3k(l_a), - u3k(l_b)), - u3gdb_uni(u3k(r_a), - u3k(r_b))); - } - else if ( c3y == u3gc_gor(p_n_b, p_n_a) ) { - return u3gdb_uni( - u3nt(u3k(n_a), - u3gdb_uni(u3k(l_a), - u3nt(u3k(n_b), - u3k(l_b), - u3k(u3_nul))), - u3k(r_a)), - u3k(r_b)); - } - else { - return u3gdb_uni( - u3nt(u3k(n_a), - u3k(l_a), - u3gdb_uni(u3k(r_a), - u3nt(u3k(n_b), - u3k(u3_nul), - u3k(r_b)))), - u3k(l_b)); - } - } - else if ( c3y == u3r_sing(p_n_b, p_n_a) ) { - return u3nt(u3k(n_b), - u3gdb_uni(u3k(r_b), u3k(r_a)), - u3gdb_uni(u3k(l_b), u3k(l_a))); - } - else if ( c3y == u3gc_gor(p_n_a, p_n_b) ) { - return u3gdb_uni( - u3k(r_a), - u3nt(u3k(n_b), - u3gdb_uni(u3nt(u3k(n_a), - u3k(l_a), - u3k(u3_nul)), - u3k(l_b)), - u3k(r_b))); - } - else { - return u3gdb_uni( - u3k(l_a), - u3nt(u3k(n_b), - u3k(l_b), - u3gdb_uni(u3k(r_b), - u3nt(u3k(n_a), - u3k(u3_nul), - u3k(r_a))))); - } - } - } - u3_noun - u3ydb_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 u3gdb_uni(a, b); - } - } diff --git a/mets/d/in_bif.c b/mets/d/in_bif.c deleted file mode 100644 index 8a23fa9866..0000000000 --- a/mets/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 == u3gc_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 u3ydi_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 u3gdi_bif(a, b); - } - } - - u3_noun u3gdi_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 u3ldi_bif(u3_noun a, u3_noun b); - */ diff --git a/mets/d/in_dif.c b/mets/d/in_dif.c deleted file mode 100644 index 5ddce0778e..0000000000 --- a/mets/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 == u3gc_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 u3ydi_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 u3gdi_dif(a, b); - } - } - - u3_noun u3gdi_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 = u3gdi_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 = u3gdi_dif(l_c, l_b); - e = u3gdi_dif(r_c, r_b); - u3z(c); - - return _i_dif_join(d, e); - } - } - } - } - - /* - u3_weak u3ldi_dif(u3_noun a, u3_noun b); - */ diff --git a/mets/d/in_gas.c b/mets/d/in_gas.c deleted file mode 100644 index 008f52720c..0000000000 --- a/mets/d/in_gas.c +++ /dev/null @@ -1,58 +0,0 @@ -/* j/4/gas.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gdi_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 = u3gdi_put(a, i_b)) ) { - return u3m_bail(c3__exit); - } else { - u3_noun d = u3gdi_gas(c, t_b); - - u3z(c); - return d; - } - } - } - } - u3_noun - u3ydi_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 u3gdi_gas(a, b); - } - } - u3_noun - u3ldi_gas(u3_noun a, - u3_noun b) - { - u3_weak c = u3gdi_gas(a, b); - - u3z(a); u3z(b); - if ( u3_none == c ) { - return u3m_bail(c3__exit); - } - else return c; - } - diff --git a/mets/d/in_has.c b/mets/d/in_has.c deleted file mode 100644 index 2a6b128ceb..0000000000 --- a/mets/d/in_has.c +++ /dev/null @@ -1,58 +0,0 @@ -/* j/4/in_has.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gdi_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 == u3gc_hor(b, n_a) ) { - return u3gdi_has(l_a, b); - } - else return u3gdi_has(r_a, b); - } - } - } - } - u3_noun - u3ydi_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 u3gdi_has(a, b); - } - } - u3_noun - u3ldi_has(u3_noun a, - u3_noun b) - { - u3_weak c = u3gdi_has(a, b); - - u3z(a); u3z(b); - if ( u3_none == c ) { - return u3m_bail(c3__exit); - } - else return c; - } - diff --git a/mets/d/in_int.c b/mets/d/in_int.c deleted file mode 100644 index 00600ccdc9..0000000000 --- a/mets/d/in_int.c +++ /dev/null @@ -1,76 +0,0 @@ -/* j/4/in_int.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gdi_int(u3_noun a, - u3_noun b) - { - if ( u3_nul == a ) { - return u3k(u3_nul); - } - else if ( u3_nul == b ) { - return u3k(u3_nul); - } - else { - u3_noun l_a, n_a, r_a, lr_a; - 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 == u3gc_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), - u3gdi_int(l_a, l_b), - u3gdi_int(r_a, r_b)); - } - else if ( c3y == u3gc_hor(n_b, n_a) ) { - return u3gdi_uni(u3gdi_int(l_a, - u3nt(n_b, - l_b, - u3_nul)), - u3gdi_int(a, - r_b)); - } - else { - return u3gdi_uni(u3gdi_int(r_a, - u3nt(n_b, - u3_nul, - r_b)), - u3gdi_int(a, - l_b)); - } - } - } - } - u3_noun - u3ydi_int(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 u3gdi_int(a, b); - } - } diff --git a/mets/d/in_mer.c b/mets/d/in_mer.c deleted file mode 100644 index 41bcd4853f..0000000000 --- a/mets/d/in_mer.c +++ /dev/null @@ -1,80 +0,0 @@ -/* j/4/in_mer.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gdi_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 == u3gc_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), - u3gdi_mer(l_a, l_b), - u3gdi_mer(r_a, r_b)); - } - else if ( c3y == u3gc_hor(n_b, n_a) ) { - return u3gdi_mer(u3nt(n_a, - u3gdi_mer(l_a, - u3nt(n_b, - l_b, - u3_nul)), - r_a), - r_b); - } - else { - return u3gdi_mer(u3nt(n_a, - l_a, - u3gdi_mer(r_a, - u3nt(n_b, - u3_nul, - r_b))), - l_b); - } - } - } - } - - u3_noun - u3ydi_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 u3gdi_mer(a, b); - } - } diff --git a/mets/d/in_put.c b/mets/d/in_put.c deleted file mode 100644 index cb1c88deba..0000000000 --- a/mets/d/in_put.c +++ /dev/null @@ -1,102 +0,0 @@ -/* j/4/in_put.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gdi_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 == u3gc_hor(b, n_a) ) { - c = u3gdi_put(l_a, b); - - if ( c3y == u3gc_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 = u3gdi_put(r_a, b); - - if ( c3y == u3gc_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 - u3ydi_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 u3gdi_put(a, b); - } - } - u3_weak - u3ldi_put(u3_noun a, - u3_noun b) - { - // Bizarre asymmetry in old jets. - // - // (Mysterious comment in old glue code.) - // - u3_noun pro = u3gdi_put(a, b); - - u3z(a); u3z(b); - return pro; - } - - diff --git a/mets/d/in_tap.c b/mets/d/in_tap.c deleted file mode 100644 index 306532fd1d..0000000000 --- a/mets/d/in_tap.c +++ /dev/null @@ -1,55 +0,0 @@ -/* j/4/in_tap.c -** -*/ -#include "all.h" - - -/* functions -*/ - static u3_noun - _tap_in(u3_noun a, - u3_noun b) - { - if ( u3_nul == a ) { - return b; - } else { - u3_noun l_a, n_a, r_a; - - if ( (c3n == u3r_trel(a, &n_a, &l_a, &r_a)) ) { - u3z(b); - return u3m_bail(c3__exit); - } else { - return _tap_in(r_a, - u3nc(u3k(n_a), - _tap_in(l_a, b))); - } - } - } - - u3_noun - u3gdi_tap(u3_noun a) - { - return _tap_in(a, u3_nul); - } - u3_noun - u3ydi_tap(u3_noun cor) - { - u3_noun a; - - if ( c3n == u3r_mean(cor, u3x_con_sam, &a, 0) ) { - return u3m_bail(c3__exit); - } else { - return u3gdi_tap(a); - } - } - u3_noun - u3ldi_tap(u3_noun a) - { - u3_weak b = u3gdi_tap(a); - - u3z(a); - if ( u3_none == b ) { - return u3m_bail(c3__exit); - } - else return b; - } diff --git a/mets/d/in_uni.c b/mets/d/in_uni.c deleted file mode 100644 index 3291e1217f..0000000000 --- a/mets/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 == u3gc_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 == u3gc_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 == u3gc_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 - u3ldi_uni(u3_noun a, - u3_noun b) - { - u3_noun c = u3gdi_uni(a, b); - - u3z(a); - u3z(b); - return c; - } - - u3_noun - u3gdi_uni(u3_noun a, - u3_noun b) - { - if ( c3y == u3r_sing(a, b) ) { - return u3k(a); - } - else { - return _in_uni(a, b); - } - } - u3_noun - u3ydi_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 u3gdi_uni(a, b); - } - } - diff --git a/mets/d/in_wyt.c b/mets/d/in_wyt.c deleted file mode 100644 index 55634b41ed..0000000000 --- a/mets/d/in_wyt.c +++ /dev/null @@ -1,30 +0,0 @@ -/* jets/d/in_wyt.c -** -*/ -#include "all.h" - -/* functions -*/ - u3_noun u3ydi_wyt(u3_noun cor) - { - u3_noun a; - if ( c3n == u3r_mean(cor, u3x_con_2, &a, 0) ) { - return u3m_bail(c3__exit); - } else { - return u3gdi_wyt(a); - } - } - - u3_noun u3gdi_wyt(u3_noun a) - { - u3_noun n_a, l_a, r_a; - if ( u3_nul == a ) { - return 0; - } - else if ( c3n == u3r_trel(a, &n_a, &l_a, &r_a) ) { - return u3m_bail(c3__exit); - } - else { - return u3i_vint(u3la_add(u3gdi_wyt(l_a), u3gdi_wyt(r_a))); - } - } diff --git a/mets/e/aes_cbc.c b/mets/e/aes_cbc.c deleted file mode 100644 index 861a072003..0000000000 --- a/mets/e/aes_cbc.c +++ /dev/null @@ -1,548 +0,0 @@ -/* j/5/aes_cbc.c -** -*/ -#include "all.h" - -#include - -/* functions -*/ - u3_noun - u3gea_cbca_en(u3_atom key, - u3_atom iv, - u3_atom msg) - { - c3_y key_y[16]; - c3_y iv_y[16]; - c3_w len_msg_w; - c3_w len_out_w; - c3_y *msg_y; - c3_y *out_y; - u3_atom out; - AES_KEY key_u; - - c3_assert(u3r_met(3, key) <= 16); - c3_assert(u3r_met(3, iv) <= 16); - len_msg_w = u3r_met(3, msg); - len_out_w = (len_msg_w % 16) == 0 ? len_msg_w : len_msg_w + (16 - (len_msg_w % 16)); - len_msg_w = len_out_w; - - msg_y = u3a_malloc(len_msg_w); - out_y = u3a_malloc(len_out_w); - - { - int i = 15; - - do { - key_y[i] = u3r_byte(15-i, key); - i--; - } while (i >= 0); - } - { - int i = 15; - - do { - iv_y[i] = u3r_byte(15-i, iv); - i--; - } while (i >= 0); - } - { - int i = len_msg_w - 1; - - do { - msg_y[i] = u3r_byte((len_msg_w - 1)-i, msg); - i--; - } while (i >= 0); - } - - if ( 0 != AES_set_encrypt_key(key_y, 128, &key_u) ) { - return u3m_bail(c3__exit); - } - else { - AES_cbc_encrypt(msg_y, out_y, len_msg_w, &key_u, iv_y, AES_ENCRYPT); - } - - /* array reverse - we can write backwards u3i_bytes * - * in the unlikely event that this becomes a problem */ - { - int i = len_out_w - 1; - int j = 0; - c3_y tmp; - - do { - tmp = out_y[i]; - out_y[i] = out_y[j]; - out_y[j] = tmp; - i--; j++; - } while (i > j); - } - - out = u3i_bytes(len_out_w, out_y); - u3a_free(msg_y); - u3a_free(out_y); - return out; - } - - u3_noun - u3yea_cbca_en(u3_noun cor) - { - u3_noun a, b, c; - - if ( c3n == u3r_mean(cor, u3x_sam, &c, 60, &a, 61, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) { - return u3m_bail(c3__exit); - } else { - return u3gea_cbca_en(a, b, c); - } - } - - u3_noun - u3gea_cbca_de(u3_atom key, - u3_atom iv, - u3_atom msg) - { - c3_y key_y[16]; - c3_y iv_y[16]; - c3_w len_msg_w; - c3_w len_out_w; - c3_y *msg_y; - c3_y *out_y; - u3_atom out; - AES_KEY key_u; - - c3_assert(u3r_met(3, key) <= 16); - c3_assert(u3r_met(3, iv) <= 16); - len_msg_w = u3r_met(3, msg); - len_out_w = (len_msg_w % 16) == 0 ? len_msg_w : len_msg_w + (16 - (len_msg_w % 16)); - len_msg_w = len_out_w; - - msg_y = u3a_malloc(len_msg_w); - out_y = u3a_malloc(len_out_w); - - { - int i = 15; - - do { - key_y[i] = u3r_byte(15-i, key); - i--; - } while (i >= 0); - } - { - int i = 15; - - do { - iv_y[i] = u3r_byte(15-i, iv); - i--; - } while (i >= 0); - } - { - int i = len_msg_w - 1; - - do { - msg_y[i] = u3r_byte((len_msg_w - 1)-i, msg); - i--; - } while (i >= 0); - } - - if ( 0 != AES_set_decrypt_key(key_y, 128, &key_u) ) { - return u3m_bail(c3__exit); - } - else { - AES_cbc_encrypt(msg_y, out_y, len_msg_w, &key_u, iv_y, AES_DECRYPT); - } - - /* array reverse - we can write backwards u3i_bytes * - * in the unlikely event that this becomes a problem */ - { - int i = len_out_w - 1; - int j = 0; - c3_y tmp; - - do { - tmp = out_y[i]; - out_y[i] = out_y[j]; - out_y[j] = tmp; - i--; j++; - } while (i > j); - } - - out = u3i_bytes(len_out_w, out_y); - u3a_free(msg_y); - u3a_free(out_y); - return out; - } - - u3_noun - u3yea_cbca_de(u3_noun cor) - { - u3_noun a, b, c; - - if ( c3n == u3r_mean(cor, u3x_sam, &c, 60, &a, 61, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) { - return u3m_bail(c3__exit); - } else { - return u3gea_cbca_de(a, b, c); - } - } - - u3_noun - u3gea_cbcb_en(u3_atom key, - u3_atom iv, - u3_atom msg) - { - c3_y key_y[24]; - c3_y iv_y[16]; - c3_w len_msg_w; - c3_w len_out_w; - c3_y *msg_y; - c3_y *out_y; - u3_atom out; - AES_KEY key_u; - - c3_assert(u3r_met(3, key) <= 24); - c3_assert(u3r_met(3, iv) <= 16); - len_msg_w = u3r_met(3, msg); - len_out_w = (len_msg_w % 16) == 0 ? len_msg_w : len_msg_w + (16 - (len_msg_w % 16)); - len_msg_w = len_out_w; - - msg_y = u3a_malloc(len_msg_w); - out_y = u3a_malloc(len_out_w); - - { - int i = 23; - - do { - key_y[i] = u3r_byte(23-i, key); - i--; - } while (i >= 0); - } - { - int i = 15; - - do { - iv_y[i] = u3r_byte(15-i, iv); - i--; - } while (i >= 0); - } - { - int i = len_msg_w - 1; - - do { - msg_y[i] = u3r_byte((len_msg_w - 1)-i, msg); - i--; - } while (i >= 0); - } - - if ( 0 != AES_set_encrypt_key(key_y, 192, &key_u) ) { - return u3m_bail(c3__exit); - } - else { - AES_cbc_encrypt(msg_y, out_y, len_msg_w, &key_u, iv_y, AES_ENCRYPT); - } - - /* array reverse - we can write backwards u3i_bytes * - * in the unlikely event that this becomes a problem */ - { - int i = len_out_w - 1; - int j = 0; - c3_y tmp; - - do { - tmp = out_y[i]; - out_y[i] = out_y[j]; - out_y[j] = tmp; - i--; j++; - } while (i > j); - } - - out = u3i_bytes(len_out_w, out_y); - u3a_free(msg_y); - u3a_free(out_y); - return out; - } - - u3_noun - u3yea_cbcb_en(u3_noun cor) - { - u3_noun a, b, c; - - if ( c3n == u3r_mean(cor, u3x_sam, &c, 60, &a, 61, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) { - return u3m_bail(c3__exit); - } else { - return u3gea_cbcb_en(a, b, c); - } - } - - u3_noun - u3gea_cbcb_de(u3_atom key, - u3_atom iv, - u3_atom msg) - { - c3_y key_y[24]; - c3_y iv_y[16]; - c3_w len_msg_w; - c3_w len_out_w; - c3_y *msg_y; - c3_y *out_y; - u3_atom out; - AES_KEY key_u; - - c3_assert(u3r_met(3, key) <= 24); - c3_assert(u3r_met(3, iv) <= 16); - len_msg_w = u3r_met(3, msg); - len_out_w = (len_msg_w % 16) == 0 ? len_msg_w : len_msg_w + (16 - (len_msg_w % 16)); - len_msg_w = len_out_w; - - msg_y = u3a_malloc(len_msg_w); - out_y = u3a_malloc(len_out_w); - - { - int i = 23; - - do { - key_y[i] = u3r_byte(23-i, key); - i--; - } while (i >= 0); - } - { - int i = 15; - - do { - iv_y[i] = u3r_byte(15-i, iv); - i--; - } while (i >= 0); - } - { - int i = len_msg_w - 1; - - do { - msg_y[i] = u3r_byte((len_msg_w - 1)-i, msg); - i--; - } while (i >= 0); - } - - if ( 0 != AES_set_decrypt_key(key_y, 192, &key_u) ) { - return u3m_bail(c3__exit); - } - else { - AES_cbc_encrypt(msg_y, out_y, len_msg_w, &key_u, iv_y, AES_DECRYPT); - } - - /* array reverse - we can write backwards u3i_bytes * - * in the unlikely event that this becomes a problem */ - { - int i = len_out_w - 1; - int j = 0; - c3_y tmp; - - do { - tmp = out_y[i]; - out_y[i] = out_y[j]; - out_y[j] = tmp; - i--; j++; - } while (i > j); - } - - out = u3i_bytes(len_out_w, out_y); - u3a_free(msg_y); - u3a_free(out_y); - return out; - } - - u3_noun - u3yea_cbcb_de(u3_noun cor) - { - u3_noun a, b, c; - - if ( c3n == u3r_mean(cor, u3x_sam, &c, 60, &a, 61, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) { - return u3m_bail(c3__exit); - } else { - return u3gea_cbcb_de(a, b, c); - } - } - - u3_noun - u3gea_cbcc_en(u3_atom key, - u3_atom iv, - u3_atom msg) - { - c3_y key_y[32]; - c3_y iv_y[16]; - c3_w len_msg_w; - c3_w len_out_w; - c3_y *msg_y; - c3_y *out_y; - u3_atom out; - AES_KEY key_u; - - c3_assert(u3r_met(3, key) <= 32); - c3_assert(u3r_met(3, iv) <= 16); - len_msg_w = u3r_met(3, msg); - len_out_w = (len_msg_w % 16) == 0 ? len_msg_w : len_msg_w + (16 - (len_msg_w % 16)); - len_msg_w = len_out_w; - - msg_y = u3a_malloc(len_msg_w); - out_y = u3a_malloc(len_out_w); - - { - int i = 31; - - do { - key_y[i] = u3r_byte(31-i, key); - i--; - } while (i >= 0); - } - { - int i = 15; - - do { - iv_y[i] = u3r_byte(15-i, iv); - i--; - } while (i >= 0); - } - { - int i = len_msg_w - 1; - - do { - msg_y[i] = u3r_byte((len_msg_w - 1)-i, msg); - i--; - } while (i >= 0); - } - - if ( 0 != AES_set_encrypt_key(key_y, 256, &key_u) ) { - return u3m_bail(c3__exit); - } - else { - AES_cbc_encrypt(msg_y, out_y, len_msg_w, &key_u, iv_y, AES_ENCRYPT); - } - - /* array reverse - we can write backwards u3i_bytes * - * in the unlikely event that this becomes a problem */ - { - int i = len_out_w - 1; - int j = 0; - c3_y tmp; - - do { - tmp = out_y[i]; - out_y[i] = out_y[j]; - out_y[j] = tmp; - i--; j++; - } while (i > j); - } - - out = u3i_bytes(len_out_w, out_y); - u3a_free(msg_y); - u3a_free(out_y); - return out; - } - - u3_noun - u3yea_cbcc_en(u3_noun cor) - { - u3_noun a, b, c; - - if ( c3n == u3r_mean(cor, u3x_sam, &c, 60, &a, 61, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) { - return u3m_bail(c3__exit); - } else { - return u3gea_cbcc_en(a, b, c); - } - } - - u3_noun - u3gea_cbcc_de(u3_atom key, - u3_atom iv, - u3_atom msg) - { - c3_y key_y[32]; - c3_y iv_y[16]; - c3_w len_msg_w; - c3_w len_out_w; - c3_y *msg_y; - c3_y *out_y; - u3_atom out; - AES_KEY key_u; - - c3_assert(u3r_met(3, key) <= 32); - c3_assert(u3r_met(3, iv) <= 16); - len_msg_w = u3r_met(3, msg); - len_out_w = (len_msg_w % 16) == 0 ? len_msg_w : len_msg_w + (16 - (len_msg_w % 16)); - len_msg_w = len_out_w; - - msg_y = u3a_malloc(len_msg_w); - out_y = u3a_malloc(len_out_w); - - { - int i = 31; - - do { - key_y[i] = u3r_byte(31-i, key); - i--; - } while (i >= 0); - } - { - int i = 15; - - do { - iv_y[i] = u3r_byte(15-i, iv); - i--; - } while (i >= 0); - } - { - int i = len_msg_w - 1; - - do { - msg_y[i] = u3r_byte((len_msg_w - 1)-i, msg); - i--; - } while (i >= 0); - } - - if ( 0 != AES_set_decrypt_key(key_y, 256, &key_u) ) { - return u3m_bail(c3__exit); - } - else { - AES_cbc_encrypt(msg_y, out_y, len_msg_w, &key_u, iv_y, AES_DECRYPT); - } - - /* array reverse - we can write backwards u3i_bytes * - * in the unlikely event that this becomes a problem */ - { - int i = len_out_w - 1; - int j = 0; - c3_y tmp; - - do { - tmp = out_y[i]; - out_y[i] = out_y[j]; - out_y[j] = tmp; - i--; j++; - } while (i > j); - } - - out = u3i_bytes(len_out_w, out_y); - u3a_free(msg_y); - u3a_free(out_y); - return out; - } - - u3_noun - u3yea_cbcc_de(u3_noun cor) - { - u3_noun a, b, c; - - if ( c3n == u3r_mean(cor, u3x_sam, &c, 60, &a, 61, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) { - return u3m_bail(c3__exit); - } else { - return u3gea_cbcc_de(a, b, c); - } - } diff --git a/mets/e/aes_ecb.c b/mets/e/aes_ecb.c deleted file mode 100644 index 6ba83f27d8..0000000000 --- a/mets/e/aes_ecb.c +++ /dev/null @@ -1,407 +0,0 @@ -/* j/5/aes_ecb.c -** -*/ -#include "all.h" - -#include - -/* functions -*/ - u3_noun - u3gea_ecba_en(u3_atom key, - u3_atom blk) - { - c3_y key_y[16]; - c3_y blk_y[16]; - AES_KEY key_u; - - c3_assert(u3r_met(3, key) <= 16); - c3_assert(u3r_met(3, blk) <= 16); - - { - int i = 15; - - do { - key_y[i] = u3r_byte(15-i, key); - i--; - } while (i >= 0); - } - { - int i = 15; - - do { - blk_y[i] = u3r_byte(15-i, blk); - i--; - } while (i >= 0); - } - - if ( 0 != AES_set_encrypt_key(key_y, 128, &key_u) ) { - return u3m_bail(c3__exit); - } - else { - AES_ecb_encrypt(blk_y, blk_y, &key_u, AES_ENCRYPT); - } - - /* array reverse - we can write backwards u3i_bytes * - * in the unlikely event that this becomes a problem */ - { - int i = 15; - int j = 0; - c3_y tmp; - - do { - tmp = blk_y[i]; - blk_y[i] = blk_y[j]; - blk_y[j] = tmp; - i--; j++; - } while (i > j); - } - - return u3i_bytes(16, blk_y); - } - - u3_noun - u3yea_ecba_en(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) { - return u3m_bail(c3__exit); - } else { - return u3gea_ecba_en(a, b); - } - } - - u3_noun - u3gea_ecba_de(u3_atom key, - u3_atom blk) - { - c3_y key_y[16]; - c3_y blk_y[16]; - AES_KEY key_u; - - c3_assert(u3r_met(3, key) <= 16); - c3_assert(u3r_met(3, blk) <= 16); - - { - int i = 15; - - do { - key_y[i] = u3r_byte(15-i, key); - i--; - } while (i >= 0); - } - { - int i = 15; - - do { - blk_y[i] = u3r_byte(15-i, blk); - i--; - } while (i >= 0); - } - - if ( 0 != AES_set_decrypt_key(key_y, 128, &key_u) ) { - return u3m_bail(c3__exit); - } - else { - AES_ecb_encrypt(blk_y, blk_y, &key_u, AES_DECRYPT); - } - - /* array reverse - we can write backwards u3i_bytes * - * in the unlikely event that this becomes a problem */ - { - int i = 15; - int j = 0; - c3_y tmp; - - do { - tmp = blk_y[i]; - blk_y[i] = blk_y[j]; - blk_y[j] = tmp; - i--; j++; - } while (i > j); - } - return u3i_bytes(16, blk_y); - } - - u3_noun - u3yea_ecba_de(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) { - return u3m_bail(c3__exit); - } else { - return u3gea_ecba_de(a, b); - } - } - - u3_noun - u3gea_ecbb_en(u3_atom key, - u3_atom blk) - { - c3_y key_y[24]; - c3_y blk_y[16]; - AES_KEY key_u; - - c3_assert(u3r_met(3, key) <= 24); - c3_assert(u3r_met(3, blk) <= 16); - - { - int i = 23; - - do { - key_y[i] = u3r_byte(23-i, key); - i--; - } while (i >= 0); - } - { - int i = 15; - - do { - blk_y[i] = u3r_byte(15-i, blk); - i--; - } while (i >= 0); - } - - if ( 0 != AES_set_encrypt_key(key_y, 192, &key_u) ) { - return u3m_bail(c3__exit); - } - else { - AES_ecb_encrypt(blk_y, blk_y, &key_u, AES_ENCRYPT); - } - - /* array reverse - we can write backwards u3i_bytes * - * in the unlikely event that this becomes a problem */ - { - int i = 15; - int j = 0; - c3_y tmp; - - do { - tmp = blk_y[i]; - blk_y[i] = blk_y[j]; - blk_y[j] = tmp; - i--; j++; - } while (i > j); - } - - return u3i_bytes(16, blk_y); - } - - u3_noun - u3yea_ecbb_en(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) { - return u3m_bail(c3__exit); - } else { - return u3gea_ecbb_en(a, b); - } - } - - u3_noun - u3gea_ecbb_de(u3_atom key, - u3_atom blk) - { - c3_y key_y[24]; - c3_y blk_y[16]; - AES_KEY key_u; - - c3_assert(u3r_met(3, key) <= 24); - c3_assert(u3r_met(3, blk) <= 16); - - { - int i = 23; - - do { - key_y[i] = u3r_byte(23-i, key); - i--; - } while (i >= 0); - } - { - int i = 15; - - do { - blk_y[i] = u3r_byte(15-i, blk); - i--; - } while (i >= 0); - } - - if ( 0 != AES_set_decrypt_key(key_y, 192, &key_u) ) { - return u3m_bail(c3__exit); - } - else { - AES_ecb_encrypt(blk_y, blk_y, &key_u, AES_DECRYPT); - } - - /* array reverse - we can write backwards u3i_bytes * - * in the unlikely event that this becomes a problem */ - { - int i = 15; - int j = 0; - c3_y tmp; - - do { - tmp = blk_y[i]; - blk_y[i] = blk_y[j]; - blk_y[j] = tmp; - i--; j++; - } while (i > j); - } - return u3i_bytes(16, blk_y); - } - - u3_noun - u3yea_ecbb_de(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) { - return u3m_bail(c3__exit); - } else { - return u3gea_ecbb_de(a, b); - } - } - - u3_noun - u3gea_ecbc_en(u3_atom key, - u3_atom blk) - { - c3_y key_y[32]; - c3_y blk_y[16]; - AES_KEY key_u; - - c3_assert(u3r_met(3, key) <= 32); - c3_assert(u3r_met(3, blk) <= 16); - - { - int i = 31; - - do { - key_y[i] = u3r_byte(31-i, key); - i--; - } while (i >= 0); - } - { - int i = 15; - - do { - blk_y[i] = u3r_byte(15-i, blk); - i--; - } while (i >= 0); - } - - if ( 0 != AES_set_encrypt_key(key_y, 256, &key_u) ) { - return u3m_bail(c3__exit); - } - else { - AES_ecb_encrypt(blk_y, blk_y, &key_u, AES_ENCRYPT); - } - - /* array reverse - we can write backwards u3i_bytes * - * in the unlikely event that this becomes a problem */ - { - int i = 15; - int j = 0; - c3_y tmp; - - do { - tmp = blk_y[i]; - blk_y[i] = blk_y[j]; - blk_y[j] = tmp; - i--; j++; - } while (i > j); - } - - return u3i_bytes(16, blk_y); - } - - u3_noun - u3yea_ecbc_en(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) { - return u3m_bail(c3__exit); - } else { - return u3gea_ecbc_en(a, b); - } - } - - u3_noun - u3gea_ecbc_de(u3_atom key, - u3_atom blk) - { - c3_y key_y[32]; - c3_y blk_y[16]; - AES_KEY key_u; - - c3_assert(u3r_met(3, key) <= 32); - c3_assert(u3r_met(3, blk) <= 16); - - { - int i = 31; - - do { - key_y[i] = u3r_byte(31-i, key); - i--; - } while (i >= 0); - } - { - int i = 15; - - do { - blk_y[i] = u3r_byte(15-i, blk); - i--; - } while (i >= 0); - } - - if ( 0 != AES_set_decrypt_key(key_y, 256, &key_u) ) { - return u3m_bail(c3__exit); - } - else { - AES_ecb_encrypt(blk_y, blk_y, &key_u, AES_DECRYPT); - } - - /* array reverse - we can write backwards u3i_bytes * - * in the unlikely event that this becomes a problem */ - { - int i = 15; - int j = 0; - c3_y tmp; - - do { - tmp = blk_y[i]; - blk_y[i] = blk_y[j]; - blk_y[j] = tmp; - i--; j++; - } while (i > j); - } - return u3i_bytes(16, blk_y); - } - - u3_noun - u3yea_ecbc_de(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam, &b, u3x_con_sam, &a, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) { - return u3m_bail(c3__exit); - } else { - return u3gea_ecbc_de(a, b); - } - } diff --git a/mets/e/aesc.c b/mets/e/aesc.c deleted file mode 100644 index 05b64ca5d9..0000000000 --- a/mets/e/aesc.c +++ /dev/null @@ -1,121 +0,0 @@ -/* j/5/aes.c -** -*/ -#include "all.h" - - -#if defined(U3_OS_osx) -#include -#else -#include -#endif - -/* functions -*/ - u3_noun - u3gea_en(u3_atom a, - u3_atom b) - { - c3_y a_y[32]; - c3_y b_y[16]; -#if defined(U3_OS_osx) - size_t siz_i = 0; -#else - AES_KEY key_u; -#endif - - c3_assert(u3r_met(3, a) <= 32); - c3_assert(u3r_met(3, b) <= 16); - - u3r_bytes(0, 32, a_y, a); - u3r_bytes(0, 16, b_y, b); - -#if defined(U3_OS_osx) - if ( kCCSuccess != CCCrypt(kCCEncrypt, kCCAlgorithmAES128, - kCCOptionECBMode, a_y, kCCKeySizeAES256, 0, b_y, - 16, b_y, 16, &siz_i) ) - { - return u3m_bail(c3__exit); - } - else c3_assert(16 == siz_i); -#else - if ( 0 != AES_set_encrypt_key(a_y, 256, &key_u) ) { - return u3m_bail(c3__exit); - } - else { - AES_encrypt(b_y, b_y, &key_u); - } -#endif - - return u3i_bytes(16, b_y); - } - - u3_noun - u3yea_en(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3gea_en(a, b); - } - } - - u3_noun - u3gea_de(u3_atom a, - u3_atom b) - { - c3_y a_y[32]; - c3_y b_y[16]; -#if defined(U3_OS_osx) - size_t siz_i = 0; -#else - AES_KEY key_u; -#endif - - c3_assert(u3r_met(3, a) <= 32); - c3_assert(u3r_met(3, b) <= 16); - - u3r_bytes(0, 32, a_y, a); - u3r_bytes(0, 16, b_y, b); - -#if defined(U3_OS_osx) - if ( kCCSuccess != CCCrypt(kCCDecrypt, kCCAlgorithmAES128, - kCCOptionECBMode, a_y, kCCKeySizeAES256, 0, b_y, - 16, b_y, 16, &siz_i) ) - { - return u3m_bail(c3__exit); - } - else c3_assert(16 == siz_i); -#else - if ( 0 != AES_set_decrypt_key(a_y, 256, &key_u) ) { - return u3m_bail(c3__exit); - } - else { - AES_decrypt(b_y, b_y, &key_u); - } -#endif - - return u3i_bytes(16, b_y); - } - - u3_noun - u3yea_de(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3gea_de(a, b); - } - } diff --git a/mets/e/cue.c b/mets/e/cue.c deleted file mode 100644 index 2b386e9a3d..0000000000 --- a/mets/e/cue.c +++ /dev/null @@ -1,96 +0,0 @@ -/* j/5/cue.c -** -*/ -#include "all.h" - - - static u3_noun - _cue_in(u3p(u3h_root) har_p, - u3_atom a, - u3_atom b) - { - u3_noun p, q; - - if ( 0 == u3gc_cut(0, b, 1, a) ) { - u3_noun x = u3ga_inc(b); - u3_noun c = u3ge_rub(x, a); - - p = u3ga_inc(u3k(u3h(c))); - q = u3k(u3t(c)); - - u3h_put(har_p, u3k(b), u3k(q)); - - u3z(c); - u3z(x); - } - else { - u3_noun c = u3ga_add(2, b); - u3_noun l = u3ga_inc(b); - - if ( 0 == u3gc_cut(0, l, 1, a) ) { - u3_noun u, v, w; - u3_noun x, y; - - u = _cue_in(har_p, a, c); - x = u3ga_add(u3h(u), c); - v = _cue_in(har_p, a, x); - w = u3nc(u3k(u3h(u3t(u))), u3k(u3h(u3t(v)))); - - y = u3ga_add(u3h(u), u3h(v)); - p = u3ga_add(2, y); - - q = w; - u3h_put(har_p, u3k(b), u3k(q)); - - u3z(u); u3z(v); u3z(x); u3z(y); - } - else { - u3_noun d = u3ge_rub(c, a); - u3_noun x = u3h_get(har_p, u3k(u3t(d))); - - p = u3ga_add(2, u3h(d)); - if ( u3_none == x ) { - return u3m_bail(c3__exit); - } - q = x; - u3z(d); - } - u3z(l); - u3z(c); - } - return u3nt(p, q, 0); - } - - u3_noun - u3ge_cue(u3_atom a) - { - u3p(u3h_root) har_p = u3h_new(); - - u3_noun x = _cue_in(har_p, a, 0); - u3_noun y = u3k(u3h(u3t(x))); - - u3h_free(har_p); - - u3z(x); - return y; - } - u3_noun - u3ye_cue(u3_noun cor) - { - u3_noun a; - - if ( (u3_none == (a = u3r_at(u3x_sam, cor))) ) { - return u3m_bail(c3__fail); - } else { - return u3ge_cue(a); - } - } - u3_noun - u3le_cue(u3_atom a) - { - u3_noun b = u3ge_cue(a); - - u3z(a); - return b; - } - diff --git a/mets/e/ed_puck.c b/mets/e/ed_puck.c deleted file mode 100644 index d877c6233f..0000000000 --- a/mets/e/ed_puck.c +++ /dev/null @@ -1,33 +0,0 @@ -/* gen164/5/ed_puck.c -** -*/ -#include "all.h" - - -#include - -/* functions -*/ - u3_noun - u3yee_puck(u3_noun cor) - { - c3_y pub_y[32]; - c3_y sec_y[64]; - c3_y sed_y[32]; - c3_w met_w; - u3_noun a = u3r_at(u3x_sam, cor); - - if ( (u3_none == a) || (c3n == u3ud(a)) ) { - return u3m_bail(c3__exit); - } - - met_w = u3r_met(3, a); - if ( met_w > 32 ) { - return u3m_bail(c3__exit); - } - - memset(sed_y, 0, 32); - u3r_bytes(0, met_w, sed_y, a); - ed25519_create_keypair(pub_y, sec_y, sed_y); - return u3i_bytes(32, pub_y); - } diff --git a/mets/e/ed_shar.c b/mets/e/ed_shar.c deleted file mode 100644 index 582c0c505f..0000000000 --- a/mets/e/ed_shar.c +++ /dev/null @@ -1,47 +0,0 @@ -/* j/5/shar.c -** -*/ -#include "all.h" - -#include - - u3_noun - u3gee_shar(u3_atom pub, u3_atom sek) - { - c3_y pub_y[32], sek_y[32], self_y[32], exp_y[64], shr_y[32]; - c3_w met_pub_w, met_sek_w; - - met_pub_w = u3r_met(3, pub); - met_sek_w = u3r_met(3, sek); - - if ( (met_pub_w > 32) || (met_sek_w > 32) ) { - return u3m_bail(c3__exit); - } - - u3r_bytes(0, 32, pub_y, pub); - u3r_bytes(0, 32, sek_y, sek); - - memset(self_y, 0, 32); - memset(exp_y, 0, 64); - memset(shr_y, 0, 32); - - ed25519_create_keypair(self_y, exp_y, sek_y); - ed25519_key_exchange(shr_y, pub_y, exp_y); - - return u3i_bytes(32, shr_y); - } - - u3_noun - u3yee_shar(u3_noun cor) - { - u3_noun pub, sek; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &pub, u3x_sam_3, &sek, 0)) || - (c3n == u3ud(pub)) || - (c3n == u3ud(sek)) ) - { - return u3m_bail(c3__exit); - } else { - return u3gee_shar(pub, sek); - } - } diff --git a/mets/e/ed_sign.c b/mets/e/ed_sign.c deleted file mode 100644 index 250faaad88..0000000000 --- a/mets/e/ed_sign.c +++ /dev/null @@ -1,51 +0,0 @@ -/* gen164/5/ed_sign.c -** -*/ -#include "all.h" - - -#include - -/* functions -*/ - static u3_noun - _cqee_sign(u3_noun a, - u3_noun b) - { - c3_y sig_y[64]; - c3_y sed_y[32]; - c3_y pub_y[64]; - c3_y sec_y[64]; - - c3_w mesm_w = u3r_met(3, a); - c3_w mess_w = u3r_met(3, b); - - c3_y* mes_y = 0; - - memset(sig_y, 0, 64); - memset(sed_y, 0, 32); - memset(pub_y, 0, 64); - memset(sec_y, 0, 64); - - mes_y = malloc(mesm_w); - - u3r_bytes(0, mesm_w, mes_y, a); - u3r_bytes(0, mess_w, sed_y, b); - - ed25519_create_keypair(pub_y, sec_y, sed_y); - ed25519_sign(sig_y, mes_y, mesm_w, pub_y, sec_y); - free(mes_y); - return u3i_bytes(64, sig_y); - } - - u3_noun - u3yee_sign(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__fail); - } else { - return _cqee_sign(a, b); - } - } diff --git a/mets/e/ed_veri.c b/mets/e/ed_veri.c deleted file mode 100644 index e7d28f75cf..0000000000 --- a/mets/e/ed_veri.c +++ /dev/null @@ -1,48 +0,0 @@ -/* gen164/5/ed_veri.c -** -*/ -#include "all.h" - - -#include - -/* functions -*/ - static u3_noun - _cqee_veri(u3_noun s, - u3_noun m, - u3_noun pk) - { - c3_y sig_y[64]; - c3_y pub_y[32]; - c3_w ret; - c3_y* mes_y; - - c3_w mesm_w = u3r_met(3, m); - - memset(sig_y, 0, 64); - memset(pub_y, 0, 32); - - mes_y = c3_malloc(mesm_w); - - u3r_bytes(0, 64, sig_y, s); - u3r_bytes(0, 32, pub_y, pk); - u3r_bytes(0, mesm_w, mes_y, m); - - ret = ed25519_verify(sig_y, mes_y, mesm_w, pub_y) == 1 ? c3y : c3n; - free(mes_y); - return ret; - } - - u3_noun - u3yee_veri(u3_noun cor) - { - u3_noun a, b, c; - if ( c3n == u3r_mean(cor, - u3x_sam_2, &a, u3x_sam_6, &b, - u3x_sam_7, &c, 0) ) { - return u3m_bail(c3__fail); - } else { - return _cqee_veri(a, b, c); - } - } diff --git a/mets/e/fl.c b/mets/e/fl.c deleted file mode 100644 index e152757b1d..0000000000 --- a/mets/e/fl.c +++ /dev/null @@ -1,428 +0,0 @@ -/* j/e/fl.c -** -*/ -#include "all.h" - -/* structures -*/ - typedef struct _flOptions { - c3_w precision; - mpz_t minExp; - mpz_t expWidth; - c3_w rMode; - c3_w eMode; - } flOptions; - - typedef struct _ea { - mpz_t e; - mpz_t a; - } ea; - -/* functions -*/ - static void - _satom_to_mp(mpz_t a_mp, - u3_atom b) - { - if ( _(u3a_is_cat(b)) ) { - c3_ws c = (b + 1) >> 1; - if ( (b & 1) ) { - c = -c; - } - mpz_init_set_si(a_mp, c); - } - else { - u3r_mp(a_mp, b); - c3_t x = mpz_odd_p(a_mp); - mpz_add_ui(a_mp, a_mp, 1); - mpz_tdiv_q_2exp(a_mp, a_mp, 1); - if ( x ) { - mpz_neg(a_mp, a_mp); - } - } - } - - static u3_noun - _mp_to_satom(mpz_t a_mp) - { - c3_ws b = mpz_sgn(a_mp); - switch ( b ) { - default: return u3m_bail(c3__fail); - case 0: { - mpz_clear(a_mp); - return 0; - } - case 1: { - mpz_mul_2exp(a_mp, a_mp, 1); - return u3i_mp(a_mp); - } - case -1: { - mpz_abs(a_mp, a_mp); - mpz_mul_2exp(a_mp, a_mp, 1); - mpz_sub_ui(a_mp, a_mp, 1); - return u3i_mp(a_mp); - } - } - } - - static void - _noun_to_flOptions(flOptions* a, - u3_noun b) - { - u3_noun c; - u3_atom d, e, f, g, h; - u3x_trel(b, &c, &d, &e); - u3x_trel(c, &f, &g, &h); - - mpz_t i; - u3r_mp(i, f); - if ( !mpz_fits_uint_p(i) ) { - mpz_clear(i); - u3m_bail(c3__exit); - } - a->precision = mpz_get_ui(i); - mpz_clear(i); - - if ( a->precision < 2 ) u3m_bail(c3__exit); - - _satom_to_mp(a->minExp, g); - u3r_mp(a->expWidth, h); - - if ( !(_(u3a_is_cat(d)) && _(u3a_is_cat(e))) ) { - mpz_clear(a->minExp); - mpz_clear(a->expWidth); - u3m_bail(c3__exit); - } - a->rMode = d; - a->eMode = e; - } - - static void - _noun_to_ea(ea* a, - u3_noun b) - { - u3_atom c, d; - u3x_cell(b, &c, &d); - - if ( !(_(u3a_is_cat(c))) ) { - u3m_bail(c3__exit); - } - - _satom_to_mp(a->e, c); - u3r_mp(a->a, d); - } - - static u3_noun - _ea_to_noun(ea* a) - { - u3_atom b = _mp_to_satom(a->e); - u3_atom c = u3i_mp(a->a); - - return u3i_cell(u3k(b), u3k(c)); - } - - static void - _xpd(ea* a, - flOptions* b) - { - size_t z = mpz_sizeinbase(a->a, 2); - if ( z >= b->precision ) return; - c3_w c = b->precision - z; - - if ( b->eMode != c3__i ) { - mpz_t i; - mpz_init_set(i, a->e); - mpz_sub(i, i, b->minExp); - if ( mpz_sgn(i) < 0 ) { - c = 0; - } - else if ( mpz_fits_uint_p(i) ) - { - c3_w d = mpz_get_ui(i); - c = c3_min(c, d); - } - mpz_clear(i); - } - - mpz_mul_2exp(a->a, a->a, c); - mpz_sub_ui(a->e, a->e, c); - } - - /* a: floating point number, b: flOptions, i: rounding mode, j: sticky bit */ - u3_noun - u3gef_lug(u3_noun a, - u3_noun b, - u3_atom i, - u3_atom j) - { - mpz_t v, g, h; - ea c; - flOptions d; - _noun_to_ea(&c, a); - _noun_to_flOptions(&d, b); - if ( mpz_sgn(c.a) == 0 ) { - mpz_clear(d.minExp); mpz_clear(d.expWidth); - mpz_clear(c.a); mpz_clear(c.e); - return u3m_bail(c3__exit); - } - size_t m = mpz_sizeinbase(c.a, 2); - if ( !_(j) && (m <= d.precision) ) { - mpz_clear(d.minExp); mpz_clear(d.expWidth); - mpz_clear(c.a); mpz_clear(c.e); - return u3m_bail(c3__exit); - } - c3_w q = 0; - c3_w f = (m > d.precision) ? m - d.precision : 0; - mpz_init(g); - if ( (d.eMode != c3__i) && - (mpz_cmp(c.e, d.minExp) < 0) ) { - mpz_sub(g, d.minExp, c.e); - if ( !mpz_fits_uint_p(g) ) { - mpz_clear(g); - mpz_clear(d.minExp); mpz_clear(d.expWidth); - mpz_clear(c.a); mpz_clear(c.e); - return u3m_bail(c3__exit); - } - q = mpz_get_ui(g); - } - q = c3_max(f, q); - mpz_init(v); - mpz_tdiv_r_2exp(v, c.a, q); - mpz_tdiv_q_2exp(c.a, c.a, q); - mpz_add_ui(c.e, c.e, q); - mpz_init_set_ui(h, 1); - if ( q > 0 ) mpz_mul_2exp(h, h, q - 1); - - if ( mpz_sgn(c.a) == 0 ) { - c3_t y; - switch ( i ) { - default: - mpz_clear(v); mpz_clear(h); mpz_clear(g); - mpz_clear(d.minExp); mpz_clear(d.expWidth); - mpz_clear(c.a); mpz_clear(c.e); - return u3m_bail(c3__exit); - case c3__fl: - case c3__sm: - mpz_set_ui(c.a, 0); - mpz_set_ui(c.e, 0); - mpz_clear(v); mpz_clear(h); mpz_clear(g); - break; - case c3__ce: - case c3__lg: - mpz_set_ui(c.a, 1); - mpz_set(c.e, d.minExp); - mpz_clear(v); mpz_clear(h); mpz_clear(g); - break; - case c3__ne: - case c3__nt: - case c3__na: - if ( (i != c3__na) && _(j) ) { - y = (mpz_cmp(v, h) <= 0); - } else { - y = (mpz_cmp(v, h) < 0); - } - if ( y ) { - mpz_set_ui(c.a, 0); - mpz_set_ui(c.e, 0); - } else { - mpz_set_ui(c.a, 1); - mpz_set(c.e, d.minExp); - } - mpz_clear(v); mpz_clear(h); mpz_clear(g); - break; - } - goto end; - } - _xpd(&c, &d); - switch ( i ) { - c3_ws x; - default: - mpz_clear(v); mpz_clear(h); mpz_clear(g); - mpz_clear(d.minExp); mpz_clear(d.expWidth); - mpz_clear(c.a); mpz_clear(c.e); - return u3m_bail(c3__exit); - case c3__fl: - break; - case c3__lg: - mpz_add_ui(c.a, c.a, 1); - break; - case c3__sm: - if ( (mpz_sgn(v) != 0) || !_(j) ) break; - if ( (mpz_cmp(c.e, d.minExp) == 0) && (d.eMode != c3__i) ) { - mpz_sub_ui(c.a, c.a, 1); - break; - } - mpz_mul_2exp(g, c.a, 1); - mpz_sub_ui(g, g, 1); - if ( mpz_sizeinbase(g, 2) <= d.precision ) { - mpz_sub_ui(c.e, c.e, 1); - mpz_set(c.a, g); - } else { - mpz_sub_ui(c.a, c.a, 1); - } - break; - case c3__ce: - if ( (mpz_sgn(v) != 0) || !_(j) ) { - mpz_add_ui(c.a, c.a, 1); - } - break; - case c3__ne: - if ( mpz_sgn(v) == 0 ) break; - x = mpz_cmp(v, h); - if ( (x == 0) && _(j) ) { - if ( mpz_odd_p(c.a) ) { - mpz_add_ui(c.a, c.a, 1); - } - } - else if ( x >= 0 ) { - mpz_add_ui(c.a, c.a, 1); - } - break; - case c3__na: - case c3__nt: - if ( mpz_sgn(v) == 0 ) break; - x = mpz_cmp(v, h); - if ( (x < 0) ) break; - if ( (i == c3__nt) && (x == 0) ) { - if (!_(j)) mpz_add_ui(c.a, c.a, 1); - } else { - mpz_add_ui(c.a, c.a, 1); - } - break; - } - if ( mpz_sizeinbase(c.a, 2) == (d.precision + 1) ) { - mpz_tdiv_q_2exp(c.a, c.a, 1); - mpz_add_ui(c.e, c.e, 1); - } - if ( mpz_sgn(c.a) == 0 ) { - mpz_set_ui(c.e, 0); - mpz_clear(v); mpz_clear(h); mpz_clear(g); - goto end; - } - mpz_set(g, d.minExp); - mpz_add(g, g, d.expWidth); - if ( (d.eMode != c3__i) && (mpz_cmp(g, c.e) < 0) ) { - mpz_clear(v); mpz_clear(h); mpz_clear(g); - mpz_clear(d.minExp); mpz_clear(d.expWidth); - mpz_clear(c.a); mpz_clear(c.e); - return u3nc(c3__i, c3y); - } - mpz_clear(v); mpz_clear(h); mpz_clear(g); - - // all mpz except in c, d structures cleared; c contains result - end: - if ( d.eMode == c3__f ) { - if ( mpz_sizeinbase(c.a, 2) != d.precision ) { - mpz_set_ui(c.a, 0); - mpz_set_ui(c.e, 0); - } - } - u3_noun ret = u3nq(c3__f, c3y, u3k(_mp_to_satom(c.e)), u3k(u3i_mp(c.a))); - mpz_clear(d.minExp); mpz_clear(d.expWidth); - return ret; - } - - u3_noun - u3yef_lug(u3_noun cor) - { - u3_noun a, b, c, d, e; - a = u3x_at(u3x_sam, cor); - b = u3x_at(30, cor); - u3x_trel(a, &c, &d, &e); - - return u3gef_lug(d, b, c, e); - } - - u3_noun - u3gef_drg(u3_noun a, - u3_noun b) - { - ea c; - flOptions d; - _noun_to_ea(&c, a); - _noun_to_flOptions(&d, b); - if ( mpz_sgn(c.a) == 0 ) { - mpz_clear(d.minExp); mpz_clear(d.expWidth); - mpz_clear(c.a); mpz_clear(c.e); - u3m_bail(c3__exit); - } - _xpd(&c, &d); - if ( !mpz_fits_sint_p(c.e) ) { - mpz_clear(d.minExp); mpz_clear(d.expWidth); - mpz_clear(c.a); mpz_clear(c.e); - u3m_bail(c3__exit); - } - mpz_t r, s, m, i, j, u, o; - mpz_init_set(r, c.a); - mpz_init_set_ui(s, 1); - mpz_init_set_ui(m, 1); - mpz_init(i); - mpz_init(j); - c3_w se = mpz_sgn(c.e); - if ( se == 1 ) { - mpz_mul_2exp(r, r, mpz_get_ui(c.e)); - mpz_mul_2exp(m, m, mpz_get_ui(c.e)); - } - else if ( se == -1 ) { - mpz_mul_2exp(s, s, mpz_get_ui(c.e)); - } - mpz_cdiv_q_ui(i, s, 10); - mpz_set_ui(c.e, 0); - while ( mpz_cmp(r, i) < 0 ) { - mpz_sub_ui(c.e, c.e, 1); - mpz_mul_ui(r, r, 10); - mpz_mul_ui(m, m, 10); - } - while ( 1 ) { - mpz_mul_2exp(i, r, 1); - mpz_add(i, i, m); - mpz_mul_2exp(j, s, 1); - if ( mpz_cmp(i, j) < 0 ) { - break; - } - mpz_mul_ui(s, s, 10); - mpz_add_ui(c.e, c.e, 1); - } - mpz_init(u); - mpz_init_set_ui(o, 0); - while ( 1 ) { - mpz_sub_ui(c.e, c.e, 1); - mpz_mul_ui(r, r, 10); - mpz_mul_ui(m, m, 10); - mpz_tdiv_qr(u, r, r, s); - mpz_mul_2exp(i, r, 1); - mpz_mul_2exp(j, s, 1); - c3_t l = mpz_cmp(i, m) < 0; - c3_t h = mpz_cmp(j, m) < 0; - if ( !h ) { - mpz_sub(j, j, m); - h = mpz_cmp(i, j) > 0; - } - if ( l || h ) { - mpz_mul_ui(o, o, 10); - mpz_add(o, o, u); - if ( h && (!l || (mpz_cmp(i, s) >= 0)) ) { - mpz_add_ui(o, o, 1); - } - break; - } - mpz_mul_ui(o, o, 10); - mpz_add(o, o, u); - } - mpz_set(c.a, o); - mpz_clear(r); mpz_clear(s); mpz_clear(m); - mpz_clear(i); mpz_clear(j); mpz_clear(u); - mpz_clear(o); mpz_clear(d.minExp); mpz_clear(d.expWidth); - - return _ea_to_noun(&c); - } - - u3_noun - u3yef_drg(u3_noun cor) - { - u3_noun a, b; - a = u3x_at(u3x_sam, cor); - b = u3x_at(30, cor); - - return u3gef_drg(a, b); - } diff --git a/mets/e/jam.c b/mets/e/jam.c deleted file mode 100644 index 959dec848c..0000000000 --- a/mets/e/jam.c +++ /dev/null @@ -1,143 +0,0 @@ -/* j/5/jam.c -** -*/ -#include "all.h" - - -/* functions -*/ - static u3_noun - _jam_in(u3p(u3h_root) har_p, u3_atom, u3_atom, u3_noun); - - static u3_noun - _jam_in_pair(u3p(u3h_root) har_p, - u3_atom h_a, - u3_atom t_a, - u3_atom b, - u3_noun l) - { - u3_noun w = u3nc(u3nc(2, 1), u3k(l)); - u3_noun x = u3ga_add(2, b); - u3_noun d = _jam_in(har_p, h_a, x, w); - u3_noun p_d, q_d, r_d; - u3_noun r; - - u3r_trel(d, &p_d, &q_d, &r_d); - { - u3_noun y = u3ga_add(x, p_d); - u3_noun e = _jam_in(har_p, t_a, y, q_d); - u3_noun p_e, q_e, r_e; - - u3r_trel(e, &p_e, &q_e, &r_e); - { - u3_noun z = u3ga_add(p_d, p_e); - - r = u3nt(u3ga_add(2, z), u3k(q_e), 0); - - u3z(z); - } - u3z(e); - u3z(y); - } - u3z(d); - u3z(x); - u3z(w); - - return r; - } - - static u3_noun - _jam_in_flat(u3p(u3h_root) har_p, - u3_atom a, - u3_noun l) - { - u3_noun d = u3ge_mat(a); - u3_noun x = u3ga_add(1, u3h(d)); - u3_noun y = u3nt - (u3k(x), u3nc(u3nc(x, u3gc_lsh(0, 1, u3t(d))), u3k(l)), 0); - - u3z(d); - - return y; - } - - static u3_noun - _jam_in_ptr(u3p(u3h_root) har_p, - u3_atom u_c, - u3_noun l) - { - u3_noun d = u3ge_mat(u_c); - u3_atom x = u3gc_lsh(0, 2, u3t(d)); - u3_atom y = u3ga_add(2, u3h(d)); - u3_noun z = u3nt - (u3k(y), u3nc(u3nc(y, u3gc_mix(3, x)), u3k(l)), 0); - - u3z(d); - u3z(x); - - return z; - } - - static u3_noun - _jam_in(u3p(u3h_root) har_p, - u3_noun a, - u3_atom b, - u3_noun l) - { - u3_noun c = u3h_get(har_p, a); - u3_noun x; - - if ( u3_none == c ) { - u3h_put(har_p, a, u3k(b)); - - if ( c3y == u3ud(a) ) { - x = _jam_in_flat(har_p, a, l); - } else { - x = _jam_in_pair(har_p, u3h(a), u3t(a), b, l); - } - } - else { - if ( c3y == u3ud(a) && u3r_met(0, a) <= u3r_met(0, c) ) { - x = _jam_in_flat(har_p, a, l); - } - else { - x = _jam_in_ptr(har_p, c, l); - } - } - return x; - } - - u3_noun - u3ge_jam(u3_atom a) - { - u3p(u3h_root) har_p = u3h_new(); - - u3_noun x = _jam_in(har_p, a, 0, u3_nul); - u3_noun q = u3gb_flop(u3h(u3t(x))); - u3_noun r = u3gc_can(0, q); - - u3z(x); - u3z(q); - u3h_free(har_p); - return r; - } - u3_noun - u3ye_jam(u3_noun cor) - { - u3_noun a; - - if ( (u3_none == (a = u3r_at(u3x_sam, cor))) ) { - return u3m_bail(c3__fail); - } else { - return u3ge_jam(a); - } - } - u3_atom - u3le_jam(u3_noun a) - { - u3_atom b = u3ge_jam(a); - - u3z(a); - return b; - } - diff --git a/mets/e/lore.c b/mets/e/lore.c deleted file mode 100644 index 64bddd8d65..0000000000 --- a/mets/e/lore.c +++ /dev/null @@ -1,65 +0,0 @@ -/* j/5/lore.c -** -*/ -#include "all.h" - - - u3_noun - u3ge_lore(u3_atom lub) - { - c3_w len_w = u3r_met(3, lub); - c3_w pos_w = 0; - u3_noun tez = u3_nul; - - while ( 1 ) { - c3_w meg_w = 0; - c3_y end_y; - - c3_y byt_y; - while ( 1 ) { - if ( pos_w >= len_w ) { - byt_y = 0; - end_y = c3y; - break; - } - byt_y = u3r_byte(pos_w + meg_w, lub); - - if ( (10 == byt_y) || (0 == byt_y) ) { - end_y = __(byt_y == 0); - break; - } else meg_w++; - } - - if ((byt_y == 0) && ((pos_w + meg_w + 1) < len_w)) { - return u3m_bail(c3__exit); - } - - { - c3_y* byts_y = alloca(meg_w); - u3r_bytes(pos_w, meg_w, byts_y, lub); - - if ( _(end_y) ) { - return u3lb_flop(u3nc(u3i_bytes(meg_w, byts_y), tez)); - } - if ( pos_w >= len_w ) { - return u3lb_flop(tez); - } - tez = u3nc(u3i_bytes(meg_w, byts_y), tez); - pos_w += (meg_w + 1); - } - } - } - - u3_noun - u3ye_lore(u3_noun cor) - { - u3_noun lub; - - if ( (u3_none == (lub = u3r_at(u3x_sam, cor))) || - (c3n == u3ud(lub)) ) - { - return u3m_bail(c3__fail); - } else { - return u3ge_lore(lub); - } - } diff --git a/mets/e/loss.c b/mets/e/loss.c deleted file mode 100644 index 9e3474fb01..0000000000 --- a/mets/e/loss.c +++ /dev/null @@ -1,296 +0,0 @@ -/* j/5/loss.c -** -*/ -#include "all.h" - - -/* functions -*/ - typedef struct _u3_loss { // loss problem - u3_noun hel; // a as a list - c3_w lel_w; // length of a - c3_w lev_w; // length of b - u3_noun* hev; // b as an array - u3_noun sev; // b as a set of lists - c3_w kct_w; // candidate count - u3_noun* kad; // candidate array - } u3_loss; - - // free loss object - // - static void - _flem(u3_loss* loc_u) - { - u3z(loc_u->sev); - { - c3_w i_w; - - for ( i_w = 0; i_w < loc_u->kct_w; i_w++ ) { - u3z(loc_u->kad[i_w]); - } - } - free(loc_u->hev); - free(loc_u->kad); - } - - // extract lcs - XX don't use the stack like this - // - static u3_noun - _lext(u3_loss* loc_u, - u3_noun kad) - { - if ( u3_nul == kad ) { - return u3_nul; - } else { - return u3nc(u3k(loc_u->hev[u3r_word(0, u3h(kad))]), - _lext(loc_u, u3t(kad))); - } - } - - // extract lcs - // - static u3_noun - _lexs(u3_loss* loc_u) - { - if ( 0 == loc_u->kct_w ) { - return u3_nul; - } else return u3lb_flop(_lext(loc_u, loc_u->kad[loc_u->kct_w - 1])); - } - - // initialize loss object - // - static void - _lemp(u3_loss* loc_u, - u3_noun hel, - u3_noun hev) - { - loc_u->hel = hel; - loc_u->lel_w = u3lb_lent(u3k(hel)); - - // Read hev into array. - { - c3_w i_w; - - loc_u->hev = c3_malloc(u3lb_lent(u3k(hev)) * sizeof(u3_noun)); - - for ( i_w = 0; u3_nul != hev; i_w++ ) { - loc_u->hev[i_w] = u3h(hev); - hev = u3t(hev); - } - loc_u->lev_w = i_w; - } - loc_u->kct_w = 0; - loc_u->kad = c3_malloc((1 + c3_min(loc_u->lev_w, loc_u->lel_w)) * - sizeof(u3_noun)); - - // Compute equivalence classes. - // - loc_u->sev = u3_nul; - { - c3_w i_w; - - for ( i_w = 0; i_w < loc_u->lev_w; i_w++ ) { - u3_noun how = loc_u->hev[i_w]; - u3_noun hav; - u3_noun teg; - - hav = u3ldb_get(u3k(loc_u->sev), u3k(how)); - teg = u3nc(u3i_words(1, &i_w), - (hav == u3_none) ? u3_nul : hav); - loc_u->sev = u3ldb_put(loc_u->sev, u3k(how), teg); - } - } - } - - // apply - // - static void - _lune(u3_loss* loc_u, - c3_w inx_w, - c3_w goy_w) - { - u3_noun kad; - - kad = u3nc(u3i_words(1, &goy_w), - (inx_w == 0) ? u3_nul - : u3k(loc_u->kad[inx_w - 1])); - if ( loc_u->kct_w == inx_w ) { - c3_assert(loc_u->kct_w < (1 << 31)); - loc_u->kct_w++; - } else { - u3z(loc_u->kad[inx_w]); - } - loc_u->kad[inx_w] = kad; - } - - // extend fits top - // - static u3_noun - _hink(u3_loss* loc_u, - c3_w inx_w, - c3_w goy_w) - { - return __ - ( (loc_u->kct_w == inx_w) || - (u3r_word(0, u3h(loc_u->kad[inx_w])) > goy_w) ); - } - - // extend fits bottom - // - static u3_noun - _lonk(u3_loss* loc_u, - c3_w inx_w, - c3_w goy_w) - { - return __ - ( (0 == inx_w) || - (u3r_word(0, u3h(loc_u->kad[inx_w - 1])) < goy_w) ); - } - -#if 0 - // search for first index >= inx_w and <= max_w that fits - // the hink and lonk criteria. - // - static u3_noun - _binka(u3_loss* loc_u, - c3_w* inx_w, - c3_w max_w, - c3_w goy_w) - { - while ( *inx_w <= max_w ) { - if ( c3n == _lonk(loc_u, *inx_w, goy_w) ) { - return c3n; - } - if ( c3y == _hink(loc_u, *inx_w, goy_w) ) { - return c3y; - } - else ++*inx_w; - } - return c3n; - } -#endif - - // search for lowest index >= inx_w and <= max_w for which - // both hink(inx_w) and lonk(inx_w) are true. lonk is false - // if inx_w is too high, hink is false if it is too low. - // - static u3_noun - _bink(u3_loss* loc_u, - c3_w* inx_w, - c3_w max_w, - c3_w goy_w) - { - c3_assert(max_w >= *inx_w); - - if ( max_w == *inx_w ) { - if ( c3n == _lonk(loc_u, *inx_w, goy_w) ) { - return c3n; - } - if ( c3y == _hink(loc_u, *inx_w, goy_w) ) { - return c3y; - } - else { - ++*inx_w; - return c3n; - } - } - else { - c3_w mid_w = *inx_w + ((max_w - *inx_w) / 2); - - if ( (c3n == _lonk(loc_u, mid_w, goy_w)) || - (c3y == _hink(loc_u, mid_w, goy_w)) ) - { - return _bink(loc_u, inx_w, mid_w, goy_w); - } else { - *inx_w = mid_w + 1; - return _bink(loc_u, inx_w, max_w, goy_w); - } - } - } - - - static void - _merg(u3_loss* loc_u, - c3_w inx_w, - u3_noun gay) - { - if ( (u3_nul == gay) || (inx_w > loc_u->kct_w) ) { - return; - } - else { - u3_noun i_gay = u3h(gay); - c3_w goy_w = u3r_word(0, i_gay); - u3_noun bik; - - bik = _bink(loc_u, &inx_w, loc_u->kct_w, goy_w); - - if ( c3y == bik ) { - _merg(loc_u, inx_w + 1, u3t(gay)); - _lune(loc_u, inx_w, goy_w); - } - else { - _merg(loc_u, inx_w, u3t(gay)); - } - } - } - - // compute lcs - // - static void - _loss(u3_loss* loc_u) - { - while ( u3_nul != loc_u->hel ) { - u3_noun i_hel = u3h(loc_u->hel); - u3_noun guy = u3ldb_get(u3k(loc_u->sev), u3k(i_hel)); - - if ( u3_none != guy ) { - u3_noun gay = u3lb_flop(guy); - - _merg(loc_u, 0, gay); - u3z(gay); - } - - loc_u->hel = u3t(loc_u->hel); - } - } - - u3_noun - u3ge_loss(u3_noun hel, - u3_noun hev) - { - u3_loss loc_u; - u3_noun lcs; - - _lemp(&loc_u, hel, hev); - _loss(&loc_u); - lcs = _lexs(&loc_u); - - _flem(&loc_u); - return lcs; - } - - static u3_noun - _listp(u3_noun lix) - { - while ( 1 ) { - if ( u3_nul == lix ) return c3y; - if ( c3n == u3du(lix) ) return c3n; - lix = u3t(lix); - } - } - - u3_noun - u3ye_loss(u3_noun cor) - { - u3_noun hel, hev; - - if ( (u3_none == (hel = u3r_at(u3x_sam_2, cor))) || - (u3_none == (hev = u3r_at(u3x_sam_3, cor))) || - (c3n == _listp(hel)) || - (c3n == _listp(hev)) ) - { - return u3m_bail(c3__fail); - } else { - return u3ge_loss(hel, hev); - } - } diff --git a/mets/e/lune.c b/mets/e/lune.c deleted file mode 100644 index 17875f0de9..0000000000 --- a/mets/e/lune.c +++ /dev/null @@ -1,55 +0,0 @@ -/* j/5/lune.c -** -*/ -#include "all.h" - - - u3_noun - u3ge_lune(u3_atom lub) - { - if (lub == 0) { - return u3_nul; - } - - { - c3_w end_w = u3r_met(3, lub) - 1; - c3_w pos_w = end_w; - u3_noun lin = u3_nul; - - if (u3r_byte(pos_w, lub) != 10) { - return u3m_error("noeol"); - } - - if (pos_w == 0) { - return u3nc(u3_nul, lin); - } - - while (--pos_w) { - if (u3r_byte(pos_w, lub) == 10) { - lin = u3nc(u3gc_cut(3, (pos_w + 1), (end_w - pos_w - 1), lub), lin); - end_w = pos_w; - } - } - - if (u3r_byte(pos_w, lub) == 10) { - return u3nc(u3_nul, - u3nc(u3gc_cut(3, (pos_w + 1), (end_w - pos_w - 1), lub), lin)); - } - - return u3nc(u3gc_cut(3, pos_w, (end_w - pos_w), lub), lin); - } - } - - u3_noun - u3ye_lune(u3_noun cor) - { - u3_noun lub; - - if ( (u3_none == (lub = u3r_at(u3x_sam, cor))) || - (c3n == u3ud(lub)) ) - { - return u3m_bail(c3__fail); - } else { - return u3ge_lune(lub); - } - } diff --git a/mets/e/mat.c b/mets/e/mat.c deleted file mode 100644 index f2032eaaa1..0000000000 --- a/mets/e/mat.c +++ /dev/null @@ -1,50 +0,0 @@ -/* j/3/mat.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3ge_mat(u3_atom a) - { - if ( 0 == a ) { - return u3nc(1, 1); - } else { - u3_atom b = u3gc_met(0, a); - u3_atom c = u3gc_met(0, b); - u3_atom u, v, w, x, y, z; - u3_atom p, q; - - u = u3ga_dec(c); - v = u3ga_add(c, c); - w = u3gc_bex(c); - x = u3gc_end(0, u, b); - y = u3gc_lsh(0, u, a); - z = u3gc_mix(x, y); - - p = u3ga_add(v, b); - q = u3gc_cat(0, w, z); - - u3z(u); - u3z(v); - u3z(w); - u3z(x); - u3z(y); - u3z(z); - - return u3nc(p, q); - } - } - u3_noun - u3ye_mat(u3_noun cor) - { - u3_noun a; - - if ( (u3_none == (a = u3r_at(u3x_sam, cor))) ) { - return u3m_bail(c3__fail); - } else { - return u3ge_mat(a); - } - } diff --git a/mets/e/mink.c b/mets/e/mink.c deleted file mode 100644 index 988a9abd39..0000000000 --- a/mets/e/mink.c +++ /dev/null @@ -1,25 +0,0 @@ -/* j/5/mink.c -** -*/ -#include "all.h" - - u3_noun - u3ye_mink(u3_noun cor) - { - u3_noun bus, fol, gul; - - if ( c3n == u3r_mean(cor, u3x_sam_4, &bus, - u3x_sam_5, &fol, - u3x_sam_3, &gul, - 0) ) - { - return u3m_bail(c3__exit); - } - else { - u3_noun som; - - som = u3n_nock_et(u3k(gul), u3k(bus), u3k(fol)); - - return som; - } - } diff --git a/mets/e/mule.c b/mets/e/mule.c deleted file mode 100644 index 94f0d7b179..0000000000 --- a/mets/e/mule.c +++ /dev/null @@ -1,23 +0,0 @@ -/* j/5/mule.c -** -*/ -#include "all.h" - - u3_noun - u3ye_mule(u3_noun cor) - { - u3_noun tap; - - if ( c3n == u3r_mean(cor, u3x_sam, &tap, 0) ) { - return u3m_bail(c3__exit); - } - else { - u3_noun hok = u3j_hook(u3k(cor), "mute"); - - /* this takes advantage of the fact that mute's result, at the typeless - * C/Nock level, is identical to what a typed mule would produce, - * without running the formula twice. - */ - return u3n_slam_on(hok, u3k(tap)); - } - } diff --git a/mets/e/parse.c b/mets/e/parse.c deleted file mode 100644 index 0363aa412d..0000000000 --- a/mets/e/parse.c +++ /dev/null @@ -1,974 +0,0 @@ -/* j/5/parse.c -** -*/ -#include "all.h" - - - static u3_noun - _slip(u3_noun weq, - u3_noun naz) - { - u3_noun p_naz, q_naz; - - u3x_cell(naz, &p_naz, &q_naz); - if ( 10 == weq ) { - return u3nc(u3x_good(u3i_vint(u3k(p_naz))), - 1); - } else { - return u3nc(u3k(p_naz), - u3x_good(u3i_vint(u3k(q_naz)))); - } - } - - static u3_noun - _fail(u3_noun tub) - { - u3_noun p_tub, q_tub; - - u3x_cell(tub, &p_tub, &q_tub); - return u3nc(u3k(p_tub), u3_nul); - } - - static u3_noun - _last(u3_noun zyc, - u3_noun naz) - { - u3_noun p_zyc, q_zyc, p_naz, q_naz; - - u3x_cell(zyc, &p_zyc, &q_zyc); - u3x_cell(naz, &p_naz, &q_naz); - - if ( !_(u3a_is_cat(p_zyc)) || !_(u3a_is_cat(q_zyc)) || - !_(u3a_is_cat(p_naz)) || !_(u3a_is_cat(q_naz)) ) - { - return u3m_bail(c3__fail); - } else { - if ( p_zyc == p_naz ) { - return (q_zyc > q_naz) ? u3k(zyc) : u3k(naz); - } - else { - return (p_zyc > p_naz) ? u3k(zyc) : u3k(naz); - } - } - } - - static u3_noun - _next(u3_noun tub) - { - u3_noun p_tub, q_tub; - u3_noun zac; - - u3x_cell(tub, &p_tub, &q_tub); - if ( c3n == u3du(q_tub) ) { - return _fail(tub); - } - else { - u3_noun iq_tub = u3h(q_tub); - u3_noun tq_tub = u3t(q_tub); - - zac = _slip(iq_tub, p_tub); - - return u3nc(zac, - u3nq(u3_nul, - u3k(iq_tub), - u3k(zac), - u3k(tq_tub))); - } - } - -/* bend -*/ - static u3_noun - _cqe_bend_fun(u3_noun raq, - u3_noun vex, - u3_noun sab) - { - u3_noun p_vex, q_vex; - - u3x_cell(vex, &p_vex, &q_vex); - if ( c3n == u3du(q_vex) ) { - return u3k(vex); - } else { - u3_noun uq_vex = u3t(q_vex); - u3_noun puq_vex, quq_vex; - u3_noun yit, yur; - u3_noun p_yit, q_yit; - u3_noun ret; - - u3x_cell(uq_vex, &puq_vex, &quq_vex); - yit = u3x_good(u3n_slam_on(u3k(sab), u3k(quq_vex))); - - u3x_cell(yit, &p_yit, &q_yit); - yur = _last(p_vex, p_yit); - - if ( c3n == u3du(q_yit) ) { - ret = u3nc(yur, u3k(q_vex)); - } - else { - u3_noun uq_yit = u3t(q_yit); - u3_noun puq_yit, quq_yit; - u3_noun vux; - - u3x_cell(uq_yit, &puq_yit, &quq_yit); - - vux = u3x_good(u3n_slam_on(u3k(raq), - u3nc(u3k(puq_vex), - u3k(puq_yit)))); - if ( u3_nul == vux ) { - ret = u3nc(yur, u3k(q_vex)); - } - else { - ret = u3nq(yur, - u3_nul, - u3k(u3t(vux)), - u3k(quq_yit)); - u3z(vux); - } - } - u3z(yit); - return ret; - } - } - - u3_noun - u3ye_bend_fun(u3_noun cor) - { - u3_noun van, raq, vex, sab; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &vex, - u3x_sam_3, &sab, - u3x_con, &van, 0)) || - (u3_none == (raq = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return _cqe_bend_fun(raq, vex, sab); - } - } - -/* cold -*/ - static u3_noun - _cqe_cold_fun(u3_noun cus, - u3_noun sef, - u3_noun tub) - { - u3_noun vex = u3x_good(u3n_slam_on(u3k(sef), u3k(tub))); - u3_noun p_vex, q_vex; - - u3x_cell(vex, &p_vex, &q_vex); - - if ( c3n == u3du(q_vex) ) { - return vex; - } - else { - u3_noun uq_vex = u3t(q_vex); - u3_noun quq_vex; - u3_noun ret; - - u3x_cell(uq_vex, 0, &quq_vex); - ret = u3nq(u3k(p_vex), - u3_nul, - u3k(cus), - u3k(quq_vex)); - - u3z(vex); - return ret; - } - } - - u3_noun - u3ye_cold_fun(u3_noun cor) - { - u3_noun van, cus, sef, tub; - - if ( (c3n == u3r_mean(cor, u3x_sam, &tub, u3x_con, &van, 0)) || - (c3n == u3r_mean(van, u3x_sam_2, &cus, u3x_sam_3, &sef, 0)) ) - { - return u3m_bail(c3__fail); - } else { - return _cqe_cold_fun(cus, sef, tub); - } - } - -/* cook -*/ - static u3_noun - _cqe_cook_fun(u3_noun poq, - u3_noun sef, - u3_noun tub) - { - u3_noun vex = u3x_good(u3n_slam_on(u3k(sef), u3k(tub))); - u3_noun p_vex, q_vex; - - u3x_cell(vex, &p_vex, &q_vex); - - if ( c3n == u3du(q_vex) ) { - return vex; - } - else { - u3_noun uq_vex = u3t(q_vex); - u3_noun puq_vex, quq_vex; - u3_noun wag; - u3_noun ret; - - u3x_cell(uq_vex, &puq_vex, &quq_vex); - wag = u3x_good(u3n_slam_on(u3k(poq), u3k(puq_vex))); - ret = u3nq(u3k(p_vex), - u3_nul, - wag, - u3k(quq_vex)); - - u3z(vex); - return ret; - } - } - - u3_noun - u3ye_cook_fun(u3_noun cor) - { - u3_noun van, poq, sef, tub; - - if ( (c3n == u3r_mean(cor, u3x_sam, &tub, u3x_con, &van, 0)) || - (c3n == u3r_mean(van, u3x_sam_2, &poq, u3x_sam_3, &sef, 0)) ) - { - return u3m_bail(c3__fail); - } else { - return _cqe_cook_fun(poq, sef, tub); - } - } - -/* comp -*/ - static u3_noun - _cqe_comp_fun(u3_noun raq, - u3_noun vex, - u3_noun sab) - { - u3_noun p_vex, q_vex; - - u3x_cell(vex, &p_vex, &q_vex); - if ( c3n == u3du(q_vex) ) { - return u3k(vex); - } else { - u3_noun uq_vex = u3t(q_vex); - u3_noun puq_vex, quq_vex; - u3_noun yit, yur; - u3_noun p_yit, q_yit; - u3_noun ret; - - u3x_cell(uq_vex, &puq_vex, &quq_vex); - yit = u3x_good(u3n_slam_on(u3k(sab), u3k(quq_vex))); - - u3x_cell(yit, &p_yit, &q_yit); - yur = _last(p_vex, p_yit); - - if ( c3n == u3du(q_yit) ) { - ret = u3nc(yur, u3k(q_yit)); - } - else { - u3_noun uq_yit = u3t(q_yit); - u3_noun puq_yit, quq_yit; - - u3x_cell(uq_yit, &puq_yit, &quq_yit); - ret = u3nq(yur, - u3_nul, - u3x_good(u3n_slam_on(u3k(raq), - u3nc(u3k(puq_vex), - u3k(puq_yit)))), - u3k(quq_yit)); - } - u3z(yit); - return ret; - } - } - - u3_noun - u3ye_comp_fun(u3_noun cor) - { - u3_noun van, raq, vex, sab; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &vex, - u3x_sam_3, &sab, - u3x_con, &van, 0)) || - (u3_none == (raq = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return _cqe_comp_fun(raq, vex, sab); - } - } - -/* easy -*/ - static u3_noun - _cqe_easy_fun(u3_noun huf, - u3_noun tub) - { - u3_noun p_tub, q_tub; - - u3x_cell(tub, &p_tub, &q_tub); - return u3nq(u3k(p_tub), - u3_nul, - u3k(huf), - u3k(tub)); - } - - u3_noun - u3ye_easy_fun(u3_noun cor) - { - u3_noun van, huf, tub; - - if ( (c3n == u3r_mean(cor, u3x_sam, &tub, u3x_con, &van, 0)) || - (u3_none == (huf = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return _cqe_easy_fun(huf, tub); - } - } - -/* glue -*/ - static u3_noun - _cqe_glue_fun(u3_noun bus, - u3_noun vex, - u3_noun sab) - { - u3_noun p_vex, q_vex; - - u3x_cell(vex, &p_vex, &q_vex); - if ( c3n == u3du(q_vex) ) { - return u3k(vex); - } - else { - u3_noun uq_vex = u3t(q_vex); - u3_noun puq_vex, quq_vex; - u3_noun yit, yur; - u3_noun p_yit, q_yit; - u3_noun ret; - - u3x_cell(uq_vex, &puq_vex, &quq_vex); - yit = u3x_good(u3n_slam_on(u3k(bus), u3k(quq_vex))); - - u3x_cell(yit, &p_yit, &q_yit); - yur = _last(p_vex, p_yit); - - if ( c3n == u3du(q_yit) ) { - ret = u3nc(yur, u3_nul); - } - else { - u3_noun uq_yit = u3t(q_yit); - u3_noun puq_yit, quq_yit; - u3_noun wam, p_wam, q_wam, goy; - - u3x_cell(uq_yit, &puq_yit, &quq_yit); - wam = u3x_good(u3n_slam_on(u3k(sab), u3k(quq_yit))); - - u3x_cell(wam, &p_wam, &q_wam); - goy = _last(yur, p_wam); - u3z(yur); - - if ( c3n == u3du(q_wam) ) { - ret = u3nc(goy, u3_nul); - } else { - u3_noun uq_wam = u3t(q_wam); - u3_noun puq_wam, quq_wam; - - u3x_cell(uq_wam, &puq_wam, &quq_wam); - ret = u3nq(goy, - u3_nul, - u3nc(u3k(puq_vex), - u3k(puq_wam)), - u3k(quq_wam)); - } - u3z(wam); - } - u3z(yit); - return ret; - } - } - - u3_noun - u3ye_glue_fun(u3_noun cor) - { - u3_noun van, bus, vex, sab; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &vex, - u3x_sam_3, &sab, - u3x_con, &van, 0)) || - (u3_none == (bus = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return _cqe_glue_fun(bus, vex, sab); - } - } - -/* here -*/ - static u3_noun - _cqe_here_fun(u3_noun hez, - u3_noun sef, - u3_noun tub) - { - u3_noun vex = u3x_good(u3n_slam_on(u3k(sef), u3k(tub))); - u3_noun p_vex, q_vex; - - u3x_cell(vex, &p_vex, &q_vex); - - if ( c3n == u3du(q_vex) ) { - return vex; - } - else { - u3_noun uq_vex = u3t(q_vex); - u3_noun p_tub, q_tub; - u3_noun puq_vex, quq_vex, pquq_vex; - u3_noun gud, wag; - u3_noun ret; - - u3x_cell(tub, &p_tub, &q_tub); - u3x_cell(uq_vex, &puq_vex, &quq_vex); - u3x_cell(quq_vex, &pquq_vex, 0); - gud = u3nc( - u3nc(u3k(p_tub), - u3k(pquq_vex)), - u3k(puq_vex)); - - wag = u3x_good(u3n_slam_on(u3k(hez), gud)); - ret = u3nq(u3k(p_vex), - u3_nul, - wag, - u3k(quq_vex)); - - u3z(vex); - return ret; - } - } - - u3_noun - u3ye_here_fun(u3_noun cor) - { - u3_noun van, hez, sef, tub; - - if ( (c3n == u3r_mean(cor, u3x_sam, &tub, u3x_con, &van, 0)) || - (c3n == u3r_mean(van, u3x_sam_2, &hez, u3x_sam_3, &sef, 0)) ) - { - return u3m_bail(c3__fail); - } - else { - return _cqe_here_fun(hez, sef, tub); - } - } - -/* just -*/ - static u3_noun - _cqe_just_fun(u3_noun daf, - u3_noun tub) - { - u3_noun p_tub, q_tub; - - u3x_cell(tub, &p_tub, &q_tub); - - if ( c3n == u3du(q_tub) ) { - return _fail(tub); - } - else { - u3_noun iq_tub = u3h(q_tub); - - if ( c3y == u3r_sing(daf, iq_tub) ) { - return _next(tub); - } - else return _fail(tub); - } - } - u3_noun - u3ye_just_fun(u3_noun cor) - { - u3_noun van, daf, tub; - - if ( (c3n == u3r_mean(cor, u3x_sam, &tub, u3x_con, &van, 0)) || - (u3_none == (daf = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return _cqe_just_fun(daf, tub); - } - } - -/* mask -*/ - static u3_noun - _cqe_mask_fun(u3_noun bud, - u3_noun tub) - { - u3_noun p_tub, q_tub; - - u3x_cell(tub, &p_tub, &q_tub); - - if ( c3n == u3du(q_tub) ) { - return _fail(tub); - } - else { - u3_noun iq_tub = u3h(q_tub); - - while ( c3y == u3du(bud) ) { - if ( c3y == u3r_sing(u3h(bud), iq_tub) ) { - return _next(tub); - } - bud = u3t(bud); - } - return _fail(tub); - } - } - u3_noun - u3ye_mask_fun(u3_noun cor) - { - u3_noun van, bud, tub; - - if ( (c3n == u3r_mean(cor, u3x_sam, &tub, u3x_con, &van, 0)) || - (u3_none == (bud = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return _cqe_mask_fun(bud, tub); - } - } -/* pfix -*/ - static u3_noun - _cqe_pfix(u3_noun vex, - u3_noun sab) - { - u3_noun p_vex, q_vex; - - u3x_cell(vex, &p_vex, &q_vex); - if ( c3n == u3du(q_vex) ) { - return u3k(vex); - } - else { - u3_noun uq_vex = u3t(q_vex); - u3_noun puq_vex, quq_vex; - u3_noun yit, p_yit, q_yit; - u3_noun ret; - - u3x_cell(uq_vex, &puq_vex, &quq_vex); - yit = u3x_good(u3n_slam_on(u3k(sab), u3k(quq_vex))); - - u3x_cell(yit, &p_yit, &q_yit); - ret = u3nc(_last(p_vex, p_yit), - u3k(q_yit)); - - u3z(yit); - return ret; - } - } - u3_noun - u3ye_pfix(u3_noun cor) - { - u3_noun vex, sab; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &vex, u3x_sam_3, &sab, 0)) ) { - return u3m_bail(c3__exit); - } else { - return _cqe_pfix(vex, sab); - } - } - -/* plug -*/ - static u3_noun - _cqe_plug(u3_noun vex, - u3_noun sab) - { - u3_noun p_vex, q_vex; - - u3x_cell(vex, &p_vex, &q_vex); - if ( c3n == u3du(q_vex) ) { - return u3k(vex); - } - else { - u3_noun uq_vex = u3t(q_vex); - u3_noun puq_vex, quq_vex; - u3_noun yit, yur; - u3_noun p_yit, q_yit; - u3_noun ret; - - u3x_cell(uq_vex, &puq_vex, &quq_vex); - yit = u3x_good(u3n_slam_on(u3k(sab), u3k(quq_vex))); - - u3x_cell(yit, &p_yit, &q_yit); - yur = _last(p_vex, p_yit); - - if ( c3n == u3du(q_yit) ) { - ret = u3nc(yur, u3k(q_yit)); - } - else { - u3_noun uq_yit = u3t(q_yit); - u3_noun puq_yit, quq_yit; - - u3x_cell(uq_yit, &puq_yit, &quq_yit); - ret = u3nq(yur, - u3_nul, - u3nc(u3k(puq_vex), - u3k(puq_yit)), - u3k(quq_yit)); - } - u3z(yit); - return ret; - } - } - u3_noun - u3ye_plug(u3_noun cor) - { - u3_noun vex, sab; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &vex, u3x_sam_3, &sab, 0)) ) { - return u3m_bail(c3__exit); - } else { - return _cqe_plug(vex, sab); - } - } - -/* pose -*/ - u3_noun - u3ge_pose(u3_noun vex, - u3_noun sab) - { - u3_noun p_vex, q_vex; - - u3x_cell(vex, &p_vex, &q_vex); - if ( c3y == u3du(q_vex) ) { - return u3k(vex); - } else { - u3_noun roq = u3x_good(u3n_kick_on(u3k(sab))); - u3_noun p_roq, q_roq; - u3_noun ret; - - u3x_cell(roq, &p_roq, &q_roq); - ret = u3nc(_last(p_vex, p_roq), - u3k(q_roq)); - - u3z(roq); - return ret; - } - } - u3_noun - u3ye_pose(u3_noun cor) - { - u3_noun vex, sab; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &vex, u3x_sam_3, &sab, 0)) ) { - return u3m_bail(c3__exit); - } else { - return u3ge_pose(vex, sab); - } - } - -/* sfix -*/ - static u3_noun - _cqe_sfix(u3_noun vex, - u3_noun sab) - { - u3_noun p_vex, q_vex; - - u3x_cell(vex, &p_vex, &q_vex); - if ( c3n == u3du(q_vex) ) { - return u3k(vex); - } - else { - u3_noun uq_vex = u3t(q_vex); - u3_noun puq_vex, quq_vex; - u3_noun yit, p_yit, q_yit, yur; - u3_noun ret; - - u3x_cell(uq_vex, &puq_vex, &quq_vex); - yit = u3x_good(u3n_slam_on(u3k(sab), u3k(quq_vex))); - - u3x_cell(yit, &p_yit, &q_yit); - yur = _last(p_vex, p_yit); - - if ( c3n == u3du(q_yit) ) { - ret = u3nc(yur, u3_nul); - } - else { - u3_noun uq_yit = u3t(q_yit); - u3_noun puq_yit, quq_yit; - - u3x_cell(uq_yit, &puq_yit, &quq_yit); - - ret = u3nq(yur, - u3_nul, - u3k(puq_vex), - u3k(quq_yit)); - } - u3z(yit); - return ret; - } - } - u3_noun - u3ye_sfix(u3_noun cor) - { - u3_noun vex, sab; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &vex, u3x_sam_3, &sab, 0)) ) { - return u3m_bail(c3__exit); - } else { - return _cqe_sfix(vex, sab); - } - } - -/* shim -*/ - static u3_noun - _cqe_shim_fun(u3_noun zep, - u3_noun tub) - { - u3_noun p_tub, q_tub; - - u3x_cell(tub, &p_tub, &q_tub); - - if ( c3n == u3du(q_tub) ) { - return _fail(tub); - } - else { - u3_noun p_zep, q_zep; - u3_noun iq_tub = u3h(q_tub); - - u3x_cell(zep, &p_zep, &q_zep); - if ( _(u3a_is_cat(p_zep)) && - _(u3a_is_cat(q_zep)) && - _(u3a_is_cat(iq_tub)) ) - { - if ( (iq_tub >= p_zep) && (iq_tub <= q_zep) ) { - return _next(tub); - } - else return _fail(tub); - } - else { - return u3m_bail(c3__fail); - } - } - } - u3_noun - u3ye_shim_fun(u3_noun cor) - { - u3_noun van, zep, tub; - - if ( (c3n == u3r_mean(cor, u3x_sam, &tub, u3x_con, &van, 0)) || - (u3_none == (zep = u3r_at(u3x_sam, van))) ) - { - return u3m_bail(c3__fail); - } else { - return _cqe_shim_fun(zep, tub); - } - } - -/* stag -*/ - static u3_noun - _cqe_stag_fun(u3_noun gob, - u3_noun sef, - u3_noun tub) - { - u3_noun vex = u3x_good(u3n_slam_on(u3k(sef), u3k(tub))); - u3_noun p_vex, q_vex; - - u3x_cell(vex, &p_vex, &q_vex); - - if ( c3n == u3du(q_vex) ) { - return vex; - } - else { - u3_noun uq_vex = u3t(q_vex); - u3_noun puq_vex, quq_vex; - u3_noun wag; - u3_noun ret; - - u3x_cell(uq_vex, &puq_vex, &quq_vex); - wag = u3nc(u3k(gob), u3k(puq_vex)); - ret = u3nq(u3k(p_vex), - u3_nul, - wag, - u3k(quq_vex)); - - u3z(vex); - return ret; - } - } - - u3_noun - u3ye_stag_fun(u3_noun cor) - { - u3_noun van, gob, sef, tub; - - if ( (c3n == u3r_mean(cor, u3x_sam, &tub, u3x_con, &van, 0)) || - (c3n == u3r_mean(van, u3x_sam_2, &gob, u3x_sam_3, &sef, 0)) ) - { - return u3m_bail(c3__fail); - } else { - return _cqe_stag_fun(gob, sef, tub); - } - } - -/* stew -*/ - static u3_noun - _stew_wor(u3_noun ort, - u3_noun wan) - { - if ( !_(u3a_is_cat(ort)) ) { - return u3m_bail(c3__fail); - } - else { - if ( c3n == u3du(wan) ) { - if ( !_(u3a_is_cat(wan)) ) { - return u3m_bail(c3__fail); - } - else return (ort < wan) ? c3y : c3n; - } - else { - u3_noun h_wan = u3h(wan); - - if ( !_(u3a_is_cat(h_wan)) ) { - return u3m_bail(c3__fail); - } - else return (ort < h_wan) ? c3y : c3n; - } - } - } - - static u3_noun - _cqe_stew_fun(u3_noun hel, - u3_noun tub) - { - u3_noun p_tub, q_tub; - - u3x_cell(tub, &p_tub, &q_tub); - if ( c3n == u3du(q_tub) ) { - return _fail(tub); - } - else { - u3_noun iq_tub = u3h(q_tub); - - if ( !_(u3a_is_cat(iq_tub)) ) { - return u3m_bail(c3__fail); - } - else while ( 1 ) { - if ( c3n == u3du(hel) ) { - return _fail(tub); - } - else { - u3_noun n_hel, l_hel, r_hel; - u3_noun pn_hel, qn_hel; - c3_o bit_o; - - u3x_trel(hel, &n_hel, &l_hel, &r_hel); - u3x_cell(n_hel, &pn_hel, &qn_hel); - - if ( (c3n == u3du(pn_hel)) ) { - bit_o = __((iq_tub == pn_hel)); - } - else { - u3_noun hpn_hel = u3h(pn_hel); - u3_noun tpn_hel = u3t(pn_hel); - - if ( !_(u3a_is_cat(hpn_hel)) || - !_(u3a_is_cat(tpn_hel)) ) { - return _fail(tub); - } - else bit_o = __((iq_tub >= hpn_hel) && (iq_tub <= tpn_hel)); - } - - if ( c3y == bit_o ) { - return u3x_good - (u3n_slam_on(u3k(qn_hel), u3k(tub))); - } else { - if ( c3y == _stew_wor(iq_tub, pn_hel) ) { - hel = l_hel; - } - else hel = r_hel; - } - } - } - } - } - u3_noun - u3ye_stew_fun(u3_noun cor) - { - u3_noun con, hel, tub; - - if ( (c3n == u3r_mean(cor, u3x_sam, &tub, u3x_con, &con, 0)) || - (u3_none == (hel = u3r_at(2, con))) ) - { - return u3m_bail(c3__fail); - } else { - return _cqe_stew_fun(hel, tub); - } - } - -/* stir -*/ - static u3_noun - _cqe_stir_fun(u3_noun rud, - u3_noun raq, - u3_noun fel, - u3_noun tub) - { - u3_noun vex = u3x_good(u3n_slam_on(u3k(fel), u3k(tub))); - u3_noun p_vex, q_vex; - u3_noun ret; - - u3x_cell(vex, &p_vex, &q_vex); - if ( c3n == u3du(q_vex) ) { - ret = u3nq(u3k(p_vex), - u3_nul, - u3k(rud), - u3k(tub)); - } - else { - u3_noun uq_vex = u3t(q_vex); - u3_noun puq_vex, quq_vex; - u3_noun wag, p_wag, q_wag, uq_wag, puq_wag, quq_wag; - - u3x_cell(uq_vex, &puq_vex, &quq_vex); - wag = _cqe_stir_fun(rud, raq, fel, quq_vex); - - u3x_cell(wag, &p_wag, &q_wag); - if ( c3n == u3du(q_wag) ) { - return u3m_bail(c3__fail); - } - uq_wag = u3t(q_wag); - u3x_cell(uq_wag, &puq_wag, &quq_wag); - - ret = u3nq(_last(p_vex, p_wag), - u3_nul, - u3x_good(u3n_slam_on(u3k(raq), - u3nc(u3k(puq_vex), - u3k(puq_wag)))), - u3k(quq_wag)); - u3z(wag); - } - u3z(vex); - return ret; - } - - u3_noun - u3ye_stir_fun(u3_noun cor) - { - u3_noun van, rud, raq, fel, tub; - - if ( (c3n == u3r_mean(cor, u3x_sam, &tub, u3x_con, &van, 0)) || - (c3n == u3r_mean(van, u3x_sam_2, &rud, - u3x_sam_6, &raq, - u3x_sam_7, &fel, - 0)) ) - { - return u3m_bail(c3__fail); - } else { - return _cqe_stir_fun(rud, raq, fel, tub); - } - } diff --git a/mets/e/rd.c b/mets/e/rd.c deleted file mode 100644 index f3a422b47b..0000000000 --- a/mets/e/rd.c +++ /dev/null @@ -1,390 +0,0 @@ -/* j/e/rd.c -** -*/ -#include "all.h" -#include "softfloat.h" - -#define DOUBNAN 0x7ff8000000000000 - - union doub { - float64_t d; - c3_d c; - }; - -/* functions -*/ - static inline c3_t - _nan_test(float64_t a) - { - return !f64_eq(a, a); - } - - static inline float64_t - _nan_unify(float64_t a) - { - if ( _nan_test(a) ) - { - *(c3_d*)(&a) = DOUBNAN; - } - return a; - } - - static inline void - _set_rounding(c3_w a) - { - switch ( a ) - { - default: - u3m_bail(c3__fail); - break; - case c3__n: - softfloat_roundingMode = softfloat_round_near_even; - break; - case c3__z: - softfloat_roundingMode = softfloat_round_minMag; - break; - case c3__u: - softfloat_roundingMode = softfloat_round_max; - break; - case c3__d: - softfloat_roundingMode = softfloat_round_min; - break; - } - } - -/* add -*/ - u3_noun - u3ger_add(u3_atom a, - u3_atom b, - u3_atom r) - { - union doub c, d, e; - _set_rounding(r); - c.c = u3r_chub(0, a); - d.c = u3r_chub(0, b); - e.d = _nan_unify(f64_add(c.d, d.d)); - - return u3i_chubs(1, &e.c); - } - - u3_noun - u3yer_add(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3ger_add(a, b, u3x_at(30, cor)); - } - } - -/* sub -*/ - u3_noun - u3ger_sub(u3_atom a, - u3_atom b, - u3_atom r) - { - union doub c, d, e; - _set_rounding(r); - c.c = u3r_chub(0, a); - d.c = u3r_chub(0, b); - e.d = _nan_unify(f64_sub(c.d, d.d)); - - return u3i_chubs(1, &e.c); - } - - u3_noun - u3yer_sub(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3ger_sub(a, b, u3x_at(30, cor)); - } - } - -/* mul -*/ - u3_noun - u3ger_mul(u3_atom a, - u3_atom b, - u3_atom r) - { - union doub c, d, e; - _set_rounding(r); - c.c = u3r_chub(0, a); - d.c = u3r_chub(0, b); - e.d = _nan_unify(f64_mul(c.d, d.d)); - - return u3i_chubs(1, &e.c); - } - - u3_noun - u3yer_mul(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3ger_mul(a, b, u3x_at(30, cor)); - } - } - -/* div -*/ - u3_noun - u3ger_div(u3_atom a, - u3_atom b, - u3_atom r) - { - union doub c, d, e; - _set_rounding(r); - c.c = u3r_chub(0, a); - d.c = u3r_chub(0, b); - e.d = _nan_unify(f64_div(c.d, d.d)); - - return u3i_chubs(1, &e.c); - } - - u3_noun - u3yer_div(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3ger_div(a, b, u3x_at(30, cor)); - } - } - -/* sqt -*/ - u3_noun - u3ger_sqt(u3_atom a, - u3_atom r) - { - union doub c, d; - _set_rounding(r); - c.c = u3r_chub(0, a); - d.d = _nan_unify(f64_sqrt(c.d)); - - return u3i_chubs(1, &d.c); - } - - u3_noun - u3yer_sqt(u3_noun cor) - { - u3_noun a; - - if ( c3n == (a = u3r_at(u3x_sam, cor)) || - c3n == u3ud(a) ) - { - return u3m_bail(c3__exit); - } - else { - return u3ger_sqt(a, u3x_at(30, cor)); - } - } - -/* fma -*/ - u3_noun - u3ger_fma(u3_atom a, - u3_atom b, - u3_atom c, - u3_atom r) - { - union doub d, e, f, g; - _set_rounding(r); - d.c = u3r_chub(0, a); - e.c = u3r_chub(0, b); - f.c = u3r_chub(0, c); - g.d = _nan_unify(f64_mulAdd(d.d, e.d, f.d)); - - return u3i_chubs(1, &g.c); - } - - u3_noun - u3yer_fma(u3_noun cor) - { - u3_noun a, b, c; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_6, &b, u3x_sam_7, &c, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) || - c3n == u3ud(c) ) - { - return u3m_bail(c3__exit); - } - else { - return u3ger_fma(a, b, c, u3x_at(30, cor)); - } - } - -/* lth -*/ - u3_noun - u3ger_lth(u3_atom a, - u3_atom b) - { - union doub c, d; - c.c = u3r_chub(0, a); - d.c = u3r_chub(0, b); - - return __(f64_lt(c.d, d.d)); - } - - u3_noun - u3yer_lth(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3ger_lth(a, b); - } - } - -/* lte -*/ - u3_noun - u3ger_lte(u3_atom a, - u3_atom b) - { - union doub c, d; - c.c = u3r_chub(0, a); - d.c = u3r_chub(0, b); - - return __(f64_le(c.d, d.d)); - } - - u3_noun - u3yer_lte(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3ger_lte(a, b); - } - } - -/* equ -*/ - u3_noun - u3ger_equ(u3_atom a, - u3_atom b) - { - union doub c, d; - c.c = u3r_chub(0, a); - d.c = u3r_chub(0, b); - - return __(f64_eq(c.d, d.d)); - } - - u3_noun - u3yer_equ(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3ger_equ(a, b); - } - } - -/* gte -*/ - u3_noun - u3ger_gte(u3_atom a, - u3_atom b) - { - union doub c, d; - c.c = u3r_chub(0, a); - d.c = u3r_chub(0, b); - - return __(f64_le(d.d, c.d)); - } - - u3_noun - u3yer_gte(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3ger_gte(a, b); - } - } - -/* gth -*/ - u3_noun - u3ger_gth(u3_atom a, - u3_atom b) - { - union doub c, d; - c.c = u3r_chub(0, a); - d.c = u3r_chub(0, b); - - return __(f64_lt(d.d, c.d)); - } - - u3_noun - u3yer_gth(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3ger_gth(a, b); - } - } diff --git a/mets/e/rh.c b/mets/e/rh.c deleted file mode 100644 index 0738a5d15b..0000000000 --- a/mets/e/rh.c +++ /dev/null @@ -1,390 +0,0 @@ -/* j/e/rh.c -** -*/ -#include "all.h" -#include "softfloat.h" - -#define HALFNAN 0x7e00 - - union half { - float16_t h; - c3_s c; - }; - -/* functions -*/ - static inline c3_t - _nan_test(float16_t a) - { - return !f16_eq(a, a); - } - - static inline float16_t - _nan_unify(float16_t a) - { - if ( _nan_test(a) ) - { - *(c3_s*)(&a) = HALFNAN; - } - return a; - } - - static inline void - _set_rounding(c3_w a) - { - switch ( a ) - { - default: - u3m_bail(c3__fail); - break; - case c3__n: - softfloat_roundingMode = softfloat_round_near_even; - break; - case c3__z: - softfloat_roundingMode = softfloat_round_minMag; - break; - case c3__u: - softfloat_roundingMode = softfloat_round_max; - break; - case c3__d: - softfloat_roundingMode = softfloat_round_min; - break; - } - } - -/* add -*/ - u3_noun - u3ges_add(u3_atom a, - u3_atom b, - u3_atom r) - { - union half c, d, e; - _set_rounding(r); - c.c = u3r_word(0, a); - d.c = u3r_word(0, b); - e.h = _nan_unify(f16_add(c.h, d.h)); - - return e.c; - } - - u3_noun - u3yes_add(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3ges_add(a, b, u3x_at(30, cor)); - } - } - -/* sub -*/ - u3_noun - u3ges_sub(u3_atom a, - u3_atom b, - u3_atom r) - { - union half c, d, e; - _set_rounding(r); - c.c = u3r_word(0, a); - d.c = u3r_word(0, b); - e.h = _nan_unify(f16_sub(c.h, d.h)); - - return e.c; - } - - u3_noun - u3yes_sub(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3ges_sub(a, b, u3x_at(30, cor)); - } - } - -/* mul -*/ - u3_noun - u3ges_mul(u3_atom a, - u3_atom b, - u3_atom r) - { - union half c, d, e; - _set_rounding(r); - c.c = u3r_word(0, a); - d.c = u3r_word(0, b); - e.h = _nan_unify(f16_mul(c.h, d.h)); - - return e.c; - } - - u3_noun - u3yes_mul(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3ges_mul(a, b, u3x_at(30, cor)); - } - } - -/* div -*/ - u3_noun - u3ges_div(u3_atom a, - u3_atom b, - u3_atom r) - { - union half c, d, e; - _set_rounding(r); - c.c = u3r_word(0, a); - d.c = u3r_word(0, b); - e.h = _nan_unify(f16_div(c.h, d.h)); - - return e.c; - } - - u3_noun - u3yes_div(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3ges_div(a, b, u3x_at(30, cor)); - } - } - -/* sqt -*/ - u3_noun - u3ges_sqt(u3_atom a, - u3_atom r) - { - union half c, d; - _set_rounding(r); - c.c = u3r_word(0, a); - d.h = _nan_unify(f16_sqrt(c.h)); - - return d.c; - } - - u3_noun - u3yes_sqt(u3_noun cor) - { - u3_noun a; - - if ( c3n == (a = u3r_at(u3x_sam, cor)) || - c3n == u3ud(a) ) - { - return u3m_bail(c3__exit); - } - else { - return u3ges_sqt(a, u3x_at(30, cor)); - } - } - -/* fma -*/ - u3_noun - u3ges_fma(u3_atom a, - u3_atom b, - u3_atom c, - u3_atom r) - { - union half d, e, f, g; - _set_rounding(r); - d.c = u3r_word(0, a); - e.c = u3r_word(0, b); - f.c = u3r_word(0, c); - g.h = _nan_unify(f16_mulAdd(d.h, e.h, f.h)); - - return g.c; - } - - u3_noun - u3yes_fma(u3_noun cor) - { - u3_noun a, b, c; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_6, &b, u3x_sam_7, &c, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) || - c3n == u3ud(c) ) - { - return u3m_bail(c3__exit); - } - else { - return u3ges_fma(a, b, c, u3x_at(30, cor)); - } - } - -/* lth -*/ - u3_noun - u3ges_lth(u3_atom a, - u3_atom b) - { - union half c, d; - c.c = u3r_word(0, a); - d.c = u3r_word(0, b); - - return __(f16_lt(c.h, d.h)); - } - - u3_noun - u3yes_lth(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3ges_lth(a, b); - } - } - -/* lte -*/ - u3_noun - u3ges_lte(u3_atom a, - u3_atom b) - { - union half c, d; - c.c = u3r_word(0, a); - d.c = u3r_word(0, b); - - return __(f16_le(c.h, d.h)); - } - - u3_noun - u3yes_lte(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3ges_lte(a, b); - } - } - -/* equ -*/ - u3_noun - u3ges_equ(u3_atom a, - u3_atom b) - { - union half c, d; - c.c = u3r_word(0, a); - d.c = u3r_word(0, b); - - return __(f16_eq(c.h, d.h)); - } - - u3_noun - u3yes_equ(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3ges_equ(a, b); - } - } - -/* gte -*/ - u3_noun - u3ges_gte(u3_atom a, - u3_atom b) - { - union half c, d; - c.c = u3r_word(0, a); - d.c = u3r_word(0, b); - - return __(f16_le(d.h, c.h)); - } - - u3_noun - u3yes_gte(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3ges_gte(a, b); - } - } - -/* gth -*/ - u3_noun - u3ges_gth(u3_atom a, - u3_atom b) - { - union half c, d; - c.c = u3r_word(0, a); - d.c = u3r_word(0, b); - - return __(f16_lt(d.h, c.h)); - } - - u3_noun - u3yes_gth(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3ges_gth(a, b); - } - } diff --git a/mets/e/rq.c b/mets/e/rq.c deleted file mode 100644 index 321ac7ca05..0000000000 --- a/mets/e/rq.c +++ /dev/null @@ -1,446 +0,0 @@ -/* j/e/rq.c -** -*/ -#include "all.h" -#include "softfloat.h" - -#define QUADNAN 0x7fff800000000000 - - union quad { - float128_t* q; - c3_w* c; - }; - -/* functions -*/ - static inline c3_t - _nan_test(float128_t* a) - { - return !f128M_eq(a, a); - } - - static inline void - _nan_unify(float128_t* a) - { - if ( _nan_test(a) ) - { - *( (c3_d*)a) = 0; - *(((c3_d*)a)+1) = QUADNAN; - } - } - - static inline void - _set_rounding(c3_w a) - { - switch ( a ) - { - default: - u3m_bail(c3__fail); - break; - case c3__n: - softfloat_roundingMode = softfloat_round_near_even; - break; - case c3__z: - softfloat_roundingMode = softfloat_round_minMag; - break; - case c3__u: - softfloat_roundingMode = softfloat_round_max; - break; - case c3__d: - softfloat_roundingMode = softfloat_round_min; - break; - } - } - -/* add -*/ - u3_noun - u3geq_add(u3_atom a, - u3_atom b, - u3_atom r) - { - union quad c, d, e; - _set_rounding(r); - c.c = alloca(16); - d.c = alloca(16); - e.c = alloca(16); - - u3r_words(0, 4, c.c, a); - u3r_words(0, 4, d.c, b); - f128M_add(c.q, d.q, e.q); - _nan_unify(e.q); - - u3_atom f = u3i_words(4, e.c); - return f; - } - - u3_noun - u3yeq_add(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3geq_add(a, b, u3x_at(30, cor)); - } - } - -/* sub -*/ - u3_noun - u3geq_sub(u3_atom a, - u3_atom b, - u3_atom r) - { - union quad c, d, e; - _set_rounding(r); - c.c = alloca(16); - d.c = alloca(16); - e.c = alloca(16); - - u3r_words(0, 4, c.c, a); - u3r_words(0, 4, d.c, b); - f128M_sub(c.q, d.q, e.q); - _nan_unify(e.q); - - u3_atom f = u3i_words(4, e.c); - return f; - } - - u3_noun - u3yeq_sub(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3geq_sub(a, b, u3x_at(30, cor)); - } - } - -/* mul -*/ - u3_noun - u3geq_mul(u3_atom a, - u3_atom b, - u3_atom r) - { - union quad c, d, e; - _set_rounding(r); - c.c = alloca(16); - d.c = alloca(16); - e.c = alloca(16); - - u3r_words(0, 4, c.c, a); - u3r_words(0, 4, d.c, b); - f128M_mul(c.q, d.q, e.q); - _nan_unify(e.q); - - u3_atom f = u3i_words(4, e.c); - return f; - } - - u3_noun - u3yeq_mul(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3geq_mul(a, b, u3x_at(30, cor)); - } - } - -/* div -*/ - u3_noun - u3geq_div(u3_atom a, - u3_atom b, - u3_atom r) - { - union quad c, d, e; - _set_rounding(r); - c.c = alloca(16); - d.c = alloca(16); - e.c = alloca(16); - - u3r_words(0, 4, c.c, a); - u3r_words(0, 4, d.c, b); - f128M_div(c.q, d.q, e.q); - _nan_unify(e.q); - - u3_atom f = u3i_words(4, e.c); - return f; - } - - u3_noun - u3yeq_div(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3geq_div(a, b, u3x_at(30, cor)); - } - } - -/* sqt -*/ - u3_noun - u3geq_sqt(u3_atom a, - u3_atom r) - { - union quad c, d; - _set_rounding(r); - c.c = alloca(16); - d.c = alloca(16); - - u3r_words(0, 4, c.c, a); - f128M_sqrt(c.q, d.q); - _nan_unify(d.q); - - u3_atom e = u3i_words(4, d.c); - return e; - } - - u3_noun - u3yeq_sqt(u3_noun cor) - { - u3_noun a; - - if ( c3n == (a = u3r_at(u3x_sam, cor)) || - c3n == u3ud(a) ) - { - return u3m_bail(c3__exit); - } - else { - return u3geq_sqt(a, u3x_at(30, cor)); - } - } - -/* fma -*/ - u3_noun - u3geq_fma(u3_atom a, - u3_atom b, - u3_atom c, - u3_atom r) - { - union quad d, e, f, g; - _set_rounding(r); - d.c = alloca(16); - e.c = alloca(16); - f.c = alloca(16); - g.c = alloca(16); - - u3r_words(0, 4, d.c, a); - u3r_words(0, 4, e.c, b); - u3r_words(0, 4, f.c, c); - f128M_mulAdd(d.q, e.q, f.q, g.q); - _nan_unify(g.q); - - u3_atom h = u3i_words(4, g.c); - return h; - } - - u3_noun - u3yeq_fma(u3_noun cor) - { - u3_noun a, b, c; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_6, &b, u3x_sam_7, &c, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) || - c3n == u3ud(c) ) - { - return u3m_bail(c3__exit); - } - else { - return u3geq_fma(a, b, c, u3x_at(30, cor)); - } - } - -/* lth -*/ - u3_noun - u3geq_lth(u3_atom a, - u3_atom b) - { - union quad c, d; - c.c = alloca(16); - d.c = alloca(16); - - u3r_words(0, 4, c.c, a); - u3r_words(0, 4, d.c, b); - c3_o e = __(f128M_lt(c.q, d.q)); - - return e; - } - - u3_noun - u3yeq_lth(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3geq_lth(a, b); - } - } - -/* lte -*/ - u3_noun - u3geq_lte(u3_atom a, - u3_atom b) - { - union quad c, d; - c.c = alloca(16); - d.c = alloca(16); - - u3r_words(0, 4, c.c, a); - u3r_words(0, 4, d.c, b); - c3_o e = __(f128M_le(c.q, d.q)); - - return e; - } - - u3_noun - u3yeq_lte(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3geq_lte(a, b); - } - } - -/* equ -*/ - u3_noun - u3geq_equ(u3_atom a, - u3_atom b) - { - union quad c, d; - c.c = alloca(16); - d.c = alloca(16); - - u3r_words(0, 4, c.c, a); - u3r_words(0, 4, d.c, b); - c3_o e = __(f128M_eq(c.q, d.q)); - - return e; - } - - u3_noun - u3yeq_equ(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3geq_equ(a, b); - } - } - -/* gte -*/ - u3_noun - u3geq_gte(u3_atom a, - u3_atom b) - { - union quad c, d; - c.c = alloca(16); - d.c = alloca(16); - - u3r_words(0, 4, c.c, a); - u3r_words(0, 4, d.c, b); - c3_o e = __(f128M_le(d.q, c.q)); - - return e; - } - - u3_noun - u3yeq_gte(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3geq_gte(a, b); - } - } - -/* gth -*/ - u3_noun - u3geq_gth(u3_atom a, - u3_atom b) - { - union quad c, d; - c.c = alloca(16); - d.c = alloca(16); - - u3r_words(0, 4, c.c, a); - u3r_words(0, 4, d.c, b); - c3_o e = __(f128M_lt(d.q, c.q)); - - return e; - } - - u3_noun - u3yeq_gth(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3geq_gth(a, b); - } - } diff --git a/mets/e/rs.c b/mets/e/rs.c deleted file mode 100644 index 07c085fd1d..0000000000 --- a/mets/e/rs.c +++ /dev/null @@ -1,390 +0,0 @@ -/* j/e/rs.c -** -*/ -#include "all.h" -#include "softfloat.h" - -#define SINGNAN 0x7fc00000 - - union sing { - float32_t s; - c3_w c; - }; - -/* functions -*/ - static inline c3_t - _nan_test(float32_t a) - { - return !f32_eq(a, a); - } - - static inline float32_t - _nan_unify(float32_t a) - { - if ( _nan_test(a) ) - { - *(c3_w*)(&a) = SINGNAN; - } - return a; - } - - static inline void - _set_rounding(c3_w a) - { - switch ( a ) - { - default: - u3m_bail(c3__fail); - break; - case c3__n: - softfloat_roundingMode = softfloat_round_near_even; - break; - case c3__z: - softfloat_roundingMode = softfloat_round_minMag; - break; - case c3__u: - softfloat_roundingMode = softfloat_round_max; - break; - case c3__d: - softfloat_roundingMode = softfloat_round_min; - break; - } - } - -/* add -*/ - u3_noun - u3get_add(u3_atom a, - u3_atom b, - u3_atom r) - { - union sing c, d, e; - _set_rounding(r); - c.c = u3r_word(0, a); - d.c = u3r_word(0, b); - e.s = _nan_unify(f32_add(c.s, d.s)); - - return u3i_words(1, &e.c); - } - - u3_noun - u3yet_add(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3get_add(a, b, u3x_at(30, cor)); - } - } - -/* sub -*/ - u3_noun - u3get_sub(u3_atom a, - u3_atom b, - u3_atom r) - { - union sing c, d, e; - _set_rounding(r); - c.c = u3r_word(0, a); - d.c = u3r_word(0, b); - e.s = _nan_unify(f32_sub(c.s, d.s)); - - return u3i_words(1, &e.c); - } - - u3_noun - u3yet_sub(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3get_sub(a, b, u3x_at(30, cor)); - } - } - -/* mul -*/ - u3_noun - u3get_mul(u3_atom a, - u3_atom b, - u3_atom r) - { - union sing c, d, e; - _set_rounding(r); - c.c = u3r_word(0, a); - d.c = u3r_word(0, b); - e.s = _nan_unify(f32_mul(c.s, d.s)); - - return u3i_words(1, &e.c); - } - - u3_noun - u3yet_mul(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3get_mul(a, b, u3x_at(30, cor)); - } - } - -/* div -*/ - u3_noun - u3get_div(u3_atom a, - u3_atom b, - u3_atom r) - { - union sing c, d, e; - _set_rounding(r); - c.c = u3r_word(0, a); - d.c = u3r_word(0, b); - e.s = _nan_unify(f32_div(c.s, d.s)); - - return u3i_words(1, &e.c); - } - - u3_noun - u3yet_div(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3get_div(a, b, u3x_at(30, cor)); - } - } - -/* sqt -*/ - u3_noun - u3get_sqt(u3_atom a, - u3_atom r) - { - union sing c, d; - _set_rounding(r); - c.c = u3r_word(0, a); - d.s = _nan_unify(f32_sqrt(c.s)); - - return u3i_words(1, &d.c); - } - - u3_noun - u3yet_sqt(u3_noun cor) - { - u3_noun a; - - if ( c3n == (a = u3r_at(u3x_sam, cor)) || - c3n == u3ud(a) ) - { - return u3m_bail(c3__exit); - } - else { - return u3get_sqt(a, u3x_at(30, cor)); - } - } - -/* fma -*/ - u3_noun - u3get_fma(u3_atom a, - u3_atom b, - u3_atom c, - u3_atom r) - { - union sing d, e, f, g; - _set_rounding(r); - d.c = u3r_word(0, a); - e.c = u3r_word(0, b); - f.c = u3r_word(0, c); - g.s = _nan_unify(f32_mulAdd(d.s, e.s, f.s)); - - return u3i_words(1, &g.c); - } - - u3_noun - u3yet_fma(u3_noun cor) - { - u3_noun a, b, c; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_6, &b, u3x_sam_7, &c, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) || - c3n == u3ud(c) ) - { - return u3m_bail(c3__exit); - } - else { - return u3get_fma(a, b, c, u3x_at(30, cor)); - } - } - -/* lth -*/ - u3_noun - u3get_lth(u3_atom a, - u3_atom b) - { - union sing c, d; - c.c = u3r_word(0, a); - d.c = u3r_word(0, b); - - return __(f32_lt(c.s, d.s)); - } - - u3_noun - u3yet_lth(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3get_lth(a, b); - } - } - -/* lte -*/ - u3_noun - u3get_lte(u3_atom a, - u3_atom b) - { - union sing c, d; - c.c = u3r_word(0, a); - d.c = u3r_word(0, b); - - return __(f32_le(c.s, d.s)); - } - - u3_noun - u3yet_lte(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3get_lte(a, b); - } - } - -/* equ -*/ - u3_noun - u3get_equ(u3_atom a, - u3_atom b) - { - union sing c, d; - c.c = u3r_word(0, a); - d.c = u3r_word(0, b); - - return __(f32_eq(c.s, d.s)); - } - - u3_noun - u3yet_equ(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3get_equ(a, b); - } - } - -/* gte -*/ - u3_noun - u3get_gte(u3_atom a, - u3_atom b) - { - union sing c, d; - c.c = u3r_word(0, a); - d.c = u3r_word(0, b); - - return __(f32_le(d.s, c.s)); - } - - u3_noun - u3yet_gte(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3get_gte(a, b); - } - } - -/* gth -*/ - u3_noun - u3get_gth(u3_atom a, - u3_atom b) - { - union sing c, d; - c.c = u3r_word(0, a); - d.c = u3r_word(0, b); - - return __(f32_lt(d.s, c.s)); - } - - u3_noun - u3yet_gth(u3_noun cor) - { - u3_noun a, b; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) || - c3n == u3ud(a) || - c3n == u3ud(b) ) - { - return u3m_bail(c3__exit); - } - else { - return u3get_gth(a, b); - } - } diff --git a/mets/e/rub.c b/mets/e/rub.c deleted file mode 100644 index 99dd867aa2..0000000000 --- a/mets/e/rub.c +++ /dev/null @@ -1,79 +0,0 @@ -/* j/3/rub.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3ge_rub(u3_atom a, - u3_atom b) - { - u3_atom c, d, e; - u3_atom w, x, y, z; - u3_atom p, q; - - u3_atom m = u3ga_add(a, u3r_met(0, b)); - - // Compute c and d. - { - x = u3k(a); - - while ( 0 == u3gc_cut(0, x, 1, b) ) { - u3_atom y = u3ga_inc(x); - - // Sanity check: crash if decoding more bits than available - if ( c3y == u3ga_gth(x, m)) { - // fprintf(stderr, "[%%rub-hard %d %d %d]\r\n", a, x, m); - return u3m_bail(c3__exit); - } - - u3z(x); - x = y; - } - if ( c3y == u3r_sing(x, a) ) { - u3z(x); - return u3nc(1, 0); - } - c = u3ga_sub(x, a); - d = u3ga_inc(x); - - u3z(x); - } - - // Compute e, p, q. - { - x = u3ga_dec(c); - y = u3gc_bex(x); - z = u3gc_cut(0, d, x, b); - - e = u3ga_add(y, z); - u3z(y); u3z(z); - - w = u3ga_add(c, c); - y = u3ga_add(w, e); - z = u3ga_add(d, x); - - p = u3ga_add(w, e); - q = u3gc_cut(0, z, e, b); - - u3z(w); u3z(x); u3z(y); u3z(z); - - return u3nc(p, q); - } - } - u3_noun - u3ye_rub(u3_noun cor) - { - u3_noun a, b; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) || - (c3n == u3ud(a)) || - (c3n == u3ud(b)) ) - { - return u3m_bail(c3__fail); - } else { - return u3ge_rub(a, b); - } - } diff --git a/mets/e/scr.c b/mets/e/scr.c deleted file mode 100644 index 41d4bfce00..0000000000 --- a/mets/e/scr.c +++ /dev/null @@ -1,289 +0,0 @@ -/* j/5/scr.c -** -*/ -#include "all.h" - -#include -#include -#include - -static int _crypto_scrypt(const uint8_t *, size_t, const uint8_t *, size_t, - uint64_t, uint32_t, uint32_t, uint8_t *, size_t); - -/* functions -*/ - - u3_noun - u3ges_hsl(u3_atom p, u3_atom pl, - u3_atom s, u3_atom sl, - u3_atom n, - u3_atom r, - u3_atom z, - u3_atom d) - { - // asserting that n is power of 2 in _crypto_scrypt - if (!(_(u3a_is_atom(p)) && _(u3a_is_atom(s)) && - _(u3a_is_cat(pl)) && _(u3a_is_cat(sl)) && - _(u3a_is_cat(n)) && _(u3a_is_cat(r)) && - _(u3a_is_cat(z)) && _(u3a_is_cat(d)) && - (r != 0) && (z != 0) && - (((c3_d)r * 128 * ((c3_d)n + z - 1)) <= (1 << 30)))) - return u3m_bail(c3__exit); - - c3_y* b_p = u3a_malloc(pl + 1); c3_y* b_s= u3a_malloc(sl + 1); - u3r_bytes(0, pl, b_p, p); u3r_bytes(0, sl, b_s, s); - b_p[pl] = 0; b_s[sl]=0; - c3_y* buf = u3a_malloc(d); - - if (_crypto_scrypt(b_p, pl, b_s, sl, n, r, z, buf, d) != 0) - return u3m_bail(c3__exit); - - u3_noun res = u3i_bytes(d, buf); - u3a_free(b_p); u3a_free(b_s); u3a_free(buf); - - return res; - } - - u3_noun - u3yes_hsl(u3_noun cor) - { - u3_noun p, pl, s, sl, n, r, z, d; - u3_noun q; - - u3x_quil(u3r_at(u3x_sam, cor), &p, &pl, &s, &sl, &q); - u3x_qual(q, &n, &r, &z, &d); - - return u3ges_hsl(p, pl, s, sl, n, r, z, d); - } - - u3_noun - u3ges_hsh(u3_atom p, - u3_atom s, - u3_atom n, - u3_atom r, - u3_atom z, - u3_atom d) - { - // asserting that n is power of 2 in _crypto_scrypt - if (!(_(u3a_is_atom(p)) && _(u3a_is_atom(s)) && - _(u3a_is_cat(n)) && _(u3a_is_cat(r)) && - _(u3a_is_cat(z)) && _(u3a_is_cat(d)) && - (r != 0) && (z != 0) && - (((c3_d)r * 128 * ((c3_d)n + z - 1)) <= (1 << 30)))) - return u3m_bail(c3__exit); - - c3_w pl = u3r_met(3, p); c3_w sl = u3r_met(3, s); - c3_y* b_p = u3a_malloc(pl + 1); c3_y* b_s= u3a_malloc(sl + 1); - u3r_bytes(0, pl, b_p, p); u3r_bytes(0, sl, b_s, s); - b_p[pl] = 0; b_s[sl]=0; - c3_y* buf = u3a_malloc(d); - - if (_crypto_scrypt(b_p, pl, b_s, sl, n, r, z, buf, d) != 0) - return u3m_bail(c3__exit); - - u3_noun res = u3i_bytes(d, buf); - u3a_free(b_p); u3a_free(b_s); u3a_free(buf); - - return res; - } - - u3_noun - u3yes_hsh(u3_noun cor) - { - u3_noun p, s, n, r, z, d; - u3_noun q; - - u3x_quil(u3r_at(u3x_sam, cor), &p, &s, &n, &r, &q); - u3x_cell(q, &z, &d); - - return u3ges_hsh(p, s, n, r, z, d); - } - - u3_noun - u3ges_pbl(u3_atom p, u3_atom pl, - u3_atom s, u3_atom sl, - u3_atom c, - u3_atom d) - { - if (!(_(u3a_is_atom(p)) && _(u3a_is_atom(s)) && - _(u3a_is_cat(pl)) && _(u3a_is_cat(sl)) && - _(u3a_is_cat(c)) && _(u3a_is_cat(d)) && - (d <= (1 << 30)) && (c <= (1 << 28)) && - (c != 0))) - return u3m_bail(c3__exit); - - c3_y* b_p = u3a_malloc(pl + 1); c3_y* b_s= u3a_malloc(pl + 1); - u3r_bytes(0, pl, b_p, p); u3r_bytes(0, sl, b_s, s); - b_p[pl] = 0; b_s[sl]=0; - c3_y* buf = u3a_malloc(d); - - PBKDF2_SHA256(b_p, pl, b_s, sl, c, buf, d); - - u3_noun res = u3i_bytes(d, buf); - u3a_free(b_p); u3a_free(b_s); u3a_free(buf); - - return res; - } - - u3_noun - u3yes_pbl(u3_noun cor) - { - u3_noun p, pl, s, sl, c, d; - u3_noun q; - - u3x_quil(u3r_at(u3x_sam, cor), &p, &pl, &s, &sl, &q); - u3x_cell(q, &c, &d); - - return u3ges_pbl(p, pl, s, sl, c, d); - } - - u3_noun - u3ges_pbk(u3_atom p, u3_atom s, u3_atom c, u3_atom d) - { - if (!(_(u3a_is_atom(p)) && _(u3a_is_atom(s)) && - _(u3a_is_cat(c)) && _(u3a_is_cat(d)) && - (d <= (1 << 30)) && (c <= (1 << 28)) && - (c != 0))) - return u3m_bail(c3__exit); - - c3_w pl = u3r_met(3, p); c3_w sl = u3r_met(3, s); - c3_y* b_p = u3a_malloc(pl + 1); c3_y* b_s= u3a_malloc(pl + 1); - u3r_bytes(0, pl, b_p, p); u3r_bytes(0, sl, b_s, s); - b_p[pl] = 0; b_s[sl]=0; - c3_y* buf = u3a_malloc(d); - - PBKDF2_SHA256(b_p, pl, b_s, sl, c, buf, d); - - u3_noun res = u3i_bytes(d, buf); - u3a_free(b_p); u3a_free(b_s); u3a_free(buf); - - return res; - } - - u3_noun - u3yes_pbk(u3_noun cor) - { - u3_noun p, s, c, d; - - u3x_qual(u3r_at(u3x_sam, cor), &p, &s, &c, &d); - - return u3ges_pbk(p, s, c, d); - } - -/*- - * Copyright 2009 Colin Percival - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file was originally written by Colin Percival as part of the Tarsnap - * online backup system. - */ - -/** - * crypto_scrypt(passwd, passwdlen, salt, saltlen, N, r, p, buf, buflen): - * Compute scrypt(passwd[0 .. passwdlen - 1], salt[0 .. saltlen - 1], N, r, - * p, buflen) and write the result into buf. The parameters r, p, and buflen - * must satisfy r * p < 2^30 and buflen <= (2^32 - 1) * 32. The parameter N - * must be a power of 2 greater than 1. - * - * Return 0 on success; or -1 on error. - */ -static int -_crypto_scrypt(const uint8_t * passwd, size_t passwdlen, - const uint8_t * salt, size_t saltlen, uint64_t N, uint32_t r, uint32_t p, - uint8_t * buf, size_t buflen) -{ - void * B0, * V0, * XY0; - uint8_t * B; - uint32_t * V; - uint32_t * XY; - uint32_t i; - - if (((N & (N-1)) != 0) || N == 0) - goto err0; - - /* Sanity-check parameters. */ -#if SIZE_MAX > UINT32_MAX - if (buflen > (((uint64_t)(1) << 32) - 1) * 32) { - errno = EFBIG; - goto err0; - } -#endif - if ((uint64_t)(r) * (uint64_t)(p) >= (1 << 30)) { - errno = EFBIG; - goto err0; - } - if (((N & (N - 1)) != 0) || (N == 0)) { - errno = EINVAL; - goto err0; - } - int test_size_max = (r > SIZE_MAX / 128 / p) || (N > SIZE_MAX / 128 / r); - -#if SIZE_MAX / 256 <= UINT32_MAX - test_size_max = (r > (SIZE_MAX - 64) / 256) || test_size_max; -#endif - if(test_size_max) { - errno = ENOMEM; - goto err0; - } - - /* Allocate memory. */ - if ((B0 = u3a_malloc(128 * r * p + 63)) == NULL) - goto err0; - B = (uint8_t *)(((uintptr_t)(B0) + 63) & ~ (uintptr_t)(63)); - if ((XY0 = u3a_malloc(256 * r + 64 + 63)) == NULL) - goto err1; - XY = (uint32_t *)(((uintptr_t)(XY0) + 63) & ~ (uintptr_t)(63)); - if ((V0 = u3a_malloc(128 * r * N + 63)) == NULL) - goto err2; - V = (uint32_t *)(((uintptr_t)(V0) + 63) & ~ (uintptr_t)(63)); - - /* 1: (B_0 ... B_{p-1}) <-- PBKDF2(P, S, 1, p * MFLen) */ - PBKDF2_SHA256(passwd, passwdlen, salt, saltlen, 1, B, p * 128 * r); - - /* 2: for i = 0 to p - 1 do */ - for (i = 0; i < p; i++) { - /* 3: B_i <-- MF(B_i, N) */ - smix(&B[i * 128 * r], r, N, V, XY); - } - - /* 5: DK <-- PBKDF2(P, B, 1, dkLen) */ - PBKDF2_SHA256(passwd, passwdlen, B, p * 128 * r, 1, buf, buflen); - - /* Free memory. */ - - u3a_free(V0); - u3a_free(XY0); - u3a_free(B0); - - /* Success! */ - return (0); - -err2: - u3a_free(XY0); -err1: - u3a_free(B0); -err0: - /* Failure! */ - return (-1); -} diff --git a/mets/e/shax.c b/mets/e/shax.c deleted file mode 100644 index 92d2ea369b..0000000000 --- a/mets/e/shax.c +++ /dev/null @@ -1,250 +0,0 @@ -/* j/5/shax.c -** -*/ -#include "all.h" - - -#if defined(U3_OS_osx) -#include -#else -#include -#endif - -/* functions -*/ - - u3_noun - u3ge_shay(u3_atom a, - u3_atom b) - { - c3_assert(_(u3a_is_cat(a))); - c3_y* fat_y = c3_malloc(a + 1); - - u3r_bytes(0, a, fat_y, b); - { - c3_y dig_y[32]; -#if defined(U3_OS_osx) - CC_SHA256_CTX ctx_h; - - CC_SHA256_Init(&ctx_h); - CC_SHA256_Update(&ctx_h, fat_y, a); - CC_SHA256_Final(dig_y, &ctx_h); -#else - SHA256_CTX ctx_h; - - SHA256_Init(&ctx_h); - SHA256_Update(&ctx_h, fat_y, a); - SHA256_Final(dig_y, &ctx_h); -#endif - free(fat_y); - return u3i_bytes(32, dig_y); - } - } - -// u3_noun -// u3ge_shax( -// u3_atom a) -// { -// c3_w met_w = u3r_met(3, a); -// return u3ge_shay(met_w, a); -// } -// XX preformance -u3_noun - u3ge_shax(u3_atom a) - { - c3_w met_w = u3r_met(3, a); - c3_y* fat_y = c3_malloc(met_w + 1); - - u3r_bytes(0, met_w, fat_y, a); - { - c3_y dig_y[32]; -#if defined(U3_OS_osx) - CC_SHA256_CTX ctx_h; - - CC_SHA256_Init(&ctx_h); - CC_SHA256_Update(&ctx_h, fat_y, met_w); - CC_SHA256_Final(dig_y, &ctx_h); -#else - SHA256_CTX ctx_h; - - SHA256_Init(&ctx_h); - SHA256_Update(&ctx_h, fat_y, met_w); - SHA256_Final(dig_y, &ctx_h); -#endif - free(fat_y); - return u3i_bytes(32, dig_y); - } - } - -// XX end preformance - - u3_noun - u3ge_shal(u3_atom a, - u3_atom b) - { - c3_assert(_(u3a_is_cat(a))); - c3_y* fat_y = c3_malloc(a + 1); - - u3r_bytes(0, a, fat_y, b); - { - c3_y dig_y[64]; -#if defined(U3_OS_osx) - CC_SHA512_CTX ctx_h; - - CC_SHA512_Init(&ctx_h); - CC_SHA512_Update(&ctx_h, fat_y, a); - CC_SHA512_Final(dig_y, &ctx_h); -#else - SHA512_CTX ctx_h; - - SHA512_Init(&ctx_h); - SHA512_Update(&ctx_h, fat_y, a); - SHA512_Final(dig_y, &ctx_h); -#endif - free(fat_y); - return u3i_bytes(64, dig_y); - } - } - - u3_noun - u3ge_shas(u3_atom sal, - u3_atom ruz) - { - u3_noun one = u3ge_shax(ruz); - u3_noun two = u3gc_mix(sal, one); - u3_noun tri = u3ge_shax(two); - - u3z(one); u3z(two); return tri; - } - - u3_noun - u3ye_shax(u3_noun cor) - { - u3_noun a; - - if ( (u3_none == (a = u3r_at(u3x_sam, cor))) || - (c3n == u3ud(a)) ) - { - return u3m_bail(c3__exit); - } else { - return u3ge_shax(a); - } - } - - u3_noun - u3ye_shay(u3_noun cor) - { - u3_noun a, b; - -// static int few = 0; -// if(few == 0) printf("foo\r\n"); -// few++; few %= 1000; - - - if ( (u3_none == (a = u3r_at(u3x_sam_2, cor))) || - (u3_none == (b = u3r_at(u3x_sam_3, cor))) || - (c3n == u3ud(a)) || - (c3n == u3a_is_cat(a)) || - (c3n == u3ud(b)) ) - { - return u3m_bail(c3__exit); - } else { - return u3ge_shay(a, b); - } - } - - u3_noun - u3ye_shal(u3_noun cor) - { - u3_noun a, b; - - if ( (u3_none == (a = u3r_at(u3x_sam_2, cor))) || - (u3_none == (b = u3r_at(u3x_sam_3, cor))) || - (c3n == u3ud(a)) || - (c3n == u3a_is_cat(a)) || - (c3n == u3ud(b)) ) - { - return u3m_bail(c3__exit); - } else { - return u3ge_shal(a, b); - } - } - - u3_noun - u3ye_shas(u3_noun cor) - { - u3_noun sal, ruz; - - if ( (u3_none == (sal = u3r_at(u3x_sam_2, cor))) || - (u3_none == (ruz = u3r_at(u3x_sam_3, cor))) || - (c3n == u3ud(sal)) || - (c3n == u3ud(ruz)) ) - { - return u3m_bail(c3__exit); - } else { - return u3ge_shas(sal, ruz); - } - } - - static u3_noun - _og_list(u3_noun a, - u3_noun b, - u3_noun c) - { - u3_noun l = u3_nul; - - if ( !_(u3a_is_cat(b)) ) { - return u3m_bail(c3__fail); - } - while ( 0 != b ) { - u3_noun x = u3gc_mix(a, c); - u3_noun y = u3gc_mix(b, x); - u3_noun d = u3ge_shas(c3_s4('o','g','-','b'), y); - u3_noun m; - - u3z(x); u3z(y); - - if ( b < 256 ) { - u3_noun e = u3gc_end(0, b, d); - - u3z(d); - m = u3nc(b, e); - b = 0; - } else { - m = u3nc(256, d); - c = d; - - b -= 256; - } - l = u3nc(m, l); - } - return u3lb_flop(l); - } - - u3_noun - u3geo_raw(u3_atom a, - u3_atom b) - { - u3_noun x = u3gc_mix(b, a); - u3_noun c = u3ge_shas(c3_s4('o','g','-','a'), x); - u3_noun l = _og_list(a, b, c); - u3_noun r = u3gc_can(0, l); - - u3z(l); - u3z(c); - u3z(x); - - return r; - } - - u3_noun - u3yeo_raw(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 u3geo_raw(a, b); - } - } diff --git a/mets/e/tape.c b/mets/e/tape.c deleted file mode 100644 index 46299990a0..0000000000 --- a/mets/e/tape.c +++ /dev/null @@ -1,53 +0,0 @@ -/* j/3/tape.c -** -*/ -#include "all.h" - - -/* functions -*/ - static u3_noun - _norm(u3_noun a) - { - if ( c3n == u3du(a) ) { - return u3_nul; - } else { - return u3nc(((c3y == u3du(u3h(a))) ? u3_nul : u3k(u3h(a))), - _norm(u3t(a))); - } - } - - static u3_noun - _good(u3_noun a) - { - while ( 1 ) { - if ( u3_nul == a ) { - return c3y; - } - if ( c3n == u3ud(u3h(a)) ) { - return c3n; - } - a = u3t(a); - } - } - - u3_noun - u3ge_tape(u3_noun a) - { - if ( c3y == _good(a) ) { - return u3k(a); - } else { - return _norm(a); - } - } - u3_noun - u3ye_tape(u3_noun cor) - { - u3_noun a; - - if ( (u3_none == (a = u3r_at(u3x_sam, cor))) ) { - return u3m_bail(c3__fail); - } else { - return u3ge_tape(a); - } - } diff --git a/mets/e/trip.c b/mets/e/trip.c deleted file mode 100644 index ce2fcdfadd..0000000000 --- a/mets/e/trip.c +++ /dev/null @@ -1,35 +0,0 @@ -/* j/5/trip.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3ge_trip(u3_atom a) - { - if ( c3n == u3ud(a) ) { - return u3m_bail(c3__exit); - } - return u3gc_rip(3, a); - } - u3_noun - u3ye_trip(u3_noun cor) - { - u3_noun a; - - if ( (u3_none == (a = u3r_at(u3x_sam, cor))) ) { - return u3m_bail(c3__fail); - } else { - return u3ge_trip(a); - } - } - u3_atom - u3le_trip(u3_noun a) - { - u3_atom b = u3ge_trip(a); - - u3z(a); - return b; - } diff --git a/mets/f/al.c b/mets/f/al.c deleted file mode 100644 index cc911b3c60..0000000000 --- a/mets/f/al.c +++ /dev/null @@ -1,41 +0,0 @@ -/* j/6/al.c -** -*/ -#include "all.h" - - -/* ~(. al gen) -*/ -static u3_noun -_al_core(u3_noun van, - u3_noun gen) -{ - u3_noun ter = u3r_at(u3x_con_3, van); - u3_noun gat = u3j_hook(u3k(ter), "al"); - - return u3i_molt(gat, u3x_sam, u3k(gen), 0); -} - -/* ~(bunt al gen) -*/ -u3_noun -u3gfl_bunt(u3_noun van, - u3_noun gen) -{ - u3_noun cor = _al_core(van, gen); - - return u3j_hook(cor, "bunt"); -} - -/* ~(whip al gen) -*/ -u3_noun -u3gfl_whip(u3_noun van, - u3_noun gen, - u3_noun axe) // -{ - u3_noun cor = _al_core(van, gen); - u3_noun gat = u3j_hook(u3k(cor), "whip"); - - return u3n_slam_on(gat, u3k(axe)); -} diff --git a/mets/f/ap.c b/mets/f/ap.c deleted file mode 100644 index 43306b83b2..0000000000 --- a/mets/f/ap.c +++ /dev/null @@ -1,1041 +0,0 @@ -/* j/6/ap.c -** -*/ -#include "all.h" - - -/** forward declares -**/ - u3_noun u3yfp_rake(u3_noun); - u3_noun u3yfp_open(u3_noun); - u3_noun u3yfp_hack(u3_noun); - - static u3_noun - _ap_open_l(u3_noun, u3_noun); - - // make sure these match the array below! - // -# define _ap_jet_open 0 -# define _ap_jet_rake 1 -# define _ap_jet_hack 2 - - static u3_noun - _open_in(u3_noun ter, u3_noun gen); -#if 0 - /* ~(. al gen) - */ - static u3_noun - _al_bore(u3_noun ter, - u3_noun gen) - { - u3_noun gat = u3j_hook(u3k(ter), "al"); - - return u3i_molt(gat, u3x_sam, u3nc(c3__herb, u3k(gen)), 0); - } -#endif - /* ~(. al gen) - */ - static u3_noun - _al_core(u3_noun ter, - u3_noun gen) - { - u3_noun gat = u3j_hook(u3k(ter), "al"); - - return u3i_molt(gat, u3x_sam, u3k(gen), 0); - } - - /* van is transferred, gen is retained - */ - static u3_noun - _ap_bunt(u3_noun van, - u3_noun gen) - { - u3_noun pro = u3gfl_bunt(van, gen); - - u3z(van); - return pro; - } - -/** open cases -**/ - -#define _open_do_p(stem) \ - static u3_noun _open_in_##stem \ - ( u3_noun ter, u3_noun p_gen) - -#define _open_do_pq(stem) \ - static u3_noun _open_in_##stem \ - ( u3_noun ter, u3_noun p_gen, u3_noun q_gen) - -#define _open_do_pqr(stem) \ - static u3_noun _open_in_##stem \ - ( u3_noun ter, u3_noun p_gen, u3_noun q_gen, u3_noun r_gen) - -#define _open_do_pqrs(stem) \ - static u3_noun _open_in_##stem \ - ( u3_noun ter, u3_noun p_gen, u3_noun q_gen, u3_noun r_gen, \ - u3_noun s_gen) - -/*** -**** -***/ - _open_do_pq(tsbr) // =: - { - return u3nt(c3__tsls, - _ap_bunt(_al_core(ter, p_gen), p_gen), - u3k(q_gen)); - } - _open_do_pq(tscl) // =: - { - return u3nt(c3__tsgr, - u3nt(c3__cncb, - u3nc(u3nc(u3_nul, 1), - u3_nul), - u3k(p_gen)), - u3k(q_gen)); - } - _open_do_pqr(tsdt) // =. - { - return u3nt(c3__tsgr, - u3nt(c3__cncb, - u3nc(u3nc(u3_nul, 1), - u3_nul), - u3nc(u3nc(u3k(p_gen), - u3k(q_gen)), - u3_nul)), - u3k(r_gen)); - } - _open_do_pq(tsgl) // =< - { - return u3nt(c3__tsgr, - u3k(q_gen), - u3k(p_gen)); - } - _open_do_pq(tshp) // =- - { - return u3nt(c3__tsls, - u3k(q_gen), - u3k(p_gen)); - } - _open_do_pq(tsls) // =+ - { - return u3nt(c3__tsgr, - u3nc(u3k(p_gen), - u3nc(u3_nul, 1)), - u3k(q_gen)); - } - _open_do_p(tssg) // =~ - { - if ( !_(u3du(p_gen)) ) { - return u3nc(0, 1); - } else { - u3_noun tp_gen = u3t(p_gen); - u3_noun ip_gen = u3h(p_gen); - - if ( (u3_nul == p_gen) ) { - return u3nc(u3_blip, 1); - } - else if ( (u3_nul == tp_gen) ) { - return u3k(ip_gen); - } - else { - return u3nt(c3__tsgr, - u3k(ip_gen), - _open_in_tssg(ter, tp_gen)); - } - } - } -/*** -**** -***/ - _open_do_p(bccb) // $_ - { - return _ap_bunt(_al_core(ter, p_gen), p_gen); - } - _open_do_p(bctr) // $* - { - return - u3nc(c3__ktsg, - _ap_bunt(_al_core(ter, p_gen), - p_gen)); - } - _open_do_p(bczp) // $! - { - return u3nt(c3__bccb, - c3__axil, - u3k(p_gen)); - } -/*** -**** -***/ - _open_do_p(brhp) // |- - { - return u3nt(c3__tsgl, - u3nc(c3__cnzy, u3_blip), - u3nc(c3__brdt, u3k(p_gen))); - } - _open_do_p(brdt) // |. - { - return u3nc(c3__brcn, - u3nt(u3nt(u3_blip, c3__ash, u3k(p_gen)), - u3_nul, - u3_nul)); - } - -/*** -**** -***/ - _open_do_p(wtbr) // ?| - { - if ( (u3_nul == p_gen) ) { - return u3nt(c3__dtzz, 'f', c3n); - } - else { - u3_noun ip_gen = u3h(p_gen); - u3_noun tp_gen = u3t(p_gen); - - return u3nq(c3__wtcl, - u3k(ip_gen), - u3nt(c3__dtzz, 'f', c3y), - _open_in_wtbr(ter, tp_gen)); - } - } - _open_do_pqr(wtkt) // ?^ - { - return u3nq(c3__wtcl, - u3nt(c3__wtts, - u3nt(c3__axil, c3__atom, u3_blip), - u3k(p_gen)), - u3k(r_gen), - u3k(q_gen)); - } - _open_do_pq(wtgl) // ?< - { - return u3nq(c3__wtcl, - u3k(p_gen), - u3nc(c3__zpzp, u3_nul), - u3k(q_gen)); - } - _open_do_pqr(wtdt) // ?. - { - return u3nq(c3__wtcl, - u3k(p_gen), - u3k(r_gen), - u3k(q_gen)); - } - _open_do_pq(wtgr) // ?> - { - return u3nq(c3__wtcl, - u3k(p_gen), - u3k(q_gen), - u3nc(c3__zpzp, u3_nul)); - } - _open_do_pq(wthp) // ?- - { - if ( (u3_nul == q_gen) ) { - return u3nc(c3__zpfs, - u3nc(c3__cnzz, - u3k(p_gen))); - } - else { - u3_noun iq_gen = u3h(q_gen); - u3_noun tq_gen = u3t(q_gen); - u3_noun piq_gen = u3h(iq_gen); - u3_noun qiq_gen = u3t(iq_gen); - - return u3nq(c3__wtcl, - u3nt(c3__wtts, - u3k(piq_gen), - u3k(p_gen)), - u3k(qiq_gen), - _open_in_wthp(ter, p_gen, tq_gen)); - } - } - _open_do_p(wtpm) // ?& - { - if ( (u3_nul == p_gen) ) { - return u3nt(c3__dtzz, 'f', c3y); - } - else { - u3_noun ip_gen = u3h(p_gen); - u3_noun tp_gen = u3t(p_gen); - - return u3nq(c3__wtcl, - u3k(ip_gen), - _open_in_wtpm(ter, tp_gen), - u3nt(c3__dtzz, 'f', c3n)); - } - } - _open_do_pqr(wtls) // ?+ - { u3_noun tul = u3nc(u3nc(u3nc(c3__axil, c3__noun), - u3k(q_gen)), - u3_nul); - u3_noun zal = u3gb_weld(r_gen, tul); - u3_noun ret = u3nt(c3__wthp, u3k(p_gen), zal); - - u3z(tul); - return ret; - - } - _open_do_pqr(wtpt) // ?@ - { - return u3nq(c3__wtcl, - u3nt(c3__wtts, - u3nt(c3__axil, - c3__atom, - u3_blip), - u3k(p_gen)), - u3k(q_gen), - u3k(r_gen)); - } - _open_do_pqr(wtsg) // ?~ - { - return u3nq(c3__wtcl, - u3nt(c3__wtts, - u3nc(c3__axil, c3__null), - u3k(p_gen)), - u3k(q_gen), - u3k(r_gen)); - } - _open_do_p(wtzp) // ?! - { - return u3nq(c3__wtcl, - u3k(p_gen), - u3nt(c3__dtzz, 'f', c3n), - u3nt(c3__dtzz, 'f', c3y)); - } -/*** -**** -***/ - _open_do_pq(zpcb) // !_ - { - return u3k(q_gen); - } - _open_do_p(zpgr) // !> - { - return u3nq(c3__cnhp, - u3nc(c3__cnzy, c3__onan), - u3nt(c3__zpsm, - u3nc(c3__bctr, - u3nc(c3__herb, - u3nc(c3__cnzy, - c3__abel))), - u3k(p_gen)), - u3_nul); - } -/*** -**** -***/ - _open_do_pq(clhp) // :- - { - return u3nc(u3k(p_gen), - u3k(q_gen)); - } - _open_do_pq(clcb) // :_ - { - return u3nc(u3k(q_gen), - u3k(p_gen)); - } - _open_do_p(clcn) // :% - { - return u3nc(u3nc(c3__clsg, - u3k(p_gen)), - u3nc(c3__bczp, c3__null)); - } - _open_do_pqrs(clkt) // :^ - { - return u3nq(u3k(p_gen), - u3k(q_gen), - u3k(r_gen), - u3k(s_gen)); - } - _open_do_pqr(clls) // :+ - { - return u3nt(u3k(p_gen), - u3k(q_gen), - u3k(r_gen)); - } - _open_do_p(clsg) // :~ - { - if ( (u3_nul == p_gen) ) { - return u3nt(c3__dtzz, 'n', u3_nul); - } - else { - u3_noun ip_gen = u3h(p_gen); - u3_noun tp_gen = u3t(p_gen); - - return u3nc(u3k(ip_gen), - _open_in_clsg(ter, tp_gen)); - } - } - _open_do_p(cltr) // :* - { - if ( (u3_nul == p_gen) ) { - return u3nc(c3__zpzp, u3_nul); - } - else { - u3_noun ip_gen = u3h(p_gen); - u3_noun tp_gen = u3t(p_gen); - - if ( (u3_nul == tp_gen) ) { - return u3k(ip_gen); - } else { - return u3nc(u3k(ip_gen), - _open_in_cltr(ter, tp_gen)); - } - } - } -/*** -**** -***/ - _open_do_pq(cncb) // %_ - { - return u3nc(c3__ktls, - u3nq(u3nc(c3__cnzz, u3k(p_gen)), - c3__cnts, - u3k(p_gen), - u3k(q_gen))); - } -#if 0 - _open_do_pq(cncl) // %: - { - return u3nq - (c3__cnsg, - u3nc(u3_blip, u3_nul), - u3k(p_gen), - u3k(q_gen)); - } -#endif - _open_do_pq(cndt) // %. - { - return u3nt(c3__cnhp, - u3k(q_gen), - u3nc(u3k(p_gen), u3_nul)); - } - _open_do_pqrs(cnkt) // %^ - { - return u3nq(c3__cnhp, - u3k(p_gen), - u3k(q_gen), - u3nt(u3k(r_gen), - u3k(s_gen), - u3_nul)); - } - _open_do_pq(cnhp) // %- - { - if ( (u3_nul == q_gen) ) { - return u3nt(c3__tsgr, - u3k(p_gen), - u3nc(c3__cnzy, u3_blip)); - } else { - return u3nq(c3__cncl, - u3k(p_gen), - c3__cltr, - u3k(q_gen)); - } - } - _open_do_pqr(cnls) // %+ - { - return u3nc(c3__cnhp, - u3nq(u3k(p_gen), - u3k(q_gen), - u3k(r_gen), - u3_nul)); - } - _open_do_pqr(cnsg) // %~ - { - return u3nq(c3__cntr, - u3k(p_gen), - u3k(q_gen), - u3nc(u3nc(u3nc(u3nc(u3_nul, 6), 0), u3k(r_gen)), 0)); - } - _open_do_p(cnzy) // %cnzy - { - return u3nt(c3__cnts, - u3nc(u3k(p_gen), u3_nul), - u3_nul); - } - _open_do_p(cnzz) // %cnzz - { - return u3nt(c3__cnts, u3k(p_gen), u3_nul); - } -/*** -**** -***/ - _open_do_p(hxgl) // #< - { - return u3nq(c3__cnhp, - u3nc(c3__cnzy, c3__noah), - u3nc(c3__zpgr, - u3nc(c3__cltr, u3k(p_gen))), - u3_nul); - } - _open_do_p(hxgr) // #> - { - return u3nq(c3__cnhp, - u3nc(c3__cnzy, c3__cain), - u3nc(c3__zpgr, - u3nc(c3__cltr, u3k(p_gen))), - u3_nul); - } -/*** -**** -***/ - _open_do_pq(ktdt) // ^. - { - return u3nt(c3__ktls, - u3nq(c3__cnhp, u3k(p_gen), u3k(q_gen), u3_nul), - u3k(q_gen)); - } -#if 0 - _open_do_pq(kthp) // ^- - { - return u3nt(c3__ktls, - _ap_bunt(_al_bore(ter, p_gen), p_gen), - u3k(q_gen)); - } -#endif -/*** -**** -***/ - _open_do_pq(brcb) // |_ - { - return u3nt(c3__tsls, - u3nc(c3__bctr, u3k(p_gen)), - u3nc(c3__brcn, u3k(q_gen))); - } - _open_do_pq(brkt) // |^ - { - u3_noun diz = u3nc(c3__ash, u3k(p_gen)); - u3_noun ret = u3nt(c3__tsgr, - u3nc(c3__brcn, - u3gdb_put(q_gen, u3_blip, diz)), - u3nc(c3__cnzy, u3_blip)); - - u3z(diz); - return ret; - } - _open_do_pq(brls) // |+ - { - return u3nc(c3__ktbr, - u3nt(c3__brts, - u3k(p_gen), - u3k(q_gen))); - } - _open_do_p(brwt) // |? - { - return u3nt(c3__ktwt, - c3__brdt, - u3k(p_gen)); - } -/*** -**** -***/ - _open_do_pq(sgts) // ~= - { - return u3nt(c3__sggr, - u3nc(c3__germ, u3k(p_gen)), - u3k(q_gen)); - } -#if 0 - _open_do_pq(sgbr) // ~| - { - return u3nt - (c3__sggr, - u3nc(c3__mean, u3k(p_gen)), - u3k(q_gen)); - } -#endif - _open_do_pq(sggl) // ~> - { - return u3nt(c3__tsgl, - u3nq(c3__sggr, u3k(p_gen), u3_nul, 1), - u3k(q_gen)); - } - _open_do_pq(sgbc) // ~$ - { - return u3nt(c3__sggr, - u3nq(c3__live, - c3__dtzz, - u3_blip, - u3k(p_gen)), - u3k(q_gen)); - } - _open_do_pq(sgcb) // ~_ - { - return u3nt(c3__sggr, - u3nc(c3__mean, - u3nc(c3__brdt, - u3k(p_gen))), - u3k(q_gen)); - } - static u3_noun - _sgcn_a(u3_noun r_gen, - u3_noun nob) - { - if ( c3n == u3du(r_gen) ) { - return u3k(nob); - } else { - u3_noun ir_gen = u3h(r_gen); - u3_noun tr_gen = u3t(r_gen); - u3_noun pir_gen, qir_gen; - - u3x_cell(ir_gen, &pir_gen, &qir_gen); - - return u3nc(u3nc(u3nt(c3__dtzz, u3_blip, u3k(pir_gen)), - u3nc(c3__zpts, u3k(qir_gen))), - _sgcn_a(tr_gen, nob)); - } - } - _open_do_pqrs(sgcn) // ~% - { - return u3nt(c3__sggl, - u3nq(c3__sgcn, - c3__clls, - u3nt(c3__dtzz, u3_blip, u3k(p_gen)), - u3nt(u3nc(c3__zpts, u3k(q_gen)), - c3__clsg, - _sgcn_a(r_gen, u3_nul))), - u3k(s_gen)); - } - _open_do_pq(sgfs) // ~/ - { - return u3nc(c3__sgcn, - u3nq(u3k(p_gen), - u3nc(u3_nul, 7), - u3_nul, - u3k(q_gen))); - } - _open_do_pq(sgls) // ~+ - { - return u3nt(c3__sggr, - u3nq(c3__sgls, c3__dtzz, u3_blip, u3k(p_gen)), - u3k(q_gen)); - } - _open_do_pqr(sgpm) // ~& - { - return u3nt(c3__sggr, - u3nt(c3__slog, - u3nt(c3__dtzy, u3_blip, u3k(p_gen)), - u3nq(c3__cnhp, u3nc(c3__cnzy, c3__cain), - u3nc(c3__zpgr, u3k(q_gen)), u3_nul)), - u3k(r_gen)); - } - _open_do_pqrs(sgwt) // ~? - { - return u3nt(c3__tsls, - u3nq(c3__wtdt, - u3k(q_gen), - u3nc(c3__bczp, c3__null), - u3nc(u3nc(c3__bczp, c3__null), u3k(r_gen))), - u3nq(c3__wtsg, - u3nc(u3nc(u3_nul, 2),u3_nul), - u3nt(c3__tsgr, - u3nc(u3_nul, 3), - u3k(s_gen)), - u3nq(c3__sgpm, - u3k(p_gen), - u3nc(u3_nul, 5), - u3nt(c3__tsgr, - u3nc(u3_nul, 3), - u3k(s_gen))))); - } -/*** -**** -***/ - static u3_noun - _smcl_in(u3_noun q_gen) - { - u3_noun hq_gen = u3h(q_gen); - u3_noun tq_gen = u3t(q_gen); - - if ( c3n == u3du(tq_gen) ) { - return u3nt(c3__tsgr, - u3nc(u3_nul, 3), - u3k(hq_gen)); - } else { - return u3nc(c3__cnhp, - u3nq(u3nc(u3_nul, 2), - u3nt(c3__tsgr, - u3nc(u3_nul, 3), - u3k(hq_gen)), - _smcl_in(tq_gen), - u3_nul)); - } - } - _open_do_pq(smcl) - { - if ( c3n == u3du(q_gen) ) { - return u3nc(c3__zpzp, u3_nul); - } - else if ( u3_nul == u3t(q_gen) ) { - return u3k(u3h(q_gen)); - } - else { - return u3nt(c3__tsls, - u3k(p_gen), - _smcl_in(q_gen)); - } - } -#if 0 - _open_do_pq(smsm) - { - return - u3nt(c3__tsgr, u3nq(c3__ktts, c3__v, u3_nul, 1), - u3nt(c3__tsls, - u3nt(c3__ktts, c3__a, - u3nt(c3__tsgr, u3nc(c3__cnzy, c3__v), - u3k(p_gen))), - u3nt(c3__tsls, - u3nt(c3__ktts, c3__b, - u3nt(c3__tsgr, - u3nc(c3__cnzy, c3__v), - u3k(q_gen))), - u3nt(c3__tsls, - u3nt(c3__ktts, c3__c, - u3nq(c3__cnhp, - u3nc(c3__cnzy, c3__a), - u3nc(c3__cnzy, c3__b), - u3_nul)), - u3nt(c3__wtgr, - u3nt(c3__dtts, - u3nc(c3__cnzy, c3__c), - u3nc(c3__cnzy, c3__b)), - u3nc(c3__cnzy, c3__c)))))); - } -#endif - -/* functions -*/ - /** open - **/ - static u3_noun - _open_in(u3_noun ter, - u3_noun gen) - { - u3_noun p_gen, q_gen, r_gen, s_gen; - - return u3_none; - - if ( c3y == u3ud(gen) ) { - // printf("studly\n"); - // u3_err("stud m", gen); - return u3m_bail(c3__exit); - - return u3nt(c3__cnts, - u3nc(u3k(gen), u3_nul), - u3_nul); - } - else switch ( u3h(gen) ) { - default: return u3_none; - - case u3_nul: { - return u3nt(c3__cnts, - u3nc(u3k(gen), u3_nul), - u3_nul); - } - -# define _open_p(stem) \ - case c3__##stem: \ - return _open_in_##stem(ter, u3t(gen)); \ - -# define _open_pq(stem) \ - case c3__##stem: \ - if ( c3n == u3r_cell(u3t(gen), &p_gen, &q_gen) ) { \ - return u3m_bail(c3__fail); \ - } else return _open_in_##stem(ter, p_gen, q_gen); - -# define _open_pqr(stem) \ - case c3__##stem: \ - if ( c3n == u3r_trel(u3t(gen), &p_gen, &q_gen, &r_gen) ) { \ - return u3m_bail(c3__fail); \ - } else return _open_in_##stem(ter, p_gen, q_gen, r_gen); - -# define _open_pqrs(stem) \ - case c3__##stem: \ - if ( c3n == u3r_qual\ - (u3t(gen), &p_gen, &q_gen, &r_gen, &s_gen) )\ - { \ - return u3m_bail(c3__fail); \ - } else return _open_in_##stem(ter, p_gen, q_gen, r_gen, s_gen); - - _open_p (bccb); - _open_p (bctr); - _open_p (bczp); - - _open_p (brdt); - _open_pq (brcb); - _open_p (brhp); - _open_pq (brkt); - _open_pq (brls); - _open_p (brwt); - - _open_pq (clcb); - _open_p (clcn); - _open_pq (clhp); - _open_pqrs(clkt); - _open_pqr (clls); - _open_p (cltr); - _open_p (clsg); - _open_pq (cncb); - // _open_pq (cncl); - _open_pq (cndt); - _open_pqrs(cnkt); - _open_pq (cnhp); - _open_pqr (cnls); - _open_pqr (cnsg); - _open_p (cnzy); - _open_p (cnzz); - - _open_p (hxgl); - _open_p (hxgr); - - _open_pq (ktdt); -// _open_pq (kthp); - - _open_pq (sgts); -// _open_pq (sgbr); - _open_pq (sggl); - _open_pq (sgbc); - _open_pq (sgcb); - _open_pqrs(sgcn); - _open_pq (sgfs); - _open_pq (sgls); - _open_pqr (sgpm); - _open_pqrs(sgwt); - - _open_pq (smcl); - // _open_pq (smsm); - - _open_pq (tsbr); - _open_pq (tscl); - _open_pqr (tsdt); - _open_pq (tsgl); - _open_pq (tshp); - _open_pq (tsls); - _open_p (tssg); - - _open_pqr (wtdt); - _open_pq (wtgl); - _open_pqr (wtpt); - _open_pqr (wtsg); - _open_p (wtzp); - _open_p (wtbr); - _open_pq (wthp); - _open_pq (wtgr); - _open_pqr (wtls); - _open_pqr (wtkt); - _open_p (wtpm); - - _open_pq (zpcb); - _open_p (zpgr); - } - } - - /** rake - **/ - u3_noun - u3gfp_rake(u3_noun gen) - { - u3_noun p_gen, q_gen; - - if ( c3y == u3ud(gen) ) { - return u3nc(u3k(gen), u3_nul); - } - else switch ( u3h(gen) ) { - default: return u3m_error("rake-twig"); - - case u3_nul: return u3nc(u3k(gen), u3_nul); - - case c3__cnzy: { - return u3nc(u3k(u3t(gen)), u3_nul); - } - case c3__cnzz: { - return u3k(u3t(gen)); - } - case c3__cnts: { - if ( c3n == u3r_cell(u3t(gen), &p_gen, &q_gen) ) { - return u3m_bail(c3__fail); - } - else { - if ( u3_nul != q_gen ) { - return u3m_bail(c3__fail); - } - else { - return u3k(p_gen); - } - } - } - case c3__zpcb: { - if ( c3n == u3r_cell(u3t(gen), &p_gen, &q_gen) ) { - return u3m_bail(c3__fail); - } - else return u3gfp_rake(q_gen); - } - } - } - u3_noun - u3yfp_rake(u3_noun cor) - { - u3_noun gen; - - if ( u3_none == (gen = u3r_at(u3x_sam, cor)) ) { - return u3m_bail(c3__fail); - } else { - return u3gfp_rake(gen); - } - } - - /** hack - **/ - u3_noun - u3gfp_hack(u3_noun ter, - u3_noun gen) - { - u3_noun p_gen, q_gen; - u3_noun ret; - - if ( c3y == u3du(u3h(gen)) ) { - return u3nt(c3y, - u3k(u3h(gen)), - u3k(u3t(gen))); - } - else switch ( u3h(gen) ) { - case c3__tsgr: u3x_cell(u3t(gen), &p_gen, &q_gen); - { - if ( (c3n == u3du(p_gen)) || (u3_nul != u3h(p_gen)) ) { - return u3nc(c3n, u3k(gen)); - } - else { - u3_noun pyr = u3gfp_hack(ter, q_gen); - - if ( c3y == u3h(pyr) ) { - ret = u3nt(c3y, - u3nt(c3__tsgr, - u3k(p_gen), - u3k(u3h(u3t(pyr)))), - u3nt(c3__tsgr, - u3k(p_gen), - u3k(u3t(u3t(pyr))))); - } - else { - ret = u3nc(c3n, - u3nt(c3__tsgr, - u3k(p_gen), - u3k(u3t(pyr)))); - } - u3z(pyr); - return ret; - } - } - case c3__zpcb: u3x_cell(u3t(gen), &p_gen, &q_gen); - { - u3_noun pyr = u3gfp_hack(ter, q_gen); - - if ( c3y == u3h(pyr) ) { - ret = u3nt(c3y, - u3nt(c3__zpcb, - u3k(p_gen), - u3k(u3h(u3t(pyr)))), - u3nt(c3__zpcb, - u3k(p_gen), - u3k(u3t(u3t(pyr))))); - } - else { - ret = u3nc(c3n, - u3nt(c3__zpcb, - u3k(p_gen), - u3k(u3t(pyr)))); - } - u3z(pyr); - return ret; - } - default: break; - } - - { - u3_noun voq = _ap_open_l(ter, gen); - - if ( u3_none == voq ) { - return u3nc(c3n, u3k(gen)); - } - else if ( c3y == u3r_sing(voq, gen) ) { - return u3nc(c3n, voq); - } - else { - ret = u3gfp_hack(ter, voq); - - u3z(voq); - return ret; - } - } - } - - u3_noun - u3yfp_hack(u3_noun cor) - { - u3_noun gen; - - if ( u3_none == (gen = u3r_at(u3x_sam, cor)) ) { - return u3m_bail(c3__fail); - } else { - u3_noun ter = u3r_at(u3x_con, cor); - - return u3gfp_hack(ter, gen); - } - } - -/* boilerplate -*/ - static u3_noun - _ap_core(u3_noun ter, - u3_noun gen) - { - u3_noun gat = u3j_hook(u3k(ter), "ap"); - - return u3i_molt(gat, u3x_sam, u3k(gen), 0); - } - -/* open -*/ - static u3_noun - _ap_open_n(u3_noun ter, - u3_noun gen) - { - u3_noun cor = _ap_core(ter, gen); - - return u3j_soft(cor, "open"); - } - static u3_noun - _ap_open_l(u3_noun ter, - u3_noun gen) - { - u3_noun pro = _open_in(ter, gen); - - if ( u3_none != pro ) { - return pro; - } else { - return _ap_open_n(ter, gen); - } - } - - u3_noun - u3gfp_open(u3_noun ter, - u3_noun gen) - { - return _ap_open_l(ter, gen); - } - - u3_noun - u3yfp_open(u3_noun cor) - { - u3_noun gen; - - if ( u3_none == (gen = u3r_at(u3x_sam, cor)) ) { - return u3m_bail(c3__fail); - } else { - u3_noun ter = u3r_at(u3x_con, cor); - - return u3gfp_open(ter, gen); - } - } diff --git a/mets/f/cell.c b/mets/f/cell.c deleted file mode 100644 index b425a86bd5..0000000000 --- a/mets/f/cell.c +++ /dev/null @@ -1,29 +0,0 @@ -/* j/6/cell.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gf_cell(u3_noun hed, - u3_noun tal) - { - if ( (c3__void == hed) || (c3__void == tal) ) { - return c3__void; - } else { - return u3nt(c3__cell, u3k(hed), u3k(tal)); - } - } - u3_noun - u3yf_cell(u3_noun cor) - { - u3_noun hed, tal; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &hed, u3x_sam_3, &tal, 0) ) { - return u3m_bail(c3__fail); - } else { - return u3gf_cell(hed, tal); - } - } diff --git a/mets/f/comb.c b/mets/f/comb.c deleted file mode 100644 index 56c84c5e04..0000000000 --- a/mets/f/comb.c +++ /dev/null @@ -1,70 +0,0 @@ -/* j/6/comb.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gf_comb(u3_noun mal, - u3_noun buz) - { - if ( (u3_none == mal) || (u3_none == buz) ) { - return u3_none; - } - else { - u3_noun p_mal, q_mal, p_buz, q_buz, pp_buz, pq_buz; - - if ( (c3y == u3r_p(mal, 0, &p_mal)) && (0 != p_mal) ) { - if ( (c3y == u3r_p(buz, 0, &p_buz)) && (0 != p_buz) ) { - return u3nc(0, - u3gc_peg(p_mal, p_buz)); - } - else if ( c3y == u3r_pq(buz, 2, &p_buz, &q_buz) && - c3y == u3r_p(p_buz, 0, &pp_buz) && - c3y == u3r_p(q_buz, 0, &pq_buz) ) - { - return u3nt(2, - u3nc(0, - u3gc_peg(p_mal, pp_buz)), - u3nc(0, - u3gc_peg(p_mal, pq_buz))); - } - else return u3nt(7, - u3k(mal), - u3k(buz)); - } -#if 1 - else if ( (c3y == u3r_bush(mal, &p_mal, &q_mal)) && - (c3y == u3du(p_mal)) && - (c3y == u3du(q_mal)) && - (0 == u3h(q_mal)) && - (1 == u3t(q_mal)) ) - { - return u3nt(8, - u3k(p_mal), - u3k(buz)); - } -#endif - else if ( (c3y == u3r_p(buz, 0, &p_buz)) && - (c3y == u3r_sing(1, p_buz)) ) - { - return u3k(mal); - } - else return u3nt(7, - u3k(mal), - u3k(buz)); - } - } - u3_noun - u3yf_comb(u3_noun cor) - { - u3_noun mal, buz; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &mal, u3x_sam_3, &buz, 0) ) { - return u3_none; - } else { - return u3gf_comb(mal, buz); - } - } diff --git a/mets/f/cons.c b/mets/f/cons.c deleted file mode 100644 index f6a520d75c..0000000000 --- a/mets/f/cons.c +++ /dev/null @@ -1,52 +0,0 @@ -/* j/6/cons.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gf_cons(u3_noun vur, - u3_noun sed) - { - u3_noun p_vur, p_sed; - - if ( c3y == u3r_p(vur, 1, &p_vur) && - c3y == u3r_p(sed, 1, &p_sed) ) { - return u3nt(1, - u3k(p_vur), - u3k(p_sed)); - } - else if ( c3y == u3r_p(vur, 0, &p_vur) && - c3y == u3r_p(sed, 0, &p_sed) && - !(c3y == u3r_sing(1, p_vur)) && - !(c3y == u3r_sing(p_vur, p_sed)) && - (0 == u3r_nord(p_vur, p_sed)) ) - { - u3_atom fub = u3ga_div(p_vur, 2); - u3_atom nof = u3ga_div(p_sed, 2); - - if ( c3y == u3r_sing(fub, nof) ) { - u3z(nof); - - return u3nc(0, fub); - } - else { - u3z(fub); - u3z(nof); - } - } - return u3nc(u3k(vur), u3k(sed)); - } - u3_noun - u3yf_cons(u3_noun cor) - { - u3_noun vur, sed; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &vur, u3x_sam_3, &sed, 0) ) { - return u3m_bail(c3__fail); - } else { - return u3gf_cons(vur, sed); - } - } diff --git a/mets/f/core.c b/mets/f/core.c deleted file mode 100644 index 3b3cf19391..0000000000 --- a/mets/f/core.c +++ /dev/null @@ -1,29 +0,0 @@ -/* j/6/core.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gf_core(u3_noun pac, - u3_noun con) - { - if ( (c3__void == pac) ) { - return c3__void; - } else { - return u3nt(c3__core, u3k(pac), u3k(con)); - } - } - u3_noun - u3yf_core(u3_noun cor) - { - u3_noun pac, con; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &pac, u3x_sam_3, &con, 0) ) { - return u3m_bail(c3__fail); - } else { - return u3gf_core(pac, con); - } - } diff --git a/mets/f/face.c b/mets/f/face.c deleted file mode 100644 index 9e473202dd..0000000000 --- a/mets/f/face.c +++ /dev/null @@ -1,31 +0,0 @@ -/* j/6/face.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gf_face(u3_noun sag, - u3_noun tip) - { - if ( c3__void == tip ) { - return c3__void; - } - else return u3nt(c3__face, - u3k(sag), - u3k(tip)); - } - u3_noun - u3yf_face(u3_noun cor) - { - u3_noun sag, tip; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &sag, u3x_sam_3, &tip, 0) ) { - return u3m_bail(c3__fail); - } else { - return u3gf_face(sag, tip); - } - } - diff --git a/mets/f/fine.c b/mets/f/fine.c deleted file mode 100644 index 7155ad18f4..0000000000 --- a/mets/f/fine.c +++ /dev/null @@ -1,35 +0,0 @@ -/* j/6/fine.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gf_fine(u3_noun fuv, - u3_noun lup, - u3_noun mar) - { - if ( (c3__void == lup) || (c3__void == mar) ) { - return c3__void; - } else { - return u3nq(c3__fine, - u3k(fuv), - u3k(lup), - u3k(mar)); - } - } - u3_noun - u3yf_fine(u3_noun cor) - { - u3_noun fuv, lup, mar; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &fuv, - u3x_sam_6, &lup, - u3x_sam_7, &mar, 0) ) { - return u3m_bail(c3__fail); - } else { - return u3gf_fine(fuv, lup, mar); - } - } diff --git a/mets/f/fitz.c b/mets/f/fitz.c deleted file mode 100644 index 8d85110923..0000000000 --- a/mets/f/fitz.c +++ /dev/null @@ -1,67 +0,0 @@ -/* j/6/fitz.c -** -*/ -#include "all.h" - - -/* functions -*/ - static u3_noun - _fitz_fiz(u3_noun yaz, - u3_noun wix) - { - c3_w yaz_w = u3r_met(3, yaz); - c3_w wix_w = u3r_met(3, wix); - c3_y yaz_y, wix_y; - - yaz_y = (0 == yaz_w) ? 0 : u3r_byte((yaz_w - 1), yaz); - if ( (yaz_y < 'A') || (yaz_y > 'Z') ) yaz_y = 0; - - wix_y = (0 == wix_w) ? 0 : u3r_byte((wix_w - 1), wix); - if ( (wix_y < 'A') || (wix_y > 'Z') ) wix_y = 0; - - if ( yaz_y && wix_y ) { - if ( !wix_y || (wix_y > yaz_y) ) { - return c3n; - } - } - return c3y; - } - - u3_noun - u3gf_fitz(u3_noun yaz, - u3_noun wix) - { - c3_w i_w, met_w = c3_min(u3r_met(3, yaz), u3r_met(3, wix)); - - if ( c3n == _fitz_fiz(yaz, wix) ) { - return c3n; - } - for ( i_w = 0; i_w < met_w; i_w++ ) { - c3_y yaz_y = u3r_byte(i_w, yaz); - c3_y wix_y = u3r_byte(i_w, wix); - - if ( (yaz_y >= 'A') && (yaz_y <= 'Z') ) yaz_y = 0; - if ( (wix_y >= 'A') && (wix_y <= 'Z') ) wix_y = 0; - - if ( yaz_y && wix_y && (yaz_y != wix_y) ) { - return c3n; - } - } - return c3y; - } - - u3_noun - u3yf_fitz(u3_noun cor) - { - u3_noun yaz, wix; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &yaz, u3x_sam_3, &wix, 0)) || - (c3n == u3ud(yaz)) || - (c3n == u3ud(wix)) ) - { - return u3m_bail(c3__fail); - } else { - return u3gf_fitz(yaz, wix); - } - } diff --git a/mets/f/flan.c b/mets/f/flan.c deleted file mode 100644 index b8ba8ae825..0000000000 --- a/mets/f/flan.c +++ /dev/null @@ -1,44 +0,0 @@ -/* j/6/flan.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gf_flan(u3_noun bos, - u3_noun nif) - { - if ( c3y == u3r_sing(1, u3h(bos)) ) { - if ( (u3_nul == u3t(bos)) ) { - return u3k(nif); - } - else return u3k(bos); - } - else { - if ( c3y == u3r_sing(1, u3h(nif)) ) { - if ( (u3_nul == u3t(nif)) ) { - return u3k(bos); - } - else return u3k(nif); - } - else { - return u3nq(6, - u3k(bos), - u3k(nif), - u3nc(1, c3n)); - } - } - } - u3_noun - u3yf_flan(u3_noun cor) - { - u3_noun bos, nif; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &bos, u3x_sam_3, &nif, 0) ) { - return u3m_bail(c3__fail); - } else { - return u3gf_flan(bos, nif); - } - } diff --git a/mets/f/flip.c b/mets/f/flip.c deleted file mode 100644 index 170b4a996d..0000000000 --- a/mets/f/flip.c +++ /dev/null @@ -1,39 +0,0 @@ -/* j/6/flip.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gf_flip(u3_noun hel) - { - if ( c3y == u3r_sing(1, u3h(hel)) ) { - if ( (c3y == u3t(hel)) ) { - return u3nc(1, c3n); - } - else { - c3_assert((c3n == u3t(hel))); - - return u3nc(1, c3y); - } - } - else { - return u3nq(6, - u3k(hel), - u3nc(1, c3n), - u3nc(1, c3y)); - } - } - u3_noun - u3yf_flip(u3_noun cor) - { - u3_noun hel; - - if ( u3_none == (hel = u3r_at(u3x_sam, cor)) ) { - return u3m_bail(c3__fail); - } else { - return u3gf_flip(hel); - } - } diff --git a/mets/f/flor.c b/mets/f/flor.c deleted file mode 100644 index bbbb08bdd3..0000000000 --- a/mets/f/flor.c +++ /dev/null @@ -1,44 +0,0 @@ -/* j/6/flor.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gf_flor(u3_noun bos, - u3_noun nif) - { - if ( c3y == u3r_sing(1, u3h(bos)) ) { - if ( (u3_nul == u3t(bos)) ) { - return u3k(bos); - } - else return u3k(nif); - } - else { - if ( c3y == u3r_sing(1, u3h(nif)) ) { - if ( (u3_nul == u3t(nif)) ) { - return u3k(nif); - } - else return u3k(bos); - } - else { - return u3nq(6, - u3k(bos), - u3nc(1, c3y), - u3k(nif)); - } - } - } - u3_noun - u3yf_flor(u3_noun cor) - { - u3_noun bos, nif; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &bos, u3x_sam_3, &nif, 0) ) { - return u3m_bail(c3__fail); - } else { - return u3gf_flor(bos, nif); - } - } diff --git a/mets/f/fork.c b/mets/f/fork.c deleted file mode 100644 index 48ae310e5f..0000000000 --- a/mets/f/fork.c +++ /dev/null @@ -1,78 +0,0 @@ -/* j/6/fork.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gf_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 u3lf_fork(u3nt(u3k(hoz), u3k(bur), u3_nul)); - } - - u3_noun - u3gf_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 = u3ldi_uni(lez, u3k(u3t(i_yed))); - } - else { - lez = u3ldi_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 - u3yf_fork(u3_noun cor) - { - u3_noun yed; - - if ( c3n == u3r_mean(cor, u3x_sam, &yed, 0) ) { - return u3m_bail(c3__fail); - } else { - return u3gf_fork(yed); - } - } - - u3_noun - u3lf_fork(u3_noun yed) - { - u3_noun ret = u3gf_fork(yed); - - u3z(yed); - return ret; - } diff --git a/mets/f/help.c b/mets/f/help.c deleted file mode 100644 index a7c2e1512d..0000000000 --- a/mets/f/help.c +++ /dev/null @@ -1,31 +0,0 @@ -/* j/6/help.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gf_help(u3_noun sag, - u3_noun tip) - { - if ( c3__void == tip ) { - return c3__void; - } - else return u3nt(c3__help, - u3k(sag), - u3k(tip)); - } - u3_noun - u3yf_help(u3_noun cor) - { - u3_noun sag, tip; - - if ( c3n == u3r_mean(cor, u3x_sam_2, &sag, u3x_sam_3, &tip, 0) ) { - return u3m_bail(c3__fail); - } else { - return u3gf_help(sag, tip); - } - } - diff --git a/mets/f/hike.c b/mets/f/hike.c deleted file mode 100644 index cf3c045f5c..0000000000 --- a/mets/f/hike.c +++ /dev/null @@ -1,136 +0,0 @@ -/* j/6/hike.c -** -*/ -#include "all.h" - - -/* internal tools -*/ - /* _lily_hike_belt_root(): convert (pac) to a list of root tools. - */ - static u3_noun - _lily_hike_belt_root(u3_noun pac) - { - if ( (u3_nul == pac) ) { - return u3_nul; - } - else { - u3_atom axis = u3h(u3h(pac)); - u3_noun tool = u3t(u3h(pac)); - u3_noun list_tool = _lily_hike_belt_root(u3t(pac)); - - if ( c3y == u3r_sing(1, axis) ) { - return u3nc(u3k(tool), - list_tool); - } - else return list_tool; - } - } - - /* _lily_hike_belt_l(): factor (pac) left. - */ - static u3_noun - _lily_hike_belt_l(u3_noun pac) - { - if ( (u3_nul == pac) ) { - return u3_nul; - } - else { - u3_atom axis = u3h(u3h(pac)); - u3_noun tool = u3t(u3h(pac)); - u3_noun belt_l = _lily_hike_belt_l(u3t(pac)); - - { - if ( (1 != axis) && - (c3y == u3r_sing(2, u3gc_cap(axis))) ) - { - u3_atom axis_tap = u3gc_mas(axis); - - return u3nc(u3nc(u3k(axis_tap), - u3k(tool)), - belt_l); - } - else return belt_l; - } - } - } - - /* _lily_hike_belt_r(): factor (pac) right. - */ - static u3_noun - _lily_hike_belt_r(u3_noun pac) - { - if ( (u3_nul == pac) ) { - return u3_nul; - } - else { - u3_atom axis = u3h(u3h(pac)); - u3_noun tool = u3t(u3h(pac)); - u3_noun belt_r = _lily_hike_belt_r(u3t(pac)); - - { - if ( (1 != axis) && - (c3y == u3r_sing(3, u3gc_cap(axis))) ) - { - u3_atom axis_tap = u3gc_mas(axis); - - return u3nc(u3nc(u3k(axis_tap), - u3k(tool)), - belt_r); - } - else return belt_r; - } - } - } - -/* functions -*/ - u3_noun - u3gf_hike(u3_noun axe, - u3_noun pac) - { - if ( (u3_nul == pac) ) { - return u3nc(0, u3k(axe)); - } - else { - u3_noun zet = _lily_hike_belt_root(pac); - - if ( u3_nul != zet ) { - u3_noun fol = u3k(u3h(zet)); - - u3z(zet); - return fol; - } - else { - u3_noun tum = _lily_hike_belt_l(pac); - u3_noun gam = _lily_hike_belt_r(pac); - u3_noun hax = u3gc_peg(axe, 2); - u3_noun moz = u3gc_peg(axe, 3); - u3_noun zip = u3gf_hike(hax, tum); - u3_noun dof = u3gf_hike(moz, gam); - u3_noun fol = u3gf_cons(zip, dof); - - u3z(tum); - u3z(gam); - u3z(hax); - u3z(moz); - u3z(zip); - u3z(dof); - - return fol; - } - } - } - u3_noun - u3yf_hike(u3_noun cor) - { - u3_noun axe, pac; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &axe, u3x_sam_3, &pac, 0)) || - (c3n == u3ud(axe)) ) - { - return u3m_bail(c3__fail); - } else { - return u3gf_hike(axe, pac); - } - } diff --git a/mets/f/look.c b/mets/f/look.c deleted file mode 100644 index 68c5a33f18..0000000000 --- a/mets/f/look.c +++ /dev/null @@ -1,132 +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); - } - 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, - u3gc_peg(axe, 2), - u3k(qn_dab)); - } - else { - if ( c3y == u3gc_gor(cog, pn_dab) ) { - return u3_nul; - } - else { - u3_noun pro; - - axe = u3gc_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, - u3gc_peg(axe, 2), - u3k(qn_dab)); - } - else { - if ( c3y == u3gc_gor(cog, pn_dab) ) { - u3_noun pro; - - axe = u3gc_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, - u3gc_peg(axe, 2), - u3k(qn_dab)); - } - else { - if ( c3y == u3gc_gor(cog, pn_dab) ) { - u3_noun pro; - - axe = u3gc_peg(axe, 6); - pro = _look_in(cog, l_dab, axe); - u3z(axe); - return pro; - } - else { - u3_noun pro; - - axe = u3gc_peg(axe, 7); - pro = _look_in(cog, r_dab, axe); - u3z(axe); - return pro; - } - } - } - } - } - } - - - - -/* functions -*/ - u3_noun - u3gf_look(u3_noun cog, - u3_noun dab) - { - return _look_in(cog, dab, 1); - } - u3_noun - u3yf_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 u3gf_look(cog, dab); - } - } diff --git a/mets/f/loot.c b/mets/f/loot.c deleted file mode 100644 index aecca85299..0000000000 --- a/mets/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 = u3gf_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, u3gc_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 = u3gc_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 = u3gc_peg(axe, 2); - u3_noun pro; - - pro = u3nt(u3_nul, u3gc_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 = u3gc_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 = u3gc_peg(axe, 2); - u3_noun pro; - - pro = u3nt(u3_nul, u3gc_peg(nax, u3h(u_yep)), u3k(u3t(u_yep))); - u3z(nax); - u3z(yep); - return pro; - } - } - else { - if ( u3_nul == yep ) { - u3_noun nax = u3gc_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 = u3gc_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 = u3gc_peg(axe, 2); - u3_noun pro; - - pro = u3nt(u3_nul, u3gc_peg(nax, u3h(u_yep)), u3k(u3t(u_yep))); - u3z(nax); - u3z(yep); - return pro; - } - } - } - } - } - -/* functions -*/ - u3_noun - u3gf_loot(u3_noun cog, - u3_noun dom) - { - return _loot_in(cog, dom, 1); - } - u3_noun - u3yf_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 u3gf_loot(cog, dom); - } - } diff --git a/mets/f/slot.c b/mets/f/slot.c deleted file mode 100644 index 56ccbf8d1d..0000000000 --- a/mets/f/slot.c +++ /dev/null @@ -1,55 +0,0 @@ -/* j/6/slot.c -** -*/ -#include "all.h" - - -/* functions -*/ - u3_noun - u3gf_slot(u3_atom axe, - u3_noun vax) - { - u3_noun fag = u3r_at(axe, u3t(vax)); - - fprintf(stderr, "slot axe %d\r\n", axe); - - if ( u3_none == fag ) { - return u3m_bail(c3__exit); - } - else { - u3_noun typ = u3gfu_peek( - } - c3_w i_w, met_w = c3_min(u3r_met(3, axe), u3r_met(3, vax)); - - if ( c3n == _slot_fiz(axe, vax) ) { - return c3n; - } - for ( i_w = 0; i_w < met_w; i_w++ ) { - c3_y axe_y = u3r_byte(i_w, axe); - c3_y vax_y = u3r_byte(i_w, vax); - - if ( (axe_y >= 'A') && (axe_y <= 'Z') ) axe_y = 0; - if ( (vax_y >= 'A') && (vax_y <= 'Z') ) vax_y = 0; - - if ( axe_y && vax_y && (axe_y != vax_y) ) { - return c3n; - } - } - return c3y; - } - - u3_noun - u3ye_slot(u3_noun cor) - { - u3_noun axe, vax; - - if ( (c3n == u3r_mean(cor, u3x_sam_2, &axe, u3x_sam_3, &vax, 0)) || - (c3n == u3ud(axe)) || - (c3n == u3du(vax)) ) - { - return u3m_bail(c3__fail); - } else { - return u3gf_slot(axe, vax); - } - } diff --git a/mets/f/type.c b/mets/f/type.c deleted file mode 100644 index d8eaa518e7..0000000000 --- a/mets/f/type.c +++ /dev/null @@ -1,42 +0,0 @@ -/* j/6/type.c -** -*/ - -/* new template for type switching -*/ -{ - u3_noun p_sut, q_sut, r_sut; - - if ( c3n == u3du(sut) ) switch ( sut ) { - default: return u3m_bail(c3__fail); - - case c3__noun: - { - } - case c3__void: - { - } - } - else switch ( u3h(sut) ) { - default: return u3m_bail(c3__fail); - - case c3__atom: u3x_cell(u3t(sut), &p_sut, &q_sut); - { - } - case c3__cell: u3x_cell(u3t(sut), &p_sut, &q_sut); - { - } - case c3__core: u3x_cell(u3t(sut), &p_sut, &q_sut); - { - } - case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut); - { - } - case c3__fork: p_sut = u3t(sut); - { - } - case c3__hold: p_sut = u3t(sut); - { - } - } -} diff --git a/mets/f/ut.c b/mets/f/ut.c deleted file mode 100644 index 395cf03393..0000000000 --- a/mets/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 - u3gfu_duck(u3_noun van, - u3_noun typ) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(typ), 0); - u3_noun ret = u3j_hook(u3k(von), "dune"); - - u3z(von); - return ret; - } - - // dung: create a dunk core for mean (noun caption) - // - u3_noun - u3gfu_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_hook(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 - u3gfu_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_hook(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 - u3gfu_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(u3gfu_dunq(van, ugh_c, typ))); -#endif - } - - // shew: create a show core for mean - // - u3_noun - u3gfu_shew(u3_noun van, - u3_noun mol) - { - u3_noun sho = u3j_hook(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 - u3gfu_shep(u3_noun van, - const c3_c* paz_c, - u3_noun sty, - u3_noun mol) - { - return u3gfu_shew(van, - u3nc(u3nc('c', u3i_string(paz_c)), - u3nc(u3k(sty), mol))); - } - diff --git a/mets/f/ut_burn.c b/mets/f/ut_burn.c deleted file mode 100644 index a0964d91bc..0000000000 --- a/mets/f/ut_burn.c +++ /dev/null @@ -1,192 +0,0 @@ -/* j/6/ut_burn.c -** -*/ -#include "all.h" - - -/* logic -*/ - static u3_noun - _burn_in(u3_noun van, u3_noun sut, u3_noun gil); - - static u3_noun - _burn_fork(u3_noun van, - u3_noun yed, - u3_noun gil) - { - if ( u3_nul == yed ) { - return u3_nul; - } else { - u3_noun dis = _burn_in(van, u3h(yed), gil); - u3_noun mor = _burn_fork(van, u3t(yed), gil); - - if ( u3_nul == dis ) return mor; - if ( u3_nul == mor ) return dis; - { - u3_noun u_dis = u3t(dis); - u3_noun u_mor = u3t(mor); - - if ( u3du(u_dis) == u3du(u_mor) ) { - if ( c3y == u3gc_gor(u_mor, u_dis) ) { - u3z(dis); - return mor; - } else { - u3z(mor); - return dis; - } - } else { - if ( c3y == u3ud(u_dis) ) { - u3z(mor); - return dis; - } - else { - u3z(dis); - return mor; - } - } - } - } - } - - static u3_noun - _burn_in(u3_noun van, - u3_noun sut, - u3_noun gil) - { - u3_noun p_sut, q_sut, pq_sut, qq_sut, rq_sut, sq_sut, psq_sut, qsq_sut; - - if ( c3n == u3du(sut) ) switch ( sut ) { - default: return u3m_bail(c3__fail); - - case c3__noun: return u3nc(u3_nul, 0); - case c3__void: { - return u3_nul; - } - } - else switch ( u3h(sut) ) { - default: return u3m_bail(c3__fail); - - case c3__atom: u3x_cell(u3t(sut), &p_sut, &q_sut); - { - if ( c3y == u3du(q_sut) ) { - return u3nc(u3_nul, u3k(u3t(q_sut))); - } else { - return u3nc(u3_nul, 0); - } - } - case c3__cell: u3x_cell(u3t(sut), &p_sut, &q_sut); - { - u3_noun hed = _burn_in(van, p_sut, gil); - - if ( u3_nul == hed ) { - return u3_nul; - } - else { - u3_noun tal = _burn_in(van, q_sut, gil); - - if ( u3_nul == tal ) { - u3z(hed); - return u3_nul; - } - else { - u3_noun ret = u3nt(u3_nul, u3k(u3t(hed)), u3k(u3t(tal))); - - u3z(hed); - u3z(tal); - return ret; - } - } - } - case c3__core: u3x_cell(u3t(sut), &p_sut, &q_sut); - u3x_qual(q_sut, &pq_sut, &qq_sut, &rq_sut, &sq_sut); - u3x_cell(sq_sut, &psq_sut, &qsq_sut); - { - u3_noun pay = _burn_in(van, p_sut, gil); - - if ( u3_nul == pay ) { - return u3_nul; - } - else { - u3_noun ret = u3nt(u3_nul, u3k(psq_sut), u3k(u3t(pay))); - - u3z(pay); - return ret; - } - } - case c3__help: - case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut); - { - return _burn_in(van, q_sut, gil); - } - case c3__fork: p_sut = u3t(sut); - { - u3_noun yed = u3gdi_tap(p_sut); - u3_noun ret = _burn_fork(van, yed, gil); - - u3z(yed); - return ret; - } - case c3__hold: - { - if ( (c3y == u3gdi_has(gil, sut)) ) { - return u3_nul; - } - else { - u3_noun zoc = u3gdi_put(gil, sut); - u3_noun fop = u3gfu_repo(van, sut); - u3_noun pro = _burn_in(van, fop, zoc); - - u3z(fop); - u3z(zoc); - - return pro; - } - } - } - } - - static u3_noun - _cqfu_burn(u3_noun van, - u3_noun sut) - { - u3_noun unt = _burn_in(van, sut, u3_nul); - - if ( u3_nul == unt ) { - return u3m_error("burn"); - } - else { - u3_noun ret = u3k(u3t(unt)); - - u3z(unt); - return ret; - } - } - - u3_noun - u3gfu_burn(u3_noun van, - u3_noun sut) - { - c3_m fun_m = 144 + c3__burn + ((!!u3r_at(u3gfu_van_vet, van)) << 8); - u3_noun pro = u3z_find(fun_m, sut); - - if ( u3_none != pro ) { - return pro; - } - else { - pro = _cqfu_burn(van, sut); - - return u3z_save(fun_m, sut, pro); - } - } - - u3_noun - u3yfu_burn(u3_noun cor) - { - u3_noun sut; - - if ( u3_none == (sut = u3r_at(u3x_sam, cor)) ) { - return u3m_bail(c3__fail); - } else { - return u3gfu_burn(cor, sut); - } - } diff --git a/mets/f/ut_buss.c b/mets/f/ut_buss.c deleted file mode 100644 index 521a2fef9f..0000000000 --- a/mets/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_hook(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_hook(von, "busk"); - - return u3n_kick_on(u3i_molt(gat, - u3x_sam, - u3k(gen), - 0)); - } - -/* boilerplate -*/ - u3_noun - u3yfu_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 - u3gfu_buss(u3_noun van, - u3_noun sut, - u3_noun cog, - u3_noun gen) - { - return _cqfu_buss(van, sut, cog, gen); - } - - - u3_noun - u3yfu_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 - u3gfu_busk(u3_noun van, - u3_noun sut, - u3_noun gen) - { - return _cqfu_busk(van, sut, gen); - } - diff --git a/mets/f/ut_conk.c b/mets/f/ut_conk.c deleted file mode 100644 index 249a23ea73..0000000000 --- a/mets/f/ut_conk.c +++ /dev/null @@ -1,90 +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 nux = u3nc(u3_nul, u3k(got)); - u3_noun ret = u3gf_face(nux, sut); - - u3z(nux); - 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 = u3gf_face(nux, cok); - - u3z(nux); - u3z(cok); - return ret; - } - case 2: { - u3_noun vet = u3r_at(u3gfu_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 == u3gfu_nest(van, cel, c3y, sut) ) { - return u3m_bail(c3__fail); - } - u3z(cel); - } - hed = u3gfu_peek(van, sut, c3__both, 2); - tal = u3gfu_peek(van, sut, c3__both, 3); - deh = _cqfu_conk(van, hed, u3h(u3t(got))); - lat = _cqfu_conk(van, tal, u3t(u3t(got))); - - ret = u3gf_cell(deh, lat); - - u3z(lat); - u3z(deh); - u3z(tal); - u3z(hed); - - return ret; - } - } - } - -/* boilerplate -*/ - u3_noun - u3yfu_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 - u3gfu_conk(u3_noun van, - u3_noun sut, - u3_noun got) - { - return _cqfu_conk(van, sut, got); - } - diff --git a/mets/f/ut_crop.c b/mets/f/ut_crop.c deleted file mode 100644 index dfb45b03b3..0000000000 --- a/mets/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 = u3gfu_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 == u3gfu_nest(van, p_ref, c3n, p_sut) ) - { - u3_noun foz = _crop_dext(van, q_sut, q_ref, bix); - u3_noun ret = u3gf_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__help: u3x_cell(u3t(sut), &p_sut, &q_sut); - { - u3_noun foz = _crop_dext(van, q_sut, ref, bix); - u3_noun ret = u3gf_help(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 = u3gf_face(p_sut, foz); - - u3z(foz); - return ret; - } - case c3__fork: p_sut = u3t(sut); - { - u3_noun yed = u3gdi_tap(p_sut); - u3_noun ret = u3lf_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 == u3gdi_has(bix, hud) ) { -# if 0 - u3_noun dun = u3gfu_dunq(van, "type", sut); - u3_noun niz = u3gfu_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 = u3gdi_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__help: - 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 = u3gdi_tap(p_ref); - u3_noun ret = _crop_sint_fork(van, sut, yed, bix); - - u3z(yed); - return ret; - } - case c3__hold: - { - u3_noun rep = u3gfu_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 - u3yfu_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 - u3gfu_crop(u3_noun van, - u3_noun sut, - u3_noun ref) - { - c3_m fun_m = 144 + c3__crop + ((!!u3r_at(u3gfu_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/mets/f/ut_find.c b/mets/f/ut_find.c deleted file mode 100644 index 7072069245..0000000000 --- a/mets/f/ut_find.c +++ /dev/null @@ -1,896 +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); - - static u3_noun - u3gfu_felt(u3_noun van, - u3_noun sut, - u3_noun lap) - { - u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0); - u3_noun gat = u3j_hook(von, "felt"); - - return u3n_kick_on(u3i_molt(gat, - u3x_sam, - u3k(lap), - 0)); - } - - static u3_noun - u3gfu_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_hook(von, "fund"); - - return u3n_kick_on(u3i_molt(gat, - u3x_sam_2, - u3k(way), - u3x_sam_3, - u3k(gen), - 0)); - } - - static u3_noun - u3gfu_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_hook(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 u3nq - (c3y, - u3_nul, - u3nt(u3_nul, - u3nc(u3_nul, u3k(axe)), - u3k(lon)), - u3nc(c3y, u3k(sut))); - } - else { - return u3nt - (c3n, c3y, u3ga_dec(p_heg)); - } - } - - static u3_noun - _find_join(u3_noun a, - u3_noun b) - { - if ( c3y == u3r_sing(a, b) ) { - return u3k(a); - } else { - return u3lb_weld(u3k(a), u3nc(c3_s2('|', '|'), u3k(b))); - } - } - - 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 = u3gc_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 = u3gc_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, sq_sut, psq_sut, qsq_sut; - - u3x_cell(u3t(sut), &p_sut, &q_sut); - u3x_qual(q_sut, &pq_sut, &qq_sut, &rq_sut, &sq_sut); - u3x_cell(sq_sut, &psq_sut, &qsq_sut); - { - if ( u3_nul == q_heg ) { - return _find_buck_here(van, sut, way, p_heg, q_heg, axe, lon, gil); - } - else { - u3_noun zem = u3gf_loot(u3t(q_heg), qsq_sut); - - if ( (u3_nul != zem) && (0 != p_heg) ) { - u3_noun ped; - - ped = u3ga_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 pqu_zem = u3h(qu_zem); - u3_noun qqu_zem = u3t(qu_zem); - u3_noun mut; - u3_noun pro; - - mut = u3nt(c3__core, - u3k(p_sut), - u3nq(c3__gold, - u3k(qq_sut), - u3k(rq_sut), - u3k(sq_sut))); - - pro = u3nq - (c3y, - u3k(pqu_zem), - u3nc(u3nc(u3_nul, u3k(axe)), u3k(lon)), - u3nt(c3n, - u3gc_peg(2, pu_zem), - u3nt(u3nc(mut, u3k(qqu_zem)), u3_nul, u3_nul))); - - u3z(zem); - return pro; - } - else { - u3_noun pec = u3gfu_peel(van, sut, way, pq_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 = u3gc_peg(axe, 3); - - pro = _find_buck(van, p_sut, way, p_heg, q_heg, exa, lon, gil); - u3z(exa); - } - else { - u3_noun sam = u3gfu_peek(van, p_sut, way, 2); - u3_noun exa = u3gc_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); // wain - u3_noun ppp_yor = u3h(pp_yor); // wain - u3_noun qpp_hax = u3t(pp_hax); - u3_noun qpp_yor = u3t(pp_yor); - u3_noun pqpp_hax = u3h(qpp_hax); // span - u3_noun pqpp_yor = u3h(qpp_yor); // span - u3_noun qqpp_hax = u3t(qpp_hax); // nock - u3_noun qqpp_yor = u3t(qpp_yor); // nock - - if ( c3n == u3r_sing(qqpp_hax, qqpp_yor) ) { - return u3m_error("find-fork-c"); - } - return u3nq(c3n, - c3n, - _find_join(ppp_hax, ppp_yor), - u3nc( - u3lf_fork(u3nt(u3k(pqpp_hax), u3k(pqpp_yor), u3_nul)), - u3k(qqpp_hax))); - } - } - } - else { - if ( c3n == u3h(yor) ) { - return u3m_error("find-fork-d"); - } - else { - u3_noun p_hax = u3t(hax); // {wain vein opal} - u3_noun p_yor = u3t(yor); // {wain vein opal} - u3_noun pp_hax = u3h(p_hax); // wain - u3_noun pp_yor = u3h(p_yor); // wain - u3_noun qp_hax = u3t(p_hax); // {vein opal} - u3_noun qp_yor = u3t(p_yor); // {vein opal} - u3_noun pqp_hax = u3h(qp_hax); // vein - u3_noun pqp_yor = u3h(qp_yor); // vein - u3_noun qqp_hax = u3t(qp_hax); // opal - u3_noun qqp_yor = u3t(qp_yor); // opal - - if ( c3n == u3r_sing(pqp_hax, pqp_yor) ) { - return u3m_error("find-fork-e"); - } - else { - if ( c3y == u3h(qqp_hax) ) { - if ( c3y != u3h(qqp_yor) ) { - return u3m_error("find-fork-f"); - } else { - u3_noun pqqp_hax = u3t(qqp_hax); // span - u3_noun pqqp_yor = u3t(qqp_yor); // span - - return - u3nq(c3y, - _find_join(pp_hax, pp_yor), - u3k(pqp_hax), - u3nc(c3y, u3lf_fork - (u3nt(u3k(pqqp_hax), u3k(pqqp_yor), u3_nul)))); - } - } - else if ( c3n != u3h(qqp_yor) ) { - return u3m_error("find-fork-g"); - } else { - u3_noun pqqp_hax = u3h(u3t(qqp_hax)); // axis - u3_noun pqqp_yor = u3h(u3t(qqp_yor)); // axis - u3_noun qqqp_hax = u3t(u3t(qqp_hax)); // (set {span foot}) - u3_noun qqqp_yor = u3t(u3t(qqp_yor)); // (set {span foot}) - - if ( c3n == u3r_sing(pqqp_hax, pqqp_yor) ) { - return u3m_error("find-fork-h"); - } else { - return - u3nq(c3y, - u3_nul, - u3k(pqp_hax), - u3nt(c3n, u3k(pqqp_hax), u3gdi_uni(qqqp_hax, qqqp_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 = u3gdi_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 ) { - // if ( 1 ) { - 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 = u3gfu_mint // (pair span nock) - (van, q_sut, c3__noun, iqp_sut); - u3_noun tqp_sut = u3t(qp_sut); // (list twig) - u3_noun p_tiv = u3h(tiv); // span - 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 span nock) - u3_noun ret; - u3_noun dog = u3nc(0, u3k(axe)); // nock - u3_noun wan; - - if ( c3y == u3h(fid) ) { - wan = u3k(u3h(u3t(fid))); - tor = u3nc(c3y, u3k(u3t(u3t(fid)))); - } else { - wan = u3k(u3h(u3t(u3t(fid)))); - tor = u3nc(c3n, u3k(u3t(u3t(fid)))); - } - u3z(fid); - - vat = u3gfu_fine(van, sut, tor); - u3z(tor); - - ret = u3nq - (c3n, - c3n, - wan, - u3nc(u3k(u3h(vat)), u3gf_comb(u3gf_comb(dog, q_tiv), u3t(vat)))); - - u3z(vat); - u3z(dog); - 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; - u3_noun pp_sut, qp_sut; - - u3x_cell(u3t(sut), &p_sut, &q_sut); - u3x_cell(p_sut, &pp_sut, &qp_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(qp_sut) ) { - if ( c3y == u3r_sing(qp_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 pqp_sut = u3h(qp_sut); // (map term {wain (unit twig)}) - u3_noun qqp_sut = u3t(qp_sut); // (list (pair span nock)) - u3_noun tyr = u3gdb_get(pqp_sut, uq_heg); // (unit {wain (unit twig)}) - - if ( u3_nul == tyr ) { - return _find_buck_face_next - (van, sut, q_sut, qqp_sut, way, p_heg, q_heg, axe, lon, gil); - } - else { - u3_noun u_tyr = u3t(tyr); // (pair wain (unit twig)) - u3_noun pu_tyr = u3h(u_tyr); - u3_noun qu_tyr = u3t(u_tyr); - - if ( u3_nul == qu_tyr ) { - u3_noun nol = u3nc(u3_nul, u3k(lon)); - u3_noun dep = u3ga_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 uqu_tyr = u3t(qu_tyr); - u3_noun tor = u3gfu_fund(van, sut, way, uqu_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 = u3nq(c3y, u3_nul, u3gb_weld(pp_tor, nol), u3k(qp_tor)); - u3z(nol); - u3z(tor); - u3z(tyr); - return ret; - } - else { - u3_noun p_tor = u3t(tor); // (pair span nock) - u3_noun pp_tor = u3h(p_tor); // span - u3_noun qp_tor = u3t(p_tor); // nock - u3_noun dog = u3nc(0, u3k(axe)); // nock - u3_noun ret; - - ret = u3nq(c3n, - c3n, - u3k(pu_tyr), - u3nc(u3k(pp_tor), u3gf_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__help: - { - u3_noun fop = u3gfu_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 == u3gdi_has(gil, sut)) ) { - return u3_nul; - } - else { - u3_noun zoc = u3gdi_put(gil, sut); - u3_noun fop = u3gfu_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, // span - u3_noun way, // ?(%read %rite %free %both) - u3_noun i_hyp, // limb - u3_noun p_mor) // {wain palo} - { - u3_noun qp_mor = u3t(p_mor); // palo - u3_noun pqp_mor = u3h(qp_mor); // vein - u3_noun qqp_mor = u3t(qp_mor); // opal - { - u3_noun ref = u3gfu_felt(van, sut, qqp_mor); - u3_noun lon = u3k(pqp_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 - - ret = u3nq - (c3y, - u3_nul, - u3nc(u3nc(u3_nul, u3k(p_heg)), u3k(lon)), - u3nc(c3y, u3gfu_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 u3nq(c3y, u3_nul, 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); // {wain span nock} - u3_noun ppp_mor = u3h(pp_mor); - u3_noun qpp_mor = u3t(pp_mor); - u3_noun pqpp_mor = u3h(qpp_mor); // span - u3_noun qqpp_mor = u3t(qpp_mor); // nock - u3_noun gen = u3nt(c3__wing, u3k(i_hyp), u3_nul); - u3_noun fex = u3gfu_mint(van, pqpp_mor, c3__noun, gen); - u3_noun ret = u3nq(c3n, - c3n, - u3k(ppp_mor), - u3nc(u3k(u3h(fex)), - u3gf_comb(qqpp_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(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 - u3yfu_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 - u3gfu_find(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun hyp) - { - c3_m fun_m = 144 + c3__find + ((!!u3r_at(u3gfu_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 - u3yfu_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 - u3gfu_fond(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun hyp) - { - c3_m fun_m = 144 + c3__fond + ((!!u3r_at(u3gfu_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/mets/f/ut_fire.c b/mets/f/ut_fire.c deleted file mode 100644 index 973b99ec0b..0000000000 --- a/mets/f/ut_fire.c +++ /dev/null @@ -1,195 +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(u3gfu_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(u3gfu_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 == u3gdi_has(rib, key) ) { - ret = c3y; - } - else { - u3_noun rob = u3gdi_put(rib, key); - u3_noun von = u3i_molt(u3k(van), - u3gfu_van_rib, - u3k(rob), - 0); - u3_noun mul = u3gfu_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 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_cell(gat, &h_gat, &t_gat)) ) - { - return u3m_bail(c3__fail); - } else { - u3_noun dox = u3nt - (c3__core, u3k(qq_typ), u3k(q_typ)); - - if ( c3__ash == u3h(gat) ) { - if ( (c3y == vet) && - (c3n == u3gfu_nest(van, qq_typ, c3y, p_typ)) ) - { -#if 0 - u3_noun dun = u3gfu_dunq(van, "need", qq_typ); - u3_noun niz = u3gfu_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__elm == u3h(gat)); -#if 0 - u3_noun dun = u3gfu_dunq(van, "wild", typ); - u3_noun niz = u3gfu_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(u3gfu_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__elm == 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 - u3yfu_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 - u3gfu_fire(u3_noun van, - u3_noun sut, - u3_noun hag) - { - return _cqfu_fire(van, sut, hag); - } diff --git a/mets/f/ut_fish.c b/mets/f/ut_fish.c deleted file mode 100644 index 6992655cbc..0000000000 --- a/mets/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 = u3gf_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 = u3gf_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 = u3gc_peg(axe, 2); - u3_noun rit = u3gc_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 = u3gf_flan(hed, tal); - u3_noun vug = u3gf_flan(hut, hob); - - u3z(hob); - u3z(tal); - u3z(hed); - u3z(rit); - u3z(lef); - u3z(hut); - - return vug; - } - } - case c3__core: { - return u3nc(0, 0); - } - case c3__help: - 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 = u3gdi_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 == u3gdi_has(vit, sut)) ) { - // u3_noun dun = u3gfu_dunq(van, "type", sut); - u3_noun niz = u3gfu_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 = u3gdi_put(vit, sut); - u3_noun fop = u3gfu_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 - u3yfu_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 - u3gfu_fish(u3_noun van, - u3_noun sut, - u3_noun axe) - { - c3_m fun_m = 144 + c3__fish + ((!!u3r_at(u3gfu_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/mets/f/ut_fuse.c b/mets/f/ut_fuse.c deleted file mode 100644 index a0831522d4..0000000000 --- a/mets/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 = u3gfu_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 == u3gf_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 = u3gf_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__help: u3x_cell(u3t(sut), &p_sut, &q_sut); - { - u3_noun vot = _fuse_in(van, q_sut, ref, bix); - u3_noun ret = u3gf_help(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 = u3gf_face(p_sut, vot); - - u3z(vot); - return ret; - } - case c3__fork: p_sut = u3t(sut); - { - u3_noun yed = u3gdi_tap(p_sut); - u3_noun ret = u3lf_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 == u3gdi_has(bix, hud) ) { - // u3_noun dun = u3gfu_dunq(van, "type", sut); - // u3_noun niz = u3gfu_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 = u3gdi_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 - u3yfu_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 - u3gfu_fuse(u3_noun van, - u3_noun sut, - u3_noun ref) - { - c3_m fun_m = 144 + c3__fuse + ((!!u3r_at(u3gfu_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/mets/f/ut_gain.c b/mets/f/ut_gain.c deleted file mode 100644 index 64865ad068..0000000000 --- a/mets/f/ut_gain.c +++ /dev/null @@ -1,16 +0,0 @@ -/* j/6/gain.c -** -*/ -#include "all.h" - - - u3_noun - u3gfu_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_hook(von, "gain"); - - return u3n_kick_on(u3i_molt(gat, u3x_sam, u3k(gen), 0)); - } diff --git a/mets/f/ut_lose.c b/mets/f/ut_lose.c deleted file mode 100644 index e9f4d3df26..0000000000 --- a/mets/f/ut_lose.c +++ /dev/null @@ -1,16 +0,0 @@ -/* j/6/lose.c -** -*/ -#include "all.h" - - - u3_noun - u3gfu_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_hook(von, "lose"); - - return u3n_kick_on(u3i_molt(gat, u3x_sam, u3k(gen), 0)); - } diff --git a/mets/f/ut_mint.c b/mets/f/ut_mint.c deleted file mode 100644 index 72a4af4195..0000000000 --- a/mets/f/ut_mint.c +++ /dev/null @@ -1,930 +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 u3lf_fork(u3nt(u3nq(c3__atom, 'f', u3_nul, 0), - u3nq(c3__atom, 'f', u3_nul, 1), - u3_nul)); - } - - static u3_noun - _mint_vet(u3_noun van) - { - // u3_noun vet = u3j_hook(u3k(van), "vet"); - u3_noun vet = u3r_at(u3gfu_van_vet, van); - - switch ( vet ) { - case c3n: - case c3y: return vet; - default: return u3m_bail(c3__fail); - } - } - - static u3_noun - _mint_core(u3_noun pac, - u3_noun con) - { - if ( (c3__void == pac) ) { - return c3__void; - } else { - return u3nt(c3__core, pac, con); - } - } - - 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 == u3gfu_nest(van, gol, c3y, typ)) ) - { - // u3_noun dun = u3gfu_dunq(van, "need", gol); - // u3_noun niz = u3gfu_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_coke(u3_noun nug) - { - if ( 0 == u3h(nug) ) { - return u3k(u3t(nug)); - } - else if ( 10 == u3h(nug) ) { - return _mint_coke(u3t(u3t(nug))); - } - else { - return u3m_error("mint-coke"); - } - } - - static u3_noun - _mint_brew(u3_noun van, - u3_noun sut, - u3_noun tov, - u3_noun gen) - { - u3_noun von; - - switch ( tov ) { - default: return u3m_bail(c3__fail); - case c3y: - von = u3k(van); break; - case c3n: - von = u3i_molt(u3k(van), u3gfu_van_vet, c3n, 0); break; - } - { - u3_noun mil = u3gfu_mint(von, sut, c3__noun, gen); - u3_noun fol = u3k(u3t(mil)); - - u3z(mil); - u3z(von); - return fol; - } - } - - static u3_noun - _mint_harp(u3_noun van, - u3_noun sut, - u3_noun dab) - { - if ( (u3_nul == dab) ) { - return 0; - } - 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); - } - else { - u3_noun qqn_dab = u3t(u3t(n_dab)); - u3_noun vad; - - switch ( u3h(qqn_dab) ) { - default: return u3m_bail(c3__exit); - case c3__ash: { - vad = _mint_brew(van, sut, c3y, u3t(qqn_dab)); - break; - } - case c3__elm: { - vad = _mint_brew(van, sut, c3n, u3t(qqn_dab)); - break; - } - } - - if ( (u3_nul == l_dab) && (u3_nul == r_dab) ) { - return vad; - } - else if ( (u3_nul == l_dab) ) { - return u3nc(vad, _mint_harp(van, sut, r_dab)); - } - else if ( (u3_nul == r_dab) ) { - return u3nc(vad, _mint_harp(van, sut, l_dab)); - } - else { - return u3nt(vad, - _mint_harp(van, sut, l_dab), - _mint_harp(van, sut, r_dab)); - } - } - } - } - - static u3_noun - _mint_hope(u3_noun van, - u3_noun sut, - u3_noun dom) - { - if ( (u3_nul == dom) ) { - return 0; - } - 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 dov; - - dov = _mint_harp(van, sut, qqn_dom); - - if ( (u3_nul == l_dom) && (u3_nul == r_dom) ) { - return dov; - } - else if ( (u3_nul == l_dom) ) { - return u3nc(dov, _mint_hope(van, sut, r_dom)); - } - else if ( (u3_nul == r_dom) ) { - return u3nc(dov, _mint_hope(van, sut, l_dom)); - } - else { - return u3nt(dov, - _mint_hope(van, sut, l_dom), - _mint_hope(van, sut, r_dom)); - } - } - } - } - - static u3_noun - _mint_grow(u3_noun van, - u3_noun sut, - u3_noun gol, - u3_atom mel, - u3_noun ruf, - u3_noun wan, - 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 toc = _mint_core(u3k(p_dan), - u3nq(c3__gold, - u3k(p_dan), - u3k(wan), - u3nc(u3_nul, - u3k(dom)))); - u3_noun dez = _mint_hope(van, toc, dom); - u3_noun zod = u3nc(1, dez); - u3_noun cot = _mint_core(u3k(p_dan), - u3nq(mel, - u3k(p_dan), - u3k(wan), - u3nc(u3k(dez), - u3k(dom)))); - u3_noun ret = u3nc(_mint_nice(van, gol, cot), - u3gf_cons(zod, q_dan)); - - u3z(zod); - u3z(toc); - 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_hook(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_hook(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 = u3gfu_fire(van, sut, rag); - u3_noun fol = u3gf_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 = u3gfu_mint(van, sut, c3__noun, qi_mew); - u3_noun p_zil = u3h(zil); - u3_noun q_zil = u3t(zil); - u3_noun wip = u3gfu_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 = u3gfu_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__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 rex = u3gfp_open(ter, 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 = u3gf_cell(u3h(hed), u3h(tal)); - - ret = u3nc(_mint_nice(van, gol, typ), - u3gf_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 rex = u3gfp_open(ter, gen); - - if ( c3y == u3r_sing(rex, gen) ) { -#if 1 - u3_noun zix = u3gfu_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__wtts: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun heb = u3nc(c3__herb, u3k(p_gen)); - u3_noun nob = u3gfl_bunt(van, heb); - u3_noun dok = u3nc(c3__wing, u3k(q_gen)); - u3_noun vol = _mint_corn(van, sut, dok); - u3_noun axe = _mint_coke(vol); - u3_noun wam = u3gfu_play(van, sut, nob); - - ret = u3nc(_mint_nice(van, gol, _mint_bean()), - u3gfu_fish(van, wam, axe)); - - u3z(axe); - u3z(vol); - u3z(wam); - u3z(nob); - u3z(dok); - u3z(heb); - - 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 = u3gfu_gain(van, sut, p_gen); - u3_noun wux = u3gfu_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(u3gf_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 = u3gf_cell(u3h(hed), u3h(tal)); - - ret = u3nc(_mint_nice(van, gol, typ), - u3gf_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 == u3gfu_nest(van, u3h(one), c3n, u3h(two))) && - (c3n == u3gfu_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__bunt, 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(11, 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 = u3gfu_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 = u3gfu_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 = u3gfu_wrap(van, u3h(ryd), c3__iron); - u3_noun pro = u3nc(tyf, u3k(u3t(ryd))); - - u3z(ryd); - return pro; - } - - case c3__ktpm: p_gen = u3t(gen); - _mint_used(); - { - u3_noun ryd = _mint_in(van, sut, gol, p_gen); - u3_noun tyf = u3gfu_wrap(van, u3h(ryd), c3__zinc); - u3_noun pro = u3nc(tyf, 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 = u3gfu_wrap(van, u3h(ryd), c3__lead); - u3_noun pro = u3nc(tyf, u3k(u3t(ryd))); - - u3z(ryd); - return pro; - } - - case c3__help: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun hum = _mint_in(van, sut, gol, q_gen); - - u3_noun ret = u3nc(u3gf_help(p_gen, u3k(u3h(hum))), - u3k(u3t(hum))); - u3z(hum); - return ret; - } - - case c3__ktts: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun vat = _mint_in(van, sut, gol, q_gen); - - ret = u3nc(u3gfu_conk(van, u3h(vat), p_gen), - u3k(u3t(vat))); - - u3z(vat); - return ret; - } - - case c3__tune: p_gen = u3t(gen); - _mint_used(); - { - return u3nc(u3gf_face(p_gen, sut), u3nc(0, 1)); - } - - case c3__ktsg: p_gen = u3t(gen); - _mint_used(); - { - u3_noun nef = _mint_in(van, sut, gol, p_gen); - u3_noun p_nef = u3h(nef); - u3_noun q_nef = u3t(nef); - u3_noun fom; - - { - u3_noun cag = u3gfu_burn(van, sut); - u3_noun wim = u3n_nock_an(cag, u3k(q_nef)); - - if ( 0 == u3h(wim) ) { - fom = u3nc(1, u3k(u3t(wim))); - } else { - fom = u3k(q_nef); - } - u3z(wim); - } - ret = u3nc(u3k(p_nef), fom); - - u3z(nef); - return ret; - } - - case c3__ktls: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun huz = u3gfu_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__tsgr: 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); - 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), - u3gf_comb(q_fid, q_dov)); - - u3z(fid); - u3z(dov); - return ret; - } - - case c3__tstr: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); - _mint_used(); - { - u3_noun boc = u3gfu_buss(van, sut, p_gen, q_gen); - u3_noun ret = _mint_in(van, boc, gol, r_gen); - - u3z(boc); - return ret; - } - - case c3__tscm: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun boc = u3gfu_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, ruf, p_gen, q_gen); - u3z(ruf); - - return ret; - } - - case c3__sgzp: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - u3_noun typ = u3gfu_play(van, sut, p_gen); - u3_noun dug = u3gfu_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__sggr: 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(10, bez, u3k(u3t(hum)))); - - u3z(hum); - return ret; - } - - case c3__zpts: p_gen = u3t(gen); - _mint_used(); - { - u3_noun von = u3i_molt(u3k(van), u3gfu_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), u3gfu_van_fab, c3n, 0); - u3_noun ret = _mint_in(von, sut, gol, p_gen); - - u3z(von); - return ret; - } - - case c3__zpcm: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mint_used(); - { - return u3nc(_mint_nice(van, - gol, - u3gfu_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(10, bez, u3k(u3t(hum)))); - u3z(hum); - } - u3t_drop(); - return ret; - } - - 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 = u3gfu_play(van, sut, p_gen); - u3_noun p_vos = u3h(vos); - u3_noun q_vos = u3t(vos); - u3_noun waz = u3nc(1, u3k(p_vos)); - u3_noun sif = u3k(zur); - u3_noun cig = u3gf_cell(sif, p_vos); - u3_noun ret; - - ret = u3nc(_mint_nice(van, gol, cig), - u3gf_cons(waz, q_vos)); - - u3z(waz); - u3z(zur); - u3z(sif); - u3z(vos); - - return ret; - } - - case c3__lost: p_gen = u3t(gen); - _mint_used(); - { - if ( c3y == _mint_vet(van) ) { - u3_noun zur = u3gfu_play(van, sut, p_gen); - u3_noun dun = u3gfu_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 - u3yfu_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 - u3gfu_mint(u3_noun van, - u3_noun sut, - u3_noun gol, - u3_noun gen) - { - c3_m fun_m = 144 + c3__mint; - u3_noun vrf = u3r_at(u3gfu_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/mets/f/ut_mull.c b/mets/f/ut_mull.c deleted file mode 100644 index 3406fecc6f..0000000000 --- a/mets/f/ut_mull.c +++ /dev/null @@ -1,842 +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_core(u3_noun pac, - u3_noun con) - { - if ( (c3__void == pac) ) { - return c3__void; - } else { - return u3nt(c3__core, pac, con); - } - } - - static u3_noun - _mull_bean() - { - return u3lf_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_hook(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_coke(u3_noun nug) - { - if ( 0 == u3h(nug) ) { - return u3k(u3t(nug)); - } - else if ( 10 == u3h(nug) ) { - return _mull_coke(u3t(u3t(nug))); - } - else { - return u3m_error("mull-coke"); - } - } - - static u3_noun - _mull_doke(u3_noun van, - u3_noun sut, - u3_noun gen) - { - u3_noun fug = u3gfu_mint(van, sut, c3__noun, gen); - u3_noun axe = _mull_coke(u3t(fug)); - - u3z(fug); - return axe; - } - - static u3_noun - _mull_nice(u3_noun van, - u3_noun gol, - u3_noun typ) - { - if ( c3n == u3gfu_nest(van, gol, c3y, typ) ) { - // u3_noun dun = u3gfu_dunq(van, "need", gol); - // u3_noun niz = u3gfu_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 void - _mull_bake(u3_noun van, - u3_noun sut, - u3_noun dox, - u3_noun dab) - { - if ( u3_nul != dab ) { - u3_noun n_dab, l_dab, r_dab; - - u3r_trel(dab, &n_dab, &l_dab, &r_dab); - if ( c3n == u3du(n_dab) ) { - u3m_bail(c3__fail); - } - else { - u3_noun qqn_dab = u3t(u3t(n_dab)); - u3_noun vad; - - switch ( u3h(qqn_dab) ) { - default: u3m_bail(c3__exit); - case c3__ash: { - vad = _mull_in(van, sut, c3__noun, dox, u3t(qqn_dab)); - break; - } - case c3__elm: { - vad = u3_nul; - break; - } - } - u3z(vad); - - if ( (u3_nul == l_dab) && (u3_nul == r_dab) ) { - return; - } - else if ( (u3_nul == l_dab) ) { - _mull_bake(van, sut, dox, r_dab); - } - else if ( (u3_nul == r_dab) ) { - _mull_bake(van, sut, dox, l_dab); - } - else { - _mull_bake(van, sut, dox, l_dab); - _mull_bake(van, sut, dox, r_dab); - } - } - } - } - - static void - _mull_balk(u3_noun van, - u3_noun sut, - u3_noun dox, - u3_noun dom) - { - if ( u3_nul != dom ) { - u3_noun n_dom, l_dom, r_dom; - - u3r_trel(dom, &n_dom, &l_dom, &r_dom); - if ( c3n == u3du(n_dom) ) { - u3m_bail(c3__fail); - } - else { - u3_noun qqn_dom = u3t(u3t(n_dom)); - - _mull_bake(van, sut, dox, qqn_dom); - - if ( (u3_nul == l_dom) && (u3_nul == r_dom) ) { - return; - } - else if ( (u3_nul == l_dom) ) { - _mull_balk(van, sut, dox, r_dom); - } - else if ( (u3_nul == r_dom) ) { - _mull_balk(van, sut, dox, l_dom); - } - else { - _mull_balk(van, sut, dox, l_dom); - _mull_balk(van, sut, dox, r_dom); - } - } - } - } - - static u3_noun - _mull_grow(u3_noun van, - u3_noun sut, - u3_noun gol, - u3_noun dox, - u3_atom mel, - u3_noun ruf, - u3_noun wan, - 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 p_toc = _mull_core(u3k(p_dan), - u3nq(c3__gold, - u3k(p_dan), - u3k(wan), - u3nc(u3_nul, u3k(dom)))); - u3_noun q_toc = _mull_core(u3k(q_dan), - u3nq(c3__gold, - u3k(q_dan), - u3k(wan), - u3nc(u3_nul, u3k(dom)))); - u3_noun p_ret = _mull_core(u3k(p_dan), - u3nq(u3k(mel), - u3k(p_dan), - u3k(wan), - u3nc(u3nc(u3_nul, u3_nul), - u3k(dom)))); - u3_noun q_ret = _mull_core(u3k(q_dan), - u3nq(u3k(mel), - u3k(q_dan), - u3k(wan), - u3nc(u3nc(u3_nul, u3_nul), - u3k(dom)))); - u3_noun ret = u3nc(_mull_nice(van, gol, p_ret), q_ret); - - _mull_balk(van, p_toc, q_toc, dom); - - u3z(q_toc); - u3z(p_toc); - 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_hook(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 = u3gfu_toss(van, sut, pi_mew, p_zil, p_yom); - u3_noun dof = u3gfu_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 = u3gfu_seek(van, sut, c3__read, hyp); - u3_noun vug = u3gfu_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), u3gfu_van_vet, c3n, 0); - u3_noun p_ret = u3gfu_fire(van, sut, u3h(yom)); - u3_noun q_ret = u3gfu_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 rex = u3gfp_open(ter, 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 = u3gf_cell(u3h(hed), u3h(tal)); - u3_noun dat = u3gf_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 rex = u3gfp_open(ter, gen); - - if ( c3y == u3r_sing(rex, gen) ) { -#if 1 - u3_noun zix = u3gfu_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__wtts: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun heb = u3nc(c3__herb, u3k(p_gen)); - u3_noun nob = u3gfl_bunt(van, heb); - u3_noun p_waz = u3gfu_play(van, sut, nob); - u3_noun q_waz = u3gfu_play(van, dox, nob); - 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 = u3gfu_fish(van, p_waz, p_syx); - u3_noun q_pov = u3gfu_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(nob); - u3z(dok); - u3z(heb); - - 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 = u3gfu_gain(van, sut, p_gen); - u3_noun q_fex = u3gfu_gain(van, dox, p_gen); - u3_noun p_wux = u3gfu_lose(van, sut, p_gen); - u3_noun q_wux = u3gfu_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 - : u3gfu_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 - : u3gfu_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 = u3gf_forq(u3h(hiq), u3h(ran)); - dat = u3gf_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 = u3gf_cell(u3h(hed), u3h(tal)); - u3_noun dat = u3gf_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__bunt, 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 = u3gfu_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 = u3gfu_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(u3gfu_wrap(van, - u3h(vat), - c3__iron), - u3gfu_wrap(van, - u3t(vat), - c3__iron)); - - u3z(vat); - return pro; - } - - case c3__ktpm: p_gen = u3t(gen); - _mull_used(); - { - u3_noun vat = _mull_in(van, sut, gol, dox, p_gen); - u3_noun pro = u3nc(u3gfu_wrap(van, - u3h(vat), - c3__zinc), - u3gfu_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(u3gfu_wrap(van, - u3h(vat), - c3__lead), - u3gfu_wrap(van, - u3t(vat), - c3__lead)); - - u3z(vat); - return pro; - } - - case c3__help: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun vat = _mull_in(van, sut, gol, dox, q_gen); - u3_noun ret = u3nc(u3gf_help(p_gen, u3h(vat)), - u3gf_help(p_gen, u3t(vat))); - - u3z(vat); - return ret; - } - - case c3__ktts: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun vat = _mull_in(van, sut, gol, dox, q_gen); - u3_noun ret = u3nc(u3gfu_conk(van, u3h(vat), p_gen), - u3gfu_conk(van, u3t(vat), p_gen)); - - u3z(vat); - return ret; - } - - case c3__tune: p_gen = u3t(gen); - _mull_used(); - { - return u3nc(u3gf_face(p_gen, sut), - u3gf_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, u3gfu_play(van, sut, p_gen)); - u3_noun q_hif = u3gfu_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__tsgr: 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__tstr: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); - _mull_used(); - { - u3_noun boc = u3gfu_buss(van, sut, p_gen, q_gen); - u3_noun nuf = u3gfu_buss(van, dox, p_gen, q_gen); - u3_noun ret = _mull_in(van, boc, gol, nuf, r_gen); - - u3z(boc); - u3z(nuf); - - return ret; - } - - case c3__tscm: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun boc = u3gfu_busk(van, sut, p_gen); - u3_noun nuf = u3gfu_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, ruf, p_gen, q_gen); - u3z(ruf); - - return ret; - } - - case c3__sgzp: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun typ = u3gfu_play(van, sut, p_gen); - u3_noun dug = u3gfu_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__sggr: 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 = u3gfu_play(van, sut, p_gen); - u3_noun q_ret = u3gfu_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), u3gfu_van_fab, c3n, 0); - u3_noun ret = _mull_in(von, sut, gol, dox, p_gen); - - u3z(von); - return ret; - } - - case c3__zpsm: u3x_cell(u3t(gen), &p_gen, &q_gen); - _mull_used(); - { - u3_noun p_zur = u3gfu_play(van, sut, p_gen); - u3_noun q_zur = u3gfu_play (van, dox, p_gen); - u3_noun vos = _mull_in(van, sut, c3__noun, dox, q_gen); - u3_noun p_ret = u3gf_cell(p_zur, u3h(vos)); - u3_noun q_ret = u3gf_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__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 - u3yfu_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 - u3gfu_mull(u3_noun van, - u3_noun sut, - u3_noun gol, - u3_noun dox, - u3_noun gen) - { - c3_m fun_m = 144 + c3__mull + ((!!u3r_at(u3gfu_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/mets/f/ut_nest.c b/mets/f/ut_nest.c deleted file mode 100644 index 28ae5ae60a..0000000000 --- a/mets/f/ut_nest.c +++ /dev/null @@ -1,544 +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, pqn_hem, qqn_hem, pn_dab, pqn_dab, qqn_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_trel(n_dab, &pn_dab, &pqn_dab, &qqn_dab); - u3x_trel(n_hem, &pn_hem, &pqn_hem, &qqn_hem); - - if ( c3n == u3r_sing(pn_dab, pn_hem) ) { - return c3n; - } else { - if ( (c3n == u3du(qqn_dab)) || (c3n == u3du(qqn_hem)) ) { - return u3m_bail(c3__fail); - } - else switch ( u3h(qqn_dab) ) { - default: return u3m_bail(c3__exit); - case c3__ash: { - if ( c3__ash != u3h(qqn_hem) ) { - return c3n; - } else { - u3_noun qqqn_dab = u3t(qqn_dab); - u3_noun qqqn_hem = u3t(qqn_hem); - u3_noun vis = u3gfu_play(van, sut, qqqn_dab); - u3_noun lon = u3gfu_play(van, ref, qqqn_hem); - - u3_noun ret = _nest_dext(van, vis, tel, lon, u3_nul, u3_nul, gil); - - u3z(vis); - u3z(lon); - return ret; - } - } - case c3__elm: { - return u3r_sing(qqn_dab, qqn_hem); - } - } - } - } - } - - 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, pqn_vim, qqn_vim, pn_dom, 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_trel(n_dom, &pn_dom, &pqn_dom, &qqn_dom); - u3x_trel(n_vim, &pn_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, sq_sut; - u3_noun pq_ref, qq_ref, rq_ref, sq_ref; - u3_noun psq_sut, qsq_sut, psq_ref, qsq_ref; - u3_noun ret; - - u3x_trel(sut, 0, &p_sut, &q_sut); - u3x_trel(ref, 0, &p_ref, &q_ref); - - u3x_qual(q_sut, &pq_sut, &qq_sut, &rq_sut, &sq_sut); - u3x_qual(q_ref, &pq_ref, &qq_ref, &rq_ref, &sq_ref); - - u3x_cell(sq_sut, &psq_sut, &qsq_sut); - u3x_cell(sq_ref, &psq_ref, &qsq_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 == _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 ( (pq_sut != pq_ref) && - (c3__lead != pq_sut) && - (c3__gold != pq_ref) ) - { - return c3n; - } - else { - u3_noun hud = u3nc(u3k(sut), u3k(ref)); - - if ( (c3y == u3gdi_has(gil, hud)) ) { - u3z(hud); - - return c3y; - } - else { - u3_noun zoc = u3gdi_put(gil, hud); - u3_noun tus = u3nt(c3__core, - u3k(qq_sut), - u3nc(c3__gold, - u3k(u3t(q_sut)))); - - u3_noun fer = u3nt(c3__core, - u3k(qq_ref), - u3nc(c3__gold, - u3k(u3t(q_ref)))); - - ret = _nest_dope(van, tus, tel, fer, qsq_sut, qsq_ref, zoc); - u3z(fer); - u3z(tus); - u3z(zoc); - u3z(hud); - - if ( c3n == ret ) { - return c3n; - } - else { - switch ( pq_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 = u3gfu_peek(van, qq_sut, c3__rite, 2); - u3_noun r_sam = u3gfu_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 = u3gfu_peek(van, qq_sut, c3__read, 2); - u3_noun r_pal = u3gfu_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 == u3gf_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__help: - 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 = u3gdi_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 == u3gdi_has(seg, sut) ) { - return c3n; - } - else { - u3_noun hud = u3nc(u3k(sut), u3k(ref)); - - if ( (c3y == u3gdi_has(gil, hud)) ) { - u3z(hud); - - return c3y; - } - else { - u3_noun gus = u3gdi_put(seg, sut); - u3_noun zoc = u3gdi_put(gil, hud); - u3_noun fop = u3gfu_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 = u3gfu_dunq(van, "need", sut); - u3_noun niz = u3gfu_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 = 144 + c3__nest + ((!!u3r_at(u3gfu_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 = u3gfu_repo(van, ref); - u3_noun hiv = _nest_dext(van, sut, tel, gam, seg, reg, gil); - - u3z(gam); - return hiv; - } - case c3__help: - 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 = u3gdi_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 == u3gdi_has(reg, ref) ) { - return c3y; - } - { - u3_noun hud = u3nc(u3k(sut), u3k(ref)); - - if ( (c3y == u3gdi_has(gil, hud)) ) { - u3z(hud); - - return c3y; - } else { - u3_noun gur = u3gdi_put(reg, ref); - u3_noun zoc = u3gdi_put(gil, hud); - u3_noun gam = u3gfu_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 - u3yfu_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 - u3gfu_nest(u3_noun van, - u3_noun sut, - u3_noun tel, - u3_noun ref) - { - return _cqfu_nest(van, sut, tel, ref); - } - diff --git a/mets/f/ut_peek.c b/mets/f/ut_peek.c deleted file mode 100644 index 0fd8d31a02..0000000000 --- a/mets/f/ut_peek.c +++ /dev/null @@ -1,214 +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 = u3gc_cap(axe); - u3_atom tap = u3gc_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 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_cell(rq_sut, &prq_sut, &qrq_sut)) ) - { - return u3m_bail(c3__fail); - } else { - u3_atom now = u3gc_cap(axe); - u3_atom lat = u3gc_mas(axe); - - if ( 3 == now ) { - u3_noun pec = u3gfu_peel(van, sut, way, pq_sut); - u3_noun sam = u3h(pec); - u3_noun con = u3t(pec); - - if ( c3y == c3a(sam, con) ) { - pro = _cqfu_peek(van, p_sut, way, lat); - } - else { - 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 = u3gf_cell(hed, tal); - u3z(hed); - u3z(tal); - } - - pro = _cqfu_peek(van, typ, way, lat); - u3z(typ); - } - - u3z(pec); - } - else { - pro = c3__noun; - } - u3z(lat); - u3z(now); - - return pro; - } - } - case c3__help: - 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 = u3gdi_tap(p_sut); - u3_noun ret = u3lf_fork(_peek_fork(van, yed, way, axe, gil)); - - u3z(yed); - return ret; - } - case c3__hold: { - if ( (c3y == u3gdi_has(gil, sut)) ) { - return c3__void; - } - else { - u3_noun zoc = u3gdi_put(gil, sut); - u3_noun fop = u3gfu_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 - u3yfu_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 - u3gfu_peek(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun axe) - { - c3_m fun_m = 144 + c3__peek + ((!!u3r_at(u3gfu_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/mets/f/ut_peel.c b/mets/f/ut_peel.c deleted file mode 100644 index 931c8dbb5f..0000000000 --- a/mets/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 - u3yfu_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 - u3gfu_peel(u3_noun van, - u3_noun sut, - u3_noun way, - u3_noun met) - { - return _cqfu_peel(van, sut, way, met); - } - diff --git a/mets/f/ut_play.c b/mets/f/ut_play.c deleted file mode 100644 index 85ea1ff043..0000000000 --- a/mets/f/ut_play.c +++ /dev/null @@ -1,543 +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 u3lf_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_hook(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 - _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_hook(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 = u3gfu_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 = u3gfu_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 = u3gfu_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 ruf, - u3_noun wan, - u3_noun dom) - { - u3_noun dan = _play_in(van, sut, ruf); - - return _play_core(dan, - u3nq(u3k(mel), - u3k(dan), - u3k(wan), - u3nc(u3nc(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 = u3gfu_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 rex = u3gfp_open(ter, gen); - u3_noun ret; - - if ( c3y == u3r_sing(rex, gen) ) { - u3_noun zix = u3gfu_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 = u3gf_cell(dis, dat); - - u3z(dis); - u3z(dat); - return ret; - } - } - else switch ( u3h(gen) ) { - default: goto open; - - case c3__wtts: 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 = u3gfu_gain(van, sut, p_gen); - u3_noun wux = u3gfu_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 = u3gf_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 = u3gf_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__bunt, 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 = u3gfu_wrap(van, boc, c3__iron); - - u3z(boc); - return pro; - } - - case c3__ktpm: p_gen = u3t(gen); - _play_used(); - { - u3_noun boc = _play_x(van, sut, p_gen); - u3_noun pro = u3gfu_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 = u3gfu_wrap(van, boc, c3__lead); - - u3z(boc); - return pro; - } - - case c3__help: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - u3_noun boc = _play_x(van, sut, q_gen); - u3_noun ret = u3gf_help(p_gen, boc); - - u3z(boc); - return ret; - } - - case c3__ktts: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - u3_noun boc = _play_x(van, sut, q_gen); - u3_noun ret = u3gfu_conk(van, boc, p_gen); - - u3z(boc); - return ret; - } - - case c3__tune: p_gen = u3t(gen); - _play_used(); - { - return u3gf_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__tsgr: 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__tstr: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen); - _play_used(); - { - u3_noun boc = u3gfu_buss(van, sut, p_gen, q_gen); - u3_noun ret = _play_x(van, boc, r_gen); - - u3z(boc); - return ret; - } - - case c3__tscm: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - u3_noun boc = u3gfu_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, ruf, p_gen, q_gen); - - u3z(ruf); - return ret; - } - - case c3__sgzp: u3x_cell(u3t(gen), &p_gen, &q_gen); - _play_used(); - { - u3_noun typ = u3gfu_play(van, sut, p_gen); - u3_noun dug = u3gfu_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__sggr: 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), u3gfu_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; - - u3t_push(u3nc(c3__mean, _play_loc(van, p_gen))); - { - ret = _play_x(van, sut, q_gen); - } - u3t_drop(); - return ret; - } - - 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 = u3gf_cell(zur, vos); - - u3z(zur); - u3z(vos); - - return ret; - } - - 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), u3gfu_van_vet, c3n, 0); - u3_noun ret = _play_x(von, sut, gen); - - u3z(von); - return ret; - } - -/* boilerplate -*/ - u3_noun - u3yfu_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 - u3gfu_play(u3_noun van, - u3_noun sut, - u3_noun gen) - { - return _cqfu_play(van, sut, gen); - } diff --git a/mets/f/ut_repo.c b/mets/f/ut_repo.c deleted file mode 100644 index b77d23f557..0000000000 --- a/mets/f/ut_repo.c +++ /dev/null @@ -1,70 +0,0 @@ -/* j/6/ut_repo.c -** -*/ -#include "all.h" - - -/* logic -*/ - u3_noun - u3gfu_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 u3lf_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__help: - 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 = u3gfu_rest(van, sut, old); - u3z(old); - return ret; - } - } - } - } - - u3_noun - u3yfu_repo(u3_noun cor) - { - u3_noun sut; - - if ( u3_none == (sut = u3r_at(u3x_sam, cor)) ) { - return u3m_bail(c3__fail); - } else { - return u3gfu_repo(cor, sut); - } - } diff --git a/mets/f/ut_rest.c b/mets/f/ut_rest.c deleted file mode 100644 index ae1098df59..0000000000 --- a/mets/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(u3gfu_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 = u3gdi_gas(u3_nul, gar); - u3_noun yed = u3gdi_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 = u3gf_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(u3gdi_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(u3gfu_van_fan, van); - - if ( c3y == _rest_hit_fan(fan, leg) ) { - return u3m_error("rest-loop"); - } - else { - u3_noun naf = u3gdi_gas(fan, leg); - u3_noun nav = u3i_molt(u3k(van), u3gfu_van_fan, u3k(naf), 0); - u3_noun mez = _rest_in(nav, leg); - - u3z(naf); - u3z(nav); - return mez; - } - } - -/* boilerplate -*/ - u3_noun - u3yfu_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 - u3gfu_rest(u3_noun van, - u3_noun sut, - u3_noun leg) - { - c3_m fun_m = 144 + c3__rest + ((!!u3r_at(u3gfu_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/mets/f/ut_tack.c b/mets/f/ut_tack.c deleted file mode 100644 index 7a92ed506c..0000000000 --- a/mets/f/ut_tack.c +++ /dev/null @@ -1,21 +0,0 @@ -/* j/6/tack.c -** -*/ -#include "all.h" - - u3_noun - u3gfu_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_hook(von, "tack"); - - return u3n_kick_on(u3i_molt(gat, - u3x_sam_2, - u3k(hyp), - u3x_sam_3, - u3k(mur), - 0)); - } diff --git a/mets/f/ut_toss.c b/mets/f/ut_toss.c deleted file mode 100644 index dc804e468d..0000000000 --- a/mets/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 = u3gfu_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 - u3yfu_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 - u3gfu_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/mets/f/ut_wrap.c b/mets/f/ut_wrap.c deleted file mode 100644 index a938cfc61b..0000000000 --- a/mets/f/ut_wrap.c +++ /dev/null @@ -1,93 +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, sq_sut; - - if ( c3n == u3r_qual(q_sut, &pq_sut, &qq_sut, &rq_sut, &sq_sut) ) { - return u3m_bail(c3__fail); - } - else if ( c3__gold != pq_sut ) { - return u3m_error("wrap-gold"); - } - else { - return u3nt(c3__core, - u3k(p_sut), - u3nq(u3k(yoz), - u3k(qq_sut), - u3k(rq_sut), - u3k(sq_sut))); - } - } - case c3__fork: p_sut = u3t(sut); - { - u3_noun yed = u3gdi_tap(p_sut); - u3_noun ret = u3lf_fork(_wrap_fork(van, yed, yoz)); - - u3z(yed); - return ret; - } - case c3__hold: - { - u3_noun fop = u3gfu_repo(van, sut); - u3_noun pro = _cqfu_wrap(van, fop, yoz); - - u3z(fop); - return pro; - } - } - } - -/* boilerplate -*/ - u3_noun - u3yfu_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 - u3gfu_wrap(u3_noun van, - u3_noun sut, - u3_noun yoz) - { - return _cqfu_wrap(van, sut, yoz); - } diff --git a/mets/g/down.c b/mets/g/down.c deleted file mode 100644 index dbe98581c1..0000000000 --- a/mets/g/down.c +++ /dev/null @@ -1,220 +0,0 @@ -/* j/g/down.c -** -*/ -#include "all.h" -#include -#include -#include - -static u3_noun node_to_noun(cmark_node * nod); - -static u3_noun list_elems_to_noun(cmark_node * nod) -{ - u3_noun elems = u3_nul; - - cmark_node * child; - for ( child = nod->last_child; child; child = child->prev ) { - elems = u3nc(node_to_noun(child),elems); - } - - return elems; -} - -static u3_noun document_to_noun(cmark_node * nod) -{ - return list_elems_to_noun(nod); -} - -static u3_noun block_quote_to_noun(cmark_node * nod) -{ - return u3nc(u3nc(c3__bloq,u3_nul),list_elems_to_noun(nod)); -} - -static u3_noun list_to_noun(cmark_node * nod) -{ - return - u3nc( - u3nt( - c3__list, - __(nod->as.list.tight), - (nod->as.list.list_type == CMARK_BULLET_LIST) - ? nod->as.list.bullet_char /* XX convert? */ - : u3nc(nod->as.list.start, - (nod->as.list.delimiter == CMARK_PERIOD_DELIM) - ? '.' - : ')')), - list_elems_to_noun(nod)); -} - -static u3_noun list_item_to_noun(cmark_node * nod) -{ - return u3nc(u3nc(c3__item,u3_nul),list_elems_to_noun(nod)); -} - -static u3_noun code_block_to_noun(cmark_node * nod) -{ - u3_atom str = u3i_string((c3_c *) nod->string_content.ptr); /* XX u3i_bytes */ - u3_noun res = - u3nt( - c3__code, - nod->as.code.fenced - ? u3nq( - u3_nul, - nod->as.code.fence_char, - nod->as.code.fence_length, - u3i_tape((c3_c *) nod->as.code.info.ptr) - ) - : u3_nul, - u3ge_lore(str)); - u3z(str); - return res; -} - -static u3_noun html_to_noun(cmark_node * nod) -{ - u3_atom str = u3i_string((c3_c *) nod->string_content.ptr); /* XX u3i_bytes */ - u3_noun res = u3nc(c3__html, u3ge_lore(str)); - u3z(str); - return res; -} - -static u3_noun paragraph_to_noun(cmark_node * nod) -{ - return u3nc(c3__para, list_elems_to_noun(nod)); -} - -static u3_noun header_to_noun(cmark_node * nod) -{ - /* see also nod->as.header.setext */ - return u3nt(c3__head, nod->as.header.level, list_elems_to_noun(nod)); -} - -static u3_noun hrule_to_noun(cmark_node * nod) -{ - return u3nc(c3__hrul, u3_nul); -} - -static u3_noun reference_def_to_noun(cmark_node * nod) -{ - return u3nc(c3__defn, u3_nul); -} - -static u3_noun text_to_noun(cmark_node * nod) -{ - return u3nc(u3_blip, u3i_tape((c3_c *) cmark_chunk_to_cstr(&nod->as.literal))); -} - -static u3_noun softbreak_to_noun(cmark_node * nod) // XXX -{ - return u3nt(0, 10, 0); -} - -static u3_noun linebreak_to_noun(cmark_node * nod) -{ - return u3nc(c3__line, u3_nul); -} - -static u3_noun inline_code_to_noun(cmark_node * nod) -{ - return u3nc(c3__code, u3i_tape((c3_c *) cmark_chunk_to_cstr(&nod->as.literal))); -} - -static u3_noun inline_html_to_noun(cmark_node * nod) // XXX -{ - return u3nc(c3__htmt, u3i_string((c3_c *) cmark_chunk_to_cstr(&nod->as.literal))); -} - -static u3_noun emph_to_noun(cmark_node * nod) -{ - return u3nc(u3nc(c3__emph, c3n), list_elems_to_noun(nod)); -} - -static u3_noun strong_to_noun(cmark_node * nod) -{ - return u3nc(u3nc(c3__emph, c3y), list_elems_to_noun(nod)); -} - -static u3_noun link_to_noun(cmark_node * nod) -{ - return u3nc(u3nt(c3__link, - nod->as.link.url - ? u3i_tape((c3_c *) nod->as.link.url) - : u3_nul, - nod->as.link.title - ? u3nc(u3_nul, u3i_tape((c3_c *) nod->as.link.title)) - : u3_nul), - list_elems_to_noun(nod)); -} - -static u3_noun image_to_noun(cmark_node * nod) -{ - return u3nc(u3nt(c3__blot, - u3i_tape((c3_c *) nod->as.link.url), - nod->as.link.title - ? u3nc(u3_nul, u3i_tape((c3_c *) nod->as.link.title)) - : u3_nul), - list_elems_to_noun(nod)); -} - -static u3_noun node_to_noun(cmark_node * nod) -{ - if (!nod) { - fprintf(stderr, "markdown null node"); - return u3m_bail(c3__fail); - } - switch ( nod->type ) { - /* Block */ - case CMARK_NODE_DOCUMENT: return document_to_noun(nod); - case CMARK_NODE_BLOCK_QUOTE: return block_quote_to_noun(nod); - case CMARK_NODE_LIST: return list_to_noun(nod); - case CMARK_NODE_LIST_ITEM: return list_item_to_noun(nod); - case CMARK_NODE_CODE_BLOCK: return code_block_to_noun(nod); - case CMARK_NODE_HTML: return html_to_noun(nod); - case CMARK_NODE_PARAGRAPH: return paragraph_to_noun(nod); - case CMARK_NODE_HEADER: return header_to_noun(nod); - case CMARK_NODE_HRULE: return hrule_to_noun(nod); - case CMARK_NODE_REFERENCE_DEF: return reference_def_to_noun(nod); - /* Inline */ - case CMARK_NODE_TEXT: return text_to_noun(nod); - case CMARK_NODE_SOFTBREAK: return softbreak_to_noun(nod); - case CMARK_NODE_LINEBREAK: return linebreak_to_noun(nod); - case CMARK_NODE_INLINE_CODE: return inline_code_to_noun(nod); - case CMARK_NODE_INLINE_HTML: return inline_html_to_noun(nod); - case CMARK_NODE_EMPH: return emph_to_noun(nod); - case CMARK_NODE_STRONG: return strong_to_noun(nod); - case CMARK_NODE_LINK: return link_to_noun(nod); - case CMARK_NODE_IMAGE: return image_to_noun(nod); - default: fprintf(stderr, "bad markdown parsing"); - return u3m_bail(c3__fail); - } -} - -/* functions -*/ - u3_noun - u3gg_down(u3_atom a) - { - c3_c *tex = u3r_string(a); - - /* XX better strlen */ - cmark_node * doc = cmark_parse_document(tex, strlen(tex)); - - u3_noun res = document_to_noun(doc); - - cmark_node_free(doc); - // free out, tex? - return res; - } - u3_noun - u3yg_down(u3_noun cor) - { - u3_noun a; - - if ( (u3_none == (a = u3r_at(u3x_sam, cor))) || - (c3n == u3ud(a)) ) - { - return u3m_bail(c3__exit); - } else { - return u3gg_down(a); - } - }