Esempio n. 1
0
File: mas.c Progetto: Gruelty/urbit
  u2_weak                                                         //  transfer
  j2_mb(Pt3, mas)(u2_wire wir_r, 
                  u2_noun cor)                                    //  retain
  {
    u2_noun a;

    if ( (u2_none == (a = u2_frag(u2_cv_sam, cor))) ||
         (u2_no == u2_stud(a)) )
    {
      return u2_bl_bail(wir_r, c3__exit);
    } else {
      return j2_mbc(Pt3, mas)(wir_r, a);
    }
  }
Esempio n. 2
0
  u2_noun                                                         // transfer
  j2_mb(Pt2, slag)(u2_wire wir_r, 
                   u2_noun cor)                                   // retain
  {
    u2_noun a, b;

    if ( (u2_no == u2_mean(cor, u2_cw_sam_2, &a, u2_cw_sam_3, &b, 0)) || 
         (u2_no == u2_stud(a)) ) 
    {
      return u2_bl_bail(wir_r, c3__exit);
    } else {
      return j2_mbc(Pt2, slag)(wir_r, a, b);
    }
  }
/* functions
*/
  u2_noun                                                         //  transfer
  j2_mby(Pt6, hike)(u2_wire wir_r,
                    u2_noun axe,                                  //  retain
                    u2_noun pac)                                  //  retain
  {
    if ( (u2_nul == pac) ) {
      return u2_bc(wir_r, u2_nock_0, u2_rx(wir_r, axe));
    }
    else {
      u2_noun zet = _lily_hike_belt_root(wir_r, pac);

      if ( u2_nul != zet ) {
        u2_noun fol = u2_rx(wir_r, u2_h(zet));

        u2_rl_lose(wir_r, zet);
        return fol;
      }
      else {
        u2_noun tum = _lily_hike_belt_l(wir_r, pac);
        u2_noun gam = _lily_hike_belt_r(wir_r, pac);
        u2_noun hax = j2_mbc(Pt3, peg)(wir_r, axe, 2);
        u2_noun moz = j2_mbc(Pt3, peg)(wir_r, axe, 3);
        u2_noun zip = j2_mby(Pt6, hike)(wir_r, hax, tum);
        u2_noun dof = j2_mby(Pt6, hike)(wir_r, moz, gam);
        u2_noun fol = j2_mby(Pt6, cons)(wir_r, zip, dof);

        u2_rl_lose(wir_r, tum);
        u2_rl_lose(wir_r, gam);
        u2_rl_lose(wir_r, hax);
        u2_rl_lose(wir_r, moz);
        u2_rl_lose(wir_r, zip);
        u2_rl_lose(wir_r, dof);

        return fol;
      }
    }
  }
Esempio n. 4
0
File: mas.c Progetto: Gruelty/urbit
/* functions
*/
  u2_weak                                                         //  transfer
  j2_mbc(Pt3, mas)(u2_wire wir_r, 
                   u2_atom a)                                     //  retain
  {
    c3_w b_w;
    u2_atom c, d, e, f;

    b_w = u2_met(0, a);
    if ( b_w < 2 ) {
      return u2_bl_bail(wir_r, c3__exit);
    } 
    else {
      c = j2_mbc(Pt3, bex)(wir_r, (b_w - 1));
      d = j2_mbc(Pt3, bex)(wir_r, (b_w - 2));
      e = j2_mbc(Pt1, sub)(wir_r, a, c);
      f = j2_mbc(Pt3, con)(wir_r, e, d); 
 
      u2_rl_lose(wir_r, c);
      u2_rl_lose(wir_r, d);
      u2_rl_lose(wir_r, e);

      return f;
    }
  }
Esempio n. 5
0
File: mod.c Progetto: mnemnion/urbit
  u2_weak                                                         //  transfer
  j2_mb(Pt1, mod)(u2_wire wir_r, 
                  u2_noun cor)                                    //  retain
  {
    u2_noun a, b;

    if ( (u2_no == u2_mean(cor, u2_cw_sam_2, &a, u2_cw_sam_3, &b, 0)) ||
         (u2_no == u2_stud(a)) ||
         (u2_no == u2_stud(b)) )
    {
      return u2_none;
    } else {
      return j2_mbc(Pt1, mod)(wir_r, a, b);
    }
  }
Esempio n. 6
0
  u2_weak                                                         //  produce
  j2_mb(Pt5, shas)(u2_wire wir_r, 
                   u2_noun cor)                                    //  retain
  {
    u2_noun sal, ruz;

    if ( (u2_none == (sal = u2_frag(u2_cv_sam_2, cor))) ||
         (u2_none == (ruz = u2_frag(u2_cv_sam_3, cor))) ||
         (u2_no == u2_stud(sal)) ||
         (u2_no == u2_stud(ruz)) ) 
    {
      return u2_bl_bail(wir_r, c3__exit);
    } else {
      return j2_mbc(Pt5, shas)(wir_r, sal, ruz);
    }
  }
Esempio n. 7
0
/* _hill_z_make_txt(): execute string against shoe.
*/
static hi_shoz                                                    //  produce
_hill_z_make_txt(u2_wire wir_r,
                 hi_shoz sho,                                     //  retain
                 u2_atom txt)                                     //  retain
{
  u2_noun gen, ret;

  if ( u2_none == (gen = j2_mbc(PitZ, ream)(wir_r, txt)) ) {
    fprintf(stderr, "{%s: parser failed}\n", FileZ);
    return u2_bl_bail(wir_r, c3__fail);
  }
  ret = _hill_z_make_gen(wir_r, sho, gen);

  u2_rz(wir_r, gen);
  return ret;
}
Esempio n. 8
0
  u2_weak                                                         //  produce
  j2_mb(Pt5, repg)(u2_wire wir_r,
                   u2_noun cor)                                   //  retain
  {
    u2_noun lub;
    u2_noun rad;
    u2_noun rep;

    if ( (u2_none == (lub = u2_frag(u2_cv_sam_2, cor))) ||
         (u2_none == (rad = u2_frag(u2_cv_sam_6, cor))) ||
         (u2_none == (rep = u2_frag(u2_cv_sam_7, cor))) )
    {
      return u2_bl_bail(wir_r, c3__fail);
    } else {
      return j2_mbc(Pt5, repg)(wir_r, lub, rad, rep);
    }
  }
Esempio n. 9
0
File: peg.c Progetto: Gruelty/urbit
  u2_weak                                                         //  transfer
  j2_mb(Pt3, peg)(u2_wire wir_r, 
                  u2_noun cor)                                    //  retain
  {
    u2_noun a, b;

    if ( (u2_no == u2_mean(cor, u2_cv_sam_2, &a, u2_cv_sam_3, &b, 0)) ||
         (u2_no == u2_stud(a)) ||
         (u2_no == u2_stud(b)) ||
         (0 == a) ||
         (0 == b) )
    {
      return u2_bl_bail(wir_r, c3__exit);
    } else {
      return j2_mbc(Pt3, peg)(wir_r, a, b);
    }
  }
  u2_weak                                                         //  produce
  j2_mb(Pt5, shal)(u2_wire wir_r,
                   u2_noun cor)                                   //  retain
  {
    u2_noun a, b;

    if ( (u2_none == (a = u2_frag(u2_cv_sam_2, cor))) ||
         (u2_none == (b = u2_frag(u2_cv_sam_3, cor))) ||
         (u2_no == u2_stud(a)) ||
         (u2_no == u2_fly_is_cat(a)) ||
         (u2_no == u2_stud(b)) )
    {
      return u2_bl_bail(wir_r, c3__exit);
    } else {
      return j2_mbc(Pt5, shal)(wir_r, a, b);
    }
  }
Esempio n. 11
0
File: turn.c Progetto: MacTop/urbit
/* functions
*/
  u2_weak                                                         //  transfer
  j2_mbc(Pt2, turn)(u2_wire wir_r, 
                    u2_noun a,                                    //  retain
                    u2_noun b)                                    //  retain
  {
    if ( _0 == a ) {
      return a;
    } 
    else if ( u2_no == u2_dust(a) ) {
      return u2_bl_bail(wir_r, c3__exit);
    }
    else {   
      u2_noun one = u2_nk_mong(wir_r, b, u2_rx(wir_r, u2_h(a)));
      u2_noun two = j2_mbc(Pt2, turn)(wir_r, u2_t(a), b);

      return u2_rc(wir_r, one, two);
    }
  }
Esempio n. 12
0
File: reel.c Progetto: Gruelty/urbit
/* functions
*/
  u2_weak                                                         //  transfer
  j2_mbc(Pt2, reel)(u2_wire wir_r, 
                    u2_noun a,                                    //  retain
                    u2_noun b)                                    //  retain
  {
    if ( _0 == a ) {
      return u2_rx(wir_r, u2_frag(u2_cv_sam_3, b));
    }
    else if ( u2_no == u2_dust(a) ) {
      return u2_bl_bail(wir_r, c3__exit);
    }
    else {
      u2_weak gim = u2_rx(wir_r, u2_h(a));
      u2_weak hur = j2_mbc(Pt2, reel)(wir_r, u2_t(a), b);
      
      return u2_nk_mong(wir_r, b, u2_rc(wir_r, gim, hur));
    }
  }
  u2_weak                                                         //  transfer
  j2_mb(Pt3, cat)(u2_wire wir_r,
                  u2_noun cor)                                    //  retain
  {
    u2_noun a, b, c;

    if ( (u2_no == u2_mean(cor, u2_cv_sam_2, &a,
                                u2_cv_sam_6, &b,
                                u2_cv_sam_7, &c, 0)) ||
         (u2_no == u2_stud(a)) ||
         (u2_no == u2_stud(b)) ||
         (u2_no == u2_stud(c)) )
    {
      return u2_bl_bail(wir_r, c3__exit);
    } else {
      return j2_mbc(Pt3, cat)(wir_r, a, b, c);
    }
  }
