18 typedef std::map<exprt, std::set<exprt> > used_bits_mapt;
19 used_bits_mapt used_bits_map;
23 if(it->id() == ID_extractbit)
26 if(extractbit_expr.op1().is_constant())
27 used_bits_map[extractbit_expr.src()].insert(extractbit_expr.index());
29 else if(it->id() == ID_not &&
to_not_expr(*it).
op().
id() == ID_extractbit)
32 if(extractbit_expr.op1().is_constant())
33 used_bits_map[extractbit_expr.src()].insert(extractbit_expr.index());
39 for(used_bits_mapt::const_iterator it=used_bits_map.begin();
40 it!=used_bits_map.end();
45 boolbv_get_width(it->first.type(), width);
47 std::string value_string;
48 value_string.resize(width,
'0');
50 if(it->second.size()==width)
52 const irep_idt &ident=it->first.get(ID_identifier);
56 for(exprt::operandst::const_iterator oit=old_operands.begin();
57 oit!=old_operands.end();
60 if(oit->id()==ID_extractbit &&
61 oit->op1().is_constant())
63 if(oit->op0().get(ID_identifier)==ident)
66 const std::size_t value = numeric_cast_v<std::size_t>(val_expr);
67 value_string[value]=
'1';
70 std::cout <<
"[" << value <<
"]=1\n";
76 else if(oit->id()==ID_not &&
77 oit->op0().id()==ID_extractbit &&
78 oit->op0().op1().is_constant())
80 if(oit->op0().op0().get(ID_identifier)==ident)
87 new_operands.push_back(*oit);
91 new_operands.push_back(equality_exprt(it->first, new_value));
94 std::cout <<
"FINAL: " << value_string <<
'\n';