... | ... | @@ -141,3 +141,36 @@ int main() |
|
|
|
|
|
[![](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/raw/master/code/website/infeasible-omitted-main-no-merge.svg)](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/blob/master/code/website/infeasible-omitted-main-no-merge-highres.svg)
|
|
|
[![](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/raw/master/code/website/infeasible-omitted-main.svg)](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/blob/master/code/website/infeasible-omitted-main-highres.svg)
|
|
|
|
|
|
|
|
|
# Programs with loops
|
|
|
|
|
|
The following programs all use a loop.
|
|
|
|
|
|
## A loop that changes after two iterations
|
|
|
|
|
|
```c
|
|
|
int main()
|
|
|
{
|
|
|
x = TERM.readInt();
|
|
|
while( 0 <= x && x <= 3 )
|
|
|
{
|
|
|
if( x <= 1 )
|
|
|
{
|
|
|
LED1.switchOn();
|
|
|
LED1.switchOff();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
LED2.switchOn();
|
|
|
LED2.switchOff();
|
|
|
}
|
|
|
x = x + 1;
|
|
|
}
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
|
```
|
|
|
|
|
|
[![](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) |