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

[SMT] Add quantifier attribute and pattern support to ExportSMTLIB #6913

Open
maerhart opened this issue Apr 11, 2024 · 1 comment
Open

[SMT] Add quantifier attribute and pattern support to ExportSMTLIB #6913

maerhart opened this issue Apr 11, 2024 · 1 comment
Assignees
Labels
good first issue Good for newcomers

Comments

@maerhart
Copy link
Member

The SMT operations smt.forall and smt.exists support attributes called weight and no_pattern to give hints to the solver backend (e.g., Z3). We should add support for them in the ExportSMTLIB pass. Currently, it just errors out when it encounters those attributes:

// TODO: add support
if (op.getWeight() != 0)
return op.emitError() << "non-zero weights not supported yet";
if (op.getNoPattern())
return op.emitError() << "no-pattern attribute not supported yet";
if (!op.getPatterns().empty())
return op.emitError() << "patterns not supported yet";

Furthermore, the quantifier operations allow a variadic number of regions representing a multi-pattern each, i.e., each region should be emitted as one :pattern attribute such that each operand of the smt.yield operation in the region represents one pattern in the multi-pattern.

Information on how such attributes have to be annotated in SMT-LIB can be found in the SMT-LIB standard version 2.6 sections 3.6.5 and 3.6.6

Z3-specific documentation of those features can be found here:
https://microsoft.github.io/z3guide/docs/logic/Quantifiers/#patterns
https://microsoft.github.io/z3guide/docs/logic/Quantifiers/#multi-patterns
https://microsoft.github.io/z3guide/docs/logic/Quantifiers/#no-patterns

@maerhart maerhart added the good first issue Good for newcomers label Apr 11, 2024
@luisacicolini
Copy link
Contributor

Happy to work on this!

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

No branches or pull requests

2 participants