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

DEP: Wp interpolant, fix function calls #361

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

rasoolmaghareh
Copy link
Member

No description provided.

rasoolmaghareh and others added 5 commits December 26, 2019 17:29
Add wp-interpolant command line argument,
adding wpInterpolant field, getWPInterpolant, printWP methods and getWPInterpolantTime statistic,
Storing the list of visited instructions of a node in reverseInstructionList,
Marking instructions contributing to an infeasible path,
Adding wp class, GenerateWP function and the implication test: Context |= WP interpolant
Differentiating on instructions marked from false branch(mark with 2) and true branch (marked with 1).
This is important for negating of the instructions marked at false branch.
Separating the WP subsumption check from deletion subsumption check
Adding support for FMul,FDiv,FPToSI,SIToFP, FAdd and FSub and getting load**
Updating TxTree::markInstruction: Marking all the br instruction that have one branch as infeasible.
Other infeasible paths (like the infeasible paths in the internal KLEE function klee_make_symbolic are
not tracked by weakest precondition approach. Adding the code for instantiating branchCondition.
Updating TxTreeNode::generateWPInterpolant
Calling updateSubsumptionTableEntrySinglePartition to update subsumptionTable entry with respect to the WP expression,
add WPInterpolant check in assert violation handler,
Handling loading of an array using getelementptr (the pointer arithmetic is not done yet).
Adding support for multi-dimensional arrays in WP,
implemement updateSubsumptionTableEntry function
Adding TxWPHelper::simplifyWPExpr and Simplify WP expression
Simplify expression on flag = 1/2 & fix checking variable with WPVar
Using Z3 simplication, Need to check for negative number conversion
… add wp simplication for Rem operator

Adding support for Upd & Sel expression for array theory.
Updaing Expr simplification to handle sel and upd array expressions
Adding subsumption on sel expression and Fixing crashes
…ating point formula. We use deletion.

Adding condition to fail subsumption if a variable is undefined. This can change in future.
Fix bug for erasing rows in concretelyAddressedStore.
…" expr in Z3 to Klee,

Add simplify step after merging from 2 child WPs, Implementation of Phi Node for WP interpolant,
Adding support for llvm::ConstantPointerNull in WP interpolant
@rasoolmaghareh
Copy link
Member Author

I am checking this branch on this example, and the subsumptions are not happening. @xuanlinhha can you please check why here the WP interpolant is empty?

#include <klee/klee.h>

int main() {
    int count = 2, sum = 0;
    int a[5] = {1, 10, 100, 1000, -1};
    while (count--) {
        int c;
        c = choice(a);
        if (c == -1) exit(0);
        sum += c;
        printf("Choice %d Sum %d\n", c, sum);
    }
    printf("Final Sum %d\n", sum);
    klee_assert(sum <= 9000);

}

int choice(int *a) {
    int c;
    printf("choice(): a[0] = %d\n", a[0]);
    klee_make_symbolic(&c, sizeof(unsigned), "c");
    if (*a == -1) return -1;
    if (c) return choice(a + 1); else { printf("Return %d\n", a[0]); return a[0]; }
}

@rasoolmaghareh rasoolmaghareh changed the title WIP: Wp interpolant, fix function calls DEP: Wp interpolant, fix function calls Jun 26, 2023
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