Platform for coordinated type system adjustment.

This commit is contained in:
Curtis Yarvin 2018-05-05 15:10:34 -07:00
parent cad3d6187b
commit 747831dc26
42 changed files with 8409 additions and 3 deletions

View File

@ -294,7 +294,7 @@
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_open(u3_noun, u3_noun, u3_noun);
u3_noun u3qzp_rake(u3_noun);
# define u3qzu_van_fan 28

View File

@ -665,7 +665,659 @@ u3j_core _k143_d[] =
{}
};
static u3j_harm _142_hex_aes_ecba_en_a[] = {{".2", u3wea_ecba_en}, {}};
static u3j_harm _142_hex_aes_ecba_de_a[] = {{".2", u3wea_ecba_de}, {}};
static u3j_harm _142_hex_aes_ecbb_en_a[] = {{".2", u3wea_ecbb_en}, {}};
static u3j_harm _142_hex_aes_ecbb_de_a[] = {{".2", u3wea_ecbb_de}, {}};
static u3j_harm _142_hex_aes_ecbc_en_a[] = {{".2", u3wea_ecbc_en}, {}};
static u3j_harm _142_hex_aes_ecbc_de_a[] = {{".2", u3wea_ecbc_de}, {}};
static u3j_harm _142_hex_aes_cbca_en_a[] = {{".2", u3wea_cbca_en}, {}};
static u3j_harm _142_hex_aes_cbca_de_a[] = {{".2", u3wea_cbca_de}, {}};
static u3j_harm _142_hex_aes_cbcb_en_a[] = {{".2", u3wea_cbcb_en}, {}};
static u3j_harm _142_hex_aes_cbcb_de_a[] = {{".2", u3wea_cbcb_de}, {}};
static u3j_harm _142_hex_aes_cbcc_en_a[] = {{".2", u3wea_cbcc_en}, {}};
static u3j_harm _142_hex_aes_cbcc_de_a[] = {{".2", u3wea_cbcc_de}, {}};
static u3j_core _142_hex_aes_ecba_d[] =
{ { "en", _142_hex_aes_ecba_en_a },
{ "de", _142_hex_aes_ecba_de_a },
{}
};
static u3j_core _142_hex_aes_ecbb_d[] =
{ { "en", _142_hex_aes_ecbb_en_a },
{ "de", _142_hex_aes_ecbb_de_a },
{}
};
static u3j_core _142_hex_aes_ecbc_d[] =
{ { "en", _142_hex_aes_ecbc_en_a },
{ "de", _142_hex_aes_ecbc_de_a },
{}
};
static u3j_core _142_hex_aes_cbca_d[] =
{ { "en", _142_hex_aes_cbca_en_a },
{ "de", _142_hex_aes_cbca_de_a },
{}
};
static u3j_core _142_hex_aes_cbcb_d[] =
{ { "en", _142_hex_aes_cbcb_en_a },
{ "de", _142_hex_aes_cbcb_de_a },
{}
};
static u3j_core _142_hex_aes_cbcc_d[] =
{ { "en", _142_hex_aes_cbcc_en_a },
{ "de", _142_hex_aes_cbcc_de_a },
{}
};
static u3j_core _142_hex_aes_d[] =
{ { "ecba", 0, _142_hex_aes_ecba_d },
{ "ecbb", 0, _142_hex_aes_ecbb_d },
{ "ecbc", 0, _142_hex_aes_ecbc_d },
{ "cbca", 0, _142_hex_aes_cbca_d },
{ "cbcb", 0, _142_hex_aes_cbcb_d },
{ "cbcc", 0, _142_hex_aes_cbcc_d },
{}
};
static u3j_harm _142_hex_down_mark_a[] = {{".2", u3wg_down, c3y}, {}};
static u3j_core _142_hex_down_d[] =
{ { "mark", _142_hex_down_mark_a },
{}
};
static u3j_harm _142_hex_lore_a[] = {{".2", u3we_lore}, {}};
static u3j_harm _142_hex_loss_a[] = {{".2", u3we_loss}, {}};
static u3j_harm _142_hex_lune_a[] = {{".2", u3we_lune}, {}};
static u3j_harm _142_hex_coed__ed_puck_a[] = {{".2", u3wee_puck}, {}};
static u3j_harm _142_hex_coed__ed_sign_a[] = {{".2", u3wee_sign}, {}};
static u3j_harm _142_hex_coed__ed_veri_a[] = {{".2", u3wee_veri}, {}};
static u3j_harm _142_hex_coed__ed_shar_a[] = {{".2", u3wee_shar}, {}};
static u3j_core _142_hex_coed__ed_d[] =
{ { "sign", _142_hex_coed__ed_sign_a },
{ "puck", _142_hex_coed__ed_puck_a },
{ "veri", _142_hex_coed__ed_veri_a },
{ "shar", _142_hex_coed__ed_shar_a },
{}
};
static u3j_core _142_hex_coed_d[] =
{ { "ed", 0, _142_hex_coed__ed_d },
{}
};
static u3j_core _142_hex_d[] =
{ { "down", 0, _142_hex_down_d },
{ "lore", _142_hex_lore_a },
{ "loss", _142_hex_loss_a },
{ "lune", _142_hex_lune_a },
{ "coed", 0, _142_hex_coed_d },
{ "aes", 0, _142_hex_aes_d },
{}
};
/* layer five
*/
static u3j_harm _142_pen_cell_a[] = {{".2", u3wz_cell}, {}};
static u3j_harm _142_pen_comb_a[] = {{".2", u3wz_comb}, {}};
static u3j_harm _142_pen_cons_a[] = {{".2", u3wz_cons}, {}};
static u3j_harm _142_pen_core_a[] = {{".2", u3wz_core}, {}};
static u3j_harm _142_pen_face_a[] = {{".2", u3wz_face}, {}};
static u3j_harm _142_pen_fitz_a[] = {{".2", u3wz_fitz}, {}};
static u3j_harm _142_pen_flan_a[] = {{".2", u3wz_flan}, {}};
static u3j_harm _142_pen_flip_a[] = {{".2", u3wz_flip}, {}};
static u3j_harm _142_pen_flor_a[] = {{".2", u3wz_flor}, {}};
static u3j_harm _142_pen_fork_a[] = {{".2", u3wz_fork}, {}};
static u3j_harm _142_pen_hike_a[] = {{".2", u3wz_hike}, {}};
static u3j_harm _142_pen_look_a[] = {{".2", u3wz_look}, {}};
static u3j_harm _142_pen_loot_a[] = {{".2", u3wz_loot}, {}};
static u3j_harm _142_pen__ut_conk_a[] = {{".2", u3wzu_conk}, {}};
static u3j_harm _142_pen__ut_crop_a[] = {{".2", u3wzu_crop}, {}};
// static u3j_harm _142_pen__ut_fire_a[] = {{".2", u3wzu_fire}, {}};
static u3j_harm _142_pen__ut_fond_a[] = {{".2", u3wzu_fond}, {}};
static u3j_harm _142_pen__ut_fish_a[] = {{".2", u3wzu_fish}, {}};
static u3j_harm _142_pen__ut_fuse_a[] = {{".2", u3wzu_fuse}, {}};
static u3j_harm _142_pen__ut_mint_a[] = {{".2", u3wzu_mint}, {}};
static u3j_harm _142_pen__ut_mull_a[] = {{".2", u3wzu_mull}, {}};
static u3j_harm _142_pen__ut_nest_a[] = {{".2", u3wzu_nest}, {}};
static u3j_harm _142_pen__ut_peek_a[] = {{".2", u3wzu_peek}, {}};
static u3j_harm _142_pen__ut_play_a[] = {{".2", u3wzu_play}, {}};
static u3j_harm _142_pen__ut_rest_a[] = {{".2", u3wzu_rest}, {}};
static u3j_harm _142_pen__ut_toss_a[] = {{".2", u3wzu_toss}, {}};
static u3j_harm _142_pen__ut_wrap_a[] = {{".2", u3wzu_wrap}, {}};
static u3j_core _142_pen__ut_d[] =
{
{ "conk", _142_pen__ut_conk_a },
{ "crop", _142_pen__ut_crop_a },
{ "fond", _142_pen__ut_fond_a },
// { "fire", _142_pen__ut_fire_a },
{ "fish", _142_pen__ut_fish_a },
{ "fuse", _142_pen__ut_fuse_a },
{ "mint", _142_pen__ut_mint_a },
{ "mull", _142_pen__ut_mull_a },
{ "nest", _142_pen__ut_nest_a },
{ "peek", _142_pen__ut_peek_a },
{ "play", _142_pen__ut_play_a },
{ "rest", _142_pen__ut_rest_a },
{ "toss", _142_pen__ut_toss_a },
{ "wrap", _142_pen__ut_wrap_a },
{}
};
static u3j_harm _142_pen__ut_a[] =
{ {"repo", u3wzu_repo},
{}
};
static u3j_core _142_pen_d[] =
{ { "hex", 0, _142_hex_d },
{ "cell", _142_pen_cell_a },
{ "comb", _142_pen_comb_a },
{ "cons", _142_pen_cons_a },
{ "core", _142_pen_core_a },
{ "face", _142_pen_face_a },
{ "fitz", _142_pen_fitz_a },
{ "flan", _142_pen_flan_a },
{ "flip", _142_pen_flip_a },
{ "flor", _142_pen_flor_a },
{ "fork", _142_pen_fork_a },
{ "hike", _142_pen_hike_a },
{ "look", _142_pen_look_a },
{ "loot", _142_pen_loot_a },
// { "ap", _142_pen__ap_a },
// { "al", _142_pen__al_a },
{ "ut", _142_pen__ut_a, _142_pen__ut_d },
{}
};
/* layer four
*/
static u3j_harm _142_qua_trip_a[] = {{".2", u3we_trip}, {}};
static u3j_harm _142_qua__po_ind_a[] = {{".2", u3wcp_ind}, {}};
static u3j_harm _142_qua__po_ins_a[] = {{".2", u3wcp_ins}, {}};
static u3j_harm _142_qua__po_tod_a[] = {{".2", u3wcp_tod}, {}};
static u3j_harm _142_qua__po_tos_a[] = {{".2", u3wcp_tos}, {}};
static u3j_core _142_qua__po_d[] =
{ { "ind", _142_qua__po_ind_a },
{ "ins", _142_qua__po_ins_a },
{ "tod", _142_qua__po_tod_a },
{ "tos", _142_qua__po_tos_a },
{}
};
static u3j_harm _142_qua__bend_fun_a[] = {{".2", u3we_bend_fun}, {}};
static u3j_core _142_qua__bend_d[] =
{ { "fun", _142_qua__bend_fun_a },
{}
};
static u3j_harm _142_qua__cold_fun_a[] = {{".2", u3we_cold_fun}, {}};
static u3j_core _142_qua__cold_d[] =
{ { "fun", _142_qua__cold_fun_a },
{}
};
static u3j_harm _142_qua__cook_fun_a[] = {{".2", u3we_cook_fun}, {}};
static u3j_core _142_qua__cook_d[] =
{ { "fun", _142_qua__cook_fun_a },
{}
};
static u3j_harm _142_qua__comp_fun_a[] = {{".2", u3we_comp_fun}, {}};
static u3j_core _142_qua__comp_d[] =
{ { "fun", _142_qua__comp_fun_a },
{}
};
static u3j_harm _142_qua__easy_fun_a[] = {{".2", u3we_easy_fun}, {}};
static u3j_core _142_qua__easy_d[] =
{ { "fun", _142_qua__easy_fun_a },
{}
};
static u3j_harm _142_qua__glue_fun_a[] = {{".2", u3we_glue_fun}, {}};
static u3j_core _142_qua__glue_d[] =
{ { "fun", _142_qua__glue_fun_a },
{}
};
static u3j_harm _142_qua__here_fun_a[] = {{".2", u3we_here_fun}, {}};
static u3j_core _142_qua__here_d[] =
{ { "fun", _142_qua__here_fun_a },
{}
};
static u3j_harm _142_qua__just_fun_a[] = {{".2", u3we_just_fun}, {}};
static u3j_core _142_qua__just_d[] =
{ { "fun", _142_qua__just_fun_a },
{}
};
static u3j_harm _142_qua__mask_fun_a[] = {{".2", u3we_mask_fun}, {}};
static u3j_core _142_qua__mask_d[] =
{ { "fun", _142_qua__mask_fun_a },
{}
};
static u3j_harm _142_qua__shim_fun_a[] = {{".2", u3we_shim_fun}, {}};
static u3j_core _142_qua__shim_d[] =
{ { "fun", _142_qua__shim_fun_a },
{}
};
static u3j_harm _142_qua__stag_fun_a[] = {{".2", u3we_stag_fun}, {}};
static u3j_core _142_qua__stag_d[] =
{ { "fun", _142_qua__stag_fun_a },
{}
};
static u3j_harm _142_qua__stew_fun_a[] = {{".2", u3we_stew_fun}, {}};
static u3j_core _142_qua__stew_d[] =
{ { "fun", _142_qua__stew_fun_a },
{}
};
static u3j_harm _142_qua__stir_fun_a[] = {{".2", u3we_stir_fun}, {}};
static u3j_core _142_qua__stir_d[] =
{ { "fun", _142_qua__stir_fun_a },
{}
};
static u3j_harm _142_qua_pfix_a[] = {{".2", u3we_pfix}, {}};
static u3j_harm _142_qua_plug_a[] = {{".2", u3we_plug}, {}};
static u3j_harm _142_qua_pose_a[] = {{".2", u3we_pose}, {}};
static u3j_harm _142_qua_sfix_a[] = {{".2", u3we_sfix}, {}};
static u3j_harm _142_qua_mink_a[] = {{".2", u3we_mink}, {}};
static u3j_harm _142_qua_mule_a[] = {{".2", u3we_mule}, {}};
static u3j_core _142_qua_d[] =
{ { "pen", 0, _142_pen_d },
{ "po", 0, _142_qua__po_d },
{ "trip", _142_qua_trip_a },
{ "bend", 0, _142_qua__bend_d },
{ "cold", 0, _142_qua__cold_d },
{ "comp", 0, _142_qua__comp_d },
{ "cook", 0, _142_qua__cook_d },
{ "easy", 0, _142_qua__easy_d },
{ "glue", 0, _142_qua__glue_d },
{ "here", 0, _142_qua__here_d },
{ "just", 0, _142_qua__just_d },
{ "mask", 0, _142_qua__mask_d },
{ "shim", 0, _142_qua__shim_d },
{ "stag", 0, _142_qua__stag_d },
{ "stew", 0, _142_qua__stew_d },
{ "stir", 0, _142_qua__stir_d },
{ "pfix", _142_qua_pfix_a },
{ "plug", _142_qua_plug_a },
{ "pose", _142_qua_pose_a },
{ "sfix", _142_qua_sfix_a },
{ "mink", _142_qua_mink_a },
{ "mule", _142_qua_mule_a },
{}
};
/* layer three
*/
static u3j_harm _142_tri__cofl__drg_a[] = {{".2", u3wef_drg}, {}};
static u3j_harm _142_tri__cofl__lug_a[] = {{".2", u3wef_lug}, {}};
static u3j_core _142_tri__cofl_d[] =
{ { "drg", _142_tri__cofl__drg_a },
{ "lug", _142_tri__cofl__lug_a },
{}
};
static u3j_harm _142_tri__rd_add_a[] = {{".2", u3wer_add}, {}};
static u3j_harm _142_tri__rd_sub_a[] = {{".2", u3wer_sub}, {}};
static u3j_harm _142_tri__rd_mul_a[] = {{".2", u3wer_mul}, {}};
static u3j_harm _142_tri__rd_div_a[] = {{".2", u3wer_div}, {}};
static u3j_harm _142_tri__rd_sqt_a[] = {{".2", u3wer_sqt}, {}};
static u3j_harm _142_tri__rd_fma_a[] = {{".2", u3wer_fma}, {}};
static u3j_harm _142_tri__rd_lth_a[] = {{".2", u3wer_lth}, {}};
static u3j_harm _142_tri__rd_lte_a[] = {{".2", u3wer_lte}, {}};
static u3j_harm _142_tri__rd_equ_a[] = {{".2", u3wer_equ}, {}};
static u3j_harm _142_tri__rd_gte_a[] = {{".2", u3wer_gte}, {}};
static u3j_harm _142_tri__rd_gth_a[] = {{".2", u3wer_gth}, {}};
static u3j_core _142_tri__rd_d[] =
{ { "add", _142_tri__rd_add_a },
{ "sub", _142_tri__rd_sub_a },
{ "mul", _142_tri__rd_mul_a },
{ "div", _142_tri__rd_div_a },
{ "sqt", _142_tri__rd_sqt_a },
{ "fma", _142_tri__rd_fma_a },
{ "lth", _142_tri__rd_lth_a },
{ "lte", _142_tri__rd_lte_a },
{ "equ", _142_tri__rd_equ_a },
{ "gte", _142_tri__rd_gte_a },
{ "gth", _142_tri__rd_gth_a },
{}
};
static u3j_harm _142_tri__rs_add_a[] = {{".2", u3wet_add}, {}};
static u3j_harm _142_tri__rs_sub_a[] = {{".2", u3wet_sub}, {}};
static u3j_harm _142_tri__rs_mul_a[] = {{".2", u3wet_mul}, {}};
static u3j_harm _142_tri__rs_div_a[] = {{".2", u3wet_div}, {}};
static u3j_harm _142_tri__rs_sqt_a[] = {{".2", u3wet_sqt}, {}};
static u3j_harm _142_tri__rs_fma_a[] = {{".2", u3wet_fma}, {}};
static u3j_harm _142_tri__rs_lth_a[] = {{".2", u3wet_lth}, {}};
static u3j_harm _142_tri__rs_lte_a[] = {{".2", u3wet_lte}, {}};
static u3j_harm _142_tri__rs_equ_a[] = {{".2", u3wet_equ}, {}};
static u3j_harm _142_tri__rs_gte_a[] = {{".2", u3wet_gte}, {}};
static u3j_harm _142_tri__rs_gth_a[] = {{".2", u3wet_gth}, {}};
static u3j_core _142_tri__rs_d[] =
{ { "add", _142_tri__rs_add_a },
{ "sub", _142_tri__rs_sub_a },
{ "mul", _142_tri__rs_mul_a },
{ "div", _142_tri__rs_div_a },
{ "sqt", _142_tri__rs_sqt_a },
{ "fma", _142_tri__rs_fma_a },
{ "lth", _142_tri__rs_lth_a },
{ "lte", _142_tri__rs_lte_a },
{ "equ", _142_tri__rs_equ_a },
{ "gte", _142_tri__rs_gte_a },
{ "gth", _142_tri__rs_gth_a },
{}
};
static u3j_harm _142_tri__rq_add_a[] = {{".2", u3weq_add}, {}};
static u3j_harm _142_tri__rq_sub_a[] = {{".2", u3weq_sub}, {}};
static u3j_harm _142_tri__rq_mul_a[] = {{".2", u3weq_mul}, {}};
static u3j_harm _142_tri__rq_div_a[] = {{".2", u3weq_div}, {}};
static u3j_harm _142_tri__rq_sqt_a[] = {{".2", u3weq_sqt}, {}};
static u3j_harm _142_tri__rq_fma_a[] = {{".2", u3weq_fma}, {}};
static u3j_harm _142_tri__rq_lth_a[] = {{".2", u3weq_lth}, {}};
static u3j_harm _142_tri__rq_lte_a[] = {{".2", u3weq_lte}, {}};
static u3j_harm _142_tri__rq_equ_a[] = {{".2", u3weq_equ}, {}};
static u3j_harm _142_tri__rq_gte_a[] = {{".2", u3weq_gte}, {}};
static u3j_harm _142_tri__rq_gth_a[] = {{".2", u3weq_gth}, {}};
static u3j_core _142_tri__rq_d[] =
{ { "add", _142_tri__rq_add_a },
{ "sub", _142_tri__rq_sub_a },
{ "mul", _142_tri__rq_mul_a },
{ "div", _142_tri__rq_div_a },
{ "sqt", _142_tri__rq_sqt_a },
{ "fma", _142_tri__rq_fma_a },
{ "lth", _142_tri__rq_lth_a },
{ "lte", _142_tri__rq_lte_a },
{ "equ", _142_tri__rq_equ_a },
{ "gte", _142_tri__rq_gte_a },
{ "gth", _142_tri__rq_gth_a },
{}
};
static u3j_harm _142_tri__rh_add_a[] = {{".2", u3wes_add}, {}};
static u3j_harm _142_tri__rh_sub_a[] = {{".2", u3wes_sub}, {}};
static u3j_harm _142_tri__rh_mul_a[] = {{".2", u3wes_mul}, {}};
static u3j_harm _142_tri__rh_div_a[] = {{".2", u3wes_div}, {}};
static u3j_harm _142_tri__rh_sqt_a[] = {{".2", u3wes_sqt}, {}};
static u3j_harm _142_tri__rh_fma_a[] = {{".2", u3wes_fma}, {}};
static u3j_harm _142_tri__rh_lth_a[] = {{".2", u3wes_lth}, {}};
static u3j_harm _142_tri__rh_lte_a[] = {{".2", u3wes_lte}, {}};
static u3j_harm _142_tri__rh_equ_a[] = {{".2", u3wes_equ}, {}};
static u3j_harm _142_tri__rh_gte_a[] = {{".2", u3wes_gte}, {}};
static u3j_harm _142_tri__rh_gth_a[] = {{".2", u3wes_gth}, {}};
static u3j_core _142_tri__rh_d[] =
{ { "add", _142_tri__rh_add_a },
{ "sub", _142_tri__rh_sub_a },
{ "mul", _142_tri__rh_mul_a },
{ "div", _142_tri__rh_div_a },
{ "sqt", _142_tri__rh_sqt_a },
{ "fma", _142_tri__rh_fma_a },
{ "lth", _142_tri__rh_lth_a },
{ "lte", _142_tri__rh_lte_a },
{ "equ", _142_tri__rh_equ_a },
{ "gte", _142_tri__rh_gte_a },
{ "gth", _142_tri__rh_gth_a },
{}
};
static u3j_harm _142_tri__og_raw_a[] = {{".2", u3weo_raw}, {}};
static u3j_core _142_tri__og_d[] =
{ { "raw", _142_tri__og_raw_a },
{}
};
static u3j_harm _142_tri_shax_a[] = {{".2", u3we_shax}, {}};
static u3j_harm _142_tri_shay_a[] = {{".2", u3we_shay}, {}};
static u3j_harm _142_tri_shas_a[] = {{".2", u3we_shas}, {}};
static u3j_harm _142_tri_shal_a[] = {{".2", u3we_shal}, {}};
static u3j_core _142_tri_d[] =
{ { "qua", 0, _142_qua_d },
{ "cofl", 0, _142_tri__cofl_d },
{ "rd", 0, _142_tri__rd_d },
{ "rs", 0, _142_tri__rs_d },
{ "rq", 0, _142_tri__rq_d },
{ "rh", 0, _142_tri__rh_d },
{ "og", 0, _142_tri__og_d },
{ "shax", _142_tri_shax_a },
{ "shay", _142_tri_shay_a },
{ "shas", _142_tri_shas_a },
{ "shal", _142_tri_shal_a },
{}
};
/* layer two
*/
static u3j_harm _142_two_flop_a[] = {{".2", u3wb_flop, c3y}, {}};
static u3j_harm _142_two_lent_a[] = {{".2", u3wb_lent, c3y}, {}};
static u3j_harm _142_two_levy_a[] = {{".2", u3wb_levy, c3y}, {}};
static u3j_harm _142_two_lien_a[] = {{".2", u3wb_lien, c3y}, {}};
static u3j_harm _142_two_murn_a[] = {{".2", u3wb_murn, c3y}, {}};
static u3j_harm _142_two_need_a[] = {{".2", u3wb_need, c3y}, {}};
static u3j_harm _142_two_reap_a[] = {{".2", u3wb_reap, c3y}, {}};
static u3j_harm _142_two_reel_a[] = {{".2", u3wb_reel, c3y}, {}};
static u3j_harm _142_two_roll_a[] = {{".2", u3wb_roll, c3y}, {}};
static u3j_harm _142_two_skid_a[] = {{".2", u3wb_skid, c3y}, {}};
static u3j_harm _142_two_skim_a[] = {{".2", u3wb_skim, c3y}, {}};
static u3j_harm _142_two_skip_a[] = {{".2", u3wb_skip, c3y}, {}};
static u3j_harm _142_two_scag_a[] = {{".2", u3wb_scag, c3y}, {}};
static u3j_harm _142_two_slag_a[] = {{".2", u3wb_slag, c3y}, {}};
static u3j_harm _142_two_snag_a[] = {{".2", u3wb_snag, c3y}, {}};
// static u3j_harm _142_two_sort_a[] = {{".2", u3wb_sort, c3y}, {}};
static u3j_harm _142_two_turn_a[] = {{".2", u3wb_turn, c3y}, {}};
static u3j_harm _142_two_weld_a[] = {{".2", u3wb_weld, c3y}, {}};
static u3j_harm _142_two_bex_a[] = {{".2", u3wc_bex, c3y}, {}};
static u3j_harm _142_two_can_a[] = {{".2", u3wc_can, c3y}, {}};
static u3j_harm _142_two_cap_a[] = {{".2", u3wc_cap, c3y}, {}};
static u3j_harm _142_two_cat_a[] = {{".2", u3wc_cat, c3y}, {}};
static u3j_harm _142_two_con_a[] = {{".2", u3wc_con, c3y}, {}};
static u3j_harm _142_two_cut_a[] = {{".2", u3wc_cut, c3y}, {}};
static u3j_harm _142_two_dis_a[] = {{".2", u3wc_dis, c3y}, {}};
static u3j_harm _142_two_dor_a[] = {{".2", u3wc_dor, c3y}, {}};
static u3j_harm _142_two_dvr_a[] = {{".2", u3wc_dvr, c3y}, {}};
static u3j_harm _142_two_end_a[] = {{".2", u3wc_end, c3y}, {}};
static u3j_harm _142_two_gor_a[] = {{".2", u3wc_gor, c3y}, {}};
static u3j_harm _142_two_hor_a[] = {{".2", u3wc_hor, c3y}, {}};
static u3j_harm _142_two_lsh_a[] = {{".2", u3wc_lsh, c3y}, {}};
static u3j_harm _142_two_mas_a[] = {{".2", u3wc_mas, c3y}, {}};
static u3j_harm _142_two_met_a[] = {{".2", u3wc_met, c3y}, {}};
static u3j_harm _142_two_mix_a[] = {{".2", u3wc_mix, c3y}, {}};
static u3j_harm _142_two_mug_a[] = {{".2", u3wc_mug, c3y}, {}};
static u3j_harm _142_two_muk_a[] = {{".2", u3wc_muk, c3y}, {}};
static u3j_harm _142_two_peg_a[] = {{".2", u3wc_peg, c3y}, {}};
static u3j_harm _142_two_pow_a[] = {{".2", u3wc_pow, c3y}, {}};
static u3j_harm _142_two_rap_a[] = {{".2", u3wc_rap, c3y}, {}};
static u3j_harm _142_two_rep_a[] = {{".2", u3wc_rep, c3y}, {}};
static u3j_harm _142_two_rip_a[] = {{".2", u3wc_rip, c3y}, {}};
static u3j_harm _142_two_rsh_a[] = {{".2", u3wc_rsh, c3y}, {}};
static u3j_harm _142_two_sqt_a[] = {{".2", u3wc_sqt, c3y}, {}};
static u3j_harm _142_two_vor_a[] = {{".2", u3wc_vor, c3y}, {}};
static u3j_harm _142_two_xeb_a[] = {{".2", u3wc_xeb, c3y}, {}};
static u3j_harm _142_two__in_bif_a[] = {{".2", u3wdi_bif}, {}};
static u3j_harm _142_two__in_dif_a[] = {{".2", u3wdi_dif}, {}};
static u3j_harm _142_two__in_gas_a[] = {{".2", u3wdi_gas}, {}};
static u3j_harm _142_two__in_has_a[] = {{".2", u3wdi_has}, {}};
static u3j_harm _142_two__in_mer_a[] = {{".2", u3wdi_mer}, {}};
// static u3j_harm _142_two__in_int_a[] = {{".2", u3wdi_int}, {}};
static u3j_harm _142_two__in_put_a[] = {{".2", u3wdi_put}, {}};
static u3j_harm _142_two__in_tap_a[] = {{".2", u3wdi_tap}, {}};
static u3j_harm _142_two__in_wyt_a[] = {{".2", u3wdi_wyt}, {}};
static u3j_harm _142_two__in_uni_a[] = {{".2", u3wdi_uni}, {}};
static u3j_core _142_two__in_d[] =
{ { "bif", _142_two__in_bif_a },
{ "dif", _142_two__in_dif_a },
{ "gas", _142_two__in_gas_a },
{ "has", _142_two__in_has_a },
{ "mer", _142_two__in_mer_a },
// { "int", _142_two__in_int_a },
{ "put", _142_two__in_put_a },
{ "tap", _142_two__in_tap_a },
{ "wyt", _142_two__in_wyt_a },
{ "uni", _142_two__in_uni_a },
{}
};
static u3j_harm _142_two__by_bif_a[] = {{".2", u3wdb_bif, c3y}, {}};
static u3j_harm _142_two__by_dif_a[] = {{".2", u3wdb_dif, c3y}, {}};
static u3j_harm _142_two__by_gas_a[] = {{".2", u3wdb_gas, c3y}, {}};
static u3j_harm _142_two__by_get_a[] = {{".2", u3wdb_get, c3y}, {}};
static u3j_harm _142_two__by_has_a[] = {{".2", u3wdb_has, c3y}, {}};
// static u3j_harm _142_two__by_int_a[] = {{".2", u3wdb_int, c3y}, {}};
static u3j_harm _142_two__by_put_a[] = {{".2", u3wdb_put, c3y}, {}};
static u3j_harm _142_two__by_tap_a[] = {{".2", u3wdb_tap, c3y}, {}};
// static u3j_harm _142_two__by_uni_a[] = {{".2", u3wdb_uni, c3y}, {}};
static u3j_core _142_two__by_d[] =
{ { "bif", _142_two__by_bif_a },
{ "dif", _142_two__by_dif_a },
{ "gas", _142_two__by_gas_a },
{ "get", _142_two__by_get_a },
{ "has", _142_two__by_has_a },
// { "int", _142_two__by_int_a },
{ "put", _142_two__by_put_a },
{ "tap", _142_two__by_tap_a },
// { "uni", _142_two__by_uni_a },
{}
};
static u3j_harm _142_two_cue_a[] = {{".2", u3we_cue}, {}};
static u3j_harm _142_two_jam_a[] = {{".2", u3we_jam}, {}};
static u3j_harm _142_two_mat_a[] = {{".2", u3we_mat}, {}};
static u3j_harm _142_two_rub_a[] = {{".2", u3we_rub}, {}};
static u3j_core _142_two_d[] =
{ { "tri", 0, _142_tri_d },
{ "flop", _142_two_flop_a },
{ "lent", _142_two_lent_a },
{ "levy", _142_two_levy_a },
{ "lien", _142_two_lien_a },
{ "murn", _142_two_murn_a },
{ "need", _142_two_need_a },
{ "reap", _142_two_reap_a },
{ "reel", _142_two_reel_a },
{ "roll", _142_two_roll_a },
{ "skid", _142_two_skid_a },
{ "skim", _142_two_skim_a },
{ "skip", _142_two_skip_a },
{ "scag", _142_two_scag_a },
{ "slag", _142_two_slag_a },
{ "snag", _142_two_snag_a },
// { "sort", _142_two_sort_a },
{ "turn", _142_two_turn_a },
{ "weld", _142_two_weld_a },
{ "bex", _142_two_bex_a },
{ "cat", _142_two_cat_a },
{ "can", _142_two_can_a },
{ "cap", _142_two_cap_a },
{ "con", _142_two_con_a },
{ "cue", _142_two_cue_a },
{ "cut", _142_two_cut_a },
{ "dis", _142_two_dis_a },
{ "dor", _142_two_dor_a },
{ "dvr", _142_two_dvr_a },
{ "end", _142_two_end_a },
{ "gor", _142_two_gor_a },
{ "hor", _142_two_hor_a },
{ "jam", _142_two_jam_a },
{ "lsh", _142_two_lsh_a },
{ "mas", _142_two_mas_a },
{ "mat", _142_two_mat_a },
{ "met", _142_two_met_a },
{ "mix", _142_two_mix_a },
{ "mug", _142_two_mug_a },
{ "muk", _142_two_muk_a },
{ "rap", _142_two_rap_a },
{ "rep", _142_two_rep_a },
{ "rip", _142_two_rip_a },
{ "rsh", _142_two_rsh_a },
{ "rub", _142_two_rub_a },
{ "peg", _142_two_peg_a },
{ "pow", _142_two_pow_a },
{ "sqt", _142_two_sqt_a },
{ "vor", _142_two_vor_a },
{ "xeb", _142_two_xeb_a },
{ "by", 0, _142_two__by_d },
{ "in", 0, _142_two__in_d },
};
/* layer one
*/
static u3j_harm _142_one_add_a[] = {{".2", u3wa_add, c3y}, {}};
static u3j_harm _142_one_dec_a[] = {{".2", u3wa_dec, c3y}, {}};
static u3j_harm _142_one_div_a[] = {{".2", u3wa_div, c3y}, {}};
static u3j_harm _142_one_dvr_a[] = {{".2", u3wc_dvr, c3y}, {}};
static u3j_harm _142_one_gte_a[] = {{".2", u3wa_gte, c3y}, {}};
static u3j_harm _142_one_gth_a[] = {{".2", u3wa_gth, c3y}, {}};
static u3j_harm _142_one_lte_a[] = {{".2", u3wa_lte, c3y}, {}};
static u3j_harm _142_one_lth_a[] = {{".2", u3wa_lth, c3y}, {}};
static u3j_harm _142_one_mod_a[] = {{".2", u3wa_mod, c3y}, {}};
static u3j_harm _142_one_mul_a[] = {{".2", u3wa_mul, c3y}, {}};
static u3j_harm _142_one_sub_a[] = {{".2", u3wa_sub, c3y}, {}};
static u3j_harm _142_one_cap_a[] = {{".2", u3wc_cap, c3y}, {}};
static u3j_harm _142_one_peg_a[] = {{".2", u3wc_peg, c3y}, {}};
static u3j_harm _142_one_mas_a[] = {{".2", u3wc_mas, c3y}, {}};
static u3j_core _142_one_d[] =
{ { "two", 0, _142_two_d },
{ "add", _142_one_add_a },
{ "dec", _142_one_dec_a },
{ "div", _142_one_div_a },
{ "dvr", _142_one_dvr_a },
{ "gte", _142_one_gte_a },
{ "gth", _142_one_gth_a },
{ "lte", _142_one_lte_a },
{ "lth", _142_one_lth_a },
{ "mod", _142_one_mod_a },
{ "mul", _142_one_mul_a },
{ "sub", _142_one_sub_a },
{ "cap", _142_one_cap_a },
{ "mas", _142_one_mas_a },
{ "peg", _142_one_peg_a },
{}
};
u3j_core _k142_d[] =
{ { "one", 0, _142_one_d },
{}
};
static u3j_core _d[] = {
{ "k142", 0, _k142_d},
{ "k143", 0, _k143_d},
{}
};

