TLA+ allows you to write bounded quantification over arbitrary sets and your examples are perfectly legal TLA+, but as the error message indicates, TLC is restricted to quantification over finite sets. You may override operator definitions (in the Toolbox tab Advanced Options -> Definition Override) and write something like
Seq(S) <- UNION { [1 .. k -> S] : k \in 0 .. 3 }
to restrict to sequences of length at most 3. In the case where S itself is infinite (such as Nat in your second example), you'll want to override its definition in a similar way.
Of course, you have to think about what this change of semantics means for your specification.
Regards,
Stephan
> --
> You received this message because you are subscribed to the Google Groups "tlaplus" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
tlaplus+u...@googlegroups.com.
> To post to this group, send email to
tla...@googlegroups.com.
> Visit this group at
https://groups.google.com/group/tlaplus.
> For more options, visit
https://groups.google.com/d/optout.