Esempio n. 14
0
/* _hill_z_mint_txt(): mint `txt` to `[type form]` with PitZ jets.
*/
static u2_noun                                                    //  produce
_hill_z_mint_txt(u2_wire wir_r,
                 u2_noun sut,                                     //  retain
                 u2_noun gol,                                     //  retain
                 u2_atom txt)                                     //  retain
{
  u2_noun gen;

  if ( u2_none == (gen = j2_mbc(PitZ, ream)(wir_r, txt)) ) {
    fprintf(stderr, "{%s: parser failed}\n", FileZ);
    return u2_bl_bail(wir_r, c3__fail);
  }
  else {
    u2_noun ret = _hill_z_mint_gen(wir_r, sut, gol, gen);

    u2_rz(wir_r, gen);
    return ret;
  }
}
/* functions
*/
  u2_weak                                                         //  transfer
  j2_mbc(Pt2, lien)(u2_wire wir_r,
                    u2_noun a,                                    //  retain
                    u2_noun b)                                    //  retain
  {
    if ( _0 == a ) {
      return u2_no;
    } else {
      u2_weak loz;

      if ( u2_no == u2_dust(a) ) {
        return u2_bl_bail(wir_r, c3__exit);
      }
      else switch ( (loz = u2_nk_mong(wir_r, b, u2_rx(wir_r, u2_h(a)))) ) {
        case u2_yes:  return u2_yes;
        case u2_no:   return j2_mbc(Pt2, lien)(wir_r, u2_t(a), b);
        default:      u2_rl_lose(wir_r, loz);
                      return u2_bl_bail(wir_r, c3__exit);
      }
    }
  }
/* functions
*/
  u2_weak                                                         //  transfer
  j2_mbc(Pt2, skip)(u2_wire wir_r,
                    u2_noun a,                                    //  retain
                    u2_noun b)                                    //  retain
  {
    if ( _0 == a ) {
      return a;
    }
    else if ( u2_no == u2_dust(a) ) {
      return u2_none;
    } else {
      u2_weak hoz = u2_nk_mong(wir_r, b, u2_rx(wir_r, u2_h(a)));
      u2_weak vyr = j2_mbc(Pt2, skip)(wir_r, u2_t(a), b);

      switch ( hoz ) {
        case u2_yes:  return vyr;
        case u2_no:   return u2_rc(wir_r, u2_rx(wir_r, u2_h(a)), vyr);
        default:      u2_rl_lose(wir_r, hoz);
                      u2_rl_lose(wir_r, vyr);
                      return u2_none;
      }
    }
  }
Esempio n. 17
0
/* internals
*/
  static u2_noun                                                  //  transfer
  _tusk_in(u2_wire wir_r, 
           u2_noun van,                                           //  retain
           u2_noun sut,                                           //  retain
           u2_noun peh,                                           //  retain
           u2_noun boz,                                           //  retain
           u2_noun rix,                                           //  retain
           u2_atom axe)                                           //  retain
  {
    u2_noun ret;

    if ( u2_nul == peh ) {
      return j2_mcy(Pt6, ut, play)(wir_r, van, boz, rix);
    }
    else {
      u2_noun i_peh = u2_h(peh);
      u2_noun t_peh = u2_t(peh);

      if ( u2_yes == u2_stud(i_peh) ) {
        u2_noun cog = i_peh;
        u2_noun wer = j2_mcy(Pt6, ut, find)(wir_r, van, sut, c3__rite, i_peh);
        u2_noun p_wer, r_wer;

        u2_as_trel(wer, &p_wer, 0, &r_wer);
        {
          u2_noun nax = j2_mbc(Pt3, peg)(wir_r, axe, p_wer); 
          u2_noun giv = _tusk_in(wir_r, van, r_wer, t_peh, boz, rix, nax);
          u2_noun qog = u2_bc(wir_r, u2_nul, cog);
          u2_noun ret = j2_mcy(Pt6, ut, heal)
            (wir_r, van, sut, qog, p_wer, giv);

          u2_rl_lose(wir_r, nax);
          u2_rl_lose(wir_r, qog);
          u2_rl_lose(wir_r, giv);
          u2_rl_lose(wir_r, wer);

          return ret;
        }
      }
      else {
        u2_noun bax = u2_t(i_peh);
        u2_noun vas = j2_mcy(Pt6, ut, peek)(wir_r, van, sut, c3__rite, bax);
        u2_noun rox;

        if ( u2_nul == t_peh ) {
          rox = j2_mcy(Pt6, ut, snap)(wir_r, van, vas, rix);
        } else rox = u2_rx(wir_r, rix);
        
        {
          u2_noun nax = j2_mbc(Pt3, peg)(wir_r, axe, bax); 
          u2_noun giv = _tusk_in(wir_r, van, vas, t_peh, boz, rox, nax);

          ret = j2_mcy(Pt6, ut, heal)(wir_r, van, sut, u2_nul, bax, giv);

          u2_rl_lose(wir_r, rox);
          u2_rl_lose(wir_r, nax);
          u2_rl_lose(wir_r, giv);

          return ret;
        }
      }
    }
  }
