/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: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty termination of the given Bare JBC problem could be proven: (0) Bare JBC problem (1) BareJBCToJBCProof [EQUIVALENT, 97 ms] (2) JBC problem (3) JBCToGraph [EQUIVALENT, 212 ms] (4) JBCTerminationGraph (5) TerminationGraphToSCCProof [SOUND, 0 ms] (6) JBCTerminationSCC (7) SCCToIRSProof [SOUND, 148 ms] (8) IRSwT (9) IRSFormatTransformerProof [EQUIVALENT, 0 ms] (10) IRSwT (11) IRSwTTerminationDigraphProof [EQUIVALENT, 109 ms] (12) IRSwT (13) IntTRSCompressionProof [EQUIVALENT, 0 ms] (14) IRSwT (15) TempFilterProof [SOUND, 60 ms] (16) IntTRS (17) RankingReductionPairProof [EQUIVALENT, 0 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: f321_0_main_EQ(EOS(STATIC_321), i46, i46) -> f327_0_main_Load(EOS(STATIC_327), i46) :|: i46 > 0 f327_0_main_Load(EOS(STATIC_327), i46) -> f340_0_main_ConstantStackPush(EOS(STATIC_340), i46, i46) :|: TRUE f340_0_main_ConstantStackPush(EOS(STATIC_340), i46, i46) -> f344_0_main_IntArithmetic(EOS(STATIC_344), i46, i46, 2) :|: TRUE f344_0_main_IntArithmetic(EOS(STATIC_344), i46, i46, matching1) -> f346_0_main_NE(EOS(STATIC_346), i46, i46 % 2) :|: TRUE && matching1 = 2 f346_0_main_NE(EOS(STATIC_346), i46, matching1) -> f349_0_main_NE(EOS(STATIC_349), i46, 1) :|: TRUE && matching1 = 1 f346_0_main_NE(EOS(STATIC_346), i46, matching1) -> f350_0_main_NE(EOS(STATIC_350), i46, 0) :|: TRUE && matching1 = 0 f349_0_main_NE(EOS(STATIC_349), i46, matching1) -> f352_0_main_Inc(EOS(STATIC_352), i46) :|: 1 > 0 && matching1 = 1 f352_0_main_Inc(EOS(STATIC_352), i46) -> f357_0_main_JMP(EOS(STATIC_357), i46 + -1) :|: TRUE f357_0_main_JMP(EOS(STATIC_357), i53) -> f387_0_main_Load(EOS(STATIC_387), i53) :|: TRUE f387_0_main_Load(EOS(STATIC_387), i53) -> f304_0_main_Load(EOS(STATIC_304), i53) :|: TRUE f304_0_main_Load(EOS(STATIC_304), i40) -> f316_0_main_EQ(EOS(STATIC_316), i40, i40) :|: TRUE f316_0_main_EQ(EOS(STATIC_316), i46, i46) -> f321_0_main_EQ(EOS(STATIC_321), i46, i46) :|: TRUE f350_0_main_NE(EOS(STATIC_350), i46, matching1) -> f354_0_main_Load(EOS(STATIC_354), i46) :|: TRUE && matching1 = 0 f354_0_main_Load(EOS(STATIC_354), i46) -> f359_0_main_ConstantStackPush(EOS(STATIC_359), i46) :|: TRUE f359_0_main_ConstantStackPush(EOS(STATIC_359), i46) -> f390_0_main_IntArithmetic(EOS(STATIC_390), i46, 2) :|: TRUE f390_0_main_IntArithmetic(EOS(STATIC_390), i46, matching1) -> f1156_0_main_Store(EOS(STATIC_1156), i206) :|: i206 = i46 / 2 && i46 >= 1 && i206 < i46 && matching1 = 2 f1156_0_main_Store(EOS(STATIC_1156), i206) -> f1159_0_main_JMP(EOS(STATIC_1159), i206) :|: TRUE f1159_0_main_JMP(EOS(STATIC_1159), i206) -> f1172_0_main_Load(EOS(STATIC_1172), i206) :|: TRUE f1172_0_main_Load(EOS(STATIC_1172), i206) -> f304_0_main_Load(EOS(STATIC_304), i206) :|: TRUE Combined rules. Obtained 4 IRulesP rules: f321_0_main_EQ(EOS(STATIC_321), i46:0, i46:0) -> f321_0_main_EQ'(EOS(STATIC_321), i46:0, i46:0) :|: i46:0 > 0 && i46:0 - 2 * div = 0 && i46:0 > div1 f321_0_main_EQ'(EOS(STATIC_321), i46:0, i46:0) -> f321_0_main_EQ(EOS(STATIC_321), div1, div1) :|: i46:0 > 0 && i46:0 - 2 * div = 0 && i46:0 > div1 && i46:0 - 2 * div > -2 && i46:0 - 2 * div < 2 && i46:0 - 2 * div1 < 2 && i46:0 - 2 * div1 > -2 f321_0_main_EQ(EOS(STATIC_321), i46:0, i46:0) -> f321_0_main_EQ'(EOS(STATIC_321), i46:0, i46:0) :|: i46:0 - 2 * div = 1 && i46:0 > 0 f321_0_main_EQ'(EOS(STATIC_321), i46:0, i46:0) -> f321_0_main_EQ(EOS(STATIC_321), i46:0 - 1, i46:0 - 1) :|: i46:0 > 0 && i46:0 - 2 * div = 1 && i46:0 - 2 * div < 2 && i46:0 - 2 * div > -2 Filtered constant ground arguments: f321_0_main_EQ(x1, x2, x3) -> f321_0_main_EQ(x2, x3) f321_0_main_EQ'(x1, x2, x3) -> f321_0_main_EQ'(x2, x3) EOS(x1) -> EOS Filtered duplicate arguments: f321_0_main_EQ(x1, x2) -> f321_0_main_EQ(x2) f321_0_main_EQ'(x1, x2) -> f321_0_main_EQ'(x2) Finished conversion. Obtained 4 rules.P rules: f321_0_main_EQ(i46:0) -> f321_0_main_EQ'(i46:0) :|: i46:0 - 2 * div = 0 && i46:0 > div1 && i46:0 > 0 f321_0_main_EQ'(i46:0) -> f321_0_main_EQ(div1) :|: i46:0 - 2 * div = 0 && i46:0 > 0 && i46:0 > div1 && i46:0 - 2 * div > -2 && i46:0 - 2 * div < 2 && i46:0 - 2 * div1 > -2 && i46:0 - 2 * div1 < 2 f321_0_main_EQ(i46:0) -> f321_0_main_EQ'(i46:0) :|: i46:0 - 2 * div = 1 && i46:0 > 0 f321_0_main_EQ'(i46:0) -> f321_0_main_EQ(i46:0 - 1) :|: i46:0 - 2 * div = 1 && i46:0 > 0 && i46:0 - 2 * div > -2 && i46:0 - 2 * div < 2 ---------------------------------------- (8) Obligation: Rules: f321_0_main_EQ(x) -> f321_0_main_EQ'(x) :|: x - 2 * x1 = 0 && x > x2 && x > 0 f321_0_main_EQ'(x3) -> f321_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 f321_0_main_EQ(x6) -> f321_0_main_EQ'(x6) :|: x6 - 2 * x7 = 1 && x6 > 0 f321_0_main_EQ'(x8) -> f321_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: f321_0_main_EQ(x) -> f321_0_main_EQ'(x) :|: x - 2 * x1 = 0 && x > x2 && x > 0 f321_0_main_EQ'(x3) -> f321_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 f321_0_main_EQ(x6) -> f321_0_main_EQ'(x6) :|: x6 - 2 * x7 = 1 && x6 > 0 f321_0_main_EQ'(x8) -> f321_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) f321_0_main_EQ(x) -> f321_0_main_EQ'(x) :|: x - 2 * x1 = 0 && x > x2 && x > 0 (2) f321_0_main_EQ'(x3) -> f321_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) f321_0_main_EQ(x6) -> f321_0_main_EQ'(x6) :|: x6 - 2 * x7 = 1 && x6 > 0 (4) f321_0_main_EQ'(x8) -> f321_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) f321_0_main_EQ(x) -> f321_0_main_EQ'(x) :|: x - 2 * x1 = 0 && x > x2 && x > 0 (2) f321_0_main_EQ'(x8) -> f321_0_main_EQ(arith) :|: x8 - 2 * x9 = 1 && x8 > 0 && x8 - 2 * x9 > -2 && x8 - 2 * x9 < 2 && arith = x8 - 1 (3) f321_0_main_EQ(x6) -> f321_0_main_EQ'(x6) :|: x6 - 2 * x7 = 1 && x6 > 0 (4) f321_0_main_EQ'(x3) -> f321_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: f321_0_main_EQ(x6:0) -> f321_0_main_EQ'(x6:0) :|: x6:0 - 2 * x7:0 = 1 && x6:0 > 0 f321_0_main_EQ'(x3:0) -> f321_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 f321_0_main_EQ'(x8:0) -> f321_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 f321_0_main_EQ(x:0) -> f321_0_main_EQ'(x:0) :|: x:0 - 2 * x1:0 = 0 && x:0 > x2:0 && x:0 > 0 ---------------------------------------- (15) TempFilterProof (SOUND) Used the following sort dictionary for filtering: f321_0_main_EQ(INTEGER) f321_0_main_EQ'(INTEGER) Replaced non-predefined constructor symbols by 0. ---------------------------------------- (16) Obligation: Rules: f321_0_main_EQ(x6:0) -> f321_0_main_EQ'(x6:0) :|: x6:0 - 2 * x7:0 = 1 && x6:0 > 0 f321_0_main_EQ'(x3:0) -> f321_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 f321_0_main_EQ'(x8:0) -> f321_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) f321_0_main_EQ(x:0) -> f321_0_main_EQ'(x:0) :|: x:0 - 2 * x1:0 = 0 && x:0 > x2:0 && x:0 > 0 ---------------------------------------- (17) RankingReductionPairProof (EQUIVALENT) Interpretation: [ f321_0_main_EQ ] = 2*f321_0_main_EQ_1 + 1 [ f321_0_main_EQ' ] = 2*f321_0_main_EQ'_1 The following rules are decreasing: f321_0_main_EQ(x6:0) -> f321_0_main_EQ'(x6:0) :|: x6:0 - 2 * x7:0 = 1 && x6:0 > 0 f321_0_main_EQ'(x3:0) -> f321_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 f321_0_main_EQ'(x8:0) -> f321_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) f321_0_main_EQ(x:0) -> f321_0_main_EQ'(x:0) :|: x:0 - 2 * x1:0 = 0 && x:0 > x2:0 && x:0 > 0 The following rules are bounded: f321_0_main_EQ(x6:0) -> f321_0_main_EQ'(x6:0) :|: x6:0 - 2 * x7:0 = 1 && x6:0 > 0 f321_0_main_EQ'(x3:0) -> f321_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 f321_0_main_EQ'(x8:0) -> f321_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) f321_0_main_EQ(x:0) -> f321_0_main_EQ'(x:0) :|: x:0 - 2 * x1:0 = 0 && x:0 > x2:0 && x:0 > 0 ---------------------------------------- (18) YES