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

No value printed in models for declared constants without constraint #767

Closed
Halbaroth opened this issue Jul 27, 2023 · 6 comments
Closed
Milestone

Comments

@Halbaroth
Copy link
Collaborator

Consider the input file

(set-logic ALL)
(declare-fun a () Int)
(declare-fun b () Int)
(declare-fun c () Int)

(assert (distinct a b))
(check-sat)
(get-model)

Calling AE with the command $ alt-ergo --produce-models input.smt2 outputs

unknown
(
  (define-fun a () Int 2)
  (define-fun b () Int 0)
)

According to the SMT-LIB, models have to contain definitions for all declared constants.

@Halbaroth Halbaroth added this to the 2.5.0 milestone Jul 27, 2023
@bclement-ocp
Copy link
Collaborator

I think that this is because we never call Uf.make on unused symbols, and we probably don't want to do that so as to avoid overloading the data structure.

Ideally we would have access to the actual list of declared symbols somewhere, but I don't think we have that currently, and from my understanding we would have to dig a bit into the guts of how model generation works to fix this. We are trying to avoid doing that until #553 is merged so I don't know if it's worth fixing for 2.5.0 ?

@Halbaroth Halbaroth modified the milestones: 2.5.0, 2.6.0 Jul 27, 2023
@Halbaroth
Copy link
Collaborator Author

I think that this is because we never call Uf.make on unused symbols, and we probably don't want to do that so as to avoid overloading the data structure.

This was my insight of the root of the problem. I agree we cannot change this quickly. I postponed it for the next release.

@bclement-ocp
Copy link
Collaborator

Another thing we need to be careful about: currently we create the Expr.t only when the symbols are used. Changing it to creating the Expr.t at declaration time would have implications for the weak table & the expression's ID :(

@Halbaroth
Copy link
Collaborator Author

Exactly! We have to clean up the way we use ID in the UF before fixing this issue.

@bclement-ocp
Copy link
Collaborator

I think maintaining a separate list of declared symbols (as Symbols.t, not Expr.t) and inspecting that list at model generation time as I described above would also work without impacting the weak table?

@bclement-ocp
Copy link
Collaborator

The code in the issue now prints the following (with --produce-models):

unknown
(
  (define-fun a () Int 1)
  (define-fun b () Int 0)
  (define-fun c () Int (as @a0 Int))
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants