5.84/2.72 NO 5.84/2.72 proof of /export/starexec/sandbox/benchmark/theBenchmark.jar 5.84/2.72 # AProVE Commit ID: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty 5.84/2.72 5.84/2.72 5.84/2.72 termination of the given Bare JBC problem could be disproven: 5.84/2.72 5.84/2.72 (0) Bare JBC problem 5.84/2.72 (1) BareJBCToJBCProof [EQUIVALENT, 122 ms] 5.84/2.72 (2) JBC problem 5.84/2.72 (3) JBCNonTerm [COMPLETE, 443 ms] 5.84/2.72 (4) NO 5.84/2.72 5.84/2.72 5.84/2.72 ---------------------------------------- 5.84/2.72 5.84/2.72 (0) 5.84/2.72 Obligation: 5.84/2.72 need to prove termination of the following program: 5.84/2.72 /** 5.84/2.72 * This class represents a list, where the function duplicate() can be used to 5.84/2.72 * duplicate all elements in the list. 5.84/2.72 * @author cotto 5.84/2.72 */ 5.84/2.72 public class CyclicalListDuplicate { 5.84/2.72 /** 5.84/2.72 * A reference to the next list element. 5.84/2.72 */ 5.84/2.72 private CyclicalListDuplicate next; 5.84/2.72 5.84/2.72 public static void main(String[] args) { 5.84/2.72 CyclicalListDuplicate list = CyclicalListDuplicate.generate(args.length); 5.84/2.72 if (list != null) { 5.84/2.72 list.duplicate(); 5.84/2.72 } 5.84/2.72 } 5.84/2.72 5.84/2.72 /** 5.84/2.72 * Create a new list element. 5.84/2.72 * @param n a reference to the next element. 5.84/2.72 */ 5.84/2.72 public CyclicalListDuplicate(final CyclicalListDuplicate n) { 5.84/2.72 this.next = n; 5.84/2.72 } 5.84/2.72 5.84/2.72 public static CyclicalListDuplicate generate(int length) { 5.84/2.72 CyclicalListDuplicate last, current; 5.84/2.72 last = current = new CyclicalListDuplicate(null); 5.84/2.72 for (int i = 0; i < length - 1; i++) { 5.84/2.72 current = new CyclicalListDuplicate(current); 5.84/2.72 } 5.84/2.72 last.next = current; 5.84/2.72 return current; 5.84/2.72 } 5.84/2.72 5.84/2.72 /** 5.84/2.72 * Walk through the list and, for each original element, copy it and append 5.84/2.72 * this copy after the original. This transforms abc to aabbcc. 5.84/2.72 */ 5.84/2.72 public void duplicate() { 5.84/2.72 CyclicalListDuplicate current = this; 5.84/2.72 boolean even = true; 5.84/2.72 while (current != null) { 5.84/2.72 // only copy the original elements! 5.84/2.72 if (even) { 5.84/2.72 final CyclicalListDuplicate copy = new CyclicalListDuplicate(current.next); 5.84/2.72 current.next = copy; 5.84/2.72 } 5.84/2.72 current = current.next; 5.84/2.72 even = !even; 5.84/2.72 } 5.84/2.72 } 5.84/2.72 } 5.84/2.72 5.84/2.72 5.84/2.72 5.84/2.72 ---------------------------------------- 5.84/2.72 5.84/2.72 (1) BareJBCToJBCProof (EQUIVALENT) 5.84/2.72 initialized classpath 5.84/2.72 ---------------------------------------- 5.84/2.72 5.84/2.72 (2) 5.84/2.72 Obligation: 5.84/2.72 need to prove termination of the following program: 5.84/2.72 /** 5.84/2.72 * This class represents a list, where the function duplicate() can be used to 5.84/2.72 * duplicate all elements in the list. 5.84/2.72 * @author cotto 5.84/2.72 */ 5.84/2.72 public class CyclicalListDuplicate { 5.84/2.72 /** 5.84/2.72 * A reference to the next list element. 5.84/2.72 */ 5.84/2.72 private CyclicalListDuplicate next; 5.84/2.72 5.84/2.72 public static void main(String[] args) { 5.84/2.72 CyclicalListDuplicate list = CyclicalListDuplicate.generate(args.length); 5.84/2.72 if (list != null) { 5.84/2.72 list.duplicate(); 5.84/2.72 } 5.84/2.72 } 5.84/2.72 5.84/2.72 /** 5.84/2.72 * Create a new list element. 5.84/2.72 * @param n a reference to the next element. 5.84/2.72 */ 5.84/2.72 public CyclicalListDuplicate(final CyclicalListDuplicate n) { 5.84/2.72 this.next = n; 5.84/2.72 } 5.84/2.72 5.84/2.72 public static CyclicalListDuplicate generate(int length) { 5.84/2.72 CyclicalListDuplicate last, current; 5.84/2.72 last = current = new CyclicalListDuplicate(null); 5.84/2.72 for (int i = 0; i < length - 1; i++) { 5.84/2.72 current = new CyclicalListDuplicate(current); 5.84/2.72 } 5.84/2.72 last.next = current; 5.84/2.72 return current; 5.84/2.72 } 5.84/2.72 5.84/2.72 /** 5.84/2.72 * Walk through the list and, for each original element, copy it and append 5.84/2.72 * this copy after the original. This transforms abc to aabbcc. 5.84/2.72 */ 5.84/2.72 public void duplicate() { 5.84/2.72 CyclicalListDuplicate current = this; 5.84/2.72 boolean even = true; 5.84/2.72 while (current != null) { 5.84/2.72 // only copy the original elements! 5.84/2.72 if (even) { 5.84/2.72 final CyclicalListDuplicate copy = new CyclicalListDuplicate(current.next); 5.84/2.72 current.next = copy; 5.84/2.72 } 5.84/2.72 current = current.next; 5.84/2.72 even = !even; 5.84/2.72 } 5.84/2.72 } 5.84/2.72 } 5.84/2.72 5.84/2.72 5.84/2.72 5.84/2.72 ---------------------------------------- 5.84/2.72 5.84/2.72 (3) JBCNonTerm (COMPLETE) 5.84/2.72 Symbolic evaluation of method public static main([Ljava/lang/String;)V never reaches a method end (by explicit return or exception). 5.84/2.72 5.84/2.72 As this is the main method, we can conclude non-termination of the input program. 5.84/2.72 ---------------------------------------- 5.84/2.72 5.84/2.72 (4) 5.84/2.72 NO 5.99/2.76 EOF