1054
jets/z/ap.c Normal file

File diff suppressed because it is too large Load Diff

29
jets/z/cell.c Normal file
View File

@ -0,0 +1,29 @@
/* j/6/cell.c
**
*/
#include "all.h"
/* functions
*/
u3_noun
u3qz_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
u3wz_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 u3qz_cell(hed, tal);
}
}

70
jets/z/comb.c Normal file
View File

@ -0,0 +1,70 @@
/* j/6/comb.c
**
*/
#include "all.h"
/* functions
*/
u3_noun
u3qz_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,
u3qc_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,
u3qc_peg(p_mal, pp_buz)),
u3nc(0,
u3qc_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
u3wz_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 u3qz_comb(mal, buz);
}
}

52
jets/z/cons.c Normal file
View File

@ -0,0 +1,52 @@
/* j/6/cons.c
**
*/
#include "all.h"
/* functions
*/
u3_noun
u3qz_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 = u3qa_div(p_vur, 2);
u3_atom nof = u3qa_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
u3wz_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 u3qz_cons(vur, sed);
}
}

29
jets/z/core.c Normal file
View File

@ -0,0 +1,29 @@
/* j/6/core.c
**
*/
#include "all.h"
/* functions
*/
u3_noun
u3qz_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
u3wz_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 u3qz_core(pac, con);
}
}

