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

Proof backends confuse uninterpreted constants with similar names #568

Closed
brianhuffman opened this issue Oct 17, 2019 · 0 comments · Fixed by GaloisInc/saw-core#42 or #570
Closed
Labels
type: bug Issues reporting bugs or unexpected/unwanted behavior

Comments

@brianhuffman
Copy link
Contributor

If we define two constants with the same name (either by local definitions or by importing from more than one Cryptol module) the unint proof backends get confused and assume that they are the same constant.

For example, both of the prove_print commands in the following saw-script print "Valid":

let {{
  foo : [8] -> [8]
  foo x = 0
}};

let foo1 = {{ foo }};

let {{
  foo : [8] -> [8]
  foo x = x
}};

let foo2 = {{ foo }};

prove_print (unint_z3 ["foo"]) {{ \x -> foo1 x == foo2 x }};
prove_print (w4_unint_z3 ["foo"]) {{ \x -> foo1 x == foo2 x }};

Apparently both the sbv and what4 proof backends identify uninterpreted constants by their base names alone; we should additionally use unique ids to tell them apart. (Currently scConstant terms don't contain a unique id other than the one used for hash consing, which is actually optional. We should add a VarIndex to each scConstant like we do for ExtCns terms.)

@brianhuffman brianhuffman added the type: bug Issues reporting bugs or unexpected/unwanted behavior label Oct 17, 2019
brianhuffman pushed a commit to GaloisInc/saw-core that referenced this issue Oct 18, 2019
@brianhuffman brianhuffman reopened this Oct 18, 2019
@brianhuffman brianhuffman mentioned this issue Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Issues reporting bugs or unexpected/unwanted behavior
Projects
None yet
1 participant