(0) Obligation:

Need to prove time_complexity of the following program:
package RetVal;

public class Random {
  static String[] args;
  static int index = 0;

  public static int random() {
    final String string = args[index];
    index++;
    return string.length();
  }
}


package RetVal;

public class RetVal {
	public static void main(String[] args) {
		Random.args = args;
		int x = Random.random() % 2;
		int y = ret(x);
		test(x,y);
	}

	public static int ret(int x) {
		if (x == 0) return 1;
		else return 0;
	}

	public static boolean test(int x, int y) {
		while (x == y) {
			x--;
			y--;
		}
		return true;
	}
}


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

Constructed TerminationGraph.

(2) Obligation:

Termination Graph based on JBC Program:
RetVal.RetVal.main([Ljava/lang/String;)V: Graph of 130 nodes with 0 SCCs.


(3) TerminationGraphToComplexityProof (EQUIVALENT transformation)

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

(4) BOUNDS(CONSTANT, 111)

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

Constructed TerminationGraph.

(6) Obligation:

Termination Graph based on JBC Program:
RetVal.RetVal.main([Ljava/lang/String;)V: Graph of 126 nodes with 0 SCCs.