... | @@ -174,3 +174,29 @@ int main() |
... | @@ -174,3 +174,29 @@ int main() |
|
|
|
|
|
[![](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/raw/master/code/website/loop-changes-main-no-merge.svg)](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/blob/master/code/website/loop-changes-main-no-merge-highres.svg)
|
|
[![](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/raw/master/code/website/loop-changes-main-no-merge.svg)](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/blob/master/code/website/loop-changes-main-no-merge-highres.svg)
|
|
[![](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/raw/master/code/website/loop-changes-main.svg)](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/blob/master/code/website/loop-changes-main-highres.svg)
|
|
[![](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/raw/master/code/website/loop-changes-main.svg)](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/blob/master/code/website/loop-changes-main-highres.svg)
|
|
|
|
|
|
|
|
|
|
|
|
## A loop with alternating behaviour in different iterations
|
|
|
|
|
|
|
|
```c
|
|
|
|
int main() {
|
|
|
|
y = 1;
|
|
|
|
x = TERM.readInt();
|
|
|
|
while( 0 <= x && x <= 4 ) {
|
|
|
|
if( y <= 0 ) {
|
|
|
|
LED1.switchOn();
|
|
|
|
LED2.switchOff();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
LED2.switchOn();
|
|
|
|
LED1.switchOff();
|
|
|
|
}
|
|
|
|
y = y * -1;
|
|
|
|
x = x + 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
[![](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/raw/master/code/website/loop-alternating-main-no-merge.svg)](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/blob/master/code/website/loop-alternating-main-no-merge-highres.svg)
|
|
|
|
[![](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/raw/master/code/website/loop-alternating-main.svg)](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/blob/master/code/website/loop-alternating-main-highres.svg) |