Esempio n. 18
0
  static u2_noun                                                  //  produce
  _mint_in(u2_wire wir_r, 
           u2_noun van,                                           //  retain
           u2_noun sut,                                           //  retain
           u2_noun gol,                                           //  retain
           u2_noun gen)                                           //  retain
  {
    u2_noun p_gen, q_gen, r_gen;
    u2_noun ret;

    if ( (c3__void == sut) && 
         !((u2_yes == u2_dust(gen)) && (c3__zpcb == u2_h(gen))) )
    {
      if ( (u2_no == _mint_vet(wir_r, van))
           || ((u2_yes == u2_dust(gen)) && 
               ((c3__zpfs == u2_h(gen)) || (c3__zpzp == u2_h(gen)))) )
      {
        return u2_bt(wir_r, c3__void, _0, _0);
      }
      else {
        return u2_bl_error(wir_r, "mint-vain");
      }
    }

    if ( u2_no == u2_dust(gen) ) {
      u2_noun ter = u2_frag(u2_cw_con_2, van);
      u2_noun rex = j2_mcy(Pt6, ap, open)(wir_r, ter, gen);

      ret = _mint_in(wir_r, van, sut, gol, rex);
      u2_rl_lose(wir_r, rex);

      return ret;
    } 
    else if ( u2_yes == u2_dust(u2_h(gen)) ) {
      _mint_used(wir_r);
      {
        u2_noun hed = _mint_in(wir_r, van, sut, c3__noun, u2_h(gen));
        u2_noun tal = _mint_in(wir_r, van, sut, c3__noun, u2_t(gen));
        u2_noun typ = j2_mby(Pt6, cell)(wir_r, u2_h(hed), u2_h(tal));

        ret = u2_bc
          (wir_r,
           _mint_nice(wir_r, van, gol, typ),
           j2_mby(Pt6, cons)(wir_r, u2_t(hed), u2_t(tal)));

        u2_rl_lose(wir_r, hed);
        u2_rl_lose(wir_r, tal);

        return ret;
      }
    } else switch ( u2_h(gen) ) {
      default: {
        u2_noun ter = u2_frag(u2_cw_con_2, van);
        u2_noun rex = j2_mcy(Pt6, ap, open)(wir_r, ter, gen);

        if ( u2_yes == u2_sing(rex, gen) ) {
#if 1
          u2_noun zix = j2_mcy(Pt6, ut, shep)
                (wir_r, van, "gene", 'q', u2_rx(wir_r, gen));

          u2_bl_push(wir_r, u2_bc(wir_r, c3__mean, zix));
          return u2_bl_error(wir_r, "mint-open");
#else
          u2_err(wir_r, "h", u2_h(gen));
          return u2_bl_bail(wir_r, c3__fail);
#endif
        }
        ret = _mint_in(wir_r, van, sut, gol, rex);
        u2_rl_lose(wir_r, rex);

        return ret;
      }
      
      case c3__wtcn: u2_bi_cell(wir_r, u2_t(gen), &p_gen, &q_gen);
      _mint_used(wir_r);
      {
        u2_noun vol = _mint_corn(wir_r, van, sut, q_gen);
        u2_noun axe = _mint_coke(wir_r, vol);
        u2_noun wam = j2_mcy(Pt6, ut, play)(wir_r, van, sut, p_gen);

        ret = u2_bc
          (wir_r,
           _mint_nice(wir_r, van, gol, _mint_flag(wir_r)),
           j2_mcy(Pt6, ut, fish)(wir_r, van, wam, axe));

        u2_rl_lose(wir_r, axe);
        u2_rl_lose(wir_r, wam);
        return ret;
      }
      case c3__wtcl: u2_bi_trel(wir_r, u2_t(gen), &p_gen, &q_gen, &r_gen);
      _mint_used(wir_r);
      {
        u2_noun bol = _mint_flag(wir_r);
        u2_noun nor = _mint_in(wir_r, van, sut, bol, p_gen);
        u2_noun fex = j2_mcy(Pt6, ut, gain)(wir_r, van, sut, p_gen);
        u2_noun wux = j2_mcy(Pt6, ut, lose)(wir_r, van, sut, p_gen);
        u2_noun duy = (c3__void == fex)
                        ? ( (c3__void == wux)
                             ?  u2_bc(wir_r, _0, _0)
                             :  u2_bc(wir_r, _1, _1) )
                        : ( (c3__void == wux)
                            ?  u2_bc(wir_r, _1, _0)
                            :  u2_rx(wir_r, u2_t(nor)) );
        u2_noun hiq = _mint_in(wir_r, van, fex, gol, q_gen);
        u2_noun ran = _mint_in(wir_r, van, wux, gol, r_gen);

        ret = u2_bc
          (wir_r, j2_mby(Pt6, fork)(wir_r, u2_h(hiq), u2_h(ran)),
                  _mint_cond(wir_r, duy, 
                                    u2_rx(wir_r, u2_t(hiq)),
                                    u2_rx(wir_r, u2_t(ran))));

        u2_rl_lose(wir_r, ran);
        u2_rl_lose(wir_r, hiq);
        u2_rl_lose(wir_r, nor);
        u2_rl_lose(wir_r, wux);
        u2_rl_lose(wir_r, fex);
        u2_rl_lose(wir_r, bol);

        return ret;
      }
      case c3__clhp: u2_bi_cell(wir_r, u2_t(gen), &p_gen, &q_gen);
      _mint_used(wir_r);
      {
        u2_noun hed = _mint_in(wir_r, van, sut, c3__noun, p_gen);
        u2_noun tal = _mint_in(wir_r, van, sut, c3__noun, q_gen);
        u2_noun typ = j2_mby(Pt6, cell)(wir_r, u2_h(hed), u2_h(tal));

        ret = u2_bc
          (wir_r,
           _mint_nice(wir_r, van, gol, typ),
           j2_mby(Pt6, cons)(wir_r, u2_t(hed), u2_t(tal)));

        u2_rl_lose(wir_r, hed);
        u2_rl_lose(wir_r, tal);

        return ret;
      }
      case c3__dtts: u2_bi_cell(wir_r, u2_t(gen), &p_gen, &q_gen);
      _mint_used(wir_r);
      {
        u2_noun typ = _mint_nice(wir_r, van, gol, _mint_flag(wir_r));

        return u2_bc
          (wir_r, 
           typ,
           u2_bt(wir_r, _5, _mint_corn(wir_r, van, sut, p_gen),
                            _mint_corn(wir_r, van, sut, q_gen)));
      }
      case c3__dtwt: p_gen = u2_t(gen);
      _mint_used(wir_r);
      {
        u2_noun typ = _mint_nice(wir_r, van, gol, _mint_flag(wir_r));

        return u2_bc
          (wir_r, 
           typ,
           u2_bc(wir_r, _3, _mint_corn(wir_r, van, sut, p_gen)));
      }
      case c3__dtkt: p_gen = u2_t(gen);
      _mint_used(wir_r);
      {
        u2_noun tom = c3__noun;
        u2_noun sam = _mint_in(wir_r, van, sut, tom, p_gen);

        ret = u2_bc
          (wir_r, 
           _mint_nice(wir_r, van, gol, tom),
           u2_bc(wir_r, _11, u2_rx(wir_r, u2_t(sam))));
        
        u2_rz(wir_r, sam);
        return ret;
      }
      case c3__dtls: p_gen = u2_t(gen);
      _mint_used(wir_r);
      {
        u2_noun tom = u2_bc(wir_r, c3__atom, u2_blip);
        u2_noun sam = _mint_in(wir_r, van, sut, tom, p_gen);

        ret = u2_bc
          (wir_r, 
           _mint_nice(wir_r, van, gol, tom),
           u2_bc(wir_r, _4, u2_rx(wir_r, u2_t(sam))));
        
        u2_rz(wir_r, sam);
        return ret;
      }
      case c3__dtsg: u2_bi_cell(wir_r, u2_t(gen), &p_gen, &q_gen);
      _mint_used(wir_r);
      {
        u2_noun boc = (u2_no == u2_stud(q_gen)) 
                        ? c3__noun
                        : u2_bc(wir_r, c3__atom, u2_rx(wir_r, p_gen));
        u2_noun typ = j2_mby(Pt6, cube)(wir_r, q_gen, boc);
        u2_noun ret = 
            u2_bc(wir_r,
                  _mint_nice(wir_r, van, gol, typ),
                  u2_bc(wir_r, _1, u2_rx(wir_r, q_gen)));

        u2_rz(wir_r, boc);
        return ret;
      }
      case c3__dttr: u2_bi_cell(wir_r, u2_t(gen), &p_gen, &q_gen);
      _mint_used(wir_r);
      {
        return u2_bc
          (wir_r, 
           _mint_nice(wir_r, van, gol, c3__noun),
           u2_bt(wir_r, _2, _mint_corn(wir_r, van, sut, p_gen),
                            _mint_corn(wir_r, van, sut, q_gen)));
      }
      case c3__dtpt: u2_bi_cell(wir_r, u2_t(gen), &p_gen, &q_gen);
      _mint_used(wir_r);
      {
        u2_noun typ = j2_mcy(Pt6, ut, play)(wir_r, van, sut, gen);
        u2_noun ret = 
            u2_bc(wir_r,
                  _mint_nice(wir_r, van, gol, typ),
                  u2_bc(wir_r, _1, u2_rx(wir_r, q_gen)));

        return ret;
      }
      case c3__ktdt: u2_bi_cell(wir_r, u2_t(gen), &p_gen, &q_gen);
      _mint_used(wir_r);
      {
        u2_noun wit = j2_mcy(Pt6, ut, play)(wir_r, van, sut, p_gen);
        u2_noun nep = j2_mcy(Pt6, ut, snap)(wir_r, van, wit, q_gen);
        u2_noun ret = _mint_in(wir_r, van, sut, gol, nep);

        u2_rz(wir_r, nep);
        u2_rz(wir_r, wit);
        return ret;
      }
      case c3__ktbr: p_gen = u2_t(gen);
      _mint_used(wir_r);
      {
        u2_noun ryd = _mint_in(wir_r, van, sut, gol, p_gen);
        u2_noun tyf = j2_mcy(Pt6, ut, wrap)(wir_r, van, u2_h(ryd), c3__iron);
        u2_noun pro = u2_bc(wir_r, tyf, u2_rx(wir_r, u2_t(ryd)));

        u2_rz(wir_r, ryd);
        return pro;
      }
      case c3__ktpm: p_gen = u2_t(gen);
      _mint_used(wir_r);
      {
        u2_noun ryd = _mint_in(wir_r, van, sut, gol, p_gen);
        u2_noun tyf = j2_mcy(Pt6, ut, wrap)(wir_r, van, u2_h(ryd), c3__zinc);
        u2_noun pro = u2_bc(wir_r, tyf, u2_rx(wir_r, u2_t(ryd)));

        u2_rz(wir_r, ryd);
        return pro;
      }
      case c3__ktwt: p_gen = u2_t(gen);
      _mint_used(wir_r);
      {
        u2_noun ryd = _mint_in(wir_r, van, sut, gol, p_gen);
        u2_noun tyf = j2_mcy(Pt6, ut, wrap)(wir_r, van, u2_h(ryd), c3__lead);
        u2_noun pro = u2_bc(wir_r, tyf, u2_rx(wir_r, u2_t(ryd)));

        u2_rz(wir_r, ryd);
        return pro;
      }
      case c3__ktts: u2_bi_cell(wir_r, u2_t(gen), &p_gen, &q_gen);
      _mint_used(wir_r);
      {
        u2_noun vat = _mint_in(wir_r, van, sut, gol, q_gen);
     
        ret = u2_bc
          (wir_r,
           u2_bt(wir_r, c3__face,
                        u2_rx(wir_r, p_gen), 
                        u2_rx(wir_r, u2_h(vat))),
           u2_rx(wir_r, u2_t(vat)));

        u2_rl_lose(wir_r, vat);
        return ret;
      }
      case c3__ktsg: p_gen = u2_t(gen);
      _mint_used(wir_r);
      {
        u2_noun nef = _mint_in(wir_r, van, sut, gol, p_gen);
        u2_noun p_nef = u2_h(nef);
        u2_noun q_nef = u2_t(nef);
        u2_noun fom;

        {
          u2_noun cag = j2_mcy(Pt6, ut, burn)(wir_r, van, sut);
          u2_noun wim = u2_cn_moch(cag, u2k(q_nef));

          if ( 0 == u2h(wim) ) {
            fom = u2nc(1, u2k(u2t(wim)));
          } else {
            fom = u2k(q_nef);
          }
          u2z(wim);
        }
        ret = u2_bc(wir_r, u2_rx(wir_r, p_nef), fom);
 
        u2_rz(wir_r, nef);
        return ret;
      }
      case c3__ktls: u2_bi_cell(wir_r, u2_t(gen), &p_gen, &q_gen);
      _mint_used(wir_r);
      {
        u2_noun hif = j2_mcy(Pt6, ut, play)(wir_r, van, sut, p_gen);
        u2_noun zel = _mint_in(wir_r, van, sut, hif, q_gen);
        u2_noun ret = u2_bc(wir_r, hif, u2_rx(wir_r, u2_t(zel)));

        u2_rz(wir_r, zel);
        return ret;
      }
      case c3__tsgr: u2_bi_cell(wir_r, u2_t(gen), &p_gen, &q_gen);
      _mint_used(wir_r);
      {
        u2_noun fid = _mint_in(wir_r, van, sut, c3__noun, p_gen);
        u2_noun p_fid = u2_h(fid);
        u2_noun q_fid = u2_t(fid);
        u2_noun dov = _mint_in(wir_r, van, p_fid, gol, q_gen);
        u2_noun p_dov = u2_h(dov);
        u2_noun q_dov = u2_t(dov);

        ret = u2_bc
          (wir_r, u2_rx(wir_r, p_dov), 
                  j2_mbc(Pt6, comb)(wir_r, q_fid, q_dov));

        u2_rl_lose(wir_r, fid); 
        u2_rl_lose(wir_r, dov);
        return ret;
      }
      case c3__cnts: u2_bi_cell(wir_r, u2_t(gen), &p_gen, &q_gen);
      _mint_used(wir_r);
      {
        u2_noun sec = j2_mcy(Pt6, ut, seek)(wir_r, van, sut, c3__read, p_gen);
        u2_noun lar = _mint_foil(wir_r, sec);
        u2_noun p_lar = u2_h(lar);
        u2_noun q_lar = u2_t(lar);
        u2_noun pq_lar = u2_h(q_lar);
        u2_noun qq_lar = u2_t(q_lar);
        u2_noun mew = j2_mcy(Pt6, ut, swab)(wir_r, van, sut, qq_lar, q_gen);
        u2_noun yom = _mint_edit
          (wir_r, van, sut, mew, p_lar, u2_rx(wir_r, qq_lar), u2_nul);
        u2_noun p_yom = u2_h(yom);
        u2_noun q_yom = u2_t(yom);
        u2_noun ret = u2_bc
          (wir_r, _mint_nice(wir_r, van, gol, u2_rx(wir_r, p_yom)),
                  (_0 == pq_lar) ? u2_rx(wir_r, q_yom)
                                 : u2_bt(wir_r, _9,
                                                u2_rx(wir_r, pq_lar),
                                                u2_rx(wir_r, q_yom)));
                  
        u2_rz(wir_r, yom);
        u2_rz(wir_r, mew);
        u2_rz(wir_r, lar);

        return ret;
      }
      case c3__pmcl: u2_bi_cell(wir_r, u2_t(gen), &p_gen, &q_gen);
      _mint_used(wir_r);
      {
        u2_noun ruf = u2_bt
          (wir_r, c3__clhp, 
                  u2_bc(wir_r, u2_nul, _1),
                  u2_rx(wir_r, p_gen));
        u2_noun ret = _mint_grow(wir_r, van, sut, gol, c3__zinc, ruf, q_gen);

        u2_rz(wir_r, ruf);
        return ret;
      }
      case c3__brcn: p_gen = u2_t(gen);
      _mint_used(wir_r);
      {
        u2_noun ruf = u2_bc(wir_r, u2_nul, _1);

        ret = _mint_grow(wir_r, van, sut, gol, c3__gold, ruf, p_gen);
        u2_rz(wir_r, ruf);

        return ret;
      }
      case c3__pmcn: p_gen = u2_t(gen);
      _mint_used(wir_r);
      {
        u2_noun ruf = u2_bc(wir_r, u2_nul, _1);

        ret = _mint_grow(wir_r, van, sut, gol, c3__lead, ruf, p_gen);
        u2_rz(wir_r, ruf);

        return ret;
      }
      case c3__pmls: u2_bi_cell(wir_r, u2_t(gen), &p_gen, &q_gen);
      _mint_used(wir_r);
      {
        u2_noun ruf = u2_bt
          (wir_r, c3__clhp, 
                  u2_bc(wir_r, u2_nul, _1),
                  u2_rx(wir_r, p_gen));
        u2_noun ret = _mint_grow(wir_r, van, sut, gol, c3__iron, ruf, q_gen);

        u2_rz(wir_r, ruf);
        return ret;
      }
      case c3__sggr: u2_bi_cell(wir_r, u2_t(gen), &p_gen, &q_gen);
      _mint_used(wir_r);
      {
        u2_noun hum = _mint_in(wir_r, van, sut, gol, q_gen);
        u2_noun bez;
      
          if ( u2_yes == u2_stud(p_gen) ) {
            bez = u2_rx(wir_r, p_gen);
          } else {
            bez = u2_bc(wir_r, u2_rx(wir_r, u2_h(p_gen)),
                               _mint_corn(wir_r, van, sut, u2_t(p_gen)));
          }
          ret = u2_bc(wir_r, 
                      u2_rx(wir_r, u2_h(hum)),
                      u2_bt(wir_r, _10, bez, u2_rx(wir_r, u2_t(hum))));
        
        u2_rl_lose(wir_r, hum);
        return ret;
      }
      case c3__zpts: p_gen = u2_t(gen);
      _mint_used(wir_r);
      {
        u2_noun von = u2_bn_molt(wir_r, van, j2_ut_van_vet, u2_no, 0);
        u2_noun sev = _mint_corn(wir_r, von, sut, p_gen);

        u2_rz(wir_r, von);
        return u2_bc(wir_r, c3__noun, u2_bc(wir_r, _1, sev));
      }
      case c3__zpcm: u2_bi_cell(wir_r, u2_t(gen), &p_gen, &q_gen);
      _mint_used(wir_r);
      {
        return u2_bc
          (wir_r, 
           _mint_nice(wir_r, van, 
                             gol, 
                             j2_mcy(Pt6, ut, play)(wir_r, van, sut, p_gen)),
           u2_bc(wir_r, 1, u2_rx(wir_r, q_gen)));
      }
      case c3__zpcb: u2_bi_cell(wir_r, u2_t(gen), &p_gen, &q_gen);
      {
        u2_bl_push(wir_r, u2_bc(wir_r, c3__mean, _mint_loc(wir_r, van, p_gen)));
        {
          u2_noun hum = _mint_in(wir_r, van, sut, gol, q_gen);
          u2_noun bez = u2_bt(wir_r, c3__spot, _1, u2_rx(wir_r, p_gen));

          ret = u2_bc(wir_r, 
                      u2_rx(wir_r, u2_h(hum)),
                      u2_bt(wir_r, _10, bez, u2_rx(wir_r, u2_t(hum))));

          u2_rz(wir_r, hum);
        }
        u2_bl_drop(wir_r);
        return ret;
      }
      case c3__zpcn:
      _mint_used(wir_r);
      {
        u2_noun pet   = u2_bn_hook(wir_r, van, "seed");
        u2_noun p_pet = u2_h(pet);
        u2_noun q_pet = u2_t(pet);
        u2_noun ret;

        ret = u2_bc(wir_r, _mint_nice(wir_r, van, gol, u2_rx(wir_r, p_pet)),
                           u2_bc(wir_r, _1, u2_rx(wir_r, q_pet)));

        u2_rz(wir_r, pet);
        return ret;
      }
      case c3__zpsm: u2_bi_cell(wir_r, u2_t(gen), &p_gen, &q_gen);
      _mint_used(wir_r);
      {
        u2_noun vos   = _mint_in(wir_r, van, sut, c3__noun, q_gen);
        u2_noun zur   = j2_mcy(Pt6, ut, play)(wir_r, van, sut, p_gen);
        u2_noun p_vos = u2_h(vos);
        u2_noun q_vos = u2_t(vos);
        u2_noun waz   = u2_bc(wir_r, _1, u2_rx(wir_r, p_vos));
        u2_noun cig   = j2_mby(Pt6, cell)(wir_r, zur, p_vos);
        u2_noun ret;

        ret = u2_bc(wir_r,
                    _mint_nice(wir_r, van, gol, cig),
                    j2_mby(Pt6, cons)(wir_r, waz, q_vos));

        u2_rz(wir_r, waz);
        u2_rz(wir_r, zur);
        u2_rz(wir_r, vos);

        return ret;
      }
      case c3__zpfs: p_gen = u2_t(gen);
      _mint_used(wir_r);
      {
        if ( u2_yes == _mint_vet(wir_r, van) ) {
          u2_noun zur = j2_mcy(Pt6, ut, play)(wir_r, van, sut, p_gen);
          u2_noun dun = j2_mcy(Pt6, ut, dunq)(wir_r, van, "lost", zur);

          u2_bl_push(wir_r, u2_bc(wir_r, c3__mean, dun));
          return u2_bl_error(wir_r, "mint-lost");
        }
        else {
          return u2_bt(wir_r, c3__void, _0, _0);
        }
      }
      case c3__zpzp:
      _mint_used(wir_r);
      {
        return u2_bt(wir_r, c3__void, _0, _0);
      }
    }
  }
