about summary refs log tree commit diff homepage
AgeCommit message (Collapse)Author
2015-04-01Commit of improved IndependentSolver::getIniitalValues().Eric Rizzi
Previous implementation simply passed the entire constraint forward without any factoring of the constraint at all. This is a problem since it is highly likely that there are cached solutions to pieces of the constraint. The new implementation breaks the entire constraint down into its requisite factors and passes each piece forward, one by one, down the solver chain. After an answer is returned, it is integrated into a larger solution. Since, by definition, no factor can affect another, we can safely create a solution to the larger constraint from the answers of its smaller pieces. The reconstruction of the solution is done by analyzing which parts of an array a factor touches. If the factor is the only one to reference a particular array, then all of the values calculated in the solution for that array are included in the final answer. If the factor references a particular element of the array (for example, arr[1]), then only the value in index 1 of array arr will be included in the solution.
2015-04-01Added the ability to solve for all factors in a particular query.Eric Rizzi
This functionality is necessary in order to more effectively handle calls to IndependentSolver::getInitialValues. An incoming query will be broken down into its smaller parts, and each piece will be solved for. At the end, the pieces will be recombined into a larger solution. The IndependentElementSet::getAllFactors() method takes a query and breaks it down into all of it's non-interacting factors. The IndependentElementSet::calculateArrays() method calculates which arrays are involved in a particular factor.
2015-03-10Altered DenseSet and IndependentElementSet to record ref<Expr> involvedEric Rizzi
This is important for future changes to IndependentSolver:: getInitialValues() so that an incoming constraint can be broken down into its smallest possible parts. Each of these individual parts may then be solved for and then the solutions to each piece combined to create a final answer. Finally, several fields which had previously been private are now public to facilitate the smaller solutions being combined into a larger solution.
2015-03-02New regression test checking that the Array factory correctly distinguishes ↵Cristian Cadar
between arrays created at the same location but with different sizes
2015-03-02Merge branch 'holycrap872-ArrayFactory'Cristian Cadar
2015-02-27Improved some comments and fixed some formatting issues in the Array factory ↵Cristian Cadar
patch.
2015-02-27Merge branch 'ArrayFactory' of https://github.com/holycrap872/klee into ↵Cristian Cadar
holycrap872-ArrayFactory
2015-02-22Added factory method for Arrays + hid constructors from outside callsEric Rizzi
The way that Arrays were handled in the past led to the possibility of aliasing issues. This occured whenever a new branch discovered an array for the first time. Each branch would create a new instance of the same array without seeing if it had been created before. Therefore, should a new branch encounter the same state as some previous branch, the previous branch's solution wouldn't satisfy the new state since they didn't recognize they were referencing the same array. By creating an array factory that creates a single symbolic array, that problem is handled. Note: Concrete arrays should not be created by the factory method since their values are never shared between branches. The factory works by seeing if an array with a similar hash has been created before (the hash is based on the name and size of array). If there has been it then searches through all of the arrays with the same hash (stored in a vector) to see if there is one with an exact match. If there is one, the address of this previously created equivalent array is returned. Otherwise, the newly created array is unique, it is added to the map, and it's address is returned. This aliasing issue can be seen by comparing the output of the Dogfood/ImmutableSet.cpp test cases with and with out this commit. Both act correctly, but the number of queries making it to the solver in the previous version is much greater 244 vs 211. This is because the UBTree in the CexCachingSolver and the cache in the CachingSolver do not recognize queries whose solutions were previously calculated because it doesn't think the arrays in the two queries are the same. While this does not cause an error, it does mean that extra calls are made.
2015-02-19Teach ExprSMTLIBPrinter to use SMTLIBv2's distinct function ratherDan Liew
than writing "(not (= a b))". This makes the code simpler and queries slightly simpler.
2015-02-13Fixed and refactored overflow test cases.Cristian Cadar
2015-02-13refactor integer overflow detection, add signed intLuca Dariz
Instead of checking for every possible casse which result in overflow, it is much simpler to perform the operation using integers with bigger dimension and check if the result overflow
2015-02-13Fix overflow detection in unsigned multiplicationLuca Dariz
Previously the check was done as unsigned int a, b, c; c = a * b; if (c < a) // error but it is wrong, since it catches only a subset of all the possible overflows. This patch improves the check as unsigned int a, b, c; if ((a > 1) && (b > 1){ if ((UINT_MAX/a) < b) // error } An additional case has been added to the tests, with two 32-bit values that cause overflow and are not detected by the old check. It is also necessary to break the lowering procedure in case the current BasicBlock is splitted; in this case it was necessary in order not to trigger the division by 0 error.
2015-02-13add tests for unsigned integer overflowLuca Dariz
2015-02-13Detect overflow of unsigned add, sub and mul operationsLuca Dariz
This requires clang with -fsanitize=unsigned-integer-overflow tested with clang and llvm 3.4.2
2015-02-13Revert "Merged @luckyluke's change for detecting overflow of unsigned add, sub"Cristian Cadar
Will redo the merge to preserve original commits. This reverts commit a743d7072d9ccf11f96e3df45f25ad07da6ad9d6.
2015-02-10Merged @luckyluke's change for detecting overflow of unsigned add, subCristian Cadar
and mul operations. Refactored tests into two main cases, and disabled them on LLVM 2.9, which does not support -fsanitized=*signed-integer-overflow.
2014-12-19Merge pull request #168 from willemp/fix-va-args-passing-for-big-typesCristian Cadar
Fix va args passing for big types
2014-12-19Moved some of @ddunbar's notes from llvm.org/bugs into TODO.txtCristian Cadar
2014-12-18Merge pull request #178 from mchalupa/masterCristian Cadar
klee: let user override path to runtime library
2014-12-13Add a few line breaks to make the code more readable inDan Liew
ExprSMTLIBPrinter
2014-12-13Clean up some ExprSMTLIBPrinter code by using llvm_unreachableDan Liew
2014-12-13Clean up a few comments in ExprSMTLIBPrinterDan Liew
2014-12-12Print nested let-abbreviations in ExprSMTLIBPrinterRaimondas Sasnauskas
This patch introduces nested let-abbreviations in the ExprSMTLIBPrinter to reduce the size of the SMTLIBv2 queries and the corresponding processing time (bugfix for #170). The current implementation of the let abbreviation mode does not consider expression intra-dependencies and prints all abbreviations in the same let scope. For a (simplified) example, it prints (assert (let ( (?B1 (A + B)) (?B2 (A + B + C)) ) (= ?B1 ?B2) ) ). This is extremely inefficient if the expressions (and there many of these!) extensively reuse their subexpressions. Therefore, it's better to print the query with nested let-expressions by reusing existing expression bindings in the new let scope: (assert (let ( (?B1 (A + B)) ) (let ( (?B2 (?B1 + C)) ) (= ?B1 ?B2) ) ) ). This patch adds a new function ExprSMTLIBPrinter::scanBindingExprDeps() that scans bindings for expression dependencies. The result is a vector of new bindings (orderedBindings) that represents the expression dependency tree. When printing in the let-abbreviation mode, the new code starts with abbreviating expressions that have no dependencies and then gradually makes these new bindings available in the upcoming let-scopes where expressions with dependencies reuse them. The effect of nested let-abbreviations is comparable to :named abbreviations. However, the latter mode is not supported by the majority of the solvers.
2014-12-09Merge pull request #186 from paulmar/fixshiftCristian Cadar
Fix overshift check
2014-12-08Merge pull request #183 from hpalikareva/fix-overshift-metasmtCristian Cadar
Handling overshift behaviour in MetaSMTBuilder
2014-12-08Fix overshift checkPaul Marinescu
Shifting by bitwidth-1 is valid
2014-12-03Merge pull request #182 from hpalikareva/fix-test-prefer-cexCristian Cadar
Fixed test /Feature/PreferCex.c: Z3 instantiates different value for unc...
2014-12-03Handling overshift behaviour in MetaSMTBuilderHristina Palikareva
2014-12-03Fixed test /Feature/PreferCex.c: Z3 instantiates different value for ↵Hristina Palikareva
unconstrained buf[3]
2014-12-02Unbreak compilation (in metaSMT configuration) by preventing the #defineHristina Palikareva
unordered_map and unordered_set from leaking out into other compilation units. This should be removed entirely when C++11 support lands.
2014-12-02Fix typoDan Liew
2014-12-02Add a comment explaining why the query expr is being negated.Dan Liew
2014-12-02The printing of constraints and the QueryExpr have been merged into aDan Liew
single method with two different implementations. There is one version of this method for human readability (printHumanReadableQuery()) and a version for machine consumption (printMachineReadableQuery()). The reason for having two versions is because different behaviour is needed in different scenarios * In machine readable mode the entire query is printed inside a single ``(assert ...)``. This is done to allow ``(let ...)`` to abbreviate as much as possible. * In human readable mode each constraint and query expression is printed inside its own ``(assert ...)`` unless the abbreviation mode is ABBR_LET in which case all constraints and query expr are printed inside a single ``(assert ...)`` much like in the machine readable mode Whilst I was here I also fixed a bug handling identation when printing ``(let ...)`` expressions in printAssert()
2014-12-02Implement :named and let abbreviation modes in ExprSMTLIBPrinterRaimondas Sasnauskas
* Set the default abbreviation mode to let (ExprSMTLIBPrinter::ABBR_LET) * Remove the now defunct ExprSMTLIBLetPrinter * Improve performance of ExprSMTLIBPrinter::scan() by keeping track of visited Expr to avoid visiting them again * Rename ExprSMTLIBPrinter::printQuery() to ExprSMTLIBPrinter::printQueryExpr()
2014-12-01klee: let user override path to runtime libraryMarek Chalupa
When looking for runtime library, look first into KLEE_RUNTIME_LIBRARY_PATH environment variable. This allows to use klee not only in 'hardcoded' environment. Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
2014-11-13Fix broken webpage link in README.mdDan Liew
2014-11-13Merge pull request #177 from jirislaby/destdirDan Liew
tools: prepend DESTDIR when installing
2014-11-13tools: prepend DESTDIR when installingJiri Slaby
Some tools prepend DESTDIR properly, some not. ktest-tool and klee-stats do not, so 'make install' chokes with an error: llvm[2]: Installing Release+Asserts /usr/bin/ktest-tool /usr/bin/install: cannot create regular file '/usr/bin/ktest-tool': Permission denied Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2014-11-02Merge pull request #174 from delcypher/allow_stp_installed_in_rootDan Liew
Allow stp installed in root
2014-11-01Upstream libstp is no longer dependent on Boost so remove theDan Liew
configure/Makefile code that adds Boost as a depdendency because We don't need to support old versions of STP that needed Boost.
2014-11-01configure: allow stp being installed in /Jiri Slaby
I have stp in standard paths: /usr/include and /usr/lib64. Allow that by correct STP_CFLAGS + STP_LDFLAGS instead of STP_ROOT. Those are empty when --with-stp is not passed. configure is regenerated by autoconf too. Signed-off-by: Jiri Slaby <jslaby@suse.cz>
2014-10-31Merge pull request #173 from delcypher/switch_to_autoconf_2.69Cristian Cadar
Switch to using autoconf 2.69 this version is more commonly available
2014-10-31Merge pull request #167 from ↵Dan Liew
willemp/willem/fix_64bit_printing_bug_in_testingUtils Fix 64bit printing bug in testing utils
2014-10-31Switch to using autoconf 2.69 this version is more commonly availableDan Liew
on Linux systems (2.60 is quite old) which will make updating the configure script easier for most users.
2014-10-16Fixed declaration of print_int that Travis complained aboutWillem
2014-10-16Fix the bug in printing 64bit numbers, set the test to expect passing. ↵Willem
Changed _testingUtils to use stdint.h
2014-10-15Fixed test/Concrete/ConstantExpr.llWillem
The difference between a 64bit pointer truncated to 32 bits and the original 64bit pointer would never be 0 if any of the high 32bits in the pointer were test. If lli and klee had a different value for the top 32bits of the address this test would be marked as failing. Due to the 64bit printing buf in _testingUtils this was not exposed before. The fix clears the top 32bits of the difference.
2014-10-15Added tests to _testingUtils.c (currently failing due to a bug in printing ↵Willem
64bit numbers) Fixing this bug will expose a failing test case for Concrete/ConstantExpr.ll
2014-10-09Fixed passing of long double (and other big types) in var_args on x86_64. ↵Willem
Removed XFAIL tag from the Feature/VarArgLongDouble.c test Fixed Executor to (more) correctly handle the alignment of types larger than 64bit (such as long double) when those are passed in var_args on x86_64. Specifically: From http://www.x86-64.org/documentation/abi.pdf AMD64-ABI 3.5.7p5: Step 7. Align l->overflow_arg_area upwards to a 16 byte boundary if alignment needed by type exceeds 8 byte boundary.
2014-10-09Add (currently failing) test to check for correct long double alignment in ↵Willem
varargs on x86_64.