Commit 3f0cb631 by Bruno Schmitt

New function to retrieve polarity value of a variable.

parent ac409b31
...@@ -195,7 +195,7 @@ static inline unsigned solver_decide(solver_t *s) ...@@ -195,7 +195,7 @@ static inline unsigned solver_decide(solver_t *s)
if (solver_has_marks(s) && !var_mark(s, next_var)) if (solver_has_marks(s) && !var_mark(s, next_var))
next_var = UNDEF; 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) static inline void solver_new_decision(solver_t *s, unsigned lit)
......
...@@ -132,6 +132,11 @@ static inline char var_value(solver_t *s, unsigned var) ...@@ -132,6 +132,11 @@ static inline char var_value(solver_t *s, unsigned var)
return vec_char_at(s->assigns, 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) static inline unsigned var_dlevel(solver_t *s, unsigned var)
{ {
return vec_uint_at(s->levels, var); return vec_uint_at(s->levels, var);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment