Fix jet discrepancies on ill-typed identity cases.

This commit is contained in:
Dan Haffey 2016-08-03 22:56:26 -07:00
parent 6e45acd5cc
commit b023a78ee6
8 changed files with 46 additions and 20 deletions

View File

@ -15,6 +15,9 @@
return u3i_words(1, &c);
}
else if ( 0 == a ) {
return u3k(b);
}
else {
mpz_t a_mp, b_mp;
@ -34,7 +37,7 @@
if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) ||
(c3n == u3ud(a)) ||
(c3n == u3ud(b)) )
(c3n == u3ud(b) && a != 0) )
{
return u3m_bail(c3__exit);
} else {

View File

@ -13,6 +13,12 @@
if ( _(u3a_is_cat(a)) && _(u3a_is_cat(b)) ) {
return __(a < b);
}
else if ( 0 == a ) {
return c3y;
}
else if ( 0 == b ) {
return c3n;
}
else {
mpz_t a_mp, b_mp;
u3_noun cmp;
@ -34,8 +40,8 @@
u3_noun a, b;
if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) ||
(c3n == u3ud(a)) ||
(c3n == u3ud(b)) )
(c3n == u3ud(b) && a != 0) ||
(c3n == u3ud(a) && b != 0) )
{
return u3m_bail(c3__exit);
} else {

View File

@ -15,6 +15,9 @@
return u3i_chubs(1, &c);
}
else if ( 0 == a ) {
return 0;
}
else {
mpz_t a_mp, b_mp;
@ -34,7 +37,7 @@
if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) ||
(c3n == u3ud(a)) ||
(c3n == u3ud(b)) )
(c3n == u3ud(b) && a != 0) )
{
return u3m_bail(c3__exit);
} else {

View File

@ -16,6 +16,9 @@
}
else return (a - b);
}
else if ( 0 == b ) {
return u3k(a);
}
else {
mpz_t a_mp, b_mp;
@ -41,8 +44,8 @@
u3_noun a, b;
if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) ||
(c3n == u3ud(a)) ||
(c3n == u3ud(b)) )
(c3n == u3ud(b)) ||
(c3n == u3ud(a) && b != 0) )
{
return u3m_bail(c3__exit);
} else {

View File

@ -10,7 +10,10 @@
u3qb_scag(u3_atom a,
u3_noun b)
{
if ( !_(u3a_is_cat(a)) ) {
if ( u3_nul == b ) {
return u3_nul;
}
else if ( !_(u3a_is_cat(a)) ) {
return u3m_bail(c3__fail);
}
else {
@ -39,7 +42,7 @@
u3_noun a, b;
if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) ||
(c3n == u3ud(a)) )
(c3n == u3ud(a) && u3_nul != b) )
{
return u3m_bail(c3__exit);
} else {

View File

@ -9,7 +9,10 @@
u3_noun
u3qb_slag(u3_atom a, u3_noun b)
{
if ( !_(u3a_is_cat(a)) ) {
if ( u3_nul == b ) {
return u3_nul;
}
else if ( !_(u3a_is_cat(a)) ) {
return u3m_bail(c3__fail);
}
else {
@ -31,7 +34,7 @@
u3_noun a, b;
if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) ||
(c3n == u3ud(a)) )
(c3n == u3ud(a) && u3_nul != b) )
{
return u3m_bail(c3__exit);
} else {

View File

@ -10,10 +10,11 @@
u3qc_met(u3_atom a,
u3_atom b)
{
if ( !_(u3a_is_cat(a)) || (a >= 32) ) {
if ( 0 == b ) {
return 0;
} else return 1;
}
else if ( !_(u3a_is_cat(a)) || (a >= 32) ) {
return 1;
}
else {
c3_w met_w = u3r_met(a, b);
@ -30,8 +31,8 @@
u3_noun a, b;
if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) ||
(c3n == u3ud(a)) ||
(c3n == u3ud(b)) )
(c3n == u3ud(b)) ||
(c3n == u3ud(a) && 0 != b) )
{
return u3m_bail(c3__exit);
} else {

View File

@ -10,6 +10,10 @@
u3qc_peg(u3_atom a,
u3_atom b)
{
if ( 1 == b ) {
return u3k(a);
}
u3_atom c, d, e, f, g, h;
c = u3r_met(0, b);
@ -33,10 +37,10 @@
u3_noun a, b;
if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) ||
(c3n == u3ud(a)) ||
(c3n == u3ud(b)) ||
(0 == a) ||
(0 == b) )
(0 == b) ||
(c3n == u3ud(b)) ||
(c3n == u3ud(a) && b != 1) )
{
return u3m_bail(c3__exit);
} else {