}
}
api::Op op;
- if (p.d_kind != api::NULL_TERM)
- {
- // It is a special case, e.g. tuple_select or array constant specification.
- // We have to wait until the arguments are parsed to resolve it.
- }
- else if (!p.d_expr.isNull())
- {
- // An explicit operator, e.g. an apply function
- api::Kind fkind = getKindForFunction(p.d_expr);
- if (fkind != api::UNDEFINED_KIND)
- {
- // Some operators may require a specific kind.
- // Testers are handled differently than other indexed operators,
- // since they require a kind.
- kind = fkind;
- Trace("parser") << "Got function kind " << kind << " for expression "
- << std::endl;
- }
- args.insert(args.begin(), p.d_expr);
- }
- else if (!p.d_op.isNull())
- {
- // it was given an operator
- op = p.d_op;
- }
- else if (isIndexedOperatorEnabled(p.d_name))
+ if (p.d_kind == api::UNDEFINED_KIND && isIndexedOperatorEnabled(p.d_name))
{
// Resolve indexed symbols that cannot be resolved without knowing the type
// of the arguments. This is currently limited to `to_fp`.
size_t nchildren = args.size();
if (nchildren == 1)
{
- op = d_solver->mkOp(api::FLOATINGPOINT_TO_FP_FROM_IEEE_BV,
- p.d_indices[0],
- p.d_indices[1]);
+ kind = api::FLOATINGPOINT_TO_FP_FROM_IEEE_BV;
+ op = d_solver->mkOp(kind, p.d_indices[0], p.d_indices[1]);
}
else if (nchildren > 2)
{
if (t.isFloatingPoint())
{
- op = d_solver->mkOp(
- api::FLOATINGPOINT_TO_FP_FROM_FP, p.d_indices[0], p.d_indices[1]);
+ kind = api::FLOATINGPOINT_TO_FP_FROM_FP;
+ op = d_solver->mkOp(kind, p.d_indices[0], p.d_indices[1]);
}
else if (t.isInteger() || t.isReal())
{
- op = d_solver->mkOp(
- api::FLOATINGPOINT_TO_FP_FROM_REAL, p.d_indices[0], p.d_indices[1]);
+ kind = api::FLOATINGPOINT_TO_FP_FROM_REAL;
+ op = d_solver->mkOp(kind, p.d_indices[0], p.d_indices[1]);
}
else
{
- op = d_solver->mkOp(
- api::FLOATINGPOINT_TO_FP_FROM_SBV, p.d_indices[0], p.d_indices[1]);
+ kind = api::FLOATINGPOINT_TO_FP_FROM_SBV;
+ op = d_solver->mkOp(kind, p.d_indices[0], p.d_indices[1]);
}
}
}
+ else if (p.d_kind != api::NULL_TERM)
+ {
+ // It is a special case, e.g. tuple_select or array constant specification.
+ // We have to wait until the arguments are parsed to resolve it.
+ }
+ else if (!p.d_expr.isNull())
+ {
+ // An explicit operator, e.g. an apply function
+ api::Kind fkind = getKindForFunction(p.d_expr);
+ if (fkind != api::UNDEFINED_KIND)
+ {
+ // Some operators may require a specific kind.
+ // Testers are handled differently than other indexed operators,
+ // since they require a kind.
+ kind = fkind;
+ Trace("parser") << "Got function kind " << kind << " for expression "
+ << std::endl;
+ }
+ args.insert(args.begin(), p.d_expr);
+ }
+ else if (!p.d_op.isNull())
+ {
+ // it was given an operator
+ op = p.d_op;
+ }
else
{
isBuiltinOperator = isOperatorEnabled(p.d_name);