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

Compare Z3 arrays by checking the formulas with the Z3 solver #61

Merged
merged 2 commits into from
Aug 22, 2019

Conversation

fortunac
Copy link

One caveat is that I had to change the API for get_refuted_goals from t -> Z3.Model.model -> Z3.context -> goal Core_kernel.Sequence.t to t -> Z3.Solver.solver -> Z3.context -> goal Core_kernel.Sequence.t

@fortunac fortunac requested a review from codyroux August 22, 2019 13:45
| Z3.Solver.UNKNOWN ->
failwith (Format.sprintf "get_refuted_goals: Unable to resolve branch \
condition at %s" (Tid.to_string tid))
end
| Clause (hyps, concs) ->
let hyps_false = List.exists hyps
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you pass all the hyp_vals in a big list to Z3.Solver.check, to only invoke it once? I think this is equivalent to the conjunction, which I think is what you want.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing in the list of hyp_vals works like a charm!

let mem = Var.create "mem" (mem32_t `r32) in
let loc1 = Var.create "loc" reg32_t in
let bv1 = Word.of_int ~width:32 0xDEADBEEF in
let bv2 = Word.of_int ~width:32 0x0FA1AFE1 in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cute!

@codyroux
Copy link
Contributor

Looks fine to me except maybe that one line where you handle Clauses! Check my reasoning though on that one...

@codyroux codyroux merged commit 87421e5 into master Aug 22, 2019
@codyroux codyroux deleted the fortunac/memory-comparison branch August 22, 2019 18:52
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