/* functions
*/
  u2_weak                                                         //  transfer
  j2_mcc(Pt4, by, uni)(u2_wire wir_r,
                       u2_noun a,                                 //  retain
                       u2_noun b)                                 //  retain
  {
    if ( u2_nul == a ) {
      return u2_rx(wir_r, b);
    }
    else if ( u2_nul == b ) {
      return u2_rx(wir_r, a);
    }
    else {
      u2_noun l_a, n_a, r_a, lr_a, p_n_a, q_n_a;
      u2_noun l_b, n_b, r_b, lr_b, p_n_b, q_n_b;

      if ( (u2_no == u2_as_cell(a, &n_a, &lr_a)) ) {
        return u2_bl_bail(wir_r, c3__exit);
      }
      else if ( (u2_no == u2_as_cell(b, &n_b, &lr_b)) ) {
        return u2_bl_bail(wir_r, c3__exit);
      }
      else if ( (u2_no == u2_as_cell(n_a, &p_n_a, &q_n_a)) ) {
        return u2_bl_bail(wir_r, c3__exit);
      }
      else if ( (u2_no == u2_as_cell(n_b, &p_n_b, &q_n_b)) ) {
        return u2_bl_bail(wir_r, c3__exit);
      }
      else if ( u2_no == u2_as_cell(lr_a, &l_a, &r_a) ) {
        return u2_bl_bail(wir_r, c3__exit);
      }
      else if ( u2_no == u2_as_cell(lr_b, &l_b, &r_b) ) {
        return u2_bl_bail(wir_r, c3__exit);
      }
      else if ( u2_yes == j2_mbc(Pt3, vor)(wir_r, p_n_a, p_n_b) ) {
        if ( u2_yes == u2_sing(p_n_a, p_n_b) ) {
          return u2_rt(wir_r, u2_rx(wir_r, n_b),
                              j2_mcc(Pt4, by, uni)(
                                wir_r, u2_rx(wir_r, l_a), u2_rx(wir_r, l_b)),
                              j2_mcc(Pt4, by, uni)(
                                wir_r, u2_rx(wir_r, r_a), u2_rx(wir_r, r_b)));
        }
        else if ( u2_yes == j2_mbc(Pt3, hor)(wir_r, p_n_b, p_n_a) ) {
          return j2_mcc(Pt4, by, uni)(
            wir_r,
            u2_rt(wir_r,
                  u2_rx(wir_r, n_a),
                  j2_mcc(Pt4, by, uni)(wir_r,
                                      u2_rx(wir_r, l_a),
                                      u2_rt(wir_r,
                                            u2_rx(wir_r, n_b),
                                            u2_rx(wir_r, l_b),
                                            u2_rx(wir_r, u2_nul))),
                  u2_rx(wir_r, r_a)),
            u2_rx(wir_r, r_b));
        }
        else {
          return j2_mcc(Pt4, by, uni)(
            wir_r,
            u2_rt(wir_r,
                  u2_rx(wir_r, n_a),
                  u2_rx(wir_r, l_a),
                  j2_mcc(Pt4, by, uni)(wir_r,
                                      u2_rx(wir_r, r_a),
                                      u2_rt(wir_r,
                                            u2_rx(wir_r, n_b),
                                            u2_rx(wir_r, u2_nul),
                                            u2_rx(wir_r, r_b)))),
            u2_rx(wir_r, l_b));
        }
      }
      else if ( u2_yes == u2_sing(p_n_b, p_n_a) ) {
        return u2_rt(
          wir_r,
          u2_rx(wir_r, n_b),
          j2_mcc(Pt4, by, uni)(wir_r, u2_rx(wir_r, r_b), u2_rx(wir_r, r_a)),
          j2_mcc(Pt4, by, uni)(wir_r, u2_rx(wir_r, l_b), u2_rx(wir_r, l_a)));
      }
      else if ( u2_yes == j2_mbc(Pt3, hor)(wir_r, p_n_a, p_n_b) ) {
        return j2_mcc(Pt4, by, uni)(
          wir_r,
          u2_rx(wir_r, r_a),
          u2_rt(wir_r,
                u2_rx(wir_r, n_b),
                j2_mcc(Pt4, by, uni)(wir_r,
                                    u2_rt(wir_r,
                                          u2_rx(wir_r, n_a),
                                          u2_rx(wir_r, l_a),
                                          u2_rx(wir_r, u2_nul)),
                                    u2_rx(wir_r, l_b)),
                u2_rx(wir_r, r_b)));
      }
      else {
        return j2_mcc(Pt4, by, uni)(
          wir_r,
          u2_rx(wir_r, l_a),
          u2_rt(wir_r,
                u2_rx(wir_r, n_b),
                u2_rx(wir_r, l_b),
                j2_mcc(Pt4, by, uni)(wir_r,
                                    u2_rx(wir_r, r_b),
                                    u2_rt(wir_r,
                                          u2_rx(wir_r, n_a),
                                          u2_rx(wir_r, u2_nul),
                                          u2_rx(wir_r, r_a)))));
      }
    }
  }
