Lambda.bind constructor

Lambda.bind(
  1. Context context,
  2. List<ConstVar> bound,
  3. AST body
)

Implementation

factory Lambda.bind(
  Context context,
  List<ConstVar> bound,
  AST body,
) {
  final boundPtr = calloc<Z3_app>(bound.length);
  try {
    for (var i = 0; i < bound.length; i++) {
      boundPtr[i] = context._createAST(bound[i]).cast();
    }
    final result = context._z3.mk_lambda_const(
      bound.length,
      boundPtr,
      context._createAST(body),
    );
    return context._getAST(result) as Lambda;
  } finally {
    malloc.free(boundPtr);
  }
}