00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #include "espresso.h"
00029
00030
00031 void
00032 cautious_define_cube_size(n)
00033 int n;
00034 {
00035 if (cube.fullset != 0 && cube.num_binary_vars == n)
00036 return;
00037 if (cube.fullset != 0) {
00038 setdown_cube();
00039 FREE(cube.part_size);
00040 }
00041 cube.num_binary_vars = cube.num_vars = n;
00042 cube.part_size = ALLOC(int, n);
00043 cube_setup();
00044 }
00045
00046
00047 void
00048 define_cube_size(n)
00049 int n;
00050 {
00051 register int q, i;
00052 static int called_before = 0;
00053
00054
00055 if (cube.fullset != 0 && cube.num_binary_vars == n && cube.num_vars == n)
00056 return;
00057
00058
00059 if (n > 100) {
00060 cautious_define_cube_size(n);
00061 called_before = 0;
00062 return;
00063 }
00064
00065 if (cube.fullset == 0 || ! called_before) {
00066 cautious_define_cube_size(100);
00067 called_before = 1;
00068 }
00069
00070 cube.num_vars = n;
00071 cube.num_binary_vars = n;
00072 cube.num_mv_vars = 0;
00073 cube.output = -1;
00074 cube.size = n * 2;
00075
00076
00077
00078
00079
00080 (void) set_fill(cube.fullset, n*2);
00081 (void) set_fill(cube.binary_mask, n*2);
00082
00083
00084 q = cube.fullset[0];
00085 for(i = 0; i < cube.num_vars; i++)
00086 cube.var_mask[i][0] = q;
00087 for(i = 0; i < CUBE_TEMP; i++)
00088 cube.temp[i][0] = q;
00089
00090
00091 cube.emptyset[0] = q;
00092 cube.mv_mask[0] = q;
00093
00094
00095 if (cube.num_binary_vars != 0) {
00096 cube.inword = cube.last_word[cube.num_binary_vars - 1];
00097 cube.inmask = cube.binary_mask[cube.inword] & DISJOINT;
00098 } else {
00099 cube.inword = -1;
00100 cube.inmask = 0;
00101 }
00102
00103
00104 }
00105
00106
00107 void
00108 undefine_cube_size()
00109 {
00110 if (cube.num_binary_vars > 100) {
00111 if (cube.fullset != 0) {
00112 setdown_cube();
00113 FREE(cube.part_size);
00114 }
00115 } else {
00116 cube.num_vars = cube.num_binary_vars = 100;
00117 if (cube.fullset != 0) {
00118 setdown_cube();
00119 FREE(cube.part_size);
00120 }
00121 }
00122 }
00123
00124
00125 void
00126 set_espresso_flags()
00127 {
00128 summary = FALSE;
00129 trace = FALSE;
00130 remove_essential = TRUE;
00131 force_irredundant = TRUE;
00132 unwrap_onset = TRUE;
00133 single_expand = FALSE;
00134 pos = FALSE;
00135 recompute_onset = FALSE;
00136 use_super_gasp = FALSE;
00137 use_random_order = FALSE;
00138 }