# LTS Termination Proof

by T2Cert

## Input

Integer Transition System
• Initial Location: 5
• Transitions: (pre-variables and post-variables)  0 0 1: 0 ≤ 0 ∧ 0 ≤ 0 ∧ 0 ≤ 0 ∧ 0 ≤ 0 ∧ 0 ≤ 0 ∧ 0 ≤ 0 ∧ 1 + ___const_100_0 − i_5_0 ≤ 0 ∧ ___retres3_7_post ≤ 0 ∧ − ___retres3_7_post ≤ 0 ∧ ___cil_tmp4_8_post − ___retres3_7_post ≤ 0 ∧ − ___cil_tmp4_8_post + ___retres3_7_post ≤ 0 ∧ Result_4_post − ___cil_tmp4_8_post ≤ 0 ∧ − Result_4_post + ___cil_tmp4_8_post ≤ 0 ∧ Result_4_0 − Result_4_post ≤ 0 ∧ − Result_4_0 + Result_4_post ≤ 0 ∧ ___cil_tmp4_8_0 − ___cil_tmp4_8_post ≤ 0 ∧ − ___cil_tmp4_8_0 + ___cil_tmp4_8_post ≤ 0 ∧ ___retres3_7_0 − ___retres3_7_post ≤ 0 ∧ − ___retres3_7_0 + ___retres3_7_post ≤ 0 ∧ − x_6_0 + x_6_0 ≤ 0 ∧ x_6_0 − x_6_0 ≤ 0 ∧ − i_5_post + i_5_post ≤ 0 ∧ i_5_post − i_5_post ≤ 0 ∧ − i_5_0 + i_5_0 ≤ 0 ∧ i_5_0 − i_5_0 ≤ 0 ∧ − ___const_100_0 + ___const_100_0 ≤ 0 ∧ ___const_100_0 − ___const_100_0 ≤ 0 0 1 2: 0 ≤ 0 ∧ 0 ≤ 0 ∧ − ___const_100_0 + i_5_0 ≤ 0 ∧ 1 − x_6_0 ≤ 0 ∧ −1 − i_5_0 + i_5_post ≤ 0 ∧ 1 + i_5_0 − i_5_post ≤ 0 ∧ i_5_0 − i_5_post ≤ 0 ∧ − i_5_0 + i_5_post ≤ 0 ∧ − x_6_0 + x_6_0 ≤ 0 ∧ x_6_0 − x_6_0 ≤ 0 ∧ − ___retres3_7_post + ___retres3_7_post ≤ 0 ∧ ___retres3_7_post − ___retres3_7_post ≤ 0 ∧ − ___retres3_7_0 + ___retres3_7_0 ≤ 0 ∧ ___retres3_7_0 − ___retres3_7_0 ≤ 0 ∧ − ___const_100_0 + ___const_100_0 ≤ 0 ∧ ___const_100_0 − ___const_100_0 ≤ 0 ∧ − ___cil_tmp4_8_post + ___cil_tmp4_8_post ≤ 0 ∧ ___cil_tmp4_8_post − ___cil_tmp4_8_post ≤ 0 ∧ − ___cil_tmp4_8_0 + ___cil_tmp4_8_0 ≤ 0 ∧ ___cil_tmp4_8_0 − ___cil_tmp4_8_0 ≤ 0 ∧ − Result_4_post + Result_4_post ≤ 0 ∧ Result_4_post − Result_4_post ≤ 0 ∧ − Result_4_0 + Result_4_0 ≤ 0 ∧ Result_4_0 − Result_4_0 ≤ 0 2 2 0: − x_6_0 + x_6_0 ≤ 0 ∧ x_6_0 − x_6_0 ≤ 0 ∧ − i_5_post + i_5_post ≤ 0 ∧ i_5_post − i_5_post ≤ 0 ∧ − i_5_0 + i_5_0 ≤ 0 ∧ i_5_0 − i_5_0 ≤ 0 ∧ − ___retres3_7_post + ___retres3_7_post ≤ 0 ∧ ___retres3_7_post − ___retres3_7_post ≤ 0 ∧ − ___retres3_7_0 + ___retres3_7_0 ≤ 0 ∧ ___retres3_7_0 − ___retres3_7_0 ≤ 0 ∧ − ___const_100_0 + ___const_100_0 ≤ 0 ∧ ___const_100_0 − ___const_100_0 ≤ 0 ∧ − ___cil_tmp4_8_post + ___cil_tmp4_8_post ≤ 0 ∧ ___cil_tmp4_8_post − ___cil_tmp4_8_post ≤ 0 ∧ − ___cil_tmp4_8_0 + ___cil_tmp4_8_0 ≤ 0 ∧ ___cil_tmp4_8_0 − ___cil_tmp4_8_0 ≤ 0 ∧ − Result_4_post + Result_4_post ≤ 0 ∧ Result_4_post − Result_4_post ≤ 0 ∧ − Result_4_0 + Result_4_0 ≤ 0 ∧ Result_4_0 − Result_4_0 ≤ 0 3 3 4: 0 ≤ 0 ∧ 0 ≤ 0 ∧ i_5_post ≤ 0 ∧ − i_5_post ≤ 0 ∧ i_5_0 − i_5_post ≤ 0 ∧ − i_5_0 + i_5_post ≤ 0 ∧ − x_6_0 + x_6_0 ≤ 0 ∧ x_6_0 − x_6_0 ≤ 0 ∧ − ___retres3_7_post + ___retres3_7_post ≤ 0 ∧ ___retres3_7_post − ___retres3_7_post ≤ 0 ∧ − ___retres3_7_0 + ___retres3_7_0 ≤ 0 ∧ ___retres3_7_0 − ___retres3_7_0 ≤ 0 ∧ − ___const_100_0 + ___const_100_0 ≤ 0 ∧ ___const_100_0 − ___const_100_0 ≤ 0 ∧ − ___cil_tmp4_8_post + ___cil_tmp4_8_post ≤ 0 ∧ ___cil_tmp4_8_post − ___cil_tmp4_8_post ≤ 0 ∧ − ___cil_tmp4_8_0 + ___cil_tmp4_8_0 ≤ 0 ∧ ___cil_tmp4_8_0 − ___cil_tmp4_8_0 ≤ 0 ∧ − Result_4_post + Result_4_post ≤ 0 ∧ Result_4_post − Result_4_post ≤ 0 ∧ − Result_4_0 + Result_4_0 ≤ 0 ∧ Result_4_0 − Result_4_0 ≤ 0 4 4 1: 0 ≤ 0 ∧ 0 ≤ 0 ∧ 0 ≤ 0 ∧ 0 ≤ 0 ∧ 0 ≤ 0 ∧ 0 ≤ 0 ∧ − ___const_100_0 + i_5_0 ≤ 0 ∧ x_6_0 ≤ 0 ∧ ___retres3_7_post ≤ 0 ∧ − ___retres3_7_post ≤ 0 ∧ ___cil_tmp4_8_post − ___retres3_7_post ≤ 0 ∧ − ___cil_tmp4_8_post + ___retres3_7_post ≤ 0 ∧ Result_4_post − ___cil_tmp4_8_post ≤ 0 ∧ − Result_4_post + ___cil_tmp4_8_post ≤ 0 ∧ Result_4_0 − Result_4_post ≤ 0 ∧ − Result_4_0 + Result_4_post ≤ 0 ∧ ___cil_tmp4_8_0 − ___cil_tmp4_8_post ≤ 0 ∧ − ___cil_tmp4_8_0 + ___cil_tmp4_8_post ≤ 0 ∧ ___retres3_7_0 − ___retres3_7_post ≤ 0 ∧ − ___retres3_7_0 + ___retres3_7_post ≤ 0 ∧ − x_6_0 + x_6_0 ≤ 0 ∧ x_6_0 − x_6_0 ≤ 0 ∧ − i_5_post + i_5_post ≤ 0 ∧ i_5_post − i_5_post ≤ 0 ∧ − i_5_0 + i_5_0 ≤ 0 ∧ i_5_0 − i_5_0 ≤ 0 ∧ − ___const_100_0 + ___const_100_0 ≤ 0 ∧ ___const_100_0 − ___const_100_0 ≤ 0 4 5 0: 0 ≤ 0 ∧ 0 ≤ 0 ∧ − ___const_100_0 + i_5_0 ≤ 0 ∧ 1 − x_6_0 ≤ 0 ∧ −1 − i_5_0 + i_5_post ≤ 0 ∧ 1 + i_5_0 − i_5_post ≤ 0 ∧ i_5_0 − i_5_post ≤ 0 ∧ − i_5_0 + i_5_post ≤ 0 ∧ − x_6_0 + x_6_0 ≤ 0 ∧ x_6_0 − x_6_0 ≤ 0 ∧ − ___retres3_7_post + ___retres3_7_post ≤ 0 ∧ ___retres3_7_post − ___retres3_7_post ≤ 0 ∧ − ___retres3_7_0 + ___retres3_7_0 ≤ 0 ∧ ___retres3_7_0 − ___retres3_7_0 ≤ 0 ∧ − ___const_100_0 + ___const_100_0 ≤ 0 ∧ ___const_100_0 − ___const_100_0 ≤ 0 ∧ − ___cil_tmp4_8_post + ___cil_tmp4_8_post ≤ 0 ∧ ___cil_tmp4_8_post − ___cil_tmp4_8_post ≤ 0 ∧ − ___cil_tmp4_8_0 + ___cil_tmp4_8_0 ≤ 0 ∧ ___cil_tmp4_8_0 − ___cil_tmp4_8_0 ≤ 0 ∧ − Result_4_post + Result_4_post ≤ 0 ∧ Result_4_post − Result_4_post ≤ 0 ∧ − Result_4_0 + Result_4_0 ≤ 0 ∧ Result_4_0 − Result_4_0 ≤ 0 5 6 3: − x_6_0 + x_6_0 ≤ 0 ∧ x_6_0 − x_6_0 ≤ 0 ∧ − i_5_post + i_5_post ≤ 0 ∧ i_5_post − i_5_post ≤ 0 ∧ − i_5_0 + i_5_0 ≤ 0 ∧ i_5_0 − i_5_0 ≤ 0 ∧ − ___retres3_7_post + ___retres3_7_post ≤ 0 ∧ ___retres3_7_post − ___retres3_7_post ≤ 0 ∧ − ___retres3_7_0 + ___retres3_7_0 ≤ 0 ∧ ___retres3_7_0 − ___retres3_7_0 ≤ 0 ∧ − ___const_100_0 + ___const_100_0 ≤ 0 ∧ ___const_100_0 − ___const_100_0 ≤ 0 ∧ − ___cil_tmp4_8_post + ___cil_tmp4_8_post ≤ 0 ∧ ___cil_tmp4_8_post − ___cil_tmp4_8_post ≤ 0 ∧ − ___cil_tmp4_8_0 + ___cil_tmp4_8_0 ≤ 0 ∧ ___cil_tmp4_8_0 − ___cil_tmp4_8_0 ≤ 0 ∧ − Result_4_post + Result_4_post ≤ 0 ∧ Result_4_post − Result_4_post ≤ 0 ∧ − Result_4_0 + Result_4_0 ≤ 0 ∧ Result_4_0 − Result_4_0 ≤ 0

## Proof

The following invariants are asserted.

 0: − ___const_100_0 ≤ 0 ∧ 1 − x_6_0 ≤ 0 1: Result_4_post ≤ 0 ∧ ___cil_tmp4_8_post ≤ 0 ∧ ___retres3_7_post ≤ 0 ∧ − ___retres3_7_post ≤ 0 ∧ − ___const_100_0 ≤ 0 ∧ Result_4_0 ≤ 0 ∧ ___cil_tmp4_8_0 ≤ 0 ∧ ___retres3_7_0 ≤ 0 ∧ − ___retres3_7_0 ≤ 0 2: − ___const_100_0 ≤ 0 ∧ 1 − x_6_0 ≤ 0 3: TRUE 4: i_5_post ≤ 0 ∧ − i_5_post ≤ 0 ∧ i_5_0 ≤ 0 ∧ − i_5_0 ≤ 0 5: TRUE

The invariants are proved as follows.

### IMPACT Invariant Proof

• nodes (location) invariant:  0 (0) − ___const_100_0 ≤ 0 ∧ 1 − x_6_0 ≤ 0 1 (1) Result_4_post ≤ 0 ∧ ___cil_tmp4_8_post ≤ 0 ∧ ___retres3_7_post ≤ 0 ∧ − ___retres3_7_post ≤ 0 ∧ − ___const_100_0 ≤ 0 ∧ Result_4_0 ≤ 0 ∧ ___cil_tmp4_8_0 ≤ 0 ∧ ___retres3_7_0 ≤ 0 ∧ − ___retres3_7_0 ≤ 0 2 (2) − ___const_100_0 ≤ 0 ∧ 1 − x_6_0 ≤ 0 3 (3) TRUE 4 (4) i_5_post ≤ 0 ∧ − i_5_post ≤ 0 ∧ i_5_0 ≤ 0 ∧ − i_5_0 ≤ 0 5 (5) TRUE
• initial node: 5
• cover edges:
• transition edges:  0 0 1 0 1 2 2 2 0 3 3 4 4 4 1 4 5 0 5 6 3

### 2 Switch to Cooperation Termination Proof

We consider the following cutpoint-transitions:
 0 7 0: − x_6_0 + x_6_0 ≤ 0 ∧ x_6_0 − x_6_0 ≤ 0 ∧ − i_5_post + i_5_post ≤ 0 ∧ i_5_post − i_5_post ≤ 0 ∧ − i_5_0 + i_5_0 ≤ 0 ∧ i_5_0 − i_5_0 ≤ 0 ∧ − ___retres3_7_post + ___retres3_7_post ≤ 0 ∧ ___retres3_7_post − ___retres3_7_post ≤ 0 ∧ − ___retres3_7_0 + ___retres3_7_0 ≤ 0 ∧ ___retres3_7_0 − ___retres3_7_0 ≤ 0 ∧ − ___const_100_0 + ___const_100_0 ≤ 0 ∧ ___const_100_0 − ___const_100_0 ≤ 0 ∧ − ___cil_tmp4_8_post + ___cil_tmp4_8_post ≤ 0 ∧ ___cil_tmp4_8_post − ___cil_tmp4_8_post ≤ 0 ∧ − ___cil_tmp4_8_0 + ___cil_tmp4_8_0 ≤ 0 ∧ ___cil_tmp4_8_0 − ___cil_tmp4_8_0 ≤ 0 ∧ − Result_4_post + Result_4_post ≤ 0 ∧ Result_4_post − Result_4_post ≤ 0 ∧ − Result_4_0 + Result_4_0 ≤ 0 ∧ Result_4_0 − Result_4_0 ≤ 0
