5.12/2.14 NO 5.12/2.15 proof of /export/starexec/sandbox/benchmark/theBenchmark.jar 5.12/2.15 # AProVE Commit ID: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty 5.12/2.15 5.12/2.15 5.12/2.15 termination of the given Bare JBC problem could be disproven: 5.12/2.15 5.12/2.15 (0) Bare JBC problem 5.12/2.15 (1) BareJBCToJBCProof [EQUIVALENT, 96 ms] 5.12/2.15 (2) JBC problem 5.12/2.15 (3) JBCToGraph [EQUIVALENT, 221 ms] 5.12/2.15 (4) JBCTerminationGraph 5.12/2.15 (5) JBCNonTerm [COMPLETE, 109 ms] 5.12/2.15 (6) NO 5.12/2.15 5.12/2.15 5.12/2.15 ---------------------------------------- 5.12/2.15 5.12/2.15 (0) 5.12/2.15 Obligation: 5.12/2.15 need to prove termination of the following program: 5.12/2.15 package simple.alternDiv; 5.12/2.15 5.12/2.15 public class AlternDiv { 5.12/2.15 5.12/2.15 public static void loop(int i) { 5.12/2.15 while (i != 0) { 5.12/2.15 if (i < 0) { 5.12/2.15 i--; 5.12/2.15 i = i*(-1); 5.12/2.15 } else { 5.12/2.15 i++; 5.12/2.15 i = i*(-1); 5.12/2.15 } 5.12/2.15 } 5.12/2.15 } 5.12/2.15 } 5.12/2.15 5.12/2.15 5.12/2.15 package simple.alternDiv; 5.12/2.15 5.12/2.15 public class Main { 5.12/2.15 5.12/2.15 /** 5.12/2.15 * @param args 5.12/2.15 */ 5.12/2.15 public static void main(String[] args) { 5.12/2.15 AlternDiv.loop(args.length); 5.12/2.15 5.12/2.15 } 5.12/2.15 5.12/2.15 } 5.12/2.15 5.12/2.15 5.12/2.15 5.12/2.15 ---------------------------------------- 5.12/2.15 5.12/2.15 (1) BareJBCToJBCProof (EQUIVALENT) 5.12/2.15 initialized classpath 5.12/2.15 ---------------------------------------- 5.12/2.15 5.12/2.15 (2) 5.12/2.15 Obligation: 5.12/2.15 need to prove termination of the following program: 5.12/2.15 package simple.alternDiv; 5.12/2.15 5.12/2.15 public class AlternDiv { 5.12/2.15 5.12/2.15 public static void loop(int i) { 5.12/2.15 while (i != 0) { 5.12/2.15 if (i < 0) { 5.12/2.15 i--; 5.12/2.15 i = i*(-1); 5.12/2.15 } else { 5.12/2.15 i++; 5.12/2.15 i = i*(-1); 5.12/2.15 } 5.12/2.15 } 5.12/2.15 } 5.12/2.15 } 5.12/2.15 5.12/2.15 5.12/2.15 package simple.alternDiv; 5.12/2.15 5.12/2.15 public class Main { 5.12/2.15 5.12/2.15 /** 5.12/2.15 * @param args 5.12/2.15 */ 5.12/2.15 public static void main(String[] args) { 5.12/2.15 AlternDiv.loop(args.length); 5.12/2.15 5.12/2.15 } 5.12/2.15 5.12/2.15 } 5.12/2.15 5.12/2.15 5.12/2.15 5.12/2.15 ---------------------------------------- 5.12/2.15 5.12/2.15 (3) JBCToGraph (EQUIVALENT) 5.12/2.15 Constructed TerminationGraph. 5.12/2.15 ---------------------------------------- 5.12/2.15 5.12/2.15 (4) 5.12/2.15 Obligation: 5.12/2.15 Termination Graph based on JBC Program: 5.12/2.15 simple.alternDiv.Main.main([Ljava/lang/String;)V: Graph of 31 nodes with 1 SCC. 5.12/2.15 5.12/2.15 5.12/2.15 5.12/2.15 5.12/2.15 5.12/2.15 ---------------------------------------- 5.12/2.15 5.12/2.15 (5) JBCNonTerm (COMPLETE) 5.12/2.15 Reached a loop using the following run: 5.12/2.15 5.12/2.15 0: 5.12/2.15 a16([java.lang.String...]): length 1 -->{java.lang.Object...} 5.12/2.15 YES: (JL1) 5.12/2.15 1: 5.12/2.15 a16([java.lang.String...]): length 1 -->{java.lang.Object...} 5.12/2.15 YES: (JL1) 5.12/2.15 2: 5.12/2.15 YES: (JL1) 5.12/2.15 3: 5.12/2.15 5.12/2.15 YES: (JL1) 5.12/2.15 Start state of loop: 5.12/2.15 5.12/2.15 5.12/2.15 [a6(lv_0_0)] 5.12/2.15 5.12/2.15 i152: # 5.12/2.15 i18: [0,+inf)(l1) 5.12/2.15 a6([java.lang.String...]): length i18 -->{java.lang.Object...} 5.12/2.15 YES: (JL1) 5.12/2.15 5.12/2.15 5.12/2.15 In the loop head node, references [i152] were interesting. 5.12/2.15 5.12/2.15 All methods calls in the loop body are side-effect free, hence they can be ignored. 5.12/2.15 5.12/2.15 By SMT, we could prove 5.12/2.15 5.12/2.15 (0 <= initial_i18 and ((((path1_i152 = path1_i170 and path1_i170 = path1_i173 and path1_i176 = (path1_i173 + -1) and path1_i180 = (path1_i176 * -1) and path1_i180 = res_i152 and path1_i152 = initial_i152) and (path1_i170 != 0 and path1_i173 < 0)) or ((path2_i152 = path2_i170 and path2_i170 = path2_i174 and path2_i177 = (path2_i174 + 1) and path2_i181 = (path2_i177 * -1) and path2_i181 = res_i152 and path2_i152 = initial_i152) and (path2_i170 != 0 and path2_i174 >= 0)) or ((path1_i152 = path1_i170 and path1_i170 = path1_i173 and path1_i176 = (path1_i173 + -1) and path1_i180 = (path1_i176 * -1) and path1_i180 = res_i152 and path1_i152 = initial_i152) and (path1_i173 < 0 and path1_i170 < 0)) or ((path1_i152 = path1_i170 and path1_i170 = path1_i173 and path1_i176 = (path1_i173 + -1) and path1_i180 = (path1_i176 * -1) and path1_i180 = res_i152 and path1_i152 = initial_i152) and (path1_i173 < 0 and path1_i170 > 0)) or ((path2_i152 = path2_i170 and path2_i170 = path2_i174 and path2_i177 = (path2_i174 + 1) and path2_i181 = (path2_i177 * -1) and path2_i181 = res_i152 and path2_i152 = initial_i152) and (path2_i174 >= 0 and path2_i170 < 0)) or ((path2_i152 = path2_i170 and path2_i170 = path2_i174 and path2_i177 = (path2_i174 + 1) and path2_i181 = (path2_i177 * -1) and path2_i181 = res_i152 and path2_i152 = initial_i152) and (path2_i174 >= 0 and path2_i170 > 0))) and (((res1_i152 = res1_i170 and res1_i170 = res1_i173 and res1_i176 = (res1_i173 + -1) and res1_i180 = (res1_i176 * -1) and res_i152 = res1_i152) and !(res1_i170 != 0 and res1_i173 < 0)) and ((res2_i152 = res2_i170 and res2_i170 = res2_i174 and res2_i177 = (res2_i174 + 1) and res2_i181 = (res2_i177 * -1) and res_i152 = res2_i152) and !(res2_i170 != 0 and res2_i174 >= 0)) and ((res1_i152 = res1_i170 and res1_i170 = res1_i173 and res1_i176 = (res1_i173 + -1) and res1_i180 = (res1_i176 * -1) and res_i152 = res1_i152) and !(res1_i173 < 0 and res1_i170 < 0)) and ((res1_i152 = res1_i170 and res1_i170 = res1_i173 and res1_i176 = (res1_i173 + -1) and res1_i180 = (res1_i176 * -1) and res_i152 = res1_i152) and !(res1_i173 < 0 and res1_i170 > 0)) and ((res2_i152 = res2_i170 and res2_i170 = res2_i174 and res2_i177 = (res2_i174 + 1) and res2_i181 = (res2_i177 * -1) and res_i152 = res2_i152) and !(res2_i174 >= 0 and res2_i170 < 0)) and ((res2_i152 = res2_i170 and res2_i170 = res2_i174 and res2_i177 = (res2_i174 + 1) and res2_i181 = (res2_i177 * -1) and res_i152 = res2_i152) and !(res2_i174 >= 0 and res2_i170 > 0))))) 5.12/2.15 5.12/2.15 to be UNSAT. Consequently, the loop will not terminate. 5.12/2.15 ---------------------------------------- 5.12/2.15 5.12/2.15 (6) 5.12/2.15 NO 5.18/2.24 EOF