case kind::APPLY_SELECTOR_TOTAL: {
TypeNode t = n[0].getType();
Node opn = n.getOperator();
- if( t.isTuple() ){
+ if (t.isTuple() || t.isRecord())
+ {
toStream(out, n[0], depth, types, true);
+ out << '.';
const Datatype& dt = ((DatatypeType)t.toType()).getDatatype();
- int sindex = dt[0].getSelectorIndexInternal( opn.toExpr() );
- Assert( sindex>=0 );
- out << '.' << sindex;
+ if (t.isTuple())
+ {
+ int sindex;
+ if (n.getKind() == kind::APPLY_SELECTOR)
+ {
+ sindex = Datatype::indexOf(opn.toExpr());
+ }
+ else
+ {
+ sindex = dt[0].getSelectorIndexInternal(opn.toExpr());
+ }
+ Assert(sindex >= 0);
+ out << sindex;
+ }
+ else
+ {
+ toStream(out, opn, depth, types, false);
+ }
+ return;
}else{
toStream(op, opn, depth, types, false);
}
regress0/datatypes/some-boolean-tests.cvc
regress0/datatypes/stream-singleton.smt2
regress0/datatypes/tenum-bug.smt2
+ regress0/datatypes/tree-get-value.cvc
regress0/datatypes/tuple-model.cvc
regress0/datatypes/tuple-no-clash.cvc
regress0/datatypes/tuple-record-bug.cvc
regress0/print_lambda.cvc
regress0/printer/bv_consts_bin.smt2
regress0/printer/bv_consts_dec.smt2
+ regress0/printer/tuples_and_records.cvc
regress0/push-pop/boolean/fuzz_12.smt2
regress0/push-pop/boolean/fuzz_13.smt2
regress0/push-pop/boolean/fuzz_14.smt2
--- /dev/null
+% EXPECT: sat
+% EXPECT: ((left(x), leaf))
+OPTION "produce-models";
+DATATYPE
+ tree = node(left : tree, right : tree) | leaf
+END;
+x : tree;
+ASSERT is_leaf(left(x));
+CHECKSAT;
+GET_VALUE left(x);
--- /dev/null
+% EXPECT: invalid
+% EXPECT: ((r.a, "active"))
+% EXPECT: ((y.1, 9))
+OPTION "produce-models";
+
+R : TYPE = [#
+ a : STRING,
+ b : STRING
+#];
+r : R;
+
+y: [REAL, INT, REAL];
+
+ASSERT r = (# a := "active", b := "who knows?" #);
+ASSERT y = ( 4/5, 9, 11/9 );
+QUERY r.a = "what?";
+GET_VALUE r.a;
+GET_VALUE y.1;