and for every transition t, a duplicate t is considered.

### 3 Transition Removal

We remove transitions 0, 3, 4, 5, 6 using the following ranking functions, which are bounded by −15.

 5: 0 3: 0 4: 0 0: 0 2: 0 1: 0 5: −6 3: −7 4: −8 0: −9 2: −9 0_var_snapshot: −9 0*: −9 1: −13

The following skip-transition is inserted and corresponding redirections w.r.t. the old location are performed.

0* 10 0: x_6_0 + x_6_0 ≤ 0x_6_0x_6_0 ≤ 0i_5_post + i_5_post ≤ 0i_5_posti_5_post ≤ 0i_5_0 + i_5_0 ≤ 0i_5_0i_5_0 ≤ 0___retres3_7_post + ___retres3_7_post ≤ 0___retres3_7_post___retres3_7_post ≤ 0___retres3_7_0 + ___retres3_7_0 ≤ 0___retres3_7_0___retres3_7_0 ≤ 0___const_100_0 + ___const_100_0 ≤ 0___const_100_0___const_100_0 ≤ 0___cil_tmp4_8_post + ___cil_tmp4_8_post ≤ 0___cil_tmp4_8_post___cil_tmp4_8_post ≤ 0___cil_tmp4_8_0 + ___cil_tmp4_8_0 ≤ 0___cil_tmp4_8_0___cil_tmp4_8_0 ≤ 0Result_4_post + Result_4_post ≤ 0Result_4_postResult_4_post ≤ 0Result_4_0 + Result_4_0 ≤ 0Result_4_0Result_4_0 ≤ 0

