summaryrefslogtreecommitdiff
path: root/src/printer
diff options
context:
space:
mode:
authormudathirmahgoub <mudathirmahgoub@gmail.com>2021-03-03 02:16:32 -0600
committerGitHub <noreply@github.com>2021-03-03 08:16:32 +0000
commitc4709cb01356dd73fdd767d19af85b36ffd566c4 (patch)
tree9ad44e16486ec4cbb2d4c6776c1d80a179cc6894 /src/printer
parent80d9eab67e60ae8750165ce18ecd4eebcdc06b44 (diff)
Add tuple projection operator (#5904)
This PR adds tuple projection operator to the theory of data types. It Also adds helper functions for selecting elements from a tuple.
Diffstat (limited to 'src/printer')
-rw-r--r--src/printer/smt2/smt2_printer.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/printer/smt2/smt2_printer.cpp b/src/printer/smt2/smt2_printer.cpp
index fd9d20e4b..8c122f26d 100644
--- a/src/printer/smt2/smt2_printer.cpp
+++ b/src/printer/smt2/smt2_printer.cpp
@@ -903,6 +903,21 @@ void Smt2Printer::toStream(std::ostream& out,
}
break;
}
+ case kind::TUPLE_PROJECT:
+ {
+ TupleProjectOp op = n.getOperator().getConst<TupleProjectOp>();
+ if (op.getIndices().empty())
+ {
+ // e.g. (tuple_project tuple)
+ out << "project " << n[0] << ")";
+ }
+ else
+ {
+ // e.g. ((_ tuple_project 2 4 4) tuple)
+ out << "(_ tuple_project" << op << ") " << n[0] << ")";
+ }
+ return;
+ }
case kind::CONSTRUCTOR_TYPE:
{
out << n[n.getNumChildren()-1];
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback