return;
break;
}
- case kind::APPLY_TESTER:
case kind::APPLY_SELECTOR:
- case kind::APPLY_SELECTOR_TOTAL:
+ {
+ Node op = n.getOperator();
+ const DType& dt = DType::datatypeOf(op);
+ if (dt.isTuple())
+ {
+ stillNeedToPrintParams = false;
+ out << "(_ tupSel " << DType::indexOf(op) << ") ";
+ }
+ }
+ break;
+ case kind::APPLY_TESTER:
+ {
+ stillNeedToPrintParams = false;
+ Node op = n.getOperator();
+ size_t cindex = DType::indexOf(op);
+ const DType& dt = DType::datatypeOf(op);
+ out << "(_ is ";
+ toStream(
+ out, dt[cindex].getConstructor(), toDepth < 0 ? toDepth : toDepth - 1);
+ out << ") ";
+ }
+ break;
case kind::APPLY_UPDATER:
+ {
+ Node op = n.getOperator();
+ size_t index = DType::indexOf(op);
+ const DType& dt = DType::datatypeOf(op);
+ size_t cindex = DType::cindexOf(op);
+ out << "(_ update ";
+ toStream(out,
+ dt[cindex][index].getSelector(),
+ toDepth < 0 ? toDepth : toDepth - 1);
+ out << ") ";
+ }
+ break;
+ case kind::APPLY_SELECTOR_TOTAL:
case kind::PARAMETRIC_DATATYPE: break;
// separation logic
if( n.getMetaKind() == kind::metakind::PARAMETERIZED &&
stillNeedToPrintParams ) {
if(toDepth != 0) {
- if (n.getKind() == kind::APPLY_TESTER)
- {
- unsigned cindex = DType::indexOf(n.getOperator());
- const DType& dt = DType::datatypeOf(n.getOperator());
- out << "(_ is ";
- toStream(out,
- dt[cindex].getConstructor(),
- toDepth < 0 ? toDepth : toDepth - 1);
- out << ")";
- }else{
- toStream(
- out, n.getOperator(), toDepth < 0 ? toDepth : toDepth - 1, lbind);
- }
+ toStream(
+ out, n.getOperator(), toDepth < 0 ? toDepth : toDepth - 1, lbind);
} else {
out << "(...)";
}
size_t dag,
OutputLanguage language) const
{
+ TypeNode rangeType = termToNode(d_func).getType();
+ if (rangeType.isFunction())
+ {
+ rangeType = rangeType.getRangeType();
+ }
Printer::getPrinter(language)->toStreamCmdDefineFunction(
out,
d_func.toString(),
termVectorToNodes(d_formals),
- termToNode(d_func).getType().getRangeType(),
+ rangeType,
termToNode(d_formula));
}