Esempio n. 20
0
  u2_noun                                                         //  transfer
  j2_mcx(Pt6, ut, seek)(u2_wire wir_r, 
                        u2_noun van,                              //  retain
                        u2_noun sut,                              //  retain
                        u2_noun way,                              //  retain
                        u2_noun hyp)                              //  retain
  {
    if ( u2_nul == hyp ) {
      return u2_bt
        (wir_r, _1, u2_yes, u2_rx(wir_r, sut));
    }
    else if ( u2_no == u2_dust(hyp) ) {
      return u2_bl_bail(wir_r, c3__fail);
    }
    else {
      u2_noun i_hyp = u2_h(hyp);
      u2_noun t_hyp = u2_t(hyp);
      u2_noun zar; 
      u2_noun p_zar, q_zar;
      u2_noun yip, syp, ret;

      if ( u2_yes == u2_dust(i_hyp) ) {
        yip = u2_rx(wir_r, i_hyp);
      } else {
        yip = u2_bt(wir_r, u2_no, 0, u2_rx(wir_r, i_hyp));
      }

      zar = j2_mcx(Pt6, ut, seek)(wir_r, van, sut, way, t_hyp);
      u2_as_cell(zar, &p_zar, &q_zar);

#if 0
      if ( u2_yes == u2_h(yip) ) {
        sic = u2_nul;
      } else {
        // sic = _seek_silk(wir_r, van, u2_h(u2_t(yip)), zar);
        sic = u2_nul;
      }
      if ( u2_nul != sic ) {
        u2_rz(wir_r, yip);
        u2_rz(wir_r, zar);

        return u2_t(sic);
      }
#endif

      if ( u2_yes == u2_h(q_zar) ) {
        syp = u2_rx(wir_r, u2_t(q_zar));
      } else {
        u2_noun pq_zar, qq_zar;
        u2_noun wip;

        u2_as_cell(u2_t(q_zar), &pq_zar, &qq_zar);
        wip = _seek_flat(wir_r, qq_zar);
        syp = j2_mcy(Pt6, ut, fire)(wir_r, van, sut, wip);

        u2_rz(wir_r, wip);
      }

      if ( u2_no == u2_h(yip) ) {
        u2_noun p_yip, q_yip, hud;

        if ( u2_no == u2_as_cell(u2_t(yip), &p_yip, &q_yip) ) {
          return u2_bl_bail(wir_r, c3__fail);
        }
        hud = j2_mcy(Pt6, ut, fink)(wir_r, van, syp, p_yip, way, q_yip);
        {
          u2_noun p_hud, q_hud;

          u2_as_cell(hud, &p_hud, &q_hud);

          ret = u2_bc(wir_r, j2_mbc(Pt3, peg)(wir_r, p_zar, p_hud), 
                             u2_rx(wir_r, q_hud));
          u2_rz(wir_r, hud);
        }
      } 
      else {
        u2_noun p_yip = u2_t(yip);

        if ( u2_no == u2_stud(p_yip) ) {
          return u2_bl_bail(wir_r, c3__fail);
        }
        else {
          ret = u2_bt
            (wir_r, j2_mbc(Pt3, peg)(wir_r, p_zar, p_yip),
                    u2_yes,
                    j2_mcy(Pt6, ut, peek)(wir_r, van, syp, way, p_yip));
        }
      }
      u2_rz(wir_r, yip);
      u2_rz(wir_r, syp);
      u2_rz(wir_r, zar);
      return ret;
    }
  }
Esempio n. 21
0
File: look.c Progetto: Gruelty/urbit
/* internals
*/
  static u2_noun
  _look_in(u2_wire wir_r,
           u2_noun cog,
           u2_noun dab,
           u2_atom axe)
  {
    if ( u2_nul == dab ) {
      return u2_nul;
    }
    else {
      u2_noun n_dab, l_dab, r_dab; 
     
      u2_as_trel(dab, &n_dab, &l_dab, &r_dab);
      if ( u2_no == u2_dust(n_dab) ) {
        return u2_bl_bail(wir_r, c3__fail);
      } 
      else {
        u2_noun pn_dab = u2_h(n_dab);
        u2_noun qn_dab = u2_t(n_dab);
 
        if ( (u2_nul == l_dab) && (u2_nul == r_dab) ) {
          if ( (u2_yes == u2_dust(qn_dab)) &&
               (u2_yes == u2_sing(cog, pn_dab)) ) {
            return u2_bt(wir_r, u2_nul, 
                                u2_rx(wir_r, axe), 
                                u2_rx(wir_r, qn_dab));
          }
          else {
            return u2_nul;
          }
        }
        else if ( (u2_nul == l_dab) ) {
          if ( (u2_yes == u2_dust(qn_dab)) &&
               (u2_yes == u2_sing(cog, pn_dab)) ) {
            return u2_bt(wir_r, u2_nul, 
                                j2_mbc(Pt3, peg)(wir_r, axe, _2),
                                u2_rx(wir_r, qn_dab));
          }
          else {
            if ( u2_yes == j2_mbc(Pt3, gor)(wir_r, cog, pn_dab) ) {
              return u2_nul;
            }
            else {
              u2_noun pro;

              axe = j2_mbc(Pt3, peg)(wir_r, axe, _3);
              pro = _look_in(wir_r, cog, r_dab, axe);
              u2_rl_lose(wir_r, axe);
              return pro;
            }
          }
        }
        else if ( (u2_nul == r_dab) ) {
          if ( (u2_yes == u2_dust(qn_dab)) &&
               (u2_yes == u2_sing(cog, pn_dab)) ) {
            return u2_bt(wir_r, u2_nul, 
                                j2_mbc(Pt3, peg)(wir_r, axe, _2),
                                u2_rx(wir_r, qn_dab));
          }
          else {
            if ( u2_yes == j2_mbc(Pt3, gor)(wir_r, cog, pn_dab) ) {
              u2_noun pro;

              axe = j2_mbc(Pt3, peg)(wir_r, axe, _3);
              pro = _look_in(wir_r, cog, l_dab, axe);
              u2_rl_lose(wir_r, axe);
              return pro;
            }
            else {
              return u2_nul;
            }
          }
        }
        else {
          if ( (u2_yes == u2_dust(qn_dab)) &&
               (u2_yes == u2_sing(cog, pn_dab)) ) {
            return u2_bt(wir_r, u2_nul, 
                                j2_mbc(Pt3, peg)(wir_r, axe, _2),
                                u2_rx(wir_r, qn_dab));
          }
          else {
            if ( u2_yes == j2_mbc(Pt3, gor)(wir_r, cog, pn_dab) ) {
              u2_noun pro;

              axe = j2_mbc(Pt3, peg)(wir_r, axe, _6);
              pro = _look_in(wir_r, cog, l_dab, axe);
              u2_rl_lose(wir_r, axe);
              return pro;
            }
            else {
              u2_noun pro;

              axe = j2_mbc(Pt3, peg)(wir_r, axe, _7);
              pro = _look_in(wir_r, cog, r_dab, axe);
              u2_rl_lose(wir_r, axe);
              return pro;
            }
          }
        }
      }
    }
  }
