-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix parser error, add parser module test
- Loading branch information
Showing
10 changed files
with
164 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#include "iif.h" | ||
#include <iostream> | ||
using namespace std; | ||
using namespace iif; | ||
|
||
int loopFunction(int _reserved_input_[]) { | ||
int x = _reserved_input_[0]; | ||
int y = _reserved_input_[1]; | ||
int z = _reserved_input_[2]; | ||
int w = _reserved_input_[3]; | ||
|
||
iif_assume(x==0&&y==0&&z==0&&w==0); | ||
|
||
while(rand()%2) { | ||
recordi(x, y, z, w); | ||
if(rand()%2){ | ||
x++; | ||
y=y+2; | ||
} | ||
else if(rand()%2){ | ||
if(x>=4){ | ||
x++; | ||
y=y+3; | ||
z=z+10; | ||
w=w+10; | ||
} | ||
} | ||
else if(x>=z&&w>=y+1){ | ||
x=-x; | ||
y=-y; | ||
} | ||
|
||
} | ||
recordi(x, y, z, w); | ||
|
||
iif_assert(3*x>y-1); | ||
|
||
return 0; | ||
} | ||
|
||
int main(int argc, char** argv) { | ||
iifround = atoi(argv[1]); | ||
initseed = atoi(argv[2]); | ||
iifContext context("/home/lijiaying/Research/GitHub/zilu/tmp/f2.var", loopFunction, "loopFunction", "/home/lijiaying/Research/GitHub/zilu/tmp/f2.ds"); | ||
context.addLearner("conjunctive"); | ||
return context.learn("/home/lijiaying/Research/GitHub/zilu/tmp/f2.cnt", "/home/lijiaying/Research/GitHub/zilu/tmp/f2"); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#/bin/bash | ||
|
||
if [ $? -lt 2 ]; then | ||
file="./test/03.cfg" | ||
else | ||
file=$1 | ||
fi | ||
########################################################################## | ||
# Generate C files to verify using cfg file and inv file | ||
########################################################################## | ||
dir_parser=./build | ||
dir_temp=./tmp | ||
mkdir -p $dir_parser $dir_temp | ||
|
||
cd $dir_parser | ||
cmake .. | ||
make | cp parser.hpp .. | ||
make | ||
cd .. | ||
|
||
#echo -n -e $blue"Generating C files to get initial positive/negative value by KLEE..."$normal | ||
cat $file | $dir_parser"/parser" -t 5 -c 1 -o $dir_temp"/last.c" | ||
#cat $path_cfg | $dir_parser"/parser" -t 5 -c -1 -o $dir_temp"/"$prefix"_init2/"$file_c_init | ||
#echo -n -e $green$bold"[Done]"$normal | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters