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

Unsound? smtlib2 output #491

Closed
leepike opened this issue Jun 11, 2019 · 0 comments · Fixed by #679
Closed

Unsound? smtlib2 output #491

leepike opened this issue Jun 11, 2019 · 0 comments · Fixed by #679
Assignees
Milestone

Comments

@leepike
Copy link

leepike commented Jun 11, 2019

SAW appears to generate inconsistent SMTLIB2 files: a smtlib file returns unsat in the case SAW returns Valid and a smtlib file returns unsat in the case SAW returns Invalid.

Possibly related to #489

> cat Double.java
class Double {
    public static int add(int x, int y) {
        return x + y;
    }

    public static int dbl(int x, int y) {
        return x - y;
    }
}

> cat double_java.saw
enable_experimental;

j <- java_load_class "Double";
add <- crucible_java_extract j "add";
dbl <- crucible_java_extract j "dbl";

let thm = {{ \x y -> add x y == dbl x y }};
write_smtlib2 "java_double.smt2" thm;

result <- prove abc thm;
print result;

print "Done.";

> javac Double.java
> saw -j <path>/rt.jar java_double.saw
Loading file "java_double.saw"
extracting add
extracting dbl
prove: 1 unsolved subgoal(s)
Invalid: [x = 671088640, y = 67108864]
Done.

> z3 java_double.smt2
...
unsat 

Now let's change Double.java to make the functions equivalent:

> cat Double.java
class Double {
    public static int add(int x, int y) {
        return x + y;
    }

    public static int dbl(int x, int y) {
        return x + y;
    }
}

> javac Double.java
> saw -j <path>/rt.jar java_double.saw
Loading file "java_double.saw"
extracting add
extracting dbl
Valid
Done.

> z3 java_double.smt2
...
unsat 
@atomb atomb added this to the 1.0 milestone Oct 18, 2019
@atomb atomb self-assigned this Apr 17, 2020
@atomb atomb linked a pull request Apr 17, 2020 that will close this issue
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 a pull request may close this issue.

2 participants