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

Added logic to simplifier that creates equality out of > and < #229

Closed

Conversation

holycrap872
Copy link
Contributor

This commit adds the ability to concertize a variable's value by
using inequalities to find the range of values a variable can be.
Should the range be reduced to a single value, then the variable
can be concertized. For example if the state contains the constraints
(x>6) and (x<=7) then we know that (x==7). This equality can then be
used to simplify the incoming query.expr to a smaller and more
manageable form. Sometimes the query.expr can be simplified to a
concrete value, eliminating the need for a Solver call at all.

I ran my experiments with all of my other, pending, pull requests turned on. I did this in order to show the potential increases in speed of this technique (Without the other improvements, the effects of this pull request get washed out.) I can, however, rerun the experiments given the current state of Klee if you would like.

Command line options
--search=dfs --max-forks-terminate=32000
Of the six programs that finished, there was an average reduction in Solver calls of 26%. This ranged from "addr2line" which only saw a 17% drop (358 to 304) to "readelf" which saw a 32% drop (1086 to 866). In terms of performance, there was a 17% reduction in overall time required to complete the exploration. In the worst case "size" saw only a 10% drop (707 seconds to 642 seconds). In the best case "readelf" saw a 42% reduction in the overall time required to complete the exploration (189 seconds to 111 seconds).

For each of these six programs there was an identical number of instructions covered for the two different versions I tested.

--search=default
I did not run a regular search since, as we discussed in previous pull requests, the results are not directly comparable. I can, however, run these experiments and aggregate them if you'd like.

@holycrap872 holycrap872 force-pushed the InequalityConcretization branch 2 times, most recently from b913779 to 5114109 Compare April 23, 2015 17:22
This commit adds the ability to concretize a variable's value by
using inequalities to find the range of values a variable can be.
Should the range be reduced to a single value, then the variable
can be concretized. For example if the state contains the constraints
(x>6) and (x<=7) then we know that (x==7).  This equality can then be
used to simplify the incoming query.expr to a smaller and more
manageable form.  Sometimes the query.expr can be simplified to a
concrete value, eliminating the need for a Solver call at all.
@arrowd
Copy link
Contributor

arrowd commented Oct 22, 2021

I wonder why this seemingly useful PR has no comments at all.

@holycrap872 are you still interested in getting this in? Maybe you can rebase it on the tip?

@ccadar ccadar added this to Optimisations in KLEE Extensions Mar 21, 2023
@ccadar
Copy link
Contributor

ccadar commented Mar 21, 2023

We should close this old PR, but I've added it to https://github.com/klee/klee/projects/4 in case someone wants to revive it at some point.

@ccadar ccadar closed this Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
KLEE Extensions
Optimisations
Development

Successfully merging this pull request may close these issues.

None yet

3 participants