/* functions
*/
  u2_noun                                                         //  produce
  j2_mby(Pt5, rub)(u2_wire wir_r,
                   u2_atom a,                                     //  retain
                   u2_atom b)                                     //  retain
  {
    u2_atom c, d, e;
    u2_atom w, x, y, z;
    u2_atom p, q;

    u2_atom m = j2_mbc(Pt1, add)(wir_r, a, u2_met(0, b));

    //  Compute c and d.
    {
      x = u2_rx(wir_r, a);

      while ( _0 == j2_mbc(Pt3, cut)(wir_r, _0, x, _1, b) ) {
        u2_atom y = j2_mbc(Pt1, inc)(wir_r, x);

        //  Sanity check: crash if decoding more bits than available
        if ( u2_yes == j2_mbc(Pt1, gth)(wir_r, x, m)) {
          //  fprintf(stderr, "[%%rub-hard %d %d %d]\r\n", a, x, m);
          return u2_bl_bail(wir_r, c3__exit);
        }

        u2_rz(wir_r, x);
        x = y;
      }
      if ( u2_yes == u2_sing(x, a) ) {
        u2_rz(wir_r, x);
        return u2_bc(wir_r, _1, _0);
      }
      c = j2_mbc(Pt1, sub)(wir_r, x, a);
      d = j2_mbc(Pt1, inc)(wir_r, x);

      u2_rz(wir_r, x);
    }

    //  Compute e, p, q.
    {
      x = j2_mbc(Pt1, dec)(wir_r, c);
      y = j2_mbc(Pt3, bex)(wir_r, x);
      z = j2_mbc(Pt3, cut)(wir_r, _0, d, x, b);

      e = j2_mbc(Pt1, add)(wir_r, y, z);
      u2_rz(wir_r, y); u2_rz(wir_r, z);

      w = j2_mbc(Pt1, add)(wir_r, c, c);
      y = j2_mbc(Pt1, add)(wir_r, w, e);
      z = j2_mbc(Pt1, add)(wir_r, d, x);

      p = j2_mbc(Pt1, add)(wir_r, w, e);
      q = j2_mbc(Pt3, cut)(wir_r, _0, z, e, b);

      u2_rz(wir_r, w); u2_rz(wir_r, x); u2_rz(wir_r, y); u2_rz(wir_r, z);

      return u2_bc(wir_r, p, q);
    }
  }
/* functions
*/
  u2_weak                                                         //  transfer
  j2_mcc(Pt4, by, put)(u2_wire wir_r,
                       u2_noun a,                                 //  retain
                       u2_noun b,                                 //  retain
                       u2_noun c)                                 //  retain
  {
    if ( u2_nul == a ) {
      return u2_rt(wir_r,
                   u2_rc(wir_r, u2_rx(wir_r, b),
                                u2_rx(wir_r, c)),
                   u2_nul,
                   u2_nul);
    }
    else {
      u2_noun l_a, n_a, r_a, pn_a, qn_a;
      u2_noun d, l_d, n_d, r_d;

      if ( (u2_no == u2_as_trel(a, &n_a, &l_a, &r_a)) ||
           (u2_no == u2_as_cell(n_a, &pn_a, &qn_a)) )
      {
        return u2_bl_bail(wir_r, c3__exit);
      }
      else if ( u2_yes == u2_sing(pn_a, b) ) {
        if ( u2_yes == u2_sing(qn_a, c) ) {
          return u2_rx(wir_r, a);
        } else {
          return u2_rt
            (wir_r, u2_rc(wir_r, u2_rx(wir_r, b), u2_rx(wir_r, c)),
                    u2_rx(wir_r, l_a),
                    u2_rx(wir_r, r_a));
        }
      }
      else {
        if ( u2_yes == j2_mbc(Pt3, gor)(wir_r, b, pn_a) ) {
          d = j2_mcc(Pt4, by, put)(wir_r, l_a, b, c);

          if ( u2_yes == j2_mbc(Pt3, vor)(wir_r, pn_a, u2_h(u2_h(d))) ) {
            return u2_rt(wir_r, u2_rx(wir_r, n_a),
                                d,
                                u2_rx(wir_r, r_a));
          }
          else {
            u2_as_trel(d, &n_d, &l_d, &r_d);
            {
              u2_noun e = u2_rt
                (wir_r, u2_rx(wir_r, n_d),
                        u2_rx(wir_r, l_d),
                        u2_rt(wir_r,
                              u2_rx(wir_r, n_a),
                              u2_rx(wir_r, r_d),
                              u2_rx(wir_r, r_a)));

              u2_rl_lose(wir_r, d);
              return e;
            }
          }
        }
        else {
          d = j2_mcc(Pt4, by, put)(wir_r, r_a, b, c);

          if ( u2_yes == j2_mbc(Pt3, vor)(wir_r, pn_a, u2_h(u2_h(d))) ) {
            return u2_rt(wir_r, u2_rx(wir_r, n_a),
                                u2_rx(wir_r, l_a),
                                d);
          }
          else {
            u2_as_trel(d, &n_d, &l_d, &r_d);
            {
              u2_noun e = u2_rt
                (wir_r, u2_rx(wir_r, n_d),
                        u2_rt(wir_r,
                              u2_rx(wir_r, n_a),
                              u2_rx(wir_r, l_a),
                              u2_rx(wir_r, l_d)),
                        u2_rx(wir_r, r_d));

              u2_rl_lose(wir_r, d);
              return e;
            }
          }
        }
      }
    }
  }
