diff options
Diffstat (limited to 'research/experiments/045-proof-compiler/units/read-direct.aup')
| -rw-r--r-- | research/experiments/045-proof-compiler/units/read-direct.aup | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/research/experiments/045-proof-compiler/units/read-direct.aup b/research/experiments/045-proof-compiler/units/read-direct.aup new file mode 100644 index 0000000..8609a5e --- /dev/null +++ b/research/experiments/045-proof-compiler/units/read-direct.aup @@ -0,0 +1,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 +} |