31
jets/z/face.c Normal file
View File

@ -0,0 +1,31 @@
/* j/6/face.c
**
*/
#include "all.h"
/* functions
*/
u3_noun
u3qz_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
u3wz_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 u3qz_face(sag, tip);
}
}

35
jets/z/fine.c Normal file
View File

@ -0,0 +1,35 @@
/* j/6/fine.c
**
*/
#include "all.h"
/* functions
*/
u3_noun
u3qz_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
u3wz_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 u3qz_fine(fuv, lup, mar);
}
}

67
jets/z/fitz.c Normal file
View File

@ -0,0 +1,67 @@
/* 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
u3qz_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
u3wz_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 u3qz_fitz(yaz, wix);
}
}

44
jets/z/flan.c Normal file
View File

@ -0,0 +1,44 @@
/* j/6/flan.c
**
*/
#include "all.h"
/* functions
*/
u3_noun
u3qz_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
u3wz_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 u3qz_flan(bos, nif);
}
}

39
jets/z/flip.c Normal file
View File

@ -0,0 +1,39 @@
/* j/6/flip.c
**
*/
#include "all.h"
/* functions
*/
u3_noun
u3qz_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
u3wz_flip(u3_noun cor)
{
u3_noun hel;
if ( u3_none == (hel = u3r_at(u3x_sam, cor)) ) {
return u3m_bail(c3__fail);
} else {
return u3qz_flip(hel);
}
}

44
jets/z/flor.c Normal file
View File

@ -0,0 +1,44 @@
/* j/6/flor.c
**
*/
#include "all.h"
/* functions
*/
u3_noun
u3qz_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
u3wz_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 u3qz_flor(bos, nif);
}
}

78
jets/z/fork.c Normal file
View File

@ -0,0 +1,78 @@
/* j/6/fork.c
**
*/
#include "all.h"
/* functions
*/
u3_noun
u3qz_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 u3kz_fork(u3nt(u3k(hoz), u3k(bur), u3_nul));
}
u3_noun
u3qz_fork(u3_noun yed)
{
u3_noun lez = u3_nul;
while ( u3_nul != yed ) {
u3_noun i_yed = u3h(yed);
if ( c3__void != i_yed ) {
if ( (c3y == u3du(i_yed)) && (c3__fork == u3h(i_yed)) ) {
lez = u3kdi_uni(lez, u3k(u3t(i_yed)));
}
else {
lez = u3kdi_put(lez, u3k(i_yed));
}
}
yed = u3t(yed);
}
if ( u3_nul == lez ) {
return c3__void;
}
else if ( (u3_nul == u3h(u3t(lez))) && (u3_nul == u3t(u3t(lez))) ) {
u3_noun ret = u3k(u3h(lez));
u3z(lez);
return ret;
}
else {
return u3nc(c3__fork, lez);
}
}
u3_noun
u3wz_fork(u3_noun cor)
{
u3_noun yed;
if ( c3n == u3r_mean(cor, u3x_sam, &yed, 0) ) {
return u3m_bail(c3__fail);
} else {
return u3qz_fork(yed);
}
}
u3_noun
u3kz_fork(u3_noun yed)
{
u3_noun ret = u3qz_fork(yed);
u3z(yed);
return ret;
}

136
jets/z/hike.c Normal file
View File

@ -0,0 +1,136 @@
/* 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, u3qc_cap(axis))) )
{
u3_atom axis_tap = u3qc_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, u3qc_cap(axis))) )
{
u3_atom axis_tap = u3qc_mas(axis);
return u3nc(u3nc(u3k(axis_tap),
u3k(tool)),
belt_r);
}
else return belt_r;
}
}
}
/* functions
*/
u3_noun
u3qz_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 = u3qc_peg(axe, 2);
u3_noun moz = u3qc_peg(axe, 3);
u3_noun zip = u3qz_hike(hax, tum);
u3_noun dof = u3qz_hike(moz, gam);
u3_noun fol = u3qz_cons(zip, dof);
u3z(tum);
u3z(gam);
u3z(hax);
u3z(moz);
u3z(zip);
u3z(dof);
return fol;
}
}
}
u3_noun
u3wz_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 u3qz_hike(axe, pac);
}
}

32
jets/z/hint.c Normal file
View File

@ -0,0 +1,32 @@
/* j/6/help.c
**
*/
#include "all.h"
/* functions
*/
u3_noun
u3qz_hint(u3_noun sag,
u3_noun tip)
{
if ( c3__void == tip ) {
return c3__void;
}
if ( c3__noun == tip ) {
return c3__noun;
}
else return u3nt(c3__hint, u3k(sag), u3k(tip));
}
u3_noun
u3wz_hint(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 u3qz_hint(sag, tip);
}
}

132
jets/z/look.c Normal file
View File

@ -0,0 +1,132 @@
/* 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,
u3qc_peg(axe, 2),
u3k(qn_dab));
}
else {
if ( c3y == u3qc_gor(cog, pn_dab) ) {
return u3_nul;
}
else {
u3_noun pro;
axe = u3qc_peg(axe, 3);
pro = _look_in(cog, r_dab, axe);
u3z(axe);
return pro;
}
}
}
else if ( (u3_nul == r_dab) ) {
if ( (c3y == u3du(qn_dab)) &&
(c3y == u3r_sing(cog, pn_dab)) ) {
return u3nt(u3_nul,
u3qc_peg(axe, 2),
u3k(qn_dab));
}
else {
if ( c3y == u3qc_gor(cog, pn_dab) ) {
u3_noun pro;
axe = u3qc_peg(axe, 3);
pro = _look_in(cog, l_dab, axe);
u3z(axe);
return pro;
}
else {
return u3_nul;
}
}
}
else {
if ( (c3y == u3du(qn_dab)) &&
(c3y == u3r_sing(cog, pn_dab)) ) {
return u3nt(u3_nul,
u3qc_peg(axe, 2),
u3k(qn_dab));
}
else {
if ( c3y == u3qc_gor(cog, pn_dab) ) {
u3_noun pro;
axe = u3qc_peg(axe, 6);
pro = _look_in(cog, l_dab, axe);
u3z(axe);
return pro;
}
else {
u3_noun pro;
axe = u3qc_peg(axe, 7);
pro = _look_in(cog, r_dab, axe);
u3z(axe);
return pro;
}
}
}
}
}
}
/* functions
*/
u3_noun
u3qz_look(u3_noun cog,
u3_noun dab)
{
return _look_in(cog, dab, 1);
}
u3_noun
u3wz_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 u3qz_look(cog, dab);
}
}

133
jets/z/loot.c Normal file
View File

@ -0,0 +1,133 @@
/* j/6/loot.c
**
*/
#include "all.h"
/* internals
*/
static u3_noun
_loot_in(u3_noun cog,
u3_noun dom,
u3_atom axe)
{
if ( u3_nul == dom ) {
return u3_nul;
}
else {
u3_noun n_dom, l_dom, r_dom;
u3r_trel(dom, &n_dom, &l_dom, &r_dom);
if ( c3n == u3du(n_dom) ) {
return u3m_bail(c3__fail);
}
else {
u3_noun qqn_dom = u3t(u3t(n_dom));
u3_noun yep = u3qz_look(cog, qqn_dom);
if ( (u3_nul == l_dom) && (u3_nul == r_dom) ) {
if ( u3_nul == yep ) {
return u3_nul;
} else {
u3_noun u_yep = u3t(yep);
u3_noun pro;
pro = u3nt(u3_nul, u3qc_peg(axe, u3h(u_yep)), u3k(u3t(u_yep)));
u3z(yep);
return pro;
}
}
else if ( (u3_nul == l_dom) ) {
if ( u3_nul == yep ) {
u3_noun nax = u3qc_peg(axe, 3);
u3_noun pro;
pro = _loot_in(cog, r_dom, nax);
u3z(nax);
return pro;
}
else {
u3_noun u_yep = u3t(yep);
u3_noun nax = u3qc_peg(axe, 2);
u3_noun pro;
pro = u3nt(u3_nul, u3qc_peg(nax, u3h(u_yep)), u3k(u3t(u_yep)));
u3z(nax);
u3z(yep);
return pro;
}
}
else if ( (u3_nul == r_dom) ) {
if ( u3_nul == yep ) {
u3_noun nax = u3qc_peg(axe, 3);
u3_noun pro;
pro = _loot_in(cog, l_dom, nax);
u3z(nax);
return pro;
}
else {
u3_noun u_yep = u3t(yep);
u3_noun nax = u3qc_peg(axe, 2);
u3_noun pro;
pro = u3nt(u3_nul, u3qc_peg(nax, u3h(u_yep)), u3k(u3t(u_yep)));
u3z(nax);
u3z(yep);
return pro;
}
}
else {
if ( u3_nul == yep ) {
u3_noun nax = u3qc_peg(axe, 6);
u3_noun pey;
pey = _loot_in(cog, l_dom, nax);
u3z(nax);
if ( u3_nul != pey ) {
return pey;
}
else {
u3_noun nax = u3qc_peg(axe, 7);
u3_noun pro;
pro = _loot_in(cog, r_dom, nax);
u3z(nax);
return pro;
}
}
else {
u3_noun u_yep = u3t(yep);
u3_noun nax = u3qc_peg(axe, 2);
u3_noun pro;
pro = u3nt(u3_nul, u3qc_peg(nax, u3h(u_yep)), u3k(u3t(u_yep)));
u3z(nax);
u3z(yep);
return pro;
}
}
}
}
}
/* functions
*/
u3_noun
u3qz_loot(u3_noun cog,
u3_noun dom)
{
return _loot_in(cog, dom, 1);
}
u3_noun
u3wz_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 u3qz_loot(cog, dom);
}
}

