Next: , Up: PRS


11.1 Loop Rules

In CAST, loops of rules could be written like:

     <i:N:
       ~x[i] | ~z -> y[i]+
     >

The enclosing loop syntax is slightly different in HAC. The above example would be re-written as:

     (:i:N:
       ~x[i] | ~z -> y[i]+
     )

Again, rule loops may be nested arbitrarily deep. The notation :N: is also equivalent to :0..N-1:.

PRS-bodies may now appear inside instance-scope loops. The previous example could also be written as:

     (;i:N:
     prs {
       ~x[i] | ~z -> y[i]+
     }
     )