MAXEXPR(3)

NAME
maxExpr - returns the highest argument of an operator expression.

SYNOPSYS
#include "logmmm.h"
chain_list *maxExpr(expr,func)
chain_list *expr;
int (*func)();

PARAMETERS

expr
    operator expression

func
    integer function

DESCRIPTION
maxExpr() returns the highest argument found by using the integer function func(). This function doesn't copy the returned argument.

EXAMPLE
#include "mutnnn.h"		/* mbk utilities */
#include "logmmm.h"
chain_list *expr1,*expr2,*expr3;
expr1 = createExpr(OR);
addQExpr(expr1,createAtom("a"));
addQExpr(expr1,createAtom("b"));
expr2 = createExpr(AND);
addQExpr(expr2,createAtom("c"));
addQExpr(expr2,createAtom("d"));
addQExpr(expr1,expr2);
displayExpr(expr1);
expr3 = maxExpr(expr1,numberAtomExpr);
displayExpr(expr3);
/* it will display
(OR a b (AND c d))
(AND c d)
*/
freeExpr(expr1);	/* don't free expr3 or expr2 ! */

SEE ALSO
log(1), abl(1), sortExpr(3), minExpr(3), copyExpr(3), substExpr(3), substPhyExpr(3), flatArityExpr(3), flatPolarityExpr(3), normExpr(3).