Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abc
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
abc
Commits
0328488b
Commit
0328488b
authored
May 18, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SAT variable profiling.
parent
29ee997b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
3 deletions
+28
-3
src/sat/bmc/bmcBmc3.c
+1
-0
src/sat/bsat/satClause.h
+2
-2
src/sat/bsat/satSolver.c
+11
-1
src/sat/bsat/satSolver.h
+14
-0
No files found.
src/sat/bmc/bmcBmc3.c
View file @
0328488b
...
...
@@ -1636,6 +1636,7 @@ nTimeUndec += clock() - clk2;
}
printf
(
"%4d %s : "
,
f
,
fUnfinished
?
"-"
:
"+"
);
printf
(
"Var =%8.0f. "
,
(
double
)
p
->
nSatVars
);
printf
(
"Var2 =%8.0f. "
,
(
double
)
sat_solver_count_usedvars
(
p
->
pSat
)
);
printf
(
"Cla =%9.0f. "
,
(
double
)
p
->
pSat
->
stats
.
clauses
);
printf
(
"Cnf =%7.0f. "
,(
double
)
p
->
pSat
->
stats
.
conflicts
);
// printf( "Imp =%10.0f. ", (double)p->pSat->stats.propagations );
...
...
src/sat/bsat/satClause.h
View file @
0328488b
...
...
@@ -35,8 +35,8 @@ ABC_NAMESPACE_HEADER_START
//#define LEARNT_MAX_START_DEFAULT 0
#define LEARNT_MAX_START_DEFAULT 10000
#define LEARNT_MAX_INCRE_DEFAULT
1
000
#define LEARNT_MAX_RATIO_DEFAULT
5
0
#define LEARNT_MAX_INCRE_DEFAULT
2
000
#define LEARNT_MAX_RATIO_DEFAULT
8
0
////////////////////////////////////////////////////////////////////////
/// STRUCTURE DEFINITIONS ///
...
...
src/sat/bsat/satSolver.c
View file @
0328488b
...
...
@@ -466,6 +466,12 @@ static int clause_create_new(sat_solver* s, lit* begin, lit* end, int learnt)
static
inline
int
sat_solver_enqueue
(
sat_solver
*
s
,
lit
l
,
int
from
)
{
int
v
=
lit_var
(
l
);
if
(
s
->
pFreqs
[
v
]
==
0
)
// {
s
->
pFreqs
[
v
]
=
1
;
// s->nVarUsed++;
// }
#ifdef VERBOSEDEBUG
printf
(
L_IND
"enqueue("
L_LIT
")
\n
"
,
L_ind
,
L_lit
(
l
));
#endif
...
...
@@ -1033,6 +1039,8 @@ void sat_solver_setnvars(sat_solver* s,int n)
s
->
activity
=
ABC_REALLOC
(
unsigned
,
s
->
activity
,
s
->
cap
);
s
->
activity2
=
ABC_REALLOC
(
unsigned
,
s
->
activity2
,
s
->
cap
);
#endif
s
->
pFreqs
=
ABC_REALLOC
(
char
,
s
->
tags
,
s
->
cap
);
if
(
s
->
factors
)
s
->
factors
=
ABC_REALLOC
(
double
,
s
->
factors
,
s
->
cap
);
s
->
orderpos
=
ABC_REALLOC
(
int
,
s
->
orderpos
,
s
->
cap
);
...
...
@@ -1054,6 +1062,7 @@ void sat_solver_setnvars(sat_solver* s,int n)
#else
s
->
activity
[
var
]
=
(
1
<<
10
);
#endif
s
->
pFreqs
[
var
]
=
0
;
if
(
s
->
factors
)
s
->
factors
[
var
]
=
0
;
// *((int*)s->vi + var) = 0; s->vi[var].val = varX;
...
...
@@ -1106,6 +1115,7 @@ void sat_solver_delete(sat_solver* s)
ABC_FREE
(
s
->
tags
);
ABC_FREE
(
s
->
activity
);
ABC_FREE
(
s
->
activity2
);
ABC_FREE
(
s
->
pFreqs
);
ABC_FREE
(
s
->
factors
);
ABC_FREE
(
s
->
orderpos
);
ABC_FREE
(
s
->
reasons
);
...
...
@@ -1321,7 +1331,7 @@ void sat_solver_reducedb(sat_solver* s)
// report the results
TimeTotal
+=
clock
()
-
clk
;
if
(
s
->
fVerbose
)
//
if ( s->fVerbose )
{
Abc_Print
(
1
,
"reduceDB: Keeping %7d out of %7d clauses (%5.2f %%) "
,
s
->
stats
.
learnts
,
nLearnedOld
,
100
.
0
*
s
->
stats
.
learnts
/
nLearnedOld
);
...
...
src/sat/bsat/satSolver.h
View file @
0328488b
...
...
@@ -121,6 +121,8 @@ struct sat_solver_t
unsigned
*
activity
;
// A heuristic measurement of the activity of a variable.
unsigned
*
activity2
;
// backup variable activity
#endif
char
*
pFreqs
;
// how many times this variable was assigned a value
int
nVarUsed
;
// varinfo * vi; // variable information
int
*
levels
;
//
...
...
@@ -248,6 +250,18 @@ static inline void sat_solver_bookmark(sat_solver* s)
}
}
static
inline
int
sat_solver_count_usedvars
(
sat_solver
*
s
)
{
int
i
,
nVars
=
0
;
for
(
i
=
0
;
i
<
s
->
size
;
i
++
)
if
(
s
->
pFreqs
[
i
]
)
{
s
->
pFreqs
[
i
]
=
0
;
nVars
++
;
}
return
nVars
;
}
static
inline
int
sat_solver_add_const
(
sat_solver
*
pSat
,
int
iVar
,
int
fCompl
)
{
lit
Lits
[
1
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment