(0) Obligation:

Need to prove time_complexity of the following program:
public class CyclicPair {
	CyclicPair next;

	public static void main(int i) {
		CyclicPair one = new CyclicPair();
		CyclicPair two = new CyclicPair();
		if (i == 0) { //two cyclic
			two.next = two;
		} else {      //one cyclic
			one.next = one;
		}

		while (two.next == two && one.next == one) {
			one.next = two;      //one: o1, two: o2 | o1: (next=o2), o2: (next=o2)
			two.next = one;      //one: o1, two: o2 | o1: (next=o2), o2: (next=o1)
			one.next = two.next; //one: o2, two: o2 | o1: (next=o1), o2: (next=o1)
			two.next = two;
		}
	}
}


(1) JBCToGraph (BOTH CONCRETE BOUNDS(ID, ID) transformation)

Constructed TerminationGraph.

(2) Obligation:

Termination Graph based on JBC Program:
CyclicPair.main(I)V: Graph of 64 nodes with 0 SCCs.


(3) TerminationGraphToComplexityProof (EQUIVALENT transformation)

Proven constant complexity by absence of SCCs and edges with non-constant weight

(4) BOUNDS(CONSTANT, 53)

(5) JBCToGraph (BOTH CONCRETE BOUNDS(ID, ID) transformation)

Constructed TerminationGraph.

(6) Obligation:

Termination Graph based on JBC Program:
CyclicPair.main(I)V: Graph of 64 nodes with 0 SCCs.


(7) TerminationGraphToComplexityProof (BOTH CONCRETE BOUNDS(ID, ADD(23)) transformation)

Extracted set of 40 edges for the analysis of TIME complexity. Kept leaves.

(8) Obligation:

Set of 40 edges based on JBC Program.
Performed SCC analyses:
  • Used field analysis yielded the following read fields:

Considered paths: nonterm paths and paths from start to sinks