=================================================================== Modification le : Wed Nov 7 12:12:45 MET 2001 Par : francois =================================================================== Update of /users/outil/alliance/cvsroot/alliance/sources/boog In directory huelgoat:/users/cao/francois/alliance/sources/boog Modified Files: bog_map_pattern.c Log Message: pattern matching plus intelligent pour les mux et derives de mux =================================================================== Index: bog_map_pattern.c =================================================================== RCS file: /users/outil/alliance/cvsroot/alliance/sources/boog/bog_map_pattern.c,v retrieving revision 1.12 retrieving revision 1.13 diff -r1.12 -r1.13 186a187,262 > /* return 0 if not match */ > /******************************************************************************/ > static int isablcompatible(chain_list* expr, chain_list* pattern, int negativ) > { > char * name; > > if (!expr || !pattern) { > fprintf(stderr,"eval_pattern: NULL pointer\n"); > exit(1); > } > > /*NOT naturally absorbed*/ > if (!ABL_ATOM(pattern) && ABL_OPER(pattern)==ABL_NOT) { > return isablcompatible(expr, ABL_CADR(pattern), !negativ); > } > > if (!ABL_ATOM(expr) && ABL_OPER(expr)==ABL_NOT) { > return isablcompatible(ABL_CADR(expr), pattern, !negativ); > } > > if (ABL_ATOM (pattern) != ABL_ATOM(expr)) return 0; > > /*pattern is an atom*/ > if (ABL_ATOM(pattern)) { > if (negativ) name=getoppositename(ABL_ATOM_VALUE(expr)); > else name=ABL_ATOM_VALUE(expr); > return name==ABL_ATOM_VALUE(pattern); > } > > /* not the same arity */ > if (ABL_ARITY (expr) != ABL_ARITY (pattern)) return 0; > > /*compare operator*/ > switch (ABL_OPER(pattern)) { > case ABL_AND: case ABL_NOR: > switch (ABL_OPER(expr)) { > case ABL_AND: case ABL_NOR: if (negativ) return 0; break; > case ABL_NAND: case ABL_OR: if (!negativ) return 0; break; > default: return 0; > } > break; > case ABL_NAND: case ABL_OR: > switch (ABL_OPER(expr)) { =================================================================== Ce message est envoyé au personnes abonnées à alliance-programmers Pour plus d'information sur cette mailling-list, visitez : http://www-asim.lip6.fr/alliance/mailing-lists/