aboutsummaryrefslogtreecommitdiffstats
path: root/research/experiments/045-proof-compiler/units/call.aup
diff options
context:
space:
mode:
Diffstat (limited to 'research/experiments/045-proof-compiler/units/call.aup')
-rw-r--r--research/experiments/045-proof-compiler/units/call.aup11
1 files changed, 11 insertions, 0 deletions
diff --git a/research/experiments/045-proof-compiler/units/call.aup b/research/experiments/045-proof-compiler/units/call.aup
new file mode 100644
index 0000000..ef31ef6
--- /dev/null
+++ b/research/experiments/045-proof-compiler/units/call.aup
@@ -0,0 +1,11 @@
+state t = 0
+input go = message { n: u32 }
+fn f(x) {
+ if x > 1000000 { return 0 }
+ return x + 1
+}
+on go {
+ let s = 0
+ for i in 0 .. go.n { s = s + f(i) }
+ t = s
+}