; @author Jonas Schöpf
; Ctrl example from examples/student/sumfrom04.ctrs
(format LCTRS :smtlib 2.6)
(theory Ints)
(sort Unit)
(fun v (-> Int Int Int Int Unit))
(fun return (-> Int Unit))
(fun u (-> Int Int Int Int Unit))
(fun sum2 (-> Int Int Unit))

(rule (v m n s i) (return s) :guard (not (<= i n)) :var ((m Int) (n Int) (s Int) (i Int)))
(rule (v m n s i) (v m n (+ s i) (+ i 1)) :guard (<= i n) :var ((m Int) (n Int) (s Int) (i Int)))
(rule (u m n s i) (v m n s i) :guard (not (> m n)) :var ((m Int) (n Int) (s Int) (i Int)))
(rule (u m n s i) (return 0) :guard (> m n) :var ((m Int) (n Int) (s Int) (i Int)))
(rule (sum2 m n) (u m n 0 m) :var ((m Int) (n Int)))
