Skip to content

Commit

Permalink
#182 - examples
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed Jul 1, 2017
1 parent 71f3ab8 commit c05a241
Show file tree
Hide file tree
Showing 15 changed files with 270 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//#Unsafe
/*
* Author: Christian Schilling (schillic@informatik.uni-freiburg.de)
* Date: 2017-06-07
*/

procedure main() {
var x: int;
if (x > 0) {
call callee();
} else {
call callee();
}
assert(false);
}


procedure callee() returns ()
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//#Unsafe
/*
* Author: Christian Schilling (schillic@informatik.uni-freiburg.de)
* Date: 2017-06-19
*/

procedure main() {
var x: int;

if (x > 2) {
call foo();
} else {
call foo();
}
}

procedure foo() returns () {
assert false;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//#Unsafe
/*
* Author: Christian Schilling (schillic@informatik.uni-freiburg.de)
* Date: 2017-06-19
*/

procedure main() {
var x: int;

if (true) {
}
if (x > 2) {
call foo();
} else {
call foo();
}
}

procedure foo() returns () {
assert false;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//#Unsafe
/*
* Author: Christian Schilling (schillic@informatik.uni-freiburg.de)
* Date: 2017-06-19
*/

var g: int;

procedure main() returns ();
modifies g;

implementation main() {
var x: int;

g := 0;
if (x > 2) {
call foo();
}
if (x <= 2) {
call foo();
}
assert(g == 0);
}

procedure foo() returns ();
modifies g;

implementation foo() returns () {
g := 1;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//#Unsafe
/*
* Author: Christian Schilling (schillic@informatik.uni-freiburg.de)
* Date: 2017-06-02
*/


procedure main()
{
var x, y: int;

y := 1;
havoc x;
if (x > 0) {
y := 0;
} else {
x := 0;
}
assert(y == 1);
}
20 changes: 20 additions & 0 deletions trunk/examples/programs/toy/errorLocalization/toy/diamondSame.bpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//#Unsafe
/*
* Author: Christian Schilling (schillic@informatik.uni-freiburg.de)
* Date: 2017-06-30
*/

implementation main() returns () {
var x: int;

if (x > 0) {
x := 0;
} else {
x := 0;
}
assert false;
}

procedure main() returns ();
modifies ;
modifies ;
18 changes: 18 additions & 0 deletions trunk/examples/programs/toy/errorLocalization/toy/emptyCall.bpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//#Unsafe
/*
* Author: Christian Schilling (schillic@informatik.uni-freiburg.de)
* Date: 2017-06-14
*/

implementation main() returns (){
call init();
assert false;
}

implementation init() returns (){
}

procedure main() returns ();
modifies ;
procedure init() returns ();
modifies ;
13 changes: 13 additions & 0 deletions trunk/examples/programs/toy/errorLocalization/toy/emptyProgram.bpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//#Unsafe
/*
* Author: Christian Schilling (schillic@informatik.uni-freiburg.de)
* Date: 2017-06-12
*/

implementation main() returns (){
assert false;
}

procedure main() returns ();
modifies ;
modifies ;
13 changes: 13 additions & 0 deletions trunk/examples/programs/toy/errorLocalization/toy/loopNondet1.bpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//#Unsafe
/*
* Author: Christian Schilling (schillic@informatik.uni-freiburg.de)
* Date: 2017-06-25
*/

procedure main() returns () {
var x: int;

while (*) {
}
assert(x == 0);
}
14 changes: 14 additions & 0 deletions trunk/examples/programs/toy/errorLocalization/toy/loopNondet2.bpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//#Unsafe
/*
* Author: Christian Schilling (schillic@informatik.uni-freiburg.de)
* Date: 2017-06-25
*/

procedure main() returns () {
var x: int;

while (*) {
x := 1;
}
assert(x == 0);
}
14 changes: 14 additions & 0 deletions trunk/examples/programs/toy/errorLocalization/toy/loopNondet3.bpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//#Unsafe
/*
* Author: Christian Schilling (schillic@informatik.uni-freiburg.de)
* Date: 2017-06-25
*/

procedure main() returns () {
var x: int;

while (*) {
x := 0;
}
assert(x == 0);
}
14 changes: 14 additions & 0 deletions trunk/examples/programs/toy/errorLocalization/toy/loopNondet4.bpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//#Unsafe
/*
* Author: Christian Schilling (schillic@informatik.uni-freiburg.de)
* Date: 2017-06-25
*/

procedure main() returns () {
var x: int;

while (*) {
x := x + 1;
}
assert(x == 0);
}
14 changes: 14 additions & 0 deletions trunk/examples/programs/toy/errorLocalization/toy/loopNondet5.bpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//#Unsafe
/*
* Author: Christian Schilling (schillic@informatik.uni-freiburg.de)
* Date: 2017-06-25
*/

procedure main() returns () {
var x: int;

while (*) {
havoc x;
}
assert(x == 0);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//#Unsafe
/*
* Author: Christian Schilling (schillic@informatik.uni-freiburg.de)
* Date: 2017-06-20
*/

procedure main() {
var x,y: int;

while (x > 0) {
x := x - 1;
}
assert(y == 0);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//#Unsafe
/*
* Author: Christian Schilling (schillic@informatik.uni-freiburg.de)
* Date: 2017-06-28
*/

procedure main() {
var x: int;

while (x >= 0) {
x := x - 1;
if (x == 1) {
break;
}
if (x == 4) {
break;
}
if (x == 7) {
break;
}
if (x == 10) {
break;
}
}
assert(x == 0);
}

0 comments on commit c05a241

Please sign in to comment.