Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are there any ways to "catch" the error of Z3_mk_model? #69

Closed
LEAFERx opened this issue Feb 16, 2020 · 0 comments · Fixed by #92
Closed

Are there any ways to "catch" the error of Z3_mk_model? #69

LEAFERx opened this issue Feb 16, 2020 · 0 comments · Fixed by #92

Comments

@LEAFERx
Copy link
Contributor

LEAFERx commented Feb 16, 2020

Currently when calling Solver::get_model() without Solver::check() (or Solver::check_assumption) first or with Solver::check() returning UnSat, the process will just print out an error message and then exit, leaving users no room to do any error handling. Are there any workarounds to fix this?

For one workaround I can think of without handling the exception at the boundary of FFI, maybe we can maintain a status in Solver, like

enum SolverStatus {
  UnCheckedOrUnSat,
  Checked
}

And Solver::get_model() would return a Result<Model, [Some Error]> instead of just letting the process exits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant