(0) Obligation:
Need to prove time_complexity of the following program:
public class Sharing {
private Sharing next;
public Sharing(Sharing next) {
this.next = next;
}
public void iter(Sharing other) {
Sharing cursor = this;
while (cursor != null) {
other.next = new Sharing(null);
other = other.next;
cursor = cursor.next;
}
}
public static void main(String[] args) {
Sharing sh1 = new Sharing(new Sharing(new Sharing(null)));
Sharing sh2 = new Sharing(new Sharing(null));
sh2.next.next = sh2;
sh1.iter(sh2);
}
}
(1) JBCToGraph (BOTH CONCRETE BOUNDS(ID, ID) transformation)
Constructed TerminationGraph.
(2) Obligation:
Termination Graph based on JBC Program:
Sharing.main([Ljava/lang/String;)V: Graph of 149 nodes with 0 SCCs.
(3) TerminationGraphToComplexityProof (EQUIVALENT transformation)
Proven constant complexity by absence of SCCs and edges with non-constant weight
(4) BOUNDS(CONSTANT, 140)