/export/starexec/sandbox/solver/bin/starexec_run_standard /export/starexec/sandbox/benchmark/theBenchmark.jar /export/starexec/sandbox/output/output_files -------------------------------------------------------------------------------- YES proof of /export/starexec/sandbox/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, 223 ms] (4) JBCTerminationGraph (5) TerminationGraphToSCCProof [SOUND, 0 ms] (6) JBCTerminationSCC (7) SCCToIRSProof [SOUND, 76 ms] (8) IRSwT (9) IRSFormatTransformerProof [EQUIVALENT, 0 ms] (10) IRSwT (11) IRSwTTerminationDigraphProof [EQUIVALENT, 95 ms] (12) IRSwT (13) IntTRSCompressionProof [EQUIVALENT, 0 ms] (14) IRSwT (15) TempFilterProof [SOUND, 58 ms] (16) IntTRS (17) RankingReductionPairProof [EQUIVALENT, 4 ms] (18) YES ---------------------------------------- (0) Obligation: need to prove termination of the following program: /** * Example taken from "A Term Rewriting Approach to the Automated Termination * Analysis of Imperative Programs" (http://www.cs.unm.edu/~spf/papers/2009-02.pdf) * and converted to Java. */ public class PastaB8 { public static void main(String[] args) { Random.args = args; int x = Random.random(); if (x > 0) { while (x != 0) { if (x % 2 == 0) { x = x/2; } else { x--; } } } } } 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: /** * Example taken from "A Term Rewriting Approach to the Automated Termination * Analysis of Imperative Programs" (http://www.cs.unm.edu/~spf/papers/2009-02.pdf) * and converted to Java. */ public class PastaB8 { public static void main(String[] args) { Random.args = args; int x = Random.random(); if (x > 0) { while (x != 0) { if (x % 2 == 0) { x = x/2; } else { x--; } } } } } 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: PastaB8.main([Ljava/lang/String;)V: Graph of 124 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: PastaB8.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 19 IRulesP rules: f364_0_main_EQ(EOS(STATIC_364), i58, i58) -> f369_0_main_EQ(EOS(STATIC_369), i58, i58) :|: TRUE f369_0_main_EQ(EOS(STATIC_369), i58, i58) -> f373_0_main_Load(EOS(STATIC_373), i58) :|: i58 > 0 f373_0_main_Load(EOS(STATIC_373), i58) -> f386_0_main_ConstantStackPush(EOS(STATIC_386), i58, i58) :|: TRUE f386_0_main_ConstantStackPush(EOS(STATIC_386), i58, i58) -> f393_0_main_IntArithmetic(EOS(STATIC_393), i58, i58, 2) :|: TRUE f393_0_main_IntArithmetic(EOS(STATIC_393), i58, i58, matching1) -> f395_0_main_NE(EOS(STATIC_395), i58, i58 % 2) :|: TRUE && matching1 = 2 f395_0_main_NE(EOS(STATIC_395), i58, matching1) -> f399_0_main_NE(EOS(STATIC_399), i58, 1) :|: TRUE && matching1 = 1 f395_0_main_NE(EOS(STATIC_395), i58, matching1) -> f400_0_main_NE(EOS(STATIC_400), i58, 0) :|: TRUE && matching1 = 0 f399_0_main_NE(EOS(STATIC_399), i58, matching1) -> f402_0_main_Inc(EOS(STATIC_402), i58) :|: 1 > 0 && matching1 = 1 f402_0_main_Inc(EOS(STATIC_402), i58) -> f407_0_main_JMP(EOS(STATIC_407), i58 + -1) :|: TRUE f407_0_main_JMP(EOS(STATIC_407), i61) -> f438_0_main_Load(EOS(STATIC_438), i61) :|: TRUE f438_0_main_Load(EOS(STATIC_438), i61) -> f353_0_main_Load(EOS(STATIC_353), i61) :|: TRUE f353_0_main_Load(EOS(STATIC_353), i49) -> f364_0_main_EQ(EOS(STATIC_364), i49, i49) :|: TRUE f400_0_main_NE(EOS(STATIC_400), i58, matching1) -> f404_0_main_Load(EOS(STATIC_404), i58) :|: TRUE && matching1 = 0 f404_0_main_Load(EOS(STATIC_404), i58) -> f409_0_main_ConstantStackPush(EOS(STATIC_409), i58) :|: TRUE f409_0_main_ConstantStackPush(EOS(STATIC_409), i58) -> f440_0_main_IntArithmetic(EOS(STATIC_440), i58, 2) :|: TRUE f440_0_main_IntArithmetic(EOS(STATIC_440), i58, matching1) -> f985_0_main_Store(EOS(STATIC_985), i173) :|: i173 = i58 / 2 && i58 >= 1 && i173 < i58 && matching1 = 2 f985_0_main_Store(EOS(STATIC_985), i173) -> f986_0_main_JMP(EOS(STATIC_986), i173) :|: TRUE f986_0_main_JMP(EOS(STATIC_986), i173) -> f997_0_main_Load(EOS(STATIC_997), i173) :|: TRUE f997_0_main_Load(EOS(STATIC_997), i173) -> f353_0_main_Load(EOS(STATIC_353), i173) :|: TRUE Combined rules. Obtained 4 IRulesP rules: f364_0_main_EQ(EOS(STATIC_364), i58:0, i58:0) -> f364_0_main_EQ'(EOS(STATIC_364), i58:0, i58:0) :|: i58:0 > 0 && i58:0 - 2 * div = 0 && i58:0 > div1 f364_0_main_EQ'(EOS(STATIC_364), i58:0, i58:0) -> f364_0_main_EQ(EOS(STATIC_364), div1, div1) :|: i58:0 > 0 && i58:0 - 2 * div = 0 && i58:0 > div1 && i58:0 - 2 * div > -2 && i58:0 - 2 * div < 2 && i58:0 - 2 * div1 < 2 && i58:0 - 2 * div1 > -2 f364_0_main_EQ(EOS(STATIC_364), i58:0, i58:0) -> f364_0_main_EQ'(EOS(STATIC_364), i58:0, i58:0) :|: i58:0 - 2 * div = 1 && i58:0 > 0 f364_0_main_EQ'(EOS(STATIC_364), i58:0, i58:0) -> f364_0_main_EQ(EOS(STATIC_364), i58:0 - 1, i58:0 - 1) :|: i58:0 > 0 && i58:0 - 2 * div = 1 && i58:0 - 2 * div < 2 && i58:0 - 2 * div > -2 Filtered constant ground arguments: f364_0_main_EQ(x1, x2, x3) -> f364_0_main_EQ(x2, x3) f364_0_main_EQ'(x1, x2, x3) -> f364_0_main_EQ'(x2, x3) EOS(x1) -> EOS Filtered duplicate arguments: f364_0_main_EQ(x1, x2) -> f364_0_main_EQ(x2) f364_0_main_EQ'(x1, x2) -> f364_0_main_EQ'(x2) Finished conversion. Obtained 4 rules.P rules: f364_0_main_EQ(i58:0) -> f364_0_main_EQ'(i58:0) :|: i58:0 - 2 * div = 0 && i58:0 > div1 && i58:0 > 0 f364_0_main_EQ'(i58:0) -> f364_0_main_EQ(div1) :|: i58:0 - 2 * div = 0 && i58:0 > 0 && i58:0 > div1 && i58:0 - 2 * div > -2 && i58:0 - 2 * div < 2 && i58:0 - 2 * div1 > -2 && i58:0 - 2 * div1 < 2 f364_0_main_EQ(i58:0) -> f364_0_main_EQ'(i58:0) :|: i58:0 - 2 * div = 1 && i58:0 > 0 f364_0_main_EQ'(i58:0) -> f364_0_main_EQ(i58:0 - 1) :|: i58:0 - 2 * div = 1 && i58:0 > 0 && i58:0 - 2 * div > -2 && i58:0 - 2 * div < 2 ---------------------------------------- (8) Obligation: Rules: f364_0_main_EQ(x) -> f364_0_main_EQ'(x) :|: x - 2 * x1 = 0 && x > x2 && x > 0 f364_0_main_EQ'(x3) -> f364_0_main_EQ(x4) :|: x3 - 2 * x5 = 0 && x3 > 0 && x3 > x4 && x3 - 2 * x5 > -2 && x3 - 2 * x5 < 2 && x3 - 2 * x4 > -2 && x3 - 2 * x4 < 2 f364_0_main_EQ(x6) -> f364_0_main_EQ'(x6) :|: x6 - 2 * x7 = 1 && x6 > 0 f364_0_main_EQ'(x8) -> f364_0_main_EQ(x8 - 1) :|: x8 - 2 * x9 = 1 && x8 > 0 && x8 - 2 * x9 > -2 && x8 - 2 * x9 < 2 ---------------------------------------- (9) IRSFormatTransformerProof (EQUIVALENT) Reformatted IRS to match normalized format (transformed away non-linear left-hand sides, !=, / and %). ---------------------------------------- (10) Obligation: Rules: f364_0_main_EQ(x) -> f364_0_main_EQ'(x) :|: x - 2 * x1 = 0 && x > x2 && x > 0 f364_0_main_EQ'(x3) -> f364_0_main_EQ(x4) :|: x3 - 2 * x5 = 0 && x3 > 0 && x3 > x4 && x3 - 2 * x5 > -2 && x3 - 2 * x5 < 2 && x3 - 2 * x4 > -2 && x3 - 2 * x4 < 2 f364_0_main_EQ(x6) -> f364_0_main_EQ'(x6) :|: x6 - 2 * x7 = 1 && x6 > 0 f364_0_main_EQ'(x8) -> f364_0_main_EQ(arith) :|: x8 - 2 * x9 = 1 && x8 > 0 && x8 - 2 * x9 > -2 && x8 - 2 * x9 < 2 && arith = x8 - 1 ---------------------------------------- (11) IRSwTTerminationDigraphProof (EQUIVALENT) Constructed termination digraph! Nodes: (1) f364_0_main_EQ(x) -> f364_0_main_EQ'(x) :|: x - 2 * x1 = 0 && x > x2 && x > 0 (2) f364_0_main_EQ'(x3) -> f364_0_main_EQ(x4) :|: x3 - 2 * x5 = 0 && x3 > 0 && x3 > x4 && x3 - 2 * x5 > -2 && x3 - 2 * x5 < 2 && x3 - 2 * x4 > -2 && x3 - 2 * x4 < 2 (3) f364_0_main_EQ(x6) -> f364_0_main_EQ'(x6) :|: x6 - 2 * x7 = 1 && x6 > 0 (4) f364_0_main_EQ'(x8) -> f364_0_main_EQ(arith) :|: x8 - 2 * x9 = 1 && x8 > 0 && x8 - 2 * x9 > -2 && x8 - 2 * x9 < 2 && arith = x8 - 1 Arcs: (1) -> (2) (2) -> (1), (3) (3) -> (4) (4) -> (1) This digraph is fully evaluated! ---------------------------------------- (12) Obligation: Termination digraph: Nodes: (1) f364_0_main_EQ(x) -> f364_0_main_EQ'(x) :|: x - 2 * x1 = 0 && x > x2 && x > 0 (2) f364_0_main_EQ'(x8) -> f364_0_main_EQ(arith) :|: x8 - 2 * x9 = 1 && x8 > 0 && x8 - 2 * x9 > -2 && x8 - 2 * x9 < 2 && arith = x8 - 1 (3) f364_0_main_EQ(x6) -> f364_0_main_EQ'(x6) :|: x6 - 2 * x7 = 1 && x6 > 0 (4) f364_0_main_EQ'(x3) -> f364_0_main_EQ(x4) :|: x3 - 2 * x5 = 0 && x3 > 0 && x3 > x4 && x3 - 2 * x5 > -2 && x3 - 2 * x5 < 2 && x3 - 2 * x4 > -2 && x3 - 2 * x4 < 2 Arcs: (1) -> (4) (2) -> (1) (3) -> (2) (4) -> (1), (3) This digraph is fully evaluated! ---------------------------------------- (13) IntTRSCompressionProof (EQUIVALENT) Compressed rules. ---------------------------------------- (14) Obligation: Rules: f364_0_main_EQ'(x3:0) -> f364_0_main_EQ(x4:0) :|: x3:0 - 2 * x4:0 > -2 && x3:0 - 2 * x4:0 < 2 && x3:0 - 2 * x5:0 < 2 && x3:0 - 2 * x5:0 > -2 && x4:0 < x3:0 && x3:0 > 0 && x3:0 - 2 * x5:0 = 0 f364_0_main_EQ(x:0) -> f364_0_main_EQ'(x:0) :|: x:0 - 2 * x1:0 = 0 && x:0 > x2:0 && x:0 > 0 f364_0_main_EQ'(x8:0) -> f364_0_main_EQ(x8:0 - 1) :|: x8:0 - 2 * x9:0 > -2 && x8:0 - 2 * x9:0 < 2 && x8:0 > 0 && x8:0 - 2 * x9:0 = 1 f364_0_main_EQ(x6:0) -> f364_0_main_EQ'(x6:0) :|: x6:0 - 2 * x7:0 = 1 && x6:0 > 0 ---------------------------------------- (15) TempFilterProof (SOUND) Used the following sort dictionary for filtering: f364_0_main_EQ'(INTEGER) f364_0_main_EQ(INTEGER) Replaced non-predefined constructor symbols by 0. ---------------------------------------- (16) Obligation: Rules: f364_0_main_EQ'(x3:0) -> f364_0_main_EQ(x4:0) :|: x3:0 - 2 * x4:0 > -2 && x3:0 - 2 * x4:0 < 2 && x3:0 - 2 * x5:0 < 2 && x3:0 - 2 * x5:0 > -2 && x4:0 < x3:0 && x3:0 > 0 && x3:0 - 2 * x5:0 = 0 f364_0_main_EQ(x:0) -> f364_0_main_EQ'(x:0) :|: x:0 - 2 * x1:0 = 0 && x:0 > x2:0 && x:0 > 0 f364_0_main_EQ'(x8:0) -> f364_0_main_EQ(c) :|: c = x8:0 - 1 && (x8:0 - 2 * x9:0 > -2 && x8:0 - 2 * x9:0 < 2 && x8:0 > 0 && x8:0 - 2 * x9:0 = 1) f364_0_main_EQ(x6:0) -> f364_0_main_EQ'(x6:0) :|: x6:0 - 2 * x7:0 = 1 && x6:0 > 0 ---------------------------------------- (17) RankingReductionPairProof (EQUIVALENT) Interpretation: [ f364_0_main_EQ' ] = 2*f364_0_main_EQ'_1 + -1 [ f364_0_main_EQ ] = 2*f364_0_main_EQ_1 The following rules are decreasing: f364_0_main_EQ'(x3:0) -> f364_0_main_EQ(x4:0) :|: x3:0 - 2 * x4:0 > -2 && x3:0 - 2 * x4:0 < 2 && x3:0 - 2 * x5:0 < 2 && x3:0 - 2 * x5:0 > -2 && x4:0 < x3:0 && x3:0 > 0 && x3:0 - 2 * x5:0 = 0 f364_0_main_EQ(x:0) -> f364_0_main_EQ'(x:0) :|: x:0 - 2 * x1:0 = 0 && x:0 > x2:0 && x:0 > 0 f364_0_main_EQ'(x8:0) -> f364_0_main_EQ(c) :|: c = x8:0 - 1 && (x8:0 - 2 * x9:0 > -2 && x8:0 - 2 * x9:0 < 2 && x8:0 > 0 && x8:0 - 2 * x9:0 = 1) f364_0_main_EQ(x6:0) -> f364_0_main_EQ'(x6:0) :|: x6:0 - 2 * x7:0 = 1 && x6:0 > 0 The following rules are bounded: f364_0_main_EQ'(x3:0) -> f364_0_main_EQ(x4:0) :|: x3:0 - 2 * x4:0 > -2 && x3:0 - 2 * x4:0 < 2 && x3:0 - 2 * x5:0 < 2 && x3:0 - 2 * x5:0 > -2 && x4:0 < x3:0 && x3:0 > 0 && x3:0 - 2 * x5:0 = 0 f364_0_main_EQ(x:0) -> f364_0_main_EQ'(x:0) :|: x:0 - 2 * x1:0 = 0 && x:0 > x2:0 && x:0 > 0 f364_0_main_EQ'(x8:0) -> f364_0_main_EQ(c) :|: c = x8:0 - 1 && (x8:0 - 2 * x9:0 > -2 && x8:0 - 2 * x9:0 < 2 && x8:0 > 0 && x8:0 - 2 * x9:0 = 1) f364_0_main_EQ(x6:0) -> f364_0_main_EQ'(x6:0) :|: x6:0 - 2 * x7:0 = 1 && x6:0 > 0 ---------------------------------------- (18) YES