flatPolarityExpr(2)

ORIGIN
Cao-vlsi libraries, log package, libablmmm.a

NAME
flatPolarityExpr - translates the inverters of an expression to the level of atomic expressions

SYNOPSIS
#include "logmmm.h"
chain_list *flatPolarityExpr(expr,sign)
chain_list *expr;
int sign;

PARAMETERS

expr
    expression to transform

sign
    expression or expression inverted

DESCRIPTION
flatPolarityExpr() creates a new ABL in which inverters are translated to the level of atomic expressions by applying Morgan's laws and simplification law. If sign <> 0 the function returns the transformed expression after having complemented it.
Tranformation law
- (NOT (NOT a))   --> a
- (NOT (AND a b)) --> (OR (NOT a) (NOT b))
- (NOT (OR a b))  --> (AND (NOT a) (NOT b))

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"));
expr1 = notExpr(expr1);
expr2 = flatPolarityExpr(expr1,0);
expr3 = flatPolarityExpr(expr1,1);
displayExpr(expr1);
displayExpr(expr2);
displayExpr(expr3);
/* it will display
(NOT (OR a b))
(AND (NOT a) (NOT b))
(OR a b)
*/
freeExpr(expr1);
freeExpr(expr2);
freeExpr(expr3);

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

SUPPORT STATUS
if bugs arise, please e-mail to cao-vlsi@masi.ibp.fr