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
b39b55e8
Commit
b39b55e8
authored
Aug 13, 2017
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding a callback feature to Satoko.
parent
cf427690
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
+13
-2
src/sat/satoko/solver.c
+1
-1
src/sat/satoko/solver.h
+11
-0
src/sat/satoko/solver_api.c
+1
-1
No files found.
src/sat/satoko/solver.c
View file @
b39b55e8
...
...
@@ -639,7 +639,7 @@ char solver_search(solver_t *s)
/* No conflict */
unsigned
next_lit
;
if
(
solver_rst
(
s
)
||
solver_check_limits
(
s
)
==
0
)
{
if
(
solver_rst
(
s
)
||
solver_check_limits
(
s
)
==
0
||
solver_stop
(
s
)
)
{
b_queue_clean
(
s
->
bq_lbd
);
solver_cancel_until
(
s
,
0
);
return
SATOKO_UNDEC
;
...
...
src/sat/satoko/solver.h
View file @
b39b55e8
...
...
@@ -102,6 +102,9 @@ struct solver_t_ {
/* Temporary data used for solving cones */
vec_char_t
*
marks
;
/* Callback to stop the solver */
int
*
pstop
;
struct
satoko_stats
stats
;
struct
satoko_opts
opts
;
...
...
@@ -223,6 +226,14 @@ static inline int solver_has_marks(solver_t *s)
{
return
(
int
)(
s
->
marks
!=
NULL
);
}
static
inline
int
solver_stop
(
solver_t
*
s
)
{
return
s
->
pstop
&&
*
s
->
pstop
;
}
static
inline
void
solver_set_stop
(
solver_t
*
s
,
int
*
pstop
)
{
s
->
pstop
=
pstop
;
}
//===------------------------------------------------------------------------===
// Inline clause functions
...
...
src/sat/satoko/solver_api.c
View file @
b39b55e8
...
...
@@ -303,7 +303,7 @@ int satoko_solve(solver_t *s)
while
(
status
==
SATOKO_UNDEC
)
{
status
=
solver_search
(
s
);
if
(
solver_check_limits
(
s
)
==
0
)
if
(
solver_check_limits
(
s
)
==
0
||
solver_stop
(
s
)
)
break
;
}
if
(
s
->
opts
.
verbose
)
...
...
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