33 #define REFINE_BY_SIM_1 0
34 #define REFINE_BY_SIM_2 0
35 #define BACKTRACK_BY_SAT 1
36 #define SELECT_DYNAMICALLY 0
43 #define CLAUSE_DECAY 0.9
44 #define MAX_LEARNTS 50
225 for (i = 0; i < nsupp; ++i) {
229 if (marks[k])
continue;
236 for (j = gamma[k]; j != k; j = gamma[j]) {
247 for (i = 0; i < nsupp; ++i) {
248 marks[support[i]] = 0;
260 for (i = 0; i < nsupp; ++i) {
264 if (marks[k])
continue;
268 fprintf(f,
"%d", k-1);
271 for (j = gamma[k]; j != k; j = gamma[j]) {
273 fprintf(f,
" %d ", j-1);
281 for (i = 0; i < nsupp; ++i) {
282 marks[support[i]] = 0;
297 const int *start = a, *end = a + n, *min = a;
299 if (*a < *min) min = a;
333 if (k < n && a[k] < a[k+1]) ++k;
349 for (i = 1; i < n; ++i) {
363 for (i = 1; i < n; ++i) {
365 for (j = i; j > 0 && a[j-1] > k; --j) {
377 while (a[f] <= m) ++f;
378 do --b;
while (m <= a[b]);
403 if (b <= c)
return b;
404 if (a <= c)
return c;
408 if (a <= c)
return a;
409 if (b <= c)
return c;
468 int cb = cf + c->
clen[cf];
502 for (i = adj[k]; i != adj[k+1]; ++i) {
508 for (i = adj[gk]; ret && i != adj[gk+1]; ++i) {
509 ret = s->
stuff[edg[i]];
513 for (i = adj[k]; i != adj[k+1]; ++i) {
528 for (i = 0; i < nins; i++) {
553 for (i = 0; i < s->
ndiffs; ++i) {
582 for (i = 0; i < s->
ndiffs; ++i) {
605 int i, end = cf + c->
clen[cf];
606 for (i = ff; i <= end; ++i) {
619 do { h = 3 * h + 1; }
while (h < j);
622 for (i = h; i < n; ++i) {
624 for (j = i; b[a[j-h]] > b[k]; ) {
626 if ((j -= h) < h)
break;
683 int cb = cf + c->
clen[cf];
684 return cf <= ff && ff <= cb;
710 for (i = 0; i < s->
npairs; ++i) {
729 int l = s->left.lab[cf];
765 for (i = cf; i <= cb; ++i) {
770 for (i = cf; i <= cb; ++i) {
776 for (i = cf; i <= cb; ++i) {
805 cb = cf + c->
clen[cf];
806 c->
clen[cf] = fb - cf;
807 c->
clen[ff] = cb - ff;
891 for(i = 0; i < n; i += (left->
clen[i]+1)) {
892 for(j = 0; j < (left->
clen[i]+1); j++) {
894 else printf(
"%d ", left->
lab[i+j]);
896 if((i+left->
clen[i]+1) < n) printf(
"|");
905 if (right == NULL)
return 1;
908 for(i = 0; i < n; i += (right->
clen[i]+1)) {
909 for(j = 0; j < (right->
clen[i]+1); j++) {
911 else printf(
"%d ", right->
lab[i+j]);
913 if((i+right->
clen[i]+1) < n) printf(
"|");
940 for (i = 0; ret && i < s->
csize; ++i) {
946 for (i = 0; i < s->
csize; ++i) {
957 return cf == ff ? 1 : s->
split(s, c, cf, ff);
969 const int *adj,
const int *edg,
int cf)
971 int i, k = c->
lab[cf];
974 for (i = adj[k]; i != adj[k+1]; ++i) {
998 int cnt, i, cb, nzf, ff, fb, bmin, bmax;
1001 cb = cf + c->
clen[cf];
1007 s->
count[ff] = bmin = bmax = cnt;
1011 while (++ff <= cb) {
1015 while (bmin > cnt) s->
bucket[--bmin] = 0;
1016 while (bmax < cnt) s->
bucket[++bmax] = 0;
1024 if (bmin == bmax && cf == nzf)
return 1;
1028 for (i = bmin; i <= bmax; ++i, ff = fb) {
1029 if (!s->
bucket[i])
continue;
1035 for (i = nzf; i <= cb; ++i) {
1038 for (i = nzf; i <= cb; ++i) {
1043 for (i = bmax; i > bmin; --i) {
1045 if (ff && !s->
split(s, c, cf, ff))
return 0;
1054 const int *adj,
const int *edg,
int cf)
1057 const int cb = cf + c->
clen[cf];
1058 const int size = cb - cf + 1;
1067 for (i = 0; i <
size; ++i) {
1069 for (j = adj[k]; j != adj[k+1]; ++j) {
1078 for (i = cf; i <= cb; ++i) {
1080 for (j = adj[k]; j != adj[k+1]; ++j) {
1105 for (i = 0; i < s->
nninduce; ++i) {
1108 for (i = 0; i < s->
nsinduce; ++i) {
1164 if (c == &s->left)
return 1;
1171 if (flag[j])
continue;
1180 if (res == -1)
break;
1181 if (res == 0)
continue;
1213 int allOutputsAreDistinguished;
1221 allOutputsAreDistinguished = 1;
1224 allOutputsAreDistinguished = 0;
1228 if (allOutputsAreDistinguished)
break;
1239 for (j = 0; j < s->
n; j += c->
clen[j]+1)
1246 for (j = 0; j < s->
n; j += c->
clen[j]+1)
1267 int allOutputsAreDistinguished;
1275 allOutputsAreDistinguished = 1;
1278 allOutputsAreDistinguished = 0;
1282 if (allOutputsAreDistinguished)
break;
1293 for (j = 0; j < s->
n; j += c->
clen[j]+1)
1302 for (j = 0; j < s->
n; j += c->
clen[j]+1)
1341 for (j = 0; j < s->
n; j += c->
clen[j]+1)
1352 for (j = 0; j < s->
n; j += c->
clen[j]+1)
1385 for (j = 0; j < s->
n; j += c->
clen[j]+1)
1392 for (j = 0; j < s->
n; j += c->
clen[j]+1)
1425 for (j = 0; j < s->
n; j += c->
clen[j]+1)
1434 for (j = 0; j < s->
n; j += c->
clen[j]+1)
1473 for (j = 0; j < s->
n; j += c->
clen[j]+1)
1484 for (j = 0; j < s->
n; j += c->
clen[j]+1)
1506 Vec_Int_t * left_cfront, * right_cfront;
1514 for (cell = 0; cell < s->
n; cell += (s->left.clen[cell]+1)) {
1515 for (j = cell; j <= (cell+s->left.clen[cell]); j++) {
1542 int countN1Left, countN2Left;
1543 int countN1Right, countN2Right;
1549 for (cell = 0; cell < s->
n; cell += (s->
right.
clen[cell]+1)) {
1550 countN1Left = countN2Left = countN1Right = countN2Right = 0;
1552 for (j = cell; j <= (cell+s->
right.
clen[cell]); j++) {
1555 assert(name[0] ==
'N' && name[2] ==
':');
1564 assert(name[0] ==
'N' && name[2] ==
':');
1574 if (countN1Left != countN2Right || countN2Left != countN1Right)
1585 int i, j, v, sum1, sum2, xor1, xor2;
1593 for (j = s->
adj[v]; j < s->
adj[v+1]; j++) {
1599 for (j = s->
adj[v]; j < s->
adj[v+1]; j++) {
1600 sum2 += s->left.cfront[s->
edg[j]];
1601 xor2 ^= s->left.cfront[s->
edg[j]];
1603 if ((sum1 != sum2) || (xor1 != xor2))
1607 for (j = s->
adj[v]; j < s->
adj[v+1]; j++) {
1613 for (j = s->
adj[v]; j < s->
adj[v+1]; j++) {
1614 sum2 += s->left.cfront[s->
edg[j]];
1615 xor2 ^= s->left.cfront[s->
edg[j]];
1617 if ((sum1 != sum2) || (xor1 != xor2))
1627 int back = target + c->
clen[target];
1639 s->
split(s, c, target, back);
1668 int smallest_cell = -1, cell;
1669 int smallest_cell_size = s->
n;
1670 int max_connections = -1;
1671 int * connection_list =
zeros(s->
n);
1674 while( !s->left.clen[cell] ) cell++;
1675 while( cell < end ) {
1676 if (s->left.clen[cell] <= smallest_cell_size) {
1677 int i, connections = 0;;
1678 for (i = s->
depAdj[s->left.lab[cell]]; i < s->depAdj[s->left.lab[cell]+1]; i++) {
1679 if (!connection_list[s->
depEdg[i]]) {
1681 connection_list[s->
depEdg[i]] = 1;
1684 if ((s->left.clen[cell] < smallest_cell_size) || (connections > max_connections)) {
1685 smallest_cell_size = s->left.clen[cell];
1686 max_connections = connections;
1687 smallest_cell = cell;
1689 for (i = s->
depAdj[s->left.lab[cell]]; i < s->depAdj[s->left.lab[cell]+1]; i++)
1690 connection_list[s->
depEdg[i]] = 0;
1696 return smallest_cell;
1717 if (!
descend(s, &s->left, target, min))
return 0;
1739 const int *clen = s->left.clen;
1748 for (i = 0; i < s->
npairs; ++i) {
1751 *lmin = s->left.unlab[s->
right.
lab[s->left.unlab[k]]];
1775 for (i = 0; i < s->
n; i += (clen[i]+1)) {
1776 if (!clen[i])
continue;
1777 *rmin = *lmin = *target = i;
1778 if (s->
right.
cfront[s->left.lab[*lmin]] == *target)
1792 *target = *rmin = s->left.cfront[s->
splitvar[s->
lev]];
1795 for (i = *rmin; i <= (*rmin + s->
right.
clen[*target]); i++)
1796 if (s->
right.
lab[*rmin] == s->left.lab[*lmin]) {
1805 int target, lmin, rmin;
1829 descend(s, &s->left, target, lmin);
1853 for (rep = k; rep != theta[rep]; rep = theta[rep]);
1856 while (theta[k] != rep) {
1857 tmp = theta[k]; theta[k] = rep; k = tmp;
1865 int i, k, x, y, tmp;
1867 for (i = 0; i < s->
ndiffs; ++i) {
1892 int label, rep, irep;
1898 if (rep == label && rep != irep) {
1908 int i, label, fixed, min = -1;
1914 fixed = cell[size-1];
1917 for (i = 0; i < size-1; ++i) {
1921 if (label <= fixed)
continue;
1924 if (min != -1 && label > cell[min])
continue;
1936 int i, j, k, m, f, rep, tmp;
1954 for (m = k; m != j; m = s->
thnext[m]) {
1984 int repsize = s->
thsize[rep];
2028 if (min != -1 && s->
right.
lab[min + cf] == spec) {
2039 int i, cf, ff, splits = s->
splitlev[lev];
2040 for (i = s->
nsplits - 1; i >= splits; --i) {
2084 s->
indmin = s->left.lab[cb];
2103 if (min != -1)
return min + s->
start[s->
lev];
2131 int oldLev = s->
lev;
2136 printf(
"Backtrack by SAT from level %d to %d\n", oldLev, 0);
2141 if (s->
lev < oldLev)
2142 printf(
"Backtrack by SAT from level %d to %d\n", oldLev, s->
lev);
2164 for (i = 0; i < s->
n; ++i) {
2200 for (i = 0; i < s->
ndiffs; ++i) {
2202 s->
unsupp[i] = s->left.lab[k];
2218 for (i = 0; i < s->
n; ++i) {
2240 for (i = 0; i < s->
ndiffs; ++i) {
2294 printf(
"BAD NODE\n");
2359 for (i = 0; i < s->
n; ++i) {
2364 for (i = 0; i < s->
n; ++i) {
2369 for (i = 0; i < s->
n; ++i) {
2374 for (i = 0; i < s->
n; ++i) {
2380 for (i = 0; i < s->
n; ++i) {
2385 for (i = 0; i < s->
n; ++i) {
2400 for (i = 0; i < s->
n; ++i) {
2402 if (max < colors[i]) max = colors[i];
2407 s->left.clen[0] = s->
ccount[0] - 1;
2408 for (i = 0; i <
max; ++i) {
2414 for (i = 0; i < s->
n; ++i) {
2419 for (i = 0; i <=
max; ++i) {
2424 for (i = 0; i < s->
n; i += s->left.clen[i]+1) {
2430 for (i = 0, j = -1; i < s->
n; i += s->left.clen[i] + 1) {
2431 if (!s->left.clen[i])
continue;
2447 printf(
"Initial Refine by Dependency graph ... ");
2452 printf(
"Initial Refine by Simulation ... ");
2457 printf(
"done!\n\t--------------------\n");
2579 int n = numins + numouts;
2581 if (s == NULL)
return NULL;
2586 s->left.cfront =
zeros(n);
2587 s->left.clen =
ints(n);
2603 s->left.lab =
ints(n);
2604 s->left.unlab =
ints(n);
2633 for(i = 0; i < numins; i++) {
2637 for(i = 0; i < numouts; i++) {
2675 fprintf(f,
"group size = %fe%d\n",
2677 fprintf(f,
"levels = %d\n", stats.
levels);
2678 fprintf(f,
"nodes = %d\n", stats.
nodes);
2679 fprintf(f,
"generators = %d\n", stats.
gens);
2680 fprintf(f,
"total support = %d\n", stats.
support);
2681 fprintf(f,
"average support = %.2f\n",(
double)(stats.
support)/(
double)(stats.
gens));
2682 fprintf(f,
"nodes per generator = %.2f\n",(
double)(stats.
nodes)/(
double)(stats.
gens));
2683 fprintf(f,
"bad nodes = %d\n", stats.
bads);
2740 char * seg = (
char *)vSuppFun->pArray[i];
2743 if(((*seg) & 0x01) == 0x01)
2745 if(((*seg) & 0x02) == 0x02)
2747 if(((*seg) & 0x04) == 0x04)
2749 if(((*seg) & 0x08) == 0x08)
2751 if(((*seg) & 0x10) == 0x10)
2753 if(((*seg) & 0x20) == 0x20)
2755 if(((*seg) & 0x40) == 0x40)
2757 if(((*seg) & 0x80) == 0x80)
2826 for (i = 0; i <
n; i++) {
2830 for (k = 0, j = adj[i]; j < adj[i+1]; j++, k++)
2835 for (k = 0, j = adj[i]; j < adj[i+1]; j++, k++)
2869 int i, j, k, bit, input;
2872 int n = numouts + numins;
2876 for (i = numouts, k = 0; i <
n; i += (c->
clen[i]+1), k++) {
2880 for (j = i; j <= (i + c->
clen[i]); j++) {
2881 input = c->
lab[j] - numouts;
2882 vPiValues[input] = bit;
2901 int left_bit, right_bit;
2905 for (i = numouts; i <
n; i += (s->
right.
clen[i]+1)) {
2906 lab = s->left.lab[i] - numouts;
2907 left_bit = leftVec[lab];
2908 for (j = i+1; j <= (i + s->
right.
clen[i]); j++) {
2909 lab = s->left.lab[j] - numouts;
2910 if (left_bit != leftVec[lab])
return -1;
2914 right_bit = rightVec[lab];
2915 for (j = i+1; j <= (i + s->
right.
clen[i]); j++) {
2917 if (right_bit != rightVec[lab])
return 0;
2920 if (left_bit != right_bit)
2935 count1 = count2 = 0;
2936 for (j = i; j <= (i + s->
right.
clen[i]); j++) {
2937 if (leftVec[s->left.lab[j]]) count1++;
2938 if (rightVec[s->
right.
lab[j]]) count2++;
2941 if (count1 != count2)
return 0;
2953 int * vPiValues, * output;
2954 int numOneOutputs = 0;
2959 if (vPiValues == NULL)
2964 for (i = 0; i < numouts; i++) {
2970 n = numouts + numins;
2971 e = numins * numOneOutputs;
2980 for (i = 0; i < numouts; i++) {
2983 for (j = adj[i], k = 0; j < adj[i+1]; j++, k++)
2990 for (i = 0; i < numins; i++) {
2991 adj[i+numouts+1] = adj[i+numouts];
2992 for (k = 0, j = adj[i+numouts]; k <
Vec_IntSize(iDep[i]); k++) {
3021 int * output, * output2;
3028 if (vPiValues == NULL)
3033 for (i = 0; i < numins; i++) {
3034 if (!c->
clen[c->
cfront[i+numouts]])
continue;
3035 if (vPiValues[i] == 0) vPiValues[i] = 1;
3036 else vPiValues[i] = 0;
3048 if (vPiValues[i] == 0) vPiValues[i] = 1;
3049 else vPiValues[i] = 0;
3056 n = numouts + numins;
3065 for (i = 0; i < numouts; i++) {
3067 for (k = 0, j =
adj[i]; j <
adj[i+1]; j++, k++)
3070 for (i = 0; i < numins; i++) {
3072 for (k = 0, j =
adj[i+numouts]; j <
adj[i+numouts+1]; j++, k++)
3086 for (j = 0; j < numins; j++)
3088 for (j = 0; j < numouts; j++)
3159 if (pValues[i]) count++;
3192 if ( pMiter == NULL )
3194 printf(
"Miter computation has failed.\n" );
3198 if ( RetValue == 0 )
3204 pModel[i] = pMiter->
pModel[i];
3209 if ( RetValue == 1 )
3221 printf(
"Renoding for CNF has failed.\n" );
3226 RetValue =
Abc_NtkMiterSat( pCnf, (ABC_INT64_T)nConfLimit, (ABC_INT64_T)nInsLimit, 0, NULL, NULL );
3227 if ( RetValue == -1 ) {
3228 printf(
"Networks are undecided (SAT solver timed out).\n" );
3237 pModel[i] = pCnf->
pModel[i];
3247 int fLookForSwaps,
int fFixOutputs,
int fFixInputs,
int fQuiet,
int fPrintTree )
3253 int i, clk = clock();
3255 if (pNodePo == NULL)
3261 Abc_Print( 0,
"This output is not dependent on any input\n" );
3269 printf(
"Build functional dependency graph (dependency stats are below) ... ");
3271 printf(
"\t--------------------\n");
3298 if (fBooleanMatching) {
3326 if (fBooleanMatching) {
3328 printf(
"*** Networks are equivalent ***\n");
3330 printf(
"*** Networks are NOT equivalent ***\n");
3336 FILE * hadi = fopen(
"hadi.txt",
"a");
3337 fprintf(hadi,
"group size = %fe%d\n",
3342 ABC_PRT(
"Runtime", clock() - clk );
static unsigned Abc_ObjId(Abc_Obj_t *pObj)
static void Vec_IntPushOrder(Vec_Int_t *p, int Entry)
static int check_mapping(struct saucy *s, const int *adj, const int *edg, int k)
int(* is_automorphism)(struct saucy *)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
static void eat_pair(struct saucy *s, int k)
int(* refineBySim1)(struct saucy *, struct coloring *)
static struct saucy_graph * buildDepGraph(Abc_Ntk_t *pNtk, Vec_Int_t **iDep, Vec_Int_t **oDep)
Vec_Ptr_t * satCounterExamples
Vec_Ptr_t * randomVectorArray_sim1
static int check_OPP_only_has_swaps(struct saucy *s, struct coloring *c)
ABC_DLL int * Abc_NtkVerifyGetCleanModel(Abc_Ntk_t *pNtk, int nFrames)
int * randomVectorSplit_sim2
static void move_to_back(struct saucy *s, struct coloring *c, int k)
static void swap_labels(struct coloring *c, int a, int b)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static void split_color(struct coloring *c, int cf, int ff)
static void add_pair(struct saucy *s, int k)
static int add_conterexample(struct saucy *s, struct sim_result *cex)
static Vec_Int_t * assignRandomBitsToCells(Abc_Ntk_t *pNtk, struct coloring *c)
static int backtrack(struct saucy *s)
static int zeta_fixed(struct saucy *s)
Abc_Ntk_t * Abc_NtkMulti(Abc_Ntk_t *pNtk, int nThresh, int nFaninMax, int fCnf, int fMulti, int fSimple, int fFactor)
FUNCTION DEFINITIONS ///.
static int Abc_NtkBoxNum(Abc_Ntk_t *pNtk)
static int in_cell_range(struct coloring *c, int ff, int cf)
#define SIM_RANDOM_UNSIGNED
int(* ref_singleton)(struct saucy *, struct coloring *, int)
static int check_OPP_for_Boolean_matching(struct saucy *s, struct coloring *c)
static int is_undirected_automorphism(struct saucy *s)
void saucyGateWay(Abc_Ntk_t *pNtkOrig, Abc_Obj_t *pNodePo, FILE *gFile, int fBooleanMatching, int fLookForSwaps, int fFixOutputs, int fFixInputs, int fQuiet, int fPrintTree)
static int refineBySim2_other(struct saucy *s, struct coloring *c)
static int ref_nonsingle_directed(struct saucy *s, struct coloring *c, int cf)
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
static int refineByDepGraph(struct saucy *s, struct coloring *c)
static void set_label(struct coloring *c, int index, int value)
void saucy_free(struct saucy *s)
static int Abc_NtkCiNum(Abc_Ntk_t *pNtk)
#define ABC_ALLOC(type, num)
static void add_diffnon(struct saucy *s, int k)
#define Abc_NtkForEachCo(pNtk, pCo, i)
static int median(int a, int b, int c)
static void pick_all_the_pairs(struct saucy *s)
static void rewind_simulation_vectors(struct saucy *s, int lev)
static int descend_left(struct saucy *s)
static int refine_cell(struct saucy *s, struct coloring *c, int(*refine)(struct saucy *, struct coloring *, int))
ABC_DLL char * Abc_ObjAssignName(Abc_Obj_t *pObj, char *pName, char *pSuffix)
int(* split)(struct saucy *, struct coloring *, int, int)
static int do_search(struct saucy *s)
static int backtrackBysatCounterExamples(struct saucy *s, struct coloring *c)
static int print_automorphism_ntk2(FILE *f, int n, const int *gamma, int nsupp, const int *support, char *marks, Abc_Ntk_t *pNtk)
static int Vec_PtrSize(Vec_Ptr_t *p)
Vec_Ptr_t * randomVectorArray_sim2
static void print_stats(FILE *f, struct saucy_stats stats)
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
static void unprepare_permutation(struct saucy *s)
static void insertion_sort(int *a, int n)
static int Abc_NtkCoNum(Abc_Ntk_t *pNtk)
static void update_theta(struct saucy *s)
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
static struct saucy_graph * buildSim2Graph(Abc_Ntk_t *pNtk, struct coloring *c, Vec_Int_t *randVec, Vec_Int_t **iDep, Vec_Int_t **oDep, Vec_Ptr_t **topOrder, Vec_Int_t **obs, Vec_Int_t **ctrl)
static void fix_fronts(struct coloring *c, int cf, int ff)
static void sift_down(int *a, int n)
static void select_statically(struct saucy *s, int *target, int *lmin, int *rmin)
static int do_find_min(struct coloring *c, int t)
static int refineBySim2_init(struct saucy *s, struct coloring *c)
static int is_directed_automorphism(struct saucy *s)
int * Abc_NtkSimulateOneNode(Abc_Ntk_t *pNtk, int *pModel, int input, Vec_Ptr_t **topOrder)
struct saucy_stats * stats
static void add_diff(struct saucy *s, int k)
static int backtrack_loop(struct saucy *s)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static int refineBySim1_left(struct saucy *s, struct coloring *c)
static int double_check_OPP_isomorphism(struct saucy *s, struct coloring *c)
static int find_representative(int k, int *theta)
static int refine(struct saucy *s, struct coloring *c)
static int ifOutputVectorsAreConsistent(struct saucy *s, int *leftVec, int *rightVec)
ABC_DLL Abc_Ntk_t * Abc_NtkMiter(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int fComb, int nPartSize, int fImplic, int fMulti)
FUNCTION DEFINITIONS ///.
static void clear_refine(struct saucy *s)
static int orbit_prune(struct saucy *s)
static int Vec_IntEntry(Vec_Int_t *p, int i)
int * randomVectorSplit_sim1
static int partition(int *a, int n, int m)
#define ABC_NAMESPACE_IMPL_END
static void split_common(struct saucy *s, struct coloring *c, int cf, int ff)
static void clear_undiffnons(struct saucy *s)
ABC_DLL int Abc_NtkMiterSat(Abc_Ntk_t *pNtk, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, int fVerbose, ABC_INT64_T *pNumConfs, ABC_INT64_T *pNumInspects)
FUNCTION DEFINITIONS ///.
static int print_automorphism_quiet(FILE *f, int n, const int *gamma, int nsupp, const int *support, char *marks, Abc_Ntk_t *pNtk)
ABC_DLL Abc_Ntk_t * Abc_NtkCreateCone(Abc_Ntk_t *pNtk, Abc_Obj_t *pNode, char *pNodeName, int fUseAllCis)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
static void getDependenciesDummy(Abc_Ntk_t *pNtk, Vec_Int_t **iDep, Vec_Int_t **oDep)
static Abc_Obj_t * Abc_ObjFanout0Ntk(Abc_Obj_t *pObj)
static int Abc_NtkCecSat_saucy(Abc_Ntk_t *pNtk1, Abc_Ntk_t *pNtk2, int *pModel)
static void Abc_Print(int level, const char *format,...)
static void sift_up(int *a, int k)
static int array_find_min(const int *a, int n)
static void select_dynamically(struct saucy *s, int *target, int *lmin, int *rmin)
static int descend(struct saucy *s, struct coloring *c, int target, int min)
static int * zeros(int n)
static void Vec_PtrWriteEntry(Vec_Ptr_t *p, int i, void *Entry)
static int descend_leftmost(struct saucy *s)
static void data_count(struct saucy *s, struct coloring *c, int k)
#define ABC_NAMESPACE_IMPL_START
#define SELECT_DYNAMICALLY
int(* ref_nonsingle)(struct saucy *, struct coloring *, int)
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
static int ref_nonsingle_undirected(struct saucy *s, struct coloring *c, int cf)
static void add_induce(struct saucy *s, struct coloring *c, int who)
static void note_anctar_reps(struct saucy *s)
static int at_terminal(struct saucy *s)
static int is_a_pair(struct saucy *s, int k)
int(* print_automorphism)(FILE *f, int n, const int *gamma, int nsupp, const int *support, char *marks, Abc_Ntk_t *pNtk)
static int ref_singleton(struct saucy *s, struct coloring *c, const int *adj, const int *edg, int cf)
int(* refineBySim2)(struct saucy *, struct coloring *)
static int Vec_IntSize(Vec_Int_t *p)
static void fix_diff_subtract(struct saucy *s, int cf, const int *a, const int *b)
static int do_backtrack(struct saucy *s)
static int split_other(struct saucy *s, struct coloring *c, int cf, int ff)
static void fix_diff_singleton(struct saucy *s, int cf)
ABC_DLL int Abc_NtkMiterIsConstant(Abc_Ntk_t *pMiter)
#define Abc_ObjForEachFanout(pObj, pFanout, i)
static int print_partition(struct coloring *left, struct coloring *right, int n, Abc_Ntk_t *pNtk, int fNames)
#define Abc_NtkForEachCi(pNtk, pCi, i)
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static int ifInputVectorsAreConsistent(struct saucy *s, int *leftVec, int *rightVec)
static int ref_singleton_directed(struct saucy *s, struct coloring *c, int cf)
static int backtrack_leftmost(struct saucy *s)
void prepare_permutation_ntk(struct saucy *s)
static int ref_nonsingle_cell(struct saucy *s, struct coloring *c, int cf)
static int ref_single_cell(struct saucy *s, struct coloring *c, int cf)
static int split_init(struct saucy *s, struct coloring *c, int cf, int ff)
static void data_mark(struct saucy *s, struct coloring *c, int k)
static int backtrack_bad(struct saucy *s)
static void array_indirect_sort(int *a, const int *b, int n)
static void fix_diffs(struct saucy *s, int cf, int ff)
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
void unprepare_permutation_ntk(struct saucy *s)
void saucy_search(Abc_Ntk_t *pNtk, struct saucy *s, int directed, const int *colors, struct saucy_stats *stats)
static int split_left(struct saucy *s, struct coloring *c, int cf, int ff)
static void Abc_NtkIncrementTravId(Abc_Ntk_t *p)
#define ABC_CALLOC(type, num)
Nm_Man_t * Nm_ManCreate(int nSize)
MACRO DEFINITIONS ///.
static void reduceDB(struct saucy *s)
static void swap(int *a, int x, int y)
Vec_Ptr_t * Sim_ComputeFunSupp(Abc_Ntk_t *pNtk, int fVerbose)
static int backtrack_other(struct saucy *s)
void Abc_NtkDfsReverse_rec(Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
static void Vec_IntSortUnsigned(Vec_Int_t *p)
static int theta_prune(struct saucy *s)
static void remove_diffnon(struct saucy *s, int k)
static int maybe_split(struct saucy *s, struct coloring *c, int cf, int ff)
static int print_automorphism_ntk(FILE *f, int n, const int *gamma, int nsupp, const int *support, char *marks, Abc_Ntk_t *pNtk)
void Nm_ManFree(Nm_Man_t *p)
static struct saucy_graph * buildSim1Graph(Abc_Ntk_t *pNtk, struct coloring *c, Vec_Int_t *randVec, Vec_Int_t **iDep, Vec_Int_t **oDep)
static Vec_Ptr_t ** findTopologicalOrder(Abc_Ntk_t *pNtk)
static void prepare_permutation(struct saucy *s)
static char * bits(int n)
static int ref_nonsingle(struct saucy *s, struct coloring *c, const int *adj, const int *edg, int cf)
Abc_Ntk_t * pNtk_permuted
static int refineBySim1_other(struct saucy *s, struct coloring *c)
ABC_DLL int * Abc_NtkVerifySimulatePattern(Abc_Ntk_t *pNtk, int *pModel)
void(* select_decomposition)(struct saucy *, int *, int *, int *)
static void getDependencies(Abc_Ntk_t *pNtk, Vec_Int_t **iDep, Vec_Int_t **oDep)
static void introsort_loop(int *a, int n, int lim)
static void Vec_IntFree(Vec_Int_t *p)
static int find_min(struct saucy *s, int t)
static int refineBySim1_init(struct saucy *s, struct coloring *c)
static int ref_singleton_undirected(struct saucy *s, struct coloring *c, int cf)
static void Vec_IntClear(Vec_Int_t *p)
struct coloring left right
static void Vec_PtrShrink(Vec_Ptr_t *p, int nSizeNew)
static void multiply_index(struct saucy *s, int k)
struct saucy * saucy_alloc(Abc_Ntk_t *pNtk)
static int refineBySim2_left(struct saucy *s, struct coloring *c)
static int log_base2(int n)
ABC_DLL void Abc_NtkOrderObjsByName(Abc_Ntk_t *pNtk, int fComb)
static int select_smallest_max_connected_cell(struct saucy *s, int start, int end)
static int * generateProperInputVector(Abc_Ntk_t *pNtk, struct coloring *c, Vec_Int_t *randomVector)
static void Abc_NodeSetTravIdCurrent(Abc_Obj_t *p)
static void introsort(int *a, int n)
static void bumpActivity(struct saucy *s, struct sim_result *cex)
static void Vec_PtrFree(Vec_Ptr_t *p)
static void rewind_coloring(struct saucy *s, struct coloring *c, int lev)
static void heap_sort(int *a, int n)
static char * getVertexName(Abc_Ntk_t *pNtk, int v)
static struct sim_result * analyzeConflict(Abc_Ntk_t *pNtk, int *pModel, int fVerbose)