55
jets/z/slot.c Normal file
View File

@ -0,0 +1,55 @@
/* j/6/slot.c
**
*/
#include "all.h"
/* functions
*/
u3_noun
u3qz_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 = u3qzu_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
u3we_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 u3qz_slot(axe, vax);
}
}

42
jets/z/type.c Normal file
View File

@ -0,0 +1,42 @@
/* 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);
{
}
}
}

100
jets/z/ut.c Normal file
View File

@ -0,0 +1,100 @@
/* j/6/ut.c
**
*/
#include "all.h"
extern void
u3_pier_tank(c3_l tab_l, u3_noun tac);
// duck: create a duck core for mean.
//
u3_noun
u3qzu_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
u3qzu_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
u3qzu_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
u3qzu_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(u3qzu_dunq(van, ugh_c, typ)));
#endif
}
// shew: create a show core for mean
//
u3_noun
u3qzu_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
u3qzu_shep(u3_noun van,
const c3_c* paz_c,
u3_noun sty,
u3_noun mol)
{
return u3qzu_shew(van,
u3nc(u3nc('c', u3i_string(paz_c)),
u3nc(u3k(sty), mol)));
}

93
jets/z/ut_buss.c Normal file
View File

@ -0,0 +1,93 @@
/* j/6/ut_buss.c
**
*/
#include "all.h"
/* logic
*/
static u3_noun
_cqzu_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
_cqzu_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
u3wzu_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 _cqzu_buss(van, sut, cog, gen);
}
}
u3_noun
u3qzu_buss(u3_noun van,
u3_noun sut,
u3_noun cog,
u3_noun gen)
{
return _cqzu_buss(van, sut, cog, gen);
}
u3_noun
u3wzu_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 _cqzu_busk(van, sut, gen);
}
}
u3_noun
u3qzu_busk(u3_noun van,
u3_noun sut,
u3_noun gen)
{
return _cqzu_busk(van, sut, gen);
}

90
jets/z/ut_conk.c Normal file
View File

@ -0,0 +1,90 @@
/* j/6/ut_conk.c
**
*/
#include "all.h"
/* logic
*/
static u3_noun
_cqzu_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 = u3qz_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 = _cqzu_conk(van, sut, u3t(u3t(got)));
u3_noun nux = u3k(u3h(u3t(got)));
u3_noun ret = u3qz_face(nux, cok);
u3z(nux);
u3z(cok);
return ret;
}
case 2: {
u3_noun vet = u3r_at(u3qzu_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 == u3qzu_nest(van, cel, c3y, sut) ) {
return u3m_bail(c3__fail);
}
u3z(cel);
}
hed = u3qzu_peek(van, sut, c3__both, 2);
tal = u3qzu_peek(van, sut, c3__both, 3);
deh = _cqzu_conk(van, hed, u3h(u3t(got)));
lat = _cqzu_conk(van, tal, u3t(u3t(got)));
ret = u3qz_cell(deh, lat);
u3z(lat);
u3z(deh);
u3z(tal);
u3z(hed);
return ret;
}
}
}
/* boilerplate
*/
u3_noun
u3wzu_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 _cqzu_conk(van, sut, got);
}
}
u3_noun
u3qzu_conk(u3_noun van,
u3_noun sut,
u3_noun got)
{
return _cqzu_conk(van, sut, got);
}

271
jets/z/ut_crop.c Normal file
View File

@ -0,0 +1,271 @@
/* j/6/crop.c
**
*/
#include "all.h"
/* logic
*/
static u3_noun
_crop_dext(u3_noun, u3_noun, u3_noun, u3_noun);
static u3_noun
_crop_sint(u3_noun, u3_noun, u3_noun, u3_noun);
static u3_noun
_crop_repo(u3_noun van,
u3_noun sut,
u3_noun ref,
u3_noun bix)
{
u3_noun rep = u3qzu_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 == u3qzu_nest(van, p_ref, c3n, p_sut) )
{
u3_noun foz = _crop_dext(van, q_sut, q_ref, bix);
u3_noun ret = u3qz_cell(p_sut, foz);
u3z(foz);
return ret;
}
else return u3k(sut);
}
else return _crop_sint(van, sut, ref, bix);
}
case c3__core:
{
if ( (c3__atom == u3h(ref)) ||
(c3__cell == u3h(ref)) ) {
return u3k(sut);
}
else return _crop_sint(van, sut, ref, bix);
}
case c3__hint: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
u3_noun foz = _crop_dext(van, q_sut, ref, bix);
u3_noun ret = u3qz_hint(p_sut, foz);
u3z(foz);
return ret;
}
case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
u3_noun foz = _crop_dext(van, q_sut, ref, bix);
u3_noun ret = u3qz_face(p_sut, foz);
u3z(foz);
return ret;
}
case c3__fork: p_sut = u3t(sut);
{
u3_noun yed = u3qdi_tap(p_sut);
u3_noun ret = u3kf_fork(_crop_dext_fork(van, yed, ref, bix));
u3z(yed);
return ret;
}
case c3__hold:
{
u3_noun hud = u3nc(u3k(sut), u3k(ref));
if ( c3y == u3qdi_has(bix, hud) ) {
# if 0
u3_noun dun = u3qzu_dunq(van, "type", sut);
u3_noun niz = u3qzu_dunq(van, "over", ref);
u3t_push(u3nc(c3__mean, dun));
u3t_push(u3nc(c3__mean, niz));
# endif
return u3m_error("crop-loop");
} else {
u3_noun bux = u3qdi_put(bix, hud);
u3_noun ret = _crop_repo(van, sut, ref, bux);
u3z(hud);
u3z(bux);
return ret;
}
}
}
}
static u3_noun
_crop_sint(u3_noun van,
u3_noun sut,
u3_noun ref,
u3_noun bix)
{
u3_noun p_ref, q_ref;
switch ( u3h(ref) ) {
default: return u3m_bail(c3__fail);
case c3__core:
case c3__hint:
case c3__face: u3x_cell(u3t(ref), &p_ref, &q_ref);
{
return _crop_dext(van, sut, q_ref, bix);
}
case c3__fork: p_ref = u3t(ref);
{
u3_noun yed = u3qdi_tap(p_ref);
u3_noun ret = _crop_sint_fork(van, sut, yed, bix);
u3z(yed);
return ret;
}
case c3__hold:
{
u3_noun rep = u3qzu_repo(van, ref);
u3_noun ret = _crop_dext(van, sut, rep, bix);
u3z(rep);
return ret;
}
}
}
static u3_noun
_cqzu_crop(u3_noun van,
u3_noun sut,
u3_noun ref)
{
return _crop_dext(van, sut, ref, u3_nul);
}
/* boilerplate
*/
u3_noun
u3wzu_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 _cqzu_crop(van, sut, ref);
}
}
u3_noun
u3qzu_crop(u3_noun van,
u3_noun sut,
u3_noun ref)
{
c3_m fun_m = 144 + c3__crop + ((!!u3r_at(u3qzu_van_vet, van)) << 8);
u3_noun pro = u3z_find_2(fun_m, sut, ref);
if ( u3_none != pro ) {
return pro;
}
else {
pro = _cqzu_crop(van, sut, ref);
return u3z_save_2(fun_m, sut, ref, pro);
}
}

952
jets/z/ut_find.c Normal file
View File

@ -0,0 +1,952 @@
/* 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
_opal_sane(u3_noun ope)
{
if ( (0 == u3h(ope)) && (0 == u3t(ope)) ) {
fprintf(stderr, "insane opal\r\n");
c3_assert(0);
}
else return ope;
}
static u3_noun
_pony_sane(u3_noun poy)
{
if ( 0 == poy ) {
return poy;
}
else if ( c3n == u3h(poy) ) {
if ( c3n == u3h(u3t(poy)) ) {
// abnormal
u3_noun type = u3h(u3t(u3t(u3t(poy))));
if ( 0 == type ) {
u3m_p("insane type", 0);
c3_assert(0);
}
}
return poy;
}
else {
u3_noun ttt_poy = u3t(u3t(u3t(poy))); // opal
_opal_sane(ttt_poy);
return poy;
}
}
static u3_noun
u3qzu_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
u3qzu_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
u3qzu_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, 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,
u3_noun way,
u3_noun p_heg,
u3_noun q_heg,
u3_noun axe,
u3_noun lon,
u3_noun gil)
{
return u3nt(c3n, c3y, u3k(p_heg));
}
static u3_noun
_find_buck_stop(u3_noun van,
u3_noun sut,
u3_noun way,
u3_noun p_heg,
u3_noun q_heg,
u3_noun axe,
u3_noun lon,
u3_noun gil)
{
if ( u3_nul == q_heg ) {
return _find_buck_here(van, sut, way, p_heg, q_heg, axe, lon, gil);
}
else {
return _find_buck_lose(van, sut, way, p_heg, q_heg, axe, lon, gil);
}
}
static u3_noun
_find_buck_cell(u3_noun van,
u3_noun sut,
u3_noun way,
u3_noun p_heg,
u3_noun q_heg,
u3_noun axe,
u3_noun lon,
u3_noun gil)
{
u3_noun p_sut, q_sut;
u3x_cell(u3t(sut), &p_sut, &q_sut);
{
if ( u3_nul == q_heg ) {
return _find_buck_here(van, sut, way, p_heg, q_heg, axe, lon, gil);
}
else {
u3_noun exa = u3qc_peg(axe, 2);
u3_noun hed = _find_buck(van, p_sut, way, p_heg, q_heg, exa, lon, gil);
u3z(exa);
if ( (u3_nul == hed) || (c3y == u3h(hed)) || (c3n == u3h(u3t(hed))) ) {
return hed;
}
else {
u3_noun exa = u3qc_peg(axe, 3);
u3_noun tal = _find_buck
(van, q_sut, way, u3t(u3t(hed)), q_heg, exa, lon, gil);
u3z(exa);
u3z(hed);
return tal;
}
}
}
}
static u3_noun
_find_buck_core(u3_noun van,
u3_noun sut,
u3_noun way,
u3_noun p_heg,
u3_noun q_heg,
u3_noun axe,
u3_noun lon,
u3_noun gil)
{
u3_noun p_sut, q_sut, pq_sut, qq_sut, rq_sut, 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 = u3qz_loot(u3t(q_heg), qsq_sut);
if ( (u3_nul != zem) && (0 != p_heg) ) {
u3_noun ped;
ped = u3qa_dec(p_heg);
u3z(p_heg); p_heg = ped;
u3z(zem);
zem = u3_nul;
}
if ( u3_nul != zem ) {
u3_noun u_zem = u3t(zem);
u3_noun pu_zem = u3h(u_zem);
u3_noun qu_zem = u3t(u_zem);
u3_noun 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,
u3qc_peg(2, pu_zem),
u3nt(u3nc(mut, u3k(qqu_zem)), u3_nul, u3_nul)));
u3z(zem);
return pro;
}
else {
u3_noun pec = u3qzu_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 = u3qc_peg(axe, 3);
pro = _find_buck(van, p_sut, way, p_heg, q_heg, exa, lon, gil);
u3z(exa);
}
else {
u3_noun sam = u3qzu_peek(van, p_sut, way, 2);
u3_noun exa = u3qc_peg(axe, 6);
pro = _find_buck(van, sam, way, p_heg, q_heg, exa, lon, gil);
u3z(exa);
u3z(sam);
}
u3z(pec);
return pro;
}
}
}
}
static u3_noun
_find_twin(u3_noun van,
u3_noun hax,
u3_noun yor)
{
if ( c3y == u3r_sing(hax, yor) ) {
return u3k(hax);
}
else if ( u3_nul == hax ) {
return u3k(yor);
}
else if ( u3_nul == yor ) {
return u3k(hax);
}
else if ( c3n == u3h(hax) ) {
if ( (c3n != u3h(yor)) ) {
return u3m_error("find-fork-a");
}
else {
u3_noun p_hax = u3t(hax); // (each @ud {span nock})
u3_noun p_yor = u3t(yor); // (each @ud {span nock})
if ( (c3n != u3h(p_hax)) || (c3n != u3h(p_yor)) ) {
return u3m_error("find-fork-b");
}
else {
u3_noun pp_hax = u3t(p_hax); // {span nock}
u3_noun pp_yor = u3t(p_yor); // {span nock}
u3_noun ppp_hax = u3h(pp_hax); // 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(
u3kf_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, u3kf_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), u3qdi_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 = u3qdi_tap(p_sut);
u3_noun wiz;
u3_noun ret;
wiz = _find_buck_fork_turn(van, yed, way, p_heg, q_heg, axe, lon, gil);
u3z(yed);
ret = _find_buck_fork_twin(van, wiz);
u3z(wiz);
return ret;
}
static u3_noun
_find_buck_face_next(u3_noun van,
u3_noun sut,
u3_noun q_sut,
u3_noun qp_sut,
u3_noun way,
u3_noun p_heg,
u3_noun q_heg,
u3_noun axe,
u3_noun lon,
u3_noun gil)
{
if ( u3_nul == qp_sut ) {
u3_noun nol = u3nc(u3_nul, u3k(lon));
u3_noun ret = _find_buck(van, q_sut, way, p_heg, q_heg, axe, nol, gil);
u3z(nol);
return ret;
}
else {
u3_noun iqp_sut = u3h(qp_sut); // twig
u3_noun tiv = u3qzu_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 cob = u3qz_comb(dog, q_tiv);
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(u3t(fid)))));
}
u3z(fid);
vat = u3qzu_fine(van, sut, tor);
u3z(tor);
ret = u3nq
(c3n,
c3n,
wan,
u3nc(u3k(u3h(vat)), u3qz_comb(cob, u3t(vat))));
u3z(vat);
u3z(dog);
u3z(cob);
u3z(tiv);
return ret;
}
}
}
static u3_noun
_find_buck_face(u3_noun van,
u3_noun sut,
u3_noun way,
u3_noun p_heg,
u3_noun q_heg,
u3_noun axe,
u3_noun lon,
u3_noun gil)
{
u3_noun p_sut, q_sut;
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 = u3qdb_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 = u3qa_inc(p_heg);
u3_noun ret = _find_buck
(van, q_sut, way, dep, q_heg, axe, nol, gil);
u3z(dep);
u3z(nol);
u3z(tyr);
return ret;
}
else {
u3_noun uqu_tyr = u3t(qu_tyr);
u3_noun tor = u3qzu_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, u3qb_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), u3qz_comb(dog, qp_tor)));
u3z(dog);
u3z(tor);
u3z(tyr);
return ret;
}
}
}
}
}
}
static u3_noun
_find_bucx(u3_noun van,
u3_noun sut,
u3_noun way,
u3_noun p_heg,
u3_noun q_heg,
u3_noun axe,
u3_noun lon,
u3_noun gil)
{
if ( c3n == u3du(sut) ) switch ( sut ) {
default: return u3m_bail(c3__fail);
case c3__noun: {
// fprintf(stderr, "noun\r\n");
return _find_buck_stop(van, sut, way, p_heg, q_heg, axe, lon, gil);
}
case c3__void: {
// fprintf(stderr, "void\r\n");
// return _find_buck_stop(van, sut, way, p_heg, q_heg, axe, lon, gil);
return u3_nul;
}
}
else switch ( u3h(sut) ) {
default: return u3m_bail(c3__fail);
case c3__atom:
{
// fprintf(stderr, "atom\r\n");
return _find_buck_stop(van, sut, way, p_heg, q_heg, axe, lon, gil);
}
case c3__cell:
{
// fprintf(stderr, "cell\r\n");
return _find_buck_cell(van, sut, way, p_heg, q_heg, axe, lon, gil);
}
case c3__core:
{
// fprintf(stderr, "core\r\n");
return _find_buck_core(van, sut, way, p_heg, q_heg, axe, lon, gil);
}
case c3__hint:
{
u3_noun fop = u3qzu_repo(van, sut);
u3_noun pro = _find_bucx(van, fop, way, p_heg, q_heg, axe, lon, gil);
u3z(fop);
return pro;
}
case c3__face:
{
// fprintf(stderr, "face\r\n");
return _find_buck_face(van, sut, way, p_heg, q_heg, axe, lon, gil);
}
case c3__fork:
{
// fprintf(stderr, "fork\r\n");
return _find_buck_fork(van, sut, way, p_heg, q_heg, axe, lon, gil);
}
case c3__hold:
{
// fprintf(stderr, "hold\r\n");
if ( (c3y == u3qdi_has(gil, sut)) ) {
return u3_nul;
}
else {
u3_noun zoc = u3qdi_put(gil, sut);
u3_noun fop = u3qzu_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_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)
{
u3_noun ret = _find_bucx(van, sut, way, p_heg, q_heg, axe, lon, gil);
return _pony_sane(ret);
}
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
qqp_mor = _opal_sane(qqp_mor);
{
u3_noun ref = u3qzu_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, u3qzu_peek(van, ref, way, p_heg)));
ret = _pony_sane(ret);
}
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 _pony_sane(ret);
}
}
static u3_noun
_find_pony(u3_noun van,
u3_noun sut,
u3_noun way,
u3_noun hyp)
{
if ( u3_nul == hyp ) {
return _pony_sane(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);
mor = _pony_sane(mor);
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 = u3qzu_mint(van, pqpp_mor, c3__noun, gen);
u3_noun ret = u3nq(c3n,
c3n,
u3k(ppp_mor),
u3nc(u3k(u3h(fex)),
u3qz_comb(qqpp_mor, u3t(fex))));
u3z(fex);
u3z(gen);
u3z(mor);
return _pony_sane(ret);
}
}
else {
u3_noun p_mor = u3t(mor);
u3_noun ret = _find_limb(van, sut, way, i_hyp, p_mor);
u3z(mor);
return _pony_sane(ret);
}
}
}
static u3_noun
_cqzu_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
_cqzu_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
u3wzu_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 _cqzu_find(van, sut, way, hyp);
}
}
u3_noun
u3qzu_find(u3_noun van,
u3_noun sut,
u3_noun way,
u3_noun hyp)
{
c3_m fun_m = 144 + c3__find + ((!!u3r_at(u3qzu_van_vet, van)) << 8);
u3_noun pro = u3z_find_3(fun_m, sut, way, hyp);
if ( u3_none != pro ) {
return pro;
}
else {
pro = _cqzu_find(van, sut, way, hyp);
return u3z_save_3(fun_m, sut, way, hyp, pro);
}
}
/* boilerplate
*/
u3_noun
u3wzu_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 _cqzu_fond(van, sut, way, hyp);
}
}
u3_noun
u3qzu_fond(u3_noun van,
u3_noun sut,
u3_noun way,
u3_noun hyp)
{
c3_m fun_m = 144 + c3__fond + ((!!u3r_at(u3qzu_van_vet, van)) << 8);
u3_noun pro = u3z_find_3(fun_m, sut, way, hyp);
if ( u3_none != pro ) {
return pro;
}
else {
pro = _cqzu_fond(van, sut, way, hyp);
return u3z_save_3(fun_m, sut, way, hyp, pro);
}
}

