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

Wrong model on elementary integer problem #777

Closed
Halbaroth opened this issue Aug 9, 2023 · 2 comments · Fixed by #789
Closed

Wrong model on elementary integer problem #777

Halbaroth opened this issue Aug 9, 2023 · 2 comments · Fixed by #789
Assignees
Labels
bug models This issue is related to model generation.
Milestone

Comments

@Halbaroth
Copy link
Collaborator

Halbaroth commented Aug 9, 2023

Alt-Ergo produces a wrong model for this problem:

(set-logic ALL)
(set-option :produce-models true)
(declare-const i Int)
(define-fun C ((i Int)) Bool (> i 0))
(assert (C i))
(check-sat)
(get-model)

outputs

unknown
(
  (define-fun i () Int 0)
)

But the slightly different input:

(set-logic ALL)
(set-option :produce-models true)
(declare-const i Int)
(assert (> i 0))
(check-sat)
(get-model)

produces a correct model:

unknown
(
  (define-fun i () Int 2)
)

I used the command dune exec -- alt-ergo --produce-model --frontend dolmen.

@Halbaroth Halbaroth added the bug label Aug 9, 2023
@Halbaroth Halbaroth self-assigned this Aug 9, 2023
@bclement-ocp bclement-ocp added the models This issue is related to model generation. label Aug 10, 2023
@bclement-ocp
Copy link
Collaborator

Ah interesting. Something weird is going on because we have i → 2 in the UF representative map before generating the model, but it looks like model generation happens in a fresh context somehow? Maybe this is related to #739?

@Halbaroth
Copy link
Collaborator Author

Yes, it is! We can see it if we use --dump-models instead of --produce-models. I will fix this bug for the release 2.5.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug models This issue is related to model generation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants