(0) Obligation:
JBC Problem based on JBC Program:
Manifest-Version: 1.0
Created-By: 1.6.0_26 (Sun Microsystems Inc.)
Main-Class: simple/alternDiv/Main
package simple.alternDiv;
public class AlternDiv {
public static void loop(int i) {
while (i != 0) {
if (i < 0) {
i--;
i = i*(-1);
} else {
i++;
i = i*(-1);
}
}
}
}
package simple.alternDiv;
public class Main {
/**
* @param args
*/
public static void main(String[] args) {
AlternDiv.loop(args.length);
}
}
(1) JBCNonTerm (EQUIVALENT transformation)
Reached a loop using the following run:
0:
<simple.alternDiv.Main.main||0: load ADDR args||args: a36|| ->
String.serialVersionUID: -6849794470754667710L
String.serialPersistentFields: a34
String.CASE_INSENSITIVE_ORDER: o18
String$CaseInsensitiveComparator.serialVersionUID: 8575799808933029326L
RuntimeException.serialVersionUID: -7034897190745766939L
Exception.serialVersionUID: -3387516993124229948L
Throwable.serialVersionUID: -3042686055658047285L
o18!: String$CaseInsensitiveComparator()
a34([java.io.ObjectStreamField|]): length 0
a36([java.lang.String...]): length 1
1:
<simple.alternDiv.Main.main||1: arraylength|| - ||a36>
String.serialVersionUID: -6849794470754667710L
String.serialPersistentFields: a34
String.CASE_INSENSITIVE_ORDER: o18
String$CaseInsensitiveComparator.serialVersionUID: 8575799808933029326L
RuntimeException.serialVersionUID: -7034897190745766939L
Exception.serialVersionUID: -3387516993124229948L
Throwable.serialVersionUID: -3042686055658047285L
o18!: String$CaseInsensitiveComparator()
a34([java.io.ObjectStreamField|]): length 0
a36([java.lang.String...]): length 1
2:
<simple.alternDiv.Main.main||2: simple.alternDiv.AlternDiv.loop(I)V|| - ||1>
String.serialVersionUID: -6849794470754667710L
String.serialPersistentFields: a34
String.CASE_INSENSITIVE_ORDER: o18
String$CaseInsensitiveComparator.serialVersionUID: 8575799808933029326L
RuntimeException.serialVersionUID: -7034897190745766939L
Exception.serialVersionUID: -3387516993124229948L
Throwable.serialVersionUID: -3042686055658047285L
o18!: String$CaseInsensitiveComparator()
a34([java.io.ObjectStreamField|]): length 0
a36([java.lang.String...]): length 1
3:
<simple.alternDiv.AlternDiv.loop||0: load INT i||i: 1|| ->
<simple.alternDiv.Main.main||2: simple.alternDiv.AlternDiv.loop|| - ||1>
String.serialVersionUID: -6849794470754667710L
String.serialPersistentFields: a34
String.CASE_INSENSITIVE_ORDER: o18
String$CaseInsensitiveComparator.serialVersionUID: 8575799808933029326L
RuntimeException.serialVersionUID: -7034897190745766939L
Exception.serialVersionUID: -3387516993124229948L
Throwable.serialVersionUID: -3042686055658047285L
o18!: String$CaseInsensitiveComparator()
a34([java.io.ObjectStreamField|]): length 0
a36([java.lang.String...]): length 1
In the loop head node, references [i12] were interesting.
By SMT, we could prove
(0 <= initial_i11 and ((((path1_i12 = path1_i23 and path1_i23 = path1_i29 and path1_i32 = (path1_i29 + -1) and path1_i36 = (path1_i32 * -1) and path1_i36 = res_i12 and path1_i11 = res_i11 and path1_i12 = initial_i12 and path1_i11 = initial_i11) and (path1_i23 != 0 and path1_i29 < 0)) or ((path2_i12 = path2_i23 and path2_i23 = path2_i30 and path2_i33 = (path2_i30 + 1) and path2_i37 = (path2_i33 * -1) and path2_i37 = res_i12 and path2_i11 = res_i11 and path2_i12 = initial_i12 and path2_i11 = initial_i11) and (path2_i23 != 0 and path2_i30 >= 0)) or ((path1_i12 = path1_i23 and path1_i23 = path1_i29 and path1_i32 = (path1_i29 + -1) and path1_i36 = (path1_i32 * -1) and path1_i36 = res_i12 and path1_i11 = res_i11 and path1_i12 = initial_i12 and path1_i11 = initial_i11) and (path1_i29 < 0 and path1_i23 < 0)) or ((path1_i12 = path1_i23 and path1_i23 = path1_i29 and path1_i32 = (path1_i29 + -1) and path1_i36 = (path1_i32 * -1) and path1_i36 = res_i12 and path1_i11 = res_i11 and path1_i12 = initial_i12 and path1_i11 = initial_i11) and (path1_i29 < 0 and path1_i23 > 0)) or ((path2_i12 = path2_i23 and path2_i23 = path2_i30 and path2_i33 = (path2_i30 + 1) and path2_i37 = (path2_i33 * -1) and path2_i37 = res_i12 and path2_i11 = res_i11 and path2_i12 = initial_i12 and path2_i11 = initial_i11) and (path2_i30 >= 0 and path2_i23 < 0)) or ((path2_i12 = path2_i23 and path2_i23 = path2_i30 and path2_i33 = (path2_i30 + 1) and path2_i37 = (path2_i33 * -1) and path2_i37 = res_i12 and path2_i11 = res_i11 and path2_i12 = initial_i12 and path2_i11 = initial_i11) and (path2_i30 >= 0 and path2_i23 > 0))) and (((res_i12 = res_i23 and res_i23 = res_i29 and res_i32 = (res_i29 + -1) and res_i36 = (res_i32 * -1)) and !(res_i23 != 0 and res_i29 < 0)) and ((res_i12 = res_i23 and res_i23 = res_i30 and res_i33 = (res_i30 + 1) and res_i37 = (res_i33 * -1)) and !(res_i23 != 0 and res_i30 >= 0)) and ((res_i12 = res_i23 and res_i23 = res_i29 and res_i32 = (res_i29 + -1) and res_i36 = (res_i32 * -1)) and !(res_i23 != 0 and res_i29 < 0)) and ((res_i12 = res_i23 and res_i23 = res_i29 and res_i32 = (res_i29 + -1) and res_i36 = (res_i32 * -1)) and !(res_i23 != 0 and res_i29 < 0)) and ((res_i12 = res_i23 and res_i23 = res_i30 and res_i33 = (res_i30 + 1) and res_i37 = (res_i33 * -1)) and !(res_i23 != 0 and res_i30 >= 0)) and ((res_i12 = res_i23 and res_i23 = res_i30 and res_i33 = (res_i30 + 1) and res_i37 = (res_i33 * -1)) and !(res_i23 != 0 and res_i30 >= 0)))))
to be UNSAT. Consequently, the loop will not terminate.