| 1 |
/*** |
| 2 |
!Test |
| 3 |
solvers: [gecode] |
| 4 |
expected: !Result |
| 5 |
status: SATISFIED |
| 6 |
solution: !Solution |
| 7 |
foo_int: 1 |
| 8 |
foo_str: "test" |
| 9 |
foo_enum: B |
| 10 |
bar_int: 2 |
| 11 |
bar_str: "pred" |
| 12 |
bar_enum: C |
| 13 |
baz_tup: [3, "func"] |
| 14 |
baz_rec: {"x": B} |
| 15 |
***/ |
| 16 |
|
| 17 |
enum A = {B,C}; |
| 18 |
|
| 19 |
$T: foo(tuple($T): x) = x.1; |
| 20 |
any: foo_int :: output = foo((1,)); |
| 21 |
any: foo_str :: output = foo(("test",)); |
| 22 |
any: foo_enum :: output = foo((B,)); |
| 23 |
|
| 24 |
|
| 25 |
$T: bar(record($T: t): x) = x.t; |
| 26 |
any: bar_int :: output = bar((t: 2)); |
| 27 |
any: bar_str :: output = bar((t: "pred")); |
| 28 |
any: bar_enum :: output = bar((t: C,)); |
| 29 |
|
| 30 |
function $X: baz($X: x) = x; |
| 31 |
|
| 32 |
any: baz_tup ::output = baz((3, "func")); |
| 33 |
any: baz_rec ::output = baz((x: B,)); |
| 34 |
|