Convert tier 5 to new noun layer.

This commit is contained in:
C. Guy Yarvin 2014-08-20 02:22:41 -04:00
parent 25cd41d204
commit f06ba7242a
24 changed files with 794 additions and 824 deletions

View File

@ -334,7 +334,8 @@ $(BIN)/meme: f/meme.o \
$(J164_1_OFILES) \ $(J164_1_OFILES) \
$(J164_2_OFILES) \ $(J164_2_OFILES) \
$(J164_3_OFILES) \ $(J164_3_OFILES) \
$(J164_4_OFILES) $(J164_4_OFILES) \
$(J164_5_OFILES)
$(CC) -g $< -lgmp -o $@ $(CC) -g $< -lgmp -o $@
tags: tags:

View File

@ -19,7 +19,7 @@
/* functions /* functions
*/ */
u2_weak u2_weak
j2_mcd(Pt5, aesc, en)(u2_wire wir_r, j2_mcd(Pt5, aesc, en)(
u2_atom a, u2_atom a,
u2_atom b) u2_atom b)
{ {
@ -42,12 +42,12 @@
kCCOptionECBMode, a_y, kCCKeySizeAES256, 0, b_y, kCCOptionECBMode, a_y, kCCKeySizeAES256, 0, b_y,
16, b_y, 16, &siz_i) ) 16, b_y, 16, &siz_i) )
{ {
return u2_bl_bail(wir_r, c3__exit); return u2_cm_bail(c3__exit);
} }
else c3_assert(16 == siz_i); else c3_assert(16 == siz_i);
#else #else
if ( 0 != AES_set_encrypt_key(a_y, 256, &key_u) ) { if ( 0 != AES_set_encrypt_key(a_y, 256, &key_u) ) {
return u2_bl_bail(wir_r, c3__exit); return u2_cm_bail(c3__exit);
} }
else { else {
AES_encrypt(b_y, b_y, &key_u); AES_encrypt(b_y, b_y, &key_u);
@ -58,24 +58,24 @@
} }
u2_weak u2_weak
j2_mc(Pt5, aesc, en)(u2_wire wir_r, j2_mc(Pt5, aesc, en)(
u2_noun cor) u2_noun cor)
{ {
u2_noun a, b; u2_noun a, b;
if ( u2_no == u2_mean(cor, u2_cv_sam_2, &a, u2_cv_sam_3, &b, 0) || if ( u2_no == u2_cr_mean(cor, u2_cv_sam_2, &a, u2_cv_sam_3, &b, 0) ||
u2_no == u2_stud(a) || u2_no == u2ud(a) ||
u2_no == u2_stud(b) ) u2_no == u2ud(b) )
{ {
return u2_bl_bail(wir_r, c3__exit); return u2_cm_bail(c3__exit);
} }
else { else {
return j2_mcd(Pt5, aesc, en)(wir_r, a, b); return j2_mcd(Pt5, aesc, en)(a, b);
} }
} }
u2_weak u2_weak
j2_mcd(Pt5, aesc, de)(u2_wire wir_r, j2_mcd(Pt5, aesc, de)(
u2_atom a, u2_atom a,
u2_atom b) u2_atom b)
{ {
@ -98,12 +98,12 @@
kCCOptionECBMode, a_y, kCCKeySizeAES256, 0, b_y, kCCOptionECBMode, a_y, kCCKeySizeAES256, 0, b_y,
16, b_y, 16, &siz_i) ) 16, b_y, 16, &siz_i) )
{ {
return u2_bl_bail(wir_r, c3__exit); return u2_cm_bail(c3__exit);
} }
else c3_assert(16 == siz_i); else c3_assert(16 == siz_i);
#else #else
if ( 0 != AES_set_decrypt_key(a_y, 256, &key_u) ) { if ( 0 != AES_set_decrypt_key(a_y, 256, &key_u) ) {
return u2_bl_bail(wir_r, c3__exit); return u2_cm_bail(c3__exit);
} }
else { else {
AES_decrypt(b_y, b_y, &key_u); AES_decrypt(b_y, b_y, &key_u);
@ -114,19 +114,19 @@
} }
u2_weak u2_weak
j2_mc(Pt5, aesc, de)(u2_wire wir_r, j2_mc(Pt5, aesc, de)(
u2_noun cor) u2_noun cor)
{ {
u2_noun a, b; u2_noun a, b;
if ( u2_no == u2_mean(cor, u2_cv_sam_2, &a, u2_cv_sam_3, &b, 0) || if ( u2_no == u2_cr_mean(cor, u2_cv_sam_2, &a, u2_cv_sam_3, &b, 0) ||
u2_no == u2_stud(a) || u2_no == u2ud(a) ||
u2_no == u2_stud(b) ) u2_no == u2ud(b) )
{ {
return u2_bl_bail(wir_r, c3__exit); return u2_cm_bail(c3__exit);
} }
else { else {
return j2_mcd(Pt5, aesc, de)(wir_r, a, b); return j2_mcd(Pt5, aesc, de)(a, b);
} }
} }

View File

@ -14,7 +14,7 @@
*/ */
u2_weak u2_weak
j2_md(Pt5, coco, co, emco)(u2_wire wir_r, j2_md(Pt5, coco, co, emco)(
u2_noun cor) u2_noun cor)
{ {
u2_atom bas, min; u2_atom bas, min;
@ -23,13 +23,13 @@
u2_atom hol = 0; u2_atom hol = 0;
mpz_t bas_mp, dar_mp, hol_mp, rad_mp; mpz_t bas_mp, dar_mp, hol_mp, rad_mp;
if ( u2_no == u2_mean(cor, u2_cv_sam_4, &bas, if ( u2_no == u2_cr_mean(cor, u2_cv_sam_4, &bas,
u2_cv_sam_5, &min, u2_cv_sam_5, &min,
u2_cv_sam_3, &par, u2_cv_sam_3, &par,
u2_cv_sam_6, &rex, u2_cv_sam_6, &rex,
0) ) 0) )
{ {
return u2_bl_bail(wir_r, c3__exit); return u2_cm_bail(c3__exit);
} }
while ( 1 ) { while ( 1 ) {
@ -37,8 +37,8 @@
return rex; return rex;
} }
u2_mp(bas_mp, bas); u2_cr_mp(bas_mp, bas);
u2_mp(hol_mp, hol); u2_cr_mp(hol_mp, hol);
mpz_tdiv_q(rad_mp, hol_mp, bas_mp); mpz_tdiv_q(rad_mp, hol_mp, bas_mp);
mpz_tdiv_r(dar_mp, hol_mp, bas_mp); mpz_tdiv_r(dar_mp, hol_mp, bas_mp);
@ -47,7 +47,7 @@
min--; min--;
} }
u2_rl_mp(hol, dar_mp); u2_ci_mp(hol, dar_mp);
// rex (par =(0 dar) rad rex) // rex (par =(0 dar) rad rex)
} }

View File

