[BACK]Return to strobj.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2000 / builtin

Diff for /OpenXM_contrib2/asir2000/builtin/strobj.c between version 1.54 and 1.55

version 1.54, 2005/07/15 00:23:26 version 1.55, 2005/07/26 01:33:46
Line 45 
Line 45 
  * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,   * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,
  * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.   * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.
  *   *
  * $OpenXM: OpenXM_contrib2/asir2000/builtin/strobj.c,v 1.53 2005/07/14 04:07:31 noro Exp $   * $OpenXM: OpenXM_contrib2/asir2000/builtin/strobj.c,v 1.54 2005/07/15 00:23:26 noro Exp $
 */  */
 #include "ca.h"  #include "ca.h"
 #include "parse.h"  #include "parse.h"
Line 527  NODE merge_matching_node(NODE n,NODE a)
Line 527  NODE merge_matching_node(NODE n,NODE a)
                 return a;                  return a;
         for ( ta = a; ta; ta = NEXT(ta) ) {          for ( ta = a; ta; ta = NEXT(ta) ) {
                 ba = BDY((LIST)BDY(ta));                  ba = BDY((LIST)BDY(ta));
                   if ( !ba ) continue;
                 pa = (QUOTE)BDY(ba); va = (QUOTE)BDY(NEXT(ba));                  pa = (QUOTE)BDY(ba); va = (QUOTE)BDY(NEXT(ba));
                 for ( tn = n; tn; tn = NEXT(tn) ) {                  for ( tn = n; tn; tn = NEXT(tn) ) {
                         bn = BDY((LIST)BDY(tn));                          bn = BDY((LIST)BDY(tn));
                           if ( !bn ) continue;
                         pn = (QUOTE)BDY(bn); vn = (QUOTE)BDY(NEXT(bn));                          pn = (QUOTE)BDY(bn); vn = (QUOTE)BDY(NEXT(bn));
                         if ( !compquote(CO,pa,pn) && !compquote(CO,va,vn) )                          if ( !compquote(CO,pa,pn) ) {
                                 break;                                  if ( !compquote(CO,va,vn) ) break;
                                   else return 0;
                           }
                 }                  }
                 if ( !tn ) {                  if ( !tn ) {
                         MKNODE(tn,(pointer)BDY(ta),n);                          MKNODE(tn,(pointer)BDY(ta),n);
Line 549  NODE quote_unify_node(NODE f,NODE pat) {
Line 553  NODE quote_unify_node(NODE f,NODE pat) {
         r = 0;          r = 0;
         for ( tf = f, tp = pat; tf; tf = NEXT(tf), tp = NEXT(tp) ) {          for ( tf = f, tp = pat; tf; tf = NEXT(tf), tp = NEXT(tp) ) {
                 a = quote_unify((Obj)BDY(tf),(Obj)BDY(tp));                  a = quote_unify((Obj)BDY(tf),(Obj)BDY(tp));
                   if ( !a ) return 0;
                 r = merge_matching_node(r,a);                  r = merge_matching_node(r,a);
                 if ( !r ) return 0;                  if ( !r ) return 0;
         }          }
Line 572  NODE quote_unify(Obj f, Obj pat)
Line 577  NODE quote_unify(Obj f, Obj pat)
         NODE parg,farg,r;          NODE parg,farg,r;
         LIST fa,l;          LIST fa,l;
         int pid,id;          int pid,id;
           FUNC ff,pf;
   
         if ( OID(pat) == O_LIST ) {          if ( OID(pat) == O_LIST ) {
                 if ( OID(f) == O_LIST )                  if ( OID(f) == O_LIST )
Line 583  NODE quote_unify(Obj f, Obj pat)
Line 589  NODE quote_unify(Obj f, Obj pat)
                 get_quote_id_arg((QUOTE)pat,&pid,&parg);                  get_quote_id_arg((QUOTE)pat,&pid,&parg);
                 get_quote_id_arg((QUOTE)f,&id,&farg);                  get_quote_id_arg((QUOTE)f,&id,&farg);
                 switch ( pid ) {                  switch ( pid ) {
                           case I_FORMULA:
                                   if ( compquote(CO,f,pat) )
                                           return 0;
                                   else {
                                           MKLIST(l,0);
                                           return mknode(1,l);
                                   }
                                   break;
                           case I_LIST:
                                   return quote_unify_node(BDY((LIST)BDY(farg)),BDY((LIST)BDY(parg)));
                         case I_PVAR:                          case I_PVAR:
                                 /* [[pat,f]] */                                  /* [[pat,f]] */
                                 r = mknode(2,pat,f); MKLIST(l,r);                                  r = mknode(2,pat,f); MKLIST(l,r);
Line 598  NODE quote_unify(Obj f, Obj pat)
Line 614  NODE quote_unify(Obj f, Obj pat)
                                 } else                                  } else
                                         return 0;                                          return 0;
                         case I_BOP:                          case I_BOP:
                           case I_FUNC:
                                 /* X+Y = ... */                                  /* X+Y = ... */
                                   /* f(...) = ... */
                                 if ( compqa(CO,BDY(farg),BDY(parg)) ) return 0;                                  if ( compqa(CO,BDY(farg),BDY(parg)) ) return 0;
                                 return quote_unify_node(NEXT(farg),NEXT(parg));                                  return quote_unify_node(NEXT(farg),NEXT(parg));
                                   break;
                         default:                          default:
                                 if ( pid == id )                                  if ( pid == id )
                                         return quote_unify_node(farg,parg);                                          return quote_unify_node(farg,parg);

Legend:
Removed from v.1.54  
changed lines
  Added in v.1.55

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>