out << n.getConst<Datatype>().getName();
break;
+ case kind::EMPTYSET: {
+ out << "{} :: " << n.getConst<EmptySet>().getType();
+ return;
+ break;
+ }
+
default:
// fall back on whatever operator<< does on underlying type; we
// might luck out and print something reasonable
return;
break;
+ // SETS
+ case kind::SET_TYPE:
+ out << "SET OF ";
+ toStream(out, n[0], depth, types, false);
+ return;
+ break;
+ case kind::UNION:
+ op << '|';
+ opType = INFIX;
+ break;
+ case kind::INTERSECTION:
+ op << '&';
+ opType = INFIX;
+ break;
+ case kind::SETMINUS:
+ op << '-';
+ opType = INFIX;
+ break;
+ case kind::SUBSET:
+ op << "<=";
+ opType = INFIX;
+ break;
+ case kind::MEMBER:
+ op << "IN";
+ opType = INFIX;
+ break;
+ case kind::SINGLETON:
+ out << "{";
+ toStream(out, n[0], depth, types, false);
+ out << "}";
+ return;
+ break;
+ case kind::INSERT: {
+ if(bracket) {
+ out << '(';
+ }
+ out << '{';
+ size_t i = 0;
+ toStream(out, n[i++], depth, types, false);
+ for(;i+1 < n.getNumChildren(); ++i) {
+ out << ", ";
+ toStream(out, n[i], depth, types, false);
+ }
+ out << "} | ";
+ toStream(out, n[i], depth, types, true);
+ if(bracket) {
+ out << ')';
+ }
+ return;
+ break;
+ }
+
// Quantifiers
case kind::FORALL:
out << "(FORALL";
--- /dev/null
+OPTION "logic" "ALL_SUPPORTED";
+SetInt : TYPE = SET OF INT;
+PUSH;
+a : SET OF INT;
+b : SET OF INT;
+c : SET OF INT;
+e : INT;
+ASSERT a = {5};
+ASSERT c = (a | b);
+ASSERT NOT(c = (a & b));
+ASSERT c = (a - b);
+ASSERT a <= b;
+ASSERT e IN c;
+ASSERT e IN a;
+ASSERT e IN (a & b);
+CHECKSAT TRUE;
+POP;
+PUSH;
+x : SET OF INT;
+y : SET OF INT;
+z : SET OF INT;
+ASSERT x = y;
+ASSERT NOT((x | z) = (y | z));
+CHECKSAT TRUE;
+POP;
+PUSH;
+x : SET OF INT;
+y : SET OF INT;
+e1 : INT;
+e2 : INT;
+ASSERT x = y;
+ASSERT e1 = e2;
+ASSERT e1 IN x;
+ASSERT NOT(e2 IN y);
+CHECKSAT TRUE;
+POP;
+PUSH;
+x : SET OF INT;
+y : SET OF INT;
+z : SET OF INT;
+e1 : INT;
+e2 : INT;
+ASSERT x = y;
+ASSERT e1 = e2;
+ASSERT e1 IN (x | z);
+ASSERT NOT(e2 IN (y | z));
+CHECKSAT TRUE;
+POP;
+PUSH;
+ASSERT 5 IN ({1, 2, 3, 4} | {5});
+ASSERT 5 IN ({1, 2, 3, 4} | {} :: SET OF INT);
+CHECKSAT TRUE;
+
; EXPECT: unsat
; EXPECT: unsat
; EXPECT: unsat
+; EXPECT: unsat
(set-logic ALL_SUPPORTED)
(define-sort SetInt () (Set Int))
(assert (not (member e2 (union y z))))
(check-sat)
(pop 1)
+
+; test all the other kinds for completeness
+(push 1)
+(assert (member 5 (insert 1 2 3 4 (singleton 5))))
+(assert (member 5 (insert 1 2 3 4 (as emptyset (Set Int)))))
+(check-sat)
(exit)
-(exit)