Esempio n. 24
0
/* logic
*/
  static u2_noun
  _find_in(u2_wire wir_r,
           u2_noun van,
           u2_noun sut,
           u2_noun way,
           u2_noun cog,
           u2_noun gil)
  {
    u2_noun p_sut, q_sut;

    if ( u2_yes == u2_stud(sut) ) {
      return u2_nul;
    }
    else switch ( u2_h(sut) ) {
      default: return u2_nul;

      case c3__cell: {
        if ( (u2_no == u2_as_trel(sut, 0, &p_sut, &q_sut)) ) {
          return u2_bl_bail(wir_r, c3__fail);
        } else {
          u2_noun taf = _find_in(wir_r, van, q_sut, way, cog, gil);

          if ( u2_nul == taf ) {
            u2_noun bov = _find_in(wir_r, van, p_sut, way, cog, gil);

            if ( u2_nul == bov ) {
              return u2_nul;
            } else {
              u2_noun p_bov, q_bov;
              u2_noun pro;

              u2_mean(bov, 6, &p_bov, 7, &q_bov, 0);
              pro = u2_bt
                (wir_r, u2_nul,
                        j2_mbc(Pt3, peg)(wir_r, 2, p_bov),
                        u2_rx(wir_r, q_bov));

              u2_rl_lose(wir_r, bov);
              return pro;
            }
          } else {
            u2_noun p_taf, q_taf;
            u2_noun pro;

            u2_mean(taf, 6, &p_taf, 7, &q_taf, 0);
            pro = u2_bt
              (wir_r, u2_nul,
                      j2_mbc(Pt3, peg)(wir_r, 3, p_taf),
                      u2_rx(wir_r, q_taf));

            u2_rl_lose(wir_r, taf);
            return pro;
          }
        }
      }
      case c3__core: {
        u2_noun pq_sut, qq_sut, rq_sut;
        u2_noun prq_sut, qrq_sut;

        if ( (u2_no == u2_as_trel(sut, 0, &p_sut, &q_sut)) ||
             (u2_no == u2_as_trel(q_sut, &pq_sut, &qq_sut, &rq_sut)) ||
             (u2_no == u2_as_cell(rq_sut, &prq_sut, &qrq_sut)) )
        {
          return u2_bl_bail(wir_r, c3__fail);
        } else {
          u2_noun zem = j2_mby(Pt6, look)(wir_r, cog, qrq_sut);

          if ( u2_nul == zem ) {
            u2_noun taf = _find_in(wir_r, van, p_sut, way, cog, gil);

            if ( u2_nul == taf ) {
              return u2_nul;
            } else {
              u2_noun p_taf, q_taf;
              u2_noun pro;

              u2_mean(taf, 6, &p_taf, 7, &q_taf, 0);

              if ( u2_no == j2_mcy(Pt6, ut, park)(wir_r, van, sut, way, p_taf) )
              {
                u2_noun weh = j2_mcy(Pt6, ut, shep)
                  (wir_r, van, "way", 'a', u2_rx(wir_r, way));
                u2_noun waz = j2_mcy(Pt6, ut, shep)
                  (wir_r, van, "axis", 'd', u2_rx(wir_r, p_taf));

                u2_bl_push(wir_r, u2_bc(wir_r, c3__mean, weh));
                u2_bl_push(wir_r, u2_bc(wir_r, c3__mean, waz));
                return u2_bl_error(wir_r, "find-park");
              }
              else {
                pro = u2_bt
                  (wir_r, u2_nul,
                          j2_mbc(Pt3, peg)(wir_r, 2, p_taf),
                          u2_rx(wir_r, q_taf));

                u2_rl_lose(wir_r, taf);
                return pro;
              }
            }
          }
          else {
            u2_noun p_zem, q_zem;
            u2_noun pro;

            u2_mean(zem, 6, &p_zem, 7, &q_zem, 0);

            pro = u2_bq
              (wir_r, u2_nul,
                      _1,
                      u2_no,
                      u2_bc
                        (wir_r, j2_mbc(Pt3, peg)(wir_r, 3, p_zem),
                                u2_bc(wir_r, 
                                      u2_bc(wir_r, u2_rx(wir_r, sut),
                                                   u2_rx(wir_r, q_zem)),
                                      u2_nul)));
            u2_rz(wir_r, zem);
            return pro;
          }
        }
      }
      case c3__face: {
        if ( (u2_no == u2_as_trel(sut, 0, &p_sut, &q_sut)) ) {
          return u2_bl_bail(wir_r, c3__fail);
        } else { 
          if ( u2_no == u2_sing(cog, p_sut) ) {
            return u2_nul;
          } else {
            return u2_bq(wir_r, u2_nul, _1, u2_yes, u2_rx(wir_r, q_sut));
          }
        }
      }
      case c3__cube:
      case c3__fine: {
        u2_type fop = j2_mcy(Pt6, ut, repo)(wir_r, van, sut);
        u2_noun ret = _find_in(wir_r, van, fop, way, cog, gil);
        
        u2_rz(wir_r, fop);
        return ret;
      }
      case c3__fork: {
        if ( (u2_no == u2_as_trel(sut, 0, &p_sut, &q_sut)) ) {
          return u2_bl_bail(wir_r, c3__fail);
        }
        else {
          if ( (u2_yes == j2_mcc(Pt4, in, has)(wir_r, gil, q_sut)) ) {
            return _find_in(wir_r, van, p_sut, way, cog, gil);
          } 
          else if ( (u2_yes == j2_mcc(Pt4, in, has)(wir_r, gil, p_sut)) ) {
            return _find_in(wir_r, van, q_sut, way, cog, gil);
          } else {
            u2_noun hax = _find_in(wir_r, van, p_sut, way, cog, gil);
            u2_noun yor = _find_in(wir_r, van, q_sut, way, cog, gil);
            u2_noun p_hax, q_hax;
            u2_noun p_yor, q_yor;

            if ( u2_nul != hax ) {
              u2_mean(hax, 6, &p_hax, 7, &q_hax, 0);
            }
            if ( u2_nul != yor ) {
              u2_mean(yor, 6, &p_yor, 7, &q_yor, 0);
            }

            if ( u2_nul == hax ) {
              if ( u2_nul == yor ) {
                return u2_nul;
              } else {
                u2_noun pek = j2_mcy(Pt6, ut, peek)
                  (wir_r, van, p_sut, way, p_yor);
                u2_noun nuz = j2_mcy(Pt6, ut, nest)
                  (wir_r, van, c3__void, u2_no, pek);

                u2_rz(wir_r, pek);

                if ( u2_yes == nuz ) {
                  return yor;
                } else return u2_bl_error(wir_r, "find-fork");
              }
            }
            else {
              if ( u2_nul == yor ) {
                u2_noun pek = j2_mcy(Pt6, ut, peek)
                  (wir_r, van, q_sut, way, p_hax);
                u2_noun nuz = j2_mcy(Pt6, ut, nest)
                  (wir_r, van, c3__void, u2_no, pek);

                u2_rz(wir_r, pek);

                if ( u2_yes == nuz ) {
                  return hax;
                } else return u2_bl_error(wir_r, "find-fork");
              }
              else {
                if ( u2_yes == u2_sing(hax, yor) ) {
                  u2_rz(wir_r, yor);

                  return hax;
                } else {
                  u2_noun ret;

                  u2_mean(hax, 6, &p_hax, 7, &q_hax, 0);
                  u2_mean(yor, 6, &p_yor, 7, &q_yor, 0);

                  if ( u2_no == u2_sing(p_hax, p_yor) ) {
                    return u2_bl_error(wir_r, "find-fork");
                  }

                  if ( u2_yes == u2_h(q_hax) ) {
                    if ( u2_yes != u2_h(q_yor) ) {
                      return u2_bl_error(wir_r, "find-fork");
                    } else {
                      u2_noun pq_hax = u2_t(q_hax);
                      u2_noun pq_yor = u2_t(q_yor);

                      ret = u2_bq
                        (wir_r, 
                         u2_nul,
                         u2_rx(wir_r, p_hax),
                         u2_yes,
                         j2_mby(Pt6, fork)(wir_r, pq_hax, pq_yor));
                    }
                  }
                  else {
                    if ( u2_yes == u2_h(q_yor) ) {
                      return u2_bl_error(wir_r, "find-fork");
                    }
                    else {
                      u2_noun pq_hax, qq_hax, pq_yor, qq_yor;

                      u2_bi_cell(wir_r, u2_t(q_hax), &pq_hax, &qq_hax);
                      u2_bi_cell(wir_r, u2_t(q_yor), &pq_yor, &qq_yor);

                      if ( u2_no == u2_sing(pq_hax, pq_yor) ) {
                        return u2_bl_error(wir_r, "find-fork");
                      } else {
                        ret = u2_bq
                          (wir_r, u2_nul,
                                  u2_rx(wir_r, p_hax),
                                  u2_no,
                                  u2_bc
                                    (wir_r, u2_rx(wir_r, pq_hax),
                                            j2_mbc(Pt2, weld)
                                              (wir_r, qq_hax, qq_yor)));
                      }
                    }
                  }
                  u2_rz(wir_r, yor);
                  u2_rz(wir_r, hax);

                  return ret;
                }
              }
            }
          }
        }
      } 
      case c3__hold: p_sut = u2_t(sut);
      {
        if ( (u2_yes == j2_mcc(Pt4, in, has)(wir_r, gil, sut)) ) {
          return u2_nul;
        } 
        else {
          u2_noun zoc = j2_mcc(Pt4, in, put)(wir_r, gil, sut);
          u2_type fop = j2_mcy(Pt6, ut, repo)(wir_r, van, sut);
          u2_noun pro = _find_in(wir_r, van, fop, way, cog, zoc);

          u2_rl_lose(wir_r, fop);
          u2_rl_lose(wir_r, zoc);

          return pro;
        }
      }
    }
  }
Esempio n. 25
0
  static u2_noun                                                  //  produce
  _peek_in(u2_wire wir_r,
           u2_noun van,                                           //  retain
           u2_noun sut,                                           //  retain
           u2_noun way,                                           //  retain
           u2_atom axe,                                           //  retain
           u2_noun gil)                                           //  retain
  {
    u2_noun p_sut, q_sut;
    u2_noun pro;

    if ( (u2_no == u2_dust(sut)) ) switch ( sut ) {
      default: return u2_bl_bail(wir_r, c3__fail);

      case c3__noun: {
        return c3__noun;
      }
      case c3__void: {
        return c3__void;
      }
    }
    else switch ( u2_h(sut) ) {
      default: return u2_bl_bail(wir_r, c3__fail);

      case c3__atom: {
        return c3__void;
      }
      case c3__cell: {
        if ( (u2_no == u2_as_trel(sut, 0, &p_sut, &q_sut)) ) {
          return u2_bl_bail(wir_r, c3__fail);
        } else {
          u2_atom tip = j2_mbc(Pt3, cap)(wir_r, axe);
          u2_atom tap = j2_mbc(Pt3, mas)(wir_r, axe);

          if ( _2 == tip ) {
            pro = j2_mcx(Pt6, ut, peek)(wir_r, van, p_sut, way, tap);
          }
          else {
            pro = j2_mcx(Pt6, ut, peek)(wir_r, van, q_sut, way, tap);
          }
          u2_rl_lose(wir_r, tap); 
          u2_rl_lose(wir_r, tip);

          return pro;
        }
      }
      case c3__core: {
        u2_noun pq_sut, qq_sut, rq_sut;
        u2_noun prq_sut, qrq_sut;

        if ( (u2_no == u2_as_trel(sut, 0, &p_sut, &q_sut)) ||
             (u2_no == u2_as_trel(q_sut, &pq_sut, &qq_sut, &rq_sut)) ||
             (u2_no == u2_as_cell(rq_sut, &prq_sut, &qrq_sut)) )
        {
          return u2_bl_bail(wir_r, c3__fail);
        } else {
          u2_atom tip = j2_mbc(Pt3, cap)(wir_r, axe);
          u2_atom tap = j2_mbc(Pt3, mas)(wir_r, axe);

          if ( _3 == tip ) {
            if ( u2_no == j2_mcy(Pt6, ut, park)(wir_r, van, sut, way, tap) ) 
            {
              // u2_noun dun = j2_mcy(Pt6, ut, dunq)(wir_r, van, "type", sut);
              u2_noun waz = j2_mcy(Pt6, ut, shep)
                (wir_r, van, "axis", 'd', u2_rx(wir_r, axe));

              // u2_bl_push(wir_r, u2_bc(wir_r, c3__mean, dun));
              u2_bl_push(wir_r, u2_bc(wir_r, c3__mean, waz));

              return u2_bl_error(wir_r, "peek-park");
            }
            else pro = j2_mcx(Pt6, ut, peek)(wir_r, van, p_sut, way, tap);
          }
          else {
            pro = c3__noun;
          }
          u2_rl_lose(wir_r, tap); 
          u2_rl_lose(wir_r, tip);

          return pro;
        }
      }
      case c3__cube: {
        if ( (u2_no == u2_as_trel(sut, 0, &p_sut, &q_sut)) ) {
          return u2_bl_bail(wir_r, c3__fail);
        } else {
          return _peek_in(wir_r, van, q_sut, way, axe, gil);
        }
      }
      case c3__face: {
        if ( (u2_no == u2_as_trel(sut, 0, &p_sut, &q_sut)) ) {
          return u2_bl_bail(wir_r, c3__fail);
        } else {
          return _peek_in(wir_r, van, q_sut, way, axe, gil);
        }
      }
      case c3__fork: {
        if ( (u2_no == u2_as_trel(sut, 0, &p_sut, &q_sut)) ) {
          return u2_bl_bail(wir_r, c3__fail);
        } else {
          u2_noun hed = _peek_in(wir_r, van, p_sut, way, axe, gil);
          u2_noun tal = _peek_in(wir_r, van, q_sut, way, axe, gil);

          pro = j2_mby(Pt6, fork)(wir_r, hed, tal);

          u2_rl_lose(wir_r, hed);
          u2_rl_lose(wir_r, tal);

          return pro;
        }
      } 
      case c3__hold: {
        p_sut = u2_t(sut);
        if ( (u2_yes == j2_mcc(Pt4, in, has)(wir_r, gil, sut)) ) {
          return c3__void;
        } 
        else {
          u2_noun zoc = j2_mcc(Pt4, in, put)(wir_r, gil, sut);
          u2_type fop = j2_mcy(Pt6, ut, repo)(wir_r, van, sut);
          u2_noun pro = _peek_in(wir_r, van, fop, way, axe, zoc);

          u2_rl_lose(wir_r, fop);
          u2_rl_lose(wir_r, zoc);

          return pro;
        }
      }
    }
  }
Esempio n. 26
0
/* zuse_next4(): forward iteration from source, still a hack.
*/
void
zuse_next4(struct zuse_state* fod_f,
           const char*        ken_c,        //  now 270
           const char*        nex_c,        //  now 269
           const char*        ult_c,        //  now 268
           const char*        arg_c)        //  command-line string
{
  u2_wire wir_r = fod_f->wir_r;
  u2_noun ken   = u2_ux_read(wir_r, ken_c, "watt");
  u2_noun nex   = u2_ux_read(wir_r, nex_c, "watt");
  u2_noun ult   = u2_ux_read(wir_r, ult_c, "watt");
  u2_noun arg   = arg_c ? u2_bn_string(wir_r, arg_c) : u2_none;

  if ( u2_none == ken ) {
    printf("zuse: %s: no file\n", ken_c);
    u2_bl_bail(wir_r);
  }
  if ( u2_none == nex ) {
    printf("zuse: %s: no file\n", nex_c);
    u2_bl_bail(wir_r);
  }
  if ( u2_none == ult ) {
    printf("zuse: %s: no file\n", ult_c);
    u2_bl_bail(wir_r);
  }

  { 
    u2_noun gen = j2_mbc(watt_271, ream)(wir_r, ken);
    u2_noun xen = j2_mbc(watt_270, ream)(wir_r, nex);
    u2_noun las = j2_mbc(watt_269, ream)(wir_r, ult);
    u2_noun gar = (arg_c ? j2_mbc(watt_269, ream)(wir_r, arg) : u2_none);

    /* Boot sequence!
    */
    {
      u2_noun sho, hos, osh;

      fprintf(stderr, "{boot: %s}\n", ken_c);
      sho = zuse_boot_gene(wir_r, fod_f->bot, gen);
      if ( u2_none == sho ) {
        return;
      }
      fprintf(stderr, "{boot: %s}\n", nex_c);
      hos = zuse_boot_gene(wir_r, sho, xen);
      if ( u2_none == hos ) {
        return;
      }
      fprintf(stderr, "{boot: %s}\n", ult_c);
      osh = zuse_boot_gene(wir_r, hos, las);
      if ( u2_none == osh ) {
        return;
      }

      if ( u2_none != gar ) {
        // fprintf(stderr, "{fire: %s}\n", ken_c);
        // zuse_fire_gene(wir_r, fod_f->bot, sho, gar);
        
        // fprintf(stderr, "{fire: %s}\n", nex_c);
        // zuse_fire_gene(wir_r, sho, hos, gar);

        fprintf(stderr, "{fire: %s}\n", ult_c);
        zuse_fire_gene(wir_r, hos, osh, gar);
      }

      u2_rz(wir_r, sho);
      u2_rz(wir_r, hos);
      u2_rz(wir_r, osh);
    }
  }
}
Esempio n. 27
0
  u2_noun                                                         //  transfer
  j2_mcx(Pt6, ut, cull)(u2_wire wir_r, 
                        u2_noun van,                              //  retain
                        u2_noun sut,                              //  retain
                        u2_flag pol,                              //  retain
                        u2_atom axe,                              //  retain
                        u2_noun ref)                              //  retain
  {
    u2_noun ret, p_sut, q_sut, r_sut;

    if ( _1 == axe ) {
      if ( u2_yes == pol ) {
        return j2_mcy(Pt6, ut, fuse)(wir_r, van, sut, ref);
      } else {
        return j2_mcy(Pt6, ut, crop)(wir_r, van, sut, ref);
      }
    } else {
      u2_atom now = j2_mbc(Pt3, cap)(wir_r, axe);
      u2_atom lat = j2_mbc(Pt3, mas)(wir_r, axe);

      if ( u2_no == u2_dust(sut) ) switch ( sut ) {
        default: return u2_bl_bail(wir_r, c3__fail);

        case c3__noun: {
          u2_noun pyr = j2_mcy(Pt6, ut, repo)(wir_r, van, sut);
          u2_noun yot = j2_mcx(Pt6, ut, cull)(wir_r, van, pyr, pol, axe, ref);
          
          if ( u2_yes == u2_sing(pyr, yot) ) {
            ret = u2_rx(wir_r, sut); 
          } else {
            ret = u2_rx(wir_r, yot);
          }
          u2_rl_lose(wir_r, pyr);
          u2_rl_lose(wir_r, yot);
          break;
        }
        case c3__void: {
          ret = c3__void;
        }
      }
      else switch ( u2_h(sut) ) {
        default: return u2_bl_bail(wir_r, c3__fail);

        case c3__atom: {
          ret = c3__void; 
          break;
        }
        case c3__cell: u2_bi_cell(wir_r, u2_t(sut), &p_sut, &q_sut);
        {
          u2_noun hub;

          if ( _2 == now ) {
            hub = j2_mcx(Pt6, ut, cull)(wir_r, van, p_sut, pol, lat, ref);
            ret = j2_mby(Pt6, cell)(wir_r, hub, q_sut);
          } else {
            hub = j2_mcx(Pt6, ut, cull)(wir_r, van, q_sut, pol, lat, ref);
            ret = j2_mby(Pt6, cell)(wir_r, p_sut, hub);
          }
          u2_rl_lose(wir_r, hub);
          break;
        }
        case c3__core: u2_bi_cell(wir_r, u2_t(sut), &p_sut, &q_sut);
        {
          if ( _2 != now ) {
            ret = u2_rx(wir_r, sut);
          } else {
            u2_noun hub = j2_mcx(Pt6, ut, cull)
                                     (wir_r, van, p_sut, pol, lat, ref);

            ret = j2_mby(Pt6, core)(wir_r, hub, q_sut);

            u2_rl_lose(wir_r, hub);
          }
          break;
        }
        case c3__face: u2_bi_cell(wir_r, u2_t(sut), &p_sut, &q_sut);
        {
          u2_noun hic = j2_mcx(Pt6, ut, cull)
                                      (wir_r, van, q_sut, pol, axe, ref);

          if ( u2_yes == u2_sing(hic, q_sut) ) {
            ret = u2_rx(wir_r, sut); 
          } else {
            ret = j2_mby(Pt6, face)(wir_r, p_sut, hic);
          }
          u2_rl_lose(wir_r, hic);

          break;
        }
        case c3__fine: u2_bi_trel(wir_r, u2_t(sut), &p_sut, &q_sut, &r_sut);
        {
          u2_noun hic = j2_mcx(Pt6, ut, cull)(wir_r, van, r_sut, pol, axe, ref);

          if ( u2_yes == u2_sing(hic, r_sut) ) {
            ret = u2_rx(wir_r, sut); 
          } else {
            ret = j2_mby(Pt6, fine)(wir_r, p_sut, q_sut, hic);
          }
          u2_rl_lose(wir_r, hic);

          break;
        }
        case c3__fork: u2_bi_cell(wir_r, u2_t(sut), &p_sut, &q_sut);
        {
          u2_noun sin = j2_mcx(Pt6, ut, cull)(wir_r, van, p_sut, pol, axe, ref);
          u2_noun dex = j2_mcx(Pt6, ut, cull)(wir_r, van, q_sut, pol, axe, ref);

          ret = j2_mby(Pt6, fork)(wir_r, sin, dex);
          u2_rl_lose(wir_r, sin);
          u2_rl_lose(wir_r, dex);

          return ret;
        }
        case c3__cube: 
        case c3__hold: 
        {
          u2_noun pyr = j2_mcy(Pt6, ut, repo)(wir_r, van, sut);
          u2_noun yot = j2_mcx(Pt6, ut, cull)(wir_r, van, pyr, pol, axe, ref);

          if ( u2_yes == u2_sing(pyr, yot) ) {
            ret = u2_rx(wir_r, sut); 
          } else {
            ret = u2_rx(wir_r, yot);
          }
          u2_rl_lose(wir_r, pyr);
          u2_rl_lose(wir_r, yot);
          break;
        }
      }
      u2_rl_lose(wir_r, lat);
      return ret;
    }
  }