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

java-backend: support SMTLIB translation for KVar binders #1237

Merged
merged 6 commits into from
Apr 27, 2020

Conversation

daejunpark
Copy link
Contributor

@daejunpark daejunpark commented Apr 26, 2020

Support the format [smtlib((forall|exists ((#1 <sort>)) <term>))]. See the test for an example.

Support SMTLIB translation for binders of sort KVar.

@@ -656,6 +676,13 @@ public SMTLibTerm transform(BitVector bitVector) {

@Override
public SMTLibTerm transform(UninterpretedToken uninterpretedToken) {
if (uninterpretedToken.sort() == Sort.KVARIABLE) {
if (binders.search(uninterpretedToken) != -1) {
Copy link
Contributor

Choose a reason for hiding this comment

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

contains() must be used here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@@ -571,10 +587,14 @@ public SMTLibTerm transform(KItem kItem) {
if (label.startsWith("(")) {
// smtlib expression instead of operator
String expression = label;
boolean hasBinder = recordBinders(label, kList);
Copy link
Contributor

Choose a reason for hiding this comment

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

This whole feature is extraordinary error-prone. I'd say a warning must be added here when it is used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is no longer applicable.

@@ -243,6 +246,7 @@ public static CharSequence translateImplication(
private final LinkedHashSet<Variable> variables;
private final LinkedHashMap<Term, Variable> termAbstractionMap;
private final LinkedHashMap<UninterpretedToken, Integer> tokenEncoding;
private final Stack<Term> binders;
Copy link
Contributor

Choose a reason for hiding this comment

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

This variable must be renamed. Like smtlibForallOrExistsBinder ? Long names are better than confusing names.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now this PR becomes more general, and the name binders is appropriate.

@daejunpark daejunpark changed the title java-backend: support smtlib forall java-backend: support SMTLIB translation for binders of sort KVar Apr 27, 2020
@daejunpark daejunpark changed the title java-backend: support SMTLIB translation for binders of sort KVar java-backend: support SMTLIB translation for KVar binders Apr 27, 2020
@daejunpark
Copy link
Contributor Author

Now this PR becomes more general, supporting SMTLIB translation for arbitrary KVar binders. Please re-review.

@daejunpark daejunpark merged commit 0ac45da into master Apr 27, 2020
@daejunpark daejunpark deleted the smtlib-forall branch April 27, 2020 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants