32 #define USE_COMPL_LIFT 0
33 #define USE_COMPL_LIFT_ONSET 1
34 #define USE_COMPL_LIFT_ONSET_COMPLEX 2
52 register pcube cl, cr;
56 static int compl_level = 0;
72 if (Tr->count*Tl->count > (Tr->count+Tl->count)*
CUBELISTSIZE(T)) {
77 Tbar =
compl_merge(T, Tl, Tr, cl, cr, best, lifting);
93 register pcube *T1,
p, ceil, cof=T[0];
111 for(T1 = T+2; (p = *T1++) != NULL; ) {
121 for(T1 = T+2; (p = *T1++) != NULL; ) {
137 if (cdata.vars_active == 1) {
143 }
else if (cdata.vars_unate == cdata.vars_active) {
175 register
pcube cl, cr;
179 register pcube p, last, pt;
184 (void) printf(
"compl_merge: left %d, right %d\n", L->count, R->count);
185 (void) printf(
"%s (cl)\n%s (cr)\nLeft is\n",
pc1(cl),
pc2(cr));
187 (void) printf(
"Right is\n");
202 (void)
set_copy(cube.temp[0], cube.var_mask[var]);
250 (void) printf(
"Result %d\n", Tbar->count);
267 pcube *A1, *B1, bcube;
270 register pcube a, b, *B2, lift=cube.temp[4], liftor=cube.temp[5];
273 (void)
set_and(liftor, bcube, mask);
276 for(; (a = *A1++) != NULL; ) {
283 for(B2 = B1; (b = *B2++) != NULL; ) {
309 register pcube a, last,
p, lift=cube.temp[4], mask=cube.var_mask[
var];
312 for(; (a = *A1++) != NULL; ) {
344 register pcube last,
p, a, xlower;
348 for(; (a = *A1++) != NULL; ) {
355 if ((dist =
cdist01(p, a)) < 2) {
357 fatal(
"compl: ON-set and OFF-set are not orthogonal");
364 (void)
set_diff(xlower, cube.var_mask[var], xlower);
365 (void)
set_or(a, a, xlower);
377 register
pcube *L1, *R1;
379 register pcube pl, pr;
382 for(pl = *L1, pr = *R1; (pl != NULL) && (pr != NULL); )
403 register pcube diff=cube.temp[7], pdest, mask, full=cube.fullset;
413 for(var = 0; var < cube.num_vars; var++) {
414 mask = cube.var_mask[
var];
417 pdest =
GETSET(R, R->count++);
430 register pcube cl, cr;
432 pcover Tl, Tr, Tlbar, Trbar;
434 static int simplify_level = 0;
451 *Tnew =
compl_merge(T, Tl, Tr, cl, cr, best, lifting);
454 *Tbar =
compl_merge(T, Tlbar, Trbar, cl, cr, best, lifting);
468 debug1_print(*Tnew,
"exit SIMPCOMP (new)", simplify_level);
469 debug1_print(*Tbar,
"exit SIMPCOMP (compl)", simplify_level);
479 register pcube *T1,
p, ceil, cof=T[0];
493 (void)
set_or(cof, cof, T[2]);
501 for(T1 = T+2; (p = *T1++) != NULL; ) {
512 for(T1 = T+2; (p = *T1++) != NULL; ) {
517 (void)
set_diff(p, cube.fullset, ceil);
518 (void)
set_or(cof, cof, p);
539 if (cdata.vars_active == 1) {
546 }
else if (cdata.vars_unate == cdata.vars_active) {
569 register pcube cl, cr;
573 static int simplify_level = 0;
592 Tbar =
compl_merge(T, Tl, Tr, cl, cr, best, lifting);
615 register pcube *T1,
p, ceil, cof=T[0];
634 for(T1 = T+2; (p = *T1++) != NULL; ) {
644 for(T1 = T+2; (p = *T1++) != NULL; ) {
649 (void)
set_diff(p, cube.fullset, ceil);
650 (void)
set_or(cof, cof, p);
667 if (cdata.vars_active == 1) {
673 }
else if (cdata.vars_unate == cdata.vars_active) {
pcover cubeunlist(pcube *A1)
#define INLINEset_diff(r, a, b)
#define USE_COMPL_LIFT_ONSET_COMPLEX
static pcover compl_cube()
#define INLINEsetp_implies(a, b, when_false)
#define INLINEset_and(r, a, b)
#define USE_COMPL_LIFT_ONSET
static bool simplify_special_cases()
pcover complement(pcube *T)
#define foreach_set(R, last, p)
#define INLINEset_or(r, a, b)
static void compl_d1merge()
ABC_NAMESPACE_IMPL_START pset_family sf_contain(INOUT pset_family A)
static bool simp_comp_special_cases()
static void compl_lift_onset_complex()
static pcover compl_merge()
#define INLINEset_copy(r, a)
#define ABC_NAMESPACE_IMPL_END
pset_family unate_compl()
void simp_comp(pcube *T, pcover *Tnew, pcover *Tbar)
int binate_split_select(IN pcube *T, IN register pcube cleft, IN register pcube cright, IN int debug_flag)
#define INLINEset_merge(r, a, b, mask)
#define foreach_active_set(R, last, p)
#define ABC_NAMESPACE_IMPL_START
pset * sf_list(IN register pset_family A)
pcover map_unate_to_cover()
pcube * scofactor(IN pcube *T, IN pcube c, IN int var)
void debug_print(pcube *T, char *name, int level)
#define GETSET(family, index)
pcover map_cover_to_unate()
pcover simplify(pcube *T)
void debug1_print(pcover T, char *name, int num)
static bool compl_special_cases()
void massive_count(IN pcube *T)
#define INLINEset_clear(r, size)
static void compl_lift_onset()