build method

  1. @override
Z3_ast build(
  1. Context c
)
override

Implementation

@override
Z3_ast build(Context c) {
  final namesPtr = calloc<Z3_symbol>(args.length);
  final sortsPtr = calloc<Z3_sort>(args.length);
  try {
    var i = 0;
    for (final MapEntry(:key, :value) in args.entries) {
      namesPtr[i] = c._createSymbol(key);
      sortsPtr[i] = c._createSort(value);
      i++;
    }
    final result = c._z3.mk_lambda(
      args.length,
      sortsPtr,
      namesPtr,
      c._createAST(body),
    );
    return result;
  } finally {
    malloc.free(namesPtr);
    malloc.free(sortsPtr);
  }
}