195
jets/z/ut_fire.c Normal file
View File

@ -0,0 +1,195 @@
/* 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(u3qzu_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(u3qzu_van_rib, van);
u3_noun key = u3nt(u3k(sut),
u3k(dox),
u3k(gen));
u3_noun ret;
if ( c3n == _fire_vet(van) ) {
ret = c3y;
}
if ( c3y == u3qdi_has(rib, key) ) {
ret = c3y;
}
else {
u3_noun rob = u3qdi_put(rib, key);
u3_noun von = u3i_molt(u3k(van),
u3qzu_van_rib,
u3k(rob),
0);
u3_noun mul = u3qzu_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 == u3qzu_nest(van, qq_typ, c3y, p_typ)) )
{
#if 0
u3_noun dun = u3qzu_dunq(van, "need", qq_typ);
u3_noun niz = u3qzu_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 = u3qzu_dunq(van, "wild", typ);
u3_noun niz = u3qzu_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
_cqzu_fire(u3_noun van,
u3_noun sut,
u3_noun hag)
{
u3_noun vet = u3r_at(u3qzu_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
u3wzu_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 _cqzu_fire(van, sut, hag);
}
}
u3_noun
u3qzu_fire(u3_noun van,
u3_noun sut,
u3_noun hag)
{
return _cqzu_fire(van, sut, hag);
}

180
jets/z/ut_fish.c Normal file
View File

@ -0,0 +1,180 @@
/* j/6/fish.c
**
*/
#include "all.h"
/* functions
*/
static u3_noun
_fish_in(u3_noun, u3_noun, u3_atom, u3_noun);
static u3_noun
_fish_fork(u3_noun van,
u3_noun p_sut,
u3_atom axe,
u3_noun vit)
{
if ( u3_nul == p_sut ) {
return u3nc(1, 1);
}
else {
u3_noun hed = _fish_in(van, u3h(p_sut), axe, vit);
u3_noun tal = _fish_fork(van, u3t(p_sut), axe, vit);
u3_noun pro = u3qz_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 = u3qz_flip(ton);
u3z(ton);
return pro;
} else {
return u3nt(5,
u3nc(1, u3k(u3t(q_sut))),
u3nc(0, u3k(axe)));
}
}
}
case c3__cell: {
if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) {
return u3m_bail(c3__fail);
} else {
u3_noun hut = u3nt(3, 0, u3k(axe));
u3_noun lef = u3qc_peg(axe, 2);
u3_noun rit = u3qc_peg(axe, 3);
u3_noun hed = _fish_in(van, p_sut, lef, vit);
u3_noun tal = _fish_in(van, q_sut, rit, vit);
u3_noun hob = u3qz_flan(hed, tal);
u3_noun vug = u3qz_flan(hut, hob);
u3z(hob);
u3z(tal);
u3z(hed);
u3z(rit);
u3z(lef);
u3z(hut);
return vug;
}
}
case c3__core: {
return u3m_error("fish-core");
}
case c3__hint:
case c3__face: {
if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) {
return u3m_bail(c3__fail);
} else {
return _fish_in(van, q_sut, axe, vit);
}
}
case c3__fork: p_sut = u3t(sut);
{
u3_noun yed = u3qdi_tap(p_sut);
u3_noun ret = _fish_fork(van, yed, axe, vit);
u3z(yed);
return ret;
}
case c3__hold: {
p_sut = u3t(sut);
{
if ( (c3y == u3qdi_has(vit, sut)) ) {
// u3_noun dun = u3qzu_dunq(van, "type", sut);
u3_noun niz = u3qzu_shep
(van, "axis", 'd', u3k(axe));
// u3t_push(u3nc(c3__mean, dun));
u3t_push(u3nc(c3__mean, niz));
return u3m_error("fish-loop");
} else {
u3_noun zoc = u3qdi_put(vit, sut);
u3_noun fop = u3qzu_repo(van, sut);
u3_noun pro = _fish_in(van, fop, axe, zoc);
u3z(fop);
u3z(zoc);
return pro;
}
}
}
}
}
static u3_noun
_cqzu_fish(u3_noun van,
u3_noun sut,
u3_atom axe)
{
return _fish_in(van, sut, axe, u3_nul);
}
/* boilerplate
*/
u3_noun
u3wzu_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 _cqzu_fish(van, sut, axe);
}
}
u3_noun
u3qzu_fish(u3_noun van,
u3_noun sut,
u3_noun axe)
{
c3_m fun_m = 144 + c3__fish + ((!!u3r_at(u3qzu_van_vet, van)) << 8);
u3_noun pro = u3z_find_2(fun_m, sut, axe);
if ( u3_none != pro ) {
return pro;
}
else {
pro = _cqzu_fish(van, sut, axe);
return u3z_save_2(fun_m, sut, axe, pro);
}
}

215
jets/z/ut_fuse.c Normal file
View File

@ -0,0 +1,215 @@
/* j/6/fuse.c
**
*/
#include "all.h"
/* logic
*/
static u3_noun
_fuse_in(u3_noun, u3_noun, u3_noun, u3_noun);
static u3_noun
_fuse_repo(u3_noun van,
u3_noun sut,
u3_noun ref,
u3_noun bix)
{
u3_noun rep = u3qzu_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 == u3qz_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 = u3qz_cell(hed, tal);
u3z(hed);
u3z(tal);
return ret;
}
else return _fuse_in(van, ref, sut, bix);
}
case c3__core:
{
return _fuse_repo(van, sut, ref, bix);
}
case c3__hint: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
u3_noun vot = _fuse_in(van, q_sut, ref, bix);
u3_noun ret = u3qz_hint(p_sut, vot);
u3z(vot);
return ret;
}
case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
u3_noun vot = _fuse_in(van, q_sut, ref, bix);
u3_noun ret = u3qz_face(p_sut, vot);
u3z(vot);
return ret;
}
case c3__fork: p_sut = u3t(sut);
{
u3_noun yed = u3qdi_tap(p_sut);
u3_noun ret = u3kf_fork(_fuse_in_fork(van, yed, ref, bix));
u3z(yed);
return ret;
}
case c3__hold:
{
u3_noun hud = u3nc(u3k(sut), u3k(ref));
if ( c3y == u3qdi_has(bix, hud) ) {
// u3_noun dun = u3qzu_dunq(van, "type", sut);
// u3_noun niz = u3qzu_dunq(van, "over", ref);
// u3t_push(u3nc(c3__mean, dun));
// u3t_push(u3nc(c3__mean, niz));
return u3m_error("fuse-loop");
} else {
u3_noun bux = u3qdi_put(bix, hud);
u3_noun ret = _fuse_repo(van, sut, ref, bux);
u3z(hud);
u3z(bux);
return ret;
}
}
}
}
static u3_noun
_cqzu_fuse(u3_noun van,
u3_noun sut,
u3_noun ref)
{
return _fuse_in(van, sut, ref, u3_nul);
}
/* boilerplate
*/
u3_noun
u3wzu_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 _cqzu_fuse(van, sut, ref);
}
}
u3_noun
u3qzu_fuse(u3_noun van,
u3_noun sut,
u3_noun ref)
{
c3_m fun_m = 144 + c3__fuse + ((!!u3r_at(u3qzu_van_vet, van)) << 8);
u3_noun pro = u3z_find_2(fun_m, sut, ref);
if ( u3_none != pro ) {
return pro;
}
else {
pro = _cqzu_fuse(van, sut, ref);
return u3z_save_2(fun_m, sut, ref, pro);
}
}

16
jets/z/ut_gain.c Normal file
View File

@ -0,0 +1,16 @@
/* j/6/gain.c
**
*/
#include "all.h"
u3_noun
u3qzu_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));
}

16
jets/z/ut_lose.c Normal file
View File

@ -0,0 +1,16 @@
/* j/6/lose.c
**
*/
#include "all.h"
u3_noun
u3qzu_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));
}

856
jets/z/ut_mint.c Normal file
View File

