0 JBC
↳1 JBCToGraph (⇒, 556 ms)
↳2 JBCTerminationGraph
↳3 TerminationGraphToSCCProof (⇒, 0 ms)
↳4 JBCTerminationSCC
↳5 SCCToIntTRSProof (⇒, 45 ms)
↳6 intTRS
↳7 PolynomialOrderProcessor (⇒, 0 ms)
↳8 intTRS
↳9 TerminationGraphProcessor (⇔, 0 ms)
↳10 YES
public class DivWithoutMinus{
// adaption of the algorithm from [Kolbe 95]
public static void main(String[] args) {
Random.args = args;
int x = Random.random();
int y = Random.random();
int z = y;
int res = 0;
while (z > 0 && (y == 0 || y > 0 && x > 0)) {
if (y == 0) {
res++;
y = z;
}
else {
x--;
y--;
}
}
}
}
public class Random {
static String[] args;
static int index = 0;
public static int random() {
String string = args[index];
index++;
return string.length();
}
}
Generated rules. Obtained 27 IRules
P rules:
f919_0_main_LE(EOS, i76, i176, i189, i189) → f923_0_main_LE(EOS, i76, i176, i189, i189)
f923_0_main_LE(EOS, i76, i176, i189, i189) → f927_0_main_Load(EOS, i76, i176, i189) | >(i189, 0)
f927_0_main_Load(EOS, i76, i176, i189) → f932_0_main_EQ(EOS, i76, i176, i189, i176)
f932_0_main_EQ(EOS, i76, i192, i189, i192) → f935_0_main_EQ(EOS, i76, i192, i189, i192)
f932_0_main_EQ(EOS, i76, matching1, i189, matching2) → f936_0_main_EQ(EOS, i76, 0, i189, 0) | &&(=(matching1, 0), =(matching2, 0))
f935_0_main_EQ(EOS, i76, i192, i189, i192) → f938_0_main_Load(EOS, i76, i192, i189) | !(=(i192, 0))
f938_0_main_Load(EOS, i76, i192, i189) → f943_0_main_LE(EOS, i76, i192, i189, i192)
f943_0_main_LE(EOS, i76, i201, i189, i201) → f949_0_main_LE(EOS, i76, i201, i189, i201)
f949_0_main_LE(EOS, i76, i201, i189, i201) → f961_0_main_Load(EOS, i76, i201, i189) | >(i201, 0)
f961_0_main_Load(EOS, i76, i201, i189) → f969_0_main_LE(EOS, i76, i201, i189, i76)
f969_0_main_LE(EOS, i207, i201, i189, i207) → f974_0_main_LE(EOS, i207, i201, i189, i207)
f974_0_main_LE(EOS, i207, i201, i189, i207) → f986_0_main_Load(EOS, i207, i201, i189) | >(i207, 0)
f986_0_main_Load(EOS, i207, i201, i189) → f1011_0_main_NE(EOS, i207, i201, i189, i201)
f1011_0_main_NE(EOS, i207, i201, i189, i201) → f1418_0_main_Inc(EOS, i207, i201, i189) | >(i201, 0)
f1418_0_main_Inc(EOS, i207, i201, i189) → f1420_0_main_Inc(EOS, +(i207, -1), i201, i189) | >(i207, 0)
f1420_0_main_Inc(EOS, i356, i201, i189) → f1421_0_main_JMP(EOS, i356, +(i201, -1), i189) | >(i201, 0)
f1421_0_main_JMP(EOS, i356, i357, i189) → f1427_0_main_Load(EOS, i356, i357, i189)
f1427_0_main_Load(EOS, i356, i357, i189) → f914_0_main_Load(EOS, i356, i357, i189)
f914_0_main_Load(EOS, i76, i176, i177) → f919_0_main_LE(EOS, i76, i176, i177, i177)
f936_0_main_EQ(EOS, i76, matching1, i189, matching2) → f940_0_main_Load(EOS, i76, 0, i189) | &&(=(matching1, 0), =(matching2, 0))
f940_0_main_Load(EOS, i76, matching1, i189) → f945_0_main_NE(EOS, i76, 0, i189, 0) | =(matching1, 0)
f945_0_main_NE(EOS, i76, matching1, i189, matching2) → f951_0_main_Inc(EOS, i76, i189) | &&(=(matching1, 0), =(matching2, 0))
f951_0_main_Inc(EOS, i76, i189) → f964_0_main_Load(EOS, i76, i189)
f964_0_main_Load(EOS, i76, i189) → f971_0_main_Store(EOS, i76, i189, i189)
f971_0_main_Store(EOS, i76, i189, i189) → f976_0_main_JMP(EOS, i76, i189, i189)
f976_0_main_JMP(EOS, i76, i189, i189) → f1006_0_main_Load(EOS, i76, i189, i189)
f1006_0_main_Load(EOS, i76, i189, i189) → f914_0_main_Load(EOS, i76, i189, i189)
Combined rules. Obtained 2 IRules
P rules:
f919_0_main_LE(EOS, x0, x1, x2, x2) → f919_0_main_LE(EOS, -(x0, 1), -(x1, 1), x2, x2) | &&(&&(>(x2, 0), >(x1, 0)), >(x0, 0))
f919_0_main_LE(EOS, x0, 0, x2, x2) → f919_0_main_LE(EOS, x0, x2, x2, x2) | >(x2, 0)
Filtered ground terms:
f919_0_main_LE(x1, x2, x3, x4, x5) → f919_0_main_LE(x2, x3, x4, x5)
Cond_f919_0_main_LE(x1, x2, x3, x4, x5, x6) → Cond_f919_0_main_LE(x1, x3, x4, x5, x6)
Cond_f919_0_main_LE1(x1, x2, x3, x4, x5, x6) → Cond_f919_0_main_LE1(x1, x3, x5, x6)
Filtered duplicate terms:
f919_0_main_LE(x1, x2, x3, x4) → f919_0_main_LE(x1, x2, x4)
Cond_f919_0_main_LE(x1, x2, x3, x4, x5) → Cond_f919_0_main_LE(x1, x2, x3, x5)
Cond_f919_0_main_LE1(x1, x2, x3, x4) → Cond_f919_0_main_LE1(x1, x2, x4)
Prepared 2 rules for path length conversion:
P rules:
f919_0_main_LE(x0, x1, x2) → f919_0_main_LE(-(x0, 1), -(x1, 1), x2) | &&(&&(>(x2, 0), >(x1, 0)), >(x0, 0))
f919_0_main_LE(x0, 0, x2) → f919_0_main_LE(x0, x2, x2) | >(x2, 0)
Finished conversion. Obtained 2 rules.
P rules:
f919_0_main_LE(x0, x1, x2) → f919_0_main_LE(-(x0, 1), -(x1, 1), x2) | &&(&&(>(x2, 0), >(x0, 0)), >(x1, 0))
f919_0_main_LE(x3, c0, x4) → f919_0_main_LE(x3, x4, x4) | &&(>(x4, 0), =(0, c0))
Found the following polynomial interpretation:
Therefore the following rule(s) have been dropped:
Constructed the termination graph and obtained no non-trivial SCC(s).