We consider termination of the LCTRS with only rule scheme Calc: Signature: condLoop :: Bool -> Int -> Int -> Int -> Int condMod :: Bool -> Int -> Int -> Int -> Int halfExp :: Int -> Int -> Int -> Int pow :: Int -> Int -> Int sqBase :: Int -> Int -> Int -> Int Rules: pow(b, e) -> condLoop(e > 0, b, e, 1) condLoop(false, b, e, r) -> r condLoop(true, b, e, r) -> condMod(e % 2 = 1, b, e, r) condMod(false, b, e, r) -> sqBase(b, e, r) condMod(true, b, e, r) -> sqBase(b, e, r * b) sqBase(b, e, r) -> halfExp(b * b, e, r) halfExp(b, e, r) -> condLoop(e > 0, b, e / 2, r) The system is accessible function passing by a sort ordering that equates all sorts. We start by computing the initial DP problem D1 = (P1, R, f, c), where: P1. (1) pow#(b, e) => condLoop#(e > 0, b, e, 1) (2) condLoop#(true, b, e, r) => condMod#(e % 2 = 1, b, e, r) (3) condMod#(false, b, e, r) => sqBase#(b, e, r) (4) condMod#(true, b, e, r) => sqBase#(b, e, r * b) (5) sqBase#(b, e, r) => halfExp#(b * b, e, r) (6) halfExp#(b, e, r) => condLoop#(e > 0, b, e / 2, r) ***** We apply the Graph Processor on D1 = (P1, R, f, c). We compute a graph approximation with the following edges: 1: 2 2: 3 4 3: 5 4: 5 5: 6 6: 2 There is only one SCC, so all DPs not inside the SCC can be removed. Processor output: { D2 = (P2, R, f, c) }, where: P2. (1) condLoop#(true, b, e, r) => condMod#(e % 2 = 1, b, e, r) (2) condMod#(false, b, e, r) => sqBase#(b, e, r) (3) condMod#(true, b, e, r) => sqBase#(b, e, r * b) (4) sqBase#(b, e, r) => halfExp#(b * b, e, r) (5) halfExp#(b, e, r) => condLoop#(e > 0, b, e / 2, r) ***** We apply the Theory Arguments Processor on D2 = (P2, R, f, c). We use the following theory arguments function: condLoop# : [1, 2, 3, 4] condMod# : [1, 2, 3, 4] halfExp# : [1, 2, 3] sqBase# : [1, 2, 3] Processor output: { D3 = (P3, R, f, c) ; D4 = (P4, R, f, c) }, where: P3. (1) condLoop#(true, b, e, r) => condMod#(e % 2 = 1, b, e, r) (2) condMod#(false, b, e, r) => sqBase#(b, e, r) { b, e, r } (3) condMod#(true, b, e, r) => sqBase#(b, e, r * b) { b, e, r } (4) sqBase#(b, e, r) => halfExp#(b * b, e, r) { b, e, r } (5) halfExp#(b, e, r) => condLoop#(e > 0, b, e / 2, r) { b, e, r } P4. (1) condMod#(false, b, e, r) => sqBase#(b, e, r) (2) condMod#(true, b, e, r) => sqBase#(b, e, r * b) (3) sqBase#(b, e, r) => halfExp#(b * b, e, r) (4) halfExp#(b, e, r) => condLoop#(e > 0, b, e / 2, r) ***** We apply the Theory Arguments Processor on D3 = (P3, R, f, c). We use the following theory arguments function: condLoop# : [1, 2, 3, 4] condMod# : [1, 2, 3, 4] halfExp# : [1, 2, 3] sqBase# : [1, 2, 3] Processor output: { D5 = (P5, R, f, c) ; D6 = (P6, R, f, c) }, where: P5. (1) condLoop#(true, b, e, r) => condMod#(e % 2 = 1, b, e, r) { b, e, r } (2) condMod#(false, b, e, r) => sqBase#(b, e, r) { b, e, r } (3) condMod#(true, b, e, r) => sqBase#(b, e, r * b) { b, e, r } (4) sqBase#(b, e, r) => halfExp#(b * b, e, r) { b, e, r } (5) halfExp#(b, e, r) => condLoop#(e > 0, b, e / 2, r) { b, e, r } P6. (1) condLoop#(true, b, e, r) => condMod#(e % 2 = 1, b, e, r) ***** We apply the Graph Processor on D4 = (P4, R, f, c). We compute a graph approximation with the following edges: 1: 3 2: 3 3: 4 4: As there are no SCCs, this DP problem is removed. Processor output: { }. ***** No progress could be made on DP problem D5 = (P5, R, f, c).