@ -0,0 +1,856 @@
/* j/6/mint.c
**
*/
#include "all.h"
/* logic
*/
static u3_noun
_mint_in(u3_noun, u3_noun, u3_noun, u3_noun);
static u3_noun
_mint_bean()
{
return u3kf_fork(u3nt(u3nq(c3__atom, 'f', u3_nul, 0),
u3nq(c3__atom, 'f', u3_nul, 1),
u3_nul));
}
static u3_noun
_mint_vet(u3_noun van)
{
// u3_noun vet = u3j_hook(u3k(van), "vet");
u3_noun vet = u3r_at(u3qzu_van_vet, van);
switch ( vet ) {
case c3n:
case c3y: return vet;
default: return u3m_bail(c3__fail);
}
}
static u3_noun
_mint_feel(u3_noun van,
u3_noun sut,
u3_noun rot)
{
u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0);
u3_noun gat = u3j_hook(von, "feel");
return u3n_kick_on(u3i_molt(gat,
u3x_sam,
u3k(rot),
0));
}
static u3_noun
_mint_mine(u3_noun van,
u3_noun sut,
u3_noun mel,
u3_noun wad,
u3_noun dom)
{
u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0);
u3_noun gat = u3j_hook(von, "mine");
return u3n_kick_on(u3i_molt(gat,
u3x_sam_2,
u3k(mel),
u3x_sam_6,
u3k(wad),
u3x_sam_7,
u3k(dom),
0));
}
static u3_noun
_mint_burp(u3_noun van,
u3_noun sut)
{
u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0);
return u3j_hook(von, "burp");
}
static u3_noun
_mint_cond(u3_noun pex,
u3_noun yom,
u3_noun woq)
{
if ( 1 == u3h(pex) ) {
if ( 0 == u3t(pex) ) {
u3z(pex);
u3z(woq);
return yom;
}
else if ( 1 == u3t(pex) ) {
u3z(pex);
u3z(yom);
return woq;
}
}
return u3nq(6, pex, yom, woq);
}
static u3_noun
_mint_corn(u3_noun van,
u3_noun sut,
u3_noun gen)
{
u3_noun mil = _mint_in(van, sut, c3__noun, gen);
u3_noun fol = u3k(u3t(mil));
u3z(mil);
return fol;
}
static u3_noun
_mint_nice(u3_noun van,
u3_noun gol,
u3_noun typ)
{
if ( (c3y == _mint_vet(van)) &&
(c3n == u3qzu_nest(van, gol, c3y, typ)) )
{
// u3_noun dun = u3qzu_dunq(van, "need", gol);
// u3_noun niz = u3qzu_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_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 pul = _mint_mine(van, p_dan, mel, wan, dom);
u3_noun ret = u3nc(_mint_nice(van, gol, u3k(u3h(pul))),
u3qz_cons(u3t(pul), q_dan));
u3z(pul);
u3z(dan);
return ret;
}
static u3_noun
_mint_loc(u3_noun van,
u3_noun loc)
{
u3_noun mol = u3nc('o', u3k(loc));
u3_noun sho = u3j_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 = u3qzu_fire(van, sut, rag);
u3_noun fol = u3qz_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 = u3qzu_mint(van, sut, c3__noun, qi_mew);
u3_noun p_zil = u3h(zil);
u3_noun q_zil = u3t(zil);
u3_noun wip = u3qzu_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 = u3qzu_seek(van, sut, c3__read, hyp);
u3_noun p_lar = u3h(lar);
u3_noun q_lar = u3t(lar);
u3_noun pq_lar = u3h(q_lar);
u3_noun qq_lar = u3t(q_lar);
u3_noun mew = rig;
u3_noun yom = _mint_edit(van, sut, mew, p_lar, u3k(qq_lar), u3_nul);
u3_noun p_yom = u3h(yom);
u3_noun q_yom = u3t(yom);
u3_noun ret = u3nc(_mint_nice(van, gol, u3k(p_yom)),
(0 == pq_lar) ? u3k(q_yom)
: u3nt(9, u3k(pq_lar), u3k(q_yom)));
u3z(yom);
u3z(lar);
return ret;
}
#endif
# define _mint_used()
static u3_noun
_mint_in(u3_noun van,
u3_noun sut,
u3_noun gol,
u3_noun gen)
{
u3_noun p_gen, q_gen, r_gen;
u3_noun ret;
if ( (c3__void == sut) &&
!((c3y == u3du(gen)) && (c3__dbug == u3h(gen))) )
{
if ( (c3n == _mint_vet(van))
|| ((c3y == u3du(gen)) &&
((c3__zpfs == u3h(gen)) ||
(c3__zpsk == u3h(gen)) ||
(c3__lost == u3h(gen)) ||
(c3__fail == u3h(gen)) ||
(c3__zpzp == u3h(gen)))) )
{
return u3nt(c3__void, 0, 0);
}
else {
return u3m_error("mint-vain");
}
}
if ( c3n == u3du(gen) ) {
u3_noun ter = u3r_at(u3x_con_3, van);
u3_noun fab = u3r_at(u3qzu_van_fab, van);
u3_noun rex = u3qzp_open(ter, fab, gen);
ret = _mint_in(van, sut, gol, rex);
u3z(rex);
return ret;
}
else if ( c3y == u3du(u3h(gen)) ) {
_mint_used();
{
u3_noun hed = _mint_in(van, sut, c3__noun, u3h(gen));
u3_noun tal = _mint_in(van, sut, c3__noun, u3t(gen));
u3_noun typ = u3qz_cell(u3h(hed), u3h(tal));
ret = u3nc(_mint_nice(van, gol, typ),
u3qz_cons(u3t(hed),
u3t(tal)));
u3z(hed);
u3z(tal);
return ret;
}
} else switch ( u3h(gen) ) {
default: {
u3_noun ter = u3r_at(u3x_con_3, van);
u3_noun fab = u3r_at(u3qzu_van_fab, van);
u3_noun rex = u3qzp_open(ter, fab, gen);
if ( c3y == u3r_sing(rex, gen) ) {
#if 1
u3_noun zix = u3qzu_shep(van, "gene", 'q', u3k(gen));
u3t_push(u3nc(c3__mean, zix));
return u3m_error("mint-open");
#else
u3_err("h", u3h(gen));
return u3m_bail(c3__fail);
#endif
}
ret = _mint_in(van, sut, gol, rex);
u3z(rex);
return ret;
}
case c3__fits: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mint_used();
{
u3_noun wam = u3qzu_play(van, sut, p_gen);
u3_noun dok = u3nc(c3__wing, u3k(q_gen));
u3_noun vol = _mint_corn(van, sut, dok);
u3_noun axe = _mint_coke(vol);
ret = u3nc(_mint_nice(van, gol, _mint_bean()),
u3qzu_fish(van, wam, axe));
u3z(axe);
u3z(vol);
u3z(wam);
u3z(dok);
return ret;
}
case c3__wtcl: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen);
_mint_used();
{
u3_noun bol = _mint_bean();
u3_noun nor = _mint_in(van, sut, bol, p_gen);
u3_noun fex = u3qzu_gain(van, sut, p_gen);
u3_noun wux = u3qzu_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(u3qz_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 = u3qz_cell(u3h(hed), u3h(tal));
ret = u3nc(_mint_nice(van, gol, typ),
u3qz_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 == u3qzu_nest(van, u3h(one), c3n, u3h(two))) &&
(c3n == u3qzu_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__bcdt, 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 = u3qzu_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 = u3qzu_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 = u3qzu_wrap(van, u3h(ryd), c3__iron);
u3_noun pro = u3nc(tyf, u3k(u3t(ryd)));
u3z(ryd);
return pro;
}
case c3__ktpd:
case c3__ktpm: p_gen = u3t(gen);
_mint_used();
{
u3_noun ryd = _mint_in(van, sut, gol, p_gen);
u3_noun tyf = u3qzu_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 = u3qzu_wrap(van, u3h(ryd), c3__lead);
u3_noun pro = u3nc(tyf, u3k(u3t(ryd)));
u3z(ryd);
return pro;
}
case c3__note: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mint_used();
{
u3_noun hit = u3nc(u3k(sut), u3k(p_gen));
u3_noun hum = _mint_in(van, sut, gol, q_gen);
u3_noun ret = u3nc(u3qz_hint(hit, u3h(hum)),
u3k(u3t(hum)));
u3z(hum);
u3z(hit);
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(u3qzu_conk(van, u3h(vat), p_gen),
u3k(u3t(vat)));
u3z(vat);
return ret;
}
case c3__tune: p_gen = u3t(gen);
_mint_used();
{
return u3nc(u3qz_face(p_gen, sut), u3nc(0, 1));
}
case c3__ktls: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mint_used();
{
u3_noun huz = u3qzu_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);
if ( 0 == p_fid ) {
u3m_p("bad subject: p_gen", p_gen);
c3_assert(0);
}
u3_noun dov = _mint_in(van, p_fid, gol, q_gen);
u3_noun p_dov = u3h(dov);
u3_noun q_dov = u3t(dov);
ret = u3nc(u3k(p_dov),
u3qz_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 = u3qzu_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 = u3qzu_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 = u3qzu_play(van, sut, p_gen);
u3_noun dug = u3qzu_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), u3qzu_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), u3qzu_van_fab, c3n, 0);
u3_noun ret = _mint_in(von, sut, gol, p_gen);
u3z(von);
return ret;
}
case c3__cold:
case c3__ktsg: p_gen = u3t(gen);
_mint_used();
{
c3_m fun_m = 144 + c3__blow;
u3_noun vrf = u3r_at(u3qzu_van_vrf, van);
u3_noun pro = u3z_find_4(fun_m, vrf, sut, gol, p_gen);
if ( u3_none != pro ) {
return pro;
}
else {
u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0);
u3_noun gat = u3j_hook(von, "blow");
u3_noun pro;
pro = u3n_kick_on(u3i_molt(gat,
u3x_sam_2,
u3k(gol),
u3x_sam_3,
u3k(p_gen),
0));
return u3z_save_4(fun_m, vrf, sut, gol, p_gen, pro);
}
}
case c3__zpcm: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mint_used();
{
return u3nc(_mint_nice(van,
gol,
u3qzu_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__zpmc:
case c3__zpsm: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mint_used();
{
u3_noun vos = _mint_in(van, sut, c3__noun, q_gen);
u3_noun zur = u3qzu_play(van, sut, p_gen);
u3_noun p_vos = u3h(vos);
u3_noun q_vos = u3t(vos);
u3_noun waz = u3nc(1, _mint_burp(van, p_vos));
// u3_noun waz = u3nc(1, u3k(p_vos));
u3_noun sif = u3k(zur);
u3_noun cig = u3qz_cell(sif, p_vos);
u3_noun ret;
ret = u3nc(_mint_nice(van, gol, cig),
u3qz_cons(waz, q_vos));
u3z(waz);
u3z(zur);
u3z(sif);
u3z(vos);
return ret;
}
case c3__zpvt: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen);
_mint_used();
{
if ( c3y == _mint_feel(van, sut, p_gen) ) {
return _mint_in(van, sut, gol, q_gen);
} else {
return _mint_in(van, sut, gol, r_gen);
}
}
case c3__lost: p_gen = u3t(gen);
_mint_used();
{
if ( c3y == _mint_vet(van) ) {
u3_noun zur = u3qzu_play(van, sut, p_gen);
u3_noun dun = u3qzu_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
_cqzu_mint(u3_noun van,
u3_noun sut,
u3_noun gol,
u3_noun gen)
{
return _mint_in(van, sut, gol, gen);
}
/* boilerplate
*/
u3_noun
u3wzu_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 _cqzu_mint(van, sut, gol, gen);
}
}
u3_noun
u3qzu_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(u3qzu_van_vrf, van);
u3_noun pro = u3z_find_4(fun_m, vrf, sut, gol, gen);
if ( u3_none != pro ) {
return pro;
}
else {
pro = _cqzu_mint(van, sut, gol, gen);
return u3z_save_4(fun_m, vrf, sut, gol, gen, pro);
}
}

785
jets/z/ut_mull.c Normal file
View File

@ -0,0 +1,785 @@
/* j/6/mull.c
**
*/
#include "all.h"
/* functions
*/
static u3_noun
_mull_in(u3_noun, u3_noun, u3_noun, u3_noun, u3_noun);
static u3_noun
_mull_bean()
{
return u3kf_fork(u3nt(u3nq(c3__atom, 'f', u3_nul, 0),
u3nq(c3__atom, 'f', u3_nul, 1),
u3_nul));
}
static u3_noun
_mull_loc(u3_noun van,
u3_noun loc)
{
u3_noun mol = u3nc('o', u3k(loc));
u3_noun sho = u3j_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_feel(u3_noun van,
u3_noun sut,
u3_noun rot)
{
u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0);
u3_noun gat = u3j_hook(von, "feel");
return u3n_kick_on(u3i_molt(gat,
u3x_sam,
u3k(rot),
0));
}
static u3_noun
_mull_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_mile(u3_noun van,
u3_noun sut,
u3_noun dox,
u3_noun mel,
u3_noun wad,
u3_noun dom)
{
u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0);
u3_noun gat = u3j_hook(von, "mile");
return u3n_kick_on(u3i_molt(gat,
u3x_sam_2,
u3k(dox),
u3x_sam_6,
u3k(mel),
u3x_sam_14,
u3k(wad),
u3x_sam_15,
u3k(dom),
0));
}
static u3_noun
_mull_doke(u3_noun van,
u3_noun sut,
u3_noun gen)
{
u3_noun fug = u3qzu_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 == u3qzu_nest(van, gol, c3y, typ) ) {
// u3_noun dun = u3qzu_dunq(van, "need", gol);
// u3_noun niz = u3qzu_dunq(van, "have", typ);
// u3t_push(u3nc(c3__mean, dun));
// u3t_push(u3nc(c3__mean, niz));
return u3m_error("mull-nice");
}
else return typ;
}
static u3_noun
_mull_grow(u3_noun van,
u3_noun sut,
u3_noun gol,
u3_noun dox,
u3_atom mel,
u3_noun 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 yaz = _mull_mile(van, p_dan, q_dan, mel, wan, dom);
u3_noun p_yaz = u3h(yaz);
u3_noun q_yaz = u3t(yaz);
u3_noun ret = u3nc(_mull_nice(van, gol, u3k(p_yaz)), u3k(q_yaz));
u3z(yaz);
u3z(dan);
return ret;
}
static u3_noun
_mull_both(u3_noun van,
u3_noun gol,
u3_noun typ)
{
return u3nc(_mull_nice(van, gol, u3k(typ)),
typ);
}
#if 1
static u3_noun
_mull_cnts(u3_noun van,
u3_noun sut,
u3_noun gol,
u3_noun dox,
u3_noun hyp,
u3_noun rig)
{
u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0);
u3_noun gat = u3j_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 = u3qzu_toss(van, sut, pi_mew, p_zil, p_yom);
u3_noun dof = u3qzu_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 = u3qzu_seek(van, sut, c3__read, hyp);
u3_noun vug = u3qzu_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), u3qzu_van_vet, c3n, 0);
u3_noun p_ret = u3qzu_fire(van, sut, u3h(yom));
u3_noun q_ret = u3qzu_fire(von, sut, u3t(yom));
u3z(von);
u3z(yom);
u3z(vug);
u3z(lar);
return u3nc(_mull_nice(van, gol, p_ret), q_ret);
}
}
#endif
# define _mull_used()
static u3_noun
_mull_in(u3_noun van,
u3_noun sut,
u3_noun gol,
u3_noun dox,
u3_noun gen)
{
u3_noun p_gen, q_gen, r_gen;
u3_noun ret;
if ( c3n == u3du(gen) ) {
u3_noun ter = u3r_at(u3x_con_3, van);
u3_noun fab = u3r_at(u3qzu_van_fab, van);
u3_noun rex = u3qzp_open(ter, fab, gen);
ret = _mull_in(van, sut, gol, dox, rex);
u3z(rex);
return ret;
}
else if ( c3y == u3du(u3h(gen)) ) {
_mull_used();
{
u3_noun hed = _mull_in(van, sut, c3__noun, dox, u3h(gen));
u3_noun tal = _mull_in(van, sut, c3__noun, dox, u3t(gen));
u3_noun dis = u3qz_cell(u3h(hed), u3h(tal));
u3_noun dat = u3qz_cell(u3t(hed), u3t(tal));
u3_noun ret = u3nc(_mull_nice(van, gol, dis), dat);
u3z(tal);
u3z(hed);
return ret;
}
}
else switch ( u3h(gen) ) {
default: {
u3_noun ter = u3r_at(u3x_con_3, van);
u3_noun fab = u3r_at(u3qzu_van_fab, van);
u3_noun rex = u3qzp_open(ter, fab, gen);
if ( c3y == u3r_sing(rex, gen) ) {
#if 1
u3_noun zix = u3qzu_shep(van, "gene", 'q', u3k(gen));
u3t_push(u3nc(c3__mean, zix));
return u3m_error("mull-open");
#else
u3_err("h", u3h(gen));
return u3m_bail(c3__fail);
#endif
}
ret = _mull_in(van, sut, gol, dox, rex);
u3z(rex);
return ret;
}
case c3__fits: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mull_used();
{
u3_noun p_waz = u3qzu_play(van, sut, p_gen);
u3_noun q_waz = u3qzu_play(van, dox, p_gen);
u3_noun dok = u3nc(c3__wing, u3k(q_gen));
u3_noun p_syx = _mull_doke(van, sut, dok);
u3_noun q_syx = _mull_doke(van, dox, dok);
u3_noun p_pov = u3qzu_fish(van, p_waz, p_syx);
u3_noun q_pov = u3qzu_fish(van, q_waz, q_syx);
if ( (c3n == u3r_sing(p_syx, q_syx)) ||
(c3n == u3r_sing(p_pov, q_pov)) )
{
return u3m_error("mull-bonk-b");
}
u3z(p_waz); u3z(q_waz);
u3z(p_syx); u3z(q_syx);
u3z(p_pov); u3z(q_pov);
u3z(dok);
return _mull_both(van, gol, _mull_bean());
}
case c3__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 = u3qzu_gain(van, sut, p_gen);
u3_noun q_fex = u3qzu_gain(van, dox, p_gen);
u3_noun p_wux = u3qzu_lose(van, sut, p_gen);
u3_noun q_wux = u3qzu_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
: u3qzu_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
: u3qzu_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 = u3qz_forq(u3h(hiq), u3h(ran));
dat = u3qz_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 = u3qz_cell(u3h(hed), u3h(tal));
u3_noun dat = u3qz_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__bcdt, 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 = u3qzu_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 = u3qzu_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(u3qzu_wrap(van,
u3h(vat),
c3__iron),
u3qzu_wrap(van,
u3t(vat),
c3__iron));
u3z(vat);
return pro;
}
case c3__ktpd:
case c3__ktpm: p_gen = u3t(gen);
_mull_used();
{
u3_noun vat = _mull_in(van, sut, gol, dox, p_gen);
u3_noun pro = u3nc(u3qzu_wrap(van,
u3h(vat),
c3__zinc),
u3qzu_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(u3qzu_wrap(van,
u3h(vat),
c3__lead),
u3qzu_wrap(van,
u3t(vat),
c3__lead));
u3z(vat);
return pro;
}
case c3__note: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mull_used();
{
u3_noun vat = _mull_in(van, sut, gol, dox, q_gen);
u3_noun hit = u3nc(u3k(sut), u3k(p_gen));
u3_noun hix = u3nc(u3k(dox), u3k(p_gen));
u3_noun ret = u3nc(u3qz_hint(hit, u3h(vat)),
u3qz_hint(hix, u3t(vat)));
u3z(hix);
u3z(hit);
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(u3qzu_conk(van, u3h(vat), p_gen),
u3qzu_conk(van, u3t(vat), p_gen));
u3z(vat);
return ret;
}
case c3__tune: p_gen = u3t(gen);
_mull_used();
{
return u3nc(u3qz_face(p_gen, sut),
u3qz_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, u3qzu_play(van, sut, p_gen));
u3_noun q_hif = u3qzu_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 = u3qzu_buss(van, sut, p_gen, q_gen);
u3_noun nuf = u3qzu_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 = u3qzu_busk(van, sut, p_gen);
u3_noun nuf = u3qzu_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 = u3qzu_play(van, sut, p_gen);
u3_noun dug = u3qzu_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 = u3qzu_play(van, sut, p_gen);
u3_noun q_ret = u3qzu_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), u3qzu_van_fab, c3n, 0);
u3_noun ret = _mull_in(von, sut, gol, dox, p_gen);
u3z(von);
return ret;
}
case c3__zpmc:
case c3__zpsm: u3x_cell(u3t(gen), &p_gen, &q_gen);
_mull_used();
{
u3_noun p_zur = u3qzu_play(van, sut, p_gen);
u3_noun q_zur = u3qzu_play (van, dox, p_gen);
u3_noun vos = _mull_in(van, sut, c3__noun, dox, q_gen);
u3_noun p_ret = u3qz_cell(p_zur, u3h(vos));
u3_noun q_ret = u3qz_cell(q_zur, u3t(vos));
u3z(vos);
u3z(q_zur);
u3z(p_zur);
return u3nc
(_mull_nice(van, gol, p_ret), q_ret);
}
case c3__zpvt: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen);
_mull_used();
{
c3_o fes = _mull_feel(van, sut, p_gen);
c3_o fed = _mull_feel(van, dox, p_gen);
if ( fes != fed ) {
return u3m_error("mull-bonk-f");
}
else {
if ( c3y == fes ) {
return _mull_in(van, sut, gol, dox, q_gen);
} else {
return _mull_in(van, sut, gol, dox, r_gen);
}
}
}
case c3__lost:
case c3__fail:
case c3__zpzp:
_mull_used();
{
return u3nc(c3__void, c3__void);
}
}
}
static u3_noun
_cqzu_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
u3wzu_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 _cqzu_mull(van, sut, gol, dox, gen);
}
}
u3_noun
u3qzu_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(u3qzu_van_vet, van)) << 8);
u3_noun pro = u3z_find_4(fun_m, sut, gol, dox, gen);
if ( u3_none != pro ) {
return pro;
}
else {
pro = _cqzu_mull(van, sut, gol, dox, gen);
return u3z_save_4(fun_m, sut, gol, dox, gen, pro);
}
}

