loop authored by Markus Klinik's avatar Markus Klinik
......@@ -390,3 +390,37 @@ bool onOff(int x)
[![](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/raw/master/code/website/recursive-onOff-no-merge.svg)](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/blob/master/code/website/recursive-onOff-no-merge-highres.svg)
[![](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/raw/master/code/website/recursive-onOff.svg)](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/blob/master/code/website/recursive-onOff-highres.svg)
## A loop condition with side effect
```c
int main()
{
i = 0;
while(
foo(i))
{
i = i + 1;
}
return 0;
}
bool foo(int i)
{
if( i < 10 )
{
LED1.switchOn();
return true;
}
else
{
LED1.switchOff();
return false;
}
}
```
[![](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/raw/master/code/website/loop-condition-with-side-effect-main-no-merge.svg)](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/blob/master/code/website/loop-condition-with-side-effect-main-no-merge-highres.svg)
[![](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/raw/master/code/website/loop-condition-with-side-effect-main.svg)](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/blob/master/code/website/loop-condition-with-side-effect-main-highres.svg)