; @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) :var ((m Int) (n Int)))
(rule (u m n i total) (u m n (+ i 1) (+ total i)) :guard (<= i n) :var ((m Int) (n Int) (i Int) (total Int)))
(rule (u m n i total) (return total) :guard (not (<= i n)) :var ((m Int) (n Int) (i Int) (total Int)))