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
fc4ab6bd
Commit
fc4ab6bd
authored
Nov 26, 2011
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Started experiments with a new solver.
parent
0cfc97b9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
64 deletions
+64
-64
src/sat/bsat/satSolver.c
+0
-9
src/sat/bsat/satSolver2.c
+0
-0
src/sat/bsat/satSolver2.h
+45
-55
src/sat/bsat/satVec.h
+19
-0
No files found.
src/sat/bsat/satSolver.c
View file @
fc4ab6bd
...
...
@@ -118,15 +118,6 @@ static inline lit clause_read_lit (clause* c) { return (lit)((ABC_PTRUINT_T)
static
inline
int
sat_solver_dlevel
(
sat_solver
*
s
)
{
return
veci_size
(
&
s
->
trail_lim
);
}
static
inline
vecp
*
sat_solver_read_wlist
(
sat_solver
*
s
,
lit
l
)
{
return
&
s
->
wlists
[
l
];
}
static
inline
void
vecp_remove
(
vecp
*
v
,
void
*
e
)
{
void
**
ws
=
vecp_begin
(
v
);
int
j
=
0
;
for
(;
ws
[
j
]
!=
e
;
j
++
);
assert
(
j
<
vecp_size
(
v
));
for
(;
j
<
vecp_size
(
v
)
-
1
;
j
++
)
ws
[
j
]
=
ws
[
j
+
1
];
vecp_resize
(
v
,
vecp_size
(
v
)
-
1
);
}
//=================================================================================================
// Variable order functions:
...
...
src/sat/bsat/satSolver2.c
View file @
fc4ab6bd
This diff is collapsed.
Click to expand it.
src/sat/bsat/satSolver2.h
View file @
fc4ab6bd
...
...
@@ -77,71 +77,61 @@ extern void * sat_solver2_store_release( sat_solver2 * s );
//struct clause_t;
//typedef struct clause_t clause;
struct
varinfo_t
;
typedef
struct
varinfo_t
varinfo
;
struct
sat_solver2_t
{
int
size
;
// nof variables
int
cap
;
// size of varmaps
int
qhead
;
// Head index of queue.
int
qtail
;
// Tail index of queue.
int
size
;
// nof variables
int
cap
;
// size of varmaps
int
qhead
;
// Head index of queue.
int
qtail
;
// Tail index of queue.
int
root_level
;
// Level of first proper decision.
int
simpdb_assigns
;
// Number of top-level assignments at last 'simplifyDB()'.
int
simpdb_props
;
// Number of propagations before next 'simplifyDB()'.
double
random_seed
;
double
progress_estimate
;
int
verbosity
;
// Verbosity level. 0=silent, 1=some progress report, 2=everything
int
fNotUseRandom
;
// do not allow random decisions with a fixed probability
// int fSkipSimplify; // set to one to skip simplification of the clause database
// clauses
vecp
clauses
;
// List of problem constraints. (contains: clause*)
vecp
learnts
;
// List of learnt clauses. (contains: clause*)
int
iLearnt
;
// the first learnt clause
int
iLast
;
// the last learnt clause
veci
*
wlists
;
// watcher lists (for each literal)
cla
*
pWatches
;
// watcher lists (for each literal)
// activities
// double var_inc; // Amount to bump next variable with.
// double var_decay; // INVERSE decay factor for variable activity: stores 1/decay.
int
var_inc
;
// int var_decay;
// float cla_inc; // Amount to bump next clause with.
int
cla_inc
;
// Amount to bump next clause with.
// float cla_decay; // INVERSE decay factor for clause activity: stores 1/decay.
clause
**
pWatches
;
// watcher lists (for each literal)
vecp
*
wlists
;
//
// double* activity; // A heuristic measurement of the activity of a variable.
unsigned
*
activity
;
// A heuristic measurement of the activity of a variable.
lbool
*
assigns
;
// Current values of variables.
int
*
orderpos
;
// Index in variable order.
clause
**
reasons
;
//
int
*
levels
;
//
lit
*
trail
;
char
*
polarity
;
clause
*
binary
;
// A temporary binary clause
lbool
*
tags
;
//
veci
tagged
;
// (contains: var)
veci
stack
;
// (contains: var)
veci
order
;
// Variable order. (heap) (contains: var)
veci
trail_lim
;
// Separator indices for different decision levels in 'trail'. (contains: int)
veci
model
;
// If problem is solved, this vector contains the model (contains: lbool).
veci
conf_final
;
// If problem is unsatisfiable (possibly under assumptions),
// this vector represent the final conflict clause expressed in the assumptions.
int
root_level
;
// Level of first proper decision.
int
simpdb_assigns
;
// Number of top-level assignments at last 'simplifyDB()'.
int
simpdb_props
;
// Number of propagations before next 'simplifyDB()'.
double
random_seed
;
double
progress_estimate
;
int
verbosity
;
// Verbosity level. 0=silent, 1=some progress report, 2=everything
stats_t
stats
;
// clause memory
int
*
pMemArray
;
int
nMemAlloc
;
int
nMemSize
;
// activities
int
var_inc
;
// Amount to bump next variable with.
int
cla_inc
;
// Amount to bump next clause with.
unsigned
*
activity
;
// A heuristic measurement of the activity of a variable.
// internal state
varinfo
*
vi
;
// variable information
cla
*
reasons
;
lit
*
trail
;
int
*
orderpos
;
// Index in variable order.
veci
tagged
;
// (contains: var)
veci
stack
;
// (contains: var)
veci
order
;
// Variable order. (heap) (contains: var)
veci
trail_lim
;
// Separator indices for different decision levels in 'trail'. (contains: int)
veci
temp_clause
;
// temporary storage for a CNF clause
veci
model
;
// If problem is solved, this vector contains the model (contains: lbool).
veci
conf_final
;
// If problem is unsatisfiable (possibly under assumptions),
// this vector represent the final conflict clause expressed in the assumptions.
// statistics
stats_t
stats
;
ABC_INT64_T
nConfLimit
;
// external limit on the number of conflicts
ABC_INT64_T
nInsLimit
;
// external limit on the number of implications
int
nRuntimeLimit
;
// external limit on runtime
// clause memory
int
*
pMemArray
;
int
nMemAlloc
;
int
nMemSize
;
// int fSkipSimplify; // set to one to skip simplification of the clause database
int
fNotUseRandom
;
// do not allow random decisions with a fixed probability
veci
temp_clause
;
// temporary storage for a CNF clause
};
static
int
sat_solver2_var_value
(
sat_solver2
*
s
,
int
v
)
...
...
src/sat/bsat/satVec.h
View file @
fc4ab6bd
...
...
@@ -54,6 +54,15 @@ static inline void veci_push (veci* v, int e)
v
->
cap
=
newsize
;
}
v
->
ptr
[
v
->
size
++
]
=
e
;
}
static
inline
void
veci_remove
(
veci
*
v
,
int
e
)
{
int
*
ws
=
(
int
*
)
veci_begin
(
v
);
int
j
=
0
;
for
(;
ws
[
j
]
!=
e
;
j
++
);
assert
(
j
<
veci_size
(
v
));
for
(;
j
<
veci_size
(
v
)
-
1
;
j
++
)
ws
[
j
]
=
ws
[
j
+
1
];
veci_resize
(
v
,
veci_size
(
v
)
-
1
);
}
// vector of 32- or 64-bit pointers
...
...
@@ -83,6 +92,15 @@ static inline void vecp_push (vecp* v, void* e)
v
->
cap
=
newsize
;
}
v
->
ptr
[
v
->
size
++
]
=
e
;
}
static
inline
void
vecp_remove
(
vecp
*
v
,
void
*
e
)
{
void
**
ws
=
vecp_begin
(
v
);
int
j
=
0
;
for
(;
ws
[
j
]
!=
e
;
j
++
);
assert
(
j
<
vecp_size
(
v
));
for
(;
j
<
vecp_size
(
v
)
-
1
;
j
++
)
ws
[
j
]
=
ws
[
j
+
1
];
vecp_resize
(
v
,
vecp_size
(
v
)
-
1
);
}
...
...
@@ -99,6 +117,7 @@ static inline void vecp_push (vecp* v, void* e)
#endif
typedef
int
lit
;
typedef
int
cla
;
typedef
char
lbool
;
static
const
int
var_Undef
=
-
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