The following skip-transition is inserted and corresponding redirections w.r.t. the old location are performed.

0 8 0_var_snapshot: x_6_0 + x_6_0 ≤ 0x_6_0x_6_0 ≤ 0i_5_post + i_5_post ≤ 0i_5_posti_5_post ≤ 0i_5_0 + i_5_0 ≤ 0i_5_0i_5_0 ≤ 0___retres3_7_post + ___retres3_7_post ≤ 0___retres3_7_post___retres3_7_post ≤ 0___retres3_7_0 + ___retres3_7_0 ≤ 0___retres3_7_0___retres3_7_0 ≤ 0___const_100_0 + ___const_100_0 ≤ 0___const_100_0___const_100_0 ≤ 0___cil_tmp4_8_post + ___cil_tmp4_8_post ≤ 0___cil_tmp4_8_post___cil_tmp4_8_post ≤ 0___cil_tmp4_8_0 + ___cil_tmp4_8_0 ≤ 0___cil_tmp4_8_0___cil_tmp4_8_0 ≤ 0Result_4_post + Result_4_post ≤ 0Result_4_postResult_4_post ≤ 0Result_4_0 + Result_4_0 ≤ 0Result_4_0Result_4_0 ≤ 0

### 6 SCC Decomposition

We consider subproblems for each of the 1 SCC(s) of the program graph.

### 6.1 SCC Subproblem 1/1

Here we consider the SCC { 0, 2, 0_var_snapshot, 0* }.

### 6.1.1 Transition Removal

We remove transition 1 using the following ranking functions, which are bounded by −3.

 0: −1 + 4⋅___const_100_0 − 4⋅i_5_0 2: 1 + 4⋅___const_100_0 − 4⋅i_5_0 0_var_snapshot: −2 + 4⋅___const_100_0 − 4⋅i_5_0 0*: 4⋅___const_100_0 − 4⋅i_5_0

### 6.1.2 Transition Removal

We remove transitions 8, 2 using the following ranking functions, which are bounded by −1.

 0: 0 2: 2⋅x_6_0 0_var_snapshot: −1 0*: x_6_0

### 6.1.3 Transition Removal

We remove transition 10 using the following ranking functions, which are bounded by 0.

 0: 0 2: 0 0_var_snapshot: 0 0*: 1

### 6.1.4 Splitting Cut-Point Transitions

We consider 1 subproblems corresponding to sets of cut-point transitions as follows.

### 6.1.4.1 Cut-Point Subproblem 1/1

Here we consider cut-point transition 7.

### 6.1.4.1.1 Splitting Cut-Point Transitions

There remain no cut-point transition to consider. Hence the cooperation termination is trivial.

T2Cert

• version: 1.0