561
jets/z/ut_nest.c Normal file
View File

@ -0,0 +1,561 @@
/* 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 = u3qzu_play(van, sut, qqqn_dab);
u3_noun lon = u3qzu_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 == u3qdi_has(gil, hud)) ) {
u3z(hud);
return c3y;
}
else {
u3_noun zoc = u3qdi_put(gil, hud);
u3_noun tus = u3nt(c3__core,
u3k(qq_sut),
u3nc(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 = u3qzu_peek(van, qq_sut, c3__rite, 2);
u3_noun r_sam = u3qzu_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 = u3qzu_peek(van, qq_sut, c3__read, 2);
u3_noun r_pal = u3qzu_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 == u3qz_fitz(p_sut, p_ref)) ||
( (c3y == u3du(q_sut)) &&
( (c3n == u3du(q_ref)) ||
(c3n == u3r_sing(q_sut, q_ref)))) )
{
return c3n;
}
return c3y;
}
return _nest_sint(van, sut, tel, ref, seg, reg, gil);
}
}
case c3__cell: {
if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) {
return u3m_bail(c3__fail);
} else {
if ( c3y == u3r_pq(ref, c3__cell, &p_ref, &q_ref) ) {
return c3a(_nest_dext(van, p_sut, tel, p_ref, u3_nul, u3_nul, gil),
_nest_dext(van, q_sut, tel, q_ref, u3_nul, u3_nul, gil));
}
else return _nest_sint(van, sut, tel, ref, seg, reg, gil);
}
}
case c3__core: {
if ( c3n == u3r_trel(sut, 0, &p_sut, &q_sut) ) {
return u3m_bail(c3__fail);
} else {
if ( (c3y == u3r_pq(ref, c3__core, &p_ref, &q_ref)) ) {
return _nest_cong(van, sut, tel, ref, gil);
}
else return _nest_sint(van, sut, tel, ref, seg, reg, gil);
}
}
case c3__hint:
case c3__face: {
if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) {
return u3m_bail(c3__fail);
} else {
return _nest_dext(van, q_sut, tel, ref, seg, reg, gil);
}
}
case c3__fork: p_sut = u3t(sut);
{
if ( c3n == u3du(ref) ) switch ( ref ) {
default: return _nest_sint(van, sut, tel, ref, seg, reg, gil);
case c3__noun:
break;
}
else switch ( u3h(ref) ) {
default: return _nest_sint(van, sut, tel, ref, seg, reg, gil);
case c3__atom:
case c3__cell:
case c3__core:
break;
}
{
u3_noun dey = u3qdi_tap(p_sut);
u3_noun yed = dey;
while ( u3_nul != yed ) {
if ( c3y == _nest_dext(van, u3h(yed), c3n, ref, seg, reg, gil) ) {
u3z(dey);
return c3y;
} else {
yed = u3t(yed);
}
}
u3z(dey);
return c3n;
}
}
case c3__hold:
{
if ( c3y == u3qdi_has(seg, sut) ) {
return c3n;
}
else {
u3_noun hud = u3nc(u3k(sut), u3k(ref));
if ( (c3y == u3qdi_has(gil, hud)) ) {
u3z(hud);
return c3y;
}
else {
u3_noun gus = u3qdi_put(seg, sut);
u3_noun zoc = u3qdi_put(gil, hud);
u3_noun fop = u3qzu_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 = u3qzu_dunq(van, "need", sut);
u3_noun niz = u3qzu_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(u3qzu_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 = u3qzu_repo(van, ref);
u3_noun hiv = _nest_dext(van, sut, tel, gam, seg, reg, gil);
u3z(gam);
return hiv;
}
case c3__hint:
case c3__face: {
if ( c3n == u3r_trel(ref, 0, &p_ref, &q_ref) ) {
return u3m_bail(c3__fail);
} else {
return _nest_dext(van, sut, tel, q_ref, seg, reg, gil);
}
}
case c3__fork: p_ref = u3t(ref);
{
u3_noun dey = u3qdi_tap(p_ref);
u3_noun yed = dey;
while ( u3_nul != yed ) {
if ( c3n == _nest_dext(van, sut, c3n, u3h(yed), seg, reg, gil) ) {
u3z(dey);
return c3n;
} else {
yed = u3t(yed);
}
}
u3z(dey);
return c3y;
}
case c3__hold: {
if ( c3y == u3qdi_has(reg, ref) ) {
return c3y;
}
{
u3_noun hud = u3nc(u3k(sut), u3k(ref));
if ( (c3y == u3qdi_has(gil, hud)) ) {
u3z(hud);
return c3y;
} else {
u3_noun gur = u3qdi_put(reg, ref);
u3_noun zoc = u3qdi_put(gil, hud);
u3_noun gam = u3qzu_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
_cqzu_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
u3wzu_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 _cqzu_nest(van, sut, tel, ref);
}
}
u3_noun
u3qzu_nest(u3_noun van,
u3_noun sut,
u3_noun tel,
u3_noun ref)
{
#if 1
c3_m fun_m = 144 + c3__nest;
u3_noun vrf = u3r_at(u3qzu_van_vrf, van);
u3_noun pro = u3z_find_4(fun_m, vrf, sut, tel, ref);
if ( u3_none != pro ) {
// u3t_heck(c3__good);
return pro;
}
else {
pro = _cqzu_nest(van, sut, tel, ref);
// u3t_heck(c3__nest);
return u3z_save_4(fun_m, vrf, sut, tel, ref, pro);
}
#else
return _cqzu_nest(van, sut, tel, ref);
#endif
}

214
jets/z/ut_peek.c Normal file
View File

@ -0,0 +1,214 @@
/* j/6/peek.c
**
*/
#include "all.h"
/* logic
*/
static u3_noun
_cqzu_peek(u3_noun, u3_noun, u3_noun, u3_atom);
static u3_noun
_peek_in(u3_noun, u3_noun, u3_noun, u3_atom, u3_noun);
static u3_noun
_peek_fork(u3_noun van, u3_noun p_sut, u3_noun way, u3_noun axe, u3_noun gil)
{
if ( u3_nul == p_sut ) {
return u3_nul;
}
else {
return u3nc(_peek_in(van, u3h(p_sut), way, axe, gil),
_peek_fork(van, u3t(p_sut), way, axe, gil));
}
}
static u3_noun
_peek_in(u3_noun van,
u3_noun sut,
u3_noun way,
u3_atom axe,
u3_noun gil)
{
u3_noun p_sut, q_sut;
u3_noun pro;
if ( (c3n == u3du(sut)) ) switch ( sut ) {
default: return u3m_bail(c3__fail);
case c3__noun: {
return c3__noun;
}
case c3__void: {
return c3__void;
}
}
else switch ( u3h(sut) ) {
default: return u3m_bail(c3__fail);
case c3__atom: {
return c3__void;
}
case c3__cell: {
if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) {
return u3m_bail(c3__fail);
} else {
u3_atom tip = u3qc_cap(axe);
u3_atom tap = u3qc_mas(axe);
if ( 2 == tip ) {
pro = _cqzu_peek(van, p_sut, way, tap);
}
else {
pro = _cqzu_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 = u3qc_cap(axe);
u3_atom lat = u3qc_mas(axe);
if ( 3 == now ) {
u3_noun pec = u3qzu_peel(van, sut, way, pq_sut);
u3_noun sam = u3h(pec);
u3_noun con = u3t(pec);
if ( c3y == c3a(sam, con) ) {
pro = _cqzu_peek(van, p_sut, way, lat);
}
else {
u3_noun typ;
{
u3_noun hed, tal;
if ( c3n == sam ) {
hed = c3__noun;
} else {
hed = _cqzu_peek(van, p_sut, way, 2);
}
if ( c3n == con ) {
tal = c3__noun;
} else {
tal = _cqzu_peek(van, p_sut, way, 3);
}
typ = u3qz_cell(hed, tal);
u3z(hed);
u3z(tal);
}
pro = _cqzu_peek(van, typ, way, lat);
u3z(typ);
}
u3z(pec);
}
else {
pro = c3__noun;
}
u3z(lat);
u3z(now);
return pro;
}
}
case c3__hint:
case c3__face: {
if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) {
return u3m_bail(c3__fail);
} else {
return _peek_in(van, q_sut, way, axe, gil);
}
}
case c3__fork: p_sut = u3t(sut);
{
u3_noun yed = u3qdi_tap(p_sut);
u3_noun ret = u3kf_fork(_peek_fork(van, yed, way, axe, gil));
u3z(yed);
return ret;
}
case c3__hold: {
if ( (c3y == u3qdi_has(gil, sut)) ) {
return c3__void;
}
else {
u3_noun zoc = u3qdi_put(gil, sut);
u3_noun fop = u3qzu_repo(van, sut);
u3_noun pro = _peek_in(van, fop, way, axe, zoc);
u3z(fop);
u3z(zoc);
return pro;
}
}
}
}
static u3_noun
_cqzu_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
u3wzu_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 _cqzu_peek(van, sut, way, axe);
}
}
u3_noun
u3qzu_peek(u3_noun van,
u3_noun sut,
u3_noun way,
u3_noun axe)
{
c3_m fun_m = 144 + c3__peek + ((!!u3r_at(u3qzu_van_vet, van)) << 8);
u3_noun pro = u3z_find_3(fun_m, sut, way, axe);
if ( u3_none != pro ) {
return pro;
}
else {
pro = _cqzu_peek(van, sut, way, axe);
return u3z_save_3(fun_m, sut, way, axe, pro);
}
}

55
jets/z/ut_peel.c Normal file
View File

@ -0,0 +1,55 @@
/* j/6/ut_peel.c
**
*/
#include "all.h"
/* logic
*/
u3_noun
_cqzu_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
u3wzu_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 _cqzu_peel(van, sut, way, met);
}
}
u3_noun
u3qzu_peel(u3_noun van,
u3_noun sut,
u3_noun way,
u3_noun met)
{
return _cqzu_peel(van, sut, way, met);
}

614
jets/z/ut_play.c Normal file
View File

