summaryrefslogtreecommitdiff
path: root/test/coq/pass/while_PM_terminating.sail
diff options
context:
space:
mode:
authorBrian Campbell2019-04-15 12:08:28 +0100
committerBrian Campbell2019-04-15 12:08:28 +0100
commit1f421b865a87a161a82550443a0cf39aa2642d9c (patch)
tree61cd10e0203c7e613ba280c73360abfecad38277 /test/coq/pass/while_PM_terminating.sail
parent57443173923e87f33713c99dbab9eba7e3db0660 (diff)
Basic loop termination measures for Coq
Currently only supports pure termination measures for loops with effects. The user syntax uses separate termination measure declarations, as in the previous recursive termination measures, which are rewritten into the loop AST nodes before type checking (because it would be rather difficult to calculate the correct environment to type check the separate declaration in).
Diffstat (limited to 'test/coq/pass/while_PM_terminating.sail')
-rw-r--r--test/coq/pass/while_PM_terminating.sail15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/coq/pass/while_PM_terminating.sail b/test/coq/pass/while_PM_terminating.sail
new file mode 100644
index 00000000..5129e997
--- /dev/null
+++ b/test/coq/pass/while_PM_terminating.sail
@@ -0,0 +1,15 @@
+default Order dec
+
+$include <prelude.sail>
+
+register GPR00 : int
+
+function test b : int -> unit = {
+ i : int = 0;
+ while i < 64 do {
+ GPR00 = b + i;
+ i = i + 1;
+ }
+}
+
+termination_measure test while 64 - i