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

Print models according to SMTLIB standard #64

Merged
merged 3 commits into from
Sep 18, 2024

Conversation

sankalpgambhir
Copy link
Contributor

@sankalpgambhir sankalpgambhir commented Sep 17, 2024

Minor fix, SMTLIB models are printed as s-lists as required by the standard.

image

SMTLIB Standard 2.6, Figure 3.9 / Page 47

As highlighted, eldarica does not print the parentheses, only the individual inner elements.

Old printing:

Small model

$ ./eld -hsmt -ssol modelTest.smt2 
sat
(define-fun P ((A Int)) Bool true)

Empty model

$ ./eld -hsmt -ssol modelTest.smt2 
sat

New Printing:

Small model

$ ./eld -hsmt -ssol modelTest.smt2 
sat
(
    (define-fun P ((A Int)) Bool true)
)

Empty model

$ ./eld -hsmt -ssol modelTest.smt2 
sat
(
)

z3 quickly for comparison:

$ z3 -smt2 modelTest.smt2
sat
(
  (define-fun P ((x!0 Int)) Bool
    (or (= x!0 0) (exists ((x!1 Int)) (! (= x!0 (+ 1 x!1)) :weight 0))))
)

Dicovered when the scala-smtlib parser was freaking out trying to read models from eldarica.

Changelog:

  • added outer parentheses and indentation to model printing
  • updated test answers accordingly (not full regeneration)
  • yices url is changed to https://eldarica.org/yices for the tests, and a -c is added to its wget call so yices isn't downloaded again every time the tests are run.

@sankalpgambhir
Copy link
Contributor Author

I will make a PR to rebase the scala-2.13 branch up to master after this is merged.

@sankalpgambhir
Copy link
Contributor Author

I forgot that the tests have models as text in their answers. Almost done correcting them.

@pruemmer pruemmer merged commit 45ae3bb into uuverifiers:master Sep 18, 2024
1 check passed
@pruemmer
Copy link
Collaborator

Great, thanks a lot for this fix!

@sankalpgambhir sankalpgambhir deleted the model-printing-fix2 branch September 18, 2024 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants