SRI-CSL / yices2

The Yices SMT Solver
https://yices.csl.sri.com/
GNU General Public License v3.0
368 stars 46 forks source link

SMT2 frontend does not flush output after responding to some commands #391

Closed greedy closed 2 years ago

greedy commented 2 years ago

Under certain conditions the SMT2 frontend does not flush the output after reporting the command results. This greatly frustrates interacting with yices from another program. These errors can be observed by running yices-smt2 | cat. Piping the output through cat is essential as it disables the default line-buffering of the terminal.

So far I have observed this with the following commands:

Looking at the code some, check_delayed_assertions (used by check-sat in non-incremental no-unsat-cores mode) ends with a flush_out() while check_delayed_assertions_assuming (used by check-sat-assuming in the same mode) does not. Perhaps rather than finding all the places that print a result without calling flush_out afterwards it would be better to add a flush_out() call to report_status or show_status and other mid-level output routines as appropriate.

BrunoDutertre commented 2 years ago

This should be fixed now (2f26134041b260d2d52e739feaabc31a9abe027d).

greedy commented 2 years ago

Confirmed that this resolves the problem for me. Thanks!