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

Allow user to send and recieve custom messages to and from the SMT solver #31

Merged
merged 2 commits into from
Oct 7, 2024

Conversation

UnsignedByte
Copy link
Contributor

Fixes #30

Copy link
Collaborator

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

src/context.rs Outdated
Comment on lines 179 to 195
/// Directly send a command to the solver.
pub fn send(&mut self, cmd: SExpr) -> io::Result<()> {
let solver = self
.solver
.as_mut()
.expect("send requires a running solver");
solver.send(&self.arena, cmd)
}

/// Directly receive a response from the solver.
pub fn recv(&mut self) -> io::Result<SExpr> {
let solver = self
.solver
.as_mut()
.expect("recv requires a running solver");
solver.recv(&self.arena)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind adding a raw_ prefix (or something, open to bikeshedding) and a note in the doc comment to signify that these are low-level, "raw" APIs, check/set_option/etc. should generally be preferred, and are only intended as an escape hatch for solver-specific commands that this crate doesn't have built-in support for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! I also moved these calls to the bottom of the impl just so that they aren't at the top of cargo doc.

Copy link
Collaborator

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@fitzgen fitzgen merged commit 1a4f99c into elliottt:main Oct 7, 2024
1 check passed
@fitzgen
Copy link
Collaborator

fitzgen commented Oct 7, 2024

Published 0.2.3 with this

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.

Support for sending custom expressions to the solver
2 participants