eval<A extends Expr?> method

A eval<A extends Expr?>(
  1. Expr query, {
  2. bool completion = true,
})

Evaluates the expression query in this model.

Implementation

A eval<A extends Expr?>(Expr query, {bool completion = true}) {
  final resultPtr = calloc<Z3_ast>();
  try {
    final success = _c._z3.model_eval(
      _model,
      _c._createAST(query),
      completion,
      resultPtr,
    );
    if (success) {
      return _c._getAST(resultPtr.value) as A;
    }
    return null as A;
  } finally {
    malloc.free(resultPtr);
  }
}