@ -0,0 +1,614 @@
/* j/6/play.c
**
*/
#include "all.h"
/* logic
*/
# define _play_used()
static u3_noun
_play_in(u3_noun, u3_noun, u3_noun);
static u3_noun
_play_bean()
{
return u3kf_fork(u3nt(u3nq(c3__atom, 'f', u3_nul, 0),
u3nq(c3__atom, 'f', u3_nul, 1),
u3_nul));
}
static u3_noun
_play_rock(u3_noun odo, u3_noun bob)
{
if ( c3y == u3ud(bob) ) {
return u3nq(c3__atom, u3k(odo), u3_nul, u3k(bob));
}
else return u3nt(c3__cell, _play_rock(odo, u3h(bob)),
_play_rock(odo, u3t(bob)));
}
static u3_noun
_play_sand(u3_noun odo, u3_noun bob)
{
if ( c3y == u3ud(bob) ) {
if ( 'n' == odo ) {
if ( (bob != 0) ) {
return u3m_bail(c3__exit);
} else {
return u3nq(c3__atom, odo, u3_nul, bob);
}
}
if ( 'f' == odo ) {
if ( (bob > 1) ) {
return u3m_bail(c3__exit);
} else {
return _play_bean();
}
}
return u3nt(c3__atom, u3k(odo), u3_nul);
}
else return u3nt(c3__cell, _play_rock(odo, u3h(bob)),
_play_rock(odo, u3t(bob)));
}
static u3_noun
_play_core(u3_noun pac,
u3_noun con)
{
if ( (c3__void == pac) ) {
u3z(con);
return c3__void;
} else {
return u3nt(c3__core, pac, con);
}
}
static u3_noun
_play_loc(u3_noun van,
u3_noun loc)
{
u3_noun mol = u3nc('o', u3k(loc));
u3_noun sho = u3j_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
_play_feel(u3_noun van,
u3_noun sut,
u3_noun rot)
{
u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0);
u3_noun gat = u3j_hook(von, "feel");
return u3n_kick_on(u3i_molt(gat,
u3x_sam,
u3k(rot),
0));
}
#if 0
static u3_noun
_play_loc_term(u3_noun van,
u3_noun loc)
{
u3_noun fop = u3kb_flop(u3k(u3h(loc)));
u3_noun nam = ((0 == fop) ? c3__none : u3k(u3h(fop)));
u3_noun lys = u3nt(u3k(u3h(u3t(loc))), u3k(u3t(u3t(loc))), u3_nul);
u3_noun rup = u3nc(nam, lys);
c3_c* pre_c = u3m_pretty(rup);
u3_noun pro = u3i_string(pre_c);
u3z(fop);
u3z(rup);
free(pre_c);
return pro;
}
#endif
#if 1
static u3_noun
_play_cnts(u3_noun van,
u3_noun sut,
u3_noun hyp,
u3_noun rig)
{
u3_noun von = u3i_molt(u3k(van), u3x_sam, u3k(sut), 0);
u3_noun gat = u3j_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 = u3qzu_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 = u3qzu_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 = u3qzu_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(u3nc(c3__full, u3_nul), u3_nul),
u3k(dom))));
}
static u3_noun
_play_in(u3_noun van,
u3_noun sut,
u3_noun gen);
static u3_noun
_play_x(u3_noun van,
u3_noun sut,
u3_noun gen)
{
#if 1
return _play_in(van, sut, gen);
#else
u3_noun zix = u3qzu_shep
(van, "gene", 'q', u3k(gen));
u3_noun ret;
u3t_push(u3nc(c3__mean, zix));
ret = _play_in(van, sut, gen);
u3t_drop();
return ret;
#endif
}
static u3_noun
_play_in(u3_noun van,
u3_noun sut,
u3_noun gen)
{
u3_noun p_gen, q_gen, r_gen;
if ( c3n == u3du(gen) ) {
open: {
u3_noun ter = u3r_at(u3x_con_3, van);
u3_noun fab = u3r_at(u3qzu_van_fab, van);
u3_noun rex = u3qzp_open(ter, fab, gen);
u3_noun ret;
if ( c3y == u3r_sing(rex, gen) ) {
u3_noun zix = u3qzu_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 = u3qz_cell(dis, dat);
u3z(dis);
u3z(dat);
return ret;
}
}
else switch ( u3h(gen) ) {
default: goto open;
case c3__fits: u3x_cell(u3t(gen), &p_gen, &q_gen);
_play_used();
{
return _play_bean();
}
case c3__wtcl: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen);
_play_used();
{
u3_noun fex = u3qzu_gain(van, sut, p_gen);
u3_noun wux = u3qzu_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 = u3qz_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 = u3qz_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__bcdt, 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 = u3qzu_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 = u3qzu_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 = u3qzu_wrap(van, boc, c3__lead);
u3z(boc);
return pro;
}
case c3__note: u3x_cell(u3t(gen), &p_gen, &q_gen);
_play_used();
{
u3_noun boc = _play_x(van, sut, q_gen);
u3_noun hit = u3nc(u3k(sut), u3k(p_gen));
u3_noun ret = u3qz_hint(hit, boc);
u3z(hit);
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 = u3qzu_conk(van, boc, p_gen);
u3z(boc);
return ret;
}
case c3__tune: p_gen = u3t(gen);
_play_used();
{
return u3qz_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 = u3qzu_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 = u3qzu_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 = u3qzu_play(van, sut, p_gen);
u3_noun dug = u3qzu_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), u3qzu_van_fab, c3n, 0);
u3_noun ret = _play_x(von, sut, p_gen);
u3z(von);
return ret;
}
case c3__zpcm: u3x_cell(u3t(gen), &p_gen, &q_gen);
_play_used();
{
return _play_x(van, sut, p_gen);
}
case c3__dbug: u3x_cell(u3t(gen), &p_gen, &q_gen);
{
u3_noun ret;
#if 0
{
u3_noun cog = _play_loc_term(van, p_gen);
u3t_heck(cog);
u3z(cog);
}
#endif
u3t_push(u3nc(c3__mean, _play_loc(van, p_gen)));
{
ret = _play_x(van, sut, q_gen);
}
u3t_drop();
return ret;
}
case c3__zpmc:
case c3__zpsm: u3x_cell(u3t(gen), &p_gen, &q_gen);
_play_used();
{
u3_noun zur = _play_x(van, sut, p_gen);
u3_noun vos = _play_x(van, sut, q_gen);
u3_noun ret = u3qz_cell(zur, vos);
u3z(zur);
u3z(vos);
return ret;
}
case c3__zpvt: u3x_trel(u3t(gen), &p_gen, &q_gen, &r_gen);
_play_used();
{
if ( c3y == _play_feel(van, sut, p_gen) ) {
return _play_x(van, sut, q_gen);
} else {
return _play_x(van, sut, r_gen);
}
}
case c3__lost:
case c3__fail:
case c3__zpzp:
_play_used();
{
return c3__void;
}
}
}
static u3_noun
_cqzu_play(u3_noun van,
u3_noun sut,
u3_noun gen)
{
u3_noun von = u3i_molt(u3k(van), u3qzu_van_vet, c3n, 0);
u3_noun ret = _play_x(von, sut, gen);
u3z(von);
return ret;
}
/* boilerplate
*/
u3_noun
u3wzu_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 _cqzu_play(van, sut, gen);
}
}
u3_noun
u3qzu_play(u3_noun van,
u3_noun sut,
u3_noun gen)
{
#if 1
c3_m fun_m = 144 + c3__play;
u3_noun vrf = u3r_at(u3qzu_van_vrf, van);
u3_noun pro = u3z_find_3(fun_m, vrf, sut, gen);
if ( u3_none != pro ) {
return pro;
}
else {
pro = _cqzu_play(van, sut, gen);
return u3z_save_3(fun_m, vrf, sut, gen, pro);
}
#else
return _cqzu_play(van, sut, gen);
#endif
}

70
jets/z/ut_repo.c Normal file
View File

@ -0,0 +1,70 @@
/* j/6/ut_repo.c
**
*/
#include "all.h"
/* logic
*/
u3_noun
u3qzu_repo(u3_noun van,
u3_noun sut)
{
u3_noun p_sut, q_sut;
if ( c3n == u3du(sut) ) switch ( sut ) {
default: return u3k(sut);
case c3__noun: {
return u3kf_fork(u3nt(u3nt(c3__atom, u3_blip, u3_nul),
u3nt(c3__cell, c3__noun, c3__noun),
u3_nul));
}
}
else switch ( u3h(sut) ) {
default: {
u3m_p("head", u3h(sut));
return u3m_error("repo-flat");
}
case c3__core: {
if ( c3n == u3r_cell(u3t(sut), &p_sut, &q_sut) ) {
return u3m_bail(c3__fail);
} else {
return u3nt(c3__cell, c3__noun, u3k(p_sut));
}
}
case c3__hint:
case c3__face: {
if ( c3n == u3r_cell(u3t(sut), &p_sut, &q_sut)) {
return u3m_bail(c3__fail);
} else {
return u3k(q_sut);
}
}
case c3__hold: {
if ( c3n == u3r_cell(u3t(sut), &p_sut, &q_sut)) {
return u3m_bail(c3__fail);
} else {
u3_noun old = u3nc(u3nc(u3k(p_sut), u3k(q_sut)), u3_nul);
u3_noun ret;
ret = u3qzu_rest(van, sut, old);
u3z(old);
return ret;
}
}
}
}
u3_noun
u3wzu_repo(u3_noun cor)
{
u3_noun sut;
if ( u3_none == (sut = u3r_at(u3x_sam, cor)) ) {
return u3m_bail(c3__fail);
} else {
return u3qzu_repo(cor, sut);
}
}

114
jets/z/ut_rest.c Normal file
View File

@ -0,0 +1,114 @@
/* j/6/ut_rest.c
**
*/
#include "all.h"
/* logic
*/
static u3_noun
_rest_in_list(u3_noun van,
u3_noun leg)
{
if ( u3_nul == leg ) {
return u3_nul;
} else {
u3_noun i_leg = u3h(leg);
u3_noun t_leg = u3t(leg);
return u3nc(u3qzu_play(van, u3h(i_leg), u3t(i_leg)),
_rest_in_list(van, t_leg));
}
}
static u3_noun
_rest_in_stil(u3_noun van,
u3_noun gar)
{
u3_noun gun = u3qdi_gas(u3_nul, gar);
u3_noun yed = u3qdi_tap(gun);
u3z(gun);
return yed;
}
static u3_noun
_rest_in(u3_noun van,
u3_noun leg)
{
u3_noun gar = _rest_in_list(van, leg);
u3_noun yed = _rest_in_stil(van, gar);
u3_noun fub = u3qz_fork(yed);
u3z(gar);
u3z(yed);
return fub;
}
static u3_noun
_rest_hit_fan(u3_noun fan,
u3_noun leg)
{
if ( u3_nul == leg ) {
return c3n;
} else {
return c3o(u3qdi_has(fan, u3h(leg)),
_rest_hit_fan(fan, u3t(leg)));
}
}
static u3_noun
_cqzu_rest(u3_noun van,
u3_noun sut,
u3_noun leg)
{
u3_noun fan = u3r_at(u3qzu_van_fan, van);
if ( c3y == _rest_hit_fan(fan, leg) ) {
return u3m_error("rest-loop");
}
else {
u3_noun naf = u3qdi_gas(fan, leg);
u3_noun nav = u3i_molt(u3k(van), u3qzu_van_fan, u3k(naf), 0);
u3_noun mez = _rest_in(nav, leg);
u3z(naf);
u3z(nav);
return mez;
}
}
/* boilerplate
*/
u3_noun
u3wzu_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 _cqzu_rest(van, sut, leg);
}
}
u3_noun
u3qzu_rest(u3_noun van,
u3_noun sut,
u3_noun leg)
{
c3_m fun_m = 144 + c3__rest + ((!!u3r_at(u3qzu_van_vet, van)) << 8);
u3_noun pro = u3z_find_2(fun_m, sut, leg);
if ( u3_none != pro ) {
return pro;
}
else {
pro = _cqzu_rest(van, sut, leg);
return u3z_save_2(fun_m, sut, leg, pro);
}
}

21
jets/z/ut_tack.c Normal file
View File

@ -0,0 +1,21 @@
/* j/6/tack.c
**
*/
#include "all.h"
u3_noun
u3qzu_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));
}

97
jets/z/ut_toss.c Normal file
View File

@ -0,0 +1,97 @@
/* j/6/toss.c
**
*/
#include "all.h"
/* internals
*/
static u3_noun
_toss_in(u3_noun van,
u3_noun sut,
u3_noun peh,
u3_noun mur,
u3_noun men)
{
if ( c3n == u3du(men) ) {
return u3nc(u3_nul, u3_nul);
}
else {
u3_noun i_men = u3h(men);
u3_noun pi_men = u3h(i_men);
u3_noun qi_men = u3t(i_men);
u3_noun t_men = u3t(men);
u3_noun geq = u3qzu_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
_cqzu_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
u3wzu_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 _cqzu_toss(van, sut, peh, mur, men);
}
}
u3_noun
u3qzu_toss(u3_noun van,
u3_noun sut,
u3_noun peh,
u3_noun mur,
u3_noun men)
{
return _cqzu_toss(van, sut, peh, mur, men);
}

93
jets/z/ut_wrap.c Normal file
View File

@ -0,0 +1,93 @@
/* j/6/wrap.c
**
*/
#include "all.h"
static u3_noun _cqzu_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(_cqzu_wrap(van, u3h(p_sut), yoz),
_wrap_fork(van, u3t(p_sut), yoz));
}
}
static u3_noun
_cqzu_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 = u3qdi_tap(p_sut);
u3_noun ret = u3kf_fork(_wrap_fork(van, yed, yoz));
u3z(yed);
return ret;
}
case c3__hold:
{
u3_noun fop = u3qzu_repo(van, sut);
u3_noun pro = _cqzu_wrap(van, fop, yoz);
u3z(fop);
return pro;
}
}
}
/* boilerplate
*/
u3_noun
u3wzu_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 _cqzu_wrap(van, sut, yoz);
}
}
u3_noun
u3qzu_wrap(u3_noun van,
u3_noun sut,
u3_noun yoz)
{
return _cqzu_wrap(van, sut, yoz);
}

View File

@ -127,8 +127,8 @@ jets_e_ed_src = [
'jets/e/ed_sign.c',
'jets/e/ed_veri.c',
'jets/e/ed_shar.c'
]
jets_f_src = [
'jets/f/ap.c',
'jets/f/cell.c',
@ -171,6 +171,48 @@ jets_f_ut_src = [
'jets/f/ut_wrap.c'
]
jets_z_src = [
'jets/z/ap.c',
'jets/z/cell.c',
'jets/z/comb.c',
'jets/z/cons.c',
'jets/z/core.c',
'jets/z/face.c',
'jets/z/fitz.c',
'jets/z/flan.c',
'jets/z/flip.c',
'jets/z/flor.c',
'jets/z/fork.c',
'jets/z/hint.c',
'jets/z/hike.c',
'jets/z/look.c',
'jets/z/loot.c'
]
jets_z_ut_src = [
'jets/z/ut.c',
'jets/z/ut_buss.c',
'jets/z/ut_conk.c',
'jets/z/ut_crop.c',
'jets/z/ut_find.c',
'jets/z/ut_fire.c',
'jets/z/ut_fish.c',
'jets/z/ut_fuse.c',
'jets/z/ut_gain.c',
'jets/z/ut_lose.c',
'jets/z/ut_mint.c',
'jets/z/ut_mull.c',
'jets/z/ut_nest.c',
'jets/z/ut_peek.c',
'jets/z/ut_peel.c',
'jets/z/ut_play.c',
'jets/z/ut_repo.c',
'jets/z/ut_rest.c',
'jets/z/ut_tack.c',
'jets/z/ut_toss.c',
'jets/z/ut_wrap.c'
]
jets_g_src = [
'jets/g/down.c'
]
@ -210,7 +252,9 @@ src_list = [
vere_src, noun_src,
jets_a_src, jets_b_src,
jets_c_src, jets_d_src,
jets_e_src, jets_e_ed_src, jets_f_src, jets_f_ut_src,
jets_e_src, jets_e_ed_src,
jets_f_src, jets_f_ut_src,
jets_z_src, jets_z_ut_src,
jets_g_src, jets_src]
sources = []