NUMBEROCCEXPR(3)

NAME
numberOccExpr - returns the number of time an atom appears in an expression.

SYNOPSYS
#include "logmmm.h"
int numberOccExpr(expr,name)
chain_list *expr;
char *name;

PARAMETERS

expr
    expression

name
    name of the atom

DESCRIPTION
numberOccExpr() returns the number of time name appears in expr.

EXAMPLE
#include "mutnnn.h"		/* mbk utilities */
#include "logmmm.h"
chain_list *expr1,*expr2;
expr1 = createExpr(OR);
addQExpr(expr1,createAtom("a"));
addQExpr(expr1,createAtom("b"));
expr2 = createExpr(OR);
addQExpr(expr2,createAtom("c"));
addQExpr(expr2,createAtom("a"));
addQExpr(expr1,expr2);
printf("%d",numberOccExpr(expr1));
/* it will display
2
*/
freeExpr(expr1);	/* don't free expr2 ! */

SEE ALSO
log(1), abl(1), numberAtomExpr(3), profExpr(3), lengthExpr(3), equalExpr(3), equalVarExpr(3), searchExpr(3), searchOperExpr(3).