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
1c16c456
Commit
1c16c456
authored
Nov 27, 2011
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Started experiments with a new solver.
parent
fc4ab6bd
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
8 deletions
+24
-8
src/sat/bsat/satSolver2.c
+0
-0
src/sat/bsat/satSolver2.h
+24
-8
No files found.
src/sat/bsat/satSolver2.c
View file @
1c16c456
This diff is collapsed.
Click to expand it.
src/sat/bsat/satSolver2.h
View file @
1c16c456
...
@@ -100,7 +100,6 @@ struct sat_solver2_t
...
@@ -100,7 +100,6 @@ struct sat_solver2_t
int
iLearnt
;
// the first learnt clause
int
iLearnt
;
// the first learnt clause
int
iLast
;
// the last learnt clause
int
iLast
;
// the last learnt clause
veci
*
wlists
;
// watcher lists (for each literal)
veci
*
wlists
;
// watcher lists (for each literal)
cla
*
pWatches
;
// watcher lists (for each literal)
// clause memory
// clause memory
int
*
pMemArray
;
int
*
pMemArray
;
...
@@ -111,6 +110,8 @@ struct sat_solver2_t
...
@@ -111,6 +110,8 @@ struct sat_solver2_t
int
var_inc
;
// Amount to bump next variable with.
int
var_inc
;
// Amount to bump next variable with.
int
cla_inc
;
// Amount to bump next clause with.
int
cla_inc
;
// Amount to bump next clause with.
unsigned
*
activity
;
// A heuristic measurement of the activity of a variable.
unsigned
*
activity
;
// A heuristic measurement of the activity of a variable.
veci
claActs
;
// clause activities
veci
claProofs
;
// clause proofs
// internal state
// internal state
varinfo
*
vi
;
// variable information
varinfo
*
vi
;
// variable information
...
@@ -134,24 +135,39 @@ struct sat_solver2_t
...
@@ -134,24 +135,39 @@ struct sat_solver2_t
};
};
static
int
sat_solver2_var_value
(
sat_solver2
*
s
,
int
v
)
static
inline
int
sat_solver2_nvars
(
sat_solver2
*
s
)
{
return
s
->
size
;
}
static
inline
int
sat_solver2_nclauses
(
sat_solver2
*
s
)
{
return
(
int
)
s
->
stats
.
clauses
;
}
static
inline
int
sat_solver2_nconflicts
(
sat_solver2
*
s
)
{
return
(
int
)
s
->
stats
.
conflicts
;
}
static
inline
int
sat_solver2_var_value
(
sat_solver2
*
s
,
int
v
)
{
{
assert
(
s
->
model
.
ptr
!=
NULL
&&
v
<
s
->
size
);
assert
(
s
->
model
.
ptr
!=
NULL
&&
v
<
s
->
size
);
return
(
int
)(
s
->
model
.
ptr
[
v
]
==
l_True
);
return
(
int
)(
s
->
model
.
ptr
[
v
]
==
l_True
);
}
}
static
int
sat_solver2_var_literal
(
sat_solver2
*
s
,
int
v
)
static
in
line
in
t
sat_solver2_var_literal
(
sat_solver2
*
s
,
int
v
)
{
{
assert
(
s
->
model
.
ptr
!=
NULL
&&
v
<
s
->
size
);
assert
(
s
->
model
.
ptr
!=
NULL
&&
v
<
s
->
size
);
return
toLitCond
(
v
,
s
->
model
.
ptr
[
v
]
!=
l_True
);
return
toLitCond
(
v
,
s
->
model
.
ptr
[
v
]
!=
l_True
);
}
}
static
void
sat_solver2_act_var_clear
(
sat_solver2
*
s
)
static
inline
void
sat_solver2_act_var_clear
(
sat_solver2
*
s
)
{
{
int
i
;
int
i
;
for
(
i
=
0
;
i
<
s
->
size
;
i
++
)
for
(
i
=
0
;
i
<
s
->
size
;
i
++
)
s
->
activity
[
i
]
=
0
;
//.0;
s
->
activity
[
i
]
=
0
;
//.0;
s
->
var_inc
=
1
.
0
;
s
->
var_inc
=
1
.
0
;
}
}
static
void
sat_solver2_compress
(
sat_solver2
*
s
)
static
inline
void
sat_solver2_compress
(
sat_solver2
*
s
)
{
{
if
(
s
->
qtail
!=
s
->
qhead
)
if
(
s
->
qtail
!=
s
->
qhead
)
{
{
...
@@ -160,20 +176,20 @@ static void sat_solver2_compress(sat_solver2* s)
...
@@ -160,20 +176,20 @@ static void sat_solver2_compress(sat_solver2* s)
}
}
}
}
static
int
sat_solver2_final
(
sat_solver2
*
s
,
int
**
ppArray
)
static
in
line
in
t
sat_solver2_final
(
sat_solver2
*
s
,
int
**
ppArray
)
{
{
*
ppArray
=
s
->
conf_final
.
ptr
;
*
ppArray
=
s
->
conf_final
.
ptr
;
return
s
->
conf_final
.
size
;
return
s
->
conf_final
.
size
;
}
}
static
int
sat_solver2_set_runtime_limit
(
sat_solver2
*
s
,
int
Limit
)
static
in
line
in
t
sat_solver2_set_runtime_limit
(
sat_solver2
*
s
,
int
Limit
)
{
{
int
nRuntimeLimit
=
s
->
nRuntimeLimit
;
int
nRuntimeLimit
=
s
->
nRuntimeLimit
;
s
->
nRuntimeLimit
=
Limit
;
s
->
nRuntimeLimit
=
Limit
;
return
nRuntimeLimit
;
return
nRuntimeLimit
;
}
}
static
int
sat_solver2_set_random
(
sat_solver2
*
s
,
int
fNotUseRandom
)
static
in
line
in
t
sat_solver2_set_random
(
sat_solver2
*
s
,
int
fNotUseRandom
)
{
{
int
fNotUseRandomOld
=
s
->
fNotUseRandom
;
int
fNotUseRandomOld
=
s
->
fNotUseRandom
;
s
->
fNotUseRandom
=
fNotUseRandom
;
s
->
fNotUseRandom
=
fNotUseRandom
;
...
...
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