aboutsummaryrefslogtreecommitdiffstats
path: root/research/experiments/045-proof-compiler/units/read-direct.aup
blob: 8609a5ea5ccb1226a49aced0192f4cae21bfffaf (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].start }
  t = s
}