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
66ff650f
Commit
66ff650f
authored
May 18, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SAT variable profiling.
parent
84b3b914
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
0 deletions
+19
-0
src/sat/bmc/bmcBmc3.c
+3
-0
src/sat/bsat/satSolver.c
+14
-0
src/sat/bsat/satSolver.h
+2
-0
No files found.
src/sat/bmc/bmcBmc3.c
View file @
66ff650f
...
@@ -1636,6 +1636,7 @@ nTimeUndec += clock() - clk2;
...
@@ -1636,6 +1636,7 @@ nTimeUndec += clock() - clk2;
}
}
printf
(
"%4d %s : "
,
f
,
fUnfinished
?
"-"
:
"+"
);
printf
(
"%4d %s : "
,
f
,
fUnfinished
?
"-"
:
"+"
);
printf
(
"Var =%8.0f. "
,
(
double
)
p
->
nSatVars
);
printf
(
"Var =%8.0f. "
,
(
double
)
p
->
nSatVars
);
printf
(
"Var2 =%8.0f. "
,
(
double
)
p
->
pSat
->
nVarUsed
);
printf
(
"Cla =%9.0f. "
,
(
double
)
p
->
pSat
->
stats
.
clauses
);
printf
(
"Cla =%9.0f. "
,
(
double
)
p
->
pSat
->
stats
.
clauses
);
printf
(
"Cnf =%7.0f. "
,(
double
)
p
->
pSat
->
stats
.
conflicts
);
printf
(
"Cnf =%7.0f. "
,(
double
)
p
->
pSat
->
stats
.
conflicts
);
// printf( "Imp =%10.0f. ", (double)p->pSat->stats.propagations );
// printf( "Imp =%10.0f. ", (double)p->pSat->stats.propagations );
...
@@ -1657,6 +1658,8 @@ nTimeUndec += clock() - clk2;
...
@@ -1657,6 +1658,8 @@ nTimeUndec += clock() - clk2;
// printf( "Dups = %6d. ", p->nDupNum );
// printf( "Dups = %6d. ", p->nDupNum );
printf
(
"
\n
"
);
printf
(
"
\n
"
);
fflush
(
stdout
);
fflush
(
stdout
);
memset
(
p
->
pSat
->
pFreqs
,
0
,
sizeof
(
int
)
*
p
->
pSat
->
size
);
p
->
pSat
->
nVarUsed
=
0
;
}
}
}
}
// consider the next timeframe
// consider the next timeframe
...
...
src/sat/bsat/satSolver.c
View file @
66ff650f
...
@@ -466,6 +466,10 @@ static int clause_create_new(sat_solver* s, lit* begin, lit* end, int learnt)
...
@@ -466,6 +466,10 @@ 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
)
static
inline
int
sat_solver_enqueue
(
sat_solver
*
s
,
lit
l
,
int
from
)
{
{
int
v
=
lit_var
(
l
);
int
v
=
lit_var
(
l
);
if
(
s
->
pFreqs
[
v
]
++
==
0
)
s
->
nVarUsed
++
;
#ifdef VERBOSEDEBUG
#ifdef VERBOSEDEBUG
printf
(
L_IND
"enqueue("
L_LIT
")
\n
"
,
L_ind
,
L_lit
(
l
));
printf
(
L_IND
"enqueue("
L_LIT
")
\n
"
,
L_ind
,
L_lit
(
l
));
#endif
#endif
...
@@ -957,6 +961,8 @@ sat_solver* sat_solver_new(void)
...
@@ -957,6 +961,8 @@ sat_solver* sat_solver_new(void)
s
->
nLearntRatio
=
LEARNT_MAX_RATIO_DEFAULT
;
// ratio of learned clause limit
s
->
nLearntRatio
=
LEARNT_MAX_RATIO_DEFAULT
;
// ratio of learned clause limit
s
->
nLearntMax
=
s
->
nLearntStart
;
s
->
nLearntMax
=
s
->
nLearntStart
;
s
->
pFreqs
=
ABC_CALLOC
(
int
,
10000000
);
// initialize vectors
// initialize vectors
veci_new
(
&
s
->
order
);
veci_new
(
&
s
->
order
);
veci_new
(
&
s
->
trail_lim
);
veci_new
(
&
s
->
trail_lim
);
...
@@ -1077,6 +1083,14 @@ void sat_solver_setnvars(sat_solver* s,int n)
...
@@ -1077,6 +1083,14 @@ void sat_solver_setnvars(sat_solver* s,int n)
void
sat_solver_delete
(
sat_solver
*
s
)
void
sat_solver_delete
(
sat_solver
*
s
)
{
{
int
i
,
nVars
=
0
;
// count non-zero entries
for
(
i
=
0
;
i
<
s
->
size
;
i
++
)
nVars
+=
(
s
->
pFreqs
[
i
]
>
0
);
printf
(
"Assigned = %d. Total = %d. (%6.2f %%)
\n
"
,
nVars
,
s
->
size
,
100
.
0
*
nVars
/
s
->
size
);
ABC_FREE
(
s
->
pFreqs
);
// Vec_SetFree_( &s->Mem );
// Vec_SetFree_( &s->Mem );
Sat_MemFree_
(
&
s
->
Mem
);
Sat_MemFree_
(
&
s
->
Mem
);
...
...
src/sat/bsat/satSolver.h
View file @
66ff650f
...
@@ -121,6 +121,8 @@ struct sat_solver_t
...
@@ -121,6 +121,8 @@ struct sat_solver_t
unsigned
*
activity
;
// A heuristic measurement of the activity of a variable.
unsigned
*
activity
;
// A heuristic measurement of the activity of a variable.
unsigned
*
activity2
;
// backup variable activity
unsigned
*
activity2
;
// backup variable activity
#endif
#endif
int
*
pFreqs
;
int
nVarUsed
;
// varinfo * vi; // variable information
// varinfo * vi; // variable information
int
*
levels
;
//
int
*
levels
;
//
...
...
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