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
7747f21f
Commit
7747f21f
authored
Aug 15, 2017
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added several helpful APIs to Satoko.
parent
ca87c1a6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
0 deletions
+33
-0
src/sat/satoko/satoko.h
+1
-0
src/sat/satoko/solver.h
+17
-0
src/sat/satoko/solver_api.c
+15
-0
No files found.
src/sat/satoko/satoko.h
View file @
7747f21f
...
@@ -92,6 +92,7 @@ extern void satoko_assump_push(satoko_t *s, int);
...
@@ -92,6 +92,7 @@ extern void satoko_assump_push(satoko_t *s, int);
extern
void
satoko_assump_pop
(
satoko_t
*
s
);
extern
void
satoko_assump_pop
(
satoko_t
*
s
);
extern
int
satoko_simplify
(
satoko_t
*
);
extern
int
satoko_simplify
(
satoko_t
*
);
extern
int
satoko_solve
(
satoko_t
*
);
extern
int
satoko_solve
(
satoko_t
*
);
extern
int
satoko_solve_with_assumptions
(
satoko_t
*
s
,
int
*
plits
,
int
nlits
);
extern
void
satoko_mark_cone
(
satoko_t
*
,
int
*
,
int
);
extern
void
satoko_mark_cone
(
satoko_t
*
,
int
*
,
int
);
extern
void
satoko_unmark_cone
(
satoko_t
*
,
int
*
,
int
);
extern
void
satoko_unmark_cone
(
satoko_t
*
,
int
*
,
int
);
...
...
src/sat/satoko/solver.h
View file @
7747f21f
...
@@ -222,6 +222,19 @@ static inline int solver_varnum(solver_t *s)
...
@@ -222,6 +222,19 @@ static inline int solver_varnum(solver_t *s)
{
{
return
vec_char_size
(
s
->
assigns
);
return
vec_char_size
(
s
->
assigns
);
}
}
static
inline
int
solver_clausenum
(
solver_t
*
s
)
{
return
vec_uint_size
(
s
->
originals
);
}
static
inline
int
solver_learntnum
(
solver_t
*
s
)
{
return
vec_uint_size
(
s
->
learnts
);
}
static
inline
int
solver_conflictnum
(
solver_t
*
s
)
{
return
satoko_stats
(
s
).
n_conflicts
;
}
static
inline
int
solver_has_marks
(
solver_t
*
s
)
static
inline
int
solver_has_marks
(
solver_t
*
s
)
{
{
return
(
int
)(
s
->
marks
!=
NULL
);
return
(
int
)(
s
->
marks
!=
NULL
);
...
@@ -234,6 +247,10 @@ static inline void solver_set_stop(solver_t *s, int * pstop)
...
@@ -234,6 +247,10 @@ static inline void solver_set_stop(solver_t *s, int * pstop)
{
{
s
->
pstop
=
pstop
;
s
->
pstop
=
pstop
;
}
}
static
inline
int
solver_read_cex_varvalue
(
solver_t
*
s
,
int
ivar
)
{
return
var_polarity
(
s
,
ivar
)
==
LIT_TRUE
;
}
//===------------------------------------------------------------------------===
//===------------------------------------------------------------------------===
// Inline clause functions
// Inline clause functions
...
...
src/sat/satoko/solver_api.c
View file @
7747f21f
...
@@ -313,6 +313,21 @@ int satoko_solve(solver_t *s)
...
@@ -313,6 +313,21 @@ int satoko_solve(solver_t *s)
return
status
;
return
status
;
}
}
int
satoko_solve_with_assumptions
(
solver_t
*
s
,
int
*
plits
,
int
nlits
)
{
int
i
,
status
;
for
(
i
=
0
;
i
<
nlits
;
i
++
)
satoko_assump_push
(
s
,
plits
[
i
]
);
status
=
satoko_solve
(
s
);
for
(
i
=
0
;
i
<
nlits
;
i
++
)
satoko_assump_pop
(
s
);
if
(
status
==
SATOKO_UNSAT
)
return
1
;
if
(
status
==
SATOKO_SAT
)
return
0
;
return
-
1
;
}
int
satoko_final_conflict
(
solver_t
*
s
,
unsigned
*
out
)
int
satoko_final_conflict
(
solver_t
*
s
,
unsigned
*
out
)
{
{
if
(
vec_uint_size
(
s
->
final_conflict
)
==
0
)
if
(
vec_uint_size
(
s
->
final_conflict
)
==
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