diff options
author | Bruno Schmitt <bruno@oschmitt.com> | 2017-02-18 17:08:54 -0800 |
---|---|---|
committer | Bruno Schmitt <bruno@oschmitt.com> | 2017-02-18 17:08:54 -0800 |
commit | 3f0cb6318b14e286cd9054a0f771183d15ef3db6 (patch) | |
tree | 2d34279d7b5cb54f112c2bcbdd2d66dbfd353102 /src/sat/satoko | |
parent | ac409b3152bf0bb6fd49c243ae635ca288d92b06 (diff) | |
download | abc-3f0cb6318b14e286cd9054a0f771183d15ef3db6.tar.gz abc-3f0cb6318b14e286cd9054a0f771183d15ef3db6.tar.bz2 abc-3f0cb6318b14e286cd9054a0f771183d15ef3db6.zip |
New function to retrieve polarity value of a variable.
Diffstat (limited to 'src/sat/satoko')
-rw-r--r-- | src/sat/satoko/solver.c | 2 | ||||
-rw-r--r-- | src/sat/satoko/solver.h | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/sat/satoko/solver.c b/src/sat/satoko/solver.c index 6554f653..3e5fc8ee 100644 --- a/src/sat/satoko/solver.c +++ b/src/sat/satoko/solver.c @@ -195,7 +195,7 @@ static inline unsigned solver_decide(solver_t *s) if (solver_has_marks(s) && !var_mark(s, next_var)) next_var = UNDEF; } - return var2lit(next_var, vec_char_at(s->polarity, next_var)); + return var2lit(next_var, var_polarity(s, next_var)); } static inline void solver_new_decision(solver_t *s, unsigned lit) diff --git a/src/sat/satoko/solver.h b/src/sat/satoko/solver.h index 68cc97dc..dcae8f6e 100644 --- a/src/sat/satoko/solver.h +++ b/src/sat/satoko/solver.h @@ -132,6 +132,11 @@ static inline char var_value(solver_t *s, unsigned var) return vec_char_at(s->assigns, var); } +static inline char var_polarity(solver_t *s, unsigned var) +{ + return vec_char_at(s->polarity, var); +} + static inline unsigned var_dlevel(solver_t *s, unsigned var) { return vec_uint_at(s->levels, var); |