/export/starexec/sandbox2/solver/bin/starexec_run_standard /export/starexec/sandbox2/benchmark/theBenchmark.pl /export/starexec/sandbox2/output/output_files -------------------------------------------------------------------------------- YES proof of /export/starexec/sandbox2/benchmark/theBenchmark.pl # AProVE Commit ID: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty Left Termination of the query pattern area(g,a) w.r.t. the given Prolog program could successfully be proven: (0) Prolog (1) IntegerArithmeticTransformerProof [SOUND, 0 ms] (2) Prolog (3) UndefinedPredicateHandlerProof [SOUND, 0 ms] (4) Prolog (5) PrologToPiTRSProof [SOUND, 2 ms] (6) PiTRS (7) DependencyPairsProof [EQUIVALENT, 0 ms] (8) PiDP (9) DependencyGraphProof [EQUIVALENT, 0 ms] (10) PiDP (11) UsableRulesProof [EQUIVALENT, 0 ms] (12) PiDP (13) PiDPToQDPProof [SOUND, 0 ms] (14) QDP (15) QDPSizeChangeProof [EQUIVALENT, 0 ms] (16) YES ---------------------------------------- (0) Obligation: Clauses: area(.(X3, []), 0). area(.(','(X1, Y1), .(','(X2, Y2), XYs)), Area) :- ','(area(.(','(X2, Y2), XYs), Area1), is(Area, +(/(-(*(X1, Y2), *(Y1, X2)), 2), Area1))). Query: area(g,a) ---------------------------------------- (1) IntegerArithmeticTransformerProof (SOUND) Added definitions of predefined predicates [PROLOG]. ---------------------------------------- (2) Obligation: Clauses: area(.(X3, []), zero). area(.(','(X1, Y1), .(','(X2, Y2), XYs)), Area) :- ','(area(.(','(X2, Y2), XYs), Area1), is(Area, +(/(-(*(X1, Y2), *(Y1, X2)), succ(succ(zero))), Area1))). isPlus(zero, X, X). isPlus(succ(X), zero, succ(X)). isPlus(succ(X), succ(Y), succ(succ(Z))) :- isPlus(X, Y, Z). isPlus(succ(X), pred(Y), Z) :- isPlus(X, Y, Z). isPlus(pred(X), zero, pred(X)). isPlus(pred(X), succ(Y), Z) :- isPlus(X, Y, Z). isPlus(pred(X), pred(Y), pred(pred(Z))) :- isPlus(X, Y, Z). isMinus(X, zero, X). isMinus(zero, succ(Y), pred(Z)) :- isMinus(zero, Y, Z). isMinus(zero, pred(Y), succ(Z)) :- isMinus(zero, Y, Z). isMinus(succ(X), succ(Y), Z) :- isMinus(X, Y, Z). isMinus(succ(X), pred(Y), succ(succ(Z))) :- isMinus(X, Y, Z). isMinus(pred(X), succ(Y), pred(pred(Z))) :- isMinus(X, Y, Z). isMinus(pred(X), pred(Y), Z) :- isMinus(X, Y, Z). isTimes(X, zero, zero). isTimes(zero, succ(Y), zero). isTimes(zero, pred(Y), zero). isTimes(succ(X), succ(Y), Z) :- ','(isTimes(succ(X), Y, A), isPlus(A, succ(X), Z)). isTimes(succ(X), pred(Y), Z) :- ','(isTimes(succ(X), Y, A), isMinus(A, succ(X), Z)). isTimes(pred(X), succ(Y), Z) :- ','(isTimes(pred(X), Y, A), isPlus(A, pred(X), Z)). isTimes(pred(X), pred(Y), Z) :- ','(isTimes(pred(X), Y, A), isMinus(A, pred(X), Z)). isDiv(zero, succ(Y), zero). isDiv(zero, pred(Y), zero). isDiv(succ(X), succ(Y), zero) :- isMinus(succ(X), succ(Y), pred(Z)). isDiv(succ(X), succ(Y), succ(Z)) :- ','(isMinus(succ(X), succ(Y), A), isDiv(A, succ(Y), Z)). isDiv(succ(X), pred(Y), Z) :- ','(isMinus(zero, pred(Y), A), ','(isDiv(succ(X), A, B), isMinus(zero, B, Z))). isDiv(pred(X), pred(Y), zero) :- isMinus(pred(X), pred(Y), succ(Z)). isDiv(pred(X), pred(Y), succ(Z)) :- ','(isMinus(pred(X), pred(Y), A), isDiv(A, pred(Y), Z)). isDiv(pred(X), succ(Y), Z) :- ','(isMinus(zero, pred(X), A), ','(isDiv(A, succ(Y), B), isMinus(zero, B, Z))). isModulo(X, Y, Z) :- ','(isDiv(X, Y, A), ','(isTimes(A, Y, B), isMinus(X, B, Z))). Query: area(g,a) ---------------------------------------- (3) UndefinedPredicateHandlerProof (SOUND) Added facts for all undefined predicates [PROLOG]. ---------------------------------------- (4) Obligation: Clauses: area(.(X3, []), zero). area(.(','(X1, Y1), .(','(X2, Y2), XYs)), Area) :- ','(area(.(','(X2, Y2), XYs), Area1), is(Area, +(/(-(*(X1, Y2), *(Y1, X2)), succ(succ(zero))), Area1))). isPlus(zero, X, X). isPlus(succ(X), zero, succ(X)). isPlus(succ(X), succ(Y), succ(succ(Z))) :- isPlus(X, Y, Z). isPlus(succ(X), pred(Y), Z) :- isPlus(X, Y, Z). isPlus(pred(X), zero, pred(X)). isPlus(pred(X), succ(Y), Z) :- isPlus(X, Y, Z). isPlus(pred(X), pred(Y), pred(pred(Z))) :- isPlus(X, Y, Z). isMinus(X, zero, X). isMinus(zero, succ(Y), pred(Z)) :- isMinus(zero, Y, Z). isMinus(zero, pred(Y), succ(Z)) :- isMinus(zero, Y, Z). isMinus(succ(X), succ(Y), Z) :- isMinus(X, Y, Z). isMinus(succ(X), pred(Y), succ(succ(Z))) :- isMinus(X, Y, Z). isMinus(pred(X), succ(Y), pred(pred(Z))) :- isMinus(X, Y, Z). isMinus(pred(X), pred(Y), Z) :- isMinus(X, Y, Z). isTimes(X, zero, zero). isTimes(zero, succ(Y), zero). isTimes(zero, pred(Y), zero). isTimes(succ(X), succ(Y), Z) :- ','(isTimes(succ(X), Y, A), isPlus(A, succ(X), Z)). isTimes(succ(X), pred(Y), Z) :- ','(isTimes(succ(X), Y, A), isMinus(A, succ(X), Z)). isTimes(pred(X), succ(Y), Z) :- ','(isTimes(pred(X), Y, A), isPlus(A, pred(X), Z)). isTimes(pred(X), pred(Y), Z) :- ','(isTimes(pred(X), Y, A), isMinus(A, pred(X), Z)). isDiv(zero, succ(Y), zero). isDiv(zero, pred(Y), zero). isDiv(succ(X), succ(Y), zero) :- isMinus(succ(X), succ(Y), pred(Z)). isDiv(succ(X), succ(Y), succ(Z)) :- ','(isMinus(succ(X), succ(Y), A), isDiv(A, succ(Y), Z)). isDiv(succ(X), pred(Y), Z) :- ','(isMinus(zero, pred(Y), A), ','(isDiv(succ(X), A, B), isMinus(zero, B, Z))). isDiv(pred(X), pred(Y), zero) :- isMinus(pred(X), pred(Y), succ(Z)). isDiv(pred(X), pred(Y), succ(Z)) :- ','(isMinus(pred(X), pred(Y), A), isDiv(A, pred(Y), Z)). isDiv(pred(X), succ(Y), Z) :- ','(isMinus(zero, pred(X), A), ','(isDiv(A, succ(Y), B), isMinus(zero, B, Z))). isModulo(X, Y, Z) :- ','(isDiv(X, Y, A), ','(isTimes(A, Y, B), isMinus(X, B, Z))). is(X0, X1). Query: area(g,a) ---------------------------------------- (5) PrologToPiTRSProof (SOUND) We use the technique of [TOCL09]. With regard to the inferred argument filtering the predicates were used in the following modes: area_in_2: (b,f) Transforming Prolog into the following Term Rewriting System: Pi-finite rewrite system: The TRS R consists of the following rules: area_in_ga(.(X3, []), zero) -> area_out_ga(.(X3, []), zero) area_in_ga(.(','(X1, Y1), .(','(X2, Y2), XYs)), Area) -> U1_ga(X1, Y1, X2, Y2, XYs, Area, area_in_ga(.(','(X2, Y2), XYs), Area1)) U1_ga(X1, Y1, X2, Y2, XYs, Area, area_out_ga(.(','(X2, Y2), XYs), Area1)) -> U2_ga(X1, Y1, X2, Y2, XYs, Area, is_in_aa(Area, +(/(-(*(X1, Y2), *(Y1, X2)), succ(succ(zero))), Area1))) is_in_aa(X0, X1) -> is_out_aa(X0, X1) U2_ga(X1, Y1, X2, Y2, XYs, Area, is_out_aa(Area, +(/(-(*(X1, Y2), *(Y1, X2)), succ(succ(zero))), Area1))) -> area_out_ga(.(','(X1, Y1), .(','(X2, Y2), XYs)), Area) The argument filtering Pi contains the following mapping: area_in_ga(x1, x2) = area_in_ga(x1) .(x1, x2) = .(x1, x2) [] = [] area_out_ga(x1, x2) = area_out_ga ','(x1, x2) = ','(x1, x2) U1_ga(x1, x2, x3, x4, x5, x6, x7) = U1_ga(x7) U2_ga(x1, x2, x3, x4, x5, x6, x7) = U2_ga(x7) +(x1, x2) = +(x1, x2) /(x1, x2) = /(x1, x2) -(x1, x2) = -(x1, x2) *(x1, x2) = *(x1, x2) succ(x1) = succ(x1) zero = zero is_in_aa(x1, x2) = is_in_aa is_out_aa(x1, x2) = is_out_aa Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog ---------------------------------------- (6) Obligation: Pi-finite rewrite system: The TRS R consists of the following rules: area_in_ga(.(X3, []), zero) -> area_out_ga(.(X3, []), zero) area_in_ga(.(','(X1, Y1), .(','(X2, Y2), XYs)), Area) -> U1_ga(X1, Y1, X2, Y2, XYs, Area, area_in_ga(.(','(X2, Y2), XYs), Area1)) U1_ga(X1, Y1, X2, Y2, XYs, Area, area_out_ga(.(','(X2, Y2), XYs), Area1)) -> U2_ga(X1, Y1, X2, Y2, XYs, Area, is_in_aa(Area, +(/(-(*(X1, Y2), *(Y1, X2)), succ(succ(zero))), Area1))) is_in_aa(X0, X1) -> is_out_aa(X0, X1) U2_ga(X1, Y1, X2, Y2, XYs, Area, is_out_aa(Area, +(/(-(*(X1, Y2), *(Y1, X2)), succ(succ(zero))), Area1))) -> area_out_ga(.(','(X1, Y1), .(','(X2, Y2), XYs)), Area) The argument filtering Pi contains the following mapping: area_in_ga(x1, x2) = area_in_ga(x1) .(x1, x2) = .(x1, x2) [] = [] area_out_ga(x1, x2) = area_out_ga ','(x1, x2) = ','(x1, x2) U1_ga(x1, x2, x3, x4, x5, x6, x7) = U1_ga(x7) U2_ga(x1, x2, x3, x4, x5, x6, x7) = U2_ga(x7) +(x1, x2) = +(x1, x2) /(x1, x2) = /(x1, x2) -(x1, x2) = -(x1, x2) *(x1, x2) = *(x1, x2) succ(x1) = succ(x1) zero = zero is_in_aa(x1, x2) = is_in_aa is_out_aa(x1, x2) = is_out_aa ---------------------------------------- (7) DependencyPairsProof (EQUIVALENT) Using Dependency Pairs [AG00,LOPSTR] we result in the following initial DP problem: Pi DP problem: The TRS P consists of the following rules: AREA_IN_GA(.(','(X1, Y1), .(','(X2, Y2), XYs)), Area) -> U1_GA(X1, Y1, X2, Y2, XYs, Area, area_in_ga(.(','(X2, Y2), XYs), Area1)) AREA_IN_GA(.(','(X1, Y1), .(','(X2, Y2), XYs)), Area) -> AREA_IN_GA(.(','(X2, Y2), XYs), Area1) U1_GA(X1, Y1, X2, Y2, XYs, Area, area_out_ga(.(','(X2, Y2), XYs), Area1)) -> U2_GA(X1, Y1, X2, Y2, XYs, Area, is_in_aa(Area, +(/(-(*(X1, Y2), *(Y1, X2)), succ(succ(zero))), Area1))) U1_GA(X1, Y1, X2, Y2, XYs, Area, area_out_ga(.(','(X2, Y2), XYs), Area1)) -> IS_IN_AA(Area, +(/(-(*(X1, Y2), *(Y1, X2)), succ(succ(zero))), Area1)) The TRS R consists of the following rules: area_in_ga(.(X3, []), zero) -> area_out_ga(.(X3, []), zero) area_in_ga(.(','(X1, Y1), .(','(X2, Y2), XYs)), Area) -> U1_ga(X1, Y1, X2, Y2, XYs, Area, area_in_ga(.(','(X2, Y2), XYs), Area1)) U1_ga(X1, Y1, X2, Y2, XYs, Area, area_out_ga(.(','(X2, Y2), XYs), Area1)) -> U2_ga(X1, Y1, X2, Y2, XYs, Area, is_in_aa(Area, +(/(-(*(X1, Y2), *(Y1, X2)), succ(succ(zero))), Area1))) is_in_aa(X0, X1) -> is_out_aa(X0, X1) U2_ga(X1, Y1, X2, Y2, XYs, Area, is_out_aa(Area, +(/(-(*(X1, Y2), *(Y1, X2)), succ(succ(zero))), Area1))) -> area_out_ga(.(','(X1, Y1), .(','(X2, Y2), XYs)), Area) The argument filtering Pi contains the following mapping: area_in_ga(x1, x2) = area_in_ga(x1) .(x1, x2) = .(x1, x2) [] = [] area_out_ga(x1, x2) = area_out_ga ','(x1, x2) = ','(x1, x2) U1_ga(x1, x2, x3, x4, x5, x6, x7) = U1_ga(x7) U2_ga(x1, x2, x3, x4, x5, x6, x7) = U2_ga(x7) +(x1, x2) = +(x1, x2) /(x1, x2) = /(x1, x2) -(x1, x2) = -(x1, x2) *(x1, x2) = *(x1, x2) succ(x1) = succ(x1) zero = zero is_in_aa(x1, x2) = is_in_aa is_out_aa(x1, x2) = is_out_aa AREA_IN_GA(x1, x2) = AREA_IN_GA(x1) U1_GA(x1, x2, x3, x4, x5, x6, x7) = U1_GA(x7) U2_GA(x1, x2, x3, x4, x5, x6, x7) = U2_GA(x7) IS_IN_AA(x1, x2) = IS_IN_AA We have to consider all (P,R,Pi)-chains ---------------------------------------- (8) Obligation: Pi DP problem: The TRS P consists of the following rules: AREA_IN_GA(.(','(X1, Y1), .(','(X2, Y2), XYs)), Area) -> U1_GA(X1, Y1, X2, Y2, XYs, Area, area_in_ga(.(','(X2, Y2), XYs), Area1)) AREA_IN_GA(.(','(X1, Y1), .(','(X2, Y2), XYs)), Area) -> AREA_IN_GA(.(','(X2, Y2), XYs), Area1) U1_GA(X1, Y1, X2, Y2, XYs, Area, area_out_ga(.(','(X2, Y2), XYs), Area1)) -> U2_GA(X1, Y1, X2, Y2, XYs, Area, is_in_aa(Area, +(/(-(*(X1, Y2), *(Y1, X2)), succ(succ(zero))), Area1))) U1_GA(X1, Y1, X2, Y2, XYs, Area, area_out_ga(.(','(X2, Y2), XYs), Area1)) -> IS_IN_AA(Area, +(/(-(*(X1, Y2), *(Y1, X2)), succ(succ(zero))), Area1)) The TRS R consists of the following rules: area_in_ga(.(X3, []), zero) -> area_out_ga(.(X3, []), zero) area_in_ga(.(','(X1, Y1), .(','(X2, Y2), XYs)), Area) -> U1_ga(X1, Y1, X2, Y2, XYs, Area, area_in_ga(.(','(X2, Y2), XYs), Area1)) U1_ga(X1, Y1, X2, Y2, XYs, Area, area_out_ga(.(','(X2, Y2), XYs), Area1)) -> U2_ga(X1, Y1, X2, Y2, XYs, Area, is_in_aa(Area, +(/(-(*(X1, Y2), *(Y1, X2)), succ(succ(zero))), Area1))) is_in_aa(X0, X1) -> is_out_aa(X0, X1) U2_ga(X1, Y1, X2, Y2, XYs, Area, is_out_aa(Area, +(/(-(*(X1, Y2), *(Y1, X2)), succ(succ(zero))), Area1))) -> area_out_ga(.(','(X1, Y1), .(','(X2, Y2), XYs)), Area) The argument filtering Pi contains the following mapping: area_in_ga(x1, x2) = area_in_ga(x1) .(x1, x2) = .(x1, x2) [] = [] area_out_ga(x1, x2) = area_out_ga ','(x1, x2) = ','(x1, x2) U1_ga(x1, x2, x3, x4, x5, x6, x7) = U1_ga(x7) U2_ga(x1, x2, x3, x4, x5, x6, x7) = U2_ga(x7) +(x1, x2) = +(x1, x2) /(x1, x2) = /(x1, x2) -(x1, x2) = -(x1, x2) *(x1, x2) = *(x1, x2) succ(x1) = succ(x1) zero = zero is_in_aa(x1, x2) = is_in_aa is_out_aa(x1, x2) = is_out_aa AREA_IN_GA(x1, x2) = AREA_IN_GA(x1) U1_GA(x1, x2, x3, x4, x5, x6, x7) = U1_GA(x7) U2_GA(x1, x2, x3, x4, x5, x6, x7) = U2_GA(x7) IS_IN_AA(x1, x2) = IS_IN_AA We have to consider all (P,R,Pi)-chains ---------------------------------------- (9) DependencyGraphProof (EQUIVALENT) The approximation of the Dependency Graph [LOPSTR] contains 1 SCC with 3 less nodes. ---------------------------------------- (10) Obligation: Pi DP problem: The TRS P consists of the following rules: AREA_IN_GA(.(','(X1, Y1), .(','(X2, Y2), XYs)), Area) -> AREA_IN_GA(.(','(X2, Y2), XYs), Area1) The TRS R consists of the following rules: area_in_ga(.(X3, []), zero) -> area_out_ga(.(X3, []), zero) area_in_ga(.(','(X1, Y1), .(','(X2, Y2), XYs)), Area) -> U1_ga(X1, Y1, X2, Y2, XYs, Area, area_in_ga(.(','(X2, Y2), XYs), Area1)) U1_ga(X1, Y1, X2, Y2, XYs, Area, area_out_ga(.(','(X2, Y2), XYs), Area1)) -> U2_ga(X1, Y1, X2, Y2, XYs, Area, is_in_aa(Area, +(/(-(*(X1, Y2), *(Y1, X2)), succ(succ(zero))), Area1))) is_in_aa(X0, X1) -> is_out_aa(X0, X1) U2_ga(X1, Y1, X2, Y2, XYs, Area, is_out_aa(Area, +(/(-(*(X1, Y2), *(Y1, X2)), succ(succ(zero))), Area1))) -> area_out_ga(.(','(X1, Y1), .(','(X2, Y2), XYs)), Area) The argument filtering Pi contains the following mapping: area_in_ga(x1, x2) = area_in_ga(x1) .(x1, x2) = .(x1, x2) [] = [] area_out_ga(x1, x2) = area_out_ga ','(x1, x2) = ','(x1, x2) U1_ga(x1, x2, x3, x4, x5, x6, x7) = U1_ga(x7) U2_ga(x1, x2, x3, x4, x5, x6, x7) = U2_ga(x7) +(x1, x2) = +(x1, x2) /(x1, x2) = /(x1, x2) -(x1, x2) = -(x1, x2) *(x1, x2) = *(x1, x2) succ(x1) = succ(x1) zero = zero is_in_aa(x1, x2) = is_in_aa is_out_aa(x1, x2) = is_out_aa AREA_IN_GA(x1, x2) = AREA_IN_GA(x1) We have to consider all (P,R,Pi)-chains ---------------------------------------- (11) UsableRulesProof (EQUIVALENT) For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R. ---------------------------------------- (12) Obligation: Pi DP problem: The TRS P consists of the following rules: AREA_IN_GA(.(','(X1, Y1), .(','(X2, Y2), XYs)), Area) -> AREA_IN_GA(.(','(X2, Y2), XYs), Area1) R is empty. The argument filtering Pi contains the following mapping: .(x1, x2) = .(x1, x2) ','(x1, x2) = ','(x1, x2) AREA_IN_GA(x1, x2) = AREA_IN_GA(x1) We have to consider all (P,R,Pi)-chains ---------------------------------------- (13) PiDPToQDPProof (SOUND) Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi. ---------------------------------------- (14) Obligation: Q DP problem: The TRS P consists of the following rules: AREA_IN_GA(.(','(X1, Y1), .(','(X2, Y2), XYs))) -> AREA_IN_GA(.(','(X2, Y2), XYs)) R is empty. Q is empty. We have to consider all (P,Q,R)-chains. ---------------------------------------- (15) QDPSizeChangeProof (EQUIVALENT) By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem. From the DPs we obtained the following set of size-change graphs: *AREA_IN_GA(.(','(X1, Y1), .(','(X2, Y2), XYs))) -> AREA_IN_GA(.(','(X2, Y2), XYs)) The graph contains the following edges 1 > 1 ---------------------------------------- (16) YES