recursiveFunc function

RecursiveFunc recursiveFunc(
  1. String name,
  2. Iterable<Sort> domain,
  3. Sort range,
  4. Expr? body,
)

Declare a recursive function with the given name, domain, and range.

The body of this function should be declared later using defineRecursiveFunc.

Implementation

RecursiveFunc recursiveFunc(
  String name,
  Iterable<Sort> domain,
  Sort range,
  Expr? body,
) {
  final result = RecursiveFunc(Sym(name), domain.toList(), range);
  if (body != null) {
    defineRecursiveFunc(result, body);
  }
  return result.declare();
}