Iterate/Loop algebra

From Esolang
Jump to navigation Jump to search

Back to Iterate

This is still a work in progress. It may be changed in the future.

refers to any value independent of the current state of the block. Visit count specifically refers to the inner body, shown with an ellipsis.

Stateless

Structure Claim Note
*x<
  ...
>
By definition of the loop construct.
*c1<
  *c2<
    ...
  >
>
The inner body is executed times per each outer iteration, of which there are such.
*c1<
  ⋱
    *cn<
      ...
    >
  ⋰
>
Repeated application of the above.
*c<
  *n<
    ...
  >
>
On the -th iteration of the outer body, the inner body executes times.
*c<
  *~n<
    ...
  >
>
On the -th iteration of the outer body, the inner body executes times.
   *c<
  ⎧  *n<      
k ⎨    ⋱
  ⎩      *n<
           ...
         >
       ⋰
     >
   >
Repeated summation.
   *c<
  ⎧  *~n<      
k ⎨    ⋱
  ⎩      *~n<
           ...
         >
       ⋰
     >
   >
Repeated summation.
   *c<
  ⎧  *X<      
k ⎨    ⋱
  ⎩      *X<
           ...
         >
       ⋰
     >
   >

Where X is either n or ~n.

Where is the total number of n's, and is the total number of ~n's.

*c<
  *~n<
    ...
  >
  !
>
On the first iteration of the outer loop, VC increments by . The break immediately halts further iterations of the outer loop.

Stateful

Structure Claim Note
*=L1<
  (L1*)<>
>
*c<
  *=L1<
    (L1*)<>
  >
>
Repetition of above.