(datatype Expr (Num i64 :cost 1) (Add Expr Expr :cost 5)) (function Fib (i64) Expr :cost 10) (rewrite (Add (Num a) (Num b)) (Num (+ a b))) (rewrite (Fib x) (Add (Fib (- x 1)) (Fib (- x 2))) :when ((> x 1))) (rewrite (Fib x) (Num x) :when ((<= x 1))) (let f7 (Fib 7)) (run 1000) (print-function Fib 10) (extract f7) (check (= f7 (Num 13)))