Skip to content

Back-translate the SMTLIB unary minus, ignore models in "get-model" tests #4033

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

Merged
merged 3 commits into from
Aug 14, 2024

Conversation

geo2a
Copy link
Contributor

@geo2a geo2a commented Aug 13, 2024

This is a bridge PR that we need before bumping Z3 to 4.13.0.

  • modify test/rpc-server/runTests.py to not compare the actual model from "get-model" responses, as it may be non-deterministic. Only compare the "satisfiable" field, i.e. model existence;
  • when back-translating the results of "get-model" from SMTLIB2 s-expression to Kore, allow unary minus.

@geo2a geo2a mentioned this pull request Aug 13, 2024
@geo2a geo2a force-pushed the georgy/kore-get-model-fixes branch from 894f51f to 488804a Compare August 13, 2024 15:50
Back-translate (wrongly) unary minus

Special-case the test script for get-model

Remove special case for "-"

Special-case unary minus in a different way

add comment
@geo2a geo2a force-pushed the georgy/kore-get-model-fixes branch from 488804a to 6e4bb49 Compare August 13, 2024 15:58
@geo2a geo2a marked this pull request as ready for review August 13, 2024 15:59
Comment on lines 539 to 540
arg' <- backTranslate arg
pure $ TermLike.mkApplySymbol koreSym [mkInternalInt (InternalInt (simpleSort "SortInt") 0), arg']
Copy link
Member

Choose a reason for hiding this comment

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

I think we should rather just negate the InternalInt that we expect inside arg, unless that does not work for some reason...

Suggested change
arg' <- backTranslate arg
pure $ TermLike.mkApplySymbol koreSym [mkInternalInt (InternalInt (simpleSort "SortInt") 0), arg']
arg' <- backTranslate arg
case arg' of
InternalInt intSort n -> pure $ InternalInt intSort (negate n)
other -> throwError $ "unable to translate negation of " <> show other

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, that worked, modulo juggling Kore's data constructors.

@geo2a geo2a requested a review from jberthold August 14, 2024 07:09
@rv-jenkins rv-jenkins merged commit 53d55df into master Aug 14, 2024
6 checks passed
@rv-jenkins rv-jenkins deleted the georgy/kore-get-model-fixes branch August 14, 2024 08:30
rv-jenkins pushed a commit that referenced this pull request Aug 14, 2024
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.

4 participants