(0) Obligation:
JBC Problem based on JBC Program:
Manifest-Version: 1.0
Created-By: 1.6.0_26 (Sun Microsystems Inc.)
Main-Class: simple/whileBreak/Main
package simple.whileBreak;
public class Main {
/**
* @param args
*/
public static void main(String[] args) {
WhileBreak.loop(args.length);
}
}
package simple.whileBreak;
public class WhileBreak {
public static void loop(int i) {
while (i > 10) {
if (i > 20) {
i++;
} else {
i--;
}
if (i == 30) {
break;
}
}
}
}
(1) JBCNonTerm (EQUIVALENT transformation)
Reached a loop using the following run:
0:
<simple.whileBreak.Main.main||0: load ADDR args||args: a62|| ->
String.serialVersionUID: -6849794470754667710L
String.serialPersistentFields: a60
String.CASE_INSENSITIVE_ORDER: o31
String$CaseInsensitiveComparator.serialVersionUID: 8575799808933029326L
RuntimeException.serialVersionUID: -7034897190745766939L
Exception.serialVersionUID: -3387516993124229948L
Throwable.serialVersionUID: -3042686055658047285L
o31!: String$CaseInsensitiveComparator()
a60([java.io.ObjectStreamField|]): length 0
a62([java.lang.String...]): length 30
1:
<simple.whileBreak.Main.main||1: arraylength|| - ||a62>
String.serialVersionUID: -6849794470754667710L
String.serialPersistentFields: a60
String.CASE_INSENSITIVE_ORDER: o31
String$CaseInsensitiveComparator.serialVersionUID: 8575799808933029326L
RuntimeException.serialVersionUID: -7034897190745766939L
Exception.serialVersionUID: -3387516993124229948L
Throwable.serialVersionUID: -3042686055658047285L
o31!: String$CaseInsensitiveComparator()
a60([java.io.ObjectStreamField|]): length 0
a62([java.lang.String...]): length 30
2:
<simple.whileBreak.Main.main||2: simple.whileBreak.WhileBreak.loop(I)V|| - ||30>
String.serialVersionUID: -6849794470754667710L
String.serialPersistentFields: a60
String.CASE_INSENSITIVE_ORDER: o31
String$CaseInsensitiveComparator.serialVersionUID: 8575799808933029326L
RuntimeException.serialVersionUID: -7034897190745766939L
Exception.serialVersionUID: -3387516993124229948L
Throwable.serialVersionUID: -3042686055658047285L
o31!: String$CaseInsensitiveComparator()
a60([java.io.ObjectStreamField|]): length 0
a62([java.lang.String...]): length 30
3:
<simple.whileBreak.WhileBreak.loop||0: load INT i||i: 30|| ->
<simple.whileBreak.Main.main||2: simple.whileBreak.WhileBreak.loop|| - ||30>
String.serialVersionUID: -6849794470754667710L
String.serialPersistentFields: a60
String.CASE_INSENSITIVE_ORDER: o31
String$CaseInsensitiveComparator.serialVersionUID: 8575799808933029326L
RuntimeException.serialVersionUID: -7034897190745766939L
Exception.serialVersionUID: -3387516993124229948L
Throwable.serialVersionUID: -3042686055658047285L
o31!: String$CaseInsensitiveComparator()
a60([java.io.ObjectStreamField|]): length 0
a62([java.lang.String...]): length 30
In the loop head node, references [i21] were interesting.
By SMT, we could prove
((0 <= initial_i21 and 0 <= initial_i20) and ((((path1_i21 = path1_i30 and path1_i30 = path1_i36 and path1_i38 = (path1_i36 + -1) and path1_i38 = res_i21 and path1_i20 = res_i20 and path1_i21 = initial_i21 and path1_i20 = initial_i20) and (path1_i30 > 10 and path1_i36 <= 20 and path1_i38 > 30)) or ((path2_i21 = path2_i30 and path2_i30 = path2_i37 and path2_i39 = (path2_i37 + 1) and path2_i39 = path2_i86 and path2_i86 = res_i21 and path2_i20 = res_i20 and path2_i21 = initial_i21 and path2_i20 = initial_i20) and (path2_i30 > 10 and path2_i37 > 20 and path2_i86 > 30))) and (((res_i21 = res_i30 and res_i30 = res_i36 and res_i38 = (res_i36 + -1)) and !(res_i30 > 10 and res_i36 <= 20 and res_i38 != 30)) and ((res_i21 = res_i30 and res_i30 = res_i37 and res_i39 = (res_i37 + 1) and res_i39 = res_i86) and !(res_i30 > 10 and res_i37 > 20 and res_i86 != 30)))))
to be UNSAT. Consequently, the loop will not terminate.