-
Notifications
You must be signed in to change notification settings - Fork 1
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
Process
backend: add a function for sending (exit)
#38
Conversation
I agree, are there cases where the distinction would be important? Does it make sense to My understanding is there are two ways to terminate a process: |
I guess I don't see this library as a way of enforcing a good default way to use SMT solvers (here as external processes), but just making it easier to work with them, so it makes sense to provide both So I'm thinking we can replace We can also expose the |
Also note that the new version of |
I'm all for your proposition for |
Can't the writing to the handle fail in the second |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
smtlib-backends-process/CHANGELOG.md
Outdated
@@ -1,5 +1,15 @@ | |||
# v0.3-alpha | |||
- make test-suite compatible with `smtlib-backends-0.3` | |||
- rename `Process.close` to `Process.kill` | |||
- rename `Process.wait` to `Process.close` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it really a renaming though? Wouldn't that line be confusing, and make people sed s/wait/close/g
, although it seems that they do not do the same operation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it better with 847f437 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll merge this for now, and we can always improve the changelog when we release the next version :)
|
`Process` backend: add a function for sending `(exit)`
Currently in
Queuing
mode there is no way to send an(exit)
command to aProcess
backend, as it needs to actually be evaluated immediately but won't make the solver output anything. UsingBck.(send . backend)
will thus leave the process hanging while waiting for a response that will never come.This PR fixes this by adding an
exit
function in theProcess
module. It makes sense to keep this inside this module as this is something backend-specific: the(exit)
command doesn't have any effect when using theZ3
backend. The implementation uses another function,write
, which factors the instructions for writing onto the process' input channel.I'm not sure whether it is best to keep this
exit
function on its own or to just merge it with thewith
function instead. They latter will always be used with the former anyways but it seems SMTLIB-based projects always separate these two functions.Another thing I'm wondering is whether this function's name could be any better. It might get confusing for the user to have access to
exit
,wait
andclose
.