(0) Obligation:
Need to prove time_complexity of the following program:
package RetVal;
public class RetVal {
public static void main(int i) {
int x = i % 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(I)V: Graph of 61 nodes with 0 SCCs.
(3) TerminationGraphToComplexityProof (EQUIVALENT transformation)
Proven constant complexity by absence of SCCs and edges with non-constant weight
(4) BOUNDS(CONSTANT, 50)
(5) JBCToGraph (BOTH CONCRETE BOUNDS(ID, ID) transformation)
Constructed TerminationGraph.
(6) Obligation:
Termination Graph based on JBC Program:
RetVal.RetVal.main(I)V: Graph of 57 nodes with 0 SCCs.
(7) TerminationGraphToComplexityProof (BOTH CONCRETE BOUNDS(ID, ADD(24)) transformation)
Extracted set of 32 edges for the analysis of TIME complexity. Kept leaves.
(8) Obligation:
Set of 32 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