@ -9,17 +9,17 @@
/* functions /* functions
*/ */
u2_weak u2_weak
j2_md(Pt5, coco, co, oxco)(u2_wire wir_r, j2_md(Pt5, coco, co, oxco)(
u2_noun cor) u2_noun cor)
{ {
u2_atom bas, gop; u2_atom bas, gop;
u2_noun dug; u2_noun dug;
if ( u2_no == u2_mean(cor, u2_cv_sam_4, &bas, if ( u2_no == u2_cr_mean(cor, u2_cv_sam_4, &bas,
u2_cv_sam_5, &gop, u2_cv_sam_5, &gop,
u2_cv_sam_3, &dug, u2_cv_sam_3, &dug,
0) ) 0) )
{ {
return u2_bl_bail(wir_r, c3__exit); return u2_cm_bail(c3__exit);
} }
return 0; return 0;

View File

@ -9,7 +9,7 @@
/* functions /* functions
*/ */
u2_weak u2_weak
j2_md(Pt5, coco, co, roco)(u2_wire wir_r, j2_md(Pt5, coco, co, roco)(
u2_noun cor) u2_noun cor)
{ {
/* tree axes */ /* tree axes */
@ -18,12 +18,12 @@
/* dop => 11 */ /* dop => 11 */
/* dug => 3 */ /* dug => 3 */
/* if ( u2_no == u2_mean(cor, u2_cv_sam_4, &bas, */ /* if ( u2_no == u2_cr_mean(cor, u2_cv_sam_4, &bas, */
/* u2_cv_sam_5, &min, */ /* u2_cv_sam_5, &min, */
/* u2_cv_sam_3, &par, */ /* u2_cv_sam_3, &par, */
/* 0) ) */ /* 0) ) */
/* { */ /* { */
/* return u2_bl_bail(wir_r, c3__exit); */ /* return u2_cm_bail(c3__exit); */
/* } */ /* } */
return 0; return 0;

View File

@ -11,89 +11,89 @@
struct u2_nash* T_r; struct u2_nash* T_r;
static u2_noun // produce static u2_noun // produce
_cue_in(u2_wire wir_r, _cue_in(
u2_atom a, // retain u2_atom a, // retain
u2_atom b) // retain u2_atom b) // retain
{ {
u2_noun p, q; u2_noun p, q;
if ( _0 == j2_mbc(Pt3, cut)(wir_r, 0, b, 1, a) ) { if ( 0 == j2_mbc(Pt3, cut)(0, b, 1, a) ) {
u2_noun x = j2_mbc(Pt1, inc)(wir_r, b); u2_noun x = j2_mbc(Pt1, inc)(b);
u2_noun c = j2_mby(Pt5, rub)(wir_r, x, a); u2_noun c = j2_mby(Pt5, rub)(x, a);
p = j2_mbc(Pt1, inc)(wir_r, u2_h(c)); p = j2_mbc(Pt1, inc)(u2h(c));
q = u2_rx(wir_r, u2_t(c)); q = u2k(u2t(c));
u2_na_put(T_r, b, (void*)(c3_p)q); u2_na_put(T_r, b, (void*)(c3_p)q);
u2_rz(wir_r, c); u2z(c);
u2_rz(wir_r, x); u2z(x);
} }
else { else {
u2_noun c = j2_mbc(Pt1, add)(wir_r, _2, b); u2_noun c = j2_mbc(Pt1, add)(2, b);
u2_noun l = j2_mbc(Pt1, inc)(wir_r, b); u2_noun l = j2_mbc(Pt1, inc)(b);
if ( _0 == j2_mbc(Pt3, cut)(wir_r, 0, l, 1, a) ) { if ( 0 == j2_mbc(Pt3, cut)(0, l, 1, a) ) {
u2_noun u, v, w; u2_noun u, v, w;
u2_noun x, y; u2_noun x, y;
u = _cue_in(wir_r, a, c); u = _cue_in(a, c);
x = j2_mbc(Pt1, add)(wir_r, u2_h(u), c); x = j2_mbc(Pt1, add)(u2h(u), c);
v = _cue_in(wir_r, a, x); v = _cue_in(a, x);
w = u2_bc(wir_r, u2_rx(wir_r, u2_h(u2_t(u))), w = u2nc(u2k(u2h(u2t(u))),
u2_rx(wir_r, u2_h(u2_t(v)))); u2k(u2h(u2t(v))));
y = j2_mbc(Pt1, add)(wir_r, u2_h(u), u2_h(v)); y = j2_mbc(Pt1, add)(u2h(u), u2h(v));
p = j2_mbc(Pt1, add)(wir_r, _2, y); p = j2_mbc(Pt1, add)(2, y);
q = w; q = w;
u2_na_put(T_r, b, (void*)(c3_p)q); u2_na_put(T_r, b, (void*)(c3_p)q);
u2_rz(wir_r, u); u2_rz(wir_r, v); u2_rz(wir_r, x); u2_rz(wir_r, y); u2z(u); u2z(v); u2z(x); u2z(y);
} }
else { else {
u2_noun d = j2_mby(Pt5, rub)(wir_r, c, a); u2_noun d = j2_mby(Pt5, rub)(c, a);
u2_noun x = u2_na_get(T_r, u2_t(d)); u2_noun x = u2_na_get(T_r, u2t(d));
p = j2_mbc(Pt1, add)(wir_r, _2, u2_h(d)); p = j2_mbc(Pt1, add)(2, u2h(d));
if ( u2_none == x ) { if ( u2_none == x ) {
return u2_bl_bail(wir_r, c3__exit); return u2_cm_bail(c3__exit);
} }
q = u2_rx(wir_r, x); q = u2k(x);
u2_rz(wir_r, d); u2z(d);
} }
u2_rz(wir_r, l); u2z(l);
u2_rz(wir_r, c); u2z(c);
} }
return u2_bt(wir_r, p, q, 0); return u2nt(p, q, 0);
} }
u2_noun // transfer u2_noun // transfer
j2_mby(Pt5, cue)(u2_wire wir_r, j2_mby(Pt5, cue)(
u2_atom a) // retain u2_atom a) // retain
{ {
T_r = u2_na_make(); T_r = u2_na_make();
u2_noun x = _cue_in(wir_r, a, _0); u2_noun x = _cue_in(a, 0);
u2_noun y = u2_rx(wir_r, u2_h(u2_t(x))); u2_noun y = u2k(u2h(u2t(x)));
u2_na_take(T_r); u2_na_take(T_r);
T_r = 0; T_r = 0;
u2_rz(wir_r, x); u2z(x);
return y; return y;
} }
u2_noun // transfer u2_noun // transfer
j2_mb(Pt5, cue)(u2_wire wir_r, j2_mb(Pt5, cue)(
u2_noun cor) // retain u2_noun cor) // retain
{ {
u2_noun a; u2_noun a;
if ( (u2_none == (a = u2_frag(u2_cv_sam, cor))) ) { if ( (u2_none == (a = u2_cr_at(u2_cv_sam, cor))) ) {
return u2_bl_bail(wir_r, c3__fail); return u2_cm_bail(c3__fail);
} else { } else {
return j2_mby(Pt5, cue)(wir_r, a); return j2_mby(Pt5, cue)(a);
} }
} }

View File

@ -10,22 +10,22 @@
/* functions /* functions
*/ */
u2_weak u2_weak
j2_md(Pt5, coed, ed, puck)(u2_wire wir_r, j2_md(Pt5, coed, ed, puck)(
u2_noun cor) u2_noun cor)
{ {
c3_y pub_y[32]; c3_y pub_y[32];
c3_y sec_y[64]; c3_y sec_y[64];
c3_y sed_y[32]; c3_y sed_y[32];
c3_w met_w; c3_w met_w;
u2_noun a = u2_frag(u2_cv_sam, cor); u2_noun a = u2_cr_at(u2_cv_sam, cor);
if ( (u2_none == a) || (u2_no == u2_stud(a)) ) { if ( (u2_none == a) || (u2_no == u2ud(a)) ) {
return u2_bl_bail(wir_r, c3__exit); return u2_cm_bail(c3__exit);
} }
met_w = u2_met(3, a); met_w = u2_cr_met(3, a);
if ( met_w > 32 ) { if ( met_w > 32 ) {
return u2_bl_bail(wir_r, c3__exit); return u2_cm_bail(c3__exit);
} }
memset(sed_y, 0, 32); memset(sed_y, 0, 32);

View File

@ -10,7 +10,7 @@
/* functions /* functions
*/ */
u2_weak // transfer u2_weak // transfer
j2_mcc(Pt5, ed, sign)(u2_wire wir_r, j2_mcc(Pt5, ed, sign)(
u2_noun a, // retain u2_noun a, // retain
u2_noun b) // retain u2_noun b) // retain
{ {
@ -19,8 +19,8 @@
c3_y pub_y[64]; c3_y pub_y[64];
c3_y sec_y[64]; c3_y sec_y[64];
c3_w mesm_w = u2_met(3, a); c3_w mesm_w = u2_cr_met(3, a);
c3_w mess_w = u2_met(3, b); c3_w mess_w = u2_cr_met(3, b);
c3_y* mes_y = 0; c3_y* mes_y = 0;
@ -40,15 +40,15 @@
return u2_ci_bytes(64, sig_y); return u2_ci_bytes(64, sig_y);
} }
u2_weak u2_weak
j2_md(Pt5, coed, ed, sign)(u2_wire wir_r, j2_md(Pt5, coed, ed, sign)(
u2_noun cor) u2_noun cor)
{ {
u2_noun a, b; u2_noun a, b;
if ( u2_no == u2_mean(cor, if ( u2_no == u2_cr_mean(cor,
u2_cv_sam_2, &a, u2_cv_sam_3, &b, 0) ) { u2_cv_sam_2, &a, u2_cv_sam_3, &b, 0) ) {
return u2_bl_bail(wir_r, c3__fail); return u2_cm_bail(c3__fail);
} else { } else {
return j2_mcc(Pt5, ed, sign)(wir_r, a, b); return j2_mcc(Pt5, ed, sign)(a, b);
} }
} }
/* structures /* structures

View File

@ -10,7 +10,7 @@
/* functions /* functions
*/ */
u2_weak u2_weak
j2_mdc(Pt5, coed, ed, veri)(u2_wire wir_r, j2_mdc(Pt5, coed, ed, veri)(
u2_noun s, u2_noun s,
u2_noun m, u2_noun m,
u2_noun pk) u2_noun pk)
@ -20,7 +20,7 @@
c3_w ret; c3_w ret;
c3_y* mes_y; c3_y* mes_y;
c3_w mesm_w = u2_met(3, m); c3_w mesm_w = u2_cr_met(3, m);
memset(sig_y, 0, 64); memset(sig_y, 0, 64);
memset(pub_y, 0, 32); memset(pub_y, 0, 32);
@ -36,16 +36,16 @@
return ret; return ret;
} }
u2_weak u2_weak
j2_md(Pt5, coed, ed, veri)(u2_wire wir_r, j2_md(Pt5, coed, ed, veri)(
u2_noun cor) u2_noun cor)
{ {
u2_noun a, b, c; u2_noun a, b, c;
if ( u2_no == u2_mean(cor, if ( u2_no == u2_cr_mean(cor,
u2_cv_sam_2, &a, u2_cv_sam_6, &b, u2_cv_sam_2, &a, u2_cv_sam_6, &b,
u2_cv_sam_7, &c, 0) ) { u2_cv_sam_7, &c, 0) ) {
return u2_bl_bail(wir_r, c3__fail); return u2_cm_bail(c3__fail);
} else { } else {
return j2_mdc(Pt5, coed, ed, veri)(wir_r, a, b, c); return j2_mdc(Pt5, coed, ed, veri)(a, b, c);
} }
} }

View File

@ -9,90 +9,90 @@
*/ */
struct u2_nash* T_m; struct u2_nash* T_m;
static u2_noun static u2_noun
_jam_in(u2_wire, u2_atom, u2_atom, u2_noun); _jam_in(u2_atom, u2_atom, u2_noun);
static u2_noun // produce static u2_noun // produce
_jam_in_pair(u2_wire wir_r, _jam_in_pair(
u2_atom h_a, // retain u2_atom h_a, // retain
u2_atom t_a, // retain u2_atom t_a, // retain
u2_atom b, // retain u2_atom b, // retain
u2_noun l) // retain u2_noun l) // retain
{ {
u2_noun w = u2_bc(wir_r, u2_bc(wir_r, _2, _1), u2_rx(wir_r, l)); u2_noun w = u2nc(u2nc(2, 1), u2k(l));
u2_noun x = j2_mbc(Pt1, add)(wir_r, _2, b); u2_noun x = j2_mbc(Pt1, add)(2, b);
u2_noun d = _jam_in(wir_r, h_a, x, w); u2_noun d = _jam_in(h_a, x, w);
u2_noun p_d, q_d, r_d; u2_noun p_d, q_d, r_d;
u2_noun r; u2_noun r;
u2_as_trel(d, &p_d, &q_d, &r_d); u2_cr_trel(d, &p_d, &q_d, &r_d);
{ {
u2_noun y = j2_mbc(Pt1, add)(wir_r, x, p_d); u2_noun y = j2_mbc(Pt1, add)(x, p_d);
u2_noun e = _jam_in(wir_r, t_a, y, q_d); u2_noun e = _jam_in(t_a, y, q_d);
u2_noun p_e, q_e, r_e; u2_noun p_e, q_e, r_e;
u2_as_trel(e, &p_e, &q_e, &r_e); u2_cr_trel(e, &p_e, &q_e, &r_e);
{ {
u2_noun z = j2_mbc(Pt1, add)(wir_r, p_d, p_e); u2_noun z = j2_mbc(Pt1, add)(p_d, p_e);
r = u2_bt r = u2nt
(wir_r, j2_mbc(Pt1, add)(wir_r, _2, z), (j2_mbc(Pt1, add)(2, z),
u2_rx(wir_r, q_e), u2k(q_e),
0); 0);
u2_rz(wir_r, z); u2z(z);
} }
u2_rz(wir_r, e); u2z(e);
u2_rz(wir_r, y); u2z(y);
} }
u2_rz(wir_r, d); u2z(d);
u2_rz(wir_r, x); u2z(x);
u2_rz(wir_r, w); u2z(w);
return r; return r;
} }
static u2_noun // produce static u2_noun // produce
_jam_in_flat(u2_wire wir_r, _jam_in_flat(
u2_atom a, // retain u2_atom a, // retain
u2_noun l) // retain u2_noun l) // retain
{ {
u2_noun d = j2_mby(Pt5, mat)(wir_r, a); u2_noun d = j2_mby(Pt5, mat)(a);
u2_noun x = j2_mbc(Pt1, add)(wir_r, _1, u2_h(d)); u2_noun x = j2_mbc(Pt1, add)(1, u2h(d));
u2_noun y = u2_bt u2_noun y = u2nt
(wir_r, u2_rx(wir_r, x), (u2k(x),
u2_bc(wir_r, u2_bc(wir_r, u2nc(u2nc(
x, x,
j2_mbc(Pt3, lsh)(wir_r, _0, _1, u2_t(d))), j2_mbc(Pt3, lsh)(0, 1, u2t(d))),
u2_rx(wir_r, l)), u2k(l)),
0); 0);
u2_rz(wir_r, d); u2z(d);
return y; return y;
} }
static u2_noun // produce static u2_noun // produce
_jam_in_ptr(u2_wire wir_r, _jam_in_ptr(
u2_atom u_c, // retain u2_atom u_c, // retain
u2_noun l) // retain u2_noun l) // retain
{ {
u2_noun d = j2_mby(Pt5, mat)(wir_r, u_c); u2_noun d = j2_mby(Pt5, mat)(u_c);
u2_atom x = j2_mbc(Pt3, lsh)(wir_r, _0, _2, u2_t(d)); u2_atom x = j2_mbc(Pt3, lsh)(0, 2, u2t(d));
u2_atom y = j2_mbc(Pt1, add)(wir_r, _2, u2_h(d)); u2_atom y = j2_mbc(Pt1, add)(2, u2h(d));
u2_noun z = u2_bt u2_noun z = u2nt
(wir_r, u2_rx(wir_r, y), (u2k(y),
u2_bc(wir_r, u2_bc(wir_r, y, j2_mbc(Pt3, mix)(wir_r, _3, x)), u2nc(u2nc(y, j2_mbc(Pt3, mix)(3, x)),
u2_rx(wir_r, l)), u2k(l)),
0); 0);
u2_rz(wir_r, d); u2z(d);
u2_rz(wir_r, x); u2z(x);
return z; return z;
} }
static u2_noun // produce static u2_noun // produce
_jam_in(u2_wire wir_r, _jam_in(
u2_noun a, // retain u2_noun a, // retain
u2_atom b, // retain u2_atom b, // retain
u2_noun l) // retain u2_noun l) // retain
@ -103,48 +103,48 @@
if ( u2_none == c ) { if ( u2_none == c ) {
u2_na_put(T_m, a, (void*)(c3_p)b); u2_na_put(T_m, a, (void*)(c3_p)b);
if ( u2_yes == u2_stud(a) ) { if ( u2_yes == u2ud(a) ) {
x = _jam_in_flat(wir_r, a, l); x = _jam_in_flat(a, l);
} else { } else {
x = _jam_in_pair(wir_r, u2_h(a), u2_t(a), b, l); x = _jam_in_pair(u2h(a), u2t(a), b, l);
} }
} }
else { else {
if ( u2_yes == u2_stud(a) && u2_met(0, a) <= u2_met(0, c) ) { if ( u2_yes == u2ud(a) && u2_cr_met(0, a) <= u2_cr_met(0, c) ) {
x = _jam_in_flat(wir_r, a, l); x = _jam_in_flat(a, l);
} }
else { else {
x = _jam_in_ptr(wir_r, c, l); x = _jam_in_ptr(c, l);
} }
} }
return x; return x;
} }
u2_noun // transfer u2_noun // transfer
j2_mby(Pt5, jam)(u2_wire wir_r, j2_mby(Pt5, jam)(
u2_atom a) // retain u2_atom a) // retain
{ {
T_m = u2_na_make(); T_m = u2_na_make();
u2_noun x = _jam_in(wir_r, a, _0, u2_nul); u2_noun x = _jam_in(a, 0, u2_nul);
u2_noun q = j2_mbc(Pt2, flop)(wir_r, u2_h(u2_t(x))); u2_noun q = j2_mbc(Pt2, flop)(u2h(u2t(x)));
u2_noun r = j2_mbc(Pt3, can)(wir_r, _0, q); u2_noun r = j2_mbc(Pt3, can)(0, q);
u2_rz(wir_r, x); u2z(x);
u2_rz(wir_r, q); u2z(q);
u2_na_take(T_m); u2_na_take(T_m);
T_m = NULL; T_m = NULL;
return r; return r;
} }
u2_noun // transfer u2_noun // transfer
j2_mb(Pt5, jam)(u2_wire wir_r, j2_mb(Pt5, jam)(
u2_noun cor) // retain u2_noun cor) // retain
{ {
u2_noun a; u2_noun a;
if ( (u2_none == (a = u2_frag(u2_cv_sam, cor))) ) { if ( (u2_none == (a = u2_cr_at(u2_cv_sam, cor))) ) {
return u2_bl_bail(wir_r, c3__fail); return u2_cm_bail(c3__fail);
} else { } else {
return j2_mby(Pt5, jam)(wir_r, a); return j2_mby(Pt5, jam)(a);
} }
} }

View File

@ -6,7 +6,7 @@
#include "../pit.h" #include "../pit.h"
u2_noun // produce u2_noun // produce
j2_mbc(Pt5, lore)(u2_wire wir_r, j2_mbc(Pt5, lore)(
u2_atom lub) // retain u2_atom lub) // retain
{ {
c3_w len_w = u2_cr_met(3, lub); c3_w len_w = u2_cr_met(3, lub);
@ -23,7 +23,7 @@
c3_y byt_y; c3_y byt_y;
while ( 1 ) { while ( 1 ) {
byt_y = u2_byte(pos_w + meg_w, lub); byt_y = u2_cr_byte(pos_w + meg_w, lub);
if ( (10 == byt_y) || (0 == byt_y) ) { if ( (10 == byt_y) || (0 == byt_y) ) {
break; break;
@ -31,13 +31,13 @@
} }
if ((byt_y == 0) && ((pos_w + meg_w + 1) < len_w)) { if ((byt_y == 0) && ((pos_w + meg_w + 1) < len_w)) {
return u2_bl_bail(wir_r, c3__exit); return u2_cm_bail(c3__exit);
} }
{ {
c3_y* byts_y = alloca(meg_w); c3_y* byts_y = alloca(meg_w);
u2_bytes(pos_w, meg_w, byts_y, lub); u2_cr_bytes(pos_w, meg_w, byts_y, lub);
tez = u2nc(u2_ci_bytes(meg_w, byts_y), tez); tez = u2nc(u2_ci_bytes(meg_w, byts_y), tez);
pos_w += (meg_w + 1); pos_w += (meg_w + 1);
} }
@ -46,17 +46,17 @@
} }
u2_weak // produce u2_weak // produce
j2_mb(Pt5, lore)(u2_wire wir_r, j2_mb(Pt5, lore)(
u2_noun cor) // retain u2_noun cor) // retain
{ {
u2_noun lub; u2_noun lub;
if ( (u2_none == (lub = u2_frag(u2_cv_sam, cor))) || if ( (u2_none == (lub = u2_cr_at(u2_cv_sam, cor))) ||
(u2_no == u2ud(lub)) ) (u2_no == u2ud(lub)) )
{ {
return u2_bl_bail(wir_r, c3__fail); return u2_cm_bail(c3__fail);
} else { } else {
return j2_mbc(Pt5, lore)(wir_r, lub); return j2_mbc(Pt5, lore)(lub);
} }
} }

View File

@ -256,7 +256,7 @@
} }
u2_noun // produce u2_noun // produce
j2_mbc(Pt5, loss)(u2_wire wir_r, j2_mbc(Pt5, loss)(
u2_noun hel, // retain u2_noun hel, // retain
u2_noun hev) // retain u2_noun hev) // retain
{ {
@ -282,19 +282,19 @@
} }
u2_weak // produce u2_weak // produce
j2_mb(Pt5, loss)(u2_wire wir_r, j2_mb(Pt5, loss)(
u2_noun cor) // retain u2_noun cor) // retain
{ {
u2_noun hel, hev; u2_noun hel, hev;
if ( (u2_none == (hel = u2_frag(u2_cv_sam_2, cor))) || if ( (u2_none == (hel = u2_cr_at(u2_cv_sam_2, cor))) ||
(u2_none == (hev = u2_frag(u2_cv_sam_3, cor))) || (u2_none == (hev = u2_cr_at(u2_cv_sam_3, cor))) ||
(u2_no == _listp(hel)) || (u2_no == _listp(hel)) ||
(u2_no == _listp(hev)) ) (u2_no == _listp(hev)) )
{ {
return u2_bl_bail(wir_r, c3__fail); return u2_cm_bail(c3__fail);
} else { } else {
return j2_mbc(Pt5, loss)(wir_r, hel, hev); return j2_mbc(Pt5, loss)(hel, hev);
} }
} }

View File

@ -8,47 +8,47 @@
/* functions /* functions
*/ */
u2_noun // produce u2_noun // produce
j2_mby(Pt5, mat)(u2_wire wir_r, j2_mby(Pt5, mat)(
u2_atom a) // retain u2_atom a) // retain
{ {
if ( _0 == a ) { if ( 0 == a ) {
return u2_bc(wir_r, 1, 1); return u2nc(1, 1);
} else { } else {
u2_atom b = j2_mbc(Pt3, met)(wir_r, 0, a); u2_atom b = j2_mbc(Pt3, met)(0, a);
u2_atom c = j2_mbc(Pt3, met)(wir_r, 0, b); u2_atom c = j2_mbc(Pt3, met)(0, b);
u2_atom u, v, w, x, y, z; u2_atom u, v, w, x, y, z;
u2_atom p, q; u2_atom p, q;
u = j2_mbc(Pt1, dec)(wir_r, c); u = j2_mbc(Pt1, dec)(c);
v = j2_mbc(Pt1, add)(wir_r, c, c); v = j2_mbc(Pt1, add)(c, c);
w = j2_mbc(Pt3, bex)(wir_r, c); w = j2_mbc(Pt3, bex)(c);
x = j2_mbc(Pt3, end)(wir_r, _0, u, b); x = j2_mbc(Pt3, end)(0, u, b);
y = j2_mbc(Pt3, lsh)(wir_r, _0, u, a); y = j2_mbc(Pt3, lsh)(0, u, a);
z = j2_mbc(Pt3, mix)(wir_r, x, y); z = j2_mbc(Pt3, mix)(x, y);
p = j2_mbc(Pt1, add)(wir_r, v, b); p = j2_mbc(Pt1, add)(v, b);
q = j2_mbc(Pt3, cat)(wir_r, _0, w, z); q = j2_mbc(Pt3, cat)(0, w, z);
u2_rz(wir_r, u); u2z(u);
u2_rz(wir_r, v); u2z(v);
u2_rz(wir_r, w); u2z(w);
u2_rz(wir_r, x); u2z(x);
u2_rz(wir_r, y); u2z(y);
u2_rz(wir_r, z); u2z(z);
return u2_bc(wir_r, p, q); return u2nc(p, q);
} }
} }
u2_noun // transfer u2_noun // transfer
j2_mb(Pt5, mat)(u2_wire wir_r, j2_mb(Pt5, mat)(
u2_noun cor) // retain u2_noun cor) // retain
{ {
u2_noun a; u2_noun a;
if ( (u2_none == (a = u2_frag(u2_cv_sam, cor))) ) { if ( (u2_none == (a = u2_cr_at(u2_cv_sam, cor))) ) {
return u2_bl_bail(wir_r, c3__fail); return u2_cm_bail(c3__fail);
} else { } else {
return j2_mby(Pt5, mat)(wir_r, a); return j2_mby(Pt5, mat)(a);
} }
} }

View File

@ -6,20 +6,20 @@
#include "../pit.h" #include "../pit.h"
u2_weak // produce u2_weak // produce
j2_mb(Pt5, mink)(u2_wire wir_r, j2_mb(Pt5, mink)(
u2_noun cor) // retain u2_noun cor) // retain
{ {
u2_noun bus, fol, fly; u2_noun bus, fol, fly;
if ( u2_no == u2_mean(cor, u2_cv_sam_4, &bus, if ( u2_no == u2_cr_mean(cor, u2_cv_sam_4, &bus,
u2_cv_sam_5, &fol, u2_cv_sam_5, &fol,
u2_cv_sam_3, &fly, u2_cv_sam_3, &fly,
0) ) 0) )
{ {
return u2_bl_bail(wir_r, c3__exit); return u2_cm_bail(c3__exit);
} }
else { else {
return u2_cn_mink(u2k(bus), u2k(fol), u2k(fly)); return u2_cn_nock_in(u2k(bus), u2k(fol), u2k(fly));
} }
} }

View File

@ -1,4 +1,4 @@
/* j/5/mink.c /* j/5/mule.c
** **
** This file is in the public domain. ** This file is in the public domain.
*/ */
@ -6,21 +6,21 @@
#include "../pit.h" #include "../pit.h"
u2_weak // produce u2_weak // produce
j2_mb(Pt5, mule)(u2_wire wir_r, j2_mb(Pt5, mule)(u2_noun cor) // retain
u2_noun cor) // retain
{ {
u2_noun tap; u2_noun tap;
if ( u2_no == u2_mean(cor, u2_cv_sam, &tap, 0) ) { if ( u2_no == u2_cr_mean(cor, u2_cv_sam, &tap, 0) ) {
return u2_bl_bail(wir_r, c3__exit); return u2_cm_bail(c3__exit);
} }
else { else {
u2_noun hok = u2_bn_hook(wir_r, cor, "mute"); u2_noun hok = u2_cn_hook(u2k(cor), "mute");
/* this takes advantage of the fact that mute's result, at the typeless /* this takes advantage of the fact that mute's result, at the typeless
* C/Nock level, is identical to what a typed mule would produce, * C/Nock level, is identical to what a typed mule would produce,
* without running the formula twice. * without running the formula twice.
*/ */
return u2_bn_mong(wir_r, hok, u2k(tap));; return u2_cn_slam_on(hok, u2k(tap));;
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -27,279 +27,279 @@ union doub {
/* sun /* sun
*/ */
u2_weak u2_weak
j2_mcd(Pt5, rd, sun)(u2_wire wir_r, j2_mcd(Pt5, rd, sun)(
u2_atom a) u2_atom a)
{ {
union doub b; union doub b;
b.d = (double) u2_chub(0, a); b.d = (double) u2_cr_chub(0, a);
return u2_ci_chubs(1, &b.c); return u2_ci_chubs(1, &b.c);
} }
u2_weak u2_weak
j2_mc(Pt5, rd, sun)(u2_wire wir_r, j2_mc(Pt5, rd, sun)(
u2_noun cor) u2_noun cor)
{ {
u2_noun a; u2_noun a;
if (u2_no == u2_mean(cor, u2_cv_sam, &a, 0) if (u2_no == u2_cr_mean(cor, u2_cv_sam, &a, 0)
|| u2_no == u2_stud(a)) { || u2_no == u2ud(a)) {
return u2_bl_bail(wir_r, c3__exit); return u2_cm_bail(c3__exit);
} }
else { else {
return j2_mcd(Pt5, rd, sun)(wir_r, a); return j2_mcd(Pt5, rd, sun)(a);
} }
} }
/* mul /* mul
*/ */
u2_weak u2_weak
j2_mcd(Pt5, rd, mul)(u2_wire wir_r, j2_mcd(Pt5, rd, mul)(
u2_atom a, u2_atom a,
u2_atom b) u2_atom b)
{ {
union doub c, d, e; union doub c, d, e;
c.c = u2_chub(0, a); c.c = u2_cr_chub(0, a);
d.c = u2_chub(0, b); d.c = u2_cr_chub(0, b);
e.d = c.d * d.d; e.d = c.d * d.d;
return u2_ci_chubs(1, &e.c); return u2_ci_chubs(1, &e.c);
} }
u2_weak u2_weak
j2_mc(Pt5, rd, mul)(u2_wire wir_r, j2_mc(Pt5, rd, mul)(
u2_noun cor) u2_noun cor)
{ {
u2_noun a, b; u2_noun a, b;
if ( u2_no == u2_mean(cor, u2_cv_sam_2, &a, u2_cv_sam_3, &b, 0) || if ( u2_no == u2_cr_mean(cor, u2_cv_sam_2, &a, u2_cv_sam_3, &b, 0) ||
u2_no == u2_stud(a) || u2_no == u2ud(a) ||
u2_no == u2_stud(b) ) u2_no == u2ud(b) )
{ {
return u2_bl_bail(wir_r, c3__exit); return u2_cm_bail(c3__exit);
} }
else { else {
return j2_mcd(Pt5, rd, mul)(wir_r, a, b); return j2_mcd(Pt5, rd, mul)(a, b);
} }
} }
/* div /* div
*/ */
u2_weak u2_weak
j2_mcd(Pt5, rd, div)(u2_wire wir_r, j2_mcd(Pt5, rd, div)(
u2_atom a, u2_atom a,
u2_atom b) u2_atom b)
{ {
union doub c, d, e; union doub c, d, e;
c.c = u2_chub(0, a); c.c = u2_cr_chub(0, a);
d.c = u2_chub(0, b); d.c = u2_cr_chub(0, b);
e.d = c.d / d.d; e.d = c.d / d.d;
return u2_ci_chubs(1, &e.c); return u2_ci_chubs(1, &e.c);
} }
u2_weak u2_weak
j2_mc(Pt5, rd, div)(u2_wire wir_r, j2_mc(Pt5, rd, div)(
u2_noun cor) u2_noun cor)
{ {
u2_noun a, b; u2_noun a, b;
if ( u2_no == u2_mean(cor, u2_cv_sam_2, &a, u2_cv_sam_3, &b, 0) || if ( u2_no == u2_cr_mean(cor, u2_cv_sam_2, &a, u2_cv_sam_3, &b, 0) ||
u2_no == u2_stud(a) || u2_no == u2ud(a) ||
u2_no == u2_stud(b) ) u2_no == u2ud(b) )
{ {
return u2_bl_bail(wir_r, c3__exit); return u2_cm_bail(c3__exit);
} }
else { else {
return j2_mcd(Pt5, rd, div)(wir_r, a, b); return j2_mcd(Pt5, rd, div)(a, b);
} }
} }
/* add /* add
*/ */
u2_weak u2_weak
j2_mcd(Pt5, rd, add)(u2_wire wir_r, j2_mcd(Pt5, rd, add)(
u2_atom a, u2_atom a,
u2_atom b) u2_atom b)
{ {
union doub c, d, e; union doub c, d, e;
c.c = u2_chub(0, a); c.c = u2_cr_chub(0, a);
d.c = u2_chub(0, b); d.c = u2_cr_chub(0, b);
e.d = c.d + d.d; e.d = c.d + d.d;
return u2_ci_chubs(1, &e.c); return u2_ci_chubs(1, &e.c);
} }
u2_weak u2_weak
j2_mc(Pt5, rd, add)(u2_wire wir_r, j2_mc(Pt5, rd, add)(
u2_noun cor) u2_noun cor)
{ {
u2_noun a, b; u2_noun a, b;
if ( u2_no == u2_mean(cor, u2_cv_sam_2, &a, u2_cv_sam_3, &b, 0) || if ( u2_no == u2_cr_mean(cor, u2_cv_sam_2, &a, u2_cv_sam_3, &b, 0) ||
u2_no == u2_stud(a) || u2_no == u2ud(a) ||
u2_no == u2_stud(b) ) u2_no == u2ud(b) )
{ {
return u2_bl_bail(wir_r, c3__exit); return u2_cm_bail(c3__exit);
} }
else { else {
return j2_mcd(Pt5, rd, add)(wir_r, a, b); return j2_mcd(Pt5, rd, add)(a, b);
} }
} }
/* sub /* sub
*/ */
u2_weak u2_weak
j2_mcd(Pt5, rd, sub)(u2_wire wir_r, j2_mcd(Pt5, rd, sub)(
u2_atom a, u2_atom a,
u2_atom b) u2_atom b)
{ {
union doub c, d, e; union doub c, d, e;
c.c = u2_chub(0, a); c.c = u2_cr_chub(0, a);
d.c = u2_chub(0, b); d.c = u2_cr_chub(0, b);
e.d = c.d - d.d; e.d = c.d - d.d;
return u2_ci_chubs(1, &e.c); return u2_ci_chubs(1, &e.c);
} }
u2_weak u2_weak
j2_mc(Pt5, rd, sub)(u2_wire wir_r, j2_mc(Pt5, rd, sub)(
u2_noun cor) u2_noun cor)
{ {
u2_noun a, b; u2_noun a, b;
if ( u2_no == u2_mean(cor, u2_cv_sam_2, &a, u2_cv_sam_3, &b, 0) || if ( u2_no == u2_cr_mean(cor, u2_cv_sam_2, &a, u2_cv_sam_3, &b, 0) ||
u2_no == u2_stud(a) || u2_no == u2ud(a) ||
u2_no == u2_stud(b) ) u2_no == u2ud(b) )
{ {
return u2_bl_bail(wir_r, c3__exit); return u2_cm_bail(c3__exit);
} }
else { else {
return j2_mcd(Pt5, rd, sub)(wir_r, a, b); return j2_mcd(Pt5, rd, sub)(a, b);
} }
} }
/* lte /* lte
*/ */
u2_weak u2_weak
j2_mcd(Pt5, rd, lte)(u2_wire wir_r, j2_mcd(Pt5, rd, lte)(
u2_atom a, u2_atom a,
u2_atom b) u2_atom b)
{ {
union doub c, d; union doub c, d;
c.c = u2_chub(0, a); c.c = u2_cr_chub(0, a);
d.c = u2_chub(0, b); d.c = u2_cr_chub(0, b);
return u2_say(c.d <= d.d); return u2_say(c.d <= d.d);
} }
u2_weak u2_weak
j2_mc(Pt5, rd, lte)(u2_wire wir_r, j2_mc(Pt5, rd, lte)(
u2_noun cor) u2_noun cor)
{ {
u2_noun a, b; u2_noun a, b;
if ( u2_no == u2_mean(cor, u2_cv_sam_2, &a, u2_cv_sam_3, &b, 0) || if ( u2_no == u2_cr_mean(cor, u2_cv_sam_2, &a, u2_cv_sam_3, &b, 0) ||
u2_no == u2_stud(a) || u2_no == u2ud(a) ||
u2_no == u2_stud(b) ) u2_no == u2ud(b) )
{ {
return u2_bl_bail(wir_r, c3__exit); return u2_cm_bail(c3__exit);
} }
else { else {
return j2_mcd(Pt5, rd, lte)(wir_r, a, b); return j2_mcd(Pt5, rd, lte)(a, b);
} }
} }
/* lth /* lth
*/ */
u2_weak u2_weak
j2_mcd(Pt5, rd, lth)(u2_wire wir_r, j2_mcd(Pt5, rd, lth)(
u2_atom a, u2_atom a,
u2_atom b) u2_atom b)
{ {
union doub c, d; union doub c, d;
c.c = u2_chub(0, a); c.c = u2_cr_chub(0, a);
d.c = u2_chub(0, b); d.c = u2_cr_chub(0, b);
return u2_say(c.d < d.d); return u2_say(c.d < d.d);
} }
u2_weak u2_weak
j2_mc(Pt5, rd, lth)(u2_wire wir_r, j2_mc(Pt5, rd, lth)(
u2_noun cor) u2_noun cor)
{ {
u2_noun a, b; u2_noun a, b;
if ( u2_no == u2_mean(cor, u2_cv_sam_2, &a, u2_cv_sam_3, &b, 0) || if ( u2_no == u2_cr_mean(cor, u2_cv_sam_2, &a, u2_cv_sam_3, &b, 0) ||
u2_no == u2_stud(a) || u2_no == u2ud(a) ||
u2_no == u2_stud(b) ) u2_no == u2ud(b) )
{ {
return u2_bl_bail(wir_r, c3__exit); return u2_cm_bail(c3__exit);
} }
else { else {
return j2_mcd(Pt5, rd, lth)(wir_r, a, b); return j2_mcd(Pt5, rd, lth)(a, b);
} }
} }
/* gte /* gte
*/ */
u2_weak u2_weak
j2_mcd(Pt5, rd, gte)(u2_wire wir_r, j2_mcd(Pt5, rd, gte)(
u2_atom a, u2_atom a,
u2_atom b) u2_atom b)
{ {
union doub c, d; union doub c, d;
c.c = u2_chub(0, a); c.c = u2_cr_chub(0, a);
d.c = u2_chub(0, b); d.c = u2_cr_chub(0, b);
return u2_say(c.d >= d.d); return u2_say(c.d >= d.d);
} }
u2_weak u2_weak
j2_mc(Pt5, rd, gte)(u2_wire wir_r, j2_mc(Pt5, rd, gte)(
u2_noun cor) u2_noun cor)
{ {
u2_noun a, b; u2_noun a, b;
if ( u2_no == u2_mean(cor, u2_cv_sam_2, &a, u2_cv_sam_3, &b, 0) || if ( u2_no == u2_cr_mean(cor, u2_cv_sam_2, &a, u2_cv_sam_3, &b, 0) ||
u2_no == u2_stud(a) || u2_no == u2ud(a) ||
u2_no == u2_stud(b) ) u2_no == u2ud(b) )
{ {
return u2_bl_bail(wir_r, c3__exit); return u2_cm_bail(c3__exit);
} }
else { else {
return j2_mcd(Pt5, rd, gte)(wir_r, a, b); return j2_mcd(Pt5, rd, gte)(a, b);
} }
} }
/* gth /* gth
*/ */
u2_weak u2_weak
j2_mcd(Pt5, rd, gth)(u2_wire wir_r, j2_mcd(Pt5, rd, gth)(
u2_atom a, u2_atom a,
u2_atom b) u2_atom b)
{ {
union doub c, d; union doub c, d;
c.c = u2_chub(0, a); c.c = u2_cr_chub(0, a);
d.c = u2_chub(0, b); d.c = u2_cr_chub(0, b);
return u2_say(c.d > d.d); return u2_say(c.d > d.d);
} }
u2_weak u2_weak
j2_mc(Pt5, rd, gth)(u2_wire wir_r, j2_mc(Pt5, rd, gth)(
u2_noun cor) u2_noun cor)
{ {
u2_noun a, b; u2_noun a, b;
if ( u2_no == u2_mean(cor, u2_cv_sam_2, &a, u2_cv_sam_3, &b, 0) || if ( u2_no == u2_cr_mean(cor, u2_cv_sam_2, &a, u2_cv_sam_3, &b, 0) ||
u2_no == u2_stud(a) || u2_no == u2ud(a) ||
u2_no == u2_stud(b) ) u2_no == u2ud(b) )
{ {
return u2_bl_bail(wir_r, c3__exit); return u2_cm_bail(c3__exit);
} }
else { else {
return j2_mcd(Pt5, rd, gth)(wir_r, a, b); return j2_mcd(Pt5, rd, gth)(a, b);
} }
} }

View File

@ -8,7 +8,7 @@
#include <string.h> #include <string.h>
u2_noun // produce u2_noun // produce
j2_mbc(Pt5, repg)(u2_wire wir_r, j2_mbc(Pt5, repg)(
u2_noun lub, u2_noun lub,
u2_noun rad, u2_noun rad,
u2_noun rep) // retain u2_noun rep) // retain
@ -75,7 +75,7 @@
if (!match) { if (!match) {
if(rad_y[ic]) if(rad_y[ic])
ret = u2_cn_cell((c3_y)rad_y[ic], ret); ret = u2_ci_cell((c3_y)rad_y[ic], ret);
ic++; ic++;
} }
else { else {
@ -95,7 +95,7 @@
free(lub_y); free(lub_y);
free(rad_y); free(rad_y);
free(rep_y); free(rep_y);
return u2_cn_cell(u2_nul, u2_ckb_flop(ret)); return u2_ci_cell(u2_nul, u2_ckb_flop(ret));
} }
else { else {
// Compiling the regular expression failed // Compiling the regular expression failed
@ -113,32 +113,32 @@
cre2_opt_delete(opt); cre2_opt_delete(opt);
free(lub_y); free(lub_y);
free(rad_y); free(rad_y);
u2_bl_bail(wir_r, c3__exit); u2_cm_bail(c3__exit);
} }
cre2_opt_delete(opt); cre2_opt_delete(opt);
} }
// opt Allocation Error // opt Allocation Error
free(lub_y); free(lub_y);
free(rad_y); free(rad_y);
u2_bl_bail(wir_r, c3__exit); u2_cm_bail(c3__exit);
return u2_nul; return u2_nul;
} }
u2_weak // produce u2_weak // produce
j2_mb(Pt5, repg)(u2_wire wir_r, j2_mb(Pt5, repg)(
u2_noun cor) // retain u2_noun cor) // retain
{ {
u2_noun lub; u2_noun lub;
u2_noun rad; u2_noun rad;
u2_noun rep; u2_noun rep;
if ( (u2_none == (lub = u2_frag(u2_cv_sam_2, cor))) || if ( (u2_none == (lub = u2_cr_at(u2_cv_sam_2, cor))) ||
(u2_none == (rad = u2_frag(u2_cv_sam_6, cor))) || (u2_none == (rad = u2_cr_at(u2_cv_sam_6, cor))) ||
(u2_none == (rep = u2_frag(u2_cv_sam_7, cor))) ) (u2_none == (rep = u2_cr_at(u2_cv_sam_7, cor))) )
{ {
return u2_bl_bail(wir_r, c3__fail); return u2_cm_bail(c3__fail);
} else { } else {
return j2_mbc(Pt5, repg)(wir_r, lub, rad, rep); return j2_mbc(Pt5, repg)(lub, rad, rep);
} }
} }

View File

@ -8,7 +8,7 @@
#include <string.h> #include <string.h>
u2_noun // produce u2_noun // produce
j2_mbc(Pt5, rexp)(u2_wire wir_r, j2_mbc(Pt5, rexp)(
u2_noun lub, u2_noun lub,
u2_noun rad) // retain u2_noun rad) // retain
{ {
@ -86,7 +86,7 @@
cre2_delete(rex); cre2_delete(rex);
free(lub_y); free(lub_y);
free(rad_y); free(rad_y);
return u2_cn_cell(u2_nul, u2_nul); return u2_ci_cell(u2_nul, u2_nul);
} }
u2_noun map = u2_nul; u2_noun map = u2_nul;
@ -104,7 +104,7 @@
cre2_delete(rex); cre2_delete(rex);
free(lub_y); free(lub_y);
free(rad_y); free(rad_y);
return u2_cn_cell(u2_nul, u2_cn_cell(u2_nul, map)); return u2_ci_cell(u2_nul, u2_ci_cell(u2_nul, map));
} }
else { else {
@ -121,23 +121,23 @@
} }
free(lub_y); free(lub_y);
free(rad_y); free(rad_y);
u2_bl_bail(wir_r, c3__exit); u2_cm_bail(c3__exit);
return u2_nul; return u2_nul;
} }
u2_weak // produce u2_weak // produce
j2_mb(Pt5, rexp)(u2_wire wir_r, j2_mb(Pt5, rexp)(
u2_noun cor) // retain u2_noun cor) // retain
{ {
u2_noun lub; u2_noun lub;
u2_noun rad; u2_noun rad;
if ( (u2_none == (lub = u2_frag(u2_cv_sam_2, cor))) || if ( (u2_none == (lub = u2_cr_at(u2_cv_sam_2, cor))) ||
(u2_none == (rad = u2_frag(u2_cv_sam_3, cor))) ) (u2_none == (rad = u2_cr_at(u2_cv_sam_3, cor))) )
{ {
return u2_bl_bail(wir_r, c3__fail); return u2_cm_bail(c3__fail);
} else { } else {
return j2_mbc(Pt5, rexp)(wir_r, lub, rad); return j2_mbc(Pt5, rexp)(lub, rad);
} }
} }

View File

@ -8,7 +8,7 @@
/* functions /* functions
*/ */
u2_noun // produce u2_noun // produce
j2_mby(Pt5, rub)(u2_wire wir_r, j2_mby(Pt5, rub)(
u2_atom a, // retain u2_atom a, // retain
u2_atom b) // retain u2_atom b) // retain
{ {
@ -16,68 +16,68 @@
u2_atom w, x, y, z; u2_atom w, x, y, z;
u2_atom p, q; u2_atom p, q;
u2_atom m = j2_mbc(Pt1, add)(wir_r, a, u2_met(0, b)); u2_atom m = j2_mbc(Pt1, add)(a, u2_cr_met(0, b));
// Compute c and d. // Compute c and d.
{ {
x = u2_rx(wir_r, a); x = u2k(a);
while ( _0 == j2_mbc(Pt3, cut)(wir_r, _0, x, _1, b) ) { while ( 0 == j2_mbc(Pt3, cut)(0, x, 1, b) ) {
u2_atom y = j2_mbc(Pt1, inc)(wir_r, x); u2_atom y = j2_mbc(Pt1, inc)(x);
// Sanity check: crash if decoding more bits than available // Sanity check: crash if decoding more bits than available
if ( u2_yes == j2_mbc(Pt1, gth)(wir_r, x, m)) { if ( u2_yes == j2_mbc(Pt1, gth)(x, m)) {
// fprintf(stderr, "[%%rub-hard %d %d %d]\r\n", a, x, m); // fprintf(stderr, "[%%rub-hard %d %d %d]\r\n", a, x, m);
return u2_bl_bail(wir_r, c3__exit); return u2_cm_bail(c3__exit);
} }
u2_rz(wir_r, x); u2z(x);
x = y; x = y;
} }
if ( u2_yes == u2_sing(x, a) ) { if ( u2_yes == u2_cr_sing(x, a) ) {
u2_rz(wir_r, x); u2z(x);
return u2_bc(wir_r, _1, _0); return u2nc(1, 0);
} }
c = j2_mbc(Pt1, sub)(wir_r, x, a); c = j2_mbc(Pt1, sub)(x, a);
d = j2_mbc(Pt1, inc)(wir_r, x); d = j2_mbc(Pt1, inc)(x);
u2_rz(wir_r, x); u2z(x);
} }
// Compute e, p, q. // Compute e, p, q.
{ {
x = j2_mbc(Pt1, dec)(wir_r, c); x = j2_mbc(Pt1, dec)(c);
y = j2_mbc(Pt3, bex)(wir_r, x); y = j2_mbc(Pt3, bex)(x);
z = j2_mbc(Pt3, cut)(wir_r, _0, d, x, b); z = j2_mbc(Pt3, cut)(0, d, x, b);
e = j2_mbc(Pt1, add)(wir_r, y, z); e = j2_mbc(Pt1, add)(y, z);
u2_rz(wir_r, y); u2_rz(wir_r, z); u2z(y); u2z(z);
w = j2_mbc(Pt1, add)(wir_r, c, c); w = j2_mbc(Pt1, add)(c, c);
y = j2_mbc(Pt1, add)(wir_r, w, e); y = j2_mbc(Pt1, add)(w, e);
z = j2_mbc(Pt1, add)(wir_r, d, x); z = j2_mbc(Pt1, add)(d, x);
p = j2_mbc(Pt1, add)(wir_r, w, e); p = j2_mbc(Pt1, add)(w, e);
q = j2_mbc(Pt3, cut)(wir_r, _0, z, e, b); q = j2_mbc(Pt3, cut)(0, z, e, b);
u2_rz(wir_r, w); u2_rz(wir_r, x); u2_rz(wir_r, y); u2_rz(wir_r, z); u2z(w); u2z(x); u2z(y); u2z(z);
return u2_bc(wir_r, p, q); return u2nc(p, q);
} }
} }
u2_noun // transfer u2_noun // transfer
j2_mb(Pt5, rub)(u2_wire wir_r, j2_mb(Pt5, rub)(
u2_noun cor) // retain u2_noun cor) // retain
{ {
u2_noun a, b; u2_noun a, b;
if ( (u2_no == u2_mean(cor, u2_cv_sam_2, &a, u2_cv_sam_3, &b, 0)) || if ( (u2_no == u2_cr_mean(cor, u2_cv_sam_2, &a, u2_cv_sam_3, &b, 0)) ||
(u2_no == u2_stud(a)) || (u2_no == u2ud(a)) ||
(u2_no == u2_stud(b)) ) (u2_no == u2ud(b)) )
{ {
return u2_bl_bail(wir_r, c3__fail); return u2_cm_bail(c3__fail);
} else { } else {
return j2_mby(Pt5, rub)(wir_r, a, b); return j2_mby(Pt5, rub)(a, b);
} }
} }

View File

@ -14,13 +14,13 @@
/* functions /* functions
*/ */
u2_weak // produce u2_weak // produce
j2_mbc(Pt5, shax)(u2_wire wir_r, j2_mbc(Pt5, shax)(
u2_atom a) // retain u2_atom a) // retain
{ {
c3_w met_w = u2_met(3, a); c3_w met_w = u2_cr_met(3, a);
c3_y* fat_y = c3_malloc(met_w + 1); c3_y* fat_y = c3_malloc(met_w + 1);
u2_bytes(0, met_w, fat_y, a); u2_cr_bytes(0, met_w, fat_y, a);
{ {
c3_y dig_y[32]; c3_y dig_y[32];
#if defined(U2_OS_osx) #if defined(U2_OS_osx)
@ -37,19 +37,18 @@
SHA256_Final(dig_y, &ctx_h); SHA256_Final(dig_y, &ctx_h);
#endif #endif
free(fat_y); free(fat_y);
return u2_rl_bytes(wir_r, 32, dig_y); return u2_ci_bytes(32, dig_y);
} }
} }
u2_weak // produce u2_weak // produce
j2_mbc(Pt5, shal)(u2_wire wir_r, j2_mbc(Pt5, shal)(u2_atom a, // retain
u2_atom a, // retain
u2_atom b) // retain u2_atom b) // retain
{ {
c3_assert(u2_fly_is_cat(a)); c3_assert(u2_so(u2_co_is_cat(a)));
c3_y* fat_y = c3_malloc(a + 1); c3_y* fat_y = c3_malloc(a + 1);
u2_bytes(0, a, fat_y, b); u2_cr_bytes(0, a, fat_y, b);
{ {
c3_y dig_y[64]; c3_y dig_y[64];
#if defined(U2_OS_osx) #if defined(U2_OS_osx)
@ -66,93 +65,92 @@
SHA512_Final(dig_y, &ctx_h); SHA512_Final(dig_y, &ctx_h);
#endif #endif
free(fat_y); free(fat_y);
return u2_rl_bytes(wir_r, 64, dig_y); return u2_ci_bytes(64, dig_y);
} }
} }
u2_weak // produce u2_weak // produce
j2_mbc(Pt5, shas)(u2_wire wir_r, j2_mbc(Pt5, shas)(
u2_atom sal, // retain u2_atom sal, // retain
u2_atom ruz) // retain u2_atom ruz) // retain
{ {
u2_noun one = j2_mbc(Pt5, shax)(wir_r, ruz); u2_noun one = j2_mbc(Pt5, shax)(ruz);
u2_noun two = j2_mbc(Pt3, mix)(wir_r, sal, one); u2_noun two = j2_mbc(Pt3, mix)(sal, one);
u2_noun tri = j2_mbc(Pt5, shax)(wir_r, two); u2_noun tri = j2_mbc(Pt5, shax)(two);
u2z(one); u2z(two); return tri; u2z(one); u2z(two); return tri;
} }
u2_weak // produce u2_weak // produce
j2_mb(Pt5, shax)(u2_wire wir_r, j2_mb(Pt5, shax)(
u2_noun cor) // retain u2_noun cor) // retain
{ {
u2_noun a; u2_noun a;
if ( (u2_none == (a = u2_frag(u2_cv_sam, cor))) || if ( (u2_none == (a = u2_cr_at(u2_cv_sam, cor))) ||
(u2_no == u2_stud(a)) ) (u2_no == u2ud(a)) )
{ {
return u2_bl_bail(wir_r, c3__exit); return u2_cm_bail(c3__exit);
} else { } else {
return j2_mbc(Pt5, shax)(wir_r, a); return j2_mbc(Pt5, shax)(a);
} }
} }
u2_weak // produce u2_weak // produce
j2_mb(Pt5, shal)(u2_wire wir_r, j2_mb(Pt5, shal)(u2_noun cor) // retain
u2_noun cor) // retain
{ {
u2_noun a, b; u2_noun a, b;
if ( (u2_none == (a = u2_frag(u2_cv_sam_2, cor))) || if ( (u2_none == (a = u2_cr_at(u2_cv_sam_2, cor))) ||
(u2_none == (b = u2_frag(u2_cv_sam_3, cor))) || (u2_none == (b = u2_cr_at(u2_cv_sam_3, cor))) ||
(u2_no == u2_stud(a)) || (u2_no == u2ud(a)) ||
(u2_no == u2_fly_is_cat(a)) || (u2_no == u2_co_is_cat(a)) ||
(u2_no == u2_stud(b)) ) (u2_no == u2ud(b)) )
{ {
return u2_bl_bail(wir_r, c3__exit); return u2_cm_bail(c3__exit);
} else { } else {
return j2_mbc(Pt5, shal)(wir_r, a, b); return j2_mbc(Pt5, shal)(a, b);
} }
} }
u2_weak // produce u2_weak // produce
j2_mb(Pt5, shas)(u2_wire wir_r, j2_mb(Pt5, shas)(
u2_noun cor) // retain u2_noun cor) // retain
{ {
u2_noun sal, ruz; u2_noun sal, ruz;
if ( (u2_none == (sal = u2_frag(u2_cv_sam_2, cor))) || if ( (u2_none == (sal = u2_cr_at(u2_cv_sam_2, cor))) ||
(u2_none == (ruz = u2_frag(u2_cv_sam_3, cor))) || (u2_none == (ruz = u2_cr_at(u2_cv_sam_3, cor))) ||
(u2_no == u2_stud(sal)) || (u2_no == u2ud(sal)) ||
(u2_no == u2_stud(ruz)) ) (u2_no == u2ud(ruz)) )
{ {
return u2_bl_bail(wir_r, c3__exit); return u2_cm_bail(c3__exit);
} else { } else {
return j2_mbc(Pt5, shas)(wir_r, sal, ruz); return j2_mbc(Pt5, shas)(sal, ruz);
} }
} }
static u2_noun // produce static u2_noun // produce
_og_list(u2_wire wir_r, _og_list(
u2_noun a, // retain u2_noun a, // retain
u2_noun b, // retain u2_noun b, // retain
u2_noun c) // retain u2_noun c) // retain
{ {
u2_noun l = u2_nul; u2_noun l = u2_nul;
if ( !u2_fly_is_cat(b) ) { if ( u2_ne(u2_co_is_cat(b)) ) {
return u2_bl_bail(wir_r, c3__fail); return u2_cm_bail(c3__fail);
} }
while ( 0 != b ) { while ( 0 != b ) {
u2_noun x = j2_mbc(Pt3, mix)(wir_r, a, c); u2_noun x = j2_mbc(Pt3, mix)(a, c);
u2_noun y = j2_mbc(Pt3, mix)(wir_r, b, x); u2_noun y = j2_mbc(Pt3, mix)(b, x);
u2_noun d = j2_mbc(Pt5, shas)(wir_r, c3_s4('o','g','-','b'), y); u2_noun d = j2_mbc(Pt5, shas)(c3_s4('o','g','-','b'), y);
u2_noun m; u2_noun m;
u2z(x); u2z(y); u2z(x); u2z(y);
if ( b < 256 ) { if ( b < 256 ) {
u2_noun e = j2_mbc(Pt3, end)(wir_r, 0, b, d); u2_noun e = j2_mbc(Pt3, end)(0, b, d);
u2z(d); u2z(d);
m = u2nc(b, e); m = u2nc(b, e);
@ -169,14 +167,14 @@
} }
u2_noun // produce u2_noun // produce
j2_mcc(Pt5, og, raw)(u2_wire wir_r, j2_mcc(Pt5, og, raw)(
u2_noun a, // retain u2_noun a, // retain
u2_noun b) // retain u2_noun b) // retain
{ {
u2_noun x = j2_mbc(Pt3, mix)(wir_r, b, a); u2_noun x = j2_mbc(Pt3, mix)(b, a);
u2_noun c = j2_mbc(Pt5, shas)(wir_r, c3_s4('o','g','-','a'), x); u2_noun c = j2_mbc(Pt5, shas)(c3_s4('o','g','-','a'), x);
u2_noun l = _og_list(wir_r, a, b, c); u2_noun l = _og_list(a, b, c);
u2_noun r = j2_mbc(Pt3, can)(wir_r, 0, l); u2_noun r = j2_mbc(Pt3, can)(0, l);
u2z(l); u2z(l);
u2z(c); u2z(c);
@ -186,15 +184,15 @@
} }
u2_weak // transfer u2_weak // transfer
j2_mc(Pt5, og, raw)(u2_wire wir_r, j2_mc(Pt5, og, raw)(
u2_noun cor) // retain u2_noun cor) // retain
{ {
u2_noun a, b; u2_noun a, b;
if ( u2_no == u2_mean(cor, u2_cv_sam, &b, u2_cv_con_sam, &a, 0) ) { if ( u2_no == u2_cr_mean(cor, u2_cv_sam, &b, u2_cv_con_sam, &a, 0) ) {
return u2_bl_bail(wir_r, c3__exit); return u2_cm_bail(c3__exit);
} else { } else {
return j2_mcc(Pt5, og, raw)(wir_r, a, b); return j2_mcc(Pt5, og, raw)(a, b);
} }
} }

View File

@ -8,19 +8,19 @@
/* functions /* functions
*/ */
static u2_noun // transfer static u2_noun // transfer
_norm(u2_wire wir_r, _norm(
u2_noun a) // retain u2_noun a) // retain
{ {
if ( u2_no == u2du(a) ) { if ( u2_no == u2du(a) ) {
return u2_nul; return u2_nul;
} else { } else {
return u2nc(((u2_yes == u2du(u2h(a))) ? u2_nul : u2k(u2h(a))), return u2nc(((u2_yes == u2du(u2h(a))) ? u2_nul : u2k(u2h(a))),
_norm(wir_r, u2t(a))); _norm(u2t(a)));
} }
} }
static u2_bean static u2_bean
_good(u2_wire wir_r, _good(
u2_noun a) // retain u2_noun a) // retain
{ {
while ( 1 ) { while ( 1 ) {
@ -35,26 +35,26 @@
} }
u2_noun // transfer u2_noun // transfer
j2_mby(PtM, tape)(u2_wire wir_r, j2_mby(PtM, tape)(
u2_noun a) // retain u2_noun a) // retain
{ {
if ( u2_yes == _good(wir_r, a) ) { if ( u2_yes == _good(a) ) {
fprintf(stderr, "good!\r\n"); fprintf(stderr, "good!\r\n");
return u2k(a); return u2k(a);
} else { } else {
return _norm(wir_r, a); return _norm(a);
} }
} }
u2_noun // transfer u2_noun // transfer
j2_mb(PtM, tape)(u2_wire wir_r, j2_mb(PtM, tape)(
u2_noun cor) // retain u2_noun cor) // retain
{ {
u2_noun a; u2_noun a;
if ( (u2_none == (a = u2_frag(u2_cv_sam, cor))) ) { if ( (u2_none == (a = u2_cr_at(u2_cv_sam, cor))) ) {
return u2_bl_bail(wir_r, c3__fail); return u2_cm_bail(c3__fail);
} else { } else {
return j2_mby(PtM, tape)(wir_r, a); return j2_mby(PtM, tape)(a);
} }
} }

View File

@ -8,24 +8,24 @@
/* functions /* functions
*/ */
u2_noun // transfer u2_noun // transfer
j2_mby(Pt5, trip)(u2_wire wir_r, j2_mby(Pt5, trip)(
u2_atom a) // retain u2_atom a) // retain
{ {
if ( u2_no == u2_stud(a) ) { if ( u2_no == u2ud(a) ) {
return u2_bl_bail(wir_r, c3__exit); return u2_cm_bail(c3__exit);
} }
return j2_mbc(Pt3, rip)(wir_r, _3, a); return j2_mbc(Pt3, rip)(3, a);
} }
u2_noun // transfer u2_noun // transfer
j2_mb(Pt5, trip)(u2_wire wir_r, j2_mb(Pt5, trip)(
u2_noun cor) // retain u2_noun cor) // retain
{ {
u2_noun a; u2_noun a;
if ( (u2_none == (a = u2_frag(u2_cv_sam, cor))) ) { if ( (u2_none == (a = u2_cr_at(u2_cv_sam, cor))) ) {
return u2_bl_bail(wir_r, c3__fail); return u2_cm_bail(c3__fail);
} else { } else {
return j2_mby(Pt5, trip)(wir_r, a); return j2_mby(Pt5, trip)(a);
} }
} }

View File

@ -412,6 +412,11 @@
u2_noun u2_noun
u2_cx_t(u2_noun som); u2_cx_t(u2_noun som);
#endif #endif
/* u2_cx_good(): test for u2_none.
*/
u2_noun
u2_cx_good(u2_weak som);
/* u2_cx_at (u2at): fragment. /* u2_cx_at (u2at): fragment.
*/ */
u2_noun u2_noun
@ -795,6 +800,14 @@
u2_cr_word(c3_w a_w, u2_cr_word(c3_w a_w,
u2_atom b); u2_atom b);
/* u2_cr_chub():
**
** Return double-word (a_w) of (b).
*/
c3_d
u2_cr_chub(c3_w a_w,
u2_atom b);
/* u2_cr_words(): /* u2_cr_words():
** **
** Copy words (a_w) through (a_w + b_w - 1) from (d) to (c). ** Copy words (a_w) through (a_w + b_w - 1) from (d) to (c).
@ -1069,6 +1082,11 @@
u2_noun u2_noun
u2_cn_slam_on(u2_noun gat, u2_noun sam); u2_cn_slam_on(u2_noun gat, u2_noun sam);
/* u2_cn_kick_on(): fire `gat` without changing the sample.
*/
u2_noun
u2_cn_kick_on(u2_noun gat);
/* u2_cn_nock_un(): produce .*(bus fol), as ++toon. /* u2_cn_nock_un(): produce .*(bus fol), as ++toon.
*/ */
u2_noun u2_noun
@ -1090,6 +1108,16 @@
u2_cn_slam_in(u2_noun fly, u2_noun gat, u2_noun sam); u2_cn_slam_in(u2_noun fly, u2_noun gat, u2_noun sam);
/** Jet firing.
**/
/* u2_cn_hook():
**
** Execute hook from core.
*/
u2_noun
u2_cn_hook(u2_noun cor,
const c3_c* tam_c);
/** Memoization. /** Memoization.
*** ***
*** The memo cache is keyed by an arbitrary symbolic function *** The memo cache is keyed by an arbitrary symbolic function