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
9d46d84b
Commit
9d46d84b
authored
Feb 21, 2017
by
Bruno Schmitt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small tweak to rollback behavior.
parent
ac1eb60d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
0 deletions
+8
-0
src/sat/satoko/solver.c
+3
-0
src/sat/satoko/solver.h
+1
-0
src/sat/satoko/solver_api.c
+4
-0
No files found.
src/sat/satoko/solver.c
View file @
9d46d84b
...
@@ -397,6 +397,9 @@ static inline void solver_garbage_collect(solver_t *s)
...
@@ -397,6 +397,9 @@ static inline void solver_garbage_collect(solver_t *s)
unsigned
*
array
;
unsigned
*
array
;
struct
cdb
*
new_cdb
=
cdb_alloc
(
cdb_capacity
(
s
->
all_clauses
)
-
cdb_wasted
(
s
->
all_clauses
));
struct
cdb
*
new_cdb
=
cdb_alloc
(
cdb_capacity
(
s
->
all_clauses
)
-
cdb_wasted
(
s
->
all_clauses
));
if
(
s
->
book_cdb
)
s
->
book_cdb
=
0
;
for
(
i
=
0
;
i
<
2
*
vec_char_size
(
s
->
assigns
);
i
++
)
{
for
(
i
=
0
;
i
<
2
*
vec_char_size
(
s
->
assigns
);
i
++
)
{
struct
watcher
*
w
;
struct
watcher
*
w
;
watch_list_foreach
(
s
->
watches
,
w
,
i
)
watch_list_foreach
(
s
->
watches
,
w
,
i
)
...
...
src/sat/satoko/solver.h
View file @
9d46d84b
...
@@ -95,6 +95,7 @@ struct solver_t_ {
...
@@ -95,6 +95,7 @@ struct solver_t_ {
/* Bookmark */
/* Bookmark */
unsigned
book_cl_orig
;
/* Bookmark for orignal problem clauses vector */
unsigned
book_cl_orig
;
/* Bookmark for orignal problem clauses vector */
unsigned
book_cl_lrnt
;
/* Bookmark for learnt clauses vector */
unsigned
book_cl_lrnt
;
/* Bookmark for learnt clauses vector */
unsigned
book_cdb
;
/* Bookmark clause database size */
unsigned
book_vars
;
/* Bookmark number of variables */
unsigned
book_vars
;
/* Bookmark number of variables */
unsigned
book_trail
;
/* Bookmark trail size */
unsigned
book_trail
;
/* Bookmark trail size */
...
...
src/sat/satoko/solver_api.c
View file @
9d46d84b
...
@@ -330,6 +330,7 @@ void satoko_unbookmark(satoko_t *s)
...
@@ -330,6 +330,7 @@ void satoko_unbookmark(satoko_t *s)
{
{
s
->
book_cl_orig
=
0
;
s
->
book_cl_orig
=
0
;
s
->
book_cl_lrnt
=
0
;
s
->
book_cl_lrnt
=
0
;
s
->
book_cdb
=
0
;
s
->
book_vars
=
0
;
s
->
book_vars
=
0
;
s
->
book_trail
=
0
;
s
->
book_trail
=
0
;
}
}
...
@@ -365,6 +366,7 @@ void satoko_reset(satoko_t *s)
...
@@ -365,6 +366,7 @@ void satoko_reset(satoko_t *s)
s
->
RC2
=
s
->
opts
.
n_conf_fst_reduce
;
s
->
RC2
=
s
->
opts
.
n_conf_fst_reduce
;
s
->
book_cl_orig
=
0
;
s
->
book_cl_orig
=
0
;
s
->
book_cl_lrnt
=
0
;
s
->
book_cl_lrnt
=
0
;
s
->
book_cdb
=
0
;
s
->
book_vars
=
0
;
s
->
book_vars
=
0
;
s
->
book_trail
=
0
;
s
->
book_trail
=
0
;
}
}
...
@@ -412,6 +414,8 @@ void satoko_rollback(satoko_t *s)
...
@@ -412,6 +414,8 @@ void satoko_rollback(satoko_t *s)
/* Rewind solver and cancel level 0 assignments to the trail */
/* Rewind solver and cancel level 0 assignments to the trail */
solver_cancel_until
(
s
,
0
);
solver_cancel_until
(
s
,
0
);
vec_uint_shrink
(
s
->
trail
,
s
->
book_trail
);
vec_uint_shrink
(
s
->
trail
,
s
->
book_trail
);
if
(
s
->
book_cdb
)
s
->
all_clauses
->
size
=
s
->
book_cdb
;
s
->
book_cl_orig
=
0
;
s
->
book_cl_orig
=
0
;
s
->
book_cl_lrnt
=
0
;
s
->
book_cl_lrnt
=
0
;
s
->
book_vars
=
0
;
s
->
book_vars
=
0
;
...
...
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