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

Make solver output failsafe #462

Merged
merged 1 commit into from
Mar 1, 2024

Conversation

Timmmm
Copy link
Contributor

@Timmmm Timmmm commented Mar 1, 2024

cvc5 can output three different things:

  1. If it found a counter-example:
sat
(... the model ...)
  1. If it didn't find a counter-example:
unsat
(error "Cannot get model unless after a SAT or UNKNOWN response.")
  1. If you screw things up:
(error "Parse Error: model_smt_prop_fp_isnan.smt2:11.59: Symbol 'zf_is_NajhghjN_D_smt' not declared as a variable")

Note the last one has no sat or unsat, which meant it resulted in Sail printing Solver could not find counterexample, which is very misleading!

This change makes it a bit safer by explicitly looking for both sat and unsat.

I also changed all the prints in the file to print to stdout to be consistent.

@Timmmm
Copy link
Contributor Author

Timmmm commented Mar 1, 2024

(Note I did this before your latest commit; I think that made the output a bit safer but it probably doesn't hurt to have this still.)

@Timmmm Timmmm force-pushed the user/timh/failsafe_sat branch from 54ab7fb to 2813d4f Compare March 1, 2024 10:57
`cvc5` can output three different things:

1. If it found a counter-example:

```
sat
(... the model ...)
```

2. If it didn't find a counter-example:

```
unsat
(error "Cannot get model unless after a SAT or UNKNOWN response.")
```

3. If you screw things up:

```
(error "Parse Error: model_smt_prop_fp_isnan.smt2:11.59: Symbol 'zf_is_NajhghjN_D_smt' not declared as a variable")
```

Note the last one has no `sat` or `unsat`, which meant it resulted in Sail printing `Solver could not find counterexample`, which is very misleading!

This change makes it a bit safer by explicitly looking for both `sat` *and* `unsat`.

I also changed all the prints in the file to print to stdout to be consistent.
@Timmmm Timmmm force-pushed the user/timh/failsafe_sat branch from 2813d4f to e372d59 Compare March 1, 2024 11:04
Copy link

github-actions bot commented Mar 1, 2024

Test Results

    9 files  ±0     20 suites  ±0   0s ⏱️ ±0s
  612 tests ±0    612 ✅ ±0  0 💤 ±0  0 ❌ ±0 
1 969 runs  ±0  1 968 ✅ ±0  1 💤 ±0  0 ❌ ±0 

Results for commit e372d59. ± Comparison against base commit feb3d6f.

@Alasdair
Copy link
Collaborator

Alasdair commented Mar 1, 2024

Thanks!

@Alasdair Alasdair merged commit 7fcfb0c into rems-project:sail2 Mar 1, 2024
3 checks passed
@Timmmm Timmmm deleted the user/timh/failsafe_sat branch March 5, 2024 11:01
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 this pull request may close these issues.

2 participants