Skip to content

Commit

Permalink
move to hide bits
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
  • Loading branch information
NikolajBjorner committed Mar 5, 2024
1 parent acc9c21 commit 48026ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/ast/sls/bv_sls_eval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ namespace bv {
if (bv.is_bv(e)) {
auto& v = wval0(e);
for (unsigned i = 0; i < v.bw; ++i)
v.set_bit(i, eval(e, i));
v.set(m_tmp, i, eval(e, i));
v.set(m_tmp);
}
else if (m.is_bool(e))
m_eval.setx(e->get_id(), eval(e, 0), false);
Expand Down
6 changes: 5 additions & 1 deletion src/ast/sls/sls_valuation.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace bv {

digit_t bits(unsigned i) const { return m_bits[i]; }
svector<digit_t> const& bits() const { return m_bits; }
void set_bit(unsigned i, bool v) { set(m_bits, i, v); }

bool get_bit(unsigned i) const { return get(m_bits, i); }

void set_value(svector<digit_t>& bits, rational const& r);
Expand Down Expand Up @@ -228,6 +228,9 @@ namespace bv {
return out;
}

// TODO move:
void set_bit(unsigned i, bool v) { set(m_bits, i, v); }

private:
static digit_t get_pos_mask(unsigned bit_idx) {
return (digit_t)1 << (digit_t)(bit_idx % (8 * sizeof(digit_t)));
Expand All @@ -246,6 +249,7 @@ namespace bv {
public:
sls_pre_valuation(unsigned bw):sls_valuation(bw) {}
svector<digit_t>& bits() { return m_bits; }

};

inline std::ostream& operator<<(std::ostream& out, sls_valuation const& v) { return v.display(out); }
Expand Down

0 comments on commit 48026ed

Please sign in to comment.