aboutsummaryrefslogtreecommitdiffstats
path: root/research/experiments/045-proof-compiler/units/read.aup
blob: 34828e7912c96039c06ecf7052fb10a59c33a4d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
record R {
  start = 0
}
state ranges: list of R
state t = 0
input go = message { n: u32 }
on go {
  if ranges.count == 0 {
    for i in 0 .. 1000 { ranges.append(R { start: i }) }
  }
  let s = 0
  for i in 0 .. go.n { s = s + ranges[i % 1000].start }
  t = s
}