17 throw "reduction operators take one non-empty operand";
19 enum { O_OR, O_AND, O_XOR } op;
23 if(
id==ID_reduction_or ||
id==ID_reduction_nor)
25 else if(
id==ID_reduction_and ||
id==ID_reduction_nand)
27 else if(
id==ID_reduction_xor ||
id==ID_reduction_xnor)
30 throw "unexpected reduction operator";
34 for(std::size_t i=1; i<op_bv.size(); i++)
38 case O_OR: l=
prop.
lor(l, op_bv[i]);
break;
39 case O_AND: l=
prop.
land(l, op_bv[i]);
break;
40 case O_XOR: l=
prop.
lxor(l, op_bv[i]);
break;
44 if(
id==ID_reduction_nor ||
45 id==ID_reduction_nand ||
46 id==ID_reduction_xnor)
57 throw "reduction operators take one non-empty operand";
59 enum { O_OR, O_AND, O_XOR } op;
63 if(
id==ID_reduction_or ||
id==ID_reduction_nor)
65 else if(
id==ID_reduction_and ||
id==ID_reduction_nand)
67 else if(
id==ID_reduction_xor ||
id==ID_reduction_xnor)
70 throw "unexpected reduction operator";
74 if(op_type.
id()!=ID_verilog_signedbv ||
75 op_type.
id()!=ID_verilog_unsignedbv)
77 if((expr.
type().
id()==ID_verilog_signedbv ||
78 expr.
type().
id()==ID_verilog_unsignedbv) &&
86 for(std::size_t i=2; i<op_bv.size(); i+=2)
105 if(
id==ID_reduction_nor ||
106 id==ID_reduction_nand ||
107 id==ID_reduction_xnor)
The type of an expression.
virtual bvt convert_bv_reduction(const unary_exprt &expr)
virtual literalt lor(literalt a, literalt b)=0
virtual literalt land(literalt a, literalt b)=0
const irep_idt & id() const
virtual literalt convert_reduction(const unary_exprt &expr)
virtual const bvt & convert_bv(const exprt &expr)
virtual literalt lxor(literalt a, literalt b)=0
void conversion_failed(const exprt &expr, bvt &bv)
Generic base class for unary expressions.
dstringt has one field, an unsigned integer no which is an index into a static table of strings...
literalt const_literal(bool value)
virtual literalt lselect(literalt a, literalt b, literalt c)=0
std::size_t get_size_t(const irep_namet &name) const
std::vector< literalt > bvt