/export/starexec/sandbox2/solver/bin/starexec_run_standard /export/starexec/sandbox2/benchmark/theBenchmark.jar /export/starexec/sandbox2/output/output_files -------------------------------------------------------------------------------- YES proof of /export/starexec/sandbox2/benchmark/theBenchmark.jar # AProVE Commit ID: 794c25de1cacf0d048858bcd21c9a779e1221865 marcel 20200619 unpublished dirty termination of the given Bare JBC problem could be proven: (0) Bare JBC problem (1) BareJBCToJBCProof [EQUIVALENT, 96 ms] (2) JBC problem (3) JBCToGraph [EQUIVALENT, 294 ms] (4) JBCTerminationGraph (5) TerminationGraphToSCCProof [SOUND, 0 ms] (6) JBCTerminationSCC (7) SCCToIRSProof [SOUND, 120 ms] (8) IRSwT (9) IRSFormatTransformerProof [EQUIVALENT, 0 ms] (10) IRSwT (11) IRSwTTerminationDigraphProof [EQUIVALENT, 35 ms] (12) IRSwT (13) IntTRSCompressionProof [EQUIVALENT, 0 ms] (14) IRSwT (15) TempFilterProof [SOUND, 56 ms] (16) IntTRS (17) PolynomialOrderProcessor [EQUIVALENT, 18 ms] (18) IntTRS (19) PolynomialOrderProcessor [EQUIVALENT, 0 ms] (20) YES ---------------------------------------- (0) Obligation: need to prove termination of the following program: public class GCD3 { public static int mod(int a, int b) { if(b == 0) { return b; } if(b < 0) { a = -a; } if(a > 0) { while(a>=b) { a -= b; } return a; } else { while(a < 0) { a -= b; } return a; } } public static int gcd(int a, int b) { int tmp; while(b > 0 && a > 0) { tmp = b; b = mod(a, b); a = tmp; } return a; } public static void main(String[] args) { Random.args = args; int x = Random.random(); int y = Random.random(); gcd(x, y); } } public class Random { static String[] args; static int index = 0; public static int random() { String string = args[index]; index++; return string.length(); } } ---------------------------------------- (1) BareJBCToJBCProof (EQUIVALENT) initialized classpath ---------------------------------------- (2) Obligation: need to prove termination of the following program: public class GCD3 { public static int mod(int a, int b) { if(b == 0) { return b; } if(b < 0) { a = -a; } if(a > 0) { while(a>=b) { a -= b; } return a; } else { while(a < 0) { a -= b; } return a; } } public static int gcd(int a, int b) { int tmp; while(b > 0 && a > 0) { tmp = b; b = mod(a, b); a = tmp; } return a; } public static void main(String[] args) { Random.args = args; int x = Random.random(); int y = Random.random(); gcd(x, y); } } public class Random { static String[] args; static int index = 0; public static int random() { String string = args[index]; index++; return string.length(); } } ---------------------------------------- (3) JBCToGraph (EQUIVALENT) Constructed TerminationGraph. ---------------------------------------- (4) Obligation: Termination Graph based on JBC Program: GCD3.main([Ljava/lang/String;)V: Graph of 215 nodes with 1 SCC. ---------------------------------------- (5) TerminationGraphToSCCProof (SOUND) Splitted TerminationGraph to 1 SCCs. ---------------------------------------- (6) Obligation: SCC of termination graph based on JBC Program. SCC contains nodes from the following methods: GCD3.main([Ljava/lang/String;)V SCC calls the following helper methods: Performed SCC analyses: *Used field analysis yielded the following read fields: *Marker field analysis yielded the following relations that could be markers: ---------------------------------------- (7) SCCToIRSProof (SOUND) Transformed FIGraph SCCs to intTRSs. Log: Generated rules. Obtained 37 IRulesP rules: f535_0_gcd_LE(EOS(STATIC_535), i62, i68, i68) -> f537_0_gcd_LE(EOS(STATIC_537), i62, i68, i68) :|: TRUE f537_0_gcd_LE(EOS(STATIC_537), i62, i68, i68) -> f539_0_gcd_Load(EOS(STATIC_539), i62, i68) :|: i68 > 0 f539_0_gcd_Load(EOS(STATIC_539), i62, i68) -> f543_0_gcd_LE(EOS(STATIC_543), i62, i68, i62) :|: TRUE f543_0_gcd_LE(EOS(STATIC_543), i70, i68, i70) -> f550_0_gcd_LE(EOS(STATIC_550), i70, i68, i70) :|: TRUE f550_0_gcd_LE(EOS(STATIC_550), i70, i68, i70) -> f558_0_gcd_Load(EOS(STATIC_558), i70, i68) :|: i70 > 0 f558_0_gcd_Load(EOS(STATIC_558), i70, i68) -> f561_0_gcd_Store(EOS(STATIC_561), i70, i68, i68) :|: TRUE f561_0_gcd_Store(EOS(STATIC_561), i70, i68, i68) -> f566_0_gcd_Load(EOS(STATIC_566), i70, i68, i68) :|: TRUE f566_0_gcd_Load(EOS(STATIC_566), i70, i68, i68) -> f575_0_gcd_Load(EOS(STATIC_575), i68, i68, i70) :|: TRUE f575_0_gcd_Load(EOS(STATIC_575), i68, i68, i70) -> f577_0_gcd_InvokeMethod(EOS(STATIC_577), i68, i70, i68) :|: TRUE f577_0_gcd_InvokeMethod(EOS(STATIC_577), i68, i70, i68) -> f580_0_mod_Load(EOS(STATIC_580), i68, i70, i68) :|: TRUE f580_0_mod_Load(EOS(STATIC_580), i68, i70, i68) -> f583_0_mod_NE(EOS(STATIC_583), i68, i70, i68, i68) :|: TRUE f583_0_mod_NE(EOS(STATIC_583), i68, i70, i68, i68) -> f585_0_mod_Load(EOS(STATIC_585), i68, i70, i68) :|: i68 > 0 f585_0_mod_Load(EOS(STATIC_585), i68, i70, i68) -> f587_0_mod_GE(EOS(STATIC_587), i68, i70, i68, i68) :|: TRUE f587_0_mod_GE(EOS(STATIC_587), i68, i70, i68, i68) -> f588_0_mod_Load(EOS(STATIC_588), i68, i70, i68) :|: i68 >= 0 f588_0_mod_Load(EOS(STATIC_588), i68, i70, i68) -> f589_0_mod_LE(EOS(STATIC_589), i68, i70, i68, i70) :|: TRUE f589_0_mod_LE(EOS(STATIC_589), i68, i70, i68, i70) -> f590_0_mod_Load(EOS(STATIC_590), i68, i70, i68) :|: i70 > 0 f590_0_mod_Load(EOS(STATIC_590), i68, i70, i68) -> f620_0_mod_Load(EOS(STATIC_620), i68, i70, i68) :|: TRUE f620_0_mod_Load(EOS(STATIC_620), i68, i75, i68) -> f623_0_mod_Load(EOS(STATIC_623), i68, i75, i68, i75) :|: TRUE f623_0_mod_Load(EOS(STATIC_623), i68, i75, i68, i75) -> f624_0_mod_LT(EOS(STATIC_624), i68, i75, i68, i75, i68) :|: TRUE f624_0_mod_LT(EOS(STATIC_624), i68, i75, i68, i75, i68) -> f629_0_mod_LT(EOS(STATIC_629), i68, i75, i68, i75, i68) :|: i75 < i68 f624_0_mod_LT(EOS(STATIC_624), i68, i75, i68, i75, i68) -> f630_0_mod_LT(EOS(STATIC_630), i68, i75, i68, i75, i68) :|: i75 >= i68 f629_0_mod_LT(EOS(STATIC_629), i68, i75, i68, i75, i68) -> f632_0_mod_Load(EOS(STATIC_632), i68, i75) :|: i75 < i68 f632_0_mod_Load(EOS(STATIC_632), i68, i75) -> f644_0_mod_Return(EOS(STATIC_644), i68, i75) :|: TRUE f644_0_mod_Return(EOS(STATIC_644), i68, i75) -> f646_0_gcd_Store(EOS(STATIC_646), i68, i75) :|: TRUE f646_0_gcd_Store(EOS(STATIC_646), i68, i75) -> f650_0_gcd_Load(EOS(STATIC_650), i75, i68) :|: TRUE f650_0_gcd_Load(EOS(STATIC_650), i75, i68) -> f659_0_gcd_Store(EOS(STATIC_659), i75, i68) :|: TRUE f659_0_gcd_Store(EOS(STATIC_659), i75, i68) -> f661_0_gcd_JMP(EOS(STATIC_661), i68, i75) :|: TRUE f661_0_gcd_JMP(EOS(STATIC_661), i68, i75) -> f684_0_gcd_Load(EOS(STATIC_684), i68, i75) :|: TRUE f684_0_gcd_Load(EOS(STATIC_684), i68, i75) -> f527_0_gcd_Load(EOS(STATIC_527), i68, i75) :|: TRUE f527_0_gcd_Load(EOS(STATIC_527), i62, i63) -> f535_0_gcd_LE(EOS(STATIC_535), i62, i63, i63) :|: TRUE f630_0_mod_LT(EOS(STATIC_630), i68, i75, i68, i75, i68) -> f643_0_mod_Load(EOS(STATIC_643), i68, i75, i68) :|: i75 >= i68 f643_0_mod_Load(EOS(STATIC_643), i68, i75, i68) -> f645_0_mod_Load(EOS(STATIC_645), i68, i68, i75) :|: TRUE f645_0_mod_Load(EOS(STATIC_645), i68, i68, i75) -> f648_0_mod_IntArithmetic(EOS(STATIC_648), i68, i68, i75, i68) :|: TRUE f648_0_mod_IntArithmetic(EOS(STATIC_648), i68, i68, i75, i68) -> f658_0_mod_Store(EOS(STATIC_658), i68, i68, i75 - i68) :|: i75 > 0 && i68 > 0 f658_0_mod_Store(EOS(STATIC_658), i68, i68, i78) -> f660_0_mod_JMP(EOS(STATIC_660), i68, i78, i68) :|: TRUE f660_0_mod_JMP(EOS(STATIC_660), i68, i78, i68) -> f667_0_mod_Load(EOS(STATIC_667), i68, i78, i68) :|: TRUE f667_0_mod_Load(EOS(STATIC_667), i68, i78, i68) -> f620_0_mod_Load(EOS(STATIC_620), i68, i78, i68) :|: TRUE Combined rules. Obtained 2 IRulesP rules: f624_0_mod_LT(EOS(STATIC_624), i68:0, i75:0, i68:0, i75:0, i68:0) -> f624_0_mod_LT(EOS(STATIC_624), i75:0, i68:0, i75:0, i68:0, i75:0) :|: i75:0 > 0 && i68:0 > 0 && i75:0 < i68:0 f624_0_mod_LT(EOS(STATIC_624), i68:0, i75:0, i68:0, i75:0, i68:0) -> f624_0_mod_LT(EOS(STATIC_624), i68:0, i75:0 - i68:0, i68:0, i75:0 - i68:0, i68:0) :|: i75:0 >= i68:0 && i75:0 > 0 && i68:0 > 0 Filtered constant ground arguments: f624_0_mod_LT(x1, x2, x3, x4, x5, x6) -> f624_0_mod_LT(x2, x3, x4, x5, x6) EOS(x1) -> EOS Filtered duplicate arguments: f624_0_mod_LT(x1, x2, x3, x4, x5) -> f624_0_mod_LT(x4, x5) Finished conversion. Obtained 2 rules.P rules: f624_0_mod_LT(i75:0, i68:0) -> f624_0_mod_LT(i68:0, i75:0) :|: i68:0 > 0 && i75:0 < i68:0 && i75:0 > 0 f624_0_mod_LT(i75:0, i68:0) -> f624_0_mod_LT(i75:0 - i68:0, i68:0) :|: i75:0 > 0 && i68:0 > 0 && i75:0 >= i68:0 ---------------------------------------- (8) Obligation: Rules: f624_0_mod_LT(i75:0, i68:0) -> f624_0_mod_LT(i68:0, i75:0) :|: i68:0 > 0 && i75:0 < i68:0 && i75:0 > 0 f624_0_mod_LT(x, x1) -> f624_0_mod_LT(x - x1, x1) :|: x > 0 && x1 > 0 && x >= x1 ---------------------------------------- (9) IRSFormatTransformerProof (EQUIVALENT) Reformatted IRS to match normalized format (transformed away non-linear left-hand sides, !=, / and %). ---------------------------------------- (10) Obligation: Rules: f624_0_mod_LT(i75:0, i68:0) -> f624_0_mod_LT(i68:0, i75:0) :|: i68:0 > 0 && i75:0 < i68:0 && i75:0 > 0 f624_0_mod_LT(x, x1) -> f624_0_mod_LT(arith, x1) :|: x > 0 && x1 > 0 && x >= x1 && arith = x - x1 ---------------------------------------- (11) IRSwTTerminationDigraphProof (EQUIVALENT) Constructed termination digraph! Nodes: (1) f624_0_mod_LT(i75:0, i68:0) -> f624_0_mod_LT(i68:0, i75:0) :|: i68:0 > 0 && i75:0 < i68:0 && i75:0 > 0 (2) f624_0_mod_LT(x, x1) -> f624_0_mod_LT(arith, x1) :|: x > 0 && x1 > 0 && x >= x1 && arith = x - x1 Arcs: (1) -> (2) (2) -> (1), (2) This digraph is fully evaluated! ---------------------------------------- (12) Obligation: Termination digraph: Nodes: (1) f624_0_mod_LT(i75:0, i68:0) -> f624_0_mod_LT(i68:0, i75:0) :|: i68:0 > 0 && i75:0 < i68:0 && i75:0 > 0 (2) f624_0_mod_LT(x, x1) -> f624_0_mod_LT(arith, x1) :|: x > 0 && x1 > 0 && x >= x1 && arith = x - x1 Arcs: (1) -> (2) (2) -> (1), (2) This digraph is fully evaluated! ---------------------------------------- (13) IntTRSCompressionProof (EQUIVALENT) Compressed rules. ---------------------------------------- (14) Obligation: Rules: f624_0_mod_LT(i75:0:0, i68:0:0) -> f624_0_mod_LT(i68:0:0, i75:0:0) :|: i68:0:0 > 0 && i75:0:0 < i68:0:0 && i75:0:0 > 0 f624_0_mod_LT(x:0, x1:0) -> f624_0_mod_LT(x:0 - x1:0, x1:0) :|: x:0 > 0 && x1:0 > 0 && x:0 >= x1:0 ---------------------------------------- (15) TempFilterProof (SOUND) Used the following sort dictionary for filtering: f624_0_mod_LT(INTEGER, INTEGER) Replaced non-predefined constructor symbols by 0. ---------------------------------------- (16) Obligation: Rules: f624_0_mod_LT(i75:0:0, i68:0:0) -> f624_0_mod_LT(i68:0:0, i75:0:0) :|: i68:0:0 > 0 && i75:0:0 < i68:0:0 && i75:0:0 > 0 f624_0_mod_LT(x:0, x1:0) -> f624_0_mod_LT(c, x1:0) :|: c = x:0 - x1:0 && (x:0 > 0 && x1:0 > 0 && x:0 >= x1:0) ---------------------------------------- (17) PolynomialOrderProcessor (EQUIVALENT) Found the following polynomial interpretation: [f624_0_mod_LT(x, x1)] = x1 The following rules are decreasing: f624_0_mod_LT(i75:0:0, i68:0:0) -> f624_0_mod_LT(i68:0:0, i75:0:0) :|: i68:0:0 > 0 && i75:0:0 < i68:0:0 && i75:0:0 > 0 The following rules are bounded: f624_0_mod_LT(i75:0:0, i68:0:0) -> f624_0_mod_LT(i68:0:0, i75:0:0) :|: i68:0:0 > 0 && i75:0:0 < i68:0:0 && i75:0:0 > 0 f624_0_mod_LT(x:0, x1:0) -> f624_0_mod_LT(c, x1:0) :|: c = x:0 - x1:0 && (x:0 > 0 && x1:0 > 0 && x:0 >= x1:0) ---------------------------------------- (18) Obligation: Rules: f624_0_mod_LT(x:0, x1:0) -> f624_0_mod_LT(c, x1:0) :|: c = x:0 - x1:0 && (x:0 > 0 && x1:0 > 0 && x:0 >= x1:0) ---------------------------------------- (19) PolynomialOrderProcessor (EQUIVALENT) Found the following polynomial interpretation: [f624_0_mod_LT(x, x1)] = x The following rules are decreasing: f624_0_mod_LT(x:0, x1:0) -> f624_0_mod_LT(c, x1:0) :|: c = x:0 - x1:0 && (x:0 > 0 && x1:0 > 0 && x:0 >= x1:0) The following rules are bounded: f624_0_mod_LT(x:0, x1:0) -> f624_0_mod_LT(c, x1:0) :|: c = x:0 - x1:0 && (x:0 > 0 && x1:0 > 0 && x:0 >= x1:0) ---------------------------------------- (20) YES