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

More aggressive techniques for reconstructing proofs of strings inferences #10680

Closed
wants to merge 3 commits into from

Conversation

ajreynol
Copy link
Member

@ajreynol ajreynol commented Apr 24, 2024

Introduces a new utility method for inferring whether a predicate follows from another by substitution+rewriting+AND_ELIM.

Also adds missing cases of string inferences that were not covered by proof reconstruction.

This reduces the number of unjustified THEORY_INFERENCE in our regressions from 1820 -> 1810.

@ajreynol ajreynol added normal Priority moderate Complexity labels Apr 24, 2024
@ajreynol ajreynol requested review from HanielB and yoni206 April 24, 2024 19:55
@@ -74,7 +76,7 @@ bool TheoryProofStepBuffer::applyPredTransform(Node src,
bool useExpected)
{
// symmetric equalities
if (d_autoSym && CDProof::isSame(src, tgt))
if (src == tgt || (d_autoSym && CDProof::isSame(src, tgt)))
Copy link
Member

Choose a reason for hiding this comment

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

if d_autoSym is false wouldn't you want to add the symmetry step explicitly?

if (success)
{
// If we were successful, now go back and justify the conversion to
// original forms, which should be trivial.
Copy link
Member

Choose a reason for hiding this comment

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

please clarify

Comment on lines +174 to +175
// see if src rewrites to (and ... tgt ...). In this case, we can
// infer tgt via AND_ELIM.
Copy link
Member

Choose a reason for hiding this comment

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

can you give an insight why this may happen? Looks odd that it would.

Comment on lines +911 to +919
if (!eqs[i][1].isConst()
&& eqs[i][1].getKind() != Kind::STRING_CONCAT)
{
subs.push_back(eqs[i][1].eqNode(eqs[i][0]));
}
else
{
subs.push_back(eqs[i]);
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (!eqs[i][1].isConst()
&& eqs[i][1].getKind() != Kind::STRING_CONCAT)
{
subs.push_back(eqs[i][1].eqNode(eqs[i][0]));
}
else
{
subs.push_back(eqs[i]);
}
subs.push_back(!eqs[i][1].isConst()
&& eqs[i][1].getKind() != Kind::STRING_CONCAT
? eqs[i][1].eqNode(eqs[i][0])
: eqs[i]);

Also, can you add an insight of what is going on here?

}
Trace("strings-ipc-prefix") << "- Via trans: " << curr << std::endl;
}
if (curr.isNull())
{
break;
}
std::reverse(subs.begin(), subs.end());
Copy link
Member

Choose a reason for hiding this comment

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

ditto

@ajreynol ajreynol closed this Aug 12, 2024
github-merge-queue bot pushed a commit that referenced this pull request Aug 19, 2024
A simpler alternative for #10680 that
suffices for a problem set of interest.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants