-
Notifications
You must be signed in to change notification settings - Fork 141
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
Conversation
09f2009
to
edb4b23
Compare
@@ -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) { |
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.
contains() must be used here
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.
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); |
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.
This whole feature is extraordinary error-prone. I'd say a warning must be added here when it is used.
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.
added
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.
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; |
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.
This variable must be renamed. Like smtlibForallOrExistsBinder
? Long names are better than confusing names.
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.
done
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.
Now this PR becomes more general, and the name binders
is appropriate.
Now this PR becomes more general, supporting SMTLIB translation for arbitrary KVar binders. Please re-review. |
Support the format[smtlib((forall|exists ((#1 <sort>)) <term>))]
. See the test for an example.Support SMTLIB translation for binders of sort
KVar
.