buildSort method

  1. @override
Z3_sort buildSort(
  1. Context c
)
override

Implementation

@override
Z3_sort buildSort(Context c) {
  if (domains.length == 1) {
    return c._z3.mk_array_sort(
      c._createSort(domains.single),
      c._createSort(range),
    );
  } else {
    final indicesPtr = calloc<Z3_sort>(domains.length);
    try {
      for (var i = 0; i < domains.length; i++) {
        indicesPtr[i] = c._createSort(domains[i]);
      }
      return c._z3.mk_array_sort_n(
        domains.length,
        indicesPtr,
        c._createSort(range),
      );
    } finally {
      malloc.free(indicesPtr);
    }
  }
}