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
33290869
Commit
33290869
authored
Mar 18, 2017
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Several bug fixed / small changes in Satoko.
parent
eff11d95
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
6 deletions
+9
-6
src/sat/bmc/bmcMesh.c
+3
-2
src/sat/satoko/solver.c
+1
-1
src/sat/satoko/solver.h
+2
-0
src/sat/satoko/solver_api.c
+3
-3
No files found.
src/sat/bmc/bmcMesh.c
View file @
33290869
...
...
@@ -53,8 +53,9 @@ static inline int Bmc_MeshUVar( int Me[102][102], int x, int y ) { return Me[x][
***********************************************************************/
static
inline
int
Bmc_MeshVarValue
(
satoko_t
*
p
,
int
v
)
{
int
value
=
var_value
(
p
,
v
)
!=
VAR_UNASSING
?
var_value
(
p
,
v
)
:
var_polarity
(
p
,
v
);
return
value
==
LIT_TRUE
;
// int value = var_value(p, v) != VAR_UNASSING ? var_value(p, v) : var_polarity(p, v);
// return value == LIT_TRUE;
return
var_polarity
(
p
,
v
)
==
LIT_TRUE
;
}
/**Function*************************************************************
...
...
src/sat/satoko/solver.c
View file @
33290869
...
...
@@ -518,9 +518,9 @@ void solver_cancel_until(solver_t *s, unsigned level)
for
(
i
=
(
int
)
vec_uint_size
(
s
->
trail
)
-
1
;
i
>=
(
int
)
vec_uint_at
(
s
->
trail_lim
,
level
);
i
--
)
{
unsigned
var
=
lit2var
(
vec_uint_at
(
s
->
trail
,
(
unsigned
)
i
));
vec_char_assign
(
s
->
polarity
,
var
,
vec_char_at
(
s
->
assigns
,
var
));
vec_char_assign
(
s
->
assigns
,
var
,
VAR_UNASSING
);
vec_uint_assign
(
s
->
reasons
,
var
,
UNDEF
);
vec_char_assign
(
s
->
polarity
,
var
,
lit_polarity
(
vec_uint_at
(
s
->
trail
,
(
unsigned
)
i
)));
if
(
!
heap_in_heap
(
s
->
var_order
,
var
))
heap_insert
(
s
->
var_order
,
var
);
}
...
...
src/sat/satoko/solver.h
View file @
33290869
...
...
@@ -207,6 +207,8 @@ static inline int solver_enqueue(solver_t *s, unsigned lit, unsigned reason)
unsigned
var
=
lit2var
(
lit
);
vec_char_assign
(
s
->
assigns
,
var
,
lit_polarity
(
lit
));
if
(
solver_dlevel
(
s
)
==
0
)
vec_char_assign
(
s
->
polarity
,
var
,
lit_polarity
(
lit
));
vec_uint_assign
(
s
->
levels
,
var
,
solver_dlevel
(
s
));
vec_uint_assign
(
s
->
reasons
,
var
,
reason
);
vec_uint_push_back
(
s
->
trail
,
lit
);
...
...
src/sat/satoko/solver_api.c
View file @
33290869
...
...
@@ -480,9 +480,9 @@ void satoko_write_dimacs(satoko_t *s, char *fname, int wrt_lrnt, int zero_var)
return
;
}
fprintf
(
file
,
"p cnf %d %d
\n
"
,
n_vars
,
wrt_lrnt
?
n_orig
+
n_lrnts
:
n_orig
);
array
=
vec_uint_data
(
s
->
trail
);
for
(
i
=
0
;
i
<
vec_uint_size
(
s
->
trail
);
i
++
)
fprintf
(
file
,
"%d
\n
"
,
array
[
i
]
&
1
?
-
(
array
[
i
]
+
!
zero_var
)
:
array
[
i
]
+
!
zero_var
);
for
(
i
=
0
;
i
<
vec_char_size
(
s
->
assigns
);
i
++
)
if
(
var_value
(
s
,
i
)
!=
VAR_UNASSING
)
fprintf
(
file
,
"%d
\n
"
,
var_value
(
s
,
i
)
==
LIT_FALSE
?
-
(
int
)(
i
+
!
zero_var
)
:
i
+
!
zero_var
);
array
=
vec_uint_data
(
s
->
originals
);
for
(
i
=
0
;
i
<
vec_uint_size
(
s
->
originals
);
i
++
)
...
...
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