aa aaa aaa aaa aaa aaa aaa foreach(E1 in D1,, En in Dn, LocalVars,Goal)
Ei is a pattern that is normally a variable, but can also be any term. Di a collection. LocalVars, which is optional, is a list of variables in Goal that are local to each iteration. Goal is a callable term. All of the variables in the Ei's are local variables. The foreach call means that, for each combination of values ,
,
, the instance Goal is executed after the local variables are renamed. The call fails if any of the instances fails. Any variable, including the anonymous variable '
_
', that occurs in Goal, is shared by all iterations, unless the variable is contained within an Ei or LocalVars.
A collection takes one of the following forms: