如何索引ZIMPL中的子集集?

时间:2019-04-21 11:23:17

标签: syntax-error scip zimpl

将S作为一组子集,我想将其打印出来并对其进行索引:

set S[]:=subsets({1..5}, 3); 
do forall <i> in S do print S[i];

# Neither does the following work:

do print S;

我收到以下错误:

Reading debug.zpl
*** Error 142: Unknown index <> for symbol "S"
*** File: debug.zpl Line 2
*** do forall <i> in S do print S[i];
***                     ^^^

如何索引子集集?

1 个答案:

答案 0 :(得分:1)

do forall <i> in indexset(S) do print S[i];

应该做。