; @author Jonas Schöpf
; Ctrl example from examples/student/sumfrom02.ctrs
(format LCTRS :smtlib 2.6)

(theory Ints)

(fun return (-> Int Int))
(fun sum2 (-> Int Int Int))
(fun u (-> Int Int Int Int Int))

(rule (sum2 m n) (u m n m 0))
(rule (u m n i total) (u m n (+ i 1) (+ total i)) :guard (<= i n))
(rule (u m n i total) (return total) :guard (not (<= i n)))
