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

WP propagate to support bb-unmerge #410

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

Conversation

TheHillBright
Copy link
Contributor

Before this PR, when TX is run with bb-unmerge and WP, TX will soon fallback to deletion due to lack of support this PR adds.

@ArpitaDutta
Copy link
Member

  1. This commit has solved the previous issue of falling back to deletion.

  2. Correctly detected the bug discussed in the last example program of PR fix(subsumption): missed candidate basic blocks #383.

  3. However, I have a question regarding the below program, I am not getting the expected interpolants for the ipoint(var).

Every new iteration wrt. variable B (value 2 onwards) is into generating the nodes for the branch corresponding to ipoint(var).

Could you please look into this?

For example,

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <klee/klee.h>

#define loop for(;;)

#define f(x) (x + 2)
#define p(x) (x != 5)

#define ipoint(var) { int var; klee_make_symbolic(&var, sizeof(int), "var"); if (var) goto END; }

#define MAXDEEP 4

main() {
    int B = 1, c, x = 0;
    loop {
       int choice;
       klee_make_symbolic(&choice, sizeof(int), "choice");
       if (choice) {
            if (B == MAXDEEP) goto END;
               B++;
       } else {
               c = B;
               while (c) {
                     ipoint(var);
                     x = f(x);
                     klee_assert(p(x));
                     c = c - 1;
            }
                 break;
       }//EndIf
    }//EndLoop
END:;
}

Copy link
Member

@ArpitaDutta ArpitaDutta left a comment

Choose a reason for hiding this comment

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

Not getting expected interpolants for the below program.

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <klee/klee.h>
#define loop for(;;)
#define ipoint(var) { int var; klee_make_symbolic(&var, sizeof(int), "var"); if (var) goto END; }

#define MAXDEEP 4

main() {
    int x =1, y=1;
    int B = 1, c = 0;
    
    loop {
      int choice;
       klee_make_symbolic(&choice, sizeof(int), "choice");
       if (choice) {
           	if (B == MAXDEEP) exit(0);
		printf("%d\n",B);
		B++; 
       } else {
	   	c = B;
	   	while (c) {
		       ipoint(var);		        
		       y= y+x;
		       x = (x + 1) % 2 ; 
		       klee_assert(y>=1);
		       c = c - 1;
           	}
	  	break;
       }//EndIf
    }//EndLoop
END:;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants