; @origtpdbfilename gcdSet_a.trs
; @xtcfilename "../xml/gcdSet_a.trs.xml"
(format TRS)
(fun true 0)
(fun gcd 2)
(fun pred 1)
(fun if_gcd 3)
(fun false 0)
(fun nil 0)
(fun s 1)
(fun gcdL 1)
(fun le 2)
(fun |0| 0)
(fun minus 2)
(fun cons 2)
(rule (le |0| y) true)
(rule (le (s x) |0|) false)
(rule (le (s x) (s y)) (le x y))
(rule (pred (s x)) x)
(rule (minus x |0|) x)
(rule (minus x (s y)) (pred (minus x y)))
(rule (gcd |0| y) y)
(rule (gcd (s x) |0|) (s x))
(rule (gcd (s x) (s y)) (if_gcd (le y x) (s x) (s y)))
(rule (if_gcd true (s x) (s y)) (gcd (minus x y) (s y)))
(rule (if_gcd false (s x) (s y)) (gcd (minus y x) (s x)))
(rule (gcdL nil) |0|)
(rule (gcdL (cons x nil)) x)
(rule (gcdL (cons x (cons y xs))) (gcdL (cons (gcd x y) xs)))
(rule (gcdL (cons x (cons y xs))) (gcdL (cons y (cons x xs))) :cost 0)