0 Prolog
↳1 PrologToPiTRSProof (⇐)
↳2 PiTRS
↳3 DependencyPairsProof (⇔)
↳4 PiDP
↳5 DependencyGraphProof (⇔)
↳6 AND
↳7 PiDP
↳8 UsableRulesProof (⇔)
↳9 PiDP
↳10 PiDPToQDPProof (⇔)
↳11 QDP
↳12 QDPSizeChangeProof (⇔)
↳13 TRUE
↳14 PiDP
↳15 UsableRulesProof (⇔)
↳16 PiDP
↳17 PiDPToQDPProof (⇐)
↳18 QDP
↳19 QDPSizeChangeProof (⇔)
↳20 TRUE
↳21 PiDP
↳22 UsableRulesProof (⇔)
↳23 PiDP
↳24 PiDPToQDPProof (⇐)
↳25 QDP
↳26 QDPSizeChangeProof (⇔)
↳27 TRUE
↳28 PiDP
↳29 UsableRulesProof (⇔)
↳30 PiDP
↳31 PiDPToQDPProof (⇐)
↳32 QDP
↳33 NonTerminationProof (⇔)
↳34 FALSE
↳35 PiDP
↳36 UsableRulesProof (⇔)
↳37 PiDP
↳38 PiDPToQDPProof (⇐)
↳39 QDP
↳40 NonTerminationProof (⇔)
↳41 FALSE
↳42 PiDP
↳43 UsableRulesProof (⇔)
↳44 PiDP
↳45 PiDPToQDPProof (⇐)
↳46 QDP
↳47 NonTerminationProof (⇔)
↳48 FALSE
↳49 PiDP
↳50 UsableRulesProof (⇔)
↳51 PiDP
↳52 PiDPToQDPProof (⇐)
↳53 QDP
↳54 NonTerminationProof (⇔)
↳55 FALSE
↳56 PiDP
↳57 UsableRulesProof (⇔)
↳58 PiDP
↳59 PiDPToQDPProof (⇐)
↳60 QDP
↳61 QDPSizeChangeProof (⇔)
↳62 TRUE
↳63 PrologToPiTRSProof (⇐)
↳64 PiTRS
↳65 DependencyPairsProof (⇔)
↳66 PiDP
↳67 DependencyGraphProof (⇔)
↳68 AND
↳69 PiDP
↳70 UsableRulesProof (⇔)
↳71 PiDP
↳72 PiDPToQDPProof (⇔)
↳73 QDP
↳74 QDPSizeChangeProof (⇔)
↳75 TRUE
↳76 PiDP
↳77 UsableRulesProof (⇔)
↳78 PiDP
↳79 PiDPToQDPProof (⇐)
↳80 QDP
↳81 QDPSizeChangeProof (⇔)
↳82 TRUE
↳83 PiDP
↳84 UsableRulesProof (⇔)
↳85 PiDP
↳86 PiDPToQDPProof (⇐)
↳87 QDP
↳88 QDPSizeChangeProof (⇔)
↳89 TRUE
↳90 PiDP
↳91 UsableRulesProof (⇔)
↳92 PiDP
↳93 PiDPToQDPProof (⇐)
↳94 QDP
↳95 NonTerminationProof (⇔)
↳96 FALSE
↳97 PiDP
↳98 UsableRulesProof (⇔)
↳99 PiDP
↳100 PiDPToQDPProof (⇐)
↳101 QDP
↳102 NonTerminationProof (⇔)
↳103 FALSE
↳104 PiDP
↳105 UsableRulesProof (⇔)
↳106 PiDP
↳107 PiDPToQDPProof (⇐)
↳108 QDP
↳109 NonTerminationProof (⇔)
↳110 FALSE
↳111 PiDP
↳112 UsableRulesProof (⇔)
↳113 PiDP
↳114 PiDPToQDPProof (⇐)
↳115 QDP
↳116 NonTerminationProof (⇔)
↳117 FALSE
↳118 PiDP
↳119 UsableRulesProof (⇔)
↳120 PiDP
↳121 PiDPToQDPProof (⇐)
↳122 QDP
↳123 QDPSizeChangeProof (⇔)
↳124 TRUE
times_in_aag(one(b), X, X) → times_out_aag(one(b), X, X)
times_in_aag(zero(R), S, zero(RS)) → U35_aag(R, S, RS, times_in_aag(R, S, RS))
times_in_aag(one(R), S, RSS) → U36_aag(R, S, RSS, times_in_aaa(R, S, RS))
times_in_aaa(one(b), X, X) → times_out_aaa(one(b), X, X)
times_in_aaa(zero(R), S, zero(RS)) → U35_aaa(R, S, RS, times_in_aaa(R, S, RS))
times_in_aaa(one(R), S, RSS) → U36_aaa(R, S, RSS, times_in_aaa(R, S, RS))
U36_aaa(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aaa(R, S, RSS, add_in_aaa(S, zero(RS), RSS))
add_in_aaa(b, b, b) → add_out_aaa(b, b, b)
add_in_aaa(X, b, X) → U1_aaa(X, binaryZ_in_a(X))
binaryZ_in_a(zero(X)) → U29_a(X, binaryZ_in_a(X))
binaryZ_in_a(one(X)) → U30_a(X, binary_in_a(X))
binary_in_a(b) → binary_out_a(b)
binary_in_a(zero(X)) → U27_a(X, binaryZ_in_a(X))
U27_a(X, binaryZ_out_a(X)) → binary_out_a(zero(X))
binary_in_a(one(X)) → U28_a(X, binary_in_a(X))
U28_a(X, binary_out_a(X)) → binary_out_a(one(X))
U30_a(X, binary_out_a(X)) → binaryZ_out_a(one(X))
U29_a(X, binaryZ_out_a(X)) → binaryZ_out_a(zero(X))
U1_aaa(X, binaryZ_out_a(X)) → add_out_aaa(X, b, X)
add_in_aaa(b, Y, Y) → U2_aaa(Y, binaryZ_in_a(Y))
U2_aaa(Y, binaryZ_out_a(Y)) → add_out_aaa(b, Y, Y)
add_in_aaa(X, Y, Z) → U3_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), zero(Y), zero(Z)) → U10_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), one(Y), one(Z)) → U11_aaa(X, Y, Z, addx_in_aaa(X, Y, Z))
addx_in_aaa(one(X), b, one(X)) → U4_aaa(X, binary_in_a(X))
U4_aaa(X, binary_out_a(X)) → addx_out_aaa(one(X), b, one(X))
addx_in_aaa(zero(X), b, zero(X)) → U5_aaa(X, binaryZ_in_a(X))
U5_aaa(X, binaryZ_out_a(X)) → addx_out_aaa(zero(X), b, zero(X))
addx_in_aaa(X, Y, Z) → U6_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), zero(Y), one(Z)) → U12_aaa(X, Y, Z, addy_in_aaa(X, Y, Z))
addy_in_aaa(b, one(Y), one(Y)) → U7_aaa(Y, binary_in_a(Y))
U7_aaa(Y, binary_out_a(Y)) → addy_out_aaa(b, one(Y), one(Y))
addy_in_aaa(b, zero(Y), zero(Y)) → U8_aaa(Y, binaryZ_in_a(Y))
U8_aaa(Y, binaryZ_out_a(Y)) → addy_out_aaa(b, zero(Y), zero(Y))
addy_in_aaa(X, Y, Z) → U9_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), one(Y), zero(Z)) → U13_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
addc_in_aaa(b, b, one(b)) → addc_out_aaa(b, b, one(b))
addc_in_aaa(X, b, Z) → U14_aaa(X, Z, succZ_in_aa(X, Z))
succZ_in_aa(zero(X), one(X)) → U33_aa(X, binaryZ_in_a(X))
U33_aa(X, binaryZ_out_a(X)) → succZ_out_aa(zero(X), one(X))
succZ_in_aa(one(X), zero(Z)) → U34_aa(X, Z, succ_in_aa(X, Z))
succ_in_aa(b, one(b)) → succ_out_aa(b, one(b))
succ_in_aa(zero(X), one(X)) → U31_aa(X, binaryZ_in_a(X))
U31_aa(X, binaryZ_out_a(X)) → succ_out_aa(zero(X), one(X))
succ_in_aa(one(X), zero(Z)) → U32_aa(X, Z, succ_in_aa(X, Z))
U32_aa(X, Z, succ_out_aa(X, Z)) → succ_out_aa(one(X), zero(Z))
U34_aa(X, Z, succ_out_aa(X, Z)) → succZ_out_aa(one(X), zero(Z))
U14_aaa(X, Z, succZ_out_aa(X, Z)) → addc_out_aaa(X, b, Z)
addc_in_aaa(b, Y, Z) → U15_aaa(Y, Z, succZ_in_aa(Y, Z))
U15_aaa(Y, Z, succZ_out_aa(Y, Z)) → addc_out_aaa(b, Y, Z)
addc_in_aaa(X, Y, Z) → U16_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(zero(X), zero(Y), one(Z)) → U23_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
U23_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), zero(Y), one(Z))
addC_in_aaa(zero(X), one(Y), zero(Z)) → U24_aaa(X, Y, Z, addX_in_aaa(X, Y, Z))
addX_in_aaa(zero(X), b, one(X)) → U17_aaa(X, binaryZ_in_a(X))
U17_aaa(X, binaryZ_out_a(X)) → addX_out_aaa(zero(X), b, one(X))
addX_in_aaa(one(X), b, zero(Z)) → U18_aaa(X, Z, succ_in_aa(X, Z))
U18_aaa(X, Z, succ_out_aa(X, Z)) → addX_out_aaa(one(X), b, zero(Z))
addX_in_aaa(X, Y, Z) → U19_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), zero(Y), zero(Z)) → U25_aaa(X, Y, Z, addY_in_aaa(X, Y, Z))
addY_in_aaa(b, zero(Y), one(Y)) → U20_aaa(Y, binaryZ_in_a(Y))
U20_aaa(Y, binaryZ_out_a(Y)) → addY_out_aaa(b, zero(Y), one(Y))
addY_in_aaa(b, one(Y), zero(Z)) → U21_aaa(Y, Z, succ_in_aa(Y, Z))
U21_aaa(Y, Z, succ_out_aa(Y, Z)) → addY_out_aaa(b, one(Y), zero(Z))
addY_in_aaa(X, Y, Z) → U22_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), one(Y), one(Z)) → U26_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
U26_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), one(Y), one(Z))
U22_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addY_out_aaa(X, Y, Z)
U25_aaa(X, Y, Z, addY_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), zero(Y), zero(Z))
U19_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addX_out_aaa(X, Y, Z)
U24_aaa(X, Y, Z, addX_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), one(Y), zero(Z))
U16_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addc_out_aaa(X, Y, Z)
U13_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), one(Y), zero(Z))
U9_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addy_out_aaa(X, Y, Z)
U12_aaa(X, Y, Z, addy_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), zero(Y), one(Z))
U6_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addx_out_aaa(X, Y, Z)
U11_aaa(X, Y, Z, addx_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), one(Y), one(Z))
U10_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), zero(Y), zero(Z))
U3_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → add_out_aaa(X, Y, Z)
U37_aaa(R, S, RSS, add_out_aaa(S, zero(RS), RSS)) → times_out_aaa(one(R), S, RSS)
U35_aaa(R, S, RS, times_out_aaa(R, S, RS)) → times_out_aaa(zero(R), S, zero(RS))
U36_aag(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aag(R, S, RSS, add_in_aag(S, zero(RS), RSS))
add_in_aag(b, b, b) → add_out_aag(b, b, b)
add_in_aag(X, b, X) → U1_aag(X, binaryZ_in_g(X))
binaryZ_in_g(zero(X)) → U29_g(X, binaryZ_in_g(X))
binaryZ_in_g(one(X)) → U30_g(X, binary_in_g(X))
binary_in_g(b) → binary_out_g(b)
binary_in_g(zero(X)) → U27_g(X, binaryZ_in_g(X))
U27_g(X, binaryZ_out_g(X)) → binary_out_g(zero(X))
binary_in_g(one(X)) → U28_g(X, binary_in_g(X))
U28_g(X, binary_out_g(X)) → binary_out_g(one(X))
U30_g(X, binary_out_g(X)) → binaryZ_out_g(one(X))
U29_g(X, binaryZ_out_g(X)) → binaryZ_out_g(zero(X))
U1_aag(X, binaryZ_out_g(X)) → add_out_aag(X, b, X)
add_in_aag(b, Y, Y) → U2_aag(Y, binaryZ_in_g(Y))
U2_aag(Y, binaryZ_out_g(Y)) → add_out_aag(b, Y, Y)
add_in_aag(X, Y, Z) → U3_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), zero(Y), zero(Z)) → U10_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), one(Y), one(Z)) → U11_aag(X, Y, Z, addx_in_aag(X, Y, Z))
addx_in_aag(one(X), b, one(X)) → U4_aag(X, binary_in_g(X))
U4_aag(X, binary_out_g(X)) → addx_out_aag(one(X), b, one(X))
addx_in_aag(zero(X), b, zero(X)) → U5_aag(X, binaryZ_in_g(X))
U5_aag(X, binaryZ_out_g(X)) → addx_out_aag(zero(X), b, zero(X))
addx_in_aag(X, Y, Z) → U6_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), zero(Y), one(Z)) → U12_aag(X, Y, Z, addy_in_aag(X, Y, Z))
addy_in_aag(b, one(Y), one(Y)) → U7_aag(Y, binary_in_g(Y))
U7_aag(Y, binary_out_g(Y)) → addy_out_aag(b, one(Y), one(Y))
addy_in_aag(b, zero(Y), zero(Y)) → U8_aag(Y, binaryZ_in_g(Y))
U8_aag(Y, binaryZ_out_g(Y)) → addy_out_aag(b, zero(Y), zero(Y))
addy_in_aag(X, Y, Z) → U9_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), one(Y), zero(Z)) → U13_aag(X, Y, Z, addc_in_aag(X, Y, Z))
addc_in_aag(b, b, one(b)) → addc_out_aag(b, b, one(b))
addc_in_aag(X, b, Z) → U14_aag(X, Z, succZ_in_ag(X, Z))
succZ_in_ag(zero(X), one(X)) → U33_ag(X, binaryZ_in_g(X))
U33_ag(X, binaryZ_out_g(X)) → succZ_out_ag(zero(X), one(X))
succZ_in_ag(one(X), zero(Z)) → U34_ag(X, Z, succ_in_ag(X, Z))
succ_in_ag(b, one(b)) → succ_out_ag(b, one(b))
succ_in_ag(zero(X), one(X)) → U31_ag(X, binaryZ_in_g(X))
U31_ag(X, binaryZ_out_g(X)) → succ_out_ag(zero(X), one(X))
succ_in_ag(one(X), zero(Z)) → U32_ag(X, Z, succ_in_ag(X, Z))
U32_ag(X, Z, succ_out_ag(X, Z)) → succ_out_ag(one(X), zero(Z))
U34_ag(X, Z, succ_out_ag(X, Z)) → succZ_out_ag(one(X), zero(Z))
U14_aag(X, Z, succZ_out_ag(X, Z)) → addc_out_aag(X, b, Z)
addc_in_aag(b, Y, Z) → U15_aag(Y, Z, succZ_in_ag(Y, Z))
U15_aag(Y, Z, succZ_out_ag(Y, Z)) → addc_out_aag(b, Y, Z)
addc_in_aag(X, Y, Z) → U16_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(zero(X), zero(Y), one(Z)) → U23_aag(X, Y, Z, addz_in_aag(X, Y, Z))
U23_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addC_out_aag(zero(X), zero(Y), one(Z))
addC_in_aag(zero(X), one(Y), zero(Z)) → U24_aag(X, Y, Z, addX_in_aag(X, Y, Z))
addX_in_aag(zero(X), b, one(X)) → U17_aag(X, binaryZ_in_g(X))
U17_aag(X, binaryZ_out_g(X)) → addX_out_aag(zero(X), b, one(X))
addX_in_aag(one(X), b, zero(Z)) → U18_aag(X, Z, succ_in_ag(X, Z))
U18_aag(X, Z, succ_out_ag(X, Z)) → addX_out_aag(one(X), b, zero(Z))
addX_in_aag(X, Y, Z) → U19_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), zero(Y), zero(Z)) → U25_aag(X, Y, Z, addY_in_aag(X, Y, Z))
addY_in_aag(b, zero(Y), one(Y)) → U20_aag(Y, binaryZ_in_g(Y))
U20_aag(Y, binaryZ_out_g(Y)) → addY_out_aag(b, zero(Y), one(Y))
addY_in_aag(b, one(Y), zero(Z)) → U21_aag(Y, Z, succ_in_ag(Y, Z))
U21_aag(Y, Z, succ_out_ag(Y, Z)) → addY_out_aag(b, one(Y), zero(Z))
addY_in_aag(X, Y, Z) → U22_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), one(Y), one(Z)) → U26_aag(X, Y, Z, addc_in_aag(X, Y, Z))
U26_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addC_out_aag(one(X), one(Y), one(Z))
U22_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addY_out_aag(X, Y, Z)
U25_aag(X, Y, Z, addY_out_aag(X, Y, Z)) → addC_out_aag(one(X), zero(Y), zero(Z))
U19_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addX_out_aag(X, Y, Z)
U24_aag(X, Y, Z, addX_out_aag(X, Y, Z)) → addC_out_aag(zero(X), one(Y), zero(Z))
U16_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addc_out_aag(X, Y, Z)
U13_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addz_out_aag(one(X), one(Y), zero(Z))
U9_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addy_out_aag(X, Y, Z)
U12_aag(X, Y, Z, addy_out_aag(X, Y, Z)) → addz_out_aag(one(X), zero(Y), one(Z))
U6_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addx_out_aag(X, Y, Z)
U11_aag(X, Y, Z, addx_out_aag(X, Y, Z)) → addz_out_aag(zero(X), one(Y), one(Z))
U10_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addz_out_aag(zero(X), zero(Y), zero(Z))
U3_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → add_out_aag(X, Y, Z)
U37_aag(R, S, RSS, add_out_aag(S, zero(RS), RSS)) → times_out_aag(one(R), S, RSS)
U35_aag(R, S, RS, times_out_aag(R, S, RS)) → times_out_aag(zero(R), S, zero(RS))
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
times_in_aag(one(b), X, X) → times_out_aag(one(b), X, X)
times_in_aag(zero(R), S, zero(RS)) → U35_aag(R, S, RS, times_in_aag(R, S, RS))
times_in_aag(one(R), S, RSS) → U36_aag(R, S, RSS, times_in_aaa(R, S, RS))
times_in_aaa(one(b), X, X) → times_out_aaa(one(b), X, X)
times_in_aaa(zero(R), S, zero(RS)) → U35_aaa(R, S, RS, times_in_aaa(R, S, RS))
times_in_aaa(one(R), S, RSS) → U36_aaa(R, S, RSS, times_in_aaa(R, S, RS))
U36_aaa(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aaa(R, S, RSS, add_in_aaa(S, zero(RS), RSS))
add_in_aaa(b, b, b) → add_out_aaa(b, b, b)
add_in_aaa(X, b, X) → U1_aaa(X, binaryZ_in_a(X))
binaryZ_in_a(zero(X)) → U29_a(X, binaryZ_in_a(X))
binaryZ_in_a(one(X)) → U30_a(X, binary_in_a(X))
binary_in_a(b) → binary_out_a(b)
binary_in_a(zero(X)) → U27_a(X, binaryZ_in_a(X))
U27_a(X, binaryZ_out_a(X)) → binary_out_a(zero(X))
binary_in_a(one(X)) → U28_a(X, binary_in_a(X))
U28_a(X, binary_out_a(X)) → binary_out_a(one(X))
U30_a(X, binary_out_a(X)) → binaryZ_out_a(one(X))
U29_a(X, binaryZ_out_a(X)) → binaryZ_out_a(zero(X))
U1_aaa(X, binaryZ_out_a(X)) → add_out_aaa(X, b, X)
add_in_aaa(b, Y, Y) → U2_aaa(Y, binaryZ_in_a(Y))
U2_aaa(Y, binaryZ_out_a(Y)) → add_out_aaa(b, Y, Y)
add_in_aaa(X, Y, Z) → U3_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), zero(Y), zero(Z)) → U10_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), one(Y), one(Z)) → U11_aaa(X, Y, Z, addx_in_aaa(X, Y, Z))
addx_in_aaa(one(X), b, one(X)) → U4_aaa(X, binary_in_a(X))
U4_aaa(X, binary_out_a(X)) → addx_out_aaa(one(X), b, one(X))
addx_in_aaa(zero(X), b, zero(X)) → U5_aaa(X, binaryZ_in_a(X))
U5_aaa(X, binaryZ_out_a(X)) → addx_out_aaa(zero(X), b, zero(X))
addx_in_aaa(X, Y, Z) → U6_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), zero(Y), one(Z)) → U12_aaa(X, Y, Z, addy_in_aaa(X, Y, Z))
addy_in_aaa(b, one(Y), one(Y)) → U7_aaa(Y, binary_in_a(Y))
U7_aaa(Y, binary_out_a(Y)) → addy_out_aaa(b, one(Y), one(Y))
addy_in_aaa(b, zero(Y), zero(Y)) → U8_aaa(Y, binaryZ_in_a(Y))
U8_aaa(Y, binaryZ_out_a(Y)) → addy_out_aaa(b, zero(Y), zero(Y))
addy_in_aaa(X, Y, Z) → U9_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), one(Y), zero(Z)) → U13_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
addc_in_aaa(b, b, one(b)) → addc_out_aaa(b, b, one(b))
addc_in_aaa(X, b, Z) → U14_aaa(X, Z, succZ_in_aa(X, Z))
succZ_in_aa(zero(X), one(X)) → U33_aa(X, binaryZ_in_a(X))
U33_aa(X, binaryZ_out_a(X)) → succZ_out_aa(zero(X), one(X))
succZ_in_aa(one(X), zero(Z)) → U34_aa(X, Z, succ_in_aa(X, Z))
succ_in_aa(b, one(b)) → succ_out_aa(b, one(b))
succ_in_aa(zero(X), one(X)) → U31_aa(X, binaryZ_in_a(X))
U31_aa(X, binaryZ_out_a(X)) → succ_out_aa(zero(X), one(X))
succ_in_aa(one(X), zero(Z)) → U32_aa(X, Z, succ_in_aa(X, Z))
U32_aa(X, Z, succ_out_aa(X, Z)) → succ_out_aa(one(X), zero(Z))
U34_aa(X, Z, succ_out_aa(X, Z)) → succZ_out_aa(one(X), zero(Z))
U14_aaa(X, Z, succZ_out_aa(X, Z)) → addc_out_aaa(X, b, Z)
addc_in_aaa(b, Y, Z) → U15_aaa(Y, Z, succZ_in_aa(Y, Z))
U15_aaa(Y, Z, succZ_out_aa(Y, Z)) → addc_out_aaa(b, Y, Z)
addc_in_aaa(X, Y, Z) → U16_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(zero(X), zero(Y), one(Z)) → U23_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
U23_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), zero(Y), one(Z))
addC_in_aaa(zero(X), one(Y), zero(Z)) → U24_aaa(X, Y, Z, addX_in_aaa(X, Y, Z))
addX_in_aaa(zero(X), b, one(X)) → U17_aaa(X, binaryZ_in_a(X))
U17_aaa(X, binaryZ_out_a(X)) → addX_out_aaa(zero(X), b, one(X))
addX_in_aaa(one(X), b, zero(Z)) → U18_aaa(X, Z, succ_in_aa(X, Z))
U18_aaa(X, Z, succ_out_aa(X, Z)) → addX_out_aaa(one(X), b, zero(Z))
addX_in_aaa(X, Y, Z) → U19_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), zero(Y), zero(Z)) → U25_aaa(X, Y, Z, addY_in_aaa(X, Y, Z))
addY_in_aaa(b, zero(Y), one(Y)) → U20_aaa(Y, binaryZ_in_a(Y))
U20_aaa(Y, binaryZ_out_a(Y)) → addY_out_aaa(b, zero(Y), one(Y))
addY_in_aaa(b, one(Y), zero(Z)) → U21_aaa(Y, Z, succ_in_aa(Y, Z))
U21_aaa(Y, Z, succ_out_aa(Y, Z)) → addY_out_aaa(b, one(Y), zero(Z))
addY_in_aaa(X, Y, Z) → U22_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), one(Y), one(Z)) → U26_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
U26_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), one(Y), one(Z))
U22_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addY_out_aaa(X, Y, Z)
U25_aaa(X, Y, Z, addY_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), zero(Y), zero(Z))
U19_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addX_out_aaa(X, Y, Z)
U24_aaa(X, Y, Z, addX_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), one(Y), zero(Z))
U16_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addc_out_aaa(X, Y, Z)
U13_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), one(Y), zero(Z))
U9_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addy_out_aaa(X, Y, Z)
U12_aaa(X, Y, Z, addy_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), zero(Y), one(Z))
U6_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addx_out_aaa(X, Y, Z)
U11_aaa(X, Y, Z, addx_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), one(Y), one(Z))
U10_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), zero(Y), zero(Z))
U3_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → add_out_aaa(X, Y, Z)
U37_aaa(R, S, RSS, add_out_aaa(S, zero(RS), RSS)) → times_out_aaa(one(R), S, RSS)
U35_aaa(R, S, RS, times_out_aaa(R, S, RS)) → times_out_aaa(zero(R), S, zero(RS))
U36_aag(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aag(R, S, RSS, add_in_aag(S, zero(RS), RSS))
add_in_aag(b, b, b) → add_out_aag(b, b, b)
add_in_aag(X, b, X) → U1_aag(X, binaryZ_in_g(X))
binaryZ_in_g(zero(X)) → U29_g(X, binaryZ_in_g(X))
binaryZ_in_g(one(X)) → U30_g(X, binary_in_g(X))
binary_in_g(b) → binary_out_g(b)
binary_in_g(zero(X)) → U27_g(X, binaryZ_in_g(X))
U27_g(X, binaryZ_out_g(X)) → binary_out_g(zero(X))
binary_in_g(one(X)) → U28_g(X, binary_in_g(X))
U28_g(X, binary_out_g(X)) → binary_out_g(one(X))
U30_g(X, binary_out_g(X)) → binaryZ_out_g(one(X))
U29_g(X, binaryZ_out_g(X)) → binaryZ_out_g(zero(X))
U1_aag(X, binaryZ_out_g(X)) → add_out_aag(X, b, X)
add_in_aag(b, Y, Y) → U2_aag(Y, binaryZ_in_g(Y))
U2_aag(Y, binaryZ_out_g(Y)) → add_out_aag(b, Y, Y)
add_in_aag(X, Y, Z) → U3_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), zero(Y), zero(Z)) → U10_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), one(Y), one(Z)) → U11_aag(X, Y, Z, addx_in_aag(X, Y, Z))
addx_in_aag(one(X), b, one(X)) → U4_aag(X, binary_in_g(X))
U4_aag(X, binary_out_g(X)) → addx_out_aag(one(X), b, one(X))
addx_in_aag(zero(X), b, zero(X)) → U5_aag(X, binaryZ_in_g(X))
U5_aag(X, binaryZ_out_g(X)) → addx_out_aag(zero(X), b, zero(X))
addx_in_aag(X, Y, Z) → U6_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), zero(Y), one(Z)) → U12_aag(X, Y, Z, addy_in_aag(X, Y, Z))
addy_in_aag(b, one(Y), one(Y)) → U7_aag(Y, binary_in_g(Y))
U7_aag(Y, binary_out_g(Y)) → addy_out_aag(b, one(Y), one(Y))
addy_in_aag(b, zero(Y), zero(Y)) → U8_aag(Y, binaryZ_in_g(Y))
U8_aag(Y, binaryZ_out_g(Y)) → addy_out_aag(b, zero(Y), zero(Y))
addy_in_aag(X, Y, Z) → U9_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), one(Y), zero(Z)) → U13_aag(X, Y, Z, addc_in_aag(X, Y, Z))
addc_in_aag(b, b, one(b)) → addc_out_aag(b, b, one(b))
addc_in_aag(X, b, Z) → U14_aag(X, Z, succZ_in_ag(X, Z))
succZ_in_ag(zero(X), one(X)) → U33_ag(X, binaryZ_in_g(X))
U33_ag(X, binaryZ_out_g(X)) → succZ_out_ag(zero(X), one(X))
succZ_in_ag(one(X), zero(Z)) → U34_ag(X, Z, succ_in_ag(X, Z))
succ_in_ag(b, one(b)) → succ_out_ag(b, one(b))
succ_in_ag(zero(X), one(X)) → U31_ag(X, binaryZ_in_g(X))
U31_ag(X, binaryZ_out_g(X)) → succ_out_ag(zero(X), one(X))
succ_in_ag(one(X), zero(Z)) → U32_ag(X, Z, succ_in_ag(X, Z))
U32_ag(X, Z, succ_out_ag(X, Z)) → succ_out_ag(one(X), zero(Z))
U34_ag(X, Z, succ_out_ag(X, Z)) → succZ_out_ag(one(X), zero(Z))
U14_aag(X, Z, succZ_out_ag(X, Z)) → addc_out_aag(X, b, Z)
addc_in_aag(b, Y, Z) → U15_aag(Y, Z, succZ_in_ag(Y, Z))
U15_aag(Y, Z, succZ_out_ag(Y, Z)) → addc_out_aag(b, Y, Z)
addc_in_aag(X, Y, Z) → U16_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(zero(X), zero(Y), one(Z)) → U23_aag(X, Y, Z, addz_in_aag(X, Y, Z))
U23_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addC_out_aag(zero(X), zero(Y), one(Z))
addC_in_aag(zero(X), one(Y), zero(Z)) → U24_aag(X, Y, Z, addX_in_aag(X, Y, Z))
addX_in_aag(zero(X), b, one(X)) → U17_aag(X, binaryZ_in_g(X))
U17_aag(X, binaryZ_out_g(X)) → addX_out_aag(zero(X), b, one(X))
addX_in_aag(one(X), b, zero(Z)) → U18_aag(X, Z, succ_in_ag(X, Z))
U18_aag(X, Z, succ_out_ag(X, Z)) → addX_out_aag(one(X), b, zero(Z))
addX_in_aag(X, Y, Z) → U19_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), zero(Y), zero(Z)) → U25_aag(X, Y, Z, addY_in_aag(X, Y, Z))
addY_in_aag(b, zero(Y), one(Y)) → U20_aag(Y, binaryZ_in_g(Y))
U20_aag(Y, binaryZ_out_g(Y)) → addY_out_aag(b, zero(Y), one(Y))
addY_in_aag(b, one(Y), zero(Z)) → U21_aag(Y, Z, succ_in_ag(Y, Z))
U21_aag(Y, Z, succ_out_ag(Y, Z)) → addY_out_aag(b, one(Y), zero(Z))
addY_in_aag(X, Y, Z) → U22_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), one(Y), one(Z)) → U26_aag(X, Y, Z, addc_in_aag(X, Y, Z))
U26_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addC_out_aag(one(X), one(Y), one(Z))
U22_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addY_out_aag(X, Y, Z)
U25_aag(X, Y, Z, addY_out_aag(X, Y, Z)) → addC_out_aag(one(X), zero(Y), zero(Z))
U19_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addX_out_aag(X, Y, Z)
U24_aag(X, Y, Z, addX_out_aag(X, Y, Z)) → addC_out_aag(zero(X), one(Y), zero(Z))
U16_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addc_out_aag(X, Y, Z)
U13_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addz_out_aag(one(X), one(Y), zero(Z))
U9_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addy_out_aag(X, Y, Z)
U12_aag(X, Y, Z, addy_out_aag(X, Y, Z)) → addz_out_aag(one(X), zero(Y), one(Z))
U6_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addx_out_aag(X, Y, Z)
U11_aag(X, Y, Z, addx_out_aag(X, Y, Z)) → addz_out_aag(zero(X), one(Y), one(Z))
U10_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addz_out_aag(zero(X), zero(Y), zero(Z))
U3_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → add_out_aag(X, Y, Z)
U37_aag(R, S, RSS, add_out_aag(S, zero(RS), RSS)) → times_out_aag(one(R), S, RSS)
U35_aag(R, S, RS, times_out_aag(R, S, RS)) → times_out_aag(zero(R), S, zero(RS))
TIMES_IN_AAG(zero(R), S, zero(RS)) → U35_AAG(R, S, RS, times_in_aag(R, S, RS))
TIMES_IN_AAG(zero(R), S, zero(RS)) → TIMES_IN_AAG(R, S, RS)
TIMES_IN_AAG(one(R), S, RSS) → U36_AAG(R, S, RSS, times_in_aaa(R, S, RS))
TIMES_IN_AAG(one(R), S, RSS) → TIMES_IN_AAA(R, S, RS)
TIMES_IN_AAA(zero(R), S, zero(RS)) → U35_AAA(R, S, RS, times_in_aaa(R, S, RS))
TIMES_IN_AAA(zero(R), S, zero(RS)) → TIMES_IN_AAA(R, S, RS)
TIMES_IN_AAA(one(R), S, RSS) → U36_AAA(R, S, RSS, times_in_aaa(R, S, RS))
TIMES_IN_AAA(one(R), S, RSS) → TIMES_IN_AAA(R, S, RS)
U36_AAA(R, S, RSS, times_out_aaa(R, S, RS)) → U37_AAA(R, S, RSS, add_in_aaa(S, zero(RS), RSS))
U36_AAA(R, S, RSS, times_out_aaa(R, S, RS)) → ADD_IN_AAA(S, zero(RS), RSS)
ADD_IN_AAA(X, b, X) → U1_AAA(X, binaryZ_in_a(X))
ADD_IN_AAA(X, b, X) → BINARYZ_IN_A(X)
BINARYZ_IN_A(zero(X)) → U29_A(X, binaryZ_in_a(X))
BINARYZ_IN_A(zero(X)) → BINARYZ_IN_A(X)
BINARYZ_IN_A(one(X)) → U30_A(X, binary_in_a(X))
BINARYZ_IN_A(one(X)) → BINARY_IN_A(X)
BINARY_IN_A(zero(X)) → U27_A(X, binaryZ_in_a(X))
BINARY_IN_A(zero(X)) → BINARYZ_IN_A(X)
BINARY_IN_A(one(X)) → U28_A(X, binary_in_a(X))
BINARY_IN_A(one(X)) → BINARY_IN_A(X)
ADD_IN_AAA(b, Y, Y) → U2_AAA(Y, binaryZ_in_a(Y))
ADD_IN_AAA(b, Y, Y) → BINARYZ_IN_A(Y)
ADD_IN_AAA(X, Y, Z) → U3_AAA(X, Y, Z, addz_in_aaa(X, Y, Z))
ADD_IN_AAA(X, Y, Z) → ADDZ_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(zero(X), zero(Y), zero(Z)) → U10_AAA(X, Y, Z, addz_in_aaa(X, Y, Z))
ADDZ_IN_AAA(zero(X), zero(Y), zero(Z)) → ADDZ_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(zero(X), one(Y), one(Z)) → U11_AAA(X, Y, Z, addx_in_aaa(X, Y, Z))
ADDZ_IN_AAA(zero(X), one(Y), one(Z)) → ADDX_IN_AAA(X, Y, Z)
ADDX_IN_AAA(one(X), b, one(X)) → U4_AAA(X, binary_in_a(X))
ADDX_IN_AAA(one(X), b, one(X)) → BINARY_IN_A(X)
ADDX_IN_AAA(zero(X), b, zero(X)) → U5_AAA(X, binaryZ_in_a(X))
ADDX_IN_AAA(zero(X), b, zero(X)) → BINARYZ_IN_A(X)
ADDX_IN_AAA(X, Y, Z) → U6_AAA(X, Y, Z, addz_in_aaa(X, Y, Z))
ADDX_IN_AAA(X, Y, Z) → ADDZ_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(one(X), zero(Y), one(Z)) → U12_AAA(X, Y, Z, addy_in_aaa(X, Y, Z))
ADDZ_IN_AAA(one(X), zero(Y), one(Z)) → ADDY_IN_AAA(X, Y, Z)
ADDY_IN_AAA(b, one(Y), one(Y)) → U7_AAA(Y, binary_in_a(Y))
ADDY_IN_AAA(b, one(Y), one(Y)) → BINARY_IN_A(Y)
ADDY_IN_AAA(b, zero(Y), zero(Y)) → U8_AAA(Y, binaryZ_in_a(Y))
ADDY_IN_AAA(b, zero(Y), zero(Y)) → BINARYZ_IN_A(Y)
ADDY_IN_AAA(X, Y, Z) → U9_AAA(X, Y, Z, addz_in_aaa(X, Y, Z))
ADDY_IN_AAA(X, Y, Z) → ADDZ_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(one(X), one(Y), zero(Z)) → U13_AAA(X, Y, Z, addc_in_aaa(X, Y, Z))
ADDZ_IN_AAA(one(X), one(Y), zero(Z)) → ADDC_IN_AAA(X, Y, Z)
ADDC_IN_AAA(X, b, Z) → U14_AAA(X, Z, succZ_in_aa(X, Z))
ADDC_IN_AAA(X, b, Z) → SUCCZ_IN_AA(X, Z)
SUCCZ_IN_AA(zero(X), one(X)) → U33_AA(X, binaryZ_in_a(X))
SUCCZ_IN_AA(zero(X), one(X)) → BINARYZ_IN_A(X)
SUCCZ_IN_AA(one(X), zero(Z)) → U34_AA(X, Z, succ_in_aa(X, Z))
SUCCZ_IN_AA(one(X), zero(Z)) → SUCC_IN_AA(X, Z)
SUCC_IN_AA(zero(X), one(X)) → U31_AA(X, binaryZ_in_a(X))
SUCC_IN_AA(zero(X), one(X)) → BINARYZ_IN_A(X)
SUCC_IN_AA(one(X), zero(Z)) → U32_AA(X, Z, succ_in_aa(X, Z))
SUCC_IN_AA(one(X), zero(Z)) → SUCC_IN_AA(X, Z)
ADDC_IN_AAA(b, Y, Z) → U15_AAA(Y, Z, succZ_in_aa(Y, Z))
ADDC_IN_AAA(b, Y, Z) → SUCCZ_IN_AA(Y, Z)
ADDC_IN_AAA(X, Y, Z) → U16_AAA(X, Y, Z, addC_in_aaa(X, Y, Z))
ADDC_IN_AAA(X, Y, Z) → ADDC_IN_AAA1(X, Y, Z)
ADDC_IN_AAA1(zero(X), zero(Y), one(Z)) → U23_AAA(X, Y, Z, addz_in_aaa(X, Y, Z))
ADDC_IN_AAA1(zero(X), zero(Y), one(Z)) → ADDZ_IN_AAA(X, Y, Z)
ADDC_IN_AAA1(zero(X), one(Y), zero(Z)) → U24_AAA(X, Y, Z, addX_in_aaa(X, Y, Z))
ADDC_IN_AAA1(zero(X), one(Y), zero(Z)) → ADDX_IN_AAA1(X, Y, Z)
ADDX_IN_AAA1(zero(X), b, one(X)) → U17_AAA(X, binaryZ_in_a(X))
ADDX_IN_AAA1(zero(X), b, one(X)) → BINARYZ_IN_A(X)
ADDX_IN_AAA1(one(X), b, zero(Z)) → U18_AAA(X, Z, succ_in_aa(X, Z))
ADDX_IN_AAA1(one(X), b, zero(Z)) → SUCC_IN_AA(X, Z)
ADDX_IN_AAA1(X, Y, Z) → U19_AAA(X, Y, Z, addC_in_aaa(X, Y, Z))
ADDX_IN_AAA1(X, Y, Z) → ADDC_IN_AAA1(X, Y, Z)
ADDC_IN_AAA1(one(X), zero(Y), zero(Z)) → U25_AAA(X, Y, Z, addY_in_aaa(X, Y, Z))
ADDC_IN_AAA1(one(X), zero(Y), zero(Z)) → ADDY_IN_AAA1(X, Y, Z)
ADDY_IN_AAA1(b, zero(Y), one(Y)) → U20_AAA(Y, binaryZ_in_a(Y))
ADDY_IN_AAA1(b, zero(Y), one(Y)) → BINARYZ_IN_A(Y)
ADDY_IN_AAA1(b, one(Y), zero(Z)) → U21_AAA(Y, Z, succ_in_aa(Y, Z))
ADDY_IN_AAA1(b, one(Y), zero(Z)) → SUCC_IN_AA(Y, Z)
ADDY_IN_AAA1(X, Y, Z) → U22_AAA(X, Y, Z, addC_in_aaa(X, Y, Z))
ADDY_IN_AAA1(X, Y, Z) → ADDC_IN_AAA1(X, Y, Z)
ADDC_IN_AAA1(one(X), one(Y), one(Z)) → U26_AAA(X, Y, Z, addc_in_aaa(X, Y, Z))
ADDC_IN_AAA1(one(X), one(Y), one(Z)) → ADDC_IN_AAA(X, Y, Z)
U36_AAG(R, S, RSS, times_out_aaa(R, S, RS)) → U37_AAG(R, S, RSS, add_in_aag(S, zero(RS), RSS))
U36_AAG(R, S, RSS, times_out_aaa(R, S, RS)) → ADD_IN_AAG(S, zero(RS), RSS)
ADD_IN_AAG(X, b, X) → U1_AAG(X, binaryZ_in_g(X))
ADD_IN_AAG(X, b, X) → BINARYZ_IN_G(X)
BINARYZ_IN_G(zero(X)) → U29_G(X, binaryZ_in_g(X))
BINARYZ_IN_G(zero(X)) → BINARYZ_IN_G(X)
BINARYZ_IN_G(one(X)) → U30_G(X, binary_in_g(X))
BINARYZ_IN_G(one(X)) → BINARY_IN_G(X)
BINARY_IN_G(zero(X)) → U27_G(X, binaryZ_in_g(X))
BINARY_IN_G(zero(X)) → BINARYZ_IN_G(X)
BINARY_IN_G(one(X)) → U28_G(X, binary_in_g(X))
BINARY_IN_G(one(X)) → BINARY_IN_G(X)
ADD_IN_AAG(b, Y, Y) → U2_AAG(Y, binaryZ_in_g(Y))
ADD_IN_AAG(b, Y, Y) → BINARYZ_IN_G(Y)
ADD_IN_AAG(X, Y, Z) → U3_AAG(X, Y, Z, addz_in_aag(X, Y, Z))
ADD_IN_AAG(X, Y, Z) → ADDZ_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(zero(X), zero(Y), zero(Z)) → U10_AAG(X, Y, Z, addz_in_aag(X, Y, Z))
ADDZ_IN_AAG(zero(X), zero(Y), zero(Z)) → ADDZ_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(zero(X), one(Y), one(Z)) → U11_AAG(X, Y, Z, addx_in_aag(X, Y, Z))
ADDZ_IN_AAG(zero(X), one(Y), one(Z)) → ADDX_IN_AAG(X, Y, Z)
ADDX_IN_AAG(one(X), b, one(X)) → U4_AAG(X, binary_in_g(X))
ADDX_IN_AAG(one(X), b, one(X)) → BINARY_IN_G(X)
ADDX_IN_AAG(zero(X), b, zero(X)) → U5_AAG(X, binaryZ_in_g(X))
ADDX_IN_AAG(zero(X), b, zero(X)) → BINARYZ_IN_G(X)
ADDX_IN_AAG(X, Y, Z) → U6_AAG(X, Y, Z, addz_in_aag(X, Y, Z))
ADDX_IN_AAG(X, Y, Z) → ADDZ_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(one(X), zero(Y), one(Z)) → U12_AAG(X, Y, Z, addy_in_aag(X, Y, Z))
ADDZ_IN_AAG(one(X), zero(Y), one(Z)) → ADDY_IN_AAG(X, Y, Z)
ADDY_IN_AAG(b, one(Y), one(Y)) → U7_AAG(Y, binary_in_g(Y))
ADDY_IN_AAG(b, one(Y), one(Y)) → BINARY_IN_G(Y)
ADDY_IN_AAG(b, zero(Y), zero(Y)) → U8_AAG(Y, binaryZ_in_g(Y))
ADDY_IN_AAG(b, zero(Y), zero(Y)) → BINARYZ_IN_G(Y)
ADDY_IN_AAG(X, Y, Z) → U9_AAG(X, Y, Z, addz_in_aag(X, Y, Z))
ADDY_IN_AAG(X, Y, Z) → ADDZ_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(one(X), one(Y), zero(Z)) → U13_AAG(X, Y, Z, addc_in_aag(X, Y, Z))
ADDZ_IN_AAG(one(X), one(Y), zero(Z)) → ADDC_IN_AAG(X, Y, Z)
ADDC_IN_AAG(X, b, Z) → U14_AAG(X, Z, succZ_in_ag(X, Z))
ADDC_IN_AAG(X, b, Z) → SUCCZ_IN_AG(X, Z)
SUCCZ_IN_AG(zero(X), one(X)) → U33_AG(X, binaryZ_in_g(X))
SUCCZ_IN_AG(zero(X), one(X)) → BINARYZ_IN_G(X)
SUCCZ_IN_AG(one(X), zero(Z)) → U34_AG(X, Z, succ_in_ag(X, Z))
SUCCZ_IN_AG(one(X), zero(Z)) → SUCC_IN_AG(X, Z)
SUCC_IN_AG(zero(X), one(X)) → U31_AG(X, binaryZ_in_g(X))
SUCC_IN_AG(zero(X), one(X)) → BINARYZ_IN_G(X)
SUCC_IN_AG(one(X), zero(Z)) → U32_AG(X, Z, succ_in_ag(X, Z))
SUCC_IN_AG(one(X), zero(Z)) → SUCC_IN_AG(X, Z)
ADDC_IN_AAG(b, Y, Z) → U15_AAG(Y, Z, succZ_in_ag(Y, Z))
ADDC_IN_AAG(b, Y, Z) → SUCCZ_IN_AG(Y, Z)
ADDC_IN_AAG(X, Y, Z) → U16_AAG(X, Y, Z, addC_in_aag(X, Y, Z))
ADDC_IN_AAG(X, Y, Z) → ADDC_IN_AAG1(X, Y, Z)
ADDC_IN_AAG1(zero(X), zero(Y), one(Z)) → U23_AAG(X, Y, Z, addz_in_aag(X, Y, Z))
ADDC_IN_AAG1(zero(X), zero(Y), one(Z)) → ADDZ_IN_AAG(X, Y, Z)
ADDC_IN_AAG1(zero(X), one(Y), zero(Z)) → U24_AAG(X, Y, Z, addX_in_aag(X, Y, Z))
ADDC_IN_AAG1(zero(X), one(Y), zero(Z)) → ADDX_IN_AAG1(X, Y, Z)
ADDX_IN_AAG1(zero(X), b, one(X)) → U17_AAG(X, binaryZ_in_g(X))
ADDX_IN_AAG1(zero(X), b, one(X)) → BINARYZ_IN_G(X)
ADDX_IN_AAG1(one(X), b, zero(Z)) → U18_AAG(X, Z, succ_in_ag(X, Z))
ADDX_IN_AAG1(one(X), b, zero(Z)) → SUCC_IN_AG(X, Z)
ADDX_IN_AAG1(X, Y, Z) → U19_AAG(X, Y, Z, addC_in_aag(X, Y, Z))
ADDX_IN_AAG1(X, Y, Z) → ADDC_IN_AAG1(X, Y, Z)
ADDC_IN_AAG1(one(X), zero(Y), zero(Z)) → U25_AAG(X, Y, Z, addY_in_aag(X, Y, Z))
ADDC_IN_AAG1(one(X), zero(Y), zero(Z)) → ADDY_IN_AAG1(X, Y, Z)
ADDY_IN_AAG1(b, zero(Y), one(Y)) → U20_AAG(Y, binaryZ_in_g(Y))
ADDY_IN_AAG1(b, zero(Y), one(Y)) → BINARYZ_IN_G(Y)
ADDY_IN_AAG1(b, one(Y), zero(Z)) → U21_AAG(Y, Z, succ_in_ag(Y, Z))
ADDY_IN_AAG1(b, one(Y), zero(Z)) → SUCC_IN_AG(Y, Z)
ADDY_IN_AAG1(X, Y, Z) → U22_AAG(X, Y, Z, addC_in_aag(X, Y, Z))
ADDY_IN_AAG1(X, Y, Z) → ADDC_IN_AAG1(X, Y, Z)
ADDC_IN_AAG1(one(X), one(Y), one(Z)) → U26_AAG(X, Y, Z, addc_in_aag(X, Y, Z))
ADDC_IN_AAG1(one(X), one(Y), one(Z)) → ADDC_IN_AAG(X, Y, Z)
times_in_aag(one(b), X, X) → times_out_aag(one(b), X, X)
times_in_aag(zero(R), S, zero(RS)) → U35_aag(R, S, RS, times_in_aag(R, S, RS))
times_in_aag(one(R), S, RSS) → U36_aag(R, S, RSS, times_in_aaa(R, S, RS))
times_in_aaa(one(b), X, X) → times_out_aaa(one(b), X, X)
times_in_aaa(zero(R), S, zero(RS)) → U35_aaa(R, S, RS, times_in_aaa(R, S, RS))
times_in_aaa(one(R), S, RSS) → U36_aaa(R, S, RSS, times_in_aaa(R, S, RS))
U36_aaa(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aaa(R, S, RSS, add_in_aaa(S, zero(RS), RSS))
add_in_aaa(b, b, b) → add_out_aaa(b, b, b)
add_in_aaa(X, b, X) → U1_aaa(X, binaryZ_in_a(X))
binaryZ_in_a(zero(X)) → U29_a(X, binaryZ_in_a(X))
binaryZ_in_a(one(X)) → U30_a(X, binary_in_a(X))
binary_in_a(b) → binary_out_a(b)
binary_in_a(zero(X)) → U27_a(X, binaryZ_in_a(X))
U27_a(X, binaryZ_out_a(X)) → binary_out_a(zero(X))
binary_in_a(one(X)) → U28_a(X, binary_in_a(X))
U28_a(X, binary_out_a(X)) → binary_out_a(one(X))
U30_a(X, binary_out_a(X)) → binaryZ_out_a(one(X))
U29_a(X, binaryZ_out_a(X)) → binaryZ_out_a(zero(X))
U1_aaa(X, binaryZ_out_a(X)) → add_out_aaa(X, b, X)
add_in_aaa(b, Y, Y) → U2_aaa(Y, binaryZ_in_a(Y))
U2_aaa(Y, binaryZ_out_a(Y)) → add_out_aaa(b, Y, Y)
add_in_aaa(X, Y, Z) → U3_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), zero(Y), zero(Z)) → U10_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), one(Y), one(Z)) → U11_aaa(X, Y, Z, addx_in_aaa(X, Y, Z))
addx_in_aaa(one(X), b, one(X)) → U4_aaa(X, binary_in_a(X))
U4_aaa(X, binary_out_a(X)) → addx_out_aaa(one(X), b, one(X))
addx_in_aaa(zero(X), b, zero(X)) → U5_aaa(X, binaryZ_in_a(X))
U5_aaa(X, binaryZ_out_a(X)) → addx_out_aaa(zero(X), b, zero(X))
addx_in_aaa(X, Y, Z) → U6_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), zero(Y), one(Z)) → U12_aaa(X, Y, Z, addy_in_aaa(X, Y, Z))
addy_in_aaa(b, one(Y), one(Y)) → U7_aaa(Y, binary_in_a(Y))
U7_aaa(Y, binary_out_a(Y)) → addy_out_aaa(b, one(Y), one(Y))
addy_in_aaa(b, zero(Y), zero(Y)) → U8_aaa(Y, binaryZ_in_a(Y))
U8_aaa(Y, binaryZ_out_a(Y)) → addy_out_aaa(b, zero(Y), zero(Y))
addy_in_aaa(X, Y, Z) → U9_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), one(Y), zero(Z)) → U13_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
addc_in_aaa(b, b, one(b)) → addc_out_aaa(b, b, one(b))
addc_in_aaa(X, b, Z) → U14_aaa(X, Z, succZ_in_aa(X, Z))
succZ_in_aa(zero(X), one(X)) → U33_aa(X, binaryZ_in_a(X))
U33_aa(X, binaryZ_out_a(X)) → succZ_out_aa(zero(X), one(X))
succZ_in_aa(one(X), zero(Z)) → U34_aa(X, Z, succ_in_aa(X, Z))
succ_in_aa(b, one(b)) → succ_out_aa(b, one(b))
succ_in_aa(zero(X), one(X)) → U31_aa(X, binaryZ_in_a(X))
U31_aa(X, binaryZ_out_a(X)) → succ_out_aa(zero(X), one(X))
succ_in_aa(one(X), zero(Z)) → U32_aa(X, Z, succ_in_aa(X, Z))
U32_aa(X, Z, succ_out_aa(X, Z)) → succ_out_aa(one(X), zero(Z))
U34_aa(X, Z, succ_out_aa(X, Z)) → succZ_out_aa(one(X), zero(Z))
U14_aaa(X, Z, succZ_out_aa(X, Z)) → addc_out_aaa(X, b, Z)
addc_in_aaa(b, Y, Z) → U15_aaa(Y, Z, succZ_in_aa(Y, Z))
U15_aaa(Y, Z, succZ_out_aa(Y, Z)) → addc_out_aaa(b, Y, Z)
addc_in_aaa(X, Y, Z) → U16_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(zero(X), zero(Y), one(Z)) → U23_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
U23_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), zero(Y), one(Z))
addC_in_aaa(zero(X), one(Y), zero(Z)) → U24_aaa(X, Y, Z, addX_in_aaa(X, Y, Z))
addX_in_aaa(zero(X), b, one(X)) → U17_aaa(X, binaryZ_in_a(X))
U17_aaa(X, binaryZ_out_a(X)) → addX_out_aaa(zero(X), b, one(X))
addX_in_aaa(one(X), b, zero(Z)) → U18_aaa(X, Z, succ_in_aa(X, Z))
U18_aaa(X, Z, succ_out_aa(X, Z)) → addX_out_aaa(one(X), b, zero(Z))
addX_in_aaa(X, Y, Z) → U19_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), zero(Y), zero(Z)) → U25_aaa(X, Y, Z, addY_in_aaa(X, Y, Z))
addY_in_aaa(b, zero(Y), one(Y)) → U20_aaa(Y, binaryZ_in_a(Y))
U20_aaa(Y, binaryZ_out_a(Y)) → addY_out_aaa(b, zero(Y), one(Y))
addY_in_aaa(b, one(Y), zero(Z)) → U21_aaa(Y, Z, succ_in_aa(Y, Z))
U21_aaa(Y, Z, succ_out_aa(Y, Z)) → addY_out_aaa(b, one(Y), zero(Z))
addY_in_aaa(X, Y, Z) → U22_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), one(Y), one(Z)) → U26_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
U26_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), one(Y), one(Z))
U22_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addY_out_aaa(X, Y, Z)
U25_aaa(X, Y, Z, addY_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), zero(Y), zero(Z))
U19_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addX_out_aaa(X, Y, Z)
U24_aaa(X, Y, Z, addX_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), one(Y), zero(Z))
U16_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addc_out_aaa(X, Y, Z)
U13_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), one(Y), zero(Z))
U9_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addy_out_aaa(X, Y, Z)
U12_aaa(X, Y, Z, addy_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), zero(Y), one(Z))
U6_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addx_out_aaa(X, Y, Z)
U11_aaa(X, Y, Z, addx_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), one(Y), one(Z))
U10_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), zero(Y), zero(Z))
U3_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → add_out_aaa(X, Y, Z)
U37_aaa(R, S, RSS, add_out_aaa(S, zero(RS), RSS)) → times_out_aaa(one(R), S, RSS)
U35_aaa(R, S, RS, times_out_aaa(R, S, RS)) → times_out_aaa(zero(R), S, zero(RS))
U36_aag(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aag(R, S, RSS, add_in_aag(S, zero(RS), RSS))
add_in_aag(b, b, b) → add_out_aag(b, b, b)
add_in_aag(X, b, X) → U1_aag(X, binaryZ_in_g(X))
binaryZ_in_g(zero(X)) → U29_g(X, binaryZ_in_g(X))
binaryZ_in_g(one(X)) → U30_g(X, binary_in_g(X))
binary_in_g(b) → binary_out_g(b)
binary_in_g(zero(X)) → U27_g(X, binaryZ_in_g(X))
U27_g(X, binaryZ_out_g(X)) → binary_out_g(zero(X))
binary_in_g(one(X)) → U28_g(X, binary_in_g(X))
U28_g(X, binary_out_g(X)) → binary_out_g(one(X))
U30_g(X, binary_out_g(X)) → binaryZ_out_g(one(X))
U29_g(X, binaryZ_out_g(X)) → binaryZ_out_g(zero(X))
U1_aag(X, binaryZ_out_g(X)) → add_out_aag(X, b, X)
add_in_aag(b, Y, Y) → U2_aag(Y, binaryZ_in_g(Y))
U2_aag(Y, binaryZ_out_g(Y)) → add_out_aag(b, Y, Y)
add_in_aag(X, Y, Z) → U3_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), zero(Y), zero(Z)) → U10_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), one(Y), one(Z)) → U11_aag(X, Y, Z, addx_in_aag(X, Y, Z))
addx_in_aag(one(X), b, one(X)) → U4_aag(X, binary_in_g(X))
U4_aag(X, binary_out_g(X)) → addx_out_aag(one(X), b, one(X))
addx_in_aag(zero(X), b, zero(X)) → U5_aag(X, binaryZ_in_g(X))
U5_aag(X, binaryZ_out_g(X)) → addx_out_aag(zero(X), b, zero(X))
addx_in_aag(X, Y, Z) → U6_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), zero(Y), one(Z)) → U12_aag(X, Y, Z, addy_in_aag(X, Y, Z))
addy_in_aag(b, one(Y), one(Y)) → U7_aag(Y, binary_in_g(Y))
U7_aag(Y, binary_out_g(Y)) → addy_out_aag(b, one(Y), one(Y))
addy_in_aag(b, zero(Y), zero(Y)) → U8_aag(Y, binaryZ_in_g(Y))
U8_aag(Y, binaryZ_out_g(Y)) → addy_out_aag(b, zero(Y), zero(Y))
addy_in_aag(X, Y, Z) → U9_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), one(Y), zero(Z)) → U13_aag(X, Y, Z, addc_in_aag(X, Y, Z))
addc_in_aag(b, b, one(b)) → addc_out_aag(b, b, one(b))
addc_in_aag(X, b, Z) → U14_aag(X, Z, succZ_in_ag(X, Z))
succZ_in_ag(zero(X), one(X)) → U33_ag(X, binaryZ_in_g(X))
U33_ag(X, binaryZ_out_g(X)) → succZ_out_ag(zero(X), one(X))
succZ_in_ag(one(X), zero(Z)) → U34_ag(X, Z, succ_in_ag(X, Z))
succ_in_ag(b, one(b)) → succ_out_ag(b, one(b))
succ_in_ag(zero(X), one(X)) → U31_ag(X, binaryZ_in_g(X))
U31_ag(X, binaryZ_out_g(X)) → succ_out_ag(zero(X), one(X))
succ_in_ag(one(X), zero(Z)) → U32_ag(X, Z, succ_in_ag(X, Z))
U32_ag(X, Z, succ_out_ag(X, Z)) → succ_out_ag(one(X), zero(Z))
U34_ag(X, Z, succ_out_ag(X, Z)) → succZ_out_ag(one(X), zero(Z))
U14_aag(X, Z, succZ_out_ag(X, Z)) → addc_out_aag(X, b, Z)
addc_in_aag(b, Y, Z) → U15_aag(Y, Z, succZ_in_ag(Y, Z))
U15_aag(Y, Z, succZ_out_ag(Y, Z)) → addc_out_aag(b, Y, Z)
addc_in_aag(X, Y, Z) → U16_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(zero(X), zero(Y), one(Z)) → U23_aag(X, Y, Z, addz_in_aag(X, Y, Z))
U23_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addC_out_aag(zero(X), zero(Y), one(Z))
addC_in_aag(zero(X), one(Y), zero(Z)) → U24_aag(X, Y, Z, addX_in_aag(X, Y, Z))
addX_in_aag(zero(X), b, one(X)) → U17_aag(X, binaryZ_in_g(X))
U17_aag(X, binaryZ_out_g(X)) → addX_out_aag(zero(X), b, one(X))
addX_in_aag(one(X), b, zero(Z)) → U18_aag(X, Z, succ_in_ag(X, Z))
U18_aag(X, Z, succ_out_ag(X, Z)) → addX_out_aag(one(X), b, zero(Z))
addX_in_aag(X, Y, Z) → U19_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), zero(Y), zero(Z)) → U25_aag(X, Y, Z, addY_in_aag(X, Y, Z))
addY_in_aag(b, zero(Y), one(Y)) → U20_aag(Y, binaryZ_in_g(Y))
U20_aag(Y, binaryZ_out_g(Y)) → addY_out_aag(b, zero(Y), one(Y))
addY_in_aag(b, one(Y), zero(Z)) → U21_aag(Y, Z, succ_in_ag(Y, Z))
U21_aag(Y, Z, succ_out_ag(Y, Z)) → addY_out_aag(b, one(Y), zero(Z))
addY_in_aag(X, Y, Z) → U22_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), one(Y), one(Z)) → U26_aag(X, Y, Z, addc_in_aag(X, Y, Z))
U26_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addC_out_aag(one(X), one(Y), one(Z))
U22_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addY_out_aag(X, Y, Z)
U25_aag(X, Y, Z, addY_out_aag(X, Y, Z)) → addC_out_aag(one(X), zero(Y), zero(Z))
U19_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addX_out_aag(X, Y, Z)
U24_aag(X, Y, Z, addX_out_aag(X, Y, Z)) → addC_out_aag(zero(X), one(Y), zero(Z))
U16_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addc_out_aag(X, Y, Z)
U13_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addz_out_aag(one(X), one(Y), zero(Z))
U9_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addy_out_aag(X, Y, Z)
U12_aag(X, Y, Z, addy_out_aag(X, Y, Z)) → addz_out_aag(one(X), zero(Y), one(Z))
U6_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addx_out_aag(X, Y, Z)
U11_aag(X, Y, Z, addx_out_aag(X, Y, Z)) → addz_out_aag(zero(X), one(Y), one(Z))
U10_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addz_out_aag(zero(X), zero(Y), zero(Z))
U3_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → add_out_aag(X, Y, Z)
U37_aag(R, S, RSS, add_out_aag(S, zero(RS), RSS)) → times_out_aag(one(R), S, RSS)
U35_aag(R, S, RS, times_out_aag(R, S, RS)) → times_out_aag(zero(R), S, zero(RS))
TIMES_IN_AAG(zero(R), S, zero(RS)) → U35_AAG(R, S, RS, times_in_aag(R, S, RS))
TIMES_IN_AAG(zero(R), S, zero(RS)) → TIMES_IN_AAG(R, S, RS)
TIMES_IN_AAG(one(R), S, RSS) → U36_AAG(R, S, RSS, times_in_aaa(R, S, RS))
TIMES_IN_AAG(one(R), S, RSS) → TIMES_IN_AAA(R, S, RS)
TIMES_IN_AAA(zero(R), S, zero(RS)) → U35_AAA(R, S, RS, times_in_aaa(R, S, RS))
TIMES_IN_AAA(zero(R), S, zero(RS)) → TIMES_IN_AAA(R, S, RS)
TIMES_IN_AAA(one(R), S, RSS) → U36_AAA(R, S, RSS, times_in_aaa(R, S, RS))
TIMES_IN_AAA(one(R), S, RSS) → TIMES_IN_AAA(R, S, RS)
U36_AAA(R, S, RSS, times_out_aaa(R, S, RS)) → U37_AAA(R, S, RSS, add_in_aaa(S, zero(RS), RSS))
U36_AAA(R, S, RSS, times_out_aaa(R, S, RS)) → ADD_IN_AAA(S, zero(RS), RSS)
ADD_IN_AAA(X, b, X) → U1_AAA(X, binaryZ_in_a(X))
ADD_IN_AAA(X, b, X) → BINARYZ_IN_A(X)
BINARYZ_IN_A(zero(X)) → U29_A(X, binaryZ_in_a(X))
BINARYZ_IN_A(zero(X)) → BINARYZ_IN_A(X)
BINARYZ_IN_A(one(X)) → U30_A(X, binary_in_a(X))
BINARYZ_IN_A(one(X)) → BINARY_IN_A(X)
BINARY_IN_A(zero(X)) → U27_A(X, binaryZ_in_a(X))
BINARY_IN_A(zero(X)) → BINARYZ_IN_A(X)
BINARY_IN_A(one(X)) → U28_A(X, binary_in_a(X))
BINARY_IN_A(one(X)) → BINARY_IN_A(X)
ADD_IN_AAA(b, Y, Y) → U2_AAA(Y, binaryZ_in_a(Y))
ADD_IN_AAA(b, Y, Y) → BINARYZ_IN_A(Y)
ADD_IN_AAA(X, Y, Z) → U3_AAA(X, Y, Z, addz_in_aaa(X, Y, Z))
ADD_IN_AAA(X, Y, Z) → ADDZ_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(zero(X), zero(Y), zero(Z)) → U10_AAA(X, Y, Z, addz_in_aaa(X, Y, Z))
ADDZ_IN_AAA(zero(X), zero(Y), zero(Z)) → ADDZ_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(zero(X), one(Y), one(Z)) → U11_AAA(X, Y, Z, addx_in_aaa(X, Y, Z))
ADDZ_IN_AAA(zero(X), one(Y), one(Z)) → ADDX_IN_AAA(X, Y, Z)
ADDX_IN_AAA(one(X), b, one(X)) → U4_AAA(X, binary_in_a(X))
ADDX_IN_AAA(one(X), b, one(X)) → BINARY_IN_A(X)
ADDX_IN_AAA(zero(X), b, zero(X)) → U5_AAA(X, binaryZ_in_a(X))
ADDX_IN_AAA(zero(X), b, zero(X)) → BINARYZ_IN_A(X)
ADDX_IN_AAA(X, Y, Z) → U6_AAA(X, Y, Z, addz_in_aaa(X, Y, Z))
ADDX_IN_AAA(X, Y, Z) → ADDZ_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(one(X), zero(Y), one(Z)) → U12_AAA(X, Y, Z, addy_in_aaa(X, Y, Z))
ADDZ_IN_AAA(one(X), zero(Y), one(Z)) → ADDY_IN_AAA(X, Y, Z)
ADDY_IN_AAA(b, one(Y), one(Y)) → U7_AAA(Y, binary_in_a(Y))
ADDY_IN_AAA(b, one(Y), one(Y)) → BINARY_IN_A(Y)
ADDY_IN_AAA(b, zero(Y), zero(Y)) → U8_AAA(Y, binaryZ_in_a(Y))
ADDY_IN_AAA(b, zero(Y), zero(Y)) → BINARYZ_IN_A(Y)
ADDY_IN_AAA(X, Y, Z) → U9_AAA(X, Y, Z, addz_in_aaa(X, Y, Z))
ADDY_IN_AAA(X, Y, Z) → ADDZ_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(one(X), one(Y), zero(Z)) → U13_AAA(X, Y, Z, addc_in_aaa(X, Y, Z))
ADDZ_IN_AAA(one(X), one(Y), zero(Z)) → ADDC_IN_AAA(X, Y, Z)
ADDC_IN_AAA(X, b, Z) → U14_AAA(X, Z, succZ_in_aa(X, Z))
ADDC_IN_AAA(X, b, Z) → SUCCZ_IN_AA(X, Z)
SUCCZ_IN_AA(zero(X), one(X)) → U33_AA(X, binaryZ_in_a(X))
SUCCZ_IN_AA(zero(X), one(X)) → BINARYZ_IN_A(X)
SUCCZ_IN_AA(one(X), zero(Z)) → U34_AA(X, Z, succ_in_aa(X, Z))
SUCCZ_IN_AA(one(X), zero(Z)) → SUCC_IN_AA(X, Z)
SUCC_IN_AA(zero(X), one(X)) → U31_AA(X, binaryZ_in_a(X))
SUCC_IN_AA(zero(X), one(X)) → BINARYZ_IN_A(X)
SUCC_IN_AA(one(X), zero(Z)) → U32_AA(X, Z, succ_in_aa(X, Z))
SUCC_IN_AA(one(X), zero(Z)) → SUCC_IN_AA(X, Z)
ADDC_IN_AAA(b, Y, Z) → U15_AAA(Y, Z, succZ_in_aa(Y, Z))
ADDC_IN_AAA(b, Y, Z) → SUCCZ_IN_AA(Y, Z)
ADDC_IN_AAA(X, Y, Z) → U16_AAA(X, Y, Z, addC_in_aaa(X, Y, Z))
ADDC_IN_AAA(X, Y, Z) → ADDC_IN_AAA1(X, Y, Z)
ADDC_IN_AAA1(zero(X), zero(Y), one(Z)) → U23_AAA(X, Y, Z, addz_in_aaa(X, Y, Z))
ADDC_IN_AAA1(zero(X), zero(Y), one(Z)) → ADDZ_IN_AAA(X, Y, Z)
ADDC_IN_AAA1(zero(X), one(Y), zero(Z)) → U24_AAA(X, Y, Z, addX_in_aaa(X, Y, Z))
ADDC_IN_AAA1(zero(X), one(Y), zero(Z)) → ADDX_IN_AAA1(X, Y, Z)
ADDX_IN_AAA1(zero(X), b, one(X)) → U17_AAA(X, binaryZ_in_a(X))
ADDX_IN_AAA1(zero(X), b, one(X)) → BINARYZ_IN_A(X)
ADDX_IN_AAA1(one(X), b, zero(Z)) → U18_AAA(X, Z, succ_in_aa(X, Z))
ADDX_IN_AAA1(one(X), b, zero(Z)) → SUCC_IN_AA(X, Z)
ADDX_IN_AAA1(X, Y, Z) → U19_AAA(X, Y, Z, addC_in_aaa(X, Y, Z))
ADDX_IN_AAA1(X, Y, Z) → ADDC_IN_AAA1(X, Y, Z)
ADDC_IN_AAA1(one(X), zero(Y), zero(Z)) → U25_AAA(X, Y, Z, addY_in_aaa(X, Y, Z))
ADDC_IN_AAA1(one(X), zero(Y), zero(Z)) → ADDY_IN_AAA1(X, Y, Z)
ADDY_IN_AAA1(b, zero(Y), one(Y)) → U20_AAA(Y, binaryZ_in_a(Y))
ADDY_IN_AAA1(b, zero(Y), one(Y)) → BINARYZ_IN_A(Y)
ADDY_IN_AAA1(b, one(Y), zero(Z)) → U21_AAA(Y, Z, succ_in_aa(Y, Z))
ADDY_IN_AAA1(b, one(Y), zero(Z)) → SUCC_IN_AA(Y, Z)
ADDY_IN_AAA1(X, Y, Z) → U22_AAA(X, Y, Z, addC_in_aaa(X, Y, Z))
ADDY_IN_AAA1(X, Y, Z) → ADDC_IN_AAA1(X, Y, Z)
ADDC_IN_AAA1(one(X), one(Y), one(Z)) → U26_AAA(X, Y, Z, addc_in_aaa(X, Y, Z))
ADDC_IN_AAA1(one(X), one(Y), one(Z)) → ADDC_IN_AAA(X, Y, Z)
U36_AAG(R, S, RSS, times_out_aaa(R, S, RS)) → U37_AAG(R, S, RSS, add_in_aag(S, zero(RS), RSS))
U36_AAG(R, S, RSS, times_out_aaa(R, S, RS)) → ADD_IN_AAG(S, zero(RS), RSS)
ADD_IN_AAG(X, b, X) → U1_AAG(X, binaryZ_in_g(X))
ADD_IN_AAG(X, b, X) → BINARYZ_IN_G(X)
BINARYZ_IN_G(zero(X)) → U29_G(X, binaryZ_in_g(X))
BINARYZ_IN_G(zero(X)) → BINARYZ_IN_G(X)
BINARYZ_IN_G(one(X)) → U30_G(X, binary_in_g(X))
BINARYZ_IN_G(one(X)) → BINARY_IN_G(X)
BINARY_IN_G(zero(X)) → U27_G(X, binaryZ_in_g(X))
BINARY_IN_G(zero(X)) → BINARYZ_IN_G(X)
BINARY_IN_G(one(X)) → U28_G(X, binary_in_g(X))
BINARY_IN_G(one(X)) → BINARY_IN_G(X)
ADD_IN_AAG(b, Y, Y) → U2_AAG(Y, binaryZ_in_g(Y))
ADD_IN_AAG(b, Y, Y) → BINARYZ_IN_G(Y)
ADD_IN_AAG(X, Y, Z) → U3_AAG(X, Y, Z, addz_in_aag(X, Y, Z))
ADD_IN_AAG(X, Y, Z) → ADDZ_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(zero(X), zero(Y), zero(Z)) → U10_AAG(X, Y, Z, addz_in_aag(X, Y, Z))
ADDZ_IN_AAG(zero(X), zero(Y), zero(Z)) → ADDZ_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(zero(X), one(Y), one(Z)) → U11_AAG(X, Y, Z, addx_in_aag(X, Y, Z))
ADDZ_IN_AAG(zero(X), one(Y), one(Z)) → ADDX_IN_AAG(X, Y, Z)
ADDX_IN_AAG(one(X), b, one(X)) → U4_AAG(X, binary_in_g(X))
ADDX_IN_AAG(one(X), b, one(X)) → BINARY_IN_G(X)
ADDX_IN_AAG(zero(X), b, zero(X)) → U5_AAG(X, binaryZ_in_g(X))
ADDX_IN_AAG(zero(X), b, zero(X)) → BINARYZ_IN_G(X)
ADDX_IN_AAG(X, Y, Z) → U6_AAG(X, Y, Z, addz_in_aag(X, Y, Z))
ADDX_IN_AAG(X, Y, Z) → ADDZ_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(one(X), zero(Y), one(Z)) → U12_AAG(X, Y, Z, addy_in_aag(X, Y, Z))
ADDZ_IN_AAG(one(X), zero(Y), one(Z)) → ADDY_IN_AAG(X, Y, Z)
ADDY_IN_AAG(b, one(Y), one(Y)) → U7_AAG(Y, binary_in_g(Y))
ADDY_IN_AAG(b, one(Y), one(Y)) → BINARY_IN_G(Y)
ADDY_IN_AAG(b, zero(Y), zero(Y)) → U8_AAG(Y, binaryZ_in_g(Y))
ADDY_IN_AAG(b, zero(Y), zero(Y)) → BINARYZ_IN_G(Y)
ADDY_IN_AAG(X, Y, Z) → U9_AAG(X, Y, Z, addz_in_aag(X, Y, Z))
ADDY_IN_AAG(X, Y, Z) → ADDZ_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(one(X), one(Y), zero(Z)) → U13_AAG(X, Y, Z, addc_in_aag(X, Y, Z))
ADDZ_IN_AAG(one(X), one(Y), zero(Z)) → ADDC_IN_AAG(X, Y, Z)
ADDC_IN_AAG(X, b, Z) → U14_AAG(X, Z, succZ_in_ag(X, Z))
ADDC_IN_AAG(X, b, Z) → SUCCZ_IN_AG(X, Z)
SUCCZ_IN_AG(zero(X), one(X)) → U33_AG(X, binaryZ_in_g(X))
SUCCZ_IN_AG(zero(X), one(X)) → BINARYZ_IN_G(X)
SUCCZ_IN_AG(one(X), zero(Z)) → U34_AG(X, Z, succ_in_ag(X, Z))
SUCCZ_IN_AG(one(X), zero(Z)) → SUCC_IN_AG(X, Z)
SUCC_IN_AG(zero(X), one(X)) → U31_AG(X, binaryZ_in_g(X))
SUCC_IN_AG(zero(X), one(X)) → BINARYZ_IN_G(X)
SUCC_IN_AG(one(X), zero(Z)) → U32_AG(X, Z, succ_in_ag(X, Z))
SUCC_IN_AG(one(X), zero(Z)) → SUCC_IN_AG(X, Z)
ADDC_IN_AAG(b, Y, Z) → U15_AAG(Y, Z, succZ_in_ag(Y, Z))
ADDC_IN_AAG(b, Y, Z) → SUCCZ_IN_AG(Y, Z)
ADDC_IN_AAG(X, Y, Z) → U16_AAG(X, Y, Z, addC_in_aag(X, Y, Z))
ADDC_IN_AAG(X, Y, Z) → ADDC_IN_AAG1(X, Y, Z)
ADDC_IN_AAG1(zero(X), zero(Y), one(Z)) → U23_AAG(X, Y, Z, addz_in_aag(X, Y, Z))
ADDC_IN_AAG1(zero(X), zero(Y), one(Z)) → ADDZ_IN_AAG(X, Y, Z)
ADDC_IN_AAG1(zero(X), one(Y), zero(Z)) → U24_AAG(X, Y, Z, addX_in_aag(X, Y, Z))
ADDC_IN_AAG1(zero(X), one(Y), zero(Z)) → ADDX_IN_AAG1(X, Y, Z)
ADDX_IN_AAG1(zero(X), b, one(X)) → U17_AAG(X, binaryZ_in_g(X))
ADDX_IN_AAG1(zero(X), b, one(X)) → BINARYZ_IN_G(X)
ADDX_IN_AAG1(one(X), b, zero(Z)) → U18_AAG(X, Z, succ_in_ag(X, Z))
ADDX_IN_AAG1(one(X), b, zero(Z)) → SUCC_IN_AG(X, Z)
ADDX_IN_AAG1(X, Y, Z) → U19_AAG(X, Y, Z, addC_in_aag(X, Y, Z))
ADDX_IN_AAG1(X, Y, Z) → ADDC_IN_AAG1(X, Y, Z)
ADDC_IN_AAG1(one(X), zero(Y), zero(Z)) → U25_AAG(X, Y, Z, addY_in_aag(X, Y, Z))
ADDC_IN_AAG1(one(X), zero(Y), zero(Z)) → ADDY_IN_AAG1(X, Y, Z)
ADDY_IN_AAG1(b, zero(Y), one(Y)) → U20_AAG(Y, binaryZ_in_g(Y))
ADDY_IN_AAG1(b, zero(Y), one(Y)) → BINARYZ_IN_G(Y)
ADDY_IN_AAG1(b, one(Y), zero(Z)) → U21_AAG(Y, Z, succ_in_ag(Y, Z))
ADDY_IN_AAG1(b, one(Y), zero(Z)) → SUCC_IN_AG(Y, Z)
ADDY_IN_AAG1(X, Y, Z) → U22_AAG(X, Y, Z, addC_in_aag(X, Y, Z))
ADDY_IN_AAG1(X, Y, Z) → ADDC_IN_AAG1(X, Y, Z)
ADDC_IN_AAG1(one(X), one(Y), one(Z)) → U26_AAG(X, Y, Z, addc_in_aag(X, Y, Z))
ADDC_IN_AAG1(one(X), one(Y), one(Z)) → ADDC_IN_AAG(X, Y, Z)
times_in_aag(one(b), X, X) → times_out_aag(one(b), X, X)
times_in_aag(zero(R), S, zero(RS)) → U35_aag(R, S, RS, times_in_aag(R, S, RS))
times_in_aag(one(R), S, RSS) → U36_aag(R, S, RSS, times_in_aaa(R, S, RS))
times_in_aaa(one(b), X, X) → times_out_aaa(one(b), X, X)
times_in_aaa(zero(R), S, zero(RS)) → U35_aaa(R, S, RS, times_in_aaa(R, S, RS))
times_in_aaa(one(R), S, RSS) → U36_aaa(R, S, RSS, times_in_aaa(R, S, RS))
U36_aaa(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aaa(R, S, RSS, add_in_aaa(S, zero(RS), RSS))
add_in_aaa(b, b, b) → add_out_aaa(b, b, b)
add_in_aaa(X, b, X) → U1_aaa(X, binaryZ_in_a(X))
binaryZ_in_a(zero(X)) → U29_a(X, binaryZ_in_a(X))
binaryZ_in_a(one(X)) → U30_a(X, binary_in_a(X))
binary_in_a(b) → binary_out_a(b)
binary_in_a(zero(X)) → U27_a(X, binaryZ_in_a(X))
U27_a(X, binaryZ_out_a(X)) → binary_out_a(zero(X))
binary_in_a(one(X)) → U28_a(X, binary_in_a(X))
U28_a(X, binary_out_a(X)) → binary_out_a(one(X))
U30_a(X, binary_out_a(X)) → binaryZ_out_a(one(X))
U29_a(X, binaryZ_out_a(X)) → binaryZ_out_a(zero(X))
U1_aaa(X, binaryZ_out_a(X)) → add_out_aaa(X, b, X)
add_in_aaa(b, Y, Y) → U2_aaa(Y, binaryZ_in_a(Y))
U2_aaa(Y, binaryZ_out_a(Y)) → add_out_aaa(b, Y, Y)
add_in_aaa(X, Y, Z) → U3_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), zero(Y), zero(Z)) → U10_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), one(Y), one(Z)) → U11_aaa(X, Y, Z, addx_in_aaa(X, Y, Z))
addx_in_aaa(one(X), b, one(X)) → U4_aaa(X, binary_in_a(X))
U4_aaa(X, binary_out_a(X)) → addx_out_aaa(one(X), b, one(X))
addx_in_aaa(zero(X), b, zero(X)) → U5_aaa(X, binaryZ_in_a(X))
U5_aaa(X, binaryZ_out_a(X)) → addx_out_aaa(zero(X), b, zero(X))
addx_in_aaa(X, Y, Z) → U6_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), zero(Y), one(Z)) → U12_aaa(X, Y, Z, addy_in_aaa(X, Y, Z))
addy_in_aaa(b, one(Y), one(Y)) → U7_aaa(Y, binary_in_a(Y))
U7_aaa(Y, binary_out_a(Y)) → addy_out_aaa(b, one(Y), one(Y))
addy_in_aaa(b, zero(Y), zero(Y)) → U8_aaa(Y, binaryZ_in_a(Y))
U8_aaa(Y, binaryZ_out_a(Y)) → addy_out_aaa(b, zero(Y), zero(Y))
addy_in_aaa(X, Y, Z) → U9_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), one(Y), zero(Z)) → U13_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
addc_in_aaa(b, b, one(b)) → addc_out_aaa(b, b, one(b))
addc_in_aaa(X, b, Z) → U14_aaa(X, Z, succZ_in_aa(X, Z))
succZ_in_aa(zero(X), one(X)) → U33_aa(X, binaryZ_in_a(X))
U33_aa(X, binaryZ_out_a(X)) → succZ_out_aa(zero(X), one(X))
succZ_in_aa(one(X), zero(Z)) → U34_aa(X, Z, succ_in_aa(X, Z))
succ_in_aa(b, one(b)) → succ_out_aa(b, one(b))
succ_in_aa(zero(X), one(X)) → U31_aa(X, binaryZ_in_a(X))
U31_aa(X, binaryZ_out_a(X)) → succ_out_aa(zero(X), one(X))
succ_in_aa(one(X), zero(Z)) → U32_aa(X, Z, succ_in_aa(X, Z))
U32_aa(X, Z, succ_out_aa(X, Z)) → succ_out_aa(one(X), zero(Z))
U34_aa(X, Z, succ_out_aa(X, Z)) → succZ_out_aa(one(X), zero(Z))
U14_aaa(X, Z, succZ_out_aa(X, Z)) → addc_out_aaa(X, b, Z)
addc_in_aaa(b, Y, Z) → U15_aaa(Y, Z, succZ_in_aa(Y, Z))
U15_aaa(Y, Z, succZ_out_aa(Y, Z)) → addc_out_aaa(b, Y, Z)
addc_in_aaa(X, Y, Z) → U16_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(zero(X), zero(Y), one(Z)) → U23_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
U23_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), zero(Y), one(Z))
addC_in_aaa(zero(X), one(Y), zero(Z)) → U24_aaa(X, Y, Z, addX_in_aaa(X, Y, Z))
addX_in_aaa(zero(X), b, one(X)) → U17_aaa(X, binaryZ_in_a(X))
U17_aaa(X, binaryZ_out_a(X)) → addX_out_aaa(zero(X), b, one(X))
addX_in_aaa(one(X), b, zero(Z)) → U18_aaa(X, Z, succ_in_aa(X, Z))
U18_aaa(X, Z, succ_out_aa(X, Z)) → addX_out_aaa(one(X), b, zero(Z))
addX_in_aaa(X, Y, Z) → U19_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), zero(Y), zero(Z)) → U25_aaa(X, Y, Z, addY_in_aaa(X, Y, Z))
addY_in_aaa(b, zero(Y), one(Y)) → U20_aaa(Y, binaryZ_in_a(Y))
U20_aaa(Y, binaryZ_out_a(Y)) → addY_out_aaa(b, zero(Y), one(Y))
addY_in_aaa(b, one(Y), zero(Z)) → U21_aaa(Y, Z, succ_in_aa(Y, Z))
U21_aaa(Y, Z, succ_out_aa(Y, Z)) → addY_out_aaa(b, one(Y), zero(Z))
addY_in_aaa(X, Y, Z) → U22_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), one(Y), one(Z)) → U26_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
U26_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), one(Y), one(Z))
U22_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addY_out_aaa(X, Y, Z)
U25_aaa(X, Y, Z, addY_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), zero(Y), zero(Z))
U19_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addX_out_aaa(X, Y, Z)
U24_aaa(X, Y, Z, addX_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), one(Y), zero(Z))
U16_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addc_out_aaa(X, Y, Z)
U13_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), one(Y), zero(Z))
U9_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addy_out_aaa(X, Y, Z)
U12_aaa(X, Y, Z, addy_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), zero(Y), one(Z))
U6_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addx_out_aaa(X, Y, Z)
U11_aaa(X, Y, Z, addx_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), one(Y), one(Z))
U10_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), zero(Y), zero(Z))
U3_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → add_out_aaa(X, Y, Z)
U37_aaa(R, S, RSS, add_out_aaa(S, zero(RS), RSS)) → times_out_aaa(one(R), S, RSS)
U35_aaa(R, S, RS, times_out_aaa(R, S, RS)) → times_out_aaa(zero(R), S, zero(RS))
U36_aag(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aag(R, S, RSS, add_in_aag(S, zero(RS), RSS))
add_in_aag(b, b, b) → add_out_aag(b, b, b)
add_in_aag(X, b, X) → U1_aag(X, binaryZ_in_g(X))
binaryZ_in_g(zero(X)) → U29_g(X, binaryZ_in_g(X))
binaryZ_in_g(one(X)) → U30_g(X, binary_in_g(X))
binary_in_g(b) → binary_out_g(b)
binary_in_g(zero(X)) → U27_g(X, binaryZ_in_g(X))
U27_g(X, binaryZ_out_g(X)) → binary_out_g(zero(X))
binary_in_g(one(X)) → U28_g(X, binary_in_g(X))
U28_g(X, binary_out_g(X)) → binary_out_g(one(X))
U30_g(X, binary_out_g(X)) → binaryZ_out_g(one(X))
U29_g(X, binaryZ_out_g(X)) → binaryZ_out_g(zero(X))
U1_aag(X, binaryZ_out_g(X)) → add_out_aag(X, b, X)
add_in_aag(b, Y, Y) → U2_aag(Y, binaryZ_in_g(Y))
U2_aag(Y, binaryZ_out_g(Y)) → add_out_aag(b, Y, Y)
add_in_aag(X, Y, Z) → U3_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), zero(Y), zero(Z)) → U10_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), one(Y), one(Z)) → U11_aag(X, Y, Z, addx_in_aag(X, Y, Z))
addx_in_aag(one(X), b, one(X)) → U4_aag(X, binary_in_g(X))
U4_aag(X, binary_out_g(X)) → addx_out_aag(one(X), b, one(X))
addx_in_aag(zero(X), b, zero(X)) → U5_aag(X, binaryZ_in_g(X))
U5_aag(X, binaryZ_out_g(X)) → addx_out_aag(zero(X), b, zero(X))
addx_in_aag(X, Y, Z) → U6_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), zero(Y), one(Z)) → U12_aag(X, Y, Z, addy_in_aag(X, Y, Z))
addy_in_aag(b, one(Y), one(Y)) → U7_aag(Y, binary_in_g(Y))
U7_aag(Y, binary_out_g(Y)) → addy_out_aag(b, one(Y), one(Y))
addy_in_aag(b, zero(Y), zero(Y)) → U8_aag(Y, binaryZ_in_g(Y))
U8_aag(Y, binaryZ_out_g(Y)) → addy_out_aag(b, zero(Y), zero(Y))
addy_in_aag(X, Y, Z) → U9_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), one(Y), zero(Z)) → U13_aag(X, Y, Z, addc_in_aag(X, Y, Z))
addc_in_aag(b, b, one(b)) → addc_out_aag(b, b, one(b))
addc_in_aag(X, b, Z) → U14_aag(X, Z, succZ_in_ag(X, Z))
succZ_in_ag(zero(X), one(X)) → U33_ag(X, binaryZ_in_g(X))
U33_ag(X, binaryZ_out_g(X)) → succZ_out_ag(zero(X), one(X))
succZ_in_ag(one(X), zero(Z)) → U34_ag(X, Z, succ_in_ag(X, Z))
succ_in_ag(b, one(b)) → succ_out_ag(b, one(b))
succ_in_ag(zero(X), one(X)) → U31_ag(X, binaryZ_in_g(X))
U31_ag(X, binaryZ_out_g(X)) → succ_out_ag(zero(X), one(X))
succ_in_ag(one(X), zero(Z)) → U32_ag(X, Z, succ_in_ag(X, Z))
U32_ag(X, Z, succ_out_ag(X, Z)) → succ_out_ag(one(X), zero(Z))
U34_ag(X, Z, succ_out_ag(X, Z)) → succZ_out_ag(one(X), zero(Z))
U14_aag(X, Z, succZ_out_ag(X, Z)) → addc_out_aag(X, b, Z)
addc_in_aag(b, Y, Z) → U15_aag(Y, Z, succZ_in_ag(Y, Z))
U15_aag(Y, Z, succZ_out_ag(Y, Z)) → addc_out_aag(b, Y, Z)
addc_in_aag(X, Y, Z) → U16_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(zero(X), zero(Y), one(Z)) → U23_aag(X, Y, Z, addz_in_aag(X, Y, Z))
U23_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addC_out_aag(zero(X), zero(Y), one(Z))
addC_in_aag(zero(X), one(Y), zero(Z)) → U24_aag(X, Y, Z, addX_in_aag(X, Y, Z))
addX_in_aag(zero(X), b, one(X)) → U17_aag(X, binaryZ_in_g(X))
U17_aag(X, binaryZ_out_g(X)) → addX_out_aag(zero(X), b, one(X))
addX_in_aag(one(X), b, zero(Z)) → U18_aag(X, Z, succ_in_ag(X, Z))
U18_aag(X, Z, succ_out_ag(X, Z)) → addX_out_aag(one(X), b, zero(Z))
addX_in_aag(X, Y, Z) → U19_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), zero(Y), zero(Z)) → U25_aag(X, Y, Z, addY_in_aag(X, Y, Z))
addY_in_aag(b, zero(Y), one(Y)) → U20_aag(Y, binaryZ_in_g(Y))
U20_aag(Y, binaryZ_out_g(Y)) → addY_out_aag(b, zero(Y), one(Y))
addY_in_aag(b, one(Y), zero(Z)) → U21_aag(Y, Z, succ_in_ag(Y, Z))
U21_aag(Y, Z, succ_out_ag(Y, Z)) → addY_out_aag(b, one(Y), zero(Z))
addY_in_aag(X, Y, Z) → U22_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), one(Y), one(Z)) → U26_aag(X, Y, Z, addc_in_aag(X, Y, Z))
U26_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addC_out_aag(one(X), one(Y), one(Z))
U22_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addY_out_aag(X, Y, Z)
U25_aag(X, Y, Z, addY_out_aag(X, Y, Z)) → addC_out_aag(one(X), zero(Y), zero(Z))
U19_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addX_out_aag(X, Y, Z)
U24_aag(X, Y, Z, addX_out_aag(X, Y, Z)) → addC_out_aag(zero(X), one(Y), zero(Z))
U16_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addc_out_aag(X, Y, Z)
U13_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addz_out_aag(one(X), one(Y), zero(Z))
U9_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addy_out_aag(X, Y, Z)
U12_aag(X, Y, Z, addy_out_aag(X, Y, Z)) → addz_out_aag(one(X), zero(Y), one(Z))
U6_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addx_out_aag(X, Y, Z)
U11_aag(X, Y, Z, addx_out_aag(X, Y, Z)) → addz_out_aag(zero(X), one(Y), one(Z))
U10_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addz_out_aag(zero(X), zero(Y), zero(Z))
U3_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → add_out_aag(X, Y, Z)
U37_aag(R, S, RSS, add_out_aag(S, zero(RS), RSS)) → times_out_aag(one(R), S, RSS)
U35_aag(R, S, RS, times_out_aag(R, S, RS)) → times_out_aag(zero(R), S, zero(RS))
BINARYZ_IN_G(one(X)) → BINARY_IN_G(X)
BINARY_IN_G(zero(X)) → BINARYZ_IN_G(X)
BINARYZ_IN_G(zero(X)) → BINARYZ_IN_G(X)
BINARY_IN_G(one(X)) → BINARY_IN_G(X)
times_in_aag(one(b), X, X) → times_out_aag(one(b), X, X)
times_in_aag(zero(R), S, zero(RS)) → U35_aag(R, S, RS, times_in_aag(R, S, RS))
times_in_aag(one(R), S, RSS) → U36_aag(R, S, RSS, times_in_aaa(R, S, RS))
times_in_aaa(one(b), X, X) → times_out_aaa(one(b), X, X)
times_in_aaa(zero(R), S, zero(RS)) → U35_aaa(R, S, RS, times_in_aaa(R, S, RS))
times_in_aaa(one(R), S, RSS) → U36_aaa(R, S, RSS, times_in_aaa(R, S, RS))
U36_aaa(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aaa(R, S, RSS, add_in_aaa(S, zero(RS), RSS))
add_in_aaa(b, b, b) → add_out_aaa(b, b, b)
add_in_aaa(X, b, X) → U1_aaa(X, binaryZ_in_a(X))
binaryZ_in_a(zero(X)) → U29_a(X, binaryZ_in_a(X))
binaryZ_in_a(one(X)) → U30_a(X, binary_in_a(X))
binary_in_a(b) → binary_out_a(b)
binary_in_a(zero(X)) → U27_a(X, binaryZ_in_a(X))
U27_a(X, binaryZ_out_a(X)) → binary_out_a(zero(X))
binary_in_a(one(X)) → U28_a(X, binary_in_a(X))
U28_a(X, binary_out_a(X)) → binary_out_a(one(X))
U30_a(X, binary_out_a(X)) → binaryZ_out_a(one(X))
U29_a(X, binaryZ_out_a(X)) → binaryZ_out_a(zero(X))
U1_aaa(X, binaryZ_out_a(X)) → add_out_aaa(X, b, X)
add_in_aaa(b, Y, Y) → U2_aaa(Y, binaryZ_in_a(Y))
U2_aaa(Y, binaryZ_out_a(Y)) → add_out_aaa(b, Y, Y)
add_in_aaa(X, Y, Z) → U3_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), zero(Y), zero(Z)) → U10_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), one(Y), one(Z)) → U11_aaa(X, Y, Z, addx_in_aaa(X, Y, Z))
addx_in_aaa(one(X), b, one(X)) → U4_aaa(X, binary_in_a(X))
U4_aaa(X, binary_out_a(X)) → addx_out_aaa(one(X), b, one(X))
addx_in_aaa(zero(X), b, zero(X)) → U5_aaa(X, binaryZ_in_a(X))
U5_aaa(X, binaryZ_out_a(X)) → addx_out_aaa(zero(X), b, zero(X))
addx_in_aaa(X, Y, Z) → U6_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), zero(Y), one(Z)) → U12_aaa(X, Y, Z, addy_in_aaa(X, Y, Z))
addy_in_aaa(b, one(Y), one(Y)) → U7_aaa(Y, binary_in_a(Y))
U7_aaa(Y, binary_out_a(Y)) → addy_out_aaa(b, one(Y), one(Y))
addy_in_aaa(b, zero(Y), zero(Y)) → U8_aaa(Y, binaryZ_in_a(Y))
U8_aaa(Y, binaryZ_out_a(Y)) → addy_out_aaa(b, zero(Y), zero(Y))
addy_in_aaa(X, Y, Z) → U9_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), one(Y), zero(Z)) → U13_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
addc_in_aaa(b, b, one(b)) → addc_out_aaa(b, b, one(b))
addc_in_aaa(X, b, Z) → U14_aaa(X, Z, succZ_in_aa(X, Z))
succZ_in_aa(zero(X), one(X)) → U33_aa(X, binaryZ_in_a(X))
U33_aa(X, binaryZ_out_a(X)) → succZ_out_aa(zero(X), one(X))
succZ_in_aa(one(X), zero(Z)) → U34_aa(X, Z, succ_in_aa(X, Z))
succ_in_aa(b, one(b)) → succ_out_aa(b, one(b))
succ_in_aa(zero(X), one(X)) → U31_aa(X, binaryZ_in_a(X))
U31_aa(X, binaryZ_out_a(X)) → succ_out_aa(zero(X), one(X))
succ_in_aa(one(X), zero(Z)) → U32_aa(X, Z, succ_in_aa(X, Z))
U32_aa(X, Z, succ_out_aa(X, Z)) → succ_out_aa(one(X), zero(Z))
U34_aa(X, Z, succ_out_aa(X, Z)) → succZ_out_aa(one(X), zero(Z))
U14_aaa(X, Z, succZ_out_aa(X, Z)) → addc_out_aaa(X, b, Z)
addc_in_aaa(b, Y, Z) → U15_aaa(Y, Z, succZ_in_aa(Y, Z))
U15_aaa(Y, Z, succZ_out_aa(Y, Z)) → addc_out_aaa(b, Y, Z)
addc_in_aaa(X, Y, Z) → U16_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(zero(X), zero(Y), one(Z)) → U23_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
U23_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), zero(Y), one(Z))
addC_in_aaa(zero(X), one(Y), zero(Z)) → U24_aaa(X, Y, Z, addX_in_aaa(X, Y, Z))
addX_in_aaa(zero(X), b, one(X)) → U17_aaa(X, binaryZ_in_a(X))
U17_aaa(X, binaryZ_out_a(X)) → addX_out_aaa(zero(X), b, one(X))
addX_in_aaa(one(X), b, zero(Z)) → U18_aaa(X, Z, succ_in_aa(X, Z))
U18_aaa(X, Z, succ_out_aa(X, Z)) → addX_out_aaa(one(X), b, zero(Z))
addX_in_aaa(X, Y, Z) → U19_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), zero(Y), zero(Z)) → U25_aaa(X, Y, Z, addY_in_aaa(X, Y, Z))
addY_in_aaa(b, zero(Y), one(Y)) → U20_aaa(Y, binaryZ_in_a(Y))
U20_aaa(Y, binaryZ_out_a(Y)) → addY_out_aaa(b, zero(Y), one(Y))
addY_in_aaa(b, one(Y), zero(Z)) → U21_aaa(Y, Z, succ_in_aa(Y, Z))
U21_aaa(Y, Z, succ_out_aa(Y, Z)) → addY_out_aaa(b, one(Y), zero(Z))
addY_in_aaa(X, Y, Z) → U22_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), one(Y), one(Z)) → U26_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
U26_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), one(Y), one(Z))
U22_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addY_out_aaa(X, Y, Z)
U25_aaa(X, Y, Z, addY_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), zero(Y), zero(Z))
U19_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addX_out_aaa(X, Y, Z)
U24_aaa(X, Y, Z, addX_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), one(Y), zero(Z))
U16_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addc_out_aaa(X, Y, Z)
U13_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), one(Y), zero(Z))
U9_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addy_out_aaa(X, Y, Z)
U12_aaa(X, Y, Z, addy_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), zero(Y), one(Z))
U6_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addx_out_aaa(X, Y, Z)
U11_aaa(X, Y, Z, addx_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), one(Y), one(Z))
U10_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), zero(Y), zero(Z))
U3_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → add_out_aaa(X, Y, Z)
U37_aaa(R, S, RSS, add_out_aaa(S, zero(RS), RSS)) → times_out_aaa(one(R), S, RSS)
U35_aaa(R, S, RS, times_out_aaa(R, S, RS)) → times_out_aaa(zero(R), S, zero(RS))
U36_aag(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aag(R, S, RSS, add_in_aag(S, zero(RS), RSS))
add_in_aag(b, b, b) → add_out_aag(b, b, b)
add_in_aag(X, b, X) → U1_aag(X, binaryZ_in_g(X))
binaryZ_in_g(zero(X)) → U29_g(X, binaryZ_in_g(X))
binaryZ_in_g(one(X)) → U30_g(X, binary_in_g(X))
binary_in_g(b) → binary_out_g(b)
binary_in_g(zero(X)) → U27_g(X, binaryZ_in_g(X))
U27_g(X, binaryZ_out_g(X)) → binary_out_g(zero(X))
binary_in_g(one(X)) → U28_g(X, binary_in_g(X))
U28_g(X, binary_out_g(X)) → binary_out_g(one(X))
U30_g(X, binary_out_g(X)) → binaryZ_out_g(one(X))
U29_g(X, binaryZ_out_g(X)) → binaryZ_out_g(zero(X))
U1_aag(X, binaryZ_out_g(X)) → add_out_aag(X, b, X)
add_in_aag(b, Y, Y) → U2_aag(Y, binaryZ_in_g(Y))
U2_aag(Y, binaryZ_out_g(Y)) → add_out_aag(b, Y, Y)
add_in_aag(X, Y, Z) → U3_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), zero(Y), zero(Z)) → U10_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), one(Y), one(Z)) → U11_aag(X, Y, Z, addx_in_aag(X, Y, Z))
addx_in_aag(one(X), b, one(X)) → U4_aag(X, binary_in_g(X))
U4_aag(X, binary_out_g(X)) → addx_out_aag(one(X), b, one(X))
addx_in_aag(zero(X), b, zero(X)) → U5_aag(X, binaryZ_in_g(X))
U5_aag(X, binaryZ_out_g(X)) → addx_out_aag(zero(X), b, zero(X))
addx_in_aag(X, Y, Z) → U6_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), zero(Y), one(Z)) → U12_aag(X, Y, Z, addy_in_aag(X, Y, Z))
addy_in_aag(b, one(Y), one(Y)) → U7_aag(Y, binary_in_g(Y))
U7_aag(Y, binary_out_g(Y)) → addy_out_aag(b, one(Y), one(Y))
addy_in_aag(b, zero(Y), zero(Y)) → U8_aag(Y, binaryZ_in_g(Y))
U8_aag(Y, binaryZ_out_g(Y)) → addy_out_aag(b, zero(Y), zero(Y))
addy_in_aag(X, Y, Z) → U9_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), one(Y), zero(Z)) → U13_aag(X, Y, Z, addc_in_aag(X, Y, Z))
addc_in_aag(b, b, one(b)) → addc_out_aag(b, b, one(b))
addc_in_aag(X, b, Z) → U14_aag(X, Z, succZ_in_ag(X, Z))
succZ_in_ag(zero(X), one(X)) → U33_ag(X, binaryZ_in_g(X))
U33_ag(X, binaryZ_out_g(X)) → succZ_out_ag(zero(X), one(X))
succZ_in_ag(one(X), zero(Z)) → U34_ag(X, Z, succ_in_ag(X, Z))
succ_in_ag(b, one(b)) → succ_out_ag(b, one(b))
succ_in_ag(zero(X), one(X)) → U31_ag(X, binaryZ_in_g(X))
U31_ag(X, binaryZ_out_g(X)) → succ_out_ag(zero(X), one(X))
succ_in_ag(one(X), zero(Z)) → U32_ag(X, Z, succ_in_ag(X, Z))
U32_ag(X, Z, succ_out_ag(X, Z)) → succ_out_ag(one(X), zero(Z))
U34_ag(X, Z, succ_out_ag(X, Z)) → succZ_out_ag(one(X), zero(Z))
U14_aag(X, Z, succZ_out_ag(X, Z)) → addc_out_aag(X, b, Z)
addc_in_aag(b, Y, Z) → U15_aag(Y, Z, succZ_in_ag(Y, Z))
U15_aag(Y, Z, succZ_out_ag(Y, Z)) → addc_out_aag(b, Y, Z)
addc_in_aag(X, Y, Z) → U16_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(zero(X), zero(Y), one(Z)) → U23_aag(X, Y, Z, addz_in_aag(X, Y, Z))
U23_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addC_out_aag(zero(X), zero(Y), one(Z))
addC_in_aag(zero(X), one(Y), zero(Z)) → U24_aag(X, Y, Z, addX_in_aag(X, Y, Z))
addX_in_aag(zero(X), b, one(X)) → U17_aag(X, binaryZ_in_g(X))
U17_aag(X, binaryZ_out_g(X)) → addX_out_aag(zero(X), b, one(X))
addX_in_aag(one(X), b, zero(Z)) → U18_aag(X, Z, succ_in_ag(X, Z))
U18_aag(X, Z, succ_out_ag(X, Z)) → addX_out_aag(one(X), b, zero(Z))
addX_in_aag(X, Y, Z) → U19_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), zero(Y), zero(Z)) → U25_aag(X, Y, Z, addY_in_aag(X, Y, Z))
addY_in_aag(b, zero(Y), one(Y)) → U20_aag(Y, binaryZ_in_g(Y))
U20_aag(Y, binaryZ_out_g(Y)) → addY_out_aag(b, zero(Y), one(Y))
addY_in_aag(b, one(Y), zero(Z)) → U21_aag(Y, Z, succ_in_ag(Y, Z))
U21_aag(Y, Z, succ_out_ag(Y, Z)) → addY_out_aag(b, one(Y), zero(Z))
addY_in_aag(X, Y, Z) → U22_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), one(Y), one(Z)) → U26_aag(X, Y, Z, addc_in_aag(X, Y, Z))
U26_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addC_out_aag(one(X), one(Y), one(Z))
U22_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addY_out_aag(X, Y, Z)
U25_aag(X, Y, Z, addY_out_aag(X, Y, Z)) → addC_out_aag(one(X), zero(Y), zero(Z))
U19_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addX_out_aag(X, Y, Z)
U24_aag(X, Y, Z, addX_out_aag(X, Y, Z)) → addC_out_aag(zero(X), one(Y), zero(Z))
U16_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addc_out_aag(X, Y, Z)
U13_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addz_out_aag(one(X), one(Y), zero(Z))
U9_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addy_out_aag(X, Y, Z)
U12_aag(X, Y, Z, addy_out_aag(X, Y, Z)) → addz_out_aag(one(X), zero(Y), one(Z))
U6_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addx_out_aag(X, Y, Z)
U11_aag(X, Y, Z, addx_out_aag(X, Y, Z)) → addz_out_aag(zero(X), one(Y), one(Z))
U10_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addz_out_aag(zero(X), zero(Y), zero(Z))
U3_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → add_out_aag(X, Y, Z)
U37_aag(R, S, RSS, add_out_aag(S, zero(RS), RSS)) → times_out_aag(one(R), S, RSS)
U35_aag(R, S, RS, times_out_aag(R, S, RS)) → times_out_aag(zero(R), S, zero(RS))
BINARYZ_IN_G(one(X)) → BINARY_IN_G(X)
BINARY_IN_G(zero(X)) → BINARYZ_IN_G(X)
BINARYZ_IN_G(zero(X)) → BINARYZ_IN_G(X)
BINARY_IN_G(one(X)) → BINARY_IN_G(X)
BINARYZ_IN_G(one(X)) → BINARY_IN_G(X)
BINARY_IN_G(zero(X)) → BINARYZ_IN_G(X)
BINARYZ_IN_G(zero(X)) → BINARYZ_IN_G(X)
BINARY_IN_G(one(X)) → BINARY_IN_G(X)
From the DPs we obtained the following set of size-change graphs:
SUCC_IN_AG(one(X), zero(Z)) → SUCC_IN_AG(X, Z)
times_in_aag(one(b), X, X) → times_out_aag(one(b), X, X)
times_in_aag(zero(R), S, zero(RS)) → U35_aag(R, S, RS, times_in_aag(R, S, RS))
times_in_aag(one(R), S, RSS) → U36_aag(R, S, RSS, times_in_aaa(R, S, RS))
times_in_aaa(one(b), X, X) → times_out_aaa(one(b), X, X)
times_in_aaa(zero(R), S, zero(RS)) → U35_aaa(R, S, RS, times_in_aaa(R, S, RS))
times_in_aaa(one(R), S, RSS) → U36_aaa(R, S, RSS, times_in_aaa(R, S, RS))
U36_aaa(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aaa(R, S, RSS, add_in_aaa(S, zero(RS), RSS))
add_in_aaa(b, b, b) → add_out_aaa(b, b, b)
add_in_aaa(X, b, X) → U1_aaa(X, binaryZ_in_a(X))
binaryZ_in_a(zero(X)) → U29_a(X, binaryZ_in_a(X))
binaryZ_in_a(one(X)) → U30_a(X, binary_in_a(X))
binary_in_a(b) → binary_out_a(b)
binary_in_a(zero(X)) → U27_a(X, binaryZ_in_a(X))
U27_a(X, binaryZ_out_a(X)) → binary_out_a(zero(X))
binary_in_a(one(X)) → U28_a(X, binary_in_a(X))
U28_a(X, binary_out_a(X)) → binary_out_a(one(X))
U30_a(X, binary_out_a(X)) → binaryZ_out_a(one(X))
U29_a(X, binaryZ_out_a(X)) → binaryZ_out_a(zero(X))
U1_aaa(X, binaryZ_out_a(X)) → add_out_aaa(X, b, X)
add_in_aaa(b, Y, Y) → U2_aaa(Y, binaryZ_in_a(Y))
U2_aaa(Y, binaryZ_out_a(Y)) → add_out_aaa(b, Y, Y)
add_in_aaa(X, Y, Z) → U3_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), zero(Y), zero(Z)) → U10_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), one(Y), one(Z)) → U11_aaa(X, Y, Z, addx_in_aaa(X, Y, Z))
addx_in_aaa(one(X), b, one(X)) → U4_aaa(X, binary_in_a(X))
U4_aaa(X, binary_out_a(X)) → addx_out_aaa(one(X), b, one(X))
addx_in_aaa(zero(X), b, zero(X)) → U5_aaa(X, binaryZ_in_a(X))
U5_aaa(X, binaryZ_out_a(X)) → addx_out_aaa(zero(X), b, zero(X))
addx_in_aaa(X, Y, Z) → U6_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), zero(Y), one(Z)) → U12_aaa(X, Y, Z, addy_in_aaa(X, Y, Z))
addy_in_aaa(b, one(Y), one(Y)) → U7_aaa(Y, binary_in_a(Y))
U7_aaa(Y, binary_out_a(Y)) → addy_out_aaa(b, one(Y), one(Y))
addy_in_aaa(b, zero(Y), zero(Y)) → U8_aaa(Y, binaryZ_in_a(Y))
U8_aaa(Y, binaryZ_out_a(Y)) → addy_out_aaa(b, zero(Y), zero(Y))
addy_in_aaa(X, Y, Z) → U9_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), one(Y), zero(Z)) → U13_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
addc_in_aaa(b, b, one(b)) → addc_out_aaa(b, b, one(b))
addc_in_aaa(X, b, Z) → U14_aaa(X, Z, succZ_in_aa(X, Z))
succZ_in_aa(zero(X), one(X)) → U33_aa(X, binaryZ_in_a(X))
U33_aa(X, binaryZ_out_a(X)) → succZ_out_aa(zero(X), one(X))
succZ_in_aa(one(X), zero(Z)) → U34_aa(X, Z, succ_in_aa(X, Z))
succ_in_aa(b, one(b)) → succ_out_aa(b, one(b))
succ_in_aa(zero(X), one(X)) → U31_aa(X, binaryZ_in_a(X))
U31_aa(X, binaryZ_out_a(X)) → succ_out_aa(zero(X), one(X))
succ_in_aa(one(X), zero(Z)) → U32_aa(X, Z, succ_in_aa(X, Z))
U32_aa(X, Z, succ_out_aa(X, Z)) → succ_out_aa(one(X), zero(Z))
U34_aa(X, Z, succ_out_aa(X, Z)) → succZ_out_aa(one(X), zero(Z))
U14_aaa(X, Z, succZ_out_aa(X, Z)) → addc_out_aaa(X, b, Z)
addc_in_aaa(b, Y, Z) → U15_aaa(Y, Z, succZ_in_aa(Y, Z))
U15_aaa(Y, Z, succZ_out_aa(Y, Z)) → addc_out_aaa(b, Y, Z)
addc_in_aaa(X, Y, Z) → U16_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(zero(X), zero(Y), one(Z)) → U23_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
U23_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), zero(Y), one(Z))
addC_in_aaa(zero(X), one(Y), zero(Z)) → U24_aaa(X, Y, Z, addX_in_aaa(X, Y, Z))
addX_in_aaa(zero(X), b, one(X)) → U17_aaa(X, binaryZ_in_a(X))
U17_aaa(X, binaryZ_out_a(X)) → addX_out_aaa(zero(X), b, one(X))
addX_in_aaa(one(X), b, zero(Z)) → U18_aaa(X, Z, succ_in_aa(X, Z))
U18_aaa(X, Z, succ_out_aa(X, Z)) → addX_out_aaa(one(X), b, zero(Z))
addX_in_aaa(X, Y, Z) → U19_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), zero(Y), zero(Z)) → U25_aaa(X, Y, Z, addY_in_aaa(X, Y, Z))
addY_in_aaa(b, zero(Y), one(Y)) → U20_aaa(Y, binaryZ_in_a(Y))
U20_aaa(Y, binaryZ_out_a(Y)) → addY_out_aaa(b, zero(Y), one(Y))
addY_in_aaa(b, one(Y), zero(Z)) → U21_aaa(Y, Z, succ_in_aa(Y, Z))
U21_aaa(Y, Z, succ_out_aa(Y, Z)) → addY_out_aaa(b, one(Y), zero(Z))
addY_in_aaa(X, Y, Z) → U22_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), one(Y), one(Z)) → U26_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
U26_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), one(Y), one(Z))
U22_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addY_out_aaa(X, Y, Z)
U25_aaa(X, Y, Z, addY_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), zero(Y), zero(Z))
U19_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addX_out_aaa(X, Y, Z)
U24_aaa(X, Y, Z, addX_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), one(Y), zero(Z))
U16_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addc_out_aaa(X, Y, Z)
U13_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), one(Y), zero(Z))
U9_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addy_out_aaa(X, Y, Z)
U12_aaa(X, Y, Z, addy_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), zero(Y), one(Z))
U6_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addx_out_aaa(X, Y, Z)
U11_aaa(X, Y, Z, addx_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), one(Y), one(Z))
U10_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), zero(Y), zero(Z))
U3_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → add_out_aaa(X, Y, Z)
U37_aaa(R, S, RSS, add_out_aaa(S, zero(RS), RSS)) → times_out_aaa(one(R), S, RSS)
U35_aaa(R, S, RS, times_out_aaa(R, S, RS)) → times_out_aaa(zero(R), S, zero(RS))
U36_aag(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aag(R, S, RSS, add_in_aag(S, zero(RS), RSS))
add_in_aag(b, b, b) → add_out_aag(b, b, b)
add_in_aag(X, b, X) → U1_aag(X, binaryZ_in_g(X))
binaryZ_in_g(zero(X)) → U29_g(X, binaryZ_in_g(X))
binaryZ_in_g(one(X)) → U30_g(X, binary_in_g(X))
binary_in_g(b) → binary_out_g(b)
binary_in_g(zero(X)) → U27_g(X, binaryZ_in_g(X))
U27_g(X, binaryZ_out_g(X)) → binary_out_g(zero(X))
binary_in_g(one(X)) → U28_g(X, binary_in_g(X))
U28_g(X, binary_out_g(X)) → binary_out_g(one(X))
U30_g(X, binary_out_g(X)) → binaryZ_out_g(one(X))
U29_g(X, binaryZ_out_g(X)) → binaryZ_out_g(zero(X))
U1_aag(X, binaryZ_out_g(X)) → add_out_aag(X, b, X)
add_in_aag(b, Y, Y) → U2_aag(Y, binaryZ_in_g(Y))
U2_aag(Y, binaryZ_out_g(Y)) → add_out_aag(b, Y, Y)
add_in_aag(X, Y, Z) → U3_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), zero(Y), zero(Z)) → U10_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), one(Y), one(Z)) → U11_aag(X, Y, Z, addx_in_aag(X, Y, Z))
addx_in_aag(one(X), b, one(X)) → U4_aag(X, binary_in_g(X))
U4_aag(X, binary_out_g(X)) → addx_out_aag(one(X), b, one(X))
addx_in_aag(zero(X), b, zero(X)) → U5_aag(X, binaryZ_in_g(X))
U5_aag(X, binaryZ_out_g(X)) → addx_out_aag(zero(X), b, zero(X))
addx_in_aag(X, Y, Z) → U6_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), zero(Y), one(Z)) → U12_aag(X, Y, Z, addy_in_aag(X, Y, Z))
addy_in_aag(b, one(Y), one(Y)) → U7_aag(Y, binary_in_g(Y))
U7_aag(Y, binary_out_g(Y)) → addy_out_aag(b, one(Y), one(Y))
addy_in_aag(b, zero(Y), zero(Y)) → U8_aag(Y, binaryZ_in_g(Y))
U8_aag(Y, binaryZ_out_g(Y)) → addy_out_aag(b, zero(Y), zero(Y))
addy_in_aag(X, Y, Z) → U9_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), one(Y), zero(Z)) → U13_aag(X, Y, Z, addc_in_aag(X, Y, Z))
addc_in_aag(b, b, one(b)) → addc_out_aag(b, b, one(b))
addc_in_aag(X, b, Z) → U14_aag(X, Z, succZ_in_ag(X, Z))
succZ_in_ag(zero(X), one(X)) → U33_ag(X, binaryZ_in_g(X))
U33_ag(X, binaryZ_out_g(X)) → succZ_out_ag(zero(X), one(X))
succZ_in_ag(one(X), zero(Z)) → U34_ag(X, Z, succ_in_ag(X, Z))
succ_in_ag(b, one(b)) → succ_out_ag(b, one(b))
succ_in_ag(zero(X), one(X)) → U31_ag(X, binaryZ_in_g(X))
U31_ag(X, binaryZ_out_g(X)) → succ_out_ag(zero(X), one(X))
succ_in_ag(one(X), zero(Z)) → U32_ag(X, Z, succ_in_ag(X, Z))
U32_ag(X, Z, succ_out_ag(X, Z)) → succ_out_ag(one(X), zero(Z))
U34_ag(X, Z, succ_out_ag(X, Z)) → succZ_out_ag(one(X), zero(Z))
U14_aag(X, Z, succZ_out_ag(X, Z)) → addc_out_aag(X, b, Z)
addc_in_aag(b, Y, Z) → U15_aag(Y, Z, succZ_in_ag(Y, Z))
U15_aag(Y, Z, succZ_out_ag(Y, Z)) → addc_out_aag(b, Y, Z)
addc_in_aag(X, Y, Z) → U16_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(zero(X), zero(Y), one(Z)) → U23_aag(X, Y, Z, addz_in_aag(X, Y, Z))
U23_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addC_out_aag(zero(X), zero(Y), one(Z))
addC_in_aag(zero(X), one(Y), zero(Z)) → U24_aag(X, Y, Z, addX_in_aag(X, Y, Z))
addX_in_aag(zero(X), b, one(X)) → U17_aag(X, binaryZ_in_g(X))
U17_aag(X, binaryZ_out_g(X)) → addX_out_aag(zero(X), b, one(X))
addX_in_aag(one(X), b, zero(Z)) → U18_aag(X, Z, succ_in_ag(X, Z))
U18_aag(X, Z, succ_out_ag(X, Z)) → addX_out_aag(one(X), b, zero(Z))
addX_in_aag(X, Y, Z) → U19_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), zero(Y), zero(Z)) → U25_aag(X, Y, Z, addY_in_aag(X, Y, Z))
addY_in_aag(b, zero(Y), one(Y)) → U20_aag(Y, binaryZ_in_g(Y))
U20_aag(Y, binaryZ_out_g(Y)) → addY_out_aag(b, zero(Y), one(Y))
addY_in_aag(b, one(Y), zero(Z)) → U21_aag(Y, Z, succ_in_ag(Y, Z))
U21_aag(Y, Z, succ_out_ag(Y, Z)) → addY_out_aag(b, one(Y), zero(Z))
addY_in_aag(X, Y, Z) → U22_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), one(Y), one(Z)) → U26_aag(X, Y, Z, addc_in_aag(X, Y, Z))
U26_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addC_out_aag(one(X), one(Y), one(Z))
U22_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addY_out_aag(X, Y, Z)
U25_aag(X, Y, Z, addY_out_aag(X, Y, Z)) → addC_out_aag(one(X), zero(Y), zero(Z))
U19_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addX_out_aag(X, Y, Z)
U24_aag(X, Y, Z, addX_out_aag(X, Y, Z)) → addC_out_aag(zero(X), one(Y), zero(Z))
U16_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addc_out_aag(X, Y, Z)
U13_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addz_out_aag(one(X), one(Y), zero(Z))
U9_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addy_out_aag(X, Y, Z)
U12_aag(X, Y, Z, addy_out_aag(X, Y, Z)) → addz_out_aag(one(X), zero(Y), one(Z))
U6_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addx_out_aag(X, Y, Z)
U11_aag(X, Y, Z, addx_out_aag(X, Y, Z)) → addz_out_aag(zero(X), one(Y), one(Z))
U10_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addz_out_aag(zero(X), zero(Y), zero(Z))
U3_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → add_out_aag(X, Y, Z)
U37_aag(R, S, RSS, add_out_aag(S, zero(RS), RSS)) → times_out_aag(one(R), S, RSS)
U35_aag(R, S, RS, times_out_aag(R, S, RS)) → times_out_aag(zero(R), S, zero(RS))
SUCC_IN_AG(one(X), zero(Z)) → SUCC_IN_AG(X, Z)
SUCC_IN_AG(zero(Z)) → SUCC_IN_AG(Z)
From the DPs we obtained the following set of size-change graphs:
ADDX_IN_AAG(X, Y, Z) → ADDZ_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(zero(X), zero(Y), zero(Z)) → ADDZ_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(zero(X), one(Y), one(Z)) → ADDX_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(one(X), zero(Y), one(Z)) → ADDY_IN_AAG(X, Y, Z)
ADDY_IN_AAG(X, Y, Z) → ADDZ_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(one(X), one(Y), zero(Z)) → ADDC_IN_AAG(X, Y, Z)
ADDC_IN_AAG(X, Y, Z) → ADDC_IN_AAG1(X, Y, Z)
ADDC_IN_AAG1(zero(X), zero(Y), one(Z)) → ADDZ_IN_AAG(X, Y, Z)
ADDC_IN_AAG1(zero(X), one(Y), zero(Z)) → ADDX_IN_AAG1(X, Y, Z)
ADDX_IN_AAG1(X, Y, Z) → ADDC_IN_AAG1(X, Y, Z)
ADDC_IN_AAG1(one(X), zero(Y), zero(Z)) → ADDY_IN_AAG1(X, Y, Z)
ADDY_IN_AAG1(X, Y, Z) → ADDC_IN_AAG1(X, Y, Z)
ADDC_IN_AAG1(one(X), one(Y), one(Z)) → ADDC_IN_AAG(X, Y, Z)
times_in_aag(one(b), X, X) → times_out_aag(one(b), X, X)
times_in_aag(zero(R), S, zero(RS)) → U35_aag(R, S, RS, times_in_aag(R, S, RS))
times_in_aag(one(R), S, RSS) → U36_aag(R, S, RSS, times_in_aaa(R, S, RS))
times_in_aaa(one(b), X, X) → times_out_aaa(one(b), X, X)
times_in_aaa(zero(R), S, zero(RS)) → U35_aaa(R, S, RS, times_in_aaa(R, S, RS))
times_in_aaa(one(R), S, RSS) → U36_aaa(R, S, RSS, times_in_aaa(R, S, RS))
U36_aaa(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aaa(R, S, RSS, add_in_aaa(S, zero(RS), RSS))
add_in_aaa(b, b, b) → add_out_aaa(b, b, b)
add_in_aaa(X, b, X) → U1_aaa(X, binaryZ_in_a(X))
binaryZ_in_a(zero(X)) → U29_a(X, binaryZ_in_a(X))
binaryZ_in_a(one(X)) → U30_a(X, binary_in_a(X))
binary_in_a(b) → binary_out_a(b)
binary_in_a(zero(X)) → U27_a(X, binaryZ_in_a(X))
U27_a(X, binaryZ_out_a(X)) → binary_out_a(zero(X))
binary_in_a(one(X)) → U28_a(X, binary_in_a(X))
U28_a(X, binary_out_a(X)) → binary_out_a(one(X))
U30_a(X, binary_out_a(X)) → binaryZ_out_a(one(X))
U29_a(X, binaryZ_out_a(X)) → binaryZ_out_a(zero(X))
U1_aaa(X, binaryZ_out_a(X)) → add_out_aaa(X, b, X)
add_in_aaa(b, Y, Y) → U2_aaa(Y, binaryZ_in_a(Y))
U2_aaa(Y, binaryZ_out_a(Y)) → add_out_aaa(b, Y, Y)
add_in_aaa(X, Y, Z) → U3_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), zero(Y), zero(Z)) → U10_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), one(Y), one(Z)) → U11_aaa(X, Y, Z, addx_in_aaa(X, Y, Z))
addx_in_aaa(one(X), b, one(X)) → U4_aaa(X, binary_in_a(X))
U4_aaa(X, binary_out_a(X)) → addx_out_aaa(one(X), b, one(X))
addx_in_aaa(zero(X), b, zero(X)) → U5_aaa(X, binaryZ_in_a(X))
U5_aaa(X, binaryZ_out_a(X)) → addx_out_aaa(zero(X), b, zero(X))
addx_in_aaa(X, Y, Z) → U6_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), zero(Y), one(Z)) → U12_aaa(X, Y, Z, addy_in_aaa(X, Y, Z))
addy_in_aaa(b, one(Y), one(Y)) → U7_aaa(Y, binary_in_a(Y))
U7_aaa(Y, binary_out_a(Y)) → addy_out_aaa(b, one(Y), one(Y))
addy_in_aaa(b, zero(Y), zero(Y)) → U8_aaa(Y, binaryZ_in_a(Y))
U8_aaa(Y, binaryZ_out_a(Y)) → addy_out_aaa(b, zero(Y), zero(Y))
addy_in_aaa(X, Y, Z) → U9_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), one(Y), zero(Z)) → U13_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
addc_in_aaa(b, b, one(b)) → addc_out_aaa(b, b, one(b))
addc_in_aaa(X, b, Z) → U14_aaa(X, Z, succZ_in_aa(X, Z))
succZ_in_aa(zero(X), one(X)) → U33_aa(X, binaryZ_in_a(X))
U33_aa(X, binaryZ_out_a(X)) → succZ_out_aa(zero(X), one(X))
succZ_in_aa(one(X), zero(Z)) → U34_aa(X, Z, succ_in_aa(X, Z))
succ_in_aa(b, one(b)) → succ_out_aa(b, one(b))
succ_in_aa(zero(X), one(X)) → U31_aa(X, binaryZ_in_a(X))
U31_aa(X, binaryZ_out_a(X)) → succ_out_aa(zero(X), one(X))
succ_in_aa(one(X), zero(Z)) → U32_aa(X, Z, succ_in_aa(X, Z))
U32_aa(X, Z, succ_out_aa(X, Z)) → succ_out_aa(one(X), zero(Z))
U34_aa(X, Z, succ_out_aa(X, Z)) → succZ_out_aa(one(X), zero(Z))
U14_aaa(X, Z, succZ_out_aa(X, Z)) → addc_out_aaa(X, b, Z)
addc_in_aaa(b, Y, Z) → U15_aaa(Y, Z, succZ_in_aa(Y, Z))
U15_aaa(Y, Z, succZ_out_aa(Y, Z)) → addc_out_aaa(b, Y, Z)
addc_in_aaa(X, Y, Z) → U16_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(zero(X), zero(Y), one(Z)) → U23_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
U23_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), zero(Y), one(Z))
addC_in_aaa(zero(X), one(Y), zero(Z)) → U24_aaa(X, Y, Z, addX_in_aaa(X, Y, Z))
addX_in_aaa(zero(X), b, one(X)) → U17_aaa(X, binaryZ_in_a(X))
U17_aaa(X, binaryZ_out_a(X)) → addX_out_aaa(zero(X), b, one(X))
addX_in_aaa(one(X), b, zero(Z)) → U18_aaa(X, Z, succ_in_aa(X, Z))
U18_aaa(X, Z, succ_out_aa(X, Z)) → addX_out_aaa(one(X), b, zero(Z))
addX_in_aaa(X, Y, Z) → U19_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), zero(Y), zero(Z)) → U25_aaa(X, Y, Z, addY_in_aaa(X, Y, Z))
addY_in_aaa(b, zero(Y), one(Y)) → U20_aaa(Y, binaryZ_in_a(Y))
U20_aaa(Y, binaryZ_out_a(Y)) → addY_out_aaa(b, zero(Y), one(Y))
addY_in_aaa(b, one(Y), zero(Z)) → U21_aaa(Y, Z, succ_in_aa(Y, Z))
U21_aaa(Y, Z, succ_out_aa(Y, Z)) → addY_out_aaa(b, one(Y), zero(Z))
addY_in_aaa(X, Y, Z) → U22_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), one(Y), one(Z)) → U26_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
U26_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), one(Y), one(Z))
U22_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addY_out_aaa(X, Y, Z)
U25_aaa(X, Y, Z, addY_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), zero(Y), zero(Z))
U19_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addX_out_aaa(X, Y, Z)
U24_aaa(X, Y, Z, addX_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), one(Y), zero(Z))
U16_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addc_out_aaa(X, Y, Z)
U13_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), one(Y), zero(Z))
U9_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addy_out_aaa(X, Y, Z)
U12_aaa(X, Y, Z, addy_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), zero(Y), one(Z))
U6_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addx_out_aaa(X, Y, Z)
U11_aaa(X, Y, Z, addx_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), one(Y), one(Z))
U10_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), zero(Y), zero(Z))
U3_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → add_out_aaa(X, Y, Z)
U37_aaa(R, S, RSS, add_out_aaa(S, zero(RS), RSS)) → times_out_aaa(one(R), S, RSS)
U35_aaa(R, S, RS, times_out_aaa(R, S, RS)) → times_out_aaa(zero(R), S, zero(RS))
U36_aag(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aag(R, S, RSS, add_in_aag(S, zero(RS), RSS))
add_in_aag(b, b, b) → add_out_aag(b, b, b)
add_in_aag(X, b, X) → U1_aag(X, binaryZ_in_g(X))
binaryZ_in_g(zero(X)) → U29_g(X, binaryZ_in_g(X))
binaryZ_in_g(one(X)) → U30_g(X, binary_in_g(X))
binary_in_g(b) → binary_out_g(b)
binary_in_g(zero(X)) → U27_g(X, binaryZ_in_g(X))
U27_g(X, binaryZ_out_g(X)) → binary_out_g(zero(X))
binary_in_g(one(X)) → U28_g(X, binary_in_g(X))
U28_g(X, binary_out_g(X)) → binary_out_g(one(X))
U30_g(X, binary_out_g(X)) → binaryZ_out_g(one(X))
U29_g(X, binaryZ_out_g(X)) → binaryZ_out_g(zero(X))
U1_aag(X, binaryZ_out_g(X)) → add_out_aag(X, b, X)
add_in_aag(b, Y, Y) → U2_aag(Y, binaryZ_in_g(Y))
U2_aag(Y, binaryZ_out_g(Y)) → add_out_aag(b, Y, Y)
add_in_aag(X, Y, Z) → U3_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), zero(Y), zero(Z)) → U10_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), one(Y), one(Z)) → U11_aag(X, Y, Z, addx_in_aag(X, Y, Z))
addx_in_aag(one(X), b, one(X)) → U4_aag(X, binary_in_g(X))
U4_aag(X, binary_out_g(X)) → addx_out_aag(one(X), b, one(X))
addx_in_aag(zero(X), b, zero(X)) → U5_aag(X, binaryZ_in_g(X))
U5_aag(X, binaryZ_out_g(X)) → addx_out_aag(zero(X), b, zero(X))
addx_in_aag(X, Y, Z) → U6_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), zero(Y), one(Z)) → U12_aag(X, Y, Z, addy_in_aag(X, Y, Z))
addy_in_aag(b, one(Y), one(Y)) → U7_aag(Y, binary_in_g(Y))
U7_aag(Y, binary_out_g(Y)) → addy_out_aag(b, one(Y), one(Y))
addy_in_aag(b, zero(Y), zero(Y)) → U8_aag(Y, binaryZ_in_g(Y))
U8_aag(Y, binaryZ_out_g(Y)) → addy_out_aag(b, zero(Y), zero(Y))
addy_in_aag(X, Y, Z) → U9_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), one(Y), zero(Z)) → U13_aag(X, Y, Z, addc_in_aag(X, Y, Z))
addc_in_aag(b, b, one(b)) → addc_out_aag(b, b, one(b))
addc_in_aag(X, b, Z) → U14_aag(X, Z, succZ_in_ag(X, Z))
succZ_in_ag(zero(X), one(X)) → U33_ag(X, binaryZ_in_g(X))
U33_ag(X, binaryZ_out_g(X)) → succZ_out_ag(zero(X), one(X))
succZ_in_ag(one(X), zero(Z)) → U34_ag(X, Z, succ_in_ag(X, Z))
succ_in_ag(b, one(b)) → succ_out_ag(b, one(b))
succ_in_ag(zero(X), one(X)) → U31_ag(X, binaryZ_in_g(X))
U31_ag(X, binaryZ_out_g(X)) → succ_out_ag(zero(X), one(X))
succ_in_ag(one(X), zero(Z)) → U32_ag(X, Z, succ_in_ag(X, Z))
U32_ag(X, Z, succ_out_ag(X, Z)) → succ_out_ag(one(X), zero(Z))
U34_ag(X, Z, succ_out_ag(X, Z)) → succZ_out_ag(one(X), zero(Z))
U14_aag(X, Z, succZ_out_ag(X, Z)) → addc_out_aag(X, b, Z)
addc_in_aag(b, Y, Z) → U15_aag(Y, Z, succZ_in_ag(Y, Z))
U15_aag(Y, Z, succZ_out_ag(Y, Z)) → addc_out_aag(b, Y, Z)
addc_in_aag(X, Y, Z) → U16_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(zero(X), zero(Y), one(Z)) → U23_aag(X, Y, Z, addz_in_aag(X, Y, Z))
U23_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addC_out_aag(zero(X), zero(Y), one(Z))
addC_in_aag(zero(X), one(Y), zero(Z)) → U24_aag(X, Y, Z, addX_in_aag(X, Y, Z))
addX_in_aag(zero(X), b, one(X)) → U17_aag(X, binaryZ_in_g(X))
U17_aag(X, binaryZ_out_g(X)) → addX_out_aag(zero(X), b, one(X))
addX_in_aag(one(X), b, zero(Z)) → U18_aag(X, Z, succ_in_ag(X, Z))
U18_aag(X, Z, succ_out_ag(X, Z)) → addX_out_aag(one(X), b, zero(Z))
addX_in_aag(X, Y, Z) → U19_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), zero(Y), zero(Z)) → U25_aag(X, Y, Z, addY_in_aag(X, Y, Z))
addY_in_aag(b, zero(Y), one(Y)) → U20_aag(Y, binaryZ_in_g(Y))
U20_aag(Y, binaryZ_out_g(Y)) → addY_out_aag(b, zero(Y), one(Y))
addY_in_aag(b, one(Y), zero(Z)) → U21_aag(Y, Z, succ_in_ag(Y, Z))
U21_aag(Y, Z, succ_out_ag(Y, Z)) → addY_out_aag(b, one(Y), zero(Z))
addY_in_aag(X, Y, Z) → U22_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), one(Y), one(Z)) → U26_aag(X, Y, Z, addc_in_aag(X, Y, Z))
U26_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addC_out_aag(one(X), one(Y), one(Z))
U22_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addY_out_aag(X, Y, Z)
U25_aag(X, Y, Z, addY_out_aag(X, Y, Z)) → addC_out_aag(one(X), zero(Y), zero(Z))
U19_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addX_out_aag(X, Y, Z)
U24_aag(X, Y, Z, addX_out_aag(X, Y, Z)) → addC_out_aag(zero(X), one(Y), zero(Z))
U16_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addc_out_aag(X, Y, Z)
U13_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addz_out_aag(one(X), one(Y), zero(Z))
U9_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addy_out_aag(X, Y, Z)
U12_aag(X, Y, Z, addy_out_aag(X, Y, Z)) → addz_out_aag(one(X), zero(Y), one(Z))
U6_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addx_out_aag(X, Y, Z)
U11_aag(X, Y, Z, addx_out_aag(X, Y, Z)) → addz_out_aag(zero(X), one(Y), one(Z))
U10_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addz_out_aag(zero(X), zero(Y), zero(Z))
U3_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → add_out_aag(X, Y, Z)
U37_aag(R, S, RSS, add_out_aag(S, zero(RS), RSS)) → times_out_aag(one(R), S, RSS)
U35_aag(R, S, RS, times_out_aag(R, S, RS)) → times_out_aag(zero(R), S, zero(RS))
ADDX_IN_AAG(X, Y, Z) → ADDZ_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(zero(X), zero(Y), zero(Z)) → ADDZ_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(zero(X), one(Y), one(Z)) → ADDX_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(one(X), zero(Y), one(Z)) → ADDY_IN_AAG(X, Y, Z)
ADDY_IN_AAG(X, Y, Z) → ADDZ_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(one(X), one(Y), zero(Z)) → ADDC_IN_AAG(X, Y, Z)
ADDC_IN_AAG(X, Y, Z) → ADDC_IN_AAG1(X, Y, Z)
ADDC_IN_AAG1(zero(X), zero(Y), one(Z)) → ADDZ_IN_AAG(X, Y, Z)
ADDC_IN_AAG1(zero(X), one(Y), zero(Z)) → ADDX_IN_AAG1(X, Y, Z)
ADDX_IN_AAG1(X, Y, Z) → ADDC_IN_AAG1(X, Y, Z)
ADDC_IN_AAG1(one(X), zero(Y), zero(Z)) → ADDY_IN_AAG1(X, Y, Z)
ADDY_IN_AAG1(X, Y, Z) → ADDC_IN_AAG1(X, Y, Z)
ADDC_IN_AAG1(one(X), one(Y), one(Z)) → ADDC_IN_AAG(X, Y, Z)
ADDX_IN_AAG(Z) → ADDZ_IN_AAG(Z)
ADDZ_IN_AAG(zero(Z)) → ADDZ_IN_AAG(Z)
ADDZ_IN_AAG(one(Z)) → ADDX_IN_AAG(Z)
ADDZ_IN_AAG(one(Z)) → ADDY_IN_AAG(Z)
ADDY_IN_AAG(Z) → ADDZ_IN_AAG(Z)
ADDZ_IN_AAG(zero(Z)) → ADDC_IN_AAG(Z)
ADDC_IN_AAG(Z) → ADDC_IN_AAG1(Z)
ADDC_IN_AAG1(one(Z)) → ADDZ_IN_AAG(Z)
ADDC_IN_AAG1(zero(Z)) → ADDX_IN_AAG1(Z)
ADDX_IN_AAG1(Z) → ADDC_IN_AAG1(Z)
ADDC_IN_AAG1(zero(Z)) → ADDY_IN_AAG1(Z)
ADDY_IN_AAG1(Z) → ADDC_IN_AAG1(Z)
ADDC_IN_AAG1(one(Z)) → ADDC_IN_AAG(Z)
From the DPs we obtained the following set of size-change graphs:
BINARYZ_IN_A(one(X)) → BINARY_IN_A(X)
BINARY_IN_A(zero(X)) → BINARYZ_IN_A(X)
BINARYZ_IN_A(zero(X)) → BINARYZ_IN_A(X)
BINARY_IN_A(one(X)) → BINARY_IN_A(X)
times_in_aag(one(b), X, X) → times_out_aag(one(b), X, X)
times_in_aag(zero(R), S, zero(RS)) → U35_aag(R, S, RS, times_in_aag(R, S, RS))
times_in_aag(one(R), S, RSS) → U36_aag(R, S, RSS, times_in_aaa(R, S, RS))
times_in_aaa(one(b), X, X) → times_out_aaa(one(b), X, X)
times_in_aaa(zero(R), S, zero(RS)) → U35_aaa(R, S, RS, times_in_aaa(R, S, RS))
times_in_aaa(one(R), S, RSS) → U36_aaa(R, S, RSS, times_in_aaa(R, S, RS))
U36_aaa(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aaa(R, S, RSS, add_in_aaa(S, zero(RS), RSS))
add_in_aaa(b, b, b) → add_out_aaa(b, b, b)
add_in_aaa(X, b, X) → U1_aaa(X, binaryZ_in_a(X))
binaryZ_in_a(zero(X)) → U29_a(X, binaryZ_in_a(X))
binaryZ_in_a(one(X)) → U30_a(X, binary_in_a(X))
binary_in_a(b) → binary_out_a(b)
binary_in_a(zero(X)) → U27_a(X, binaryZ_in_a(X))
U27_a(X, binaryZ_out_a(X)) → binary_out_a(zero(X))
binary_in_a(one(X)) → U28_a(X, binary_in_a(X))
U28_a(X, binary_out_a(X)) → binary_out_a(one(X))
U30_a(X, binary_out_a(X)) → binaryZ_out_a(one(X))
U29_a(X, binaryZ_out_a(X)) → binaryZ_out_a(zero(X))
U1_aaa(X, binaryZ_out_a(X)) → add_out_aaa(X, b, X)
add_in_aaa(b, Y, Y) → U2_aaa(Y, binaryZ_in_a(Y))
U2_aaa(Y, binaryZ_out_a(Y)) → add_out_aaa(b, Y, Y)
add_in_aaa(X, Y, Z) → U3_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), zero(Y), zero(Z)) → U10_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), one(Y), one(Z)) → U11_aaa(X, Y, Z, addx_in_aaa(X, Y, Z))
addx_in_aaa(one(X), b, one(X)) → U4_aaa(X, binary_in_a(X))
U4_aaa(X, binary_out_a(X)) → addx_out_aaa(one(X), b, one(X))
addx_in_aaa(zero(X), b, zero(X)) → U5_aaa(X, binaryZ_in_a(X))
U5_aaa(X, binaryZ_out_a(X)) → addx_out_aaa(zero(X), b, zero(X))
addx_in_aaa(X, Y, Z) → U6_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), zero(Y), one(Z)) → U12_aaa(X, Y, Z, addy_in_aaa(X, Y, Z))
addy_in_aaa(b, one(Y), one(Y)) → U7_aaa(Y, binary_in_a(Y))
U7_aaa(Y, binary_out_a(Y)) → addy_out_aaa(b, one(Y), one(Y))
addy_in_aaa(b, zero(Y), zero(Y)) → U8_aaa(Y, binaryZ_in_a(Y))
U8_aaa(Y, binaryZ_out_a(Y)) → addy_out_aaa(b, zero(Y), zero(Y))
addy_in_aaa(X, Y, Z) → U9_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), one(Y), zero(Z)) → U13_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
addc_in_aaa(b, b, one(b)) → addc_out_aaa(b, b, one(b))
addc_in_aaa(X, b, Z) → U14_aaa(X, Z, succZ_in_aa(X, Z))
succZ_in_aa(zero(X), one(X)) → U33_aa(X, binaryZ_in_a(X))
U33_aa(X, binaryZ_out_a(X)) → succZ_out_aa(zero(X), one(X))
succZ_in_aa(one(X), zero(Z)) → U34_aa(X, Z, succ_in_aa(X, Z))
succ_in_aa(b, one(b)) → succ_out_aa(b, one(b))
succ_in_aa(zero(X), one(X)) → U31_aa(X, binaryZ_in_a(X))
U31_aa(X, binaryZ_out_a(X)) → succ_out_aa(zero(X), one(X))
succ_in_aa(one(X), zero(Z)) → U32_aa(X, Z, succ_in_aa(X, Z))
U32_aa(X, Z, succ_out_aa(X, Z)) → succ_out_aa(one(X), zero(Z))
U34_aa(X, Z, succ_out_aa(X, Z)) → succZ_out_aa(one(X), zero(Z))
U14_aaa(X, Z, succZ_out_aa(X, Z)) → addc_out_aaa(X, b, Z)
addc_in_aaa(b, Y, Z) → U15_aaa(Y, Z, succZ_in_aa(Y, Z))
U15_aaa(Y, Z, succZ_out_aa(Y, Z)) → addc_out_aaa(b, Y, Z)
addc_in_aaa(X, Y, Z) → U16_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(zero(X), zero(Y), one(Z)) → U23_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
U23_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), zero(Y), one(Z))
addC_in_aaa(zero(X), one(Y), zero(Z)) → U24_aaa(X, Y, Z, addX_in_aaa(X, Y, Z))
addX_in_aaa(zero(X), b, one(X)) → U17_aaa(X, binaryZ_in_a(X))
U17_aaa(X, binaryZ_out_a(X)) → addX_out_aaa(zero(X), b, one(X))
addX_in_aaa(one(X), b, zero(Z)) → U18_aaa(X, Z, succ_in_aa(X, Z))
U18_aaa(X, Z, succ_out_aa(X, Z)) → addX_out_aaa(one(X), b, zero(Z))
addX_in_aaa(X, Y, Z) → U19_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), zero(Y), zero(Z)) → U25_aaa(X, Y, Z, addY_in_aaa(X, Y, Z))
addY_in_aaa(b, zero(Y), one(Y)) → U20_aaa(Y, binaryZ_in_a(Y))
U20_aaa(Y, binaryZ_out_a(Y)) → addY_out_aaa(b, zero(Y), one(Y))
addY_in_aaa(b, one(Y), zero(Z)) → U21_aaa(Y, Z, succ_in_aa(Y, Z))
U21_aaa(Y, Z, succ_out_aa(Y, Z)) → addY_out_aaa(b, one(Y), zero(Z))
addY_in_aaa(X, Y, Z) → U22_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), one(Y), one(Z)) → U26_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
U26_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), one(Y), one(Z))
U22_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addY_out_aaa(X, Y, Z)
U25_aaa(X, Y, Z, addY_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), zero(Y), zero(Z))
U19_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addX_out_aaa(X, Y, Z)
U24_aaa(X, Y, Z, addX_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), one(Y), zero(Z))
U16_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addc_out_aaa(X, Y, Z)
U13_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), one(Y), zero(Z))
U9_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addy_out_aaa(X, Y, Z)
U12_aaa(X, Y, Z, addy_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), zero(Y), one(Z))
U6_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addx_out_aaa(X, Y, Z)
U11_aaa(X, Y, Z, addx_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), one(Y), one(Z))
U10_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), zero(Y), zero(Z))
U3_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → add_out_aaa(X, Y, Z)
U37_aaa(R, S, RSS, add_out_aaa(S, zero(RS), RSS)) → times_out_aaa(one(R), S, RSS)
U35_aaa(R, S, RS, times_out_aaa(R, S, RS)) → times_out_aaa(zero(R), S, zero(RS))
U36_aag(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aag(R, S, RSS, add_in_aag(S, zero(RS), RSS))
add_in_aag(b, b, b) → add_out_aag(b, b, b)
add_in_aag(X, b, X) → U1_aag(X, binaryZ_in_g(X))
binaryZ_in_g(zero(X)) → U29_g(X, binaryZ_in_g(X))
binaryZ_in_g(one(X)) → U30_g(X, binary_in_g(X))
binary_in_g(b) → binary_out_g(b)
binary_in_g(zero(X)) → U27_g(X, binaryZ_in_g(X))
U27_g(X, binaryZ_out_g(X)) → binary_out_g(zero(X))
binary_in_g(one(X)) → U28_g(X, binary_in_g(X))
U28_g(X, binary_out_g(X)) → binary_out_g(one(X))
U30_g(X, binary_out_g(X)) → binaryZ_out_g(one(X))
U29_g(X, binaryZ_out_g(X)) → binaryZ_out_g(zero(X))
U1_aag(X, binaryZ_out_g(X)) → add_out_aag(X, b, X)
add_in_aag(b, Y, Y) → U2_aag(Y, binaryZ_in_g(Y))
U2_aag(Y, binaryZ_out_g(Y)) → add_out_aag(b, Y, Y)
add_in_aag(X, Y, Z) → U3_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), zero(Y), zero(Z)) → U10_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), one(Y), one(Z)) → U11_aag(X, Y, Z, addx_in_aag(X, Y, Z))
addx_in_aag(one(X), b, one(X)) → U4_aag(X, binary_in_g(X))
U4_aag(X, binary_out_g(X)) → addx_out_aag(one(X), b, one(X))
addx_in_aag(zero(X), b, zero(X)) → U5_aag(X, binaryZ_in_g(X))
U5_aag(X, binaryZ_out_g(X)) → addx_out_aag(zero(X), b, zero(X))
addx_in_aag(X, Y, Z) → U6_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), zero(Y), one(Z)) → U12_aag(X, Y, Z, addy_in_aag(X, Y, Z))
addy_in_aag(b, one(Y), one(Y)) → U7_aag(Y, binary_in_g(Y))
U7_aag(Y, binary_out_g(Y)) → addy_out_aag(b, one(Y), one(Y))
addy_in_aag(b, zero(Y), zero(Y)) → U8_aag(Y, binaryZ_in_g(Y))
U8_aag(Y, binaryZ_out_g(Y)) → addy_out_aag(b, zero(Y), zero(Y))
addy_in_aag(X, Y, Z) → U9_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), one(Y), zero(Z)) → U13_aag(X, Y, Z, addc_in_aag(X, Y, Z))
addc_in_aag(b, b, one(b)) → addc_out_aag(b, b, one(b))
addc_in_aag(X, b, Z) → U14_aag(X, Z, succZ_in_ag(X, Z))
succZ_in_ag(zero(X), one(X)) → U33_ag(X, binaryZ_in_g(X))
U33_ag(X, binaryZ_out_g(X)) → succZ_out_ag(zero(X), one(X))
succZ_in_ag(one(X), zero(Z)) → U34_ag(X, Z, succ_in_ag(X, Z))
succ_in_ag(b, one(b)) → succ_out_ag(b, one(b))
succ_in_ag(zero(X), one(X)) → U31_ag(X, binaryZ_in_g(X))
U31_ag(X, binaryZ_out_g(X)) → succ_out_ag(zero(X), one(X))
succ_in_ag(one(X), zero(Z)) → U32_ag(X, Z, succ_in_ag(X, Z))
U32_ag(X, Z, succ_out_ag(X, Z)) → succ_out_ag(one(X), zero(Z))
U34_ag(X, Z, succ_out_ag(X, Z)) → succZ_out_ag(one(X), zero(Z))
U14_aag(X, Z, succZ_out_ag(X, Z)) → addc_out_aag(X, b, Z)
addc_in_aag(b, Y, Z) → U15_aag(Y, Z, succZ_in_ag(Y, Z))
U15_aag(Y, Z, succZ_out_ag(Y, Z)) → addc_out_aag(b, Y, Z)
addc_in_aag(X, Y, Z) → U16_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(zero(X), zero(Y), one(Z)) → U23_aag(X, Y, Z, addz_in_aag(X, Y, Z))
U23_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addC_out_aag(zero(X), zero(Y), one(Z))
addC_in_aag(zero(X), one(Y), zero(Z)) → U24_aag(X, Y, Z, addX_in_aag(X, Y, Z))
addX_in_aag(zero(X), b, one(X)) → U17_aag(X, binaryZ_in_g(X))
U17_aag(X, binaryZ_out_g(X)) → addX_out_aag(zero(X), b, one(X))
addX_in_aag(one(X), b, zero(Z)) → U18_aag(X, Z, succ_in_ag(X, Z))
U18_aag(X, Z, succ_out_ag(X, Z)) → addX_out_aag(one(X), b, zero(Z))
addX_in_aag(X, Y, Z) → U19_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), zero(Y), zero(Z)) → U25_aag(X, Y, Z, addY_in_aag(X, Y, Z))
addY_in_aag(b, zero(Y), one(Y)) → U20_aag(Y, binaryZ_in_g(Y))
U20_aag(Y, binaryZ_out_g(Y)) → addY_out_aag(b, zero(Y), one(Y))
addY_in_aag(b, one(Y), zero(Z)) → U21_aag(Y, Z, succ_in_ag(Y, Z))
U21_aag(Y, Z, succ_out_ag(Y, Z)) → addY_out_aag(b, one(Y), zero(Z))
addY_in_aag(X, Y, Z) → U22_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), one(Y), one(Z)) → U26_aag(X, Y, Z, addc_in_aag(X, Y, Z))
U26_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addC_out_aag(one(X), one(Y), one(Z))
U22_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addY_out_aag(X, Y, Z)
U25_aag(X, Y, Z, addY_out_aag(X, Y, Z)) → addC_out_aag(one(X), zero(Y), zero(Z))
U19_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addX_out_aag(X, Y, Z)
U24_aag(X, Y, Z, addX_out_aag(X, Y, Z)) → addC_out_aag(zero(X), one(Y), zero(Z))
U16_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addc_out_aag(X, Y, Z)
U13_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addz_out_aag(one(X), one(Y), zero(Z))
U9_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addy_out_aag(X, Y, Z)
U12_aag(X, Y, Z, addy_out_aag(X, Y, Z)) → addz_out_aag(one(X), zero(Y), one(Z))
U6_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addx_out_aag(X, Y, Z)
U11_aag(X, Y, Z, addx_out_aag(X, Y, Z)) → addz_out_aag(zero(X), one(Y), one(Z))
U10_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addz_out_aag(zero(X), zero(Y), zero(Z))
U3_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → add_out_aag(X, Y, Z)
U37_aag(R, S, RSS, add_out_aag(S, zero(RS), RSS)) → times_out_aag(one(R), S, RSS)
U35_aag(R, S, RS, times_out_aag(R, S, RS)) → times_out_aag(zero(R), S, zero(RS))
BINARYZ_IN_A(one(X)) → BINARY_IN_A(X)
BINARY_IN_A(zero(X)) → BINARYZ_IN_A(X)
BINARYZ_IN_A(zero(X)) → BINARYZ_IN_A(X)
BINARY_IN_A(one(X)) → BINARY_IN_A(X)
BINARYZ_IN_A → BINARY_IN_A
BINARY_IN_A → BINARYZ_IN_A
BINARYZ_IN_A → BINARYZ_IN_A
BINARY_IN_A → BINARY_IN_A
SUCC_IN_AA(one(X), zero(Z)) → SUCC_IN_AA(X, Z)
times_in_aag(one(b), X, X) → times_out_aag(one(b), X, X)
times_in_aag(zero(R), S, zero(RS)) → U35_aag(R, S, RS, times_in_aag(R, S, RS))
times_in_aag(one(R), S, RSS) → U36_aag(R, S, RSS, times_in_aaa(R, S, RS))
times_in_aaa(one(b), X, X) → times_out_aaa(one(b), X, X)
times_in_aaa(zero(R), S, zero(RS)) → U35_aaa(R, S, RS, times_in_aaa(R, S, RS))
times_in_aaa(one(R), S, RSS) → U36_aaa(R, S, RSS, times_in_aaa(R, S, RS))
U36_aaa(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aaa(R, S, RSS, add_in_aaa(S, zero(RS), RSS))
add_in_aaa(b, b, b) → add_out_aaa(b, b, b)
add_in_aaa(X, b, X) → U1_aaa(X, binaryZ_in_a(X))
binaryZ_in_a(zero(X)) → U29_a(X, binaryZ_in_a(X))
binaryZ_in_a(one(X)) → U30_a(X, binary_in_a(X))
binary_in_a(b) → binary_out_a(b)
binary_in_a(zero(X)) → U27_a(X, binaryZ_in_a(X))
U27_a(X, binaryZ_out_a(X)) → binary_out_a(zero(X))
binary_in_a(one(X)) → U28_a(X, binary_in_a(X))
U28_a(X, binary_out_a(X)) → binary_out_a(one(X))
U30_a(X, binary_out_a(X)) → binaryZ_out_a(one(X))
U29_a(X, binaryZ_out_a(X)) → binaryZ_out_a(zero(X))
U1_aaa(X, binaryZ_out_a(X)) → add_out_aaa(X, b, X)
add_in_aaa(b, Y, Y) → U2_aaa(Y, binaryZ_in_a(Y))
U2_aaa(Y, binaryZ_out_a(Y)) → add_out_aaa(b, Y, Y)
add_in_aaa(X, Y, Z) → U3_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), zero(Y), zero(Z)) → U10_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), one(Y), one(Z)) → U11_aaa(X, Y, Z, addx_in_aaa(X, Y, Z))
addx_in_aaa(one(X), b, one(X)) → U4_aaa(X, binary_in_a(X))
U4_aaa(X, binary_out_a(X)) → addx_out_aaa(one(X), b, one(X))
addx_in_aaa(zero(X), b, zero(X)) → U5_aaa(X, binaryZ_in_a(X))
U5_aaa(X, binaryZ_out_a(X)) → addx_out_aaa(zero(X), b, zero(X))
addx_in_aaa(X, Y, Z) → U6_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), zero(Y), one(Z)) → U12_aaa(X, Y, Z, addy_in_aaa(X, Y, Z))
addy_in_aaa(b, one(Y), one(Y)) → U7_aaa(Y, binary_in_a(Y))
U7_aaa(Y, binary_out_a(Y)) → addy_out_aaa(b, one(Y), one(Y))
addy_in_aaa(b, zero(Y), zero(Y)) → U8_aaa(Y, binaryZ_in_a(Y))
U8_aaa(Y, binaryZ_out_a(Y)) → addy_out_aaa(b, zero(Y), zero(Y))
addy_in_aaa(X, Y, Z) → U9_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), one(Y), zero(Z)) → U13_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
addc_in_aaa(b, b, one(b)) → addc_out_aaa(b, b, one(b))
addc_in_aaa(X, b, Z) → U14_aaa(X, Z, succZ_in_aa(X, Z))
succZ_in_aa(zero(X), one(X)) → U33_aa(X, binaryZ_in_a(X))
U33_aa(X, binaryZ_out_a(X)) → succZ_out_aa(zero(X), one(X))
succZ_in_aa(one(X), zero(Z)) → U34_aa(X, Z, succ_in_aa(X, Z))
succ_in_aa(b, one(b)) → succ_out_aa(b, one(b))
succ_in_aa(zero(X), one(X)) → U31_aa(X, binaryZ_in_a(X))
U31_aa(X, binaryZ_out_a(X)) → succ_out_aa(zero(X), one(X))
succ_in_aa(one(X), zero(Z)) → U32_aa(X, Z, succ_in_aa(X, Z))
U32_aa(X, Z, succ_out_aa(X, Z)) → succ_out_aa(one(X), zero(Z))
U34_aa(X, Z, succ_out_aa(X, Z)) → succZ_out_aa(one(X), zero(Z))
U14_aaa(X, Z, succZ_out_aa(X, Z)) → addc_out_aaa(X, b, Z)
addc_in_aaa(b, Y, Z) → U15_aaa(Y, Z, succZ_in_aa(Y, Z))
U15_aaa(Y, Z, succZ_out_aa(Y, Z)) → addc_out_aaa(b, Y, Z)
addc_in_aaa(X, Y, Z) → U16_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(zero(X), zero(Y), one(Z)) → U23_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
U23_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), zero(Y), one(Z))
addC_in_aaa(zero(X), one(Y), zero(Z)) → U24_aaa(X, Y, Z, addX_in_aaa(X, Y, Z))
addX_in_aaa(zero(X), b, one(X)) → U17_aaa(X, binaryZ_in_a(X))
U17_aaa(X, binaryZ_out_a(X)) → addX_out_aaa(zero(X), b, one(X))
addX_in_aaa(one(X), b, zero(Z)) → U18_aaa(X, Z, succ_in_aa(X, Z))
U18_aaa(X, Z, succ_out_aa(X, Z)) → addX_out_aaa(one(X), b, zero(Z))
addX_in_aaa(X, Y, Z) → U19_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), zero(Y), zero(Z)) → U25_aaa(X, Y, Z, addY_in_aaa(X, Y, Z))
addY_in_aaa(b, zero(Y), one(Y)) → U20_aaa(Y, binaryZ_in_a(Y))
U20_aaa(Y, binaryZ_out_a(Y)) → addY_out_aaa(b, zero(Y), one(Y))
addY_in_aaa(b, one(Y), zero(Z)) → U21_aaa(Y, Z, succ_in_aa(Y, Z))
U21_aaa(Y, Z, succ_out_aa(Y, Z)) → addY_out_aaa(b, one(Y), zero(Z))
addY_in_aaa(X, Y, Z) → U22_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), one(Y), one(Z)) → U26_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
U26_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), one(Y), one(Z))
U22_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addY_out_aaa(X, Y, Z)
U25_aaa(X, Y, Z, addY_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), zero(Y), zero(Z))
U19_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addX_out_aaa(X, Y, Z)
U24_aaa(X, Y, Z, addX_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), one(Y), zero(Z))
U16_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addc_out_aaa(X, Y, Z)
U13_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), one(Y), zero(Z))
U9_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addy_out_aaa(X, Y, Z)
U12_aaa(X, Y, Z, addy_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), zero(Y), one(Z))
U6_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addx_out_aaa(X, Y, Z)
U11_aaa(X, Y, Z, addx_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), one(Y), one(Z))
U10_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), zero(Y), zero(Z))
U3_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → add_out_aaa(X, Y, Z)
U37_aaa(R, S, RSS, add_out_aaa(S, zero(RS), RSS)) → times_out_aaa(one(R), S, RSS)
U35_aaa(R, S, RS, times_out_aaa(R, S, RS)) → times_out_aaa(zero(R), S, zero(RS))
U36_aag(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aag(R, S, RSS, add_in_aag(S, zero(RS), RSS))
add_in_aag(b, b, b) → add_out_aag(b, b, b)
add_in_aag(X, b, X) → U1_aag(X, binaryZ_in_g(X))
binaryZ_in_g(zero(X)) → U29_g(X, binaryZ_in_g(X))
binaryZ_in_g(one(X)) → U30_g(X, binary_in_g(X))
binary_in_g(b) → binary_out_g(b)
binary_in_g(zero(X)) → U27_g(X, binaryZ_in_g(X))
U27_g(X, binaryZ_out_g(X)) → binary_out_g(zero(X))
binary_in_g(one(X)) → U28_g(X, binary_in_g(X))
U28_g(X, binary_out_g(X)) → binary_out_g(one(X))
U30_g(X, binary_out_g(X)) → binaryZ_out_g(one(X))
U29_g(X, binaryZ_out_g(X)) → binaryZ_out_g(zero(X))
U1_aag(X, binaryZ_out_g(X)) → add_out_aag(X, b, X)
add_in_aag(b, Y, Y) → U2_aag(Y, binaryZ_in_g(Y))
U2_aag(Y, binaryZ_out_g(Y)) → add_out_aag(b, Y, Y)
add_in_aag(X, Y, Z) → U3_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), zero(Y), zero(Z)) → U10_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), one(Y), one(Z)) → U11_aag(X, Y, Z, addx_in_aag(X, Y, Z))
addx_in_aag(one(X), b, one(X)) → U4_aag(X, binary_in_g(X))
U4_aag(X, binary_out_g(X)) → addx_out_aag(one(X), b, one(X))
addx_in_aag(zero(X), b, zero(X)) → U5_aag(X, binaryZ_in_g(X))
U5_aag(X, binaryZ_out_g(X)) → addx_out_aag(zero(X), b, zero(X))
addx_in_aag(X, Y, Z) → U6_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), zero(Y), one(Z)) → U12_aag(X, Y, Z, addy_in_aag(X, Y, Z))
addy_in_aag(b, one(Y), one(Y)) → U7_aag(Y, binary_in_g(Y))
U7_aag(Y, binary_out_g(Y)) → addy_out_aag(b, one(Y), one(Y))
addy_in_aag(b, zero(Y), zero(Y)) → U8_aag(Y, binaryZ_in_g(Y))
U8_aag(Y, binaryZ_out_g(Y)) → addy_out_aag(b, zero(Y), zero(Y))
addy_in_aag(X, Y, Z) → U9_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), one(Y), zero(Z)) → U13_aag(X, Y, Z, addc_in_aag(X, Y, Z))
addc_in_aag(b, b, one(b)) → addc_out_aag(b, b, one(b))
addc_in_aag(X, b, Z) → U14_aag(X, Z, succZ_in_ag(X, Z))
succZ_in_ag(zero(X), one(X)) → U33_ag(X, binaryZ_in_g(X))
U33_ag(X, binaryZ_out_g(X)) → succZ_out_ag(zero(X), one(X))
succZ_in_ag(one(X), zero(Z)) → U34_ag(X, Z, succ_in_ag(X, Z))
succ_in_ag(b, one(b)) → succ_out_ag(b, one(b))
succ_in_ag(zero(X), one(X)) → U31_ag(X, binaryZ_in_g(X))
U31_ag(X, binaryZ_out_g(X)) → succ_out_ag(zero(X), one(X))
succ_in_ag(one(X), zero(Z)) → U32_ag(X, Z, succ_in_ag(X, Z))
U32_ag(X, Z, succ_out_ag(X, Z)) → succ_out_ag(one(X), zero(Z))
U34_ag(X, Z, succ_out_ag(X, Z)) → succZ_out_ag(one(X), zero(Z))
U14_aag(X, Z, succZ_out_ag(X, Z)) → addc_out_aag(X, b, Z)
addc_in_aag(b, Y, Z) → U15_aag(Y, Z, succZ_in_ag(Y, Z))
U15_aag(Y, Z, succZ_out_ag(Y, Z)) → addc_out_aag(b, Y, Z)
addc_in_aag(X, Y, Z) → U16_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(zero(X), zero(Y), one(Z)) → U23_aag(X, Y, Z, addz_in_aag(X, Y, Z))
U23_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addC_out_aag(zero(X), zero(Y), one(Z))
addC_in_aag(zero(X), one(Y), zero(Z)) → U24_aag(X, Y, Z, addX_in_aag(X, Y, Z))
addX_in_aag(zero(X), b, one(X)) → U17_aag(X, binaryZ_in_g(X))
U17_aag(X, binaryZ_out_g(X)) → addX_out_aag(zero(X), b, one(X))
addX_in_aag(one(X), b, zero(Z)) → U18_aag(X, Z, succ_in_ag(X, Z))
U18_aag(X, Z, succ_out_ag(X, Z)) → addX_out_aag(one(X), b, zero(Z))
addX_in_aag(X, Y, Z) → U19_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), zero(Y), zero(Z)) → U25_aag(X, Y, Z, addY_in_aag(X, Y, Z))
addY_in_aag(b, zero(Y), one(Y)) → U20_aag(Y, binaryZ_in_g(Y))
U20_aag(Y, binaryZ_out_g(Y)) → addY_out_aag(b, zero(Y), one(Y))
addY_in_aag(b, one(Y), zero(Z)) → U21_aag(Y, Z, succ_in_ag(Y, Z))
U21_aag(Y, Z, succ_out_ag(Y, Z)) → addY_out_aag(b, one(Y), zero(Z))
addY_in_aag(X, Y, Z) → U22_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), one(Y), one(Z)) → U26_aag(X, Y, Z, addc_in_aag(X, Y, Z))
U26_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addC_out_aag(one(X), one(Y), one(Z))
U22_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addY_out_aag(X, Y, Z)
U25_aag(X, Y, Z, addY_out_aag(X, Y, Z)) → addC_out_aag(one(X), zero(Y), zero(Z))
U19_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addX_out_aag(X, Y, Z)
U24_aag(X, Y, Z, addX_out_aag(X, Y, Z)) → addC_out_aag(zero(X), one(Y), zero(Z))
U16_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addc_out_aag(X, Y, Z)
U13_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addz_out_aag(one(X), one(Y), zero(Z))
U9_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addy_out_aag(X, Y, Z)
U12_aag(X, Y, Z, addy_out_aag(X, Y, Z)) → addz_out_aag(one(X), zero(Y), one(Z))
U6_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addx_out_aag(X, Y, Z)
U11_aag(X, Y, Z, addx_out_aag(X, Y, Z)) → addz_out_aag(zero(X), one(Y), one(Z))
U10_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addz_out_aag(zero(X), zero(Y), zero(Z))
U3_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → add_out_aag(X, Y, Z)
U37_aag(R, S, RSS, add_out_aag(S, zero(RS), RSS)) → times_out_aag(one(R), S, RSS)
U35_aag(R, S, RS, times_out_aag(R, S, RS)) → times_out_aag(zero(R), S, zero(RS))
SUCC_IN_AA(one(X), zero(Z)) → SUCC_IN_AA(X, Z)
SUCC_IN_AA → SUCC_IN_AA
ADDX_IN_AAA(X, Y, Z) → ADDZ_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(zero(X), zero(Y), zero(Z)) → ADDZ_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(zero(X), one(Y), one(Z)) → ADDX_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(one(X), zero(Y), one(Z)) → ADDY_IN_AAA(X, Y, Z)
ADDY_IN_AAA(X, Y, Z) → ADDZ_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(one(X), one(Y), zero(Z)) → ADDC_IN_AAA(X, Y, Z)
ADDC_IN_AAA(X, Y, Z) → ADDC_IN_AAA1(X, Y, Z)
ADDC_IN_AAA1(zero(X), zero(Y), one(Z)) → ADDZ_IN_AAA(X, Y, Z)
ADDC_IN_AAA1(zero(X), one(Y), zero(Z)) → ADDX_IN_AAA1(X, Y, Z)
ADDX_IN_AAA1(X, Y, Z) → ADDC_IN_AAA1(X, Y, Z)
ADDC_IN_AAA1(one(X), zero(Y), zero(Z)) → ADDY_IN_AAA1(X, Y, Z)
ADDY_IN_AAA1(X, Y, Z) → ADDC_IN_AAA1(X, Y, Z)
ADDC_IN_AAA1(one(X), one(Y), one(Z)) → ADDC_IN_AAA(X, Y, Z)
times_in_aag(one(b), X, X) → times_out_aag(one(b), X, X)
times_in_aag(zero(R), S, zero(RS)) → U35_aag(R, S, RS, times_in_aag(R, S, RS))
times_in_aag(one(R), S, RSS) → U36_aag(R, S, RSS, times_in_aaa(R, S, RS))
times_in_aaa(one(b), X, X) → times_out_aaa(one(b), X, X)
times_in_aaa(zero(R), S, zero(RS)) → U35_aaa(R, S, RS, times_in_aaa(R, S, RS))
times_in_aaa(one(R), S, RSS) → U36_aaa(R, S, RSS, times_in_aaa(R, S, RS))
U36_aaa(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aaa(R, S, RSS, add_in_aaa(S, zero(RS), RSS))
add_in_aaa(b, b, b) → add_out_aaa(b, b, b)
add_in_aaa(X, b, X) → U1_aaa(X, binaryZ_in_a(X))
binaryZ_in_a(zero(X)) → U29_a(X, binaryZ_in_a(X))
binaryZ_in_a(one(X)) → U30_a(X, binary_in_a(X))
binary_in_a(b) → binary_out_a(b)
binary_in_a(zero(X)) → U27_a(X, binaryZ_in_a(X))
U27_a(X, binaryZ_out_a(X)) → binary_out_a(zero(X))
binary_in_a(one(X)) → U28_a(X, binary_in_a(X))
U28_a(X, binary_out_a(X)) → binary_out_a(one(X))
U30_a(X, binary_out_a(X)) → binaryZ_out_a(one(X))
U29_a(X, binaryZ_out_a(X)) → binaryZ_out_a(zero(X))
U1_aaa(X, binaryZ_out_a(X)) → add_out_aaa(X, b, X)
add_in_aaa(b, Y, Y) → U2_aaa(Y, binaryZ_in_a(Y))
U2_aaa(Y, binaryZ_out_a(Y)) → add_out_aaa(b, Y, Y)
add_in_aaa(X, Y, Z) → U3_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), zero(Y), zero(Z)) → U10_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), one(Y), one(Z)) → U11_aaa(X, Y, Z, addx_in_aaa(X, Y, Z))
addx_in_aaa(one(X), b, one(X)) → U4_aaa(X, binary_in_a(X))
U4_aaa(X, binary_out_a(X)) → addx_out_aaa(one(X), b, one(X))
addx_in_aaa(zero(X), b, zero(X)) → U5_aaa(X, binaryZ_in_a(X))
U5_aaa(X, binaryZ_out_a(X)) → addx_out_aaa(zero(X), b, zero(X))
addx_in_aaa(X, Y, Z) → U6_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), zero(Y), one(Z)) → U12_aaa(X, Y, Z, addy_in_aaa(X, Y, Z))
addy_in_aaa(b, one(Y), one(Y)) → U7_aaa(Y, binary_in_a(Y))
U7_aaa(Y, binary_out_a(Y)) → addy_out_aaa(b, one(Y), one(Y))
addy_in_aaa(b, zero(Y), zero(Y)) → U8_aaa(Y, binaryZ_in_a(Y))
U8_aaa(Y, binaryZ_out_a(Y)) → addy_out_aaa(b, zero(Y), zero(Y))
addy_in_aaa(X, Y, Z) → U9_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), one(Y), zero(Z)) → U13_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
addc_in_aaa(b, b, one(b)) → addc_out_aaa(b, b, one(b))
addc_in_aaa(X, b, Z) → U14_aaa(X, Z, succZ_in_aa(X, Z))
succZ_in_aa(zero(X), one(X)) → U33_aa(X, binaryZ_in_a(X))
U33_aa(X, binaryZ_out_a(X)) → succZ_out_aa(zero(X), one(X))
succZ_in_aa(one(X), zero(Z)) → U34_aa(X, Z, succ_in_aa(X, Z))
succ_in_aa(b, one(b)) → succ_out_aa(b, one(b))
succ_in_aa(zero(X), one(X)) → U31_aa(X, binaryZ_in_a(X))
U31_aa(X, binaryZ_out_a(X)) → succ_out_aa(zero(X), one(X))
succ_in_aa(one(X), zero(Z)) → U32_aa(X, Z, succ_in_aa(X, Z))
U32_aa(X, Z, succ_out_aa(X, Z)) → succ_out_aa(one(X), zero(Z))
U34_aa(X, Z, succ_out_aa(X, Z)) → succZ_out_aa(one(X), zero(Z))
U14_aaa(X, Z, succZ_out_aa(X, Z)) → addc_out_aaa(X, b, Z)
addc_in_aaa(b, Y, Z) → U15_aaa(Y, Z, succZ_in_aa(Y, Z))
U15_aaa(Y, Z, succZ_out_aa(Y, Z)) → addc_out_aaa(b, Y, Z)
addc_in_aaa(X, Y, Z) → U16_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(zero(X), zero(Y), one(Z)) → U23_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
U23_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), zero(Y), one(Z))
addC_in_aaa(zero(X), one(Y), zero(Z)) → U24_aaa(X, Y, Z, addX_in_aaa(X, Y, Z))
addX_in_aaa(zero(X), b, one(X)) → U17_aaa(X, binaryZ_in_a(X))
U17_aaa(X, binaryZ_out_a(X)) → addX_out_aaa(zero(X), b, one(X))
addX_in_aaa(one(X), b, zero(Z)) → U18_aaa(X, Z, succ_in_aa(X, Z))
U18_aaa(X, Z, succ_out_aa(X, Z)) → addX_out_aaa(one(X), b, zero(Z))
addX_in_aaa(X, Y, Z) → U19_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), zero(Y), zero(Z)) → U25_aaa(X, Y, Z, addY_in_aaa(X, Y, Z))
addY_in_aaa(b, zero(Y), one(Y)) → U20_aaa(Y, binaryZ_in_a(Y))
U20_aaa(Y, binaryZ_out_a(Y)) → addY_out_aaa(b, zero(Y), one(Y))
addY_in_aaa(b, one(Y), zero(Z)) → U21_aaa(Y, Z, succ_in_aa(Y, Z))
U21_aaa(Y, Z, succ_out_aa(Y, Z)) → addY_out_aaa(b, one(Y), zero(Z))
addY_in_aaa(X, Y, Z) → U22_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), one(Y), one(Z)) → U26_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
U26_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), one(Y), one(Z))
U22_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addY_out_aaa(X, Y, Z)
U25_aaa(X, Y, Z, addY_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), zero(Y), zero(Z))
U19_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addX_out_aaa(X, Y, Z)
U24_aaa(X, Y, Z, addX_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), one(Y), zero(Z))
U16_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addc_out_aaa(X, Y, Z)
U13_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), one(Y), zero(Z))
U9_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addy_out_aaa(X, Y, Z)
U12_aaa(X, Y, Z, addy_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), zero(Y), one(Z))
U6_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addx_out_aaa(X, Y, Z)
U11_aaa(X, Y, Z, addx_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), one(Y), one(Z))
U10_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), zero(Y), zero(Z))
U3_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → add_out_aaa(X, Y, Z)
U37_aaa(R, S, RSS, add_out_aaa(S, zero(RS), RSS)) → times_out_aaa(one(R), S, RSS)
U35_aaa(R, S, RS, times_out_aaa(R, S, RS)) → times_out_aaa(zero(R), S, zero(RS))
U36_aag(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aag(R, S, RSS, add_in_aag(S, zero(RS), RSS))
add_in_aag(b, b, b) → add_out_aag(b, b, b)
add_in_aag(X, b, X) → U1_aag(X, binaryZ_in_g(X))
binaryZ_in_g(zero(X)) → U29_g(X, binaryZ_in_g(X))
binaryZ_in_g(one(X)) → U30_g(X, binary_in_g(X))
binary_in_g(b) → binary_out_g(b)
binary_in_g(zero(X)) → U27_g(X, binaryZ_in_g(X))
U27_g(X, binaryZ_out_g(X)) → binary_out_g(zero(X))
binary_in_g(one(X)) → U28_g(X, binary_in_g(X))
U28_g(X, binary_out_g(X)) → binary_out_g(one(X))
U30_g(X, binary_out_g(X)) → binaryZ_out_g(one(X))
U29_g(X, binaryZ_out_g(X)) → binaryZ_out_g(zero(X))
U1_aag(X, binaryZ_out_g(X)) → add_out_aag(X, b, X)
add_in_aag(b, Y, Y) → U2_aag(Y, binaryZ_in_g(Y))
U2_aag(Y, binaryZ_out_g(Y)) → add_out_aag(b, Y, Y)
add_in_aag(X, Y, Z) → U3_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), zero(Y), zero(Z)) → U10_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), one(Y), one(Z)) → U11_aag(X, Y, Z, addx_in_aag(X, Y, Z))
addx_in_aag(one(X), b, one(X)) → U4_aag(X, binary_in_g(X))
U4_aag(X, binary_out_g(X)) → addx_out_aag(one(X), b, one(X))
addx_in_aag(zero(X), b, zero(X)) → U5_aag(X, binaryZ_in_g(X))
U5_aag(X, binaryZ_out_g(X)) → addx_out_aag(zero(X), b, zero(X))
addx_in_aag(X, Y, Z) → U6_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), zero(Y), one(Z)) → U12_aag(X, Y, Z, addy_in_aag(X, Y, Z))
addy_in_aag(b, one(Y), one(Y)) → U7_aag(Y, binary_in_g(Y))
U7_aag(Y, binary_out_g(Y)) → addy_out_aag(b, one(Y), one(Y))
addy_in_aag(b, zero(Y), zero(Y)) → U8_aag(Y, binaryZ_in_g(Y))
U8_aag(Y, binaryZ_out_g(Y)) → addy_out_aag(b, zero(Y), zero(Y))
addy_in_aag(X, Y, Z) → U9_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), one(Y), zero(Z)) → U13_aag(X, Y, Z, addc_in_aag(X, Y, Z))
addc_in_aag(b, b, one(b)) → addc_out_aag(b, b, one(b))
addc_in_aag(X, b, Z) → U14_aag(X, Z, succZ_in_ag(X, Z))
succZ_in_ag(zero(X), one(X)) → U33_ag(X, binaryZ_in_g(X))
U33_ag(X, binaryZ_out_g(X)) → succZ_out_ag(zero(X), one(X))
succZ_in_ag(one(X), zero(Z)) → U34_ag(X, Z, succ_in_ag(X, Z))
succ_in_ag(b, one(b)) → succ_out_ag(b, one(b))
succ_in_ag(zero(X), one(X)) → U31_ag(X, binaryZ_in_g(X))
U31_ag(X, binaryZ_out_g(X)) → succ_out_ag(zero(X), one(X))
succ_in_ag(one(X), zero(Z)) → U32_ag(X, Z, succ_in_ag(X, Z))
U32_ag(X, Z, succ_out_ag(X, Z)) → succ_out_ag(one(X), zero(Z))
U34_ag(X, Z, succ_out_ag(X, Z)) → succZ_out_ag(one(X), zero(Z))
U14_aag(X, Z, succZ_out_ag(X, Z)) → addc_out_aag(X, b, Z)
addc_in_aag(b, Y, Z) → U15_aag(Y, Z, succZ_in_ag(Y, Z))
U15_aag(Y, Z, succZ_out_ag(Y, Z)) → addc_out_aag(b, Y, Z)
addc_in_aag(X, Y, Z) → U16_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(zero(X), zero(Y), one(Z)) → U23_aag(X, Y, Z, addz_in_aag(X, Y, Z))
U23_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addC_out_aag(zero(X), zero(Y), one(Z))
addC_in_aag(zero(X), one(Y), zero(Z)) → U24_aag(X, Y, Z, addX_in_aag(X, Y, Z))
addX_in_aag(zero(X), b, one(X)) → U17_aag(X, binaryZ_in_g(X))
U17_aag(X, binaryZ_out_g(X)) → addX_out_aag(zero(X), b, one(X))
addX_in_aag(one(X), b, zero(Z)) → U18_aag(X, Z, succ_in_ag(X, Z))
U18_aag(X, Z, succ_out_ag(X, Z)) → addX_out_aag(one(X), b, zero(Z))
addX_in_aag(X, Y, Z) → U19_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), zero(Y), zero(Z)) → U25_aag(X, Y, Z, addY_in_aag(X, Y, Z))
addY_in_aag(b, zero(Y), one(Y)) → U20_aag(Y, binaryZ_in_g(Y))
U20_aag(Y, binaryZ_out_g(Y)) → addY_out_aag(b, zero(Y), one(Y))
addY_in_aag(b, one(Y), zero(Z)) → U21_aag(Y, Z, succ_in_ag(Y, Z))
U21_aag(Y, Z, succ_out_ag(Y, Z)) → addY_out_aag(b, one(Y), zero(Z))
addY_in_aag(X, Y, Z) → U22_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), one(Y), one(Z)) → U26_aag(X, Y, Z, addc_in_aag(X, Y, Z))
U26_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addC_out_aag(one(X), one(Y), one(Z))
U22_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addY_out_aag(X, Y, Z)
U25_aag(X, Y, Z, addY_out_aag(X, Y, Z)) → addC_out_aag(one(X), zero(Y), zero(Z))
U19_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addX_out_aag(X, Y, Z)
U24_aag(X, Y, Z, addX_out_aag(X, Y, Z)) → addC_out_aag(zero(X), one(Y), zero(Z))
U16_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addc_out_aag(X, Y, Z)
U13_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addz_out_aag(one(X), one(Y), zero(Z))
U9_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addy_out_aag(X, Y, Z)
U12_aag(X, Y, Z, addy_out_aag(X, Y, Z)) → addz_out_aag(one(X), zero(Y), one(Z))
U6_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addx_out_aag(X, Y, Z)
U11_aag(X, Y, Z, addx_out_aag(X, Y, Z)) → addz_out_aag(zero(X), one(Y), one(Z))
U10_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addz_out_aag(zero(X), zero(Y), zero(Z))
U3_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → add_out_aag(X, Y, Z)
U37_aag(R, S, RSS, add_out_aag(S, zero(RS), RSS)) → times_out_aag(one(R), S, RSS)
U35_aag(R, S, RS, times_out_aag(R, S, RS)) → times_out_aag(zero(R), S, zero(RS))
ADDX_IN_AAA(X, Y, Z) → ADDZ_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(zero(X), zero(Y), zero(Z)) → ADDZ_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(zero(X), one(Y), one(Z)) → ADDX_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(one(X), zero(Y), one(Z)) → ADDY_IN_AAA(X, Y, Z)
ADDY_IN_AAA(X, Y, Z) → ADDZ_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(one(X), one(Y), zero(Z)) → ADDC_IN_AAA(X, Y, Z)
ADDC_IN_AAA(X, Y, Z) → ADDC_IN_AAA1(X, Y, Z)
ADDC_IN_AAA1(zero(X), zero(Y), one(Z)) → ADDZ_IN_AAA(X, Y, Z)
ADDC_IN_AAA1(zero(X), one(Y), zero(Z)) → ADDX_IN_AAA1(X, Y, Z)
ADDX_IN_AAA1(X, Y, Z) → ADDC_IN_AAA1(X, Y, Z)
ADDC_IN_AAA1(one(X), zero(Y), zero(Z)) → ADDY_IN_AAA1(X, Y, Z)
ADDY_IN_AAA1(X, Y, Z) → ADDC_IN_AAA1(X, Y, Z)
ADDC_IN_AAA1(one(X), one(Y), one(Z)) → ADDC_IN_AAA(X, Y, Z)
ADDX_IN_AAA → ADDZ_IN_AAA
ADDZ_IN_AAA → ADDZ_IN_AAA
ADDZ_IN_AAA → ADDX_IN_AAA
ADDZ_IN_AAA → ADDY_IN_AAA
ADDY_IN_AAA → ADDZ_IN_AAA
ADDZ_IN_AAA → ADDC_IN_AAA
ADDC_IN_AAA → ADDC_IN_AAA1
ADDC_IN_AAA1 → ADDZ_IN_AAA
ADDC_IN_AAA1 → ADDX_IN_AAA1
ADDX_IN_AAA1 → ADDC_IN_AAA1
ADDC_IN_AAA1 → ADDY_IN_AAA1
ADDY_IN_AAA1 → ADDC_IN_AAA1
ADDC_IN_AAA1 → ADDC_IN_AAA
TIMES_IN_AAA(one(R), S, RSS) → TIMES_IN_AAA(R, S, RS)
TIMES_IN_AAA(zero(R), S, zero(RS)) → TIMES_IN_AAA(R, S, RS)
times_in_aag(one(b), X, X) → times_out_aag(one(b), X, X)
times_in_aag(zero(R), S, zero(RS)) → U35_aag(R, S, RS, times_in_aag(R, S, RS))
times_in_aag(one(R), S, RSS) → U36_aag(R, S, RSS, times_in_aaa(R, S, RS))
times_in_aaa(one(b), X, X) → times_out_aaa(one(b), X, X)
times_in_aaa(zero(R), S, zero(RS)) → U35_aaa(R, S, RS, times_in_aaa(R, S, RS))
times_in_aaa(one(R), S, RSS) → U36_aaa(R, S, RSS, times_in_aaa(R, S, RS))
U36_aaa(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aaa(R, S, RSS, add_in_aaa(S, zero(RS), RSS))
add_in_aaa(b, b, b) → add_out_aaa(b, b, b)
add_in_aaa(X, b, X) → U1_aaa(X, binaryZ_in_a(X))
binaryZ_in_a(zero(X)) → U29_a(X, binaryZ_in_a(X))
binaryZ_in_a(one(X)) → U30_a(X, binary_in_a(X))
binary_in_a(b) → binary_out_a(b)
binary_in_a(zero(X)) → U27_a(X, binaryZ_in_a(X))
U27_a(X, binaryZ_out_a(X)) → binary_out_a(zero(X))
binary_in_a(one(X)) → U28_a(X, binary_in_a(X))
U28_a(X, binary_out_a(X)) → binary_out_a(one(X))
U30_a(X, binary_out_a(X)) → binaryZ_out_a(one(X))
U29_a(X, binaryZ_out_a(X)) → binaryZ_out_a(zero(X))
U1_aaa(X, binaryZ_out_a(X)) → add_out_aaa(X, b, X)
add_in_aaa(b, Y, Y) → U2_aaa(Y, binaryZ_in_a(Y))
U2_aaa(Y, binaryZ_out_a(Y)) → add_out_aaa(b, Y, Y)
add_in_aaa(X, Y, Z) → U3_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), zero(Y), zero(Z)) → U10_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), one(Y), one(Z)) → U11_aaa(X, Y, Z, addx_in_aaa(X, Y, Z))
addx_in_aaa(one(X), b, one(X)) → U4_aaa(X, binary_in_a(X))
U4_aaa(X, binary_out_a(X)) → addx_out_aaa(one(X), b, one(X))
addx_in_aaa(zero(X), b, zero(X)) → U5_aaa(X, binaryZ_in_a(X))
U5_aaa(X, binaryZ_out_a(X)) → addx_out_aaa(zero(X), b, zero(X))
addx_in_aaa(X, Y, Z) → U6_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), zero(Y), one(Z)) → U12_aaa(X, Y, Z, addy_in_aaa(X, Y, Z))
addy_in_aaa(b, one(Y), one(Y)) → U7_aaa(Y, binary_in_a(Y))
U7_aaa(Y, binary_out_a(Y)) → addy_out_aaa(b, one(Y), one(Y))
addy_in_aaa(b, zero(Y), zero(Y)) → U8_aaa(Y, binaryZ_in_a(Y))
U8_aaa(Y, binaryZ_out_a(Y)) → addy_out_aaa(b, zero(Y), zero(Y))
addy_in_aaa(X, Y, Z) → U9_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), one(Y), zero(Z)) → U13_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
addc_in_aaa(b, b, one(b)) → addc_out_aaa(b, b, one(b))
addc_in_aaa(X, b, Z) → U14_aaa(X, Z, succZ_in_aa(X, Z))
succZ_in_aa(zero(X), one(X)) → U33_aa(X, binaryZ_in_a(X))
U33_aa(X, binaryZ_out_a(X)) → succZ_out_aa(zero(X), one(X))
succZ_in_aa(one(X), zero(Z)) → U34_aa(X, Z, succ_in_aa(X, Z))
succ_in_aa(b, one(b)) → succ_out_aa(b, one(b))
succ_in_aa(zero(X), one(X)) → U31_aa(X, binaryZ_in_a(X))
U31_aa(X, binaryZ_out_a(X)) → succ_out_aa(zero(X), one(X))
succ_in_aa(one(X), zero(Z)) → U32_aa(X, Z, succ_in_aa(X, Z))
U32_aa(X, Z, succ_out_aa(X, Z)) → succ_out_aa(one(X), zero(Z))
U34_aa(X, Z, succ_out_aa(X, Z)) → succZ_out_aa(one(X), zero(Z))
U14_aaa(X, Z, succZ_out_aa(X, Z)) → addc_out_aaa(X, b, Z)
addc_in_aaa(b, Y, Z) → U15_aaa(Y, Z, succZ_in_aa(Y, Z))
U15_aaa(Y, Z, succZ_out_aa(Y, Z)) → addc_out_aaa(b, Y, Z)
addc_in_aaa(X, Y, Z) → U16_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(zero(X), zero(Y), one(Z)) → U23_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
U23_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), zero(Y), one(Z))
addC_in_aaa(zero(X), one(Y), zero(Z)) → U24_aaa(X, Y, Z, addX_in_aaa(X, Y, Z))
addX_in_aaa(zero(X), b, one(X)) → U17_aaa(X, binaryZ_in_a(X))
U17_aaa(X, binaryZ_out_a(X)) → addX_out_aaa(zero(X), b, one(X))
addX_in_aaa(one(X), b, zero(Z)) → U18_aaa(X, Z, succ_in_aa(X, Z))
U18_aaa(X, Z, succ_out_aa(X, Z)) → addX_out_aaa(one(X), b, zero(Z))
addX_in_aaa(X, Y, Z) → U19_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), zero(Y), zero(Z)) → U25_aaa(X, Y, Z, addY_in_aaa(X, Y, Z))
addY_in_aaa(b, zero(Y), one(Y)) → U20_aaa(Y, binaryZ_in_a(Y))
U20_aaa(Y, binaryZ_out_a(Y)) → addY_out_aaa(b, zero(Y), one(Y))
addY_in_aaa(b, one(Y), zero(Z)) → U21_aaa(Y, Z, succ_in_aa(Y, Z))
U21_aaa(Y, Z, succ_out_aa(Y, Z)) → addY_out_aaa(b, one(Y), zero(Z))
addY_in_aaa(X, Y, Z) → U22_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), one(Y), one(Z)) → U26_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
U26_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), one(Y), one(Z))
U22_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addY_out_aaa(X, Y, Z)
U25_aaa(X, Y, Z, addY_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), zero(Y), zero(Z))
U19_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addX_out_aaa(X, Y, Z)
U24_aaa(X, Y, Z, addX_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), one(Y), zero(Z))
U16_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addc_out_aaa(X, Y, Z)
U13_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), one(Y), zero(Z))
U9_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addy_out_aaa(X, Y, Z)
U12_aaa(X, Y, Z, addy_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), zero(Y), one(Z))
U6_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addx_out_aaa(X, Y, Z)
U11_aaa(X, Y, Z, addx_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), one(Y), one(Z))
U10_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), zero(Y), zero(Z))
U3_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → add_out_aaa(X, Y, Z)
U37_aaa(R, S, RSS, add_out_aaa(S, zero(RS), RSS)) → times_out_aaa(one(R), S, RSS)
U35_aaa(R, S, RS, times_out_aaa(R, S, RS)) → times_out_aaa(zero(R), S, zero(RS))
U36_aag(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aag(R, S, RSS, add_in_aag(S, zero(RS), RSS))
add_in_aag(b, b, b) → add_out_aag(b, b, b)
add_in_aag(X, b, X) → U1_aag(X, binaryZ_in_g(X))
binaryZ_in_g(zero(X)) → U29_g(X, binaryZ_in_g(X))
binaryZ_in_g(one(X)) → U30_g(X, binary_in_g(X))
binary_in_g(b) → binary_out_g(b)
binary_in_g(zero(X)) → U27_g(X, binaryZ_in_g(X))
U27_g(X, binaryZ_out_g(X)) → binary_out_g(zero(X))
binary_in_g(one(X)) → U28_g(X, binary_in_g(X))
U28_g(X, binary_out_g(X)) → binary_out_g(one(X))
U30_g(X, binary_out_g(X)) → binaryZ_out_g(one(X))
U29_g(X, binaryZ_out_g(X)) → binaryZ_out_g(zero(X))
U1_aag(X, binaryZ_out_g(X)) → add_out_aag(X, b, X)
add_in_aag(b, Y, Y) → U2_aag(Y, binaryZ_in_g(Y))
U2_aag(Y, binaryZ_out_g(Y)) → add_out_aag(b, Y, Y)
add_in_aag(X, Y, Z) → U3_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), zero(Y), zero(Z)) → U10_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), one(Y), one(Z)) → U11_aag(X, Y, Z, addx_in_aag(X, Y, Z))
addx_in_aag(one(X), b, one(X)) → U4_aag(X, binary_in_g(X))
U4_aag(X, binary_out_g(X)) → addx_out_aag(one(X), b, one(X))
addx_in_aag(zero(X), b, zero(X)) → U5_aag(X, binaryZ_in_g(X))
U5_aag(X, binaryZ_out_g(X)) → addx_out_aag(zero(X), b, zero(X))
addx_in_aag(X, Y, Z) → U6_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), zero(Y), one(Z)) → U12_aag(X, Y, Z, addy_in_aag(X, Y, Z))
addy_in_aag(b, one(Y), one(Y)) → U7_aag(Y, binary_in_g(Y))
U7_aag(Y, binary_out_g(Y)) → addy_out_aag(b, one(Y), one(Y))
addy_in_aag(b, zero(Y), zero(Y)) → U8_aag(Y, binaryZ_in_g(Y))
U8_aag(Y, binaryZ_out_g(Y)) → addy_out_aag(b, zero(Y), zero(Y))
addy_in_aag(X, Y, Z) → U9_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), one(Y), zero(Z)) → U13_aag(X, Y, Z, addc_in_aag(X, Y, Z))
addc_in_aag(b, b, one(b)) → addc_out_aag(b, b, one(b))
addc_in_aag(X, b, Z) → U14_aag(X, Z, succZ_in_ag(X, Z))
succZ_in_ag(zero(X), one(X)) → U33_ag(X, binaryZ_in_g(X))
U33_ag(X, binaryZ_out_g(X)) → succZ_out_ag(zero(X), one(X))
succZ_in_ag(one(X), zero(Z)) → U34_ag(X, Z, succ_in_ag(X, Z))
succ_in_ag(b, one(b)) → succ_out_ag(b, one(b))
succ_in_ag(zero(X), one(X)) → U31_ag(X, binaryZ_in_g(X))
U31_ag(X, binaryZ_out_g(X)) → succ_out_ag(zero(X), one(X))
succ_in_ag(one(X), zero(Z)) → U32_ag(X, Z, succ_in_ag(X, Z))
U32_ag(X, Z, succ_out_ag(X, Z)) → succ_out_ag(one(X), zero(Z))
U34_ag(X, Z, succ_out_ag(X, Z)) → succZ_out_ag(one(X), zero(Z))
U14_aag(X, Z, succZ_out_ag(X, Z)) → addc_out_aag(X, b, Z)
addc_in_aag(b, Y, Z) → U15_aag(Y, Z, succZ_in_ag(Y, Z))
U15_aag(Y, Z, succZ_out_ag(Y, Z)) → addc_out_aag(b, Y, Z)
addc_in_aag(X, Y, Z) → U16_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(zero(X), zero(Y), one(Z)) → U23_aag(X, Y, Z, addz_in_aag(X, Y, Z))
U23_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addC_out_aag(zero(X), zero(Y), one(Z))
addC_in_aag(zero(X), one(Y), zero(Z)) → U24_aag(X, Y, Z, addX_in_aag(X, Y, Z))
addX_in_aag(zero(X), b, one(X)) → U17_aag(X, binaryZ_in_g(X))
U17_aag(X, binaryZ_out_g(X)) → addX_out_aag(zero(X), b, one(X))
addX_in_aag(one(X), b, zero(Z)) → U18_aag(X, Z, succ_in_ag(X, Z))
U18_aag(X, Z, succ_out_ag(X, Z)) → addX_out_aag(one(X), b, zero(Z))
addX_in_aag(X, Y, Z) → U19_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), zero(Y), zero(Z)) → U25_aag(X, Y, Z, addY_in_aag(X, Y, Z))
addY_in_aag(b, zero(Y), one(Y)) → U20_aag(Y, binaryZ_in_g(Y))
U20_aag(Y, binaryZ_out_g(Y)) → addY_out_aag(b, zero(Y), one(Y))
addY_in_aag(b, one(Y), zero(Z)) → U21_aag(Y, Z, succ_in_ag(Y, Z))
U21_aag(Y, Z, succ_out_ag(Y, Z)) → addY_out_aag(b, one(Y), zero(Z))
addY_in_aag(X, Y, Z) → U22_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), one(Y), one(Z)) → U26_aag(X, Y, Z, addc_in_aag(X, Y, Z))
U26_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addC_out_aag(one(X), one(Y), one(Z))
U22_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addY_out_aag(X, Y, Z)
U25_aag(X, Y, Z, addY_out_aag(X, Y, Z)) → addC_out_aag(one(X), zero(Y), zero(Z))
U19_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addX_out_aag(X, Y, Z)
U24_aag(X, Y, Z, addX_out_aag(X, Y, Z)) → addC_out_aag(zero(X), one(Y), zero(Z))
U16_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addc_out_aag(X, Y, Z)
U13_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addz_out_aag(one(X), one(Y), zero(Z))
U9_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addy_out_aag(X, Y, Z)
U12_aag(X, Y, Z, addy_out_aag(X, Y, Z)) → addz_out_aag(one(X), zero(Y), one(Z))
U6_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addx_out_aag(X, Y, Z)
U11_aag(X, Y, Z, addx_out_aag(X, Y, Z)) → addz_out_aag(zero(X), one(Y), one(Z))
U10_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addz_out_aag(zero(X), zero(Y), zero(Z))
U3_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → add_out_aag(X, Y, Z)
U37_aag(R, S, RSS, add_out_aag(S, zero(RS), RSS)) → times_out_aag(one(R), S, RSS)
U35_aag(R, S, RS, times_out_aag(R, S, RS)) → times_out_aag(zero(R), S, zero(RS))
TIMES_IN_AAA(one(R), S, RSS) → TIMES_IN_AAA(R, S, RS)
TIMES_IN_AAA(zero(R), S, zero(RS)) → TIMES_IN_AAA(R, S, RS)
TIMES_IN_AAA → TIMES_IN_AAA
TIMES_IN_AAG(zero(R), S, zero(RS)) → TIMES_IN_AAG(R, S, RS)
times_in_aag(one(b), X, X) → times_out_aag(one(b), X, X)
times_in_aag(zero(R), S, zero(RS)) → U35_aag(R, S, RS, times_in_aag(R, S, RS))
times_in_aag(one(R), S, RSS) → U36_aag(R, S, RSS, times_in_aaa(R, S, RS))
times_in_aaa(one(b), X, X) → times_out_aaa(one(b), X, X)
times_in_aaa(zero(R), S, zero(RS)) → U35_aaa(R, S, RS, times_in_aaa(R, S, RS))
times_in_aaa(one(R), S, RSS) → U36_aaa(R, S, RSS, times_in_aaa(R, S, RS))
U36_aaa(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aaa(R, S, RSS, add_in_aaa(S, zero(RS), RSS))
add_in_aaa(b, b, b) → add_out_aaa(b, b, b)
add_in_aaa(X, b, X) → U1_aaa(X, binaryZ_in_a(X))
binaryZ_in_a(zero(X)) → U29_a(X, binaryZ_in_a(X))
binaryZ_in_a(one(X)) → U30_a(X, binary_in_a(X))
binary_in_a(b) → binary_out_a(b)
binary_in_a(zero(X)) → U27_a(X, binaryZ_in_a(X))
U27_a(X, binaryZ_out_a(X)) → binary_out_a(zero(X))
binary_in_a(one(X)) → U28_a(X, binary_in_a(X))
U28_a(X, binary_out_a(X)) → binary_out_a(one(X))
U30_a(X, binary_out_a(X)) → binaryZ_out_a(one(X))
U29_a(X, binaryZ_out_a(X)) → binaryZ_out_a(zero(X))
U1_aaa(X, binaryZ_out_a(X)) → add_out_aaa(X, b, X)
add_in_aaa(b, Y, Y) → U2_aaa(Y, binaryZ_in_a(Y))
U2_aaa(Y, binaryZ_out_a(Y)) → add_out_aaa(b, Y, Y)
add_in_aaa(X, Y, Z) → U3_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), zero(Y), zero(Z)) → U10_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), one(Y), one(Z)) → U11_aaa(X, Y, Z, addx_in_aaa(X, Y, Z))
addx_in_aaa(one(X), b, one(X)) → U4_aaa(X, binary_in_a(X))
U4_aaa(X, binary_out_a(X)) → addx_out_aaa(one(X), b, one(X))
addx_in_aaa(zero(X), b, zero(X)) → U5_aaa(X, binaryZ_in_a(X))
U5_aaa(X, binaryZ_out_a(X)) → addx_out_aaa(zero(X), b, zero(X))
addx_in_aaa(X, Y, Z) → U6_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), zero(Y), one(Z)) → U12_aaa(X, Y, Z, addy_in_aaa(X, Y, Z))
addy_in_aaa(b, one(Y), one(Y)) → U7_aaa(Y, binary_in_a(Y))
U7_aaa(Y, binary_out_a(Y)) → addy_out_aaa(b, one(Y), one(Y))
addy_in_aaa(b, zero(Y), zero(Y)) → U8_aaa(Y, binaryZ_in_a(Y))
U8_aaa(Y, binaryZ_out_a(Y)) → addy_out_aaa(b, zero(Y), zero(Y))
addy_in_aaa(X, Y, Z) → U9_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), one(Y), zero(Z)) → U13_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
addc_in_aaa(b, b, one(b)) → addc_out_aaa(b, b, one(b))
addc_in_aaa(X, b, Z) → U14_aaa(X, Z, succZ_in_aa(X, Z))
succZ_in_aa(zero(X), one(X)) → U33_aa(X, binaryZ_in_a(X))
U33_aa(X, binaryZ_out_a(X)) → succZ_out_aa(zero(X), one(X))
succZ_in_aa(one(X), zero(Z)) → U34_aa(X, Z, succ_in_aa(X, Z))
succ_in_aa(b, one(b)) → succ_out_aa(b, one(b))
succ_in_aa(zero(X), one(X)) → U31_aa(X, binaryZ_in_a(X))
U31_aa(X, binaryZ_out_a(X)) → succ_out_aa(zero(X), one(X))
succ_in_aa(one(X), zero(Z)) → U32_aa(X, Z, succ_in_aa(X, Z))
U32_aa(X, Z, succ_out_aa(X, Z)) → succ_out_aa(one(X), zero(Z))
U34_aa(X, Z, succ_out_aa(X, Z)) → succZ_out_aa(one(X), zero(Z))
U14_aaa(X, Z, succZ_out_aa(X, Z)) → addc_out_aaa(X, b, Z)
addc_in_aaa(b, Y, Z) → U15_aaa(Y, Z, succZ_in_aa(Y, Z))
U15_aaa(Y, Z, succZ_out_aa(Y, Z)) → addc_out_aaa(b, Y, Z)
addc_in_aaa(X, Y, Z) → U16_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(zero(X), zero(Y), one(Z)) → U23_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
U23_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), zero(Y), one(Z))
addC_in_aaa(zero(X), one(Y), zero(Z)) → U24_aaa(X, Y, Z, addX_in_aaa(X, Y, Z))
addX_in_aaa(zero(X), b, one(X)) → U17_aaa(X, binaryZ_in_a(X))
U17_aaa(X, binaryZ_out_a(X)) → addX_out_aaa(zero(X), b, one(X))
addX_in_aaa(one(X), b, zero(Z)) → U18_aaa(X, Z, succ_in_aa(X, Z))
U18_aaa(X, Z, succ_out_aa(X, Z)) → addX_out_aaa(one(X), b, zero(Z))
addX_in_aaa(X, Y, Z) → U19_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), zero(Y), zero(Z)) → U25_aaa(X, Y, Z, addY_in_aaa(X, Y, Z))
addY_in_aaa(b, zero(Y), one(Y)) → U20_aaa(Y, binaryZ_in_a(Y))
U20_aaa(Y, binaryZ_out_a(Y)) → addY_out_aaa(b, zero(Y), one(Y))
addY_in_aaa(b, one(Y), zero(Z)) → U21_aaa(Y, Z, succ_in_aa(Y, Z))
U21_aaa(Y, Z, succ_out_aa(Y, Z)) → addY_out_aaa(b, one(Y), zero(Z))
addY_in_aaa(X, Y, Z) → U22_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), one(Y), one(Z)) → U26_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
U26_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), one(Y), one(Z))
U22_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addY_out_aaa(X, Y, Z)
U25_aaa(X, Y, Z, addY_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), zero(Y), zero(Z))
U19_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addX_out_aaa(X, Y, Z)
U24_aaa(X, Y, Z, addX_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), one(Y), zero(Z))
U16_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addc_out_aaa(X, Y, Z)
U13_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), one(Y), zero(Z))
U9_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addy_out_aaa(X, Y, Z)
U12_aaa(X, Y, Z, addy_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), zero(Y), one(Z))
U6_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addx_out_aaa(X, Y, Z)
U11_aaa(X, Y, Z, addx_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), one(Y), one(Z))
U10_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), zero(Y), zero(Z))
U3_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → add_out_aaa(X, Y, Z)
U37_aaa(R, S, RSS, add_out_aaa(S, zero(RS), RSS)) → times_out_aaa(one(R), S, RSS)
U35_aaa(R, S, RS, times_out_aaa(R, S, RS)) → times_out_aaa(zero(R), S, zero(RS))
U36_aag(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aag(R, S, RSS, add_in_aag(S, zero(RS), RSS))
add_in_aag(b, b, b) → add_out_aag(b, b, b)
add_in_aag(X, b, X) → U1_aag(X, binaryZ_in_g(X))
binaryZ_in_g(zero(X)) → U29_g(X, binaryZ_in_g(X))
binaryZ_in_g(one(X)) → U30_g(X, binary_in_g(X))
binary_in_g(b) → binary_out_g(b)
binary_in_g(zero(X)) → U27_g(X, binaryZ_in_g(X))
U27_g(X, binaryZ_out_g(X)) → binary_out_g(zero(X))
binary_in_g(one(X)) → U28_g(X, binary_in_g(X))
U28_g(X, binary_out_g(X)) → binary_out_g(one(X))
U30_g(X, binary_out_g(X)) → binaryZ_out_g(one(X))
U29_g(X, binaryZ_out_g(X)) → binaryZ_out_g(zero(X))
U1_aag(X, binaryZ_out_g(X)) → add_out_aag(X, b, X)
add_in_aag(b, Y, Y) → U2_aag(Y, binaryZ_in_g(Y))
U2_aag(Y, binaryZ_out_g(Y)) → add_out_aag(b, Y, Y)
add_in_aag(X, Y, Z) → U3_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), zero(Y), zero(Z)) → U10_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), one(Y), one(Z)) → U11_aag(X, Y, Z, addx_in_aag(X, Y, Z))
addx_in_aag(one(X), b, one(X)) → U4_aag(X, binary_in_g(X))
U4_aag(X, binary_out_g(X)) → addx_out_aag(one(X), b, one(X))
addx_in_aag(zero(X), b, zero(X)) → U5_aag(X, binaryZ_in_g(X))
U5_aag(X, binaryZ_out_g(X)) → addx_out_aag(zero(X), b, zero(X))
addx_in_aag(X, Y, Z) → U6_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), zero(Y), one(Z)) → U12_aag(X, Y, Z, addy_in_aag(X, Y, Z))
addy_in_aag(b, one(Y), one(Y)) → U7_aag(Y, binary_in_g(Y))
U7_aag(Y, binary_out_g(Y)) → addy_out_aag(b, one(Y), one(Y))
addy_in_aag(b, zero(Y), zero(Y)) → U8_aag(Y, binaryZ_in_g(Y))
U8_aag(Y, binaryZ_out_g(Y)) → addy_out_aag(b, zero(Y), zero(Y))
addy_in_aag(X, Y, Z) → U9_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), one(Y), zero(Z)) → U13_aag(X, Y, Z, addc_in_aag(X, Y, Z))
addc_in_aag(b, b, one(b)) → addc_out_aag(b, b, one(b))
addc_in_aag(X, b, Z) → U14_aag(X, Z, succZ_in_ag(X, Z))
succZ_in_ag(zero(X), one(X)) → U33_ag(X, binaryZ_in_g(X))
U33_ag(X, binaryZ_out_g(X)) → succZ_out_ag(zero(X), one(X))
succZ_in_ag(one(X), zero(Z)) → U34_ag(X, Z, succ_in_ag(X, Z))
succ_in_ag(b, one(b)) → succ_out_ag(b, one(b))
succ_in_ag(zero(X), one(X)) → U31_ag(X, binaryZ_in_g(X))
U31_ag(X, binaryZ_out_g(X)) → succ_out_ag(zero(X), one(X))
succ_in_ag(one(X), zero(Z)) → U32_ag(X, Z, succ_in_ag(X, Z))
U32_ag(X, Z, succ_out_ag(X, Z)) → succ_out_ag(one(X), zero(Z))
U34_ag(X, Z, succ_out_ag(X, Z)) → succZ_out_ag(one(X), zero(Z))
U14_aag(X, Z, succZ_out_ag(X, Z)) → addc_out_aag(X, b, Z)
addc_in_aag(b, Y, Z) → U15_aag(Y, Z, succZ_in_ag(Y, Z))
U15_aag(Y, Z, succZ_out_ag(Y, Z)) → addc_out_aag(b, Y, Z)
addc_in_aag(X, Y, Z) → U16_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(zero(X), zero(Y), one(Z)) → U23_aag(X, Y, Z, addz_in_aag(X, Y, Z))
U23_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addC_out_aag(zero(X), zero(Y), one(Z))
addC_in_aag(zero(X), one(Y), zero(Z)) → U24_aag(X, Y, Z, addX_in_aag(X, Y, Z))
addX_in_aag(zero(X), b, one(X)) → U17_aag(X, binaryZ_in_g(X))
U17_aag(X, binaryZ_out_g(X)) → addX_out_aag(zero(X), b, one(X))
addX_in_aag(one(X), b, zero(Z)) → U18_aag(X, Z, succ_in_ag(X, Z))
U18_aag(X, Z, succ_out_ag(X, Z)) → addX_out_aag(one(X), b, zero(Z))
addX_in_aag(X, Y, Z) → U19_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), zero(Y), zero(Z)) → U25_aag(X, Y, Z, addY_in_aag(X, Y, Z))
addY_in_aag(b, zero(Y), one(Y)) → U20_aag(Y, binaryZ_in_g(Y))
U20_aag(Y, binaryZ_out_g(Y)) → addY_out_aag(b, zero(Y), one(Y))
addY_in_aag(b, one(Y), zero(Z)) → U21_aag(Y, Z, succ_in_ag(Y, Z))
U21_aag(Y, Z, succ_out_ag(Y, Z)) → addY_out_aag(b, one(Y), zero(Z))
addY_in_aag(X, Y, Z) → U22_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), one(Y), one(Z)) → U26_aag(X, Y, Z, addc_in_aag(X, Y, Z))
U26_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addC_out_aag(one(X), one(Y), one(Z))
U22_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addY_out_aag(X, Y, Z)
U25_aag(X, Y, Z, addY_out_aag(X, Y, Z)) → addC_out_aag(one(X), zero(Y), zero(Z))
U19_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addX_out_aag(X, Y, Z)
U24_aag(X, Y, Z, addX_out_aag(X, Y, Z)) → addC_out_aag(zero(X), one(Y), zero(Z))
U16_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addc_out_aag(X, Y, Z)
U13_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addz_out_aag(one(X), one(Y), zero(Z))
U9_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addy_out_aag(X, Y, Z)
U12_aag(X, Y, Z, addy_out_aag(X, Y, Z)) → addz_out_aag(one(X), zero(Y), one(Z))
U6_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addx_out_aag(X, Y, Z)
U11_aag(X, Y, Z, addx_out_aag(X, Y, Z)) → addz_out_aag(zero(X), one(Y), one(Z))
U10_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addz_out_aag(zero(X), zero(Y), zero(Z))
U3_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → add_out_aag(X, Y, Z)
U37_aag(R, S, RSS, add_out_aag(S, zero(RS), RSS)) → times_out_aag(one(R), S, RSS)
U35_aag(R, S, RS, times_out_aag(R, S, RS)) → times_out_aag(zero(R), S, zero(RS))
TIMES_IN_AAG(zero(R), S, zero(RS)) → TIMES_IN_AAG(R, S, RS)
TIMES_IN_AAG(zero(RS)) → TIMES_IN_AAG(RS)
From the DPs we obtained the following set of size-change graphs:
times_in_aag(one(b), X, X) → times_out_aag(one(b), X, X)
times_in_aag(zero(R), S, zero(RS)) → U35_aag(R, S, RS, times_in_aag(R, S, RS))
times_in_aag(one(R), S, RSS) → U36_aag(R, S, RSS, times_in_aaa(R, S, RS))
times_in_aaa(one(b), X, X) → times_out_aaa(one(b), X, X)
times_in_aaa(zero(R), S, zero(RS)) → U35_aaa(R, S, RS, times_in_aaa(R, S, RS))
times_in_aaa(one(R), S, RSS) → U36_aaa(R, S, RSS, times_in_aaa(R, S, RS))
U36_aaa(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aaa(R, S, RSS, add_in_aaa(S, zero(RS), RSS))
add_in_aaa(b, b, b) → add_out_aaa(b, b, b)
add_in_aaa(X, b, X) → U1_aaa(X, binaryZ_in_a(X))
binaryZ_in_a(zero(X)) → U29_a(X, binaryZ_in_a(X))
binaryZ_in_a(one(X)) → U30_a(X, binary_in_a(X))
binary_in_a(b) → binary_out_a(b)
binary_in_a(zero(X)) → U27_a(X, binaryZ_in_a(X))
U27_a(X, binaryZ_out_a(X)) → binary_out_a(zero(X))
binary_in_a(one(X)) → U28_a(X, binary_in_a(X))
U28_a(X, binary_out_a(X)) → binary_out_a(one(X))
U30_a(X, binary_out_a(X)) → binaryZ_out_a(one(X))
U29_a(X, binaryZ_out_a(X)) → binaryZ_out_a(zero(X))
U1_aaa(X, binaryZ_out_a(X)) → add_out_aaa(X, b, X)
add_in_aaa(b, Y, Y) → U2_aaa(Y, binaryZ_in_a(Y))
U2_aaa(Y, binaryZ_out_a(Y)) → add_out_aaa(b, Y, Y)
add_in_aaa(X, Y, Z) → U3_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), zero(Y), zero(Z)) → U10_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), one(Y), one(Z)) → U11_aaa(X, Y, Z, addx_in_aaa(X, Y, Z))
addx_in_aaa(one(X), b, one(X)) → U4_aaa(X, binary_in_a(X))
U4_aaa(X, binary_out_a(X)) → addx_out_aaa(one(X), b, one(X))
addx_in_aaa(zero(X), b, zero(X)) → U5_aaa(X, binaryZ_in_a(X))
U5_aaa(X, binaryZ_out_a(X)) → addx_out_aaa(zero(X), b, zero(X))
addx_in_aaa(X, Y, Z) → U6_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), zero(Y), one(Z)) → U12_aaa(X, Y, Z, addy_in_aaa(X, Y, Z))
addy_in_aaa(b, one(Y), one(Y)) → U7_aaa(Y, binary_in_a(Y))
U7_aaa(Y, binary_out_a(Y)) → addy_out_aaa(b, one(Y), one(Y))
addy_in_aaa(b, zero(Y), zero(Y)) → U8_aaa(Y, binaryZ_in_a(Y))
U8_aaa(Y, binaryZ_out_a(Y)) → addy_out_aaa(b, zero(Y), zero(Y))
addy_in_aaa(X, Y, Z) → U9_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), one(Y), zero(Z)) → U13_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
addc_in_aaa(b, b, one(b)) → addc_out_aaa(b, b, one(b))
addc_in_aaa(X, b, Z) → U14_aaa(X, Z, succZ_in_aa(X, Z))
succZ_in_aa(zero(X), one(X)) → U33_aa(X, binaryZ_in_a(X))
U33_aa(X, binaryZ_out_a(X)) → succZ_out_aa(zero(X), one(X))
succZ_in_aa(one(X), zero(Z)) → U34_aa(X, Z, succ_in_aa(X, Z))
succ_in_aa(b, one(b)) → succ_out_aa(b, one(b))
succ_in_aa(zero(X), one(X)) → U31_aa(X, binaryZ_in_a(X))
U31_aa(X, binaryZ_out_a(X)) → succ_out_aa(zero(X), one(X))
succ_in_aa(one(X), zero(Z)) → U32_aa(X, Z, succ_in_aa(X, Z))
U32_aa(X, Z, succ_out_aa(X, Z)) → succ_out_aa(one(X), zero(Z))
U34_aa(X, Z, succ_out_aa(X, Z)) → succZ_out_aa(one(X), zero(Z))
U14_aaa(X, Z, succZ_out_aa(X, Z)) → addc_out_aaa(X, b, Z)
addc_in_aaa(b, Y, Z) → U15_aaa(Y, Z, succZ_in_aa(Y, Z))
U15_aaa(Y, Z, succZ_out_aa(Y, Z)) → addc_out_aaa(b, Y, Z)
addc_in_aaa(X, Y, Z) → U16_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(zero(X), zero(Y), one(Z)) → U23_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
U23_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), zero(Y), one(Z))
addC_in_aaa(zero(X), one(Y), zero(Z)) → U24_aaa(X, Y, Z, addX_in_aaa(X, Y, Z))
addX_in_aaa(zero(X), b, one(X)) → U17_aaa(X, binaryZ_in_a(X))
U17_aaa(X, binaryZ_out_a(X)) → addX_out_aaa(zero(X), b, one(X))
addX_in_aaa(one(X), b, zero(Z)) → U18_aaa(X, Z, succ_in_aa(X, Z))
U18_aaa(X, Z, succ_out_aa(X, Z)) → addX_out_aaa(one(X), b, zero(Z))
addX_in_aaa(X, Y, Z) → U19_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), zero(Y), zero(Z)) → U25_aaa(X, Y, Z, addY_in_aaa(X, Y, Z))
addY_in_aaa(b, zero(Y), one(Y)) → U20_aaa(Y, binaryZ_in_a(Y))
U20_aaa(Y, binaryZ_out_a(Y)) → addY_out_aaa(b, zero(Y), one(Y))
addY_in_aaa(b, one(Y), zero(Z)) → U21_aaa(Y, Z, succ_in_aa(Y, Z))
U21_aaa(Y, Z, succ_out_aa(Y, Z)) → addY_out_aaa(b, one(Y), zero(Z))
addY_in_aaa(X, Y, Z) → U22_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), one(Y), one(Z)) → U26_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
U26_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), one(Y), one(Z))
U22_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addY_out_aaa(X, Y, Z)
U25_aaa(X, Y, Z, addY_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), zero(Y), zero(Z))
U19_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addX_out_aaa(X, Y, Z)
U24_aaa(X, Y, Z, addX_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), one(Y), zero(Z))
U16_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addc_out_aaa(X, Y, Z)
U13_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), one(Y), zero(Z))
U9_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addy_out_aaa(X, Y, Z)
U12_aaa(X, Y, Z, addy_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), zero(Y), one(Z))
U6_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addx_out_aaa(X, Y, Z)
U11_aaa(X, Y, Z, addx_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), one(Y), one(Z))
U10_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), zero(Y), zero(Z))
U3_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → add_out_aaa(X, Y, Z)
U37_aaa(R, S, RSS, add_out_aaa(S, zero(RS), RSS)) → times_out_aaa(one(R), S, RSS)
U35_aaa(R, S, RS, times_out_aaa(R, S, RS)) → times_out_aaa(zero(R), S, zero(RS))
U36_aag(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aag(R, S, RSS, add_in_aag(S, zero(RS), RSS))
add_in_aag(b, b, b) → add_out_aag(b, b, b)
add_in_aag(X, b, X) → U1_aag(X, binaryZ_in_g(X))
binaryZ_in_g(zero(X)) → U29_g(X, binaryZ_in_g(X))
binaryZ_in_g(one(X)) → U30_g(X, binary_in_g(X))
binary_in_g(b) → binary_out_g(b)
binary_in_g(zero(X)) → U27_g(X, binaryZ_in_g(X))
U27_g(X, binaryZ_out_g(X)) → binary_out_g(zero(X))
binary_in_g(one(X)) → U28_g(X, binary_in_g(X))
U28_g(X, binary_out_g(X)) → binary_out_g(one(X))
U30_g(X, binary_out_g(X)) → binaryZ_out_g(one(X))
U29_g(X, binaryZ_out_g(X)) → binaryZ_out_g(zero(X))
U1_aag(X, binaryZ_out_g(X)) → add_out_aag(X, b, X)
add_in_aag(b, Y, Y) → U2_aag(Y, binaryZ_in_g(Y))
U2_aag(Y, binaryZ_out_g(Y)) → add_out_aag(b, Y, Y)
add_in_aag(X, Y, Z) → U3_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), zero(Y), zero(Z)) → U10_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), one(Y), one(Z)) → U11_aag(X, Y, Z, addx_in_aag(X, Y, Z))
addx_in_aag(one(X), b, one(X)) → U4_aag(X, binary_in_g(X))
U4_aag(X, binary_out_g(X)) → addx_out_aag(one(X), b, one(X))
addx_in_aag(zero(X), b, zero(X)) → U5_aag(X, binaryZ_in_g(X))
U5_aag(X, binaryZ_out_g(X)) → addx_out_aag(zero(X), b, zero(X))
addx_in_aag(X, Y, Z) → U6_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), zero(Y), one(Z)) → U12_aag(X, Y, Z, addy_in_aag(X, Y, Z))
addy_in_aag(b, one(Y), one(Y)) → U7_aag(Y, binary_in_g(Y))
U7_aag(Y, binary_out_g(Y)) → addy_out_aag(b, one(Y), one(Y))
addy_in_aag(b, zero(Y), zero(Y)) → U8_aag(Y, binaryZ_in_g(Y))
U8_aag(Y, binaryZ_out_g(Y)) → addy_out_aag(b, zero(Y), zero(Y))
addy_in_aag(X, Y, Z) → U9_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), one(Y), zero(Z)) → U13_aag(X, Y, Z, addc_in_aag(X, Y, Z))
addc_in_aag(b, b, one(b)) → addc_out_aag(b, b, one(b))
addc_in_aag(X, b, Z) → U14_aag(X, Z, succZ_in_ag(X, Z))
succZ_in_ag(zero(X), one(X)) → U33_ag(X, binaryZ_in_g(X))
U33_ag(X, binaryZ_out_g(X)) → succZ_out_ag(zero(X), one(X))
succZ_in_ag(one(X), zero(Z)) → U34_ag(X, Z, succ_in_ag(X, Z))
succ_in_ag(b, one(b)) → succ_out_ag(b, one(b))
succ_in_ag(zero(X), one(X)) → U31_ag(X, binaryZ_in_g(X))
U31_ag(X, binaryZ_out_g(X)) → succ_out_ag(zero(X), one(X))
succ_in_ag(one(X), zero(Z)) → U32_ag(X, Z, succ_in_ag(X, Z))
U32_ag(X, Z, succ_out_ag(X, Z)) → succ_out_ag(one(X), zero(Z))
U34_ag(X, Z, succ_out_ag(X, Z)) → succZ_out_ag(one(X), zero(Z))
U14_aag(X, Z, succZ_out_ag(X, Z)) → addc_out_aag(X, b, Z)
addc_in_aag(b, Y, Z) → U15_aag(Y, Z, succZ_in_ag(Y, Z))
U15_aag(Y, Z, succZ_out_ag(Y, Z)) → addc_out_aag(b, Y, Z)
addc_in_aag(X, Y, Z) → U16_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(zero(X), zero(Y), one(Z)) → U23_aag(X, Y, Z, addz_in_aag(X, Y, Z))
U23_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addC_out_aag(zero(X), zero(Y), one(Z))
addC_in_aag(zero(X), one(Y), zero(Z)) → U24_aag(X, Y, Z, addX_in_aag(X, Y, Z))
addX_in_aag(zero(X), b, one(X)) → U17_aag(X, binaryZ_in_g(X))
U17_aag(X, binaryZ_out_g(X)) → addX_out_aag(zero(X), b, one(X))
addX_in_aag(one(X), b, zero(Z)) → U18_aag(X, Z, succ_in_ag(X, Z))
U18_aag(X, Z, succ_out_ag(X, Z)) → addX_out_aag(one(X), b, zero(Z))
addX_in_aag(X, Y, Z) → U19_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), zero(Y), zero(Z)) → U25_aag(X, Y, Z, addY_in_aag(X, Y, Z))
addY_in_aag(b, zero(Y), one(Y)) → U20_aag(Y, binaryZ_in_g(Y))
U20_aag(Y, binaryZ_out_g(Y)) → addY_out_aag(b, zero(Y), one(Y))
addY_in_aag(b, one(Y), zero(Z)) → U21_aag(Y, Z, succ_in_ag(Y, Z))
U21_aag(Y, Z, succ_out_ag(Y, Z)) → addY_out_aag(b, one(Y), zero(Z))
addY_in_aag(X, Y, Z) → U22_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), one(Y), one(Z)) → U26_aag(X, Y, Z, addc_in_aag(X, Y, Z))
U26_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addC_out_aag(one(X), one(Y), one(Z))
U22_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addY_out_aag(X, Y, Z)
U25_aag(X, Y, Z, addY_out_aag(X, Y, Z)) → addC_out_aag(one(X), zero(Y), zero(Z))
U19_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addX_out_aag(X, Y, Z)
U24_aag(X, Y, Z, addX_out_aag(X, Y, Z)) → addC_out_aag(zero(X), one(Y), zero(Z))
U16_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addc_out_aag(X, Y, Z)
U13_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addz_out_aag(one(X), one(Y), zero(Z))
U9_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addy_out_aag(X, Y, Z)
U12_aag(X, Y, Z, addy_out_aag(X, Y, Z)) → addz_out_aag(one(X), zero(Y), one(Z))
U6_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addx_out_aag(X, Y, Z)
U11_aag(X, Y, Z, addx_out_aag(X, Y, Z)) → addz_out_aag(zero(X), one(Y), one(Z))
U10_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addz_out_aag(zero(X), zero(Y), zero(Z))
U3_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → add_out_aag(X, Y, Z)
U37_aag(R, S, RSS, add_out_aag(S, zero(RS), RSS)) → times_out_aag(one(R), S, RSS)
U35_aag(R, S, RS, times_out_aag(R, S, RS)) → times_out_aag(zero(R), S, zero(RS))
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
times_in_aag(one(b), X, X) → times_out_aag(one(b), X, X)
times_in_aag(zero(R), S, zero(RS)) → U35_aag(R, S, RS, times_in_aag(R, S, RS))
times_in_aag(one(R), S, RSS) → U36_aag(R, S, RSS, times_in_aaa(R, S, RS))
times_in_aaa(one(b), X, X) → times_out_aaa(one(b), X, X)
times_in_aaa(zero(R), S, zero(RS)) → U35_aaa(R, S, RS, times_in_aaa(R, S, RS))
times_in_aaa(one(R), S, RSS) → U36_aaa(R, S, RSS, times_in_aaa(R, S, RS))
U36_aaa(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aaa(R, S, RSS, add_in_aaa(S, zero(RS), RSS))
add_in_aaa(b, b, b) → add_out_aaa(b, b, b)
add_in_aaa(X, b, X) → U1_aaa(X, binaryZ_in_a(X))
binaryZ_in_a(zero(X)) → U29_a(X, binaryZ_in_a(X))
binaryZ_in_a(one(X)) → U30_a(X, binary_in_a(X))
binary_in_a(b) → binary_out_a(b)
binary_in_a(zero(X)) → U27_a(X, binaryZ_in_a(X))
U27_a(X, binaryZ_out_a(X)) → binary_out_a(zero(X))
binary_in_a(one(X)) → U28_a(X, binary_in_a(X))
U28_a(X, binary_out_a(X)) → binary_out_a(one(X))
U30_a(X, binary_out_a(X)) → binaryZ_out_a(one(X))
U29_a(X, binaryZ_out_a(X)) → binaryZ_out_a(zero(X))
U1_aaa(X, binaryZ_out_a(X)) → add_out_aaa(X, b, X)
add_in_aaa(b, Y, Y) → U2_aaa(Y, binaryZ_in_a(Y))
U2_aaa(Y, binaryZ_out_a(Y)) → add_out_aaa(b, Y, Y)
add_in_aaa(X, Y, Z) → U3_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), zero(Y), zero(Z)) → U10_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), one(Y), one(Z)) → U11_aaa(X, Y, Z, addx_in_aaa(X, Y, Z))
addx_in_aaa(one(X), b, one(X)) → U4_aaa(X, binary_in_a(X))
U4_aaa(X, binary_out_a(X)) → addx_out_aaa(one(X), b, one(X))
addx_in_aaa(zero(X), b, zero(X)) → U5_aaa(X, binaryZ_in_a(X))
U5_aaa(X, binaryZ_out_a(X)) → addx_out_aaa(zero(X), b, zero(X))
addx_in_aaa(X, Y, Z) → U6_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), zero(Y), one(Z)) → U12_aaa(X, Y, Z, addy_in_aaa(X, Y, Z))
addy_in_aaa(b, one(Y), one(Y)) → U7_aaa(Y, binary_in_a(Y))
U7_aaa(Y, binary_out_a(Y)) → addy_out_aaa(b, one(Y), one(Y))
addy_in_aaa(b, zero(Y), zero(Y)) → U8_aaa(Y, binaryZ_in_a(Y))
U8_aaa(Y, binaryZ_out_a(Y)) → addy_out_aaa(b, zero(Y), zero(Y))
addy_in_aaa(X, Y, Z) → U9_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), one(Y), zero(Z)) → U13_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
addc_in_aaa(b, b, one(b)) → addc_out_aaa(b, b, one(b))
addc_in_aaa(X, b, Z) → U14_aaa(X, Z, succZ_in_aa(X, Z))
succZ_in_aa(zero(X), one(X)) → U33_aa(X, binaryZ_in_a(X))
U33_aa(X, binaryZ_out_a(X)) → succZ_out_aa(zero(X), one(X))
succZ_in_aa(one(X), zero(Z)) → U34_aa(X, Z, succ_in_aa(X, Z))
succ_in_aa(b, one(b)) → succ_out_aa(b, one(b))
succ_in_aa(zero(X), one(X)) → U31_aa(X, binaryZ_in_a(X))
U31_aa(X, binaryZ_out_a(X)) → succ_out_aa(zero(X), one(X))
succ_in_aa(one(X), zero(Z)) → U32_aa(X, Z, succ_in_aa(X, Z))
U32_aa(X, Z, succ_out_aa(X, Z)) → succ_out_aa(one(X), zero(Z))
U34_aa(X, Z, succ_out_aa(X, Z)) → succZ_out_aa(one(X), zero(Z))
U14_aaa(X, Z, succZ_out_aa(X, Z)) → addc_out_aaa(X, b, Z)
addc_in_aaa(b, Y, Z) → U15_aaa(Y, Z, succZ_in_aa(Y, Z))
U15_aaa(Y, Z, succZ_out_aa(Y, Z)) → addc_out_aaa(b, Y, Z)
addc_in_aaa(X, Y, Z) → U16_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(zero(X), zero(Y), one(Z)) → U23_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
U23_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), zero(Y), one(Z))
addC_in_aaa(zero(X), one(Y), zero(Z)) → U24_aaa(X, Y, Z, addX_in_aaa(X, Y, Z))
addX_in_aaa(zero(X), b, one(X)) → U17_aaa(X, binaryZ_in_a(X))
U17_aaa(X, binaryZ_out_a(X)) → addX_out_aaa(zero(X), b, one(X))
addX_in_aaa(one(X), b, zero(Z)) → U18_aaa(X, Z, succ_in_aa(X, Z))
U18_aaa(X, Z, succ_out_aa(X, Z)) → addX_out_aaa(one(X), b, zero(Z))
addX_in_aaa(X, Y, Z) → U19_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), zero(Y), zero(Z)) → U25_aaa(X, Y, Z, addY_in_aaa(X, Y, Z))
addY_in_aaa(b, zero(Y), one(Y)) → U20_aaa(Y, binaryZ_in_a(Y))
U20_aaa(Y, binaryZ_out_a(Y)) → addY_out_aaa(b, zero(Y), one(Y))
addY_in_aaa(b, one(Y), zero(Z)) → U21_aaa(Y, Z, succ_in_aa(Y, Z))
U21_aaa(Y, Z, succ_out_aa(Y, Z)) → addY_out_aaa(b, one(Y), zero(Z))
addY_in_aaa(X, Y, Z) → U22_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), one(Y), one(Z)) → U26_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
U26_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), one(Y), one(Z))
U22_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addY_out_aaa(X, Y, Z)
U25_aaa(X, Y, Z, addY_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), zero(Y), zero(Z))
U19_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addX_out_aaa(X, Y, Z)
U24_aaa(X, Y, Z, addX_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), one(Y), zero(Z))
U16_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addc_out_aaa(X, Y, Z)
U13_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), one(Y), zero(Z))
U9_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addy_out_aaa(X, Y, Z)
U12_aaa(X, Y, Z, addy_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), zero(Y), one(Z))
U6_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addx_out_aaa(X, Y, Z)
U11_aaa(X, Y, Z, addx_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), one(Y), one(Z))
U10_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), zero(Y), zero(Z))
U3_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → add_out_aaa(X, Y, Z)
U37_aaa(R, S, RSS, add_out_aaa(S, zero(RS), RSS)) → times_out_aaa(one(R), S, RSS)
U35_aaa(R, S, RS, times_out_aaa(R, S, RS)) → times_out_aaa(zero(R), S, zero(RS))
U36_aag(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aag(R, S, RSS, add_in_aag(S, zero(RS), RSS))
add_in_aag(b, b, b) → add_out_aag(b, b, b)
add_in_aag(X, b, X) → U1_aag(X, binaryZ_in_g(X))
binaryZ_in_g(zero(X)) → U29_g(X, binaryZ_in_g(X))
binaryZ_in_g(one(X)) → U30_g(X, binary_in_g(X))
binary_in_g(b) → binary_out_g(b)
binary_in_g(zero(X)) → U27_g(X, binaryZ_in_g(X))
U27_g(X, binaryZ_out_g(X)) → binary_out_g(zero(X))
binary_in_g(one(X)) → U28_g(X, binary_in_g(X))
U28_g(X, binary_out_g(X)) → binary_out_g(one(X))
U30_g(X, binary_out_g(X)) → binaryZ_out_g(one(X))
U29_g(X, binaryZ_out_g(X)) → binaryZ_out_g(zero(X))
U1_aag(X, binaryZ_out_g(X)) → add_out_aag(X, b, X)
add_in_aag(b, Y, Y) → U2_aag(Y, binaryZ_in_g(Y))
U2_aag(Y, binaryZ_out_g(Y)) → add_out_aag(b, Y, Y)
add_in_aag(X, Y, Z) → U3_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), zero(Y), zero(Z)) → U10_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), one(Y), one(Z)) → U11_aag(X, Y, Z, addx_in_aag(X, Y, Z))
addx_in_aag(one(X), b, one(X)) → U4_aag(X, binary_in_g(X))
U4_aag(X, binary_out_g(X)) → addx_out_aag(one(X), b, one(X))
addx_in_aag(zero(X), b, zero(X)) → U5_aag(X, binaryZ_in_g(X))
U5_aag(X, binaryZ_out_g(X)) → addx_out_aag(zero(X), b, zero(X))
addx_in_aag(X, Y, Z) → U6_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), zero(Y), one(Z)) → U12_aag(X, Y, Z, addy_in_aag(X, Y, Z))
addy_in_aag(b, one(Y), one(Y)) → U7_aag(Y, binary_in_g(Y))
U7_aag(Y, binary_out_g(Y)) → addy_out_aag(b, one(Y), one(Y))
addy_in_aag(b, zero(Y), zero(Y)) → U8_aag(Y, binaryZ_in_g(Y))
U8_aag(Y, binaryZ_out_g(Y)) → addy_out_aag(b, zero(Y), zero(Y))
addy_in_aag(X, Y, Z) → U9_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), one(Y), zero(Z)) → U13_aag(X, Y, Z, addc_in_aag(X, Y, Z))
addc_in_aag(b, b, one(b)) → addc_out_aag(b, b, one(b))
addc_in_aag(X, b, Z) → U14_aag(X, Z, succZ_in_ag(X, Z))
succZ_in_ag(zero(X), one(X)) → U33_ag(X, binaryZ_in_g(X))
U33_ag(X, binaryZ_out_g(X)) → succZ_out_ag(zero(X), one(X))
succZ_in_ag(one(X), zero(Z)) → U34_ag(X, Z, succ_in_ag(X, Z))
succ_in_ag(b, one(b)) → succ_out_ag(b, one(b))
succ_in_ag(zero(X), one(X)) → U31_ag(X, binaryZ_in_g(X))
U31_ag(X, binaryZ_out_g(X)) → succ_out_ag(zero(X), one(X))
succ_in_ag(one(X), zero(Z)) → U32_ag(X, Z, succ_in_ag(X, Z))
U32_ag(X, Z, succ_out_ag(X, Z)) → succ_out_ag(one(X), zero(Z))
U34_ag(X, Z, succ_out_ag(X, Z)) → succZ_out_ag(one(X), zero(Z))
U14_aag(X, Z, succZ_out_ag(X, Z)) → addc_out_aag(X, b, Z)
addc_in_aag(b, Y, Z) → U15_aag(Y, Z, succZ_in_ag(Y, Z))
U15_aag(Y, Z, succZ_out_ag(Y, Z)) → addc_out_aag(b, Y, Z)
addc_in_aag(X, Y, Z) → U16_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(zero(X), zero(Y), one(Z)) → U23_aag(X, Y, Z, addz_in_aag(X, Y, Z))
U23_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addC_out_aag(zero(X), zero(Y), one(Z))
addC_in_aag(zero(X), one(Y), zero(Z)) → U24_aag(X, Y, Z, addX_in_aag(X, Y, Z))
addX_in_aag(zero(X), b, one(X)) → U17_aag(X, binaryZ_in_g(X))
U17_aag(X, binaryZ_out_g(X)) → addX_out_aag(zero(X), b, one(X))
addX_in_aag(one(X), b, zero(Z)) → U18_aag(X, Z, succ_in_ag(X, Z))
U18_aag(X, Z, succ_out_ag(X, Z)) → addX_out_aag(one(X), b, zero(Z))
addX_in_aag(X, Y, Z) → U19_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), zero(Y), zero(Z)) → U25_aag(X, Y, Z, addY_in_aag(X, Y, Z))
addY_in_aag(b, zero(Y), one(Y)) → U20_aag(Y, binaryZ_in_g(Y))
U20_aag(Y, binaryZ_out_g(Y)) → addY_out_aag(b, zero(Y), one(Y))
addY_in_aag(b, one(Y), zero(Z)) → U21_aag(Y, Z, succ_in_ag(Y, Z))
U21_aag(Y, Z, succ_out_ag(Y, Z)) → addY_out_aag(b, one(Y), zero(Z))
addY_in_aag(X, Y, Z) → U22_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), one(Y), one(Z)) → U26_aag(X, Y, Z, addc_in_aag(X, Y, Z))
U26_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addC_out_aag(one(X), one(Y), one(Z))
U22_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addY_out_aag(X, Y, Z)
U25_aag(X, Y, Z, addY_out_aag(X, Y, Z)) → addC_out_aag(one(X), zero(Y), zero(Z))
U19_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addX_out_aag(X, Y, Z)
U24_aag(X, Y, Z, addX_out_aag(X, Y, Z)) → addC_out_aag(zero(X), one(Y), zero(Z))
U16_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addc_out_aag(X, Y, Z)
U13_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addz_out_aag(one(X), one(Y), zero(Z))
U9_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addy_out_aag(X, Y, Z)
U12_aag(X, Y, Z, addy_out_aag(X, Y, Z)) → addz_out_aag(one(X), zero(Y), one(Z))
U6_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addx_out_aag(X, Y, Z)
U11_aag(X, Y, Z, addx_out_aag(X, Y, Z)) → addz_out_aag(zero(X), one(Y), one(Z))
U10_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addz_out_aag(zero(X), zero(Y), zero(Z))
U3_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → add_out_aag(X, Y, Z)
U37_aag(R, S, RSS, add_out_aag(S, zero(RS), RSS)) → times_out_aag(one(R), S, RSS)
U35_aag(R, S, RS, times_out_aag(R, S, RS)) → times_out_aag(zero(R), S, zero(RS))
TIMES_IN_AAG(zero(R), S, zero(RS)) → U35_AAG(R, S, RS, times_in_aag(R, S, RS))
TIMES_IN_AAG(zero(R), S, zero(RS)) → TIMES_IN_AAG(R, S, RS)
TIMES_IN_AAG(one(R), S, RSS) → U36_AAG(R, S, RSS, times_in_aaa(R, S, RS))
TIMES_IN_AAG(one(R), S, RSS) → TIMES_IN_AAA(R, S, RS)
TIMES_IN_AAA(zero(R), S, zero(RS)) → U35_AAA(R, S, RS, times_in_aaa(R, S, RS))
TIMES_IN_AAA(zero(R), S, zero(RS)) → TIMES_IN_AAA(R, S, RS)
TIMES_IN_AAA(one(R), S, RSS) → U36_AAA(R, S, RSS, times_in_aaa(R, S, RS))
TIMES_IN_AAA(one(R), S, RSS) → TIMES_IN_AAA(R, S, RS)
U36_AAA(R, S, RSS, times_out_aaa(R, S, RS)) → U37_AAA(R, S, RSS, add_in_aaa(S, zero(RS), RSS))
U36_AAA(R, S, RSS, times_out_aaa(R, S, RS)) → ADD_IN_AAA(S, zero(RS), RSS)
ADD_IN_AAA(X, b, X) → U1_AAA(X, binaryZ_in_a(X))
ADD_IN_AAA(X, b, X) → BINARYZ_IN_A(X)
BINARYZ_IN_A(zero(X)) → U29_A(X, binaryZ_in_a(X))
BINARYZ_IN_A(zero(X)) → BINARYZ_IN_A(X)
BINARYZ_IN_A(one(X)) → U30_A(X, binary_in_a(X))
BINARYZ_IN_A(one(X)) → BINARY_IN_A(X)
BINARY_IN_A(zero(X)) → U27_A(X, binaryZ_in_a(X))
BINARY_IN_A(zero(X)) → BINARYZ_IN_A(X)
BINARY_IN_A(one(X)) → U28_A(X, binary_in_a(X))
BINARY_IN_A(one(X)) → BINARY_IN_A(X)
ADD_IN_AAA(b, Y, Y) → U2_AAA(Y, binaryZ_in_a(Y))
ADD_IN_AAA(b, Y, Y) → BINARYZ_IN_A(Y)
ADD_IN_AAA(X, Y, Z) → U3_AAA(X, Y, Z, addz_in_aaa(X, Y, Z))
ADD_IN_AAA(X, Y, Z) → ADDZ_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(zero(X), zero(Y), zero(Z)) → U10_AAA(X, Y, Z, addz_in_aaa(X, Y, Z))
ADDZ_IN_AAA(zero(X), zero(Y), zero(Z)) → ADDZ_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(zero(X), one(Y), one(Z)) → U11_AAA(X, Y, Z, addx_in_aaa(X, Y, Z))
ADDZ_IN_AAA(zero(X), one(Y), one(Z)) → ADDX_IN_AAA(X, Y, Z)
ADDX_IN_AAA(one(X), b, one(X)) → U4_AAA(X, binary_in_a(X))
ADDX_IN_AAA(one(X), b, one(X)) → BINARY_IN_A(X)
ADDX_IN_AAA(zero(X), b, zero(X)) → U5_AAA(X, binaryZ_in_a(X))
ADDX_IN_AAA(zero(X), b, zero(X)) → BINARYZ_IN_A(X)
ADDX_IN_AAA(X, Y, Z) → U6_AAA(X, Y, Z, addz_in_aaa(X, Y, Z))
ADDX_IN_AAA(X, Y, Z) → ADDZ_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(one(X), zero(Y), one(Z)) → U12_AAA(X, Y, Z, addy_in_aaa(X, Y, Z))
ADDZ_IN_AAA(one(X), zero(Y), one(Z)) → ADDY_IN_AAA(X, Y, Z)
ADDY_IN_AAA(b, one(Y), one(Y)) → U7_AAA(Y, binary_in_a(Y))
ADDY_IN_AAA(b, one(Y), one(Y)) → BINARY_IN_A(Y)
ADDY_IN_AAA(b, zero(Y), zero(Y)) → U8_AAA(Y, binaryZ_in_a(Y))
ADDY_IN_AAA(b, zero(Y), zero(Y)) → BINARYZ_IN_A(Y)
ADDY_IN_AAA(X, Y, Z) → U9_AAA(X, Y, Z, addz_in_aaa(X, Y, Z))
ADDY_IN_AAA(X, Y, Z) → ADDZ_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(one(X), one(Y), zero(Z)) → U13_AAA(X, Y, Z, addc_in_aaa(X, Y, Z))
ADDZ_IN_AAA(one(X), one(Y), zero(Z)) → ADDC_IN_AAA(X, Y, Z)
ADDC_IN_AAA(X, b, Z) → U14_AAA(X, Z, succZ_in_aa(X, Z))
ADDC_IN_AAA(X, b, Z) → SUCCZ_IN_AA(X, Z)
SUCCZ_IN_AA(zero(X), one(X)) → U33_AA(X, binaryZ_in_a(X))
SUCCZ_IN_AA(zero(X), one(X)) → BINARYZ_IN_A(X)
SUCCZ_IN_AA(one(X), zero(Z)) → U34_AA(X, Z, succ_in_aa(X, Z))
SUCCZ_IN_AA(one(X), zero(Z)) → SUCC_IN_AA(X, Z)
SUCC_IN_AA(zero(X), one(X)) → U31_AA(X, binaryZ_in_a(X))
SUCC_IN_AA(zero(X), one(X)) → BINARYZ_IN_A(X)
SUCC_IN_AA(one(X), zero(Z)) → U32_AA(X, Z, succ_in_aa(X, Z))
SUCC_IN_AA(one(X), zero(Z)) → SUCC_IN_AA(X, Z)
ADDC_IN_AAA(b, Y, Z) → U15_AAA(Y, Z, succZ_in_aa(Y, Z))
ADDC_IN_AAA(b, Y, Z) → SUCCZ_IN_AA(Y, Z)
ADDC_IN_AAA(X, Y, Z) → U16_AAA(X, Y, Z, addC_in_aaa(X, Y, Z))
ADDC_IN_AAA(X, Y, Z) → ADDC_IN_AAA1(X, Y, Z)
ADDC_IN_AAA1(zero(X), zero(Y), one(Z)) → U23_AAA(X, Y, Z, addz_in_aaa(X, Y, Z))
ADDC_IN_AAA1(zero(X), zero(Y), one(Z)) → ADDZ_IN_AAA(X, Y, Z)
ADDC_IN_AAA1(zero(X), one(Y), zero(Z)) → U24_AAA(X, Y, Z, addX_in_aaa(X, Y, Z))
ADDC_IN_AAA1(zero(X), one(Y), zero(Z)) → ADDX_IN_AAA1(X, Y, Z)
ADDX_IN_AAA1(zero(X), b, one(X)) → U17_AAA(X, binaryZ_in_a(X))
ADDX_IN_AAA1(zero(X), b, one(X)) → BINARYZ_IN_A(X)
ADDX_IN_AAA1(one(X), b, zero(Z)) → U18_AAA(X, Z, succ_in_aa(X, Z))
ADDX_IN_AAA1(one(X), b, zero(Z)) → SUCC_IN_AA(X, Z)
ADDX_IN_AAA1(X, Y, Z) → U19_AAA(X, Y, Z, addC_in_aaa(X, Y, Z))
ADDX_IN_AAA1(X, Y, Z) → ADDC_IN_AAA1(X, Y, Z)
ADDC_IN_AAA1(one(X), zero(Y), zero(Z)) → U25_AAA(X, Y, Z, addY_in_aaa(X, Y, Z))
ADDC_IN_AAA1(one(X), zero(Y), zero(Z)) → ADDY_IN_AAA1(X, Y, Z)
ADDY_IN_AAA1(b, zero(Y), one(Y)) → U20_AAA(Y, binaryZ_in_a(Y))
ADDY_IN_AAA1(b, zero(Y), one(Y)) → BINARYZ_IN_A(Y)
ADDY_IN_AAA1(b, one(Y), zero(Z)) → U21_AAA(Y, Z, succ_in_aa(Y, Z))
ADDY_IN_AAA1(b, one(Y), zero(Z)) → SUCC_IN_AA(Y, Z)
ADDY_IN_AAA1(X, Y, Z) → U22_AAA(X, Y, Z, addC_in_aaa(X, Y, Z))
ADDY_IN_AAA1(X, Y, Z) → ADDC_IN_AAA1(X, Y, Z)
ADDC_IN_AAA1(one(X), one(Y), one(Z)) → U26_AAA(X, Y, Z, addc_in_aaa(X, Y, Z))
ADDC_IN_AAA1(one(X), one(Y), one(Z)) → ADDC_IN_AAA(X, Y, Z)
U36_AAG(R, S, RSS, times_out_aaa(R, S, RS)) → U37_AAG(R, S, RSS, add_in_aag(S, zero(RS), RSS))
U36_AAG(R, S, RSS, times_out_aaa(R, S, RS)) → ADD_IN_AAG(S, zero(RS), RSS)
ADD_IN_AAG(X, b, X) → U1_AAG(X, binaryZ_in_g(X))
ADD_IN_AAG(X, b, X) → BINARYZ_IN_G(X)
BINARYZ_IN_G(zero(X)) → U29_G(X, binaryZ_in_g(X))
BINARYZ_IN_G(zero(X)) → BINARYZ_IN_G(X)
BINARYZ_IN_G(one(X)) → U30_G(X, binary_in_g(X))
BINARYZ_IN_G(one(X)) → BINARY_IN_G(X)
BINARY_IN_G(zero(X)) → U27_G(X, binaryZ_in_g(X))
BINARY_IN_G(zero(X)) → BINARYZ_IN_G(X)
BINARY_IN_G(one(X)) → U28_G(X, binary_in_g(X))
BINARY_IN_G(one(X)) → BINARY_IN_G(X)
ADD_IN_AAG(b, Y, Y) → U2_AAG(Y, binaryZ_in_g(Y))
ADD_IN_AAG(b, Y, Y) → BINARYZ_IN_G(Y)
ADD_IN_AAG(X, Y, Z) → U3_AAG(X, Y, Z, addz_in_aag(X, Y, Z))
ADD_IN_AAG(X, Y, Z) → ADDZ_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(zero(X), zero(Y), zero(Z)) → U10_AAG(X, Y, Z, addz_in_aag(X, Y, Z))
ADDZ_IN_AAG(zero(X), zero(Y), zero(Z)) → ADDZ_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(zero(X), one(Y), one(Z)) → U11_AAG(X, Y, Z, addx_in_aag(X, Y, Z))
ADDZ_IN_AAG(zero(X), one(Y), one(Z)) → ADDX_IN_AAG(X, Y, Z)
ADDX_IN_AAG(one(X), b, one(X)) → U4_AAG(X, binary_in_g(X))
ADDX_IN_AAG(one(X), b, one(X)) → BINARY_IN_G(X)
ADDX_IN_AAG(zero(X), b, zero(X)) → U5_AAG(X, binaryZ_in_g(X))
ADDX_IN_AAG(zero(X), b, zero(X)) → BINARYZ_IN_G(X)
ADDX_IN_AAG(X, Y, Z) → U6_AAG(X, Y, Z, addz_in_aag(X, Y, Z))
ADDX_IN_AAG(X, Y, Z) → ADDZ_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(one(X), zero(Y), one(Z)) → U12_AAG(X, Y, Z, addy_in_aag(X, Y, Z))
ADDZ_IN_AAG(one(X), zero(Y), one(Z)) → ADDY_IN_AAG(X, Y, Z)
ADDY_IN_AAG(b, one(Y), one(Y)) → U7_AAG(Y, binary_in_g(Y))
ADDY_IN_AAG(b, one(Y), one(Y)) → BINARY_IN_G(Y)
ADDY_IN_AAG(b, zero(Y), zero(Y)) → U8_AAG(Y, binaryZ_in_g(Y))
ADDY_IN_AAG(b, zero(Y), zero(Y)) → BINARYZ_IN_G(Y)
ADDY_IN_AAG(X, Y, Z) → U9_AAG(X, Y, Z, addz_in_aag(X, Y, Z))
ADDY_IN_AAG(X, Y, Z) → ADDZ_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(one(X), one(Y), zero(Z)) → U13_AAG(X, Y, Z, addc_in_aag(X, Y, Z))
ADDZ_IN_AAG(one(X), one(Y), zero(Z)) → ADDC_IN_AAG(X, Y, Z)
ADDC_IN_AAG(X, b, Z) → U14_AAG(X, Z, succZ_in_ag(X, Z))
ADDC_IN_AAG(X, b, Z) → SUCCZ_IN_AG(X, Z)
SUCCZ_IN_AG(zero(X), one(X)) → U33_AG(X, binaryZ_in_g(X))
SUCCZ_IN_AG(zero(X), one(X)) → BINARYZ_IN_G(X)
SUCCZ_IN_AG(one(X), zero(Z)) → U34_AG(X, Z, succ_in_ag(X, Z))
SUCCZ_IN_AG(one(X), zero(Z)) → SUCC_IN_AG(X, Z)
SUCC_IN_AG(zero(X), one(X)) → U31_AG(X, binaryZ_in_g(X))
SUCC_IN_AG(zero(X), one(X)) → BINARYZ_IN_G(X)
SUCC_IN_AG(one(X), zero(Z)) → U32_AG(X, Z, succ_in_ag(X, Z))
SUCC_IN_AG(one(X), zero(Z)) → SUCC_IN_AG(X, Z)
ADDC_IN_AAG(b, Y, Z) → U15_AAG(Y, Z, succZ_in_ag(Y, Z))
ADDC_IN_AAG(b, Y, Z) → SUCCZ_IN_AG(Y, Z)
ADDC_IN_AAG(X, Y, Z) → U16_AAG(X, Y, Z, addC_in_aag(X, Y, Z))
ADDC_IN_AAG(X, Y, Z) → ADDC_IN_AAG1(X, Y, Z)
ADDC_IN_AAG1(zero(X), zero(Y), one(Z)) → U23_AAG(X, Y, Z, addz_in_aag(X, Y, Z))
ADDC_IN_AAG1(zero(X), zero(Y), one(Z)) → ADDZ_IN_AAG(X, Y, Z)
ADDC_IN_AAG1(zero(X), one(Y), zero(Z)) → U24_AAG(X, Y, Z, addX_in_aag(X, Y, Z))
ADDC_IN_AAG1(zero(X), one(Y), zero(Z)) → ADDX_IN_AAG1(X, Y, Z)
ADDX_IN_AAG1(zero(X), b, one(X)) → U17_AAG(X, binaryZ_in_g(X))
ADDX_IN_AAG1(zero(X), b, one(X)) → BINARYZ_IN_G(X)
ADDX_IN_AAG1(one(X), b, zero(Z)) → U18_AAG(X, Z, succ_in_ag(X, Z))
ADDX_IN_AAG1(one(X), b, zero(Z)) → SUCC_IN_AG(X, Z)
ADDX_IN_AAG1(X, Y, Z) → U19_AAG(X, Y, Z, addC_in_aag(X, Y, Z))
ADDX_IN_AAG1(X, Y, Z) → ADDC_IN_AAG1(X, Y, Z)
ADDC_IN_AAG1(one(X), zero(Y), zero(Z)) → U25_AAG(X, Y, Z, addY_in_aag(X, Y, Z))
ADDC_IN_AAG1(one(X), zero(Y), zero(Z)) → ADDY_IN_AAG1(X, Y, Z)
ADDY_IN_AAG1(b, zero(Y), one(Y)) → U20_AAG(Y, binaryZ_in_g(Y))
ADDY_IN_AAG1(b, zero(Y), one(Y)) → BINARYZ_IN_G(Y)
ADDY_IN_AAG1(b, one(Y), zero(Z)) → U21_AAG(Y, Z, succ_in_ag(Y, Z))
ADDY_IN_AAG1(b, one(Y), zero(Z)) → SUCC_IN_AG(Y, Z)
ADDY_IN_AAG1(X, Y, Z) → U22_AAG(X, Y, Z, addC_in_aag(X, Y, Z))
ADDY_IN_AAG1(X, Y, Z) → ADDC_IN_AAG1(X, Y, Z)
ADDC_IN_AAG1(one(X), one(Y), one(Z)) → U26_AAG(X, Y, Z, addc_in_aag(X, Y, Z))
ADDC_IN_AAG1(one(X), one(Y), one(Z)) → ADDC_IN_AAG(X, Y, Z)
times_in_aag(one(b), X, X) → times_out_aag(one(b), X, X)
times_in_aag(zero(R), S, zero(RS)) → U35_aag(R, S, RS, times_in_aag(R, S, RS))
times_in_aag(one(R), S, RSS) → U36_aag(R, S, RSS, times_in_aaa(R, S, RS))
times_in_aaa(one(b), X, X) → times_out_aaa(one(b), X, X)
times_in_aaa(zero(R), S, zero(RS)) → U35_aaa(R, S, RS, times_in_aaa(R, S, RS))
times_in_aaa(one(R), S, RSS) → U36_aaa(R, S, RSS, times_in_aaa(R, S, RS))
U36_aaa(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aaa(R, S, RSS, add_in_aaa(S, zero(RS), RSS))
add_in_aaa(b, b, b) → add_out_aaa(b, b, b)
add_in_aaa(X, b, X) → U1_aaa(X, binaryZ_in_a(X))
binaryZ_in_a(zero(X)) → U29_a(X, binaryZ_in_a(X))
binaryZ_in_a(one(X)) → U30_a(X, binary_in_a(X))
binary_in_a(b) → binary_out_a(b)
binary_in_a(zero(X)) → U27_a(X, binaryZ_in_a(X))
U27_a(X, binaryZ_out_a(X)) → binary_out_a(zero(X))
binary_in_a(one(X)) → U28_a(X, binary_in_a(X))
U28_a(X, binary_out_a(X)) → binary_out_a(one(X))
U30_a(X, binary_out_a(X)) → binaryZ_out_a(one(X))
U29_a(X, binaryZ_out_a(X)) → binaryZ_out_a(zero(X))
U1_aaa(X, binaryZ_out_a(X)) → add_out_aaa(X, b, X)
add_in_aaa(b, Y, Y) → U2_aaa(Y, binaryZ_in_a(Y))
U2_aaa(Y, binaryZ_out_a(Y)) → add_out_aaa(b, Y, Y)
add_in_aaa(X, Y, Z) → U3_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), zero(Y), zero(Z)) → U10_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), one(Y), one(Z)) → U11_aaa(X, Y, Z, addx_in_aaa(X, Y, Z))
addx_in_aaa(one(X), b, one(X)) → U4_aaa(X, binary_in_a(X))
U4_aaa(X, binary_out_a(X)) → addx_out_aaa(one(X), b, one(X))
addx_in_aaa(zero(X), b, zero(X)) → U5_aaa(X, binaryZ_in_a(X))
U5_aaa(X, binaryZ_out_a(X)) → addx_out_aaa(zero(X), b, zero(X))
addx_in_aaa(X, Y, Z) → U6_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), zero(Y), one(Z)) → U12_aaa(X, Y, Z, addy_in_aaa(X, Y, Z))
addy_in_aaa(b, one(Y), one(Y)) → U7_aaa(Y, binary_in_a(Y))
U7_aaa(Y, binary_out_a(Y)) → addy_out_aaa(b, one(Y), one(Y))
addy_in_aaa(b, zero(Y), zero(Y)) → U8_aaa(Y, binaryZ_in_a(Y))
U8_aaa(Y, binaryZ_out_a(Y)) → addy_out_aaa(b, zero(Y), zero(Y))
addy_in_aaa(X, Y, Z) → U9_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), one(Y), zero(Z)) → U13_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
addc_in_aaa(b, b, one(b)) → addc_out_aaa(b, b, one(b))
addc_in_aaa(X, b, Z) → U14_aaa(X, Z, succZ_in_aa(X, Z))
succZ_in_aa(zero(X), one(X)) → U33_aa(X, binaryZ_in_a(X))
U33_aa(X, binaryZ_out_a(X)) → succZ_out_aa(zero(X), one(X))
succZ_in_aa(one(X), zero(Z)) → U34_aa(X, Z, succ_in_aa(X, Z))
succ_in_aa(b, one(b)) → succ_out_aa(b, one(b))
succ_in_aa(zero(X), one(X)) → U31_aa(X, binaryZ_in_a(X))
U31_aa(X, binaryZ_out_a(X)) → succ_out_aa(zero(X), one(X))
succ_in_aa(one(X), zero(Z)) → U32_aa(X, Z, succ_in_aa(X, Z))
U32_aa(X, Z, succ_out_aa(X, Z)) → succ_out_aa(one(X), zero(Z))
U34_aa(X, Z, succ_out_aa(X, Z)) → succZ_out_aa(one(X), zero(Z))
U14_aaa(X, Z, succZ_out_aa(X, Z)) → addc_out_aaa(X, b, Z)
addc_in_aaa(b, Y, Z) → U15_aaa(Y, Z, succZ_in_aa(Y, Z))
U15_aaa(Y, Z, succZ_out_aa(Y, Z)) → addc_out_aaa(b, Y, Z)
addc_in_aaa(X, Y, Z) → U16_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(zero(X), zero(Y), one(Z)) → U23_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
U23_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), zero(Y), one(Z))
addC_in_aaa(zero(X), one(Y), zero(Z)) → U24_aaa(X, Y, Z, addX_in_aaa(X, Y, Z))
addX_in_aaa(zero(X), b, one(X)) → U17_aaa(X, binaryZ_in_a(X))
U17_aaa(X, binaryZ_out_a(X)) → addX_out_aaa(zero(X), b, one(X))
addX_in_aaa(one(X), b, zero(Z)) → U18_aaa(X, Z, succ_in_aa(X, Z))
U18_aaa(X, Z, succ_out_aa(X, Z)) → addX_out_aaa(one(X), b, zero(Z))
addX_in_aaa(X, Y, Z) → U19_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), zero(Y), zero(Z)) → U25_aaa(X, Y, Z, addY_in_aaa(X, Y, Z))
addY_in_aaa(b, zero(Y), one(Y)) → U20_aaa(Y, binaryZ_in_a(Y))
U20_aaa(Y, binaryZ_out_a(Y)) → addY_out_aaa(b, zero(Y), one(Y))
addY_in_aaa(b, one(Y), zero(Z)) → U21_aaa(Y, Z, succ_in_aa(Y, Z))
U21_aaa(Y, Z, succ_out_aa(Y, Z)) → addY_out_aaa(b, one(Y), zero(Z))
addY_in_aaa(X, Y, Z) → U22_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), one(Y), one(Z)) → U26_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
U26_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), one(Y), one(Z))
U22_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addY_out_aaa(X, Y, Z)
U25_aaa(X, Y, Z, addY_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), zero(Y), zero(Z))
U19_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addX_out_aaa(X, Y, Z)
U24_aaa(X, Y, Z, addX_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), one(Y), zero(Z))
U16_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addc_out_aaa(X, Y, Z)
U13_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), one(Y), zero(Z))
U9_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addy_out_aaa(X, Y, Z)
U12_aaa(X, Y, Z, addy_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), zero(Y), one(Z))
U6_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addx_out_aaa(X, Y, Z)
U11_aaa(X, Y, Z, addx_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), one(Y), one(Z))
U10_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), zero(Y), zero(Z))
U3_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → add_out_aaa(X, Y, Z)
U37_aaa(R, S, RSS, add_out_aaa(S, zero(RS), RSS)) → times_out_aaa(one(R), S, RSS)
U35_aaa(R, S, RS, times_out_aaa(R, S, RS)) → times_out_aaa(zero(R), S, zero(RS))
U36_aag(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aag(R, S, RSS, add_in_aag(S, zero(RS), RSS))
add_in_aag(b, b, b) → add_out_aag(b, b, b)
add_in_aag(X, b, X) → U1_aag(X, binaryZ_in_g(X))
binaryZ_in_g(zero(X)) → U29_g(X, binaryZ_in_g(X))
binaryZ_in_g(one(X)) → U30_g(X, binary_in_g(X))
binary_in_g(b) → binary_out_g(b)
binary_in_g(zero(X)) → U27_g(X, binaryZ_in_g(X))
U27_g(X, binaryZ_out_g(X)) → binary_out_g(zero(X))
binary_in_g(one(X)) → U28_g(X, binary_in_g(X))
U28_g(X, binary_out_g(X)) → binary_out_g(one(X))
U30_g(X, binary_out_g(X)) → binaryZ_out_g(one(X))
U29_g(X, binaryZ_out_g(X)) → binaryZ_out_g(zero(X))
U1_aag(X, binaryZ_out_g(X)) → add_out_aag(X, b, X)
add_in_aag(b, Y, Y) → U2_aag(Y, binaryZ_in_g(Y))
U2_aag(Y, binaryZ_out_g(Y)) → add_out_aag(b, Y, Y)
add_in_aag(X, Y, Z) → U3_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), zero(Y), zero(Z)) → U10_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), one(Y), one(Z)) → U11_aag(X, Y, Z, addx_in_aag(X, Y, Z))
addx_in_aag(one(X), b, one(X)) → U4_aag(X, binary_in_g(X))
U4_aag(X, binary_out_g(X)) → addx_out_aag(one(X), b, one(X))
addx_in_aag(zero(X), b, zero(X)) → U5_aag(X, binaryZ_in_g(X))
U5_aag(X, binaryZ_out_g(X)) → addx_out_aag(zero(X), b, zero(X))
addx_in_aag(X, Y, Z) → U6_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), zero(Y), one(Z)) → U12_aag(X, Y, Z, addy_in_aag(X, Y, Z))
addy_in_aag(b, one(Y), one(Y)) → U7_aag(Y, binary_in_g(Y))
U7_aag(Y, binary_out_g(Y)) → addy_out_aag(b, one(Y), one(Y))
addy_in_aag(b, zero(Y), zero(Y)) → U8_aag(Y, binaryZ_in_g(Y))
U8_aag(Y, binaryZ_out_g(Y)) → addy_out_aag(b, zero(Y), zero(Y))
addy_in_aag(X, Y, Z) → U9_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), one(Y), zero(Z)) → U13_aag(X, Y, Z, addc_in_aag(X, Y, Z))
addc_in_aag(b, b, one(b)) → addc_out_aag(b, b, one(b))
addc_in_aag(X, b, Z) → U14_aag(X, Z, succZ_in_ag(X, Z))
succZ_in_ag(zero(X), one(X)) → U33_ag(X, binaryZ_in_g(X))
U33_ag(X, binaryZ_out_g(X)) → succZ_out_ag(zero(X), one(X))
succZ_in_ag(one(X), zero(Z)) → U34_ag(X, Z, succ_in_ag(X, Z))
succ_in_ag(b, one(b)) → succ_out_ag(b, one(b))
succ_in_ag(zero(X), one(X)) → U31_ag(X, binaryZ_in_g(X))
U31_ag(X, binaryZ_out_g(X)) → succ_out_ag(zero(X), one(X))
succ_in_ag(one(X), zero(Z)) → U32_ag(X, Z, succ_in_ag(X, Z))
U32_ag(X, Z, succ_out_ag(X, Z)) → succ_out_ag(one(X), zero(Z))
U34_ag(X, Z, succ_out_ag(X, Z)) → succZ_out_ag(one(X), zero(Z))
U14_aag(X, Z, succZ_out_ag(X, Z)) → addc_out_aag(X, b, Z)
addc_in_aag(b, Y, Z) → U15_aag(Y, Z, succZ_in_ag(Y, Z))
U15_aag(Y, Z, succZ_out_ag(Y, Z)) → addc_out_aag(b, Y, Z)
addc_in_aag(X, Y, Z) → U16_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(zero(X), zero(Y), one(Z)) → U23_aag(X, Y, Z, addz_in_aag(X, Y, Z))
U23_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addC_out_aag(zero(X), zero(Y), one(Z))
addC_in_aag(zero(X), one(Y), zero(Z)) → U24_aag(X, Y, Z, addX_in_aag(X, Y, Z))
addX_in_aag(zero(X), b, one(X)) → U17_aag(X, binaryZ_in_g(X))
U17_aag(X, binaryZ_out_g(X)) → addX_out_aag(zero(X), b, one(X))
addX_in_aag(one(X), b, zero(Z)) → U18_aag(X, Z, succ_in_ag(X, Z))
U18_aag(X, Z, succ_out_ag(X, Z)) → addX_out_aag(one(X), b, zero(Z))
addX_in_aag(X, Y, Z) → U19_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), zero(Y), zero(Z)) → U25_aag(X, Y, Z, addY_in_aag(X, Y, Z))
addY_in_aag(b, zero(Y), one(Y)) → U20_aag(Y, binaryZ_in_g(Y))
U20_aag(Y, binaryZ_out_g(Y)) → addY_out_aag(b, zero(Y), one(Y))
addY_in_aag(b, one(Y), zero(Z)) → U21_aag(Y, Z, succ_in_ag(Y, Z))
U21_aag(Y, Z, succ_out_ag(Y, Z)) → addY_out_aag(b, one(Y), zero(Z))
addY_in_aag(X, Y, Z) → U22_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), one(Y), one(Z)) → U26_aag(X, Y, Z, addc_in_aag(X, Y, Z))
U26_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addC_out_aag(one(X), one(Y), one(Z))
U22_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addY_out_aag(X, Y, Z)
U25_aag(X, Y, Z, addY_out_aag(X, Y, Z)) → addC_out_aag(one(X), zero(Y), zero(Z))
U19_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addX_out_aag(X, Y, Z)
U24_aag(X, Y, Z, addX_out_aag(X, Y, Z)) → addC_out_aag(zero(X), one(Y), zero(Z))
U16_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addc_out_aag(X, Y, Z)
U13_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addz_out_aag(one(X), one(Y), zero(Z))
U9_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addy_out_aag(X, Y, Z)
U12_aag(X, Y, Z, addy_out_aag(X, Y, Z)) → addz_out_aag(one(X), zero(Y), one(Z))
U6_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addx_out_aag(X, Y, Z)
U11_aag(X, Y, Z, addx_out_aag(X, Y, Z)) → addz_out_aag(zero(X), one(Y), one(Z))
U10_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addz_out_aag(zero(X), zero(Y), zero(Z))
U3_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → add_out_aag(X, Y, Z)
U37_aag(R, S, RSS, add_out_aag(S, zero(RS), RSS)) → times_out_aag(one(R), S, RSS)
U35_aag(R, S, RS, times_out_aag(R, S, RS)) → times_out_aag(zero(R), S, zero(RS))
TIMES_IN_AAG(zero(R), S, zero(RS)) → U35_AAG(R, S, RS, times_in_aag(R, S, RS))
TIMES_IN_AAG(zero(R), S, zero(RS)) → TIMES_IN_AAG(R, S, RS)
TIMES_IN_AAG(one(R), S, RSS) → U36_AAG(R, S, RSS, times_in_aaa(R, S, RS))
TIMES_IN_AAG(one(R), S, RSS) → TIMES_IN_AAA(R, S, RS)
TIMES_IN_AAA(zero(R), S, zero(RS)) → U35_AAA(R, S, RS, times_in_aaa(R, S, RS))
TIMES_IN_AAA(zero(R), S, zero(RS)) → TIMES_IN_AAA(R, S, RS)
TIMES_IN_AAA(one(R), S, RSS) → U36_AAA(R, S, RSS, times_in_aaa(R, S, RS))
TIMES_IN_AAA(one(R), S, RSS) → TIMES_IN_AAA(R, S, RS)
U36_AAA(R, S, RSS, times_out_aaa(R, S, RS)) → U37_AAA(R, S, RSS, add_in_aaa(S, zero(RS), RSS))
U36_AAA(R, S, RSS, times_out_aaa(R, S, RS)) → ADD_IN_AAA(S, zero(RS), RSS)
ADD_IN_AAA(X, b, X) → U1_AAA(X, binaryZ_in_a(X))
ADD_IN_AAA(X, b, X) → BINARYZ_IN_A(X)
BINARYZ_IN_A(zero(X)) → U29_A(X, binaryZ_in_a(X))
BINARYZ_IN_A(zero(X)) → BINARYZ_IN_A(X)
BINARYZ_IN_A(one(X)) → U30_A(X, binary_in_a(X))
BINARYZ_IN_A(one(X)) → BINARY_IN_A(X)
BINARY_IN_A(zero(X)) → U27_A(X, binaryZ_in_a(X))
BINARY_IN_A(zero(X)) → BINARYZ_IN_A(X)
BINARY_IN_A(one(X)) → U28_A(X, binary_in_a(X))
BINARY_IN_A(one(X)) → BINARY_IN_A(X)
ADD_IN_AAA(b, Y, Y) → U2_AAA(Y, binaryZ_in_a(Y))
ADD_IN_AAA(b, Y, Y) → BINARYZ_IN_A(Y)
ADD_IN_AAA(X, Y, Z) → U3_AAA(X, Y, Z, addz_in_aaa(X, Y, Z))
ADD_IN_AAA(X, Y, Z) → ADDZ_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(zero(X), zero(Y), zero(Z)) → U10_AAA(X, Y, Z, addz_in_aaa(X, Y, Z))
ADDZ_IN_AAA(zero(X), zero(Y), zero(Z)) → ADDZ_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(zero(X), one(Y), one(Z)) → U11_AAA(X, Y, Z, addx_in_aaa(X, Y, Z))
ADDZ_IN_AAA(zero(X), one(Y), one(Z)) → ADDX_IN_AAA(X, Y, Z)
ADDX_IN_AAA(one(X), b, one(X)) → U4_AAA(X, binary_in_a(X))
ADDX_IN_AAA(one(X), b, one(X)) → BINARY_IN_A(X)
ADDX_IN_AAA(zero(X), b, zero(X)) → U5_AAA(X, binaryZ_in_a(X))
ADDX_IN_AAA(zero(X), b, zero(X)) → BINARYZ_IN_A(X)
ADDX_IN_AAA(X, Y, Z) → U6_AAA(X, Y, Z, addz_in_aaa(X, Y, Z))
ADDX_IN_AAA(X, Y, Z) → ADDZ_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(one(X), zero(Y), one(Z)) → U12_AAA(X, Y, Z, addy_in_aaa(X, Y, Z))
ADDZ_IN_AAA(one(X), zero(Y), one(Z)) → ADDY_IN_AAA(X, Y, Z)
ADDY_IN_AAA(b, one(Y), one(Y)) → U7_AAA(Y, binary_in_a(Y))
ADDY_IN_AAA(b, one(Y), one(Y)) → BINARY_IN_A(Y)
ADDY_IN_AAA(b, zero(Y), zero(Y)) → U8_AAA(Y, binaryZ_in_a(Y))
ADDY_IN_AAA(b, zero(Y), zero(Y)) → BINARYZ_IN_A(Y)
ADDY_IN_AAA(X, Y, Z) → U9_AAA(X, Y, Z, addz_in_aaa(X, Y, Z))
ADDY_IN_AAA(X, Y, Z) → ADDZ_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(one(X), one(Y), zero(Z)) → U13_AAA(X, Y, Z, addc_in_aaa(X, Y, Z))
ADDZ_IN_AAA(one(X), one(Y), zero(Z)) → ADDC_IN_AAA(X, Y, Z)
ADDC_IN_AAA(X, b, Z) → U14_AAA(X, Z, succZ_in_aa(X, Z))
ADDC_IN_AAA(X, b, Z) → SUCCZ_IN_AA(X, Z)
SUCCZ_IN_AA(zero(X), one(X)) → U33_AA(X, binaryZ_in_a(X))
SUCCZ_IN_AA(zero(X), one(X)) → BINARYZ_IN_A(X)
SUCCZ_IN_AA(one(X), zero(Z)) → U34_AA(X, Z, succ_in_aa(X, Z))
SUCCZ_IN_AA(one(X), zero(Z)) → SUCC_IN_AA(X, Z)
SUCC_IN_AA(zero(X), one(X)) → U31_AA(X, binaryZ_in_a(X))
SUCC_IN_AA(zero(X), one(X)) → BINARYZ_IN_A(X)
SUCC_IN_AA(one(X), zero(Z)) → U32_AA(X, Z, succ_in_aa(X, Z))
SUCC_IN_AA(one(X), zero(Z)) → SUCC_IN_AA(X, Z)
ADDC_IN_AAA(b, Y, Z) → U15_AAA(Y, Z, succZ_in_aa(Y, Z))
ADDC_IN_AAA(b, Y, Z) → SUCCZ_IN_AA(Y, Z)
ADDC_IN_AAA(X, Y, Z) → U16_AAA(X, Y, Z, addC_in_aaa(X, Y, Z))
ADDC_IN_AAA(X, Y, Z) → ADDC_IN_AAA1(X, Y, Z)
ADDC_IN_AAA1(zero(X), zero(Y), one(Z)) → U23_AAA(X, Y, Z, addz_in_aaa(X, Y, Z))
ADDC_IN_AAA1(zero(X), zero(Y), one(Z)) → ADDZ_IN_AAA(X, Y, Z)
ADDC_IN_AAA1(zero(X), one(Y), zero(Z)) → U24_AAA(X, Y, Z, addX_in_aaa(X, Y, Z))
ADDC_IN_AAA1(zero(X), one(Y), zero(Z)) → ADDX_IN_AAA1(X, Y, Z)
ADDX_IN_AAA1(zero(X), b, one(X)) → U17_AAA(X, binaryZ_in_a(X))
ADDX_IN_AAA1(zero(X), b, one(X)) → BINARYZ_IN_A(X)
ADDX_IN_AAA1(one(X), b, zero(Z)) → U18_AAA(X, Z, succ_in_aa(X, Z))
ADDX_IN_AAA1(one(X), b, zero(Z)) → SUCC_IN_AA(X, Z)
ADDX_IN_AAA1(X, Y, Z) → U19_AAA(X, Y, Z, addC_in_aaa(X, Y, Z))
ADDX_IN_AAA1(X, Y, Z) → ADDC_IN_AAA1(X, Y, Z)
ADDC_IN_AAA1(one(X), zero(Y), zero(Z)) → U25_AAA(X, Y, Z, addY_in_aaa(X, Y, Z))
ADDC_IN_AAA1(one(X), zero(Y), zero(Z)) → ADDY_IN_AAA1(X, Y, Z)
ADDY_IN_AAA1(b, zero(Y), one(Y)) → U20_AAA(Y, binaryZ_in_a(Y))
ADDY_IN_AAA1(b, zero(Y), one(Y)) → BINARYZ_IN_A(Y)
ADDY_IN_AAA1(b, one(Y), zero(Z)) → U21_AAA(Y, Z, succ_in_aa(Y, Z))
ADDY_IN_AAA1(b, one(Y), zero(Z)) → SUCC_IN_AA(Y, Z)
ADDY_IN_AAA1(X, Y, Z) → U22_AAA(X, Y, Z, addC_in_aaa(X, Y, Z))
ADDY_IN_AAA1(X, Y, Z) → ADDC_IN_AAA1(X, Y, Z)
ADDC_IN_AAA1(one(X), one(Y), one(Z)) → U26_AAA(X, Y, Z, addc_in_aaa(X, Y, Z))
ADDC_IN_AAA1(one(X), one(Y), one(Z)) → ADDC_IN_AAA(X, Y, Z)
U36_AAG(R, S, RSS, times_out_aaa(R, S, RS)) → U37_AAG(R, S, RSS, add_in_aag(S, zero(RS), RSS))
U36_AAG(R, S, RSS, times_out_aaa(R, S, RS)) → ADD_IN_AAG(S, zero(RS), RSS)
ADD_IN_AAG(X, b, X) → U1_AAG(X, binaryZ_in_g(X))
ADD_IN_AAG(X, b, X) → BINARYZ_IN_G(X)
BINARYZ_IN_G(zero(X)) → U29_G(X, binaryZ_in_g(X))
BINARYZ_IN_G(zero(X)) → BINARYZ_IN_G(X)
BINARYZ_IN_G(one(X)) → U30_G(X, binary_in_g(X))
BINARYZ_IN_G(one(X)) → BINARY_IN_G(X)
BINARY_IN_G(zero(X)) → U27_G(X, binaryZ_in_g(X))
BINARY_IN_G(zero(X)) → BINARYZ_IN_G(X)
BINARY_IN_G(one(X)) → U28_G(X, binary_in_g(X))
BINARY_IN_G(one(X)) → BINARY_IN_G(X)
ADD_IN_AAG(b, Y, Y) → U2_AAG(Y, binaryZ_in_g(Y))
ADD_IN_AAG(b, Y, Y) → BINARYZ_IN_G(Y)
ADD_IN_AAG(X, Y, Z) → U3_AAG(X, Y, Z, addz_in_aag(X, Y, Z))
ADD_IN_AAG(X, Y, Z) → ADDZ_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(zero(X), zero(Y), zero(Z)) → U10_AAG(X, Y, Z, addz_in_aag(X, Y, Z))
ADDZ_IN_AAG(zero(X), zero(Y), zero(Z)) → ADDZ_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(zero(X), one(Y), one(Z)) → U11_AAG(X, Y, Z, addx_in_aag(X, Y, Z))
ADDZ_IN_AAG(zero(X), one(Y), one(Z)) → ADDX_IN_AAG(X, Y, Z)
ADDX_IN_AAG(one(X), b, one(X)) → U4_AAG(X, binary_in_g(X))
ADDX_IN_AAG(one(X), b, one(X)) → BINARY_IN_G(X)
ADDX_IN_AAG(zero(X), b, zero(X)) → U5_AAG(X, binaryZ_in_g(X))
ADDX_IN_AAG(zero(X), b, zero(X)) → BINARYZ_IN_G(X)
ADDX_IN_AAG(X, Y, Z) → U6_AAG(X, Y, Z, addz_in_aag(X, Y, Z))
ADDX_IN_AAG(X, Y, Z) → ADDZ_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(one(X), zero(Y), one(Z)) → U12_AAG(X, Y, Z, addy_in_aag(X, Y, Z))
ADDZ_IN_AAG(one(X), zero(Y), one(Z)) → ADDY_IN_AAG(X, Y, Z)
ADDY_IN_AAG(b, one(Y), one(Y)) → U7_AAG(Y, binary_in_g(Y))
ADDY_IN_AAG(b, one(Y), one(Y)) → BINARY_IN_G(Y)
ADDY_IN_AAG(b, zero(Y), zero(Y)) → U8_AAG(Y, binaryZ_in_g(Y))
ADDY_IN_AAG(b, zero(Y), zero(Y)) → BINARYZ_IN_G(Y)
ADDY_IN_AAG(X, Y, Z) → U9_AAG(X, Y, Z, addz_in_aag(X, Y, Z))
ADDY_IN_AAG(X, Y, Z) → ADDZ_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(one(X), one(Y), zero(Z)) → U13_AAG(X, Y, Z, addc_in_aag(X, Y, Z))
ADDZ_IN_AAG(one(X), one(Y), zero(Z)) → ADDC_IN_AAG(X, Y, Z)
ADDC_IN_AAG(X, b, Z) → U14_AAG(X, Z, succZ_in_ag(X, Z))
ADDC_IN_AAG(X, b, Z) → SUCCZ_IN_AG(X, Z)
SUCCZ_IN_AG(zero(X), one(X)) → U33_AG(X, binaryZ_in_g(X))
SUCCZ_IN_AG(zero(X), one(X)) → BINARYZ_IN_G(X)
SUCCZ_IN_AG(one(X), zero(Z)) → U34_AG(X, Z, succ_in_ag(X, Z))
SUCCZ_IN_AG(one(X), zero(Z)) → SUCC_IN_AG(X, Z)
SUCC_IN_AG(zero(X), one(X)) → U31_AG(X, binaryZ_in_g(X))
SUCC_IN_AG(zero(X), one(X)) → BINARYZ_IN_G(X)
SUCC_IN_AG(one(X), zero(Z)) → U32_AG(X, Z, succ_in_ag(X, Z))
SUCC_IN_AG(one(X), zero(Z)) → SUCC_IN_AG(X, Z)
ADDC_IN_AAG(b, Y, Z) → U15_AAG(Y, Z, succZ_in_ag(Y, Z))
ADDC_IN_AAG(b, Y, Z) → SUCCZ_IN_AG(Y, Z)
ADDC_IN_AAG(X, Y, Z) → U16_AAG(X, Y, Z, addC_in_aag(X, Y, Z))
ADDC_IN_AAG(X, Y, Z) → ADDC_IN_AAG1(X, Y, Z)
ADDC_IN_AAG1(zero(X), zero(Y), one(Z)) → U23_AAG(X, Y, Z, addz_in_aag(X, Y, Z))
ADDC_IN_AAG1(zero(X), zero(Y), one(Z)) → ADDZ_IN_AAG(X, Y, Z)
ADDC_IN_AAG1(zero(X), one(Y), zero(Z)) → U24_AAG(X, Y, Z, addX_in_aag(X, Y, Z))
ADDC_IN_AAG1(zero(X), one(Y), zero(Z)) → ADDX_IN_AAG1(X, Y, Z)
ADDX_IN_AAG1(zero(X), b, one(X)) → U17_AAG(X, binaryZ_in_g(X))
ADDX_IN_AAG1(zero(X), b, one(X)) → BINARYZ_IN_G(X)
ADDX_IN_AAG1(one(X), b, zero(Z)) → U18_AAG(X, Z, succ_in_ag(X, Z))
ADDX_IN_AAG1(one(X), b, zero(Z)) → SUCC_IN_AG(X, Z)
ADDX_IN_AAG1(X, Y, Z) → U19_AAG(X, Y, Z, addC_in_aag(X, Y, Z))
ADDX_IN_AAG1(X, Y, Z) → ADDC_IN_AAG1(X, Y, Z)
ADDC_IN_AAG1(one(X), zero(Y), zero(Z)) → U25_AAG(X, Y, Z, addY_in_aag(X, Y, Z))
ADDC_IN_AAG1(one(X), zero(Y), zero(Z)) → ADDY_IN_AAG1(X, Y, Z)
ADDY_IN_AAG1(b, zero(Y), one(Y)) → U20_AAG(Y, binaryZ_in_g(Y))
ADDY_IN_AAG1(b, zero(Y), one(Y)) → BINARYZ_IN_G(Y)
ADDY_IN_AAG1(b, one(Y), zero(Z)) → U21_AAG(Y, Z, succ_in_ag(Y, Z))
ADDY_IN_AAG1(b, one(Y), zero(Z)) → SUCC_IN_AG(Y, Z)
ADDY_IN_AAG1(X, Y, Z) → U22_AAG(X, Y, Z, addC_in_aag(X, Y, Z))
ADDY_IN_AAG1(X, Y, Z) → ADDC_IN_AAG1(X, Y, Z)
ADDC_IN_AAG1(one(X), one(Y), one(Z)) → U26_AAG(X, Y, Z, addc_in_aag(X, Y, Z))
ADDC_IN_AAG1(one(X), one(Y), one(Z)) → ADDC_IN_AAG(X, Y, Z)
times_in_aag(one(b), X, X) → times_out_aag(one(b), X, X)
times_in_aag(zero(R), S, zero(RS)) → U35_aag(R, S, RS, times_in_aag(R, S, RS))
times_in_aag(one(R), S, RSS) → U36_aag(R, S, RSS, times_in_aaa(R, S, RS))
times_in_aaa(one(b), X, X) → times_out_aaa(one(b), X, X)
times_in_aaa(zero(R), S, zero(RS)) → U35_aaa(R, S, RS, times_in_aaa(R, S, RS))
times_in_aaa(one(R), S, RSS) → U36_aaa(R, S, RSS, times_in_aaa(R, S, RS))
U36_aaa(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aaa(R, S, RSS, add_in_aaa(S, zero(RS), RSS))
add_in_aaa(b, b, b) → add_out_aaa(b, b, b)
add_in_aaa(X, b, X) → U1_aaa(X, binaryZ_in_a(X))
binaryZ_in_a(zero(X)) → U29_a(X, binaryZ_in_a(X))
binaryZ_in_a(one(X)) → U30_a(X, binary_in_a(X))
binary_in_a(b) → binary_out_a(b)
binary_in_a(zero(X)) → U27_a(X, binaryZ_in_a(X))
U27_a(X, binaryZ_out_a(X)) → binary_out_a(zero(X))
binary_in_a(one(X)) → U28_a(X, binary_in_a(X))
U28_a(X, binary_out_a(X)) → binary_out_a(one(X))
U30_a(X, binary_out_a(X)) → binaryZ_out_a(one(X))
U29_a(X, binaryZ_out_a(X)) → binaryZ_out_a(zero(X))
U1_aaa(X, binaryZ_out_a(X)) → add_out_aaa(X, b, X)
add_in_aaa(b, Y, Y) → U2_aaa(Y, binaryZ_in_a(Y))
U2_aaa(Y, binaryZ_out_a(Y)) → add_out_aaa(b, Y, Y)
add_in_aaa(X, Y, Z) → U3_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), zero(Y), zero(Z)) → U10_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), one(Y), one(Z)) → U11_aaa(X, Y, Z, addx_in_aaa(X, Y, Z))
addx_in_aaa(one(X), b, one(X)) → U4_aaa(X, binary_in_a(X))
U4_aaa(X, binary_out_a(X)) → addx_out_aaa(one(X), b, one(X))
addx_in_aaa(zero(X), b, zero(X)) → U5_aaa(X, binaryZ_in_a(X))
U5_aaa(X, binaryZ_out_a(X)) → addx_out_aaa(zero(X), b, zero(X))
addx_in_aaa(X, Y, Z) → U6_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), zero(Y), one(Z)) → U12_aaa(X, Y, Z, addy_in_aaa(X, Y, Z))
addy_in_aaa(b, one(Y), one(Y)) → U7_aaa(Y, binary_in_a(Y))
U7_aaa(Y, binary_out_a(Y)) → addy_out_aaa(b, one(Y), one(Y))
addy_in_aaa(b, zero(Y), zero(Y)) → U8_aaa(Y, binaryZ_in_a(Y))
U8_aaa(Y, binaryZ_out_a(Y)) → addy_out_aaa(b, zero(Y), zero(Y))
addy_in_aaa(X, Y, Z) → U9_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), one(Y), zero(Z)) → U13_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
addc_in_aaa(b, b, one(b)) → addc_out_aaa(b, b, one(b))
addc_in_aaa(X, b, Z) → U14_aaa(X, Z, succZ_in_aa(X, Z))
succZ_in_aa(zero(X), one(X)) → U33_aa(X, binaryZ_in_a(X))
U33_aa(X, binaryZ_out_a(X)) → succZ_out_aa(zero(X), one(X))
succZ_in_aa(one(X), zero(Z)) → U34_aa(X, Z, succ_in_aa(X, Z))
succ_in_aa(b, one(b)) → succ_out_aa(b, one(b))
succ_in_aa(zero(X), one(X)) → U31_aa(X, binaryZ_in_a(X))
U31_aa(X, binaryZ_out_a(X)) → succ_out_aa(zero(X), one(X))
succ_in_aa(one(X), zero(Z)) → U32_aa(X, Z, succ_in_aa(X, Z))
U32_aa(X, Z, succ_out_aa(X, Z)) → succ_out_aa(one(X), zero(Z))
U34_aa(X, Z, succ_out_aa(X, Z)) → succZ_out_aa(one(X), zero(Z))
U14_aaa(X, Z, succZ_out_aa(X, Z)) → addc_out_aaa(X, b, Z)
addc_in_aaa(b, Y, Z) → U15_aaa(Y, Z, succZ_in_aa(Y, Z))
U15_aaa(Y, Z, succZ_out_aa(Y, Z)) → addc_out_aaa(b, Y, Z)
addc_in_aaa(X, Y, Z) → U16_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(zero(X), zero(Y), one(Z)) → U23_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
U23_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), zero(Y), one(Z))
addC_in_aaa(zero(X), one(Y), zero(Z)) → U24_aaa(X, Y, Z, addX_in_aaa(X, Y, Z))
addX_in_aaa(zero(X), b, one(X)) → U17_aaa(X, binaryZ_in_a(X))
U17_aaa(X, binaryZ_out_a(X)) → addX_out_aaa(zero(X), b, one(X))
addX_in_aaa(one(X), b, zero(Z)) → U18_aaa(X, Z, succ_in_aa(X, Z))
U18_aaa(X, Z, succ_out_aa(X, Z)) → addX_out_aaa(one(X), b, zero(Z))
addX_in_aaa(X, Y, Z) → U19_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), zero(Y), zero(Z)) → U25_aaa(X, Y, Z, addY_in_aaa(X, Y, Z))
addY_in_aaa(b, zero(Y), one(Y)) → U20_aaa(Y, binaryZ_in_a(Y))
U20_aaa(Y, binaryZ_out_a(Y)) → addY_out_aaa(b, zero(Y), one(Y))
addY_in_aaa(b, one(Y), zero(Z)) → U21_aaa(Y, Z, succ_in_aa(Y, Z))
U21_aaa(Y, Z, succ_out_aa(Y, Z)) → addY_out_aaa(b, one(Y), zero(Z))
addY_in_aaa(X, Y, Z) → U22_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), one(Y), one(Z)) → U26_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
U26_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), one(Y), one(Z))
U22_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addY_out_aaa(X, Y, Z)
U25_aaa(X, Y, Z, addY_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), zero(Y), zero(Z))
U19_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addX_out_aaa(X, Y, Z)
U24_aaa(X, Y, Z, addX_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), one(Y), zero(Z))
U16_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addc_out_aaa(X, Y, Z)
U13_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), one(Y), zero(Z))
U9_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addy_out_aaa(X, Y, Z)
U12_aaa(X, Y, Z, addy_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), zero(Y), one(Z))
U6_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addx_out_aaa(X, Y, Z)
U11_aaa(X, Y, Z, addx_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), one(Y), one(Z))
U10_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), zero(Y), zero(Z))
U3_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → add_out_aaa(X, Y, Z)
U37_aaa(R, S, RSS, add_out_aaa(S, zero(RS), RSS)) → times_out_aaa(one(R), S, RSS)
U35_aaa(R, S, RS, times_out_aaa(R, S, RS)) → times_out_aaa(zero(R), S, zero(RS))
U36_aag(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aag(R, S, RSS, add_in_aag(S, zero(RS), RSS))
add_in_aag(b, b, b) → add_out_aag(b, b, b)
add_in_aag(X, b, X) → U1_aag(X, binaryZ_in_g(X))
binaryZ_in_g(zero(X)) → U29_g(X, binaryZ_in_g(X))
binaryZ_in_g(one(X)) → U30_g(X, binary_in_g(X))
binary_in_g(b) → binary_out_g(b)
binary_in_g(zero(X)) → U27_g(X, binaryZ_in_g(X))
U27_g(X, binaryZ_out_g(X)) → binary_out_g(zero(X))
binary_in_g(one(X)) → U28_g(X, binary_in_g(X))
U28_g(X, binary_out_g(X)) → binary_out_g(one(X))
U30_g(X, binary_out_g(X)) → binaryZ_out_g(one(X))
U29_g(X, binaryZ_out_g(X)) → binaryZ_out_g(zero(X))
U1_aag(X, binaryZ_out_g(X)) → add_out_aag(X, b, X)
add_in_aag(b, Y, Y) → U2_aag(Y, binaryZ_in_g(Y))
U2_aag(Y, binaryZ_out_g(Y)) → add_out_aag(b, Y, Y)
add_in_aag(X, Y, Z) → U3_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), zero(Y), zero(Z)) → U10_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), one(Y), one(Z)) → U11_aag(X, Y, Z, addx_in_aag(X, Y, Z))
addx_in_aag(one(X), b, one(X)) → U4_aag(X, binary_in_g(X))
U4_aag(X, binary_out_g(X)) → addx_out_aag(one(X), b, one(X))
addx_in_aag(zero(X), b, zero(X)) → U5_aag(X, binaryZ_in_g(X))
U5_aag(X, binaryZ_out_g(X)) → addx_out_aag(zero(X), b, zero(X))
addx_in_aag(X, Y, Z) → U6_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), zero(Y), one(Z)) → U12_aag(X, Y, Z, addy_in_aag(X, Y, Z))
addy_in_aag(b, one(Y), one(Y)) → U7_aag(Y, binary_in_g(Y))
U7_aag(Y, binary_out_g(Y)) → addy_out_aag(b, one(Y), one(Y))
addy_in_aag(b, zero(Y), zero(Y)) → U8_aag(Y, binaryZ_in_g(Y))
U8_aag(Y, binaryZ_out_g(Y)) → addy_out_aag(b, zero(Y), zero(Y))
addy_in_aag(X, Y, Z) → U9_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), one(Y), zero(Z)) → U13_aag(X, Y, Z, addc_in_aag(X, Y, Z))
addc_in_aag(b, b, one(b)) → addc_out_aag(b, b, one(b))
addc_in_aag(X, b, Z) → U14_aag(X, Z, succZ_in_ag(X, Z))
succZ_in_ag(zero(X), one(X)) → U33_ag(X, binaryZ_in_g(X))
U33_ag(X, binaryZ_out_g(X)) → succZ_out_ag(zero(X), one(X))
succZ_in_ag(one(X), zero(Z)) → U34_ag(X, Z, succ_in_ag(X, Z))
succ_in_ag(b, one(b)) → succ_out_ag(b, one(b))
succ_in_ag(zero(X), one(X)) → U31_ag(X, binaryZ_in_g(X))
U31_ag(X, binaryZ_out_g(X)) → succ_out_ag(zero(X), one(X))
succ_in_ag(one(X), zero(Z)) → U32_ag(X, Z, succ_in_ag(X, Z))
U32_ag(X, Z, succ_out_ag(X, Z)) → succ_out_ag(one(X), zero(Z))
U34_ag(X, Z, succ_out_ag(X, Z)) → succZ_out_ag(one(X), zero(Z))
U14_aag(X, Z, succZ_out_ag(X, Z)) → addc_out_aag(X, b, Z)
addc_in_aag(b, Y, Z) → U15_aag(Y, Z, succZ_in_ag(Y, Z))
U15_aag(Y, Z, succZ_out_ag(Y, Z)) → addc_out_aag(b, Y, Z)
addc_in_aag(X, Y, Z) → U16_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(zero(X), zero(Y), one(Z)) → U23_aag(X, Y, Z, addz_in_aag(X, Y, Z))
U23_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addC_out_aag(zero(X), zero(Y), one(Z))
addC_in_aag(zero(X), one(Y), zero(Z)) → U24_aag(X, Y, Z, addX_in_aag(X, Y, Z))
addX_in_aag(zero(X), b, one(X)) → U17_aag(X, binaryZ_in_g(X))
U17_aag(X, binaryZ_out_g(X)) → addX_out_aag(zero(X), b, one(X))
addX_in_aag(one(X), b, zero(Z)) → U18_aag(X, Z, succ_in_ag(X, Z))
U18_aag(X, Z, succ_out_ag(X, Z)) → addX_out_aag(one(X), b, zero(Z))
addX_in_aag(X, Y, Z) → U19_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), zero(Y), zero(Z)) → U25_aag(X, Y, Z, addY_in_aag(X, Y, Z))
addY_in_aag(b, zero(Y), one(Y)) → U20_aag(Y, binaryZ_in_g(Y))
U20_aag(Y, binaryZ_out_g(Y)) → addY_out_aag(b, zero(Y), one(Y))
addY_in_aag(b, one(Y), zero(Z)) → U21_aag(Y, Z, succ_in_ag(Y, Z))
U21_aag(Y, Z, succ_out_ag(Y, Z)) → addY_out_aag(b, one(Y), zero(Z))
addY_in_aag(X, Y, Z) → U22_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), one(Y), one(Z)) → U26_aag(X, Y, Z, addc_in_aag(X, Y, Z))
U26_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addC_out_aag(one(X), one(Y), one(Z))
U22_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addY_out_aag(X, Y, Z)
U25_aag(X, Y, Z, addY_out_aag(X, Y, Z)) → addC_out_aag(one(X), zero(Y), zero(Z))
U19_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addX_out_aag(X, Y, Z)
U24_aag(X, Y, Z, addX_out_aag(X, Y, Z)) → addC_out_aag(zero(X), one(Y), zero(Z))
U16_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addc_out_aag(X, Y, Z)
U13_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addz_out_aag(one(X), one(Y), zero(Z))
U9_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addy_out_aag(X, Y, Z)
U12_aag(X, Y, Z, addy_out_aag(X, Y, Z)) → addz_out_aag(one(X), zero(Y), one(Z))
U6_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addx_out_aag(X, Y, Z)
U11_aag(X, Y, Z, addx_out_aag(X, Y, Z)) → addz_out_aag(zero(X), one(Y), one(Z))
U10_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addz_out_aag(zero(X), zero(Y), zero(Z))
U3_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → add_out_aag(X, Y, Z)
U37_aag(R, S, RSS, add_out_aag(S, zero(RS), RSS)) → times_out_aag(one(R), S, RSS)
U35_aag(R, S, RS, times_out_aag(R, S, RS)) → times_out_aag(zero(R), S, zero(RS))
BINARYZ_IN_G(one(X)) → BINARY_IN_G(X)
BINARY_IN_G(zero(X)) → BINARYZ_IN_G(X)
BINARYZ_IN_G(zero(X)) → BINARYZ_IN_G(X)
BINARY_IN_G(one(X)) → BINARY_IN_G(X)
times_in_aag(one(b), X, X) → times_out_aag(one(b), X, X)
times_in_aag(zero(R), S, zero(RS)) → U35_aag(R, S, RS, times_in_aag(R, S, RS))
times_in_aag(one(R), S, RSS) → U36_aag(R, S, RSS, times_in_aaa(R, S, RS))
times_in_aaa(one(b), X, X) → times_out_aaa(one(b), X, X)
times_in_aaa(zero(R), S, zero(RS)) → U35_aaa(R, S, RS, times_in_aaa(R, S, RS))
times_in_aaa(one(R), S, RSS) → U36_aaa(R, S, RSS, times_in_aaa(R, S, RS))
U36_aaa(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aaa(R, S, RSS, add_in_aaa(S, zero(RS), RSS))
add_in_aaa(b, b, b) → add_out_aaa(b, b, b)
add_in_aaa(X, b, X) → U1_aaa(X, binaryZ_in_a(X))
binaryZ_in_a(zero(X)) → U29_a(X, binaryZ_in_a(X))
binaryZ_in_a(one(X)) → U30_a(X, binary_in_a(X))
binary_in_a(b) → binary_out_a(b)
binary_in_a(zero(X)) → U27_a(X, binaryZ_in_a(X))
U27_a(X, binaryZ_out_a(X)) → binary_out_a(zero(X))
binary_in_a(one(X)) → U28_a(X, binary_in_a(X))
U28_a(X, binary_out_a(X)) → binary_out_a(one(X))
U30_a(X, binary_out_a(X)) → binaryZ_out_a(one(X))
U29_a(X, binaryZ_out_a(X)) → binaryZ_out_a(zero(X))
U1_aaa(X, binaryZ_out_a(X)) → add_out_aaa(X, b, X)
add_in_aaa(b, Y, Y) → U2_aaa(Y, binaryZ_in_a(Y))
U2_aaa(Y, binaryZ_out_a(Y)) → add_out_aaa(b, Y, Y)
add_in_aaa(X, Y, Z) → U3_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), zero(Y), zero(Z)) → U10_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), one(Y), one(Z)) → U11_aaa(X, Y, Z, addx_in_aaa(X, Y, Z))
addx_in_aaa(one(X), b, one(X)) → U4_aaa(X, binary_in_a(X))
U4_aaa(X, binary_out_a(X)) → addx_out_aaa(one(X), b, one(X))
addx_in_aaa(zero(X), b, zero(X)) → U5_aaa(X, binaryZ_in_a(X))
U5_aaa(X, binaryZ_out_a(X)) → addx_out_aaa(zero(X), b, zero(X))
addx_in_aaa(X, Y, Z) → U6_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), zero(Y), one(Z)) → U12_aaa(X, Y, Z, addy_in_aaa(X, Y, Z))
addy_in_aaa(b, one(Y), one(Y)) → U7_aaa(Y, binary_in_a(Y))
U7_aaa(Y, binary_out_a(Y)) → addy_out_aaa(b, one(Y), one(Y))
addy_in_aaa(b, zero(Y), zero(Y)) → U8_aaa(Y, binaryZ_in_a(Y))
U8_aaa(Y, binaryZ_out_a(Y)) → addy_out_aaa(b, zero(Y), zero(Y))
addy_in_aaa(X, Y, Z) → U9_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), one(Y), zero(Z)) → U13_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
addc_in_aaa(b, b, one(b)) → addc_out_aaa(b, b, one(b))
addc_in_aaa(X, b, Z) → U14_aaa(X, Z, succZ_in_aa(X, Z))
succZ_in_aa(zero(X), one(X)) → U33_aa(X, binaryZ_in_a(X))
U33_aa(X, binaryZ_out_a(X)) → succZ_out_aa(zero(X), one(X))
succZ_in_aa(one(X), zero(Z)) → U34_aa(X, Z, succ_in_aa(X, Z))
succ_in_aa(b, one(b)) → succ_out_aa(b, one(b))
succ_in_aa(zero(X), one(X)) → U31_aa(X, binaryZ_in_a(X))
U31_aa(X, binaryZ_out_a(X)) → succ_out_aa(zero(X), one(X))
succ_in_aa(one(X), zero(Z)) → U32_aa(X, Z, succ_in_aa(X, Z))
U32_aa(X, Z, succ_out_aa(X, Z)) → succ_out_aa(one(X), zero(Z))
U34_aa(X, Z, succ_out_aa(X, Z)) → succZ_out_aa(one(X), zero(Z))
U14_aaa(X, Z, succZ_out_aa(X, Z)) → addc_out_aaa(X, b, Z)
addc_in_aaa(b, Y, Z) → U15_aaa(Y, Z, succZ_in_aa(Y, Z))
U15_aaa(Y, Z, succZ_out_aa(Y, Z)) → addc_out_aaa(b, Y, Z)
addc_in_aaa(X, Y, Z) → U16_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(zero(X), zero(Y), one(Z)) → U23_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
U23_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), zero(Y), one(Z))
addC_in_aaa(zero(X), one(Y), zero(Z)) → U24_aaa(X, Y, Z, addX_in_aaa(X, Y, Z))
addX_in_aaa(zero(X), b, one(X)) → U17_aaa(X, binaryZ_in_a(X))
U17_aaa(X, binaryZ_out_a(X)) → addX_out_aaa(zero(X), b, one(X))
addX_in_aaa(one(X), b, zero(Z)) → U18_aaa(X, Z, succ_in_aa(X, Z))
U18_aaa(X, Z, succ_out_aa(X, Z)) → addX_out_aaa(one(X), b, zero(Z))
addX_in_aaa(X, Y, Z) → U19_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), zero(Y), zero(Z)) → U25_aaa(X, Y, Z, addY_in_aaa(X, Y, Z))
addY_in_aaa(b, zero(Y), one(Y)) → U20_aaa(Y, binaryZ_in_a(Y))
U20_aaa(Y, binaryZ_out_a(Y)) → addY_out_aaa(b, zero(Y), one(Y))
addY_in_aaa(b, one(Y), zero(Z)) → U21_aaa(Y, Z, succ_in_aa(Y, Z))
U21_aaa(Y, Z, succ_out_aa(Y, Z)) → addY_out_aaa(b, one(Y), zero(Z))
addY_in_aaa(X, Y, Z) → U22_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), one(Y), one(Z)) → U26_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
U26_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), one(Y), one(Z))
U22_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addY_out_aaa(X, Y, Z)
U25_aaa(X, Y, Z, addY_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), zero(Y), zero(Z))
U19_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addX_out_aaa(X, Y, Z)
U24_aaa(X, Y, Z, addX_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), one(Y), zero(Z))
U16_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addc_out_aaa(X, Y, Z)
U13_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), one(Y), zero(Z))
U9_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addy_out_aaa(X, Y, Z)
U12_aaa(X, Y, Z, addy_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), zero(Y), one(Z))
U6_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addx_out_aaa(X, Y, Z)
U11_aaa(X, Y, Z, addx_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), one(Y), one(Z))
U10_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), zero(Y), zero(Z))
U3_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → add_out_aaa(X, Y, Z)
U37_aaa(R, S, RSS, add_out_aaa(S, zero(RS), RSS)) → times_out_aaa(one(R), S, RSS)
U35_aaa(R, S, RS, times_out_aaa(R, S, RS)) → times_out_aaa(zero(R), S, zero(RS))
U36_aag(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aag(R, S, RSS, add_in_aag(S, zero(RS), RSS))
add_in_aag(b, b, b) → add_out_aag(b, b, b)
add_in_aag(X, b, X) → U1_aag(X, binaryZ_in_g(X))
binaryZ_in_g(zero(X)) → U29_g(X, binaryZ_in_g(X))
binaryZ_in_g(one(X)) → U30_g(X, binary_in_g(X))
binary_in_g(b) → binary_out_g(b)
binary_in_g(zero(X)) → U27_g(X, binaryZ_in_g(X))
U27_g(X, binaryZ_out_g(X)) → binary_out_g(zero(X))
binary_in_g(one(X)) → U28_g(X, binary_in_g(X))
U28_g(X, binary_out_g(X)) → binary_out_g(one(X))
U30_g(X, binary_out_g(X)) → binaryZ_out_g(one(X))
U29_g(X, binaryZ_out_g(X)) → binaryZ_out_g(zero(X))
U1_aag(X, binaryZ_out_g(X)) → add_out_aag(X, b, X)
add_in_aag(b, Y, Y) → U2_aag(Y, binaryZ_in_g(Y))
U2_aag(Y, binaryZ_out_g(Y)) → add_out_aag(b, Y, Y)
add_in_aag(X, Y, Z) → U3_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), zero(Y), zero(Z)) → U10_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), one(Y), one(Z)) → U11_aag(X, Y, Z, addx_in_aag(X, Y, Z))
addx_in_aag(one(X), b, one(X)) → U4_aag(X, binary_in_g(X))
U4_aag(X, binary_out_g(X)) → addx_out_aag(one(X), b, one(X))
addx_in_aag(zero(X), b, zero(X)) → U5_aag(X, binaryZ_in_g(X))
U5_aag(X, binaryZ_out_g(X)) → addx_out_aag(zero(X), b, zero(X))
addx_in_aag(X, Y, Z) → U6_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), zero(Y), one(Z)) → U12_aag(X, Y, Z, addy_in_aag(X, Y, Z))
addy_in_aag(b, one(Y), one(Y)) → U7_aag(Y, binary_in_g(Y))
U7_aag(Y, binary_out_g(Y)) → addy_out_aag(b, one(Y), one(Y))
addy_in_aag(b, zero(Y), zero(Y)) → U8_aag(Y, binaryZ_in_g(Y))
U8_aag(Y, binaryZ_out_g(Y)) → addy_out_aag(b, zero(Y), zero(Y))
addy_in_aag(X, Y, Z) → U9_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), one(Y), zero(Z)) → U13_aag(X, Y, Z, addc_in_aag(X, Y, Z))
addc_in_aag(b, b, one(b)) → addc_out_aag(b, b, one(b))
addc_in_aag(X, b, Z) → U14_aag(X, Z, succZ_in_ag(X, Z))
succZ_in_ag(zero(X), one(X)) → U33_ag(X, binaryZ_in_g(X))
U33_ag(X, binaryZ_out_g(X)) → succZ_out_ag(zero(X), one(X))
succZ_in_ag(one(X), zero(Z)) → U34_ag(X, Z, succ_in_ag(X, Z))
succ_in_ag(b, one(b)) → succ_out_ag(b, one(b))
succ_in_ag(zero(X), one(X)) → U31_ag(X, binaryZ_in_g(X))
U31_ag(X, binaryZ_out_g(X)) → succ_out_ag(zero(X), one(X))
succ_in_ag(one(X), zero(Z)) → U32_ag(X, Z, succ_in_ag(X, Z))
U32_ag(X, Z, succ_out_ag(X, Z)) → succ_out_ag(one(X), zero(Z))
U34_ag(X, Z, succ_out_ag(X, Z)) → succZ_out_ag(one(X), zero(Z))
U14_aag(X, Z, succZ_out_ag(X, Z)) → addc_out_aag(X, b, Z)
addc_in_aag(b, Y, Z) → U15_aag(Y, Z, succZ_in_ag(Y, Z))
U15_aag(Y, Z, succZ_out_ag(Y, Z)) → addc_out_aag(b, Y, Z)
addc_in_aag(X, Y, Z) → U16_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(zero(X), zero(Y), one(Z)) → U23_aag(X, Y, Z, addz_in_aag(X, Y, Z))
U23_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addC_out_aag(zero(X), zero(Y), one(Z))
addC_in_aag(zero(X), one(Y), zero(Z)) → U24_aag(X, Y, Z, addX_in_aag(X, Y, Z))
addX_in_aag(zero(X), b, one(X)) → U17_aag(X, binaryZ_in_g(X))
U17_aag(X, binaryZ_out_g(X)) → addX_out_aag(zero(X), b, one(X))
addX_in_aag(one(X), b, zero(Z)) → U18_aag(X, Z, succ_in_ag(X, Z))
U18_aag(X, Z, succ_out_ag(X, Z)) → addX_out_aag(one(X), b, zero(Z))
addX_in_aag(X, Y, Z) → U19_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), zero(Y), zero(Z)) → U25_aag(X, Y, Z, addY_in_aag(X, Y, Z))
addY_in_aag(b, zero(Y), one(Y)) → U20_aag(Y, binaryZ_in_g(Y))
U20_aag(Y, binaryZ_out_g(Y)) → addY_out_aag(b, zero(Y), one(Y))
addY_in_aag(b, one(Y), zero(Z)) → U21_aag(Y, Z, succ_in_ag(Y, Z))
U21_aag(Y, Z, succ_out_ag(Y, Z)) → addY_out_aag(b, one(Y), zero(Z))
addY_in_aag(X, Y, Z) → U22_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), one(Y), one(Z)) → U26_aag(X, Y, Z, addc_in_aag(X, Y, Z))
U26_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addC_out_aag(one(X), one(Y), one(Z))
U22_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addY_out_aag(X, Y, Z)
U25_aag(X, Y, Z, addY_out_aag(X, Y, Z)) → addC_out_aag(one(X), zero(Y), zero(Z))
U19_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addX_out_aag(X, Y, Z)
U24_aag(X, Y, Z, addX_out_aag(X, Y, Z)) → addC_out_aag(zero(X), one(Y), zero(Z))
U16_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addc_out_aag(X, Y, Z)
U13_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addz_out_aag(one(X), one(Y), zero(Z))
U9_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addy_out_aag(X, Y, Z)
U12_aag(X, Y, Z, addy_out_aag(X, Y, Z)) → addz_out_aag(one(X), zero(Y), one(Z))
U6_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addx_out_aag(X, Y, Z)
U11_aag(X, Y, Z, addx_out_aag(X, Y, Z)) → addz_out_aag(zero(X), one(Y), one(Z))
U10_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addz_out_aag(zero(X), zero(Y), zero(Z))
U3_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → add_out_aag(X, Y, Z)
U37_aag(R, S, RSS, add_out_aag(S, zero(RS), RSS)) → times_out_aag(one(R), S, RSS)
U35_aag(R, S, RS, times_out_aag(R, S, RS)) → times_out_aag(zero(R), S, zero(RS))
BINARYZ_IN_G(one(X)) → BINARY_IN_G(X)
BINARY_IN_G(zero(X)) → BINARYZ_IN_G(X)
BINARYZ_IN_G(zero(X)) → BINARYZ_IN_G(X)
BINARY_IN_G(one(X)) → BINARY_IN_G(X)
BINARYZ_IN_G(one(X)) → BINARY_IN_G(X)
BINARY_IN_G(zero(X)) → BINARYZ_IN_G(X)
BINARYZ_IN_G(zero(X)) → BINARYZ_IN_G(X)
BINARY_IN_G(one(X)) → BINARY_IN_G(X)
From the DPs we obtained the following set of size-change graphs:
SUCC_IN_AG(one(X), zero(Z)) → SUCC_IN_AG(X, Z)
times_in_aag(one(b), X, X) → times_out_aag(one(b), X, X)
times_in_aag(zero(R), S, zero(RS)) → U35_aag(R, S, RS, times_in_aag(R, S, RS))
times_in_aag(one(R), S, RSS) → U36_aag(R, S, RSS, times_in_aaa(R, S, RS))
times_in_aaa(one(b), X, X) → times_out_aaa(one(b), X, X)
times_in_aaa(zero(R), S, zero(RS)) → U35_aaa(R, S, RS, times_in_aaa(R, S, RS))
times_in_aaa(one(R), S, RSS) → U36_aaa(R, S, RSS, times_in_aaa(R, S, RS))
U36_aaa(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aaa(R, S, RSS, add_in_aaa(S, zero(RS), RSS))
add_in_aaa(b, b, b) → add_out_aaa(b, b, b)
add_in_aaa(X, b, X) → U1_aaa(X, binaryZ_in_a(X))
binaryZ_in_a(zero(X)) → U29_a(X, binaryZ_in_a(X))
binaryZ_in_a(one(X)) → U30_a(X, binary_in_a(X))
binary_in_a(b) → binary_out_a(b)
binary_in_a(zero(X)) → U27_a(X, binaryZ_in_a(X))
U27_a(X, binaryZ_out_a(X)) → binary_out_a(zero(X))
binary_in_a(one(X)) → U28_a(X, binary_in_a(X))
U28_a(X, binary_out_a(X)) → binary_out_a(one(X))
U30_a(X, binary_out_a(X)) → binaryZ_out_a(one(X))
U29_a(X, binaryZ_out_a(X)) → binaryZ_out_a(zero(X))
U1_aaa(X, binaryZ_out_a(X)) → add_out_aaa(X, b, X)
add_in_aaa(b, Y, Y) → U2_aaa(Y, binaryZ_in_a(Y))
U2_aaa(Y, binaryZ_out_a(Y)) → add_out_aaa(b, Y, Y)
add_in_aaa(X, Y, Z) → U3_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), zero(Y), zero(Z)) → U10_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), one(Y), one(Z)) → U11_aaa(X, Y, Z, addx_in_aaa(X, Y, Z))
addx_in_aaa(one(X), b, one(X)) → U4_aaa(X, binary_in_a(X))
U4_aaa(X, binary_out_a(X)) → addx_out_aaa(one(X), b, one(X))
addx_in_aaa(zero(X), b, zero(X)) → U5_aaa(X, binaryZ_in_a(X))
U5_aaa(X, binaryZ_out_a(X)) → addx_out_aaa(zero(X), b, zero(X))
addx_in_aaa(X, Y, Z) → U6_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), zero(Y), one(Z)) → U12_aaa(X, Y, Z, addy_in_aaa(X, Y, Z))
addy_in_aaa(b, one(Y), one(Y)) → U7_aaa(Y, binary_in_a(Y))
U7_aaa(Y, binary_out_a(Y)) → addy_out_aaa(b, one(Y), one(Y))
addy_in_aaa(b, zero(Y), zero(Y)) → U8_aaa(Y, binaryZ_in_a(Y))
U8_aaa(Y, binaryZ_out_a(Y)) → addy_out_aaa(b, zero(Y), zero(Y))
addy_in_aaa(X, Y, Z) → U9_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), one(Y), zero(Z)) → U13_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
addc_in_aaa(b, b, one(b)) → addc_out_aaa(b, b, one(b))
addc_in_aaa(X, b, Z) → U14_aaa(X, Z, succZ_in_aa(X, Z))
succZ_in_aa(zero(X), one(X)) → U33_aa(X, binaryZ_in_a(X))
U33_aa(X, binaryZ_out_a(X)) → succZ_out_aa(zero(X), one(X))
succZ_in_aa(one(X), zero(Z)) → U34_aa(X, Z, succ_in_aa(X, Z))
succ_in_aa(b, one(b)) → succ_out_aa(b, one(b))
succ_in_aa(zero(X), one(X)) → U31_aa(X, binaryZ_in_a(X))
U31_aa(X, binaryZ_out_a(X)) → succ_out_aa(zero(X), one(X))
succ_in_aa(one(X), zero(Z)) → U32_aa(X, Z, succ_in_aa(X, Z))
U32_aa(X, Z, succ_out_aa(X, Z)) → succ_out_aa(one(X), zero(Z))
U34_aa(X, Z, succ_out_aa(X, Z)) → succZ_out_aa(one(X), zero(Z))
U14_aaa(X, Z, succZ_out_aa(X, Z)) → addc_out_aaa(X, b, Z)
addc_in_aaa(b, Y, Z) → U15_aaa(Y, Z, succZ_in_aa(Y, Z))
U15_aaa(Y, Z, succZ_out_aa(Y, Z)) → addc_out_aaa(b, Y, Z)
addc_in_aaa(X, Y, Z) → U16_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(zero(X), zero(Y), one(Z)) → U23_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
U23_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), zero(Y), one(Z))
addC_in_aaa(zero(X), one(Y), zero(Z)) → U24_aaa(X, Y, Z, addX_in_aaa(X, Y, Z))
addX_in_aaa(zero(X), b, one(X)) → U17_aaa(X, binaryZ_in_a(X))
U17_aaa(X, binaryZ_out_a(X)) → addX_out_aaa(zero(X), b, one(X))
addX_in_aaa(one(X), b, zero(Z)) → U18_aaa(X, Z, succ_in_aa(X, Z))
U18_aaa(X, Z, succ_out_aa(X, Z)) → addX_out_aaa(one(X), b, zero(Z))
addX_in_aaa(X, Y, Z) → U19_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), zero(Y), zero(Z)) → U25_aaa(X, Y, Z, addY_in_aaa(X, Y, Z))
addY_in_aaa(b, zero(Y), one(Y)) → U20_aaa(Y, binaryZ_in_a(Y))
U20_aaa(Y, binaryZ_out_a(Y)) → addY_out_aaa(b, zero(Y), one(Y))
addY_in_aaa(b, one(Y), zero(Z)) → U21_aaa(Y, Z, succ_in_aa(Y, Z))
U21_aaa(Y, Z, succ_out_aa(Y, Z)) → addY_out_aaa(b, one(Y), zero(Z))
addY_in_aaa(X, Y, Z) → U22_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), one(Y), one(Z)) → U26_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
U26_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), one(Y), one(Z))
U22_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addY_out_aaa(X, Y, Z)
U25_aaa(X, Y, Z, addY_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), zero(Y), zero(Z))
U19_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addX_out_aaa(X, Y, Z)
U24_aaa(X, Y, Z, addX_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), one(Y), zero(Z))
U16_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addc_out_aaa(X, Y, Z)
U13_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), one(Y), zero(Z))
U9_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addy_out_aaa(X, Y, Z)
U12_aaa(X, Y, Z, addy_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), zero(Y), one(Z))
U6_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addx_out_aaa(X, Y, Z)
U11_aaa(X, Y, Z, addx_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), one(Y), one(Z))
U10_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), zero(Y), zero(Z))
U3_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → add_out_aaa(X, Y, Z)
U37_aaa(R, S, RSS, add_out_aaa(S, zero(RS), RSS)) → times_out_aaa(one(R), S, RSS)
U35_aaa(R, S, RS, times_out_aaa(R, S, RS)) → times_out_aaa(zero(R), S, zero(RS))
U36_aag(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aag(R, S, RSS, add_in_aag(S, zero(RS), RSS))
add_in_aag(b, b, b) → add_out_aag(b, b, b)
add_in_aag(X, b, X) → U1_aag(X, binaryZ_in_g(X))
binaryZ_in_g(zero(X)) → U29_g(X, binaryZ_in_g(X))
binaryZ_in_g(one(X)) → U30_g(X, binary_in_g(X))
binary_in_g(b) → binary_out_g(b)
binary_in_g(zero(X)) → U27_g(X, binaryZ_in_g(X))
U27_g(X, binaryZ_out_g(X)) → binary_out_g(zero(X))
binary_in_g(one(X)) → U28_g(X, binary_in_g(X))
U28_g(X, binary_out_g(X)) → binary_out_g(one(X))
U30_g(X, binary_out_g(X)) → binaryZ_out_g(one(X))
U29_g(X, binaryZ_out_g(X)) → binaryZ_out_g(zero(X))
U1_aag(X, binaryZ_out_g(X)) → add_out_aag(X, b, X)
add_in_aag(b, Y, Y) → U2_aag(Y, binaryZ_in_g(Y))
U2_aag(Y, binaryZ_out_g(Y)) → add_out_aag(b, Y, Y)
add_in_aag(X, Y, Z) → U3_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), zero(Y), zero(Z)) → U10_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), one(Y), one(Z)) → U11_aag(X, Y, Z, addx_in_aag(X, Y, Z))
addx_in_aag(one(X), b, one(X)) → U4_aag(X, binary_in_g(X))
U4_aag(X, binary_out_g(X)) → addx_out_aag(one(X), b, one(X))
addx_in_aag(zero(X), b, zero(X)) → U5_aag(X, binaryZ_in_g(X))
U5_aag(X, binaryZ_out_g(X)) → addx_out_aag(zero(X), b, zero(X))
addx_in_aag(X, Y, Z) → U6_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), zero(Y), one(Z)) → U12_aag(X, Y, Z, addy_in_aag(X, Y, Z))
addy_in_aag(b, one(Y), one(Y)) → U7_aag(Y, binary_in_g(Y))
U7_aag(Y, binary_out_g(Y)) → addy_out_aag(b, one(Y), one(Y))
addy_in_aag(b, zero(Y), zero(Y)) → U8_aag(Y, binaryZ_in_g(Y))
U8_aag(Y, binaryZ_out_g(Y)) → addy_out_aag(b, zero(Y), zero(Y))
addy_in_aag(X, Y, Z) → U9_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), one(Y), zero(Z)) → U13_aag(X, Y, Z, addc_in_aag(X, Y, Z))
addc_in_aag(b, b, one(b)) → addc_out_aag(b, b, one(b))
addc_in_aag(X, b, Z) → U14_aag(X, Z, succZ_in_ag(X, Z))
succZ_in_ag(zero(X), one(X)) → U33_ag(X, binaryZ_in_g(X))
U33_ag(X, binaryZ_out_g(X)) → succZ_out_ag(zero(X), one(X))
succZ_in_ag(one(X), zero(Z)) → U34_ag(X, Z, succ_in_ag(X, Z))
succ_in_ag(b, one(b)) → succ_out_ag(b, one(b))
succ_in_ag(zero(X), one(X)) → U31_ag(X, binaryZ_in_g(X))
U31_ag(X, binaryZ_out_g(X)) → succ_out_ag(zero(X), one(X))
succ_in_ag(one(X), zero(Z)) → U32_ag(X, Z, succ_in_ag(X, Z))
U32_ag(X, Z, succ_out_ag(X, Z)) → succ_out_ag(one(X), zero(Z))
U34_ag(X, Z, succ_out_ag(X, Z)) → succZ_out_ag(one(X), zero(Z))
U14_aag(X, Z, succZ_out_ag(X, Z)) → addc_out_aag(X, b, Z)
addc_in_aag(b, Y, Z) → U15_aag(Y, Z, succZ_in_ag(Y, Z))
U15_aag(Y, Z, succZ_out_ag(Y, Z)) → addc_out_aag(b, Y, Z)
addc_in_aag(X, Y, Z) → U16_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(zero(X), zero(Y), one(Z)) → U23_aag(X, Y, Z, addz_in_aag(X, Y, Z))
U23_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addC_out_aag(zero(X), zero(Y), one(Z))
addC_in_aag(zero(X), one(Y), zero(Z)) → U24_aag(X, Y, Z, addX_in_aag(X, Y, Z))
addX_in_aag(zero(X), b, one(X)) → U17_aag(X, binaryZ_in_g(X))
U17_aag(X, binaryZ_out_g(X)) → addX_out_aag(zero(X), b, one(X))
addX_in_aag(one(X), b, zero(Z)) → U18_aag(X, Z, succ_in_ag(X, Z))
U18_aag(X, Z, succ_out_ag(X, Z)) → addX_out_aag(one(X), b, zero(Z))
addX_in_aag(X, Y, Z) → U19_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), zero(Y), zero(Z)) → U25_aag(X, Y, Z, addY_in_aag(X, Y, Z))
addY_in_aag(b, zero(Y), one(Y)) → U20_aag(Y, binaryZ_in_g(Y))
U20_aag(Y, binaryZ_out_g(Y)) → addY_out_aag(b, zero(Y), one(Y))
addY_in_aag(b, one(Y), zero(Z)) → U21_aag(Y, Z, succ_in_ag(Y, Z))
U21_aag(Y, Z, succ_out_ag(Y, Z)) → addY_out_aag(b, one(Y), zero(Z))
addY_in_aag(X, Y, Z) → U22_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), one(Y), one(Z)) → U26_aag(X, Y, Z, addc_in_aag(X, Y, Z))
U26_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addC_out_aag(one(X), one(Y), one(Z))
U22_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addY_out_aag(X, Y, Z)
U25_aag(X, Y, Z, addY_out_aag(X, Y, Z)) → addC_out_aag(one(X), zero(Y), zero(Z))
U19_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addX_out_aag(X, Y, Z)
U24_aag(X, Y, Z, addX_out_aag(X, Y, Z)) → addC_out_aag(zero(X), one(Y), zero(Z))
U16_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addc_out_aag(X, Y, Z)
U13_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addz_out_aag(one(X), one(Y), zero(Z))
U9_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addy_out_aag(X, Y, Z)
U12_aag(X, Y, Z, addy_out_aag(X, Y, Z)) → addz_out_aag(one(X), zero(Y), one(Z))
U6_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addx_out_aag(X, Y, Z)
U11_aag(X, Y, Z, addx_out_aag(X, Y, Z)) → addz_out_aag(zero(X), one(Y), one(Z))
U10_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addz_out_aag(zero(X), zero(Y), zero(Z))
U3_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → add_out_aag(X, Y, Z)
U37_aag(R, S, RSS, add_out_aag(S, zero(RS), RSS)) → times_out_aag(one(R), S, RSS)
U35_aag(R, S, RS, times_out_aag(R, S, RS)) → times_out_aag(zero(R), S, zero(RS))
SUCC_IN_AG(one(X), zero(Z)) → SUCC_IN_AG(X, Z)
SUCC_IN_AG(zero(Z)) → SUCC_IN_AG(Z)
From the DPs we obtained the following set of size-change graphs:
ADDX_IN_AAG(X, Y, Z) → ADDZ_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(zero(X), zero(Y), zero(Z)) → ADDZ_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(zero(X), one(Y), one(Z)) → ADDX_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(one(X), zero(Y), one(Z)) → ADDY_IN_AAG(X, Y, Z)
ADDY_IN_AAG(X, Y, Z) → ADDZ_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(one(X), one(Y), zero(Z)) → ADDC_IN_AAG(X, Y, Z)
ADDC_IN_AAG(X, Y, Z) → ADDC_IN_AAG1(X, Y, Z)
ADDC_IN_AAG1(zero(X), zero(Y), one(Z)) → ADDZ_IN_AAG(X, Y, Z)
ADDC_IN_AAG1(zero(X), one(Y), zero(Z)) → ADDX_IN_AAG1(X, Y, Z)
ADDX_IN_AAG1(X, Y, Z) → ADDC_IN_AAG1(X, Y, Z)
ADDC_IN_AAG1(one(X), zero(Y), zero(Z)) → ADDY_IN_AAG1(X, Y, Z)
ADDY_IN_AAG1(X, Y, Z) → ADDC_IN_AAG1(X, Y, Z)
ADDC_IN_AAG1(one(X), one(Y), one(Z)) → ADDC_IN_AAG(X, Y, Z)
times_in_aag(one(b), X, X) → times_out_aag(one(b), X, X)
times_in_aag(zero(R), S, zero(RS)) → U35_aag(R, S, RS, times_in_aag(R, S, RS))
times_in_aag(one(R), S, RSS) → U36_aag(R, S, RSS, times_in_aaa(R, S, RS))
times_in_aaa(one(b), X, X) → times_out_aaa(one(b), X, X)
times_in_aaa(zero(R), S, zero(RS)) → U35_aaa(R, S, RS, times_in_aaa(R, S, RS))
times_in_aaa(one(R), S, RSS) → U36_aaa(R, S, RSS, times_in_aaa(R, S, RS))
U36_aaa(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aaa(R, S, RSS, add_in_aaa(S, zero(RS), RSS))
add_in_aaa(b, b, b) → add_out_aaa(b, b, b)
add_in_aaa(X, b, X) → U1_aaa(X, binaryZ_in_a(X))
binaryZ_in_a(zero(X)) → U29_a(X, binaryZ_in_a(X))
binaryZ_in_a(one(X)) → U30_a(X, binary_in_a(X))
binary_in_a(b) → binary_out_a(b)
binary_in_a(zero(X)) → U27_a(X, binaryZ_in_a(X))
U27_a(X, binaryZ_out_a(X)) → binary_out_a(zero(X))
binary_in_a(one(X)) → U28_a(X, binary_in_a(X))
U28_a(X, binary_out_a(X)) → binary_out_a(one(X))
U30_a(X, binary_out_a(X)) → binaryZ_out_a(one(X))
U29_a(X, binaryZ_out_a(X)) → binaryZ_out_a(zero(X))
U1_aaa(X, binaryZ_out_a(X)) → add_out_aaa(X, b, X)
add_in_aaa(b, Y, Y) → U2_aaa(Y, binaryZ_in_a(Y))
U2_aaa(Y, binaryZ_out_a(Y)) → add_out_aaa(b, Y, Y)
add_in_aaa(X, Y, Z) → U3_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), zero(Y), zero(Z)) → U10_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), one(Y), one(Z)) → U11_aaa(X, Y, Z, addx_in_aaa(X, Y, Z))
addx_in_aaa(one(X), b, one(X)) → U4_aaa(X, binary_in_a(X))
U4_aaa(X, binary_out_a(X)) → addx_out_aaa(one(X), b, one(X))
addx_in_aaa(zero(X), b, zero(X)) → U5_aaa(X, binaryZ_in_a(X))
U5_aaa(X, binaryZ_out_a(X)) → addx_out_aaa(zero(X), b, zero(X))
addx_in_aaa(X, Y, Z) → U6_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), zero(Y), one(Z)) → U12_aaa(X, Y, Z, addy_in_aaa(X, Y, Z))
addy_in_aaa(b, one(Y), one(Y)) → U7_aaa(Y, binary_in_a(Y))
U7_aaa(Y, binary_out_a(Y)) → addy_out_aaa(b, one(Y), one(Y))
addy_in_aaa(b, zero(Y), zero(Y)) → U8_aaa(Y, binaryZ_in_a(Y))
U8_aaa(Y, binaryZ_out_a(Y)) → addy_out_aaa(b, zero(Y), zero(Y))
addy_in_aaa(X, Y, Z) → U9_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), one(Y), zero(Z)) → U13_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
addc_in_aaa(b, b, one(b)) → addc_out_aaa(b, b, one(b))
addc_in_aaa(X, b, Z) → U14_aaa(X, Z, succZ_in_aa(X, Z))
succZ_in_aa(zero(X), one(X)) → U33_aa(X, binaryZ_in_a(X))
U33_aa(X, binaryZ_out_a(X)) → succZ_out_aa(zero(X), one(X))
succZ_in_aa(one(X), zero(Z)) → U34_aa(X, Z, succ_in_aa(X, Z))
succ_in_aa(b, one(b)) → succ_out_aa(b, one(b))
succ_in_aa(zero(X), one(X)) → U31_aa(X, binaryZ_in_a(X))
U31_aa(X, binaryZ_out_a(X)) → succ_out_aa(zero(X), one(X))
succ_in_aa(one(X), zero(Z)) → U32_aa(X, Z, succ_in_aa(X, Z))
U32_aa(X, Z, succ_out_aa(X, Z)) → succ_out_aa(one(X), zero(Z))
U34_aa(X, Z, succ_out_aa(X, Z)) → succZ_out_aa(one(X), zero(Z))
U14_aaa(X, Z, succZ_out_aa(X, Z)) → addc_out_aaa(X, b, Z)
addc_in_aaa(b, Y, Z) → U15_aaa(Y, Z, succZ_in_aa(Y, Z))
U15_aaa(Y, Z, succZ_out_aa(Y, Z)) → addc_out_aaa(b, Y, Z)
addc_in_aaa(X, Y, Z) → U16_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(zero(X), zero(Y), one(Z)) → U23_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
U23_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), zero(Y), one(Z))
addC_in_aaa(zero(X), one(Y), zero(Z)) → U24_aaa(X, Y, Z, addX_in_aaa(X, Y, Z))
addX_in_aaa(zero(X), b, one(X)) → U17_aaa(X, binaryZ_in_a(X))
U17_aaa(X, binaryZ_out_a(X)) → addX_out_aaa(zero(X), b, one(X))
addX_in_aaa(one(X), b, zero(Z)) → U18_aaa(X, Z, succ_in_aa(X, Z))
U18_aaa(X, Z, succ_out_aa(X, Z)) → addX_out_aaa(one(X), b, zero(Z))
addX_in_aaa(X, Y, Z) → U19_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), zero(Y), zero(Z)) → U25_aaa(X, Y, Z, addY_in_aaa(X, Y, Z))
addY_in_aaa(b, zero(Y), one(Y)) → U20_aaa(Y, binaryZ_in_a(Y))
U20_aaa(Y, binaryZ_out_a(Y)) → addY_out_aaa(b, zero(Y), one(Y))
addY_in_aaa(b, one(Y), zero(Z)) → U21_aaa(Y, Z, succ_in_aa(Y, Z))
U21_aaa(Y, Z, succ_out_aa(Y, Z)) → addY_out_aaa(b, one(Y), zero(Z))
addY_in_aaa(X, Y, Z) → U22_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), one(Y), one(Z)) → U26_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
U26_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), one(Y), one(Z))
U22_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addY_out_aaa(X, Y, Z)
U25_aaa(X, Y, Z, addY_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), zero(Y), zero(Z))
U19_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addX_out_aaa(X, Y, Z)
U24_aaa(X, Y, Z, addX_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), one(Y), zero(Z))
U16_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addc_out_aaa(X, Y, Z)
U13_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), one(Y), zero(Z))
U9_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addy_out_aaa(X, Y, Z)
U12_aaa(X, Y, Z, addy_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), zero(Y), one(Z))
U6_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addx_out_aaa(X, Y, Z)
U11_aaa(X, Y, Z, addx_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), one(Y), one(Z))
U10_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), zero(Y), zero(Z))
U3_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → add_out_aaa(X, Y, Z)
U37_aaa(R, S, RSS, add_out_aaa(S, zero(RS), RSS)) → times_out_aaa(one(R), S, RSS)
U35_aaa(R, S, RS, times_out_aaa(R, S, RS)) → times_out_aaa(zero(R), S, zero(RS))
U36_aag(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aag(R, S, RSS, add_in_aag(S, zero(RS), RSS))
add_in_aag(b, b, b) → add_out_aag(b, b, b)
add_in_aag(X, b, X) → U1_aag(X, binaryZ_in_g(X))
binaryZ_in_g(zero(X)) → U29_g(X, binaryZ_in_g(X))
binaryZ_in_g(one(X)) → U30_g(X, binary_in_g(X))
binary_in_g(b) → binary_out_g(b)
binary_in_g(zero(X)) → U27_g(X, binaryZ_in_g(X))
U27_g(X, binaryZ_out_g(X)) → binary_out_g(zero(X))
binary_in_g(one(X)) → U28_g(X, binary_in_g(X))
U28_g(X, binary_out_g(X)) → binary_out_g(one(X))
U30_g(X, binary_out_g(X)) → binaryZ_out_g(one(X))
U29_g(X, binaryZ_out_g(X)) → binaryZ_out_g(zero(X))
U1_aag(X, binaryZ_out_g(X)) → add_out_aag(X, b, X)
add_in_aag(b, Y, Y) → U2_aag(Y, binaryZ_in_g(Y))
U2_aag(Y, binaryZ_out_g(Y)) → add_out_aag(b, Y, Y)
add_in_aag(X, Y, Z) → U3_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), zero(Y), zero(Z)) → U10_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), one(Y), one(Z)) → U11_aag(X, Y, Z, addx_in_aag(X, Y, Z))
addx_in_aag(one(X), b, one(X)) → U4_aag(X, binary_in_g(X))
U4_aag(X, binary_out_g(X)) → addx_out_aag(one(X), b, one(X))
addx_in_aag(zero(X), b, zero(X)) → U5_aag(X, binaryZ_in_g(X))
U5_aag(X, binaryZ_out_g(X)) → addx_out_aag(zero(X), b, zero(X))
addx_in_aag(X, Y, Z) → U6_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), zero(Y), one(Z)) → U12_aag(X, Y, Z, addy_in_aag(X, Y, Z))
addy_in_aag(b, one(Y), one(Y)) → U7_aag(Y, binary_in_g(Y))
U7_aag(Y, binary_out_g(Y)) → addy_out_aag(b, one(Y), one(Y))
addy_in_aag(b, zero(Y), zero(Y)) → U8_aag(Y, binaryZ_in_g(Y))
U8_aag(Y, binaryZ_out_g(Y)) → addy_out_aag(b, zero(Y), zero(Y))
addy_in_aag(X, Y, Z) → U9_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), one(Y), zero(Z)) → U13_aag(X, Y, Z, addc_in_aag(X, Y, Z))
addc_in_aag(b, b, one(b)) → addc_out_aag(b, b, one(b))
addc_in_aag(X, b, Z) → U14_aag(X, Z, succZ_in_ag(X, Z))
succZ_in_ag(zero(X), one(X)) → U33_ag(X, binaryZ_in_g(X))
U33_ag(X, binaryZ_out_g(X)) → succZ_out_ag(zero(X), one(X))
succZ_in_ag(one(X), zero(Z)) → U34_ag(X, Z, succ_in_ag(X, Z))
succ_in_ag(b, one(b)) → succ_out_ag(b, one(b))
succ_in_ag(zero(X), one(X)) → U31_ag(X, binaryZ_in_g(X))
U31_ag(X, binaryZ_out_g(X)) → succ_out_ag(zero(X), one(X))
succ_in_ag(one(X), zero(Z)) → U32_ag(X, Z, succ_in_ag(X, Z))
U32_ag(X, Z, succ_out_ag(X, Z)) → succ_out_ag(one(X), zero(Z))
U34_ag(X, Z, succ_out_ag(X, Z)) → succZ_out_ag(one(X), zero(Z))
U14_aag(X, Z, succZ_out_ag(X, Z)) → addc_out_aag(X, b, Z)
addc_in_aag(b, Y, Z) → U15_aag(Y, Z, succZ_in_ag(Y, Z))
U15_aag(Y, Z, succZ_out_ag(Y, Z)) → addc_out_aag(b, Y, Z)
addc_in_aag(X, Y, Z) → U16_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(zero(X), zero(Y), one(Z)) → U23_aag(X, Y, Z, addz_in_aag(X, Y, Z))
U23_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addC_out_aag(zero(X), zero(Y), one(Z))
addC_in_aag(zero(X), one(Y), zero(Z)) → U24_aag(X, Y, Z, addX_in_aag(X, Y, Z))
addX_in_aag(zero(X), b, one(X)) → U17_aag(X, binaryZ_in_g(X))
U17_aag(X, binaryZ_out_g(X)) → addX_out_aag(zero(X), b, one(X))
addX_in_aag(one(X), b, zero(Z)) → U18_aag(X, Z, succ_in_ag(X, Z))
U18_aag(X, Z, succ_out_ag(X, Z)) → addX_out_aag(one(X), b, zero(Z))
addX_in_aag(X, Y, Z) → U19_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), zero(Y), zero(Z)) → U25_aag(X, Y, Z, addY_in_aag(X, Y, Z))
addY_in_aag(b, zero(Y), one(Y)) → U20_aag(Y, binaryZ_in_g(Y))
U20_aag(Y, binaryZ_out_g(Y)) → addY_out_aag(b, zero(Y), one(Y))
addY_in_aag(b, one(Y), zero(Z)) → U21_aag(Y, Z, succ_in_ag(Y, Z))
U21_aag(Y, Z, succ_out_ag(Y, Z)) → addY_out_aag(b, one(Y), zero(Z))
addY_in_aag(X, Y, Z) → U22_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), one(Y), one(Z)) → U26_aag(X, Y, Z, addc_in_aag(X, Y, Z))
U26_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addC_out_aag(one(X), one(Y), one(Z))
U22_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addY_out_aag(X, Y, Z)
U25_aag(X, Y, Z, addY_out_aag(X, Y, Z)) → addC_out_aag(one(X), zero(Y), zero(Z))
U19_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addX_out_aag(X, Y, Z)
U24_aag(X, Y, Z, addX_out_aag(X, Y, Z)) → addC_out_aag(zero(X), one(Y), zero(Z))
U16_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addc_out_aag(X, Y, Z)
U13_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addz_out_aag(one(X), one(Y), zero(Z))
U9_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addy_out_aag(X, Y, Z)
U12_aag(X, Y, Z, addy_out_aag(X, Y, Z)) → addz_out_aag(one(X), zero(Y), one(Z))
U6_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addx_out_aag(X, Y, Z)
U11_aag(X, Y, Z, addx_out_aag(X, Y, Z)) → addz_out_aag(zero(X), one(Y), one(Z))
U10_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addz_out_aag(zero(X), zero(Y), zero(Z))
U3_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → add_out_aag(X, Y, Z)
U37_aag(R, S, RSS, add_out_aag(S, zero(RS), RSS)) → times_out_aag(one(R), S, RSS)
U35_aag(R, S, RS, times_out_aag(R, S, RS)) → times_out_aag(zero(R), S, zero(RS))
ADDX_IN_AAG(X, Y, Z) → ADDZ_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(zero(X), zero(Y), zero(Z)) → ADDZ_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(zero(X), one(Y), one(Z)) → ADDX_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(one(X), zero(Y), one(Z)) → ADDY_IN_AAG(X, Y, Z)
ADDY_IN_AAG(X, Y, Z) → ADDZ_IN_AAG(X, Y, Z)
ADDZ_IN_AAG(one(X), one(Y), zero(Z)) → ADDC_IN_AAG(X, Y, Z)
ADDC_IN_AAG(X, Y, Z) → ADDC_IN_AAG1(X, Y, Z)
ADDC_IN_AAG1(zero(X), zero(Y), one(Z)) → ADDZ_IN_AAG(X, Y, Z)
ADDC_IN_AAG1(zero(X), one(Y), zero(Z)) → ADDX_IN_AAG1(X, Y, Z)
ADDX_IN_AAG1(X, Y, Z) → ADDC_IN_AAG1(X, Y, Z)
ADDC_IN_AAG1(one(X), zero(Y), zero(Z)) → ADDY_IN_AAG1(X, Y, Z)
ADDY_IN_AAG1(X, Y, Z) → ADDC_IN_AAG1(X, Y, Z)
ADDC_IN_AAG1(one(X), one(Y), one(Z)) → ADDC_IN_AAG(X, Y, Z)
ADDX_IN_AAG(Z) → ADDZ_IN_AAG(Z)
ADDZ_IN_AAG(zero(Z)) → ADDZ_IN_AAG(Z)
ADDZ_IN_AAG(one(Z)) → ADDX_IN_AAG(Z)
ADDZ_IN_AAG(one(Z)) → ADDY_IN_AAG(Z)
ADDY_IN_AAG(Z) → ADDZ_IN_AAG(Z)
ADDZ_IN_AAG(zero(Z)) → ADDC_IN_AAG(Z)
ADDC_IN_AAG(Z) → ADDC_IN_AAG1(Z)
ADDC_IN_AAG1(one(Z)) → ADDZ_IN_AAG(Z)
ADDC_IN_AAG1(zero(Z)) → ADDX_IN_AAG1(Z)
ADDX_IN_AAG1(Z) → ADDC_IN_AAG1(Z)
ADDC_IN_AAG1(zero(Z)) → ADDY_IN_AAG1(Z)
ADDY_IN_AAG1(Z) → ADDC_IN_AAG1(Z)
ADDC_IN_AAG1(one(Z)) → ADDC_IN_AAG(Z)
From the DPs we obtained the following set of size-change graphs:
BINARYZ_IN_A(one(X)) → BINARY_IN_A(X)
BINARY_IN_A(zero(X)) → BINARYZ_IN_A(X)
BINARYZ_IN_A(zero(X)) → BINARYZ_IN_A(X)
BINARY_IN_A(one(X)) → BINARY_IN_A(X)
times_in_aag(one(b), X, X) → times_out_aag(one(b), X, X)
times_in_aag(zero(R), S, zero(RS)) → U35_aag(R, S, RS, times_in_aag(R, S, RS))
times_in_aag(one(R), S, RSS) → U36_aag(R, S, RSS, times_in_aaa(R, S, RS))
times_in_aaa(one(b), X, X) → times_out_aaa(one(b), X, X)
times_in_aaa(zero(R), S, zero(RS)) → U35_aaa(R, S, RS, times_in_aaa(R, S, RS))
times_in_aaa(one(R), S, RSS) → U36_aaa(R, S, RSS, times_in_aaa(R, S, RS))
U36_aaa(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aaa(R, S, RSS, add_in_aaa(S, zero(RS), RSS))
add_in_aaa(b, b, b) → add_out_aaa(b, b, b)
add_in_aaa(X, b, X) → U1_aaa(X, binaryZ_in_a(X))
binaryZ_in_a(zero(X)) → U29_a(X, binaryZ_in_a(X))
binaryZ_in_a(one(X)) → U30_a(X, binary_in_a(X))
binary_in_a(b) → binary_out_a(b)
binary_in_a(zero(X)) → U27_a(X, binaryZ_in_a(X))
U27_a(X, binaryZ_out_a(X)) → binary_out_a(zero(X))
binary_in_a(one(X)) → U28_a(X, binary_in_a(X))
U28_a(X, binary_out_a(X)) → binary_out_a(one(X))
U30_a(X, binary_out_a(X)) → binaryZ_out_a(one(X))
U29_a(X, binaryZ_out_a(X)) → binaryZ_out_a(zero(X))
U1_aaa(X, binaryZ_out_a(X)) → add_out_aaa(X, b, X)
add_in_aaa(b, Y, Y) → U2_aaa(Y, binaryZ_in_a(Y))
U2_aaa(Y, binaryZ_out_a(Y)) → add_out_aaa(b, Y, Y)
add_in_aaa(X, Y, Z) → U3_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), zero(Y), zero(Z)) → U10_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), one(Y), one(Z)) → U11_aaa(X, Y, Z, addx_in_aaa(X, Y, Z))
addx_in_aaa(one(X), b, one(X)) → U4_aaa(X, binary_in_a(X))
U4_aaa(X, binary_out_a(X)) → addx_out_aaa(one(X), b, one(X))
addx_in_aaa(zero(X), b, zero(X)) → U5_aaa(X, binaryZ_in_a(X))
U5_aaa(X, binaryZ_out_a(X)) → addx_out_aaa(zero(X), b, zero(X))
addx_in_aaa(X, Y, Z) → U6_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), zero(Y), one(Z)) → U12_aaa(X, Y, Z, addy_in_aaa(X, Y, Z))
addy_in_aaa(b, one(Y), one(Y)) → U7_aaa(Y, binary_in_a(Y))
U7_aaa(Y, binary_out_a(Y)) → addy_out_aaa(b, one(Y), one(Y))
addy_in_aaa(b, zero(Y), zero(Y)) → U8_aaa(Y, binaryZ_in_a(Y))
U8_aaa(Y, binaryZ_out_a(Y)) → addy_out_aaa(b, zero(Y), zero(Y))
addy_in_aaa(X, Y, Z) → U9_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), one(Y), zero(Z)) → U13_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
addc_in_aaa(b, b, one(b)) → addc_out_aaa(b, b, one(b))
addc_in_aaa(X, b, Z) → U14_aaa(X, Z, succZ_in_aa(X, Z))
succZ_in_aa(zero(X), one(X)) → U33_aa(X, binaryZ_in_a(X))
U33_aa(X, binaryZ_out_a(X)) → succZ_out_aa(zero(X), one(X))
succZ_in_aa(one(X), zero(Z)) → U34_aa(X, Z, succ_in_aa(X, Z))
succ_in_aa(b, one(b)) → succ_out_aa(b, one(b))
succ_in_aa(zero(X), one(X)) → U31_aa(X, binaryZ_in_a(X))
U31_aa(X, binaryZ_out_a(X)) → succ_out_aa(zero(X), one(X))
succ_in_aa(one(X), zero(Z)) → U32_aa(X, Z, succ_in_aa(X, Z))
U32_aa(X, Z, succ_out_aa(X, Z)) → succ_out_aa(one(X), zero(Z))
U34_aa(X, Z, succ_out_aa(X, Z)) → succZ_out_aa(one(X), zero(Z))
U14_aaa(X, Z, succZ_out_aa(X, Z)) → addc_out_aaa(X, b, Z)
addc_in_aaa(b, Y, Z) → U15_aaa(Y, Z, succZ_in_aa(Y, Z))
U15_aaa(Y, Z, succZ_out_aa(Y, Z)) → addc_out_aaa(b, Y, Z)
addc_in_aaa(X, Y, Z) → U16_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(zero(X), zero(Y), one(Z)) → U23_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
U23_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), zero(Y), one(Z))
addC_in_aaa(zero(X), one(Y), zero(Z)) → U24_aaa(X, Y, Z, addX_in_aaa(X, Y, Z))
addX_in_aaa(zero(X), b, one(X)) → U17_aaa(X, binaryZ_in_a(X))
U17_aaa(X, binaryZ_out_a(X)) → addX_out_aaa(zero(X), b, one(X))
addX_in_aaa(one(X), b, zero(Z)) → U18_aaa(X, Z, succ_in_aa(X, Z))
U18_aaa(X, Z, succ_out_aa(X, Z)) → addX_out_aaa(one(X), b, zero(Z))
addX_in_aaa(X, Y, Z) → U19_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), zero(Y), zero(Z)) → U25_aaa(X, Y, Z, addY_in_aaa(X, Y, Z))
addY_in_aaa(b, zero(Y), one(Y)) → U20_aaa(Y, binaryZ_in_a(Y))
U20_aaa(Y, binaryZ_out_a(Y)) → addY_out_aaa(b, zero(Y), one(Y))
addY_in_aaa(b, one(Y), zero(Z)) → U21_aaa(Y, Z, succ_in_aa(Y, Z))
U21_aaa(Y, Z, succ_out_aa(Y, Z)) → addY_out_aaa(b, one(Y), zero(Z))
addY_in_aaa(X, Y, Z) → U22_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), one(Y), one(Z)) → U26_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
U26_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), one(Y), one(Z))
U22_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addY_out_aaa(X, Y, Z)
U25_aaa(X, Y, Z, addY_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), zero(Y), zero(Z))
U19_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addX_out_aaa(X, Y, Z)
U24_aaa(X, Y, Z, addX_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), one(Y), zero(Z))
U16_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addc_out_aaa(X, Y, Z)
U13_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), one(Y), zero(Z))
U9_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addy_out_aaa(X, Y, Z)
U12_aaa(X, Y, Z, addy_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), zero(Y), one(Z))
U6_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addx_out_aaa(X, Y, Z)
U11_aaa(X, Y, Z, addx_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), one(Y), one(Z))
U10_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), zero(Y), zero(Z))
U3_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → add_out_aaa(X, Y, Z)
U37_aaa(R, S, RSS, add_out_aaa(S, zero(RS), RSS)) → times_out_aaa(one(R), S, RSS)
U35_aaa(R, S, RS, times_out_aaa(R, S, RS)) → times_out_aaa(zero(R), S, zero(RS))
U36_aag(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aag(R, S, RSS, add_in_aag(S, zero(RS), RSS))
add_in_aag(b, b, b) → add_out_aag(b, b, b)
add_in_aag(X, b, X) → U1_aag(X, binaryZ_in_g(X))
binaryZ_in_g(zero(X)) → U29_g(X, binaryZ_in_g(X))
binaryZ_in_g(one(X)) → U30_g(X, binary_in_g(X))
binary_in_g(b) → binary_out_g(b)
binary_in_g(zero(X)) → U27_g(X, binaryZ_in_g(X))
U27_g(X, binaryZ_out_g(X)) → binary_out_g(zero(X))
binary_in_g(one(X)) → U28_g(X, binary_in_g(X))
U28_g(X, binary_out_g(X)) → binary_out_g(one(X))
U30_g(X, binary_out_g(X)) → binaryZ_out_g(one(X))
U29_g(X, binaryZ_out_g(X)) → binaryZ_out_g(zero(X))
U1_aag(X, binaryZ_out_g(X)) → add_out_aag(X, b, X)
add_in_aag(b, Y, Y) → U2_aag(Y, binaryZ_in_g(Y))
U2_aag(Y, binaryZ_out_g(Y)) → add_out_aag(b, Y, Y)
add_in_aag(X, Y, Z) → U3_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), zero(Y), zero(Z)) → U10_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), one(Y), one(Z)) → U11_aag(X, Y, Z, addx_in_aag(X, Y, Z))
addx_in_aag(one(X), b, one(X)) → U4_aag(X, binary_in_g(X))
U4_aag(X, binary_out_g(X)) → addx_out_aag(one(X), b, one(X))
addx_in_aag(zero(X), b, zero(X)) → U5_aag(X, binaryZ_in_g(X))
U5_aag(X, binaryZ_out_g(X)) → addx_out_aag(zero(X), b, zero(X))
addx_in_aag(X, Y, Z) → U6_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), zero(Y), one(Z)) → U12_aag(X, Y, Z, addy_in_aag(X, Y, Z))
addy_in_aag(b, one(Y), one(Y)) → U7_aag(Y, binary_in_g(Y))
U7_aag(Y, binary_out_g(Y)) → addy_out_aag(b, one(Y), one(Y))
addy_in_aag(b, zero(Y), zero(Y)) → U8_aag(Y, binaryZ_in_g(Y))
U8_aag(Y, binaryZ_out_g(Y)) → addy_out_aag(b, zero(Y), zero(Y))
addy_in_aag(X, Y, Z) → U9_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), one(Y), zero(Z)) → U13_aag(X, Y, Z, addc_in_aag(X, Y, Z))
addc_in_aag(b, b, one(b)) → addc_out_aag(b, b, one(b))
addc_in_aag(X, b, Z) → U14_aag(X, Z, succZ_in_ag(X, Z))
succZ_in_ag(zero(X), one(X)) → U33_ag(X, binaryZ_in_g(X))
U33_ag(X, binaryZ_out_g(X)) → succZ_out_ag(zero(X), one(X))
succZ_in_ag(one(X), zero(Z)) → U34_ag(X, Z, succ_in_ag(X, Z))
succ_in_ag(b, one(b)) → succ_out_ag(b, one(b))
succ_in_ag(zero(X), one(X)) → U31_ag(X, binaryZ_in_g(X))
U31_ag(X, binaryZ_out_g(X)) → succ_out_ag(zero(X), one(X))
succ_in_ag(one(X), zero(Z)) → U32_ag(X, Z, succ_in_ag(X, Z))
U32_ag(X, Z, succ_out_ag(X, Z)) → succ_out_ag(one(X), zero(Z))
U34_ag(X, Z, succ_out_ag(X, Z)) → succZ_out_ag(one(X), zero(Z))
U14_aag(X, Z, succZ_out_ag(X, Z)) → addc_out_aag(X, b, Z)
addc_in_aag(b, Y, Z) → U15_aag(Y, Z, succZ_in_ag(Y, Z))
U15_aag(Y, Z, succZ_out_ag(Y, Z)) → addc_out_aag(b, Y, Z)
addc_in_aag(X, Y, Z) → U16_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(zero(X), zero(Y), one(Z)) → U23_aag(X, Y, Z, addz_in_aag(X, Y, Z))
U23_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addC_out_aag(zero(X), zero(Y), one(Z))
addC_in_aag(zero(X), one(Y), zero(Z)) → U24_aag(X, Y, Z, addX_in_aag(X, Y, Z))
addX_in_aag(zero(X), b, one(X)) → U17_aag(X, binaryZ_in_g(X))
U17_aag(X, binaryZ_out_g(X)) → addX_out_aag(zero(X), b, one(X))
addX_in_aag(one(X), b, zero(Z)) → U18_aag(X, Z, succ_in_ag(X, Z))
U18_aag(X, Z, succ_out_ag(X, Z)) → addX_out_aag(one(X), b, zero(Z))
addX_in_aag(X, Y, Z) → U19_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), zero(Y), zero(Z)) → U25_aag(X, Y, Z, addY_in_aag(X, Y, Z))
addY_in_aag(b, zero(Y), one(Y)) → U20_aag(Y, binaryZ_in_g(Y))
U20_aag(Y, binaryZ_out_g(Y)) → addY_out_aag(b, zero(Y), one(Y))
addY_in_aag(b, one(Y), zero(Z)) → U21_aag(Y, Z, succ_in_ag(Y, Z))
U21_aag(Y, Z, succ_out_ag(Y, Z)) → addY_out_aag(b, one(Y), zero(Z))
addY_in_aag(X, Y, Z) → U22_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), one(Y), one(Z)) → U26_aag(X, Y, Z, addc_in_aag(X, Y, Z))
U26_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addC_out_aag(one(X), one(Y), one(Z))
U22_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addY_out_aag(X, Y, Z)
U25_aag(X, Y, Z, addY_out_aag(X, Y, Z)) → addC_out_aag(one(X), zero(Y), zero(Z))
U19_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addX_out_aag(X, Y, Z)
U24_aag(X, Y, Z, addX_out_aag(X, Y, Z)) → addC_out_aag(zero(X), one(Y), zero(Z))
U16_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addc_out_aag(X, Y, Z)
U13_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addz_out_aag(one(X), one(Y), zero(Z))
U9_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addy_out_aag(X, Y, Z)
U12_aag(X, Y, Z, addy_out_aag(X, Y, Z)) → addz_out_aag(one(X), zero(Y), one(Z))
U6_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addx_out_aag(X, Y, Z)
U11_aag(X, Y, Z, addx_out_aag(X, Y, Z)) → addz_out_aag(zero(X), one(Y), one(Z))
U10_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addz_out_aag(zero(X), zero(Y), zero(Z))
U3_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → add_out_aag(X, Y, Z)
U37_aag(R, S, RSS, add_out_aag(S, zero(RS), RSS)) → times_out_aag(one(R), S, RSS)
U35_aag(R, S, RS, times_out_aag(R, S, RS)) → times_out_aag(zero(R), S, zero(RS))
BINARYZ_IN_A(one(X)) → BINARY_IN_A(X)
BINARY_IN_A(zero(X)) → BINARYZ_IN_A(X)
BINARYZ_IN_A(zero(X)) → BINARYZ_IN_A(X)
BINARY_IN_A(one(X)) → BINARY_IN_A(X)
BINARYZ_IN_A → BINARY_IN_A
BINARY_IN_A → BINARYZ_IN_A
BINARYZ_IN_A → BINARYZ_IN_A
BINARY_IN_A → BINARY_IN_A
SUCC_IN_AA(one(X), zero(Z)) → SUCC_IN_AA(X, Z)
times_in_aag(one(b), X, X) → times_out_aag(one(b), X, X)
times_in_aag(zero(R), S, zero(RS)) → U35_aag(R, S, RS, times_in_aag(R, S, RS))
times_in_aag(one(R), S, RSS) → U36_aag(R, S, RSS, times_in_aaa(R, S, RS))
times_in_aaa(one(b), X, X) → times_out_aaa(one(b), X, X)
times_in_aaa(zero(R), S, zero(RS)) → U35_aaa(R, S, RS, times_in_aaa(R, S, RS))
times_in_aaa(one(R), S, RSS) → U36_aaa(R, S, RSS, times_in_aaa(R, S, RS))
U36_aaa(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aaa(R, S, RSS, add_in_aaa(S, zero(RS), RSS))
add_in_aaa(b, b, b) → add_out_aaa(b, b, b)
add_in_aaa(X, b, X) → U1_aaa(X, binaryZ_in_a(X))
binaryZ_in_a(zero(X)) → U29_a(X, binaryZ_in_a(X))
binaryZ_in_a(one(X)) → U30_a(X, binary_in_a(X))
binary_in_a(b) → binary_out_a(b)
binary_in_a(zero(X)) → U27_a(X, binaryZ_in_a(X))
U27_a(X, binaryZ_out_a(X)) → binary_out_a(zero(X))
binary_in_a(one(X)) → U28_a(X, binary_in_a(X))
U28_a(X, binary_out_a(X)) → binary_out_a(one(X))
U30_a(X, binary_out_a(X)) → binaryZ_out_a(one(X))
U29_a(X, binaryZ_out_a(X)) → binaryZ_out_a(zero(X))
U1_aaa(X, binaryZ_out_a(X)) → add_out_aaa(X, b, X)
add_in_aaa(b, Y, Y) → U2_aaa(Y, binaryZ_in_a(Y))
U2_aaa(Y, binaryZ_out_a(Y)) → add_out_aaa(b, Y, Y)
add_in_aaa(X, Y, Z) → U3_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), zero(Y), zero(Z)) → U10_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), one(Y), one(Z)) → U11_aaa(X, Y, Z, addx_in_aaa(X, Y, Z))
addx_in_aaa(one(X), b, one(X)) → U4_aaa(X, binary_in_a(X))
U4_aaa(X, binary_out_a(X)) → addx_out_aaa(one(X), b, one(X))
addx_in_aaa(zero(X), b, zero(X)) → U5_aaa(X, binaryZ_in_a(X))
U5_aaa(X, binaryZ_out_a(X)) → addx_out_aaa(zero(X), b, zero(X))
addx_in_aaa(X, Y, Z) → U6_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), zero(Y), one(Z)) → U12_aaa(X, Y, Z, addy_in_aaa(X, Y, Z))
addy_in_aaa(b, one(Y), one(Y)) → U7_aaa(Y, binary_in_a(Y))
U7_aaa(Y, binary_out_a(Y)) → addy_out_aaa(b, one(Y), one(Y))
addy_in_aaa(b, zero(Y), zero(Y)) → U8_aaa(Y, binaryZ_in_a(Y))
U8_aaa(Y, binaryZ_out_a(Y)) → addy_out_aaa(b, zero(Y), zero(Y))
addy_in_aaa(X, Y, Z) → U9_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), one(Y), zero(Z)) → U13_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
addc_in_aaa(b, b, one(b)) → addc_out_aaa(b, b, one(b))
addc_in_aaa(X, b, Z) → U14_aaa(X, Z, succZ_in_aa(X, Z))
succZ_in_aa(zero(X), one(X)) → U33_aa(X, binaryZ_in_a(X))
U33_aa(X, binaryZ_out_a(X)) → succZ_out_aa(zero(X), one(X))
succZ_in_aa(one(X), zero(Z)) → U34_aa(X, Z, succ_in_aa(X, Z))
succ_in_aa(b, one(b)) → succ_out_aa(b, one(b))
succ_in_aa(zero(X), one(X)) → U31_aa(X, binaryZ_in_a(X))
U31_aa(X, binaryZ_out_a(X)) → succ_out_aa(zero(X), one(X))
succ_in_aa(one(X), zero(Z)) → U32_aa(X, Z, succ_in_aa(X, Z))
U32_aa(X, Z, succ_out_aa(X, Z)) → succ_out_aa(one(X), zero(Z))
U34_aa(X, Z, succ_out_aa(X, Z)) → succZ_out_aa(one(X), zero(Z))
U14_aaa(X, Z, succZ_out_aa(X, Z)) → addc_out_aaa(X, b, Z)
addc_in_aaa(b, Y, Z) → U15_aaa(Y, Z, succZ_in_aa(Y, Z))
U15_aaa(Y, Z, succZ_out_aa(Y, Z)) → addc_out_aaa(b, Y, Z)
addc_in_aaa(X, Y, Z) → U16_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(zero(X), zero(Y), one(Z)) → U23_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
U23_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), zero(Y), one(Z))
addC_in_aaa(zero(X), one(Y), zero(Z)) → U24_aaa(X, Y, Z, addX_in_aaa(X, Y, Z))
addX_in_aaa(zero(X), b, one(X)) → U17_aaa(X, binaryZ_in_a(X))
U17_aaa(X, binaryZ_out_a(X)) → addX_out_aaa(zero(X), b, one(X))
addX_in_aaa(one(X), b, zero(Z)) → U18_aaa(X, Z, succ_in_aa(X, Z))
U18_aaa(X, Z, succ_out_aa(X, Z)) → addX_out_aaa(one(X), b, zero(Z))
addX_in_aaa(X, Y, Z) → U19_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), zero(Y), zero(Z)) → U25_aaa(X, Y, Z, addY_in_aaa(X, Y, Z))
addY_in_aaa(b, zero(Y), one(Y)) → U20_aaa(Y, binaryZ_in_a(Y))
U20_aaa(Y, binaryZ_out_a(Y)) → addY_out_aaa(b, zero(Y), one(Y))
addY_in_aaa(b, one(Y), zero(Z)) → U21_aaa(Y, Z, succ_in_aa(Y, Z))
U21_aaa(Y, Z, succ_out_aa(Y, Z)) → addY_out_aaa(b, one(Y), zero(Z))
addY_in_aaa(X, Y, Z) → U22_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), one(Y), one(Z)) → U26_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
U26_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), one(Y), one(Z))
U22_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addY_out_aaa(X, Y, Z)
U25_aaa(X, Y, Z, addY_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), zero(Y), zero(Z))
U19_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addX_out_aaa(X, Y, Z)
U24_aaa(X, Y, Z, addX_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), one(Y), zero(Z))
U16_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addc_out_aaa(X, Y, Z)
U13_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), one(Y), zero(Z))
U9_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addy_out_aaa(X, Y, Z)
U12_aaa(X, Y, Z, addy_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), zero(Y), one(Z))
U6_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addx_out_aaa(X, Y, Z)
U11_aaa(X, Y, Z, addx_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), one(Y), one(Z))
U10_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), zero(Y), zero(Z))
U3_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → add_out_aaa(X, Y, Z)
U37_aaa(R, S, RSS, add_out_aaa(S, zero(RS), RSS)) → times_out_aaa(one(R), S, RSS)
U35_aaa(R, S, RS, times_out_aaa(R, S, RS)) → times_out_aaa(zero(R), S, zero(RS))
U36_aag(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aag(R, S, RSS, add_in_aag(S, zero(RS), RSS))
add_in_aag(b, b, b) → add_out_aag(b, b, b)
add_in_aag(X, b, X) → U1_aag(X, binaryZ_in_g(X))
binaryZ_in_g(zero(X)) → U29_g(X, binaryZ_in_g(X))
binaryZ_in_g(one(X)) → U30_g(X, binary_in_g(X))
binary_in_g(b) → binary_out_g(b)
binary_in_g(zero(X)) → U27_g(X, binaryZ_in_g(X))
U27_g(X, binaryZ_out_g(X)) → binary_out_g(zero(X))
binary_in_g(one(X)) → U28_g(X, binary_in_g(X))
U28_g(X, binary_out_g(X)) → binary_out_g(one(X))
U30_g(X, binary_out_g(X)) → binaryZ_out_g(one(X))
U29_g(X, binaryZ_out_g(X)) → binaryZ_out_g(zero(X))
U1_aag(X, binaryZ_out_g(X)) → add_out_aag(X, b, X)
add_in_aag(b, Y, Y) → U2_aag(Y, binaryZ_in_g(Y))
U2_aag(Y, binaryZ_out_g(Y)) → add_out_aag(b, Y, Y)
add_in_aag(X, Y, Z) → U3_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), zero(Y), zero(Z)) → U10_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), one(Y), one(Z)) → U11_aag(X, Y, Z, addx_in_aag(X, Y, Z))
addx_in_aag(one(X), b, one(X)) → U4_aag(X, binary_in_g(X))
U4_aag(X, binary_out_g(X)) → addx_out_aag(one(X), b, one(X))
addx_in_aag(zero(X), b, zero(X)) → U5_aag(X, binaryZ_in_g(X))
U5_aag(X, binaryZ_out_g(X)) → addx_out_aag(zero(X), b, zero(X))
addx_in_aag(X, Y, Z) → U6_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), zero(Y), one(Z)) → U12_aag(X, Y, Z, addy_in_aag(X, Y, Z))
addy_in_aag(b, one(Y), one(Y)) → U7_aag(Y, binary_in_g(Y))
U7_aag(Y, binary_out_g(Y)) → addy_out_aag(b, one(Y), one(Y))
addy_in_aag(b, zero(Y), zero(Y)) → U8_aag(Y, binaryZ_in_g(Y))
U8_aag(Y, binaryZ_out_g(Y)) → addy_out_aag(b, zero(Y), zero(Y))
addy_in_aag(X, Y, Z) → U9_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), one(Y), zero(Z)) → U13_aag(X, Y, Z, addc_in_aag(X, Y, Z))
addc_in_aag(b, b, one(b)) → addc_out_aag(b, b, one(b))
addc_in_aag(X, b, Z) → U14_aag(X, Z, succZ_in_ag(X, Z))
succZ_in_ag(zero(X), one(X)) → U33_ag(X, binaryZ_in_g(X))
U33_ag(X, binaryZ_out_g(X)) → succZ_out_ag(zero(X), one(X))
succZ_in_ag(one(X), zero(Z)) → U34_ag(X, Z, succ_in_ag(X, Z))
succ_in_ag(b, one(b)) → succ_out_ag(b, one(b))
succ_in_ag(zero(X), one(X)) → U31_ag(X, binaryZ_in_g(X))
U31_ag(X, binaryZ_out_g(X)) → succ_out_ag(zero(X), one(X))
succ_in_ag(one(X), zero(Z)) → U32_ag(X, Z, succ_in_ag(X, Z))
U32_ag(X, Z, succ_out_ag(X, Z)) → succ_out_ag(one(X), zero(Z))
U34_ag(X, Z, succ_out_ag(X, Z)) → succZ_out_ag(one(X), zero(Z))
U14_aag(X, Z, succZ_out_ag(X, Z)) → addc_out_aag(X, b, Z)
addc_in_aag(b, Y, Z) → U15_aag(Y, Z, succZ_in_ag(Y, Z))
U15_aag(Y, Z, succZ_out_ag(Y, Z)) → addc_out_aag(b, Y, Z)
addc_in_aag(X, Y, Z) → U16_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(zero(X), zero(Y), one(Z)) → U23_aag(X, Y, Z, addz_in_aag(X, Y, Z))
U23_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addC_out_aag(zero(X), zero(Y), one(Z))
addC_in_aag(zero(X), one(Y), zero(Z)) → U24_aag(X, Y, Z, addX_in_aag(X, Y, Z))
addX_in_aag(zero(X), b, one(X)) → U17_aag(X, binaryZ_in_g(X))
U17_aag(X, binaryZ_out_g(X)) → addX_out_aag(zero(X), b, one(X))
addX_in_aag(one(X), b, zero(Z)) → U18_aag(X, Z, succ_in_ag(X, Z))
U18_aag(X, Z, succ_out_ag(X, Z)) → addX_out_aag(one(X), b, zero(Z))
addX_in_aag(X, Y, Z) → U19_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), zero(Y), zero(Z)) → U25_aag(X, Y, Z, addY_in_aag(X, Y, Z))
addY_in_aag(b, zero(Y), one(Y)) → U20_aag(Y, binaryZ_in_g(Y))
U20_aag(Y, binaryZ_out_g(Y)) → addY_out_aag(b, zero(Y), one(Y))
addY_in_aag(b, one(Y), zero(Z)) → U21_aag(Y, Z, succ_in_ag(Y, Z))
U21_aag(Y, Z, succ_out_ag(Y, Z)) → addY_out_aag(b, one(Y), zero(Z))
addY_in_aag(X, Y, Z) → U22_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), one(Y), one(Z)) → U26_aag(X, Y, Z, addc_in_aag(X, Y, Z))
U26_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addC_out_aag(one(X), one(Y), one(Z))
U22_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addY_out_aag(X, Y, Z)
U25_aag(X, Y, Z, addY_out_aag(X, Y, Z)) → addC_out_aag(one(X), zero(Y), zero(Z))
U19_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addX_out_aag(X, Y, Z)
U24_aag(X, Y, Z, addX_out_aag(X, Y, Z)) → addC_out_aag(zero(X), one(Y), zero(Z))
U16_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addc_out_aag(X, Y, Z)
U13_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addz_out_aag(one(X), one(Y), zero(Z))
U9_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addy_out_aag(X, Y, Z)
U12_aag(X, Y, Z, addy_out_aag(X, Y, Z)) → addz_out_aag(one(X), zero(Y), one(Z))
U6_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addx_out_aag(X, Y, Z)
U11_aag(X, Y, Z, addx_out_aag(X, Y, Z)) → addz_out_aag(zero(X), one(Y), one(Z))
U10_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addz_out_aag(zero(X), zero(Y), zero(Z))
U3_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → add_out_aag(X, Y, Z)
U37_aag(R, S, RSS, add_out_aag(S, zero(RS), RSS)) → times_out_aag(one(R), S, RSS)
U35_aag(R, S, RS, times_out_aag(R, S, RS)) → times_out_aag(zero(R), S, zero(RS))
SUCC_IN_AA(one(X), zero(Z)) → SUCC_IN_AA(X, Z)
SUCC_IN_AA → SUCC_IN_AA
ADDX_IN_AAA(X, Y, Z) → ADDZ_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(zero(X), zero(Y), zero(Z)) → ADDZ_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(zero(X), one(Y), one(Z)) → ADDX_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(one(X), zero(Y), one(Z)) → ADDY_IN_AAA(X, Y, Z)
ADDY_IN_AAA(X, Y, Z) → ADDZ_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(one(X), one(Y), zero(Z)) → ADDC_IN_AAA(X, Y, Z)
ADDC_IN_AAA(X, Y, Z) → ADDC_IN_AAA1(X, Y, Z)
ADDC_IN_AAA1(zero(X), zero(Y), one(Z)) → ADDZ_IN_AAA(X, Y, Z)
ADDC_IN_AAA1(zero(X), one(Y), zero(Z)) → ADDX_IN_AAA1(X, Y, Z)
ADDX_IN_AAA1(X, Y, Z) → ADDC_IN_AAA1(X, Y, Z)
ADDC_IN_AAA1(one(X), zero(Y), zero(Z)) → ADDY_IN_AAA1(X, Y, Z)
ADDY_IN_AAA1(X, Y, Z) → ADDC_IN_AAA1(X, Y, Z)
ADDC_IN_AAA1(one(X), one(Y), one(Z)) → ADDC_IN_AAA(X, Y, Z)
times_in_aag(one(b), X, X) → times_out_aag(one(b), X, X)
times_in_aag(zero(R), S, zero(RS)) → U35_aag(R, S, RS, times_in_aag(R, S, RS))
times_in_aag(one(R), S, RSS) → U36_aag(R, S, RSS, times_in_aaa(R, S, RS))
times_in_aaa(one(b), X, X) → times_out_aaa(one(b), X, X)
times_in_aaa(zero(R), S, zero(RS)) → U35_aaa(R, S, RS, times_in_aaa(R, S, RS))
times_in_aaa(one(R), S, RSS) → U36_aaa(R, S, RSS, times_in_aaa(R, S, RS))
U36_aaa(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aaa(R, S, RSS, add_in_aaa(S, zero(RS), RSS))
add_in_aaa(b, b, b) → add_out_aaa(b, b, b)
add_in_aaa(X, b, X) → U1_aaa(X, binaryZ_in_a(X))
binaryZ_in_a(zero(X)) → U29_a(X, binaryZ_in_a(X))
binaryZ_in_a(one(X)) → U30_a(X, binary_in_a(X))
binary_in_a(b) → binary_out_a(b)
binary_in_a(zero(X)) → U27_a(X, binaryZ_in_a(X))
U27_a(X, binaryZ_out_a(X)) → binary_out_a(zero(X))
binary_in_a(one(X)) → U28_a(X, binary_in_a(X))
U28_a(X, binary_out_a(X)) → binary_out_a(one(X))
U30_a(X, binary_out_a(X)) → binaryZ_out_a(one(X))
U29_a(X, binaryZ_out_a(X)) → binaryZ_out_a(zero(X))
U1_aaa(X, binaryZ_out_a(X)) → add_out_aaa(X, b, X)
add_in_aaa(b, Y, Y) → U2_aaa(Y, binaryZ_in_a(Y))
U2_aaa(Y, binaryZ_out_a(Y)) → add_out_aaa(b, Y, Y)
add_in_aaa(X, Y, Z) → U3_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), zero(Y), zero(Z)) → U10_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), one(Y), one(Z)) → U11_aaa(X, Y, Z, addx_in_aaa(X, Y, Z))
addx_in_aaa(one(X), b, one(X)) → U4_aaa(X, binary_in_a(X))
U4_aaa(X, binary_out_a(X)) → addx_out_aaa(one(X), b, one(X))
addx_in_aaa(zero(X), b, zero(X)) → U5_aaa(X, binaryZ_in_a(X))
U5_aaa(X, binaryZ_out_a(X)) → addx_out_aaa(zero(X), b, zero(X))
addx_in_aaa(X, Y, Z) → U6_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), zero(Y), one(Z)) → U12_aaa(X, Y, Z, addy_in_aaa(X, Y, Z))
addy_in_aaa(b, one(Y), one(Y)) → U7_aaa(Y, binary_in_a(Y))
U7_aaa(Y, binary_out_a(Y)) → addy_out_aaa(b, one(Y), one(Y))
addy_in_aaa(b, zero(Y), zero(Y)) → U8_aaa(Y, binaryZ_in_a(Y))
U8_aaa(Y, binaryZ_out_a(Y)) → addy_out_aaa(b, zero(Y), zero(Y))
addy_in_aaa(X, Y, Z) → U9_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), one(Y), zero(Z)) → U13_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
addc_in_aaa(b, b, one(b)) → addc_out_aaa(b, b, one(b))
addc_in_aaa(X, b, Z) → U14_aaa(X, Z, succZ_in_aa(X, Z))
succZ_in_aa(zero(X), one(X)) → U33_aa(X, binaryZ_in_a(X))
U33_aa(X, binaryZ_out_a(X)) → succZ_out_aa(zero(X), one(X))
succZ_in_aa(one(X), zero(Z)) → U34_aa(X, Z, succ_in_aa(X, Z))
succ_in_aa(b, one(b)) → succ_out_aa(b, one(b))
succ_in_aa(zero(X), one(X)) → U31_aa(X, binaryZ_in_a(X))
U31_aa(X, binaryZ_out_a(X)) → succ_out_aa(zero(X), one(X))
succ_in_aa(one(X), zero(Z)) → U32_aa(X, Z, succ_in_aa(X, Z))
U32_aa(X, Z, succ_out_aa(X, Z)) → succ_out_aa(one(X), zero(Z))
U34_aa(X, Z, succ_out_aa(X, Z)) → succZ_out_aa(one(X), zero(Z))
U14_aaa(X, Z, succZ_out_aa(X, Z)) → addc_out_aaa(X, b, Z)
addc_in_aaa(b, Y, Z) → U15_aaa(Y, Z, succZ_in_aa(Y, Z))
U15_aaa(Y, Z, succZ_out_aa(Y, Z)) → addc_out_aaa(b, Y, Z)
addc_in_aaa(X, Y, Z) → U16_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(zero(X), zero(Y), one(Z)) → U23_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
U23_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), zero(Y), one(Z))
addC_in_aaa(zero(X), one(Y), zero(Z)) → U24_aaa(X, Y, Z, addX_in_aaa(X, Y, Z))
addX_in_aaa(zero(X), b, one(X)) → U17_aaa(X, binaryZ_in_a(X))
U17_aaa(X, binaryZ_out_a(X)) → addX_out_aaa(zero(X), b, one(X))
addX_in_aaa(one(X), b, zero(Z)) → U18_aaa(X, Z, succ_in_aa(X, Z))
U18_aaa(X, Z, succ_out_aa(X, Z)) → addX_out_aaa(one(X), b, zero(Z))
addX_in_aaa(X, Y, Z) → U19_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), zero(Y), zero(Z)) → U25_aaa(X, Y, Z, addY_in_aaa(X, Y, Z))
addY_in_aaa(b, zero(Y), one(Y)) → U20_aaa(Y, binaryZ_in_a(Y))
U20_aaa(Y, binaryZ_out_a(Y)) → addY_out_aaa(b, zero(Y), one(Y))
addY_in_aaa(b, one(Y), zero(Z)) → U21_aaa(Y, Z, succ_in_aa(Y, Z))
U21_aaa(Y, Z, succ_out_aa(Y, Z)) → addY_out_aaa(b, one(Y), zero(Z))
addY_in_aaa(X, Y, Z) → U22_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), one(Y), one(Z)) → U26_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
U26_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), one(Y), one(Z))
U22_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addY_out_aaa(X, Y, Z)
U25_aaa(X, Y, Z, addY_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), zero(Y), zero(Z))
U19_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addX_out_aaa(X, Y, Z)
U24_aaa(X, Y, Z, addX_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), one(Y), zero(Z))
U16_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addc_out_aaa(X, Y, Z)
U13_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), one(Y), zero(Z))
U9_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addy_out_aaa(X, Y, Z)
U12_aaa(X, Y, Z, addy_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), zero(Y), one(Z))
U6_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addx_out_aaa(X, Y, Z)
U11_aaa(X, Y, Z, addx_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), one(Y), one(Z))
U10_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), zero(Y), zero(Z))
U3_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → add_out_aaa(X, Y, Z)
U37_aaa(R, S, RSS, add_out_aaa(S, zero(RS), RSS)) → times_out_aaa(one(R), S, RSS)
U35_aaa(R, S, RS, times_out_aaa(R, S, RS)) → times_out_aaa(zero(R), S, zero(RS))
U36_aag(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aag(R, S, RSS, add_in_aag(S, zero(RS), RSS))
add_in_aag(b, b, b) → add_out_aag(b, b, b)
add_in_aag(X, b, X) → U1_aag(X, binaryZ_in_g(X))
binaryZ_in_g(zero(X)) → U29_g(X, binaryZ_in_g(X))
binaryZ_in_g(one(X)) → U30_g(X, binary_in_g(X))
binary_in_g(b) → binary_out_g(b)
binary_in_g(zero(X)) → U27_g(X, binaryZ_in_g(X))
U27_g(X, binaryZ_out_g(X)) → binary_out_g(zero(X))
binary_in_g(one(X)) → U28_g(X, binary_in_g(X))
U28_g(X, binary_out_g(X)) → binary_out_g(one(X))
U30_g(X, binary_out_g(X)) → binaryZ_out_g(one(X))
U29_g(X, binaryZ_out_g(X)) → binaryZ_out_g(zero(X))
U1_aag(X, binaryZ_out_g(X)) → add_out_aag(X, b, X)
add_in_aag(b, Y, Y) → U2_aag(Y, binaryZ_in_g(Y))
U2_aag(Y, binaryZ_out_g(Y)) → add_out_aag(b, Y, Y)
add_in_aag(X, Y, Z) → U3_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), zero(Y), zero(Z)) → U10_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), one(Y), one(Z)) → U11_aag(X, Y, Z, addx_in_aag(X, Y, Z))
addx_in_aag(one(X), b, one(X)) → U4_aag(X, binary_in_g(X))
U4_aag(X, binary_out_g(X)) → addx_out_aag(one(X), b, one(X))
addx_in_aag(zero(X), b, zero(X)) → U5_aag(X, binaryZ_in_g(X))
U5_aag(X, binaryZ_out_g(X)) → addx_out_aag(zero(X), b, zero(X))
addx_in_aag(X, Y, Z) → U6_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), zero(Y), one(Z)) → U12_aag(X, Y, Z, addy_in_aag(X, Y, Z))
addy_in_aag(b, one(Y), one(Y)) → U7_aag(Y, binary_in_g(Y))
U7_aag(Y, binary_out_g(Y)) → addy_out_aag(b, one(Y), one(Y))
addy_in_aag(b, zero(Y), zero(Y)) → U8_aag(Y, binaryZ_in_g(Y))
U8_aag(Y, binaryZ_out_g(Y)) → addy_out_aag(b, zero(Y), zero(Y))
addy_in_aag(X, Y, Z) → U9_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), one(Y), zero(Z)) → U13_aag(X, Y, Z, addc_in_aag(X, Y, Z))
addc_in_aag(b, b, one(b)) → addc_out_aag(b, b, one(b))
addc_in_aag(X, b, Z) → U14_aag(X, Z, succZ_in_ag(X, Z))
succZ_in_ag(zero(X), one(X)) → U33_ag(X, binaryZ_in_g(X))
U33_ag(X, binaryZ_out_g(X)) → succZ_out_ag(zero(X), one(X))
succZ_in_ag(one(X), zero(Z)) → U34_ag(X, Z, succ_in_ag(X, Z))
succ_in_ag(b, one(b)) → succ_out_ag(b, one(b))
succ_in_ag(zero(X), one(X)) → U31_ag(X, binaryZ_in_g(X))
U31_ag(X, binaryZ_out_g(X)) → succ_out_ag(zero(X), one(X))
succ_in_ag(one(X), zero(Z)) → U32_ag(X, Z, succ_in_ag(X, Z))
U32_ag(X, Z, succ_out_ag(X, Z)) → succ_out_ag(one(X), zero(Z))
U34_ag(X, Z, succ_out_ag(X, Z)) → succZ_out_ag(one(X), zero(Z))
U14_aag(X, Z, succZ_out_ag(X, Z)) → addc_out_aag(X, b, Z)
addc_in_aag(b, Y, Z) → U15_aag(Y, Z, succZ_in_ag(Y, Z))
U15_aag(Y, Z, succZ_out_ag(Y, Z)) → addc_out_aag(b, Y, Z)
addc_in_aag(X, Y, Z) → U16_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(zero(X), zero(Y), one(Z)) → U23_aag(X, Y, Z, addz_in_aag(X, Y, Z))
U23_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addC_out_aag(zero(X), zero(Y), one(Z))
addC_in_aag(zero(X), one(Y), zero(Z)) → U24_aag(X, Y, Z, addX_in_aag(X, Y, Z))
addX_in_aag(zero(X), b, one(X)) → U17_aag(X, binaryZ_in_g(X))
U17_aag(X, binaryZ_out_g(X)) → addX_out_aag(zero(X), b, one(X))
addX_in_aag(one(X), b, zero(Z)) → U18_aag(X, Z, succ_in_ag(X, Z))
U18_aag(X, Z, succ_out_ag(X, Z)) → addX_out_aag(one(X), b, zero(Z))
addX_in_aag(X, Y, Z) → U19_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), zero(Y), zero(Z)) → U25_aag(X, Y, Z, addY_in_aag(X, Y, Z))
addY_in_aag(b, zero(Y), one(Y)) → U20_aag(Y, binaryZ_in_g(Y))
U20_aag(Y, binaryZ_out_g(Y)) → addY_out_aag(b, zero(Y), one(Y))
addY_in_aag(b, one(Y), zero(Z)) → U21_aag(Y, Z, succ_in_ag(Y, Z))
U21_aag(Y, Z, succ_out_ag(Y, Z)) → addY_out_aag(b, one(Y), zero(Z))
addY_in_aag(X, Y, Z) → U22_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), one(Y), one(Z)) → U26_aag(X, Y, Z, addc_in_aag(X, Y, Z))
U26_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addC_out_aag(one(X), one(Y), one(Z))
U22_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addY_out_aag(X, Y, Z)
U25_aag(X, Y, Z, addY_out_aag(X, Y, Z)) → addC_out_aag(one(X), zero(Y), zero(Z))
U19_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addX_out_aag(X, Y, Z)
U24_aag(X, Y, Z, addX_out_aag(X, Y, Z)) → addC_out_aag(zero(X), one(Y), zero(Z))
U16_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addc_out_aag(X, Y, Z)
U13_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addz_out_aag(one(X), one(Y), zero(Z))
U9_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addy_out_aag(X, Y, Z)
U12_aag(X, Y, Z, addy_out_aag(X, Y, Z)) → addz_out_aag(one(X), zero(Y), one(Z))
U6_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addx_out_aag(X, Y, Z)
U11_aag(X, Y, Z, addx_out_aag(X, Y, Z)) → addz_out_aag(zero(X), one(Y), one(Z))
U10_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addz_out_aag(zero(X), zero(Y), zero(Z))
U3_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → add_out_aag(X, Y, Z)
U37_aag(R, S, RSS, add_out_aag(S, zero(RS), RSS)) → times_out_aag(one(R), S, RSS)
U35_aag(R, S, RS, times_out_aag(R, S, RS)) → times_out_aag(zero(R), S, zero(RS))
ADDX_IN_AAA(X, Y, Z) → ADDZ_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(zero(X), zero(Y), zero(Z)) → ADDZ_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(zero(X), one(Y), one(Z)) → ADDX_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(one(X), zero(Y), one(Z)) → ADDY_IN_AAA(X, Y, Z)
ADDY_IN_AAA(X, Y, Z) → ADDZ_IN_AAA(X, Y, Z)
ADDZ_IN_AAA(one(X), one(Y), zero(Z)) → ADDC_IN_AAA(X, Y, Z)
ADDC_IN_AAA(X, Y, Z) → ADDC_IN_AAA1(X, Y, Z)
ADDC_IN_AAA1(zero(X), zero(Y), one(Z)) → ADDZ_IN_AAA(X, Y, Z)
ADDC_IN_AAA1(zero(X), one(Y), zero(Z)) → ADDX_IN_AAA1(X, Y, Z)
ADDX_IN_AAA1(X, Y, Z) → ADDC_IN_AAA1(X, Y, Z)
ADDC_IN_AAA1(one(X), zero(Y), zero(Z)) → ADDY_IN_AAA1(X, Y, Z)
ADDY_IN_AAA1(X, Y, Z) → ADDC_IN_AAA1(X, Y, Z)
ADDC_IN_AAA1(one(X), one(Y), one(Z)) → ADDC_IN_AAA(X, Y, Z)
ADDX_IN_AAA → ADDZ_IN_AAA
ADDZ_IN_AAA → ADDZ_IN_AAA
ADDZ_IN_AAA → ADDX_IN_AAA
ADDZ_IN_AAA → ADDY_IN_AAA
ADDY_IN_AAA → ADDZ_IN_AAA
ADDZ_IN_AAA → ADDC_IN_AAA
ADDC_IN_AAA → ADDC_IN_AAA1
ADDC_IN_AAA1 → ADDZ_IN_AAA
ADDC_IN_AAA1 → ADDX_IN_AAA1
ADDX_IN_AAA1 → ADDC_IN_AAA1
ADDC_IN_AAA1 → ADDY_IN_AAA1
ADDY_IN_AAA1 → ADDC_IN_AAA1
ADDC_IN_AAA1 → ADDC_IN_AAA
TIMES_IN_AAA(one(R), S, RSS) → TIMES_IN_AAA(R, S, RS)
TIMES_IN_AAA(zero(R), S, zero(RS)) → TIMES_IN_AAA(R, S, RS)
times_in_aag(one(b), X, X) → times_out_aag(one(b), X, X)
times_in_aag(zero(R), S, zero(RS)) → U35_aag(R, S, RS, times_in_aag(R, S, RS))
times_in_aag(one(R), S, RSS) → U36_aag(R, S, RSS, times_in_aaa(R, S, RS))
times_in_aaa(one(b), X, X) → times_out_aaa(one(b), X, X)
times_in_aaa(zero(R), S, zero(RS)) → U35_aaa(R, S, RS, times_in_aaa(R, S, RS))
times_in_aaa(one(R), S, RSS) → U36_aaa(R, S, RSS, times_in_aaa(R, S, RS))
U36_aaa(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aaa(R, S, RSS, add_in_aaa(S, zero(RS), RSS))
add_in_aaa(b, b, b) → add_out_aaa(b, b, b)
add_in_aaa(X, b, X) → U1_aaa(X, binaryZ_in_a(X))
binaryZ_in_a(zero(X)) → U29_a(X, binaryZ_in_a(X))
binaryZ_in_a(one(X)) → U30_a(X, binary_in_a(X))
binary_in_a(b) → binary_out_a(b)
binary_in_a(zero(X)) → U27_a(X, binaryZ_in_a(X))
U27_a(X, binaryZ_out_a(X)) → binary_out_a(zero(X))
binary_in_a(one(X)) → U28_a(X, binary_in_a(X))
U28_a(X, binary_out_a(X)) → binary_out_a(one(X))
U30_a(X, binary_out_a(X)) → binaryZ_out_a(one(X))
U29_a(X, binaryZ_out_a(X)) → binaryZ_out_a(zero(X))
U1_aaa(X, binaryZ_out_a(X)) → add_out_aaa(X, b, X)
add_in_aaa(b, Y, Y) → U2_aaa(Y, binaryZ_in_a(Y))
U2_aaa(Y, binaryZ_out_a(Y)) → add_out_aaa(b, Y, Y)
add_in_aaa(X, Y, Z) → U3_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), zero(Y), zero(Z)) → U10_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), one(Y), one(Z)) → U11_aaa(X, Y, Z, addx_in_aaa(X, Y, Z))
addx_in_aaa(one(X), b, one(X)) → U4_aaa(X, binary_in_a(X))
U4_aaa(X, binary_out_a(X)) → addx_out_aaa(one(X), b, one(X))
addx_in_aaa(zero(X), b, zero(X)) → U5_aaa(X, binaryZ_in_a(X))
U5_aaa(X, binaryZ_out_a(X)) → addx_out_aaa(zero(X), b, zero(X))
addx_in_aaa(X, Y, Z) → U6_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), zero(Y), one(Z)) → U12_aaa(X, Y, Z, addy_in_aaa(X, Y, Z))
addy_in_aaa(b, one(Y), one(Y)) → U7_aaa(Y, binary_in_a(Y))
U7_aaa(Y, binary_out_a(Y)) → addy_out_aaa(b, one(Y), one(Y))
addy_in_aaa(b, zero(Y), zero(Y)) → U8_aaa(Y, binaryZ_in_a(Y))
U8_aaa(Y, binaryZ_out_a(Y)) → addy_out_aaa(b, zero(Y), zero(Y))
addy_in_aaa(X, Y, Z) → U9_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), one(Y), zero(Z)) → U13_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
addc_in_aaa(b, b, one(b)) → addc_out_aaa(b, b, one(b))
addc_in_aaa(X, b, Z) → U14_aaa(X, Z, succZ_in_aa(X, Z))
succZ_in_aa(zero(X), one(X)) → U33_aa(X, binaryZ_in_a(X))
U33_aa(X, binaryZ_out_a(X)) → succZ_out_aa(zero(X), one(X))
succZ_in_aa(one(X), zero(Z)) → U34_aa(X, Z, succ_in_aa(X, Z))
succ_in_aa(b, one(b)) → succ_out_aa(b, one(b))
succ_in_aa(zero(X), one(X)) → U31_aa(X, binaryZ_in_a(X))
U31_aa(X, binaryZ_out_a(X)) → succ_out_aa(zero(X), one(X))
succ_in_aa(one(X), zero(Z)) → U32_aa(X, Z, succ_in_aa(X, Z))
U32_aa(X, Z, succ_out_aa(X, Z)) → succ_out_aa(one(X), zero(Z))
U34_aa(X, Z, succ_out_aa(X, Z)) → succZ_out_aa(one(X), zero(Z))
U14_aaa(X, Z, succZ_out_aa(X, Z)) → addc_out_aaa(X, b, Z)
addc_in_aaa(b, Y, Z) → U15_aaa(Y, Z, succZ_in_aa(Y, Z))
U15_aaa(Y, Z, succZ_out_aa(Y, Z)) → addc_out_aaa(b, Y, Z)
addc_in_aaa(X, Y, Z) → U16_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(zero(X), zero(Y), one(Z)) → U23_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
U23_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), zero(Y), one(Z))
addC_in_aaa(zero(X), one(Y), zero(Z)) → U24_aaa(X, Y, Z, addX_in_aaa(X, Y, Z))
addX_in_aaa(zero(X), b, one(X)) → U17_aaa(X, binaryZ_in_a(X))
U17_aaa(X, binaryZ_out_a(X)) → addX_out_aaa(zero(X), b, one(X))
addX_in_aaa(one(X), b, zero(Z)) → U18_aaa(X, Z, succ_in_aa(X, Z))
U18_aaa(X, Z, succ_out_aa(X, Z)) → addX_out_aaa(one(X), b, zero(Z))
addX_in_aaa(X, Y, Z) → U19_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), zero(Y), zero(Z)) → U25_aaa(X, Y, Z, addY_in_aaa(X, Y, Z))
addY_in_aaa(b, zero(Y), one(Y)) → U20_aaa(Y, binaryZ_in_a(Y))
U20_aaa(Y, binaryZ_out_a(Y)) → addY_out_aaa(b, zero(Y), one(Y))
addY_in_aaa(b, one(Y), zero(Z)) → U21_aaa(Y, Z, succ_in_aa(Y, Z))
U21_aaa(Y, Z, succ_out_aa(Y, Z)) → addY_out_aaa(b, one(Y), zero(Z))
addY_in_aaa(X, Y, Z) → U22_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), one(Y), one(Z)) → U26_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
U26_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), one(Y), one(Z))
U22_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addY_out_aaa(X, Y, Z)
U25_aaa(X, Y, Z, addY_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), zero(Y), zero(Z))
U19_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addX_out_aaa(X, Y, Z)
U24_aaa(X, Y, Z, addX_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), one(Y), zero(Z))
U16_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addc_out_aaa(X, Y, Z)
U13_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), one(Y), zero(Z))
U9_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addy_out_aaa(X, Y, Z)
U12_aaa(X, Y, Z, addy_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), zero(Y), one(Z))
U6_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addx_out_aaa(X, Y, Z)
U11_aaa(X, Y, Z, addx_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), one(Y), one(Z))
U10_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), zero(Y), zero(Z))
U3_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → add_out_aaa(X, Y, Z)
U37_aaa(R, S, RSS, add_out_aaa(S, zero(RS), RSS)) → times_out_aaa(one(R), S, RSS)
U35_aaa(R, S, RS, times_out_aaa(R, S, RS)) → times_out_aaa(zero(R), S, zero(RS))
U36_aag(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aag(R, S, RSS, add_in_aag(S, zero(RS), RSS))
add_in_aag(b, b, b) → add_out_aag(b, b, b)
add_in_aag(X, b, X) → U1_aag(X, binaryZ_in_g(X))
binaryZ_in_g(zero(X)) → U29_g(X, binaryZ_in_g(X))
binaryZ_in_g(one(X)) → U30_g(X, binary_in_g(X))
binary_in_g(b) → binary_out_g(b)
binary_in_g(zero(X)) → U27_g(X, binaryZ_in_g(X))
U27_g(X, binaryZ_out_g(X)) → binary_out_g(zero(X))
binary_in_g(one(X)) → U28_g(X, binary_in_g(X))
U28_g(X, binary_out_g(X)) → binary_out_g(one(X))
U30_g(X, binary_out_g(X)) → binaryZ_out_g(one(X))
U29_g(X, binaryZ_out_g(X)) → binaryZ_out_g(zero(X))
U1_aag(X, binaryZ_out_g(X)) → add_out_aag(X, b, X)
add_in_aag(b, Y, Y) → U2_aag(Y, binaryZ_in_g(Y))
U2_aag(Y, binaryZ_out_g(Y)) → add_out_aag(b, Y, Y)
add_in_aag(X, Y, Z) → U3_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), zero(Y), zero(Z)) → U10_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), one(Y), one(Z)) → U11_aag(X, Y, Z, addx_in_aag(X, Y, Z))
addx_in_aag(one(X), b, one(X)) → U4_aag(X, binary_in_g(X))
U4_aag(X, binary_out_g(X)) → addx_out_aag(one(X), b, one(X))
addx_in_aag(zero(X), b, zero(X)) → U5_aag(X, binaryZ_in_g(X))
U5_aag(X, binaryZ_out_g(X)) → addx_out_aag(zero(X), b, zero(X))
addx_in_aag(X, Y, Z) → U6_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), zero(Y), one(Z)) → U12_aag(X, Y, Z, addy_in_aag(X, Y, Z))
addy_in_aag(b, one(Y), one(Y)) → U7_aag(Y, binary_in_g(Y))
U7_aag(Y, binary_out_g(Y)) → addy_out_aag(b, one(Y), one(Y))
addy_in_aag(b, zero(Y), zero(Y)) → U8_aag(Y, binaryZ_in_g(Y))
U8_aag(Y, binaryZ_out_g(Y)) → addy_out_aag(b, zero(Y), zero(Y))
addy_in_aag(X, Y, Z) → U9_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), one(Y), zero(Z)) → U13_aag(X, Y, Z, addc_in_aag(X, Y, Z))
addc_in_aag(b, b, one(b)) → addc_out_aag(b, b, one(b))
addc_in_aag(X, b, Z) → U14_aag(X, Z, succZ_in_ag(X, Z))
succZ_in_ag(zero(X), one(X)) → U33_ag(X, binaryZ_in_g(X))
U33_ag(X, binaryZ_out_g(X)) → succZ_out_ag(zero(X), one(X))
succZ_in_ag(one(X), zero(Z)) → U34_ag(X, Z, succ_in_ag(X, Z))
succ_in_ag(b, one(b)) → succ_out_ag(b, one(b))
succ_in_ag(zero(X), one(X)) → U31_ag(X, binaryZ_in_g(X))
U31_ag(X, binaryZ_out_g(X)) → succ_out_ag(zero(X), one(X))
succ_in_ag(one(X), zero(Z)) → U32_ag(X, Z, succ_in_ag(X, Z))
U32_ag(X, Z, succ_out_ag(X, Z)) → succ_out_ag(one(X), zero(Z))
U34_ag(X, Z, succ_out_ag(X, Z)) → succZ_out_ag(one(X), zero(Z))
U14_aag(X, Z, succZ_out_ag(X, Z)) → addc_out_aag(X, b, Z)
addc_in_aag(b, Y, Z) → U15_aag(Y, Z, succZ_in_ag(Y, Z))
U15_aag(Y, Z, succZ_out_ag(Y, Z)) → addc_out_aag(b, Y, Z)
addc_in_aag(X, Y, Z) → U16_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(zero(X), zero(Y), one(Z)) → U23_aag(X, Y, Z, addz_in_aag(X, Y, Z))
U23_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addC_out_aag(zero(X), zero(Y), one(Z))
addC_in_aag(zero(X), one(Y), zero(Z)) → U24_aag(X, Y, Z, addX_in_aag(X, Y, Z))
addX_in_aag(zero(X), b, one(X)) → U17_aag(X, binaryZ_in_g(X))
U17_aag(X, binaryZ_out_g(X)) → addX_out_aag(zero(X), b, one(X))
addX_in_aag(one(X), b, zero(Z)) → U18_aag(X, Z, succ_in_ag(X, Z))
U18_aag(X, Z, succ_out_ag(X, Z)) → addX_out_aag(one(X), b, zero(Z))
addX_in_aag(X, Y, Z) → U19_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), zero(Y), zero(Z)) → U25_aag(X, Y, Z, addY_in_aag(X, Y, Z))
addY_in_aag(b, zero(Y), one(Y)) → U20_aag(Y, binaryZ_in_g(Y))
U20_aag(Y, binaryZ_out_g(Y)) → addY_out_aag(b, zero(Y), one(Y))
addY_in_aag(b, one(Y), zero(Z)) → U21_aag(Y, Z, succ_in_ag(Y, Z))
U21_aag(Y, Z, succ_out_ag(Y, Z)) → addY_out_aag(b, one(Y), zero(Z))
addY_in_aag(X, Y, Z) → U22_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), one(Y), one(Z)) → U26_aag(X, Y, Z, addc_in_aag(X, Y, Z))
U26_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addC_out_aag(one(X), one(Y), one(Z))
U22_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addY_out_aag(X, Y, Z)
U25_aag(X, Y, Z, addY_out_aag(X, Y, Z)) → addC_out_aag(one(X), zero(Y), zero(Z))
U19_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addX_out_aag(X, Y, Z)
U24_aag(X, Y, Z, addX_out_aag(X, Y, Z)) → addC_out_aag(zero(X), one(Y), zero(Z))
U16_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addc_out_aag(X, Y, Z)
U13_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addz_out_aag(one(X), one(Y), zero(Z))
U9_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addy_out_aag(X, Y, Z)
U12_aag(X, Y, Z, addy_out_aag(X, Y, Z)) → addz_out_aag(one(X), zero(Y), one(Z))
U6_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addx_out_aag(X, Y, Z)
U11_aag(X, Y, Z, addx_out_aag(X, Y, Z)) → addz_out_aag(zero(X), one(Y), one(Z))
U10_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addz_out_aag(zero(X), zero(Y), zero(Z))
U3_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → add_out_aag(X, Y, Z)
U37_aag(R, S, RSS, add_out_aag(S, zero(RS), RSS)) → times_out_aag(one(R), S, RSS)
U35_aag(R, S, RS, times_out_aag(R, S, RS)) → times_out_aag(zero(R), S, zero(RS))
TIMES_IN_AAA(one(R), S, RSS) → TIMES_IN_AAA(R, S, RS)
TIMES_IN_AAA(zero(R), S, zero(RS)) → TIMES_IN_AAA(R, S, RS)
TIMES_IN_AAA → TIMES_IN_AAA
TIMES_IN_AAG(zero(R), S, zero(RS)) → TIMES_IN_AAG(R, S, RS)
times_in_aag(one(b), X, X) → times_out_aag(one(b), X, X)
times_in_aag(zero(R), S, zero(RS)) → U35_aag(R, S, RS, times_in_aag(R, S, RS))
times_in_aag(one(R), S, RSS) → U36_aag(R, S, RSS, times_in_aaa(R, S, RS))
times_in_aaa(one(b), X, X) → times_out_aaa(one(b), X, X)
times_in_aaa(zero(R), S, zero(RS)) → U35_aaa(R, S, RS, times_in_aaa(R, S, RS))
times_in_aaa(one(R), S, RSS) → U36_aaa(R, S, RSS, times_in_aaa(R, S, RS))
U36_aaa(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aaa(R, S, RSS, add_in_aaa(S, zero(RS), RSS))
add_in_aaa(b, b, b) → add_out_aaa(b, b, b)
add_in_aaa(X, b, X) → U1_aaa(X, binaryZ_in_a(X))
binaryZ_in_a(zero(X)) → U29_a(X, binaryZ_in_a(X))
binaryZ_in_a(one(X)) → U30_a(X, binary_in_a(X))
binary_in_a(b) → binary_out_a(b)
binary_in_a(zero(X)) → U27_a(X, binaryZ_in_a(X))
U27_a(X, binaryZ_out_a(X)) → binary_out_a(zero(X))
binary_in_a(one(X)) → U28_a(X, binary_in_a(X))
U28_a(X, binary_out_a(X)) → binary_out_a(one(X))
U30_a(X, binary_out_a(X)) → binaryZ_out_a(one(X))
U29_a(X, binaryZ_out_a(X)) → binaryZ_out_a(zero(X))
U1_aaa(X, binaryZ_out_a(X)) → add_out_aaa(X, b, X)
add_in_aaa(b, Y, Y) → U2_aaa(Y, binaryZ_in_a(Y))
U2_aaa(Y, binaryZ_out_a(Y)) → add_out_aaa(b, Y, Y)
add_in_aaa(X, Y, Z) → U3_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), zero(Y), zero(Z)) → U10_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(zero(X), one(Y), one(Z)) → U11_aaa(X, Y, Z, addx_in_aaa(X, Y, Z))
addx_in_aaa(one(X), b, one(X)) → U4_aaa(X, binary_in_a(X))
U4_aaa(X, binary_out_a(X)) → addx_out_aaa(one(X), b, one(X))
addx_in_aaa(zero(X), b, zero(X)) → U5_aaa(X, binaryZ_in_a(X))
U5_aaa(X, binaryZ_out_a(X)) → addx_out_aaa(zero(X), b, zero(X))
addx_in_aaa(X, Y, Z) → U6_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), zero(Y), one(Z)) → U12_aaa(X, Y, Z, addy_in_aaa(X, Y, Z))
addy_in_aaa(b, one(Y), one(Y)) → U7_aaa(Y, binary_in_a(Y))
U7_aaa(Y, binary_out_a(Y)) → addy_out_aaa(b, one(Y), one(Y))
addy_in_aaa(b, zero(Y), zero(Y)) → U8_aaa(Y, binaryZ_in_a(Y))
U8_aaa(Y, binaryZ_out_a(Y)) → addy_out_aaa(b, zero(Y), zero(Y))
addy_in_aaa(X, Y, Z) → U9_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
addz_in_aaa(one(X), one(Y), zero(Z)) → U13_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
addc_in_aaa(b, b, one(b)) → addc_out_aaa(b, b, one(b))
addc_in_aaa(X, b, Z) → U14_aaa(X, Z, succZ_in_aa(X, Z))
succZ_in_aa(zero(X), one(X)) → U33_aa(X, binaryZ_in_a(X))
U33_aa(X, binaryZ_out_a(X)) → succZ_out_aa(zero(X), one(X))
succZ_in_aa(one(X), zero(Z)) → U34_aa(X, Z, succ_in_aa(X, Z))
succ_in_aa(b, one(b)) → succ_out_aa(b, one(b))
succ_in_aa(zero(X), one(X)) → U31_aa(X, binaryZ_in_a(X))
U31_aa(X, binaryZ_out_a(X)) → succ_out_aa(zero(X), one(X))
succ_in_aa(one(X), zero(Z)) → U32_aa(X, Z, succ_in_aa(X, Z))
U32_aa(X, Z, succ_out_aa(X, Z)) → succ_out_aa(one(X), zero(Z))
U34_aa(X, Z, succ_out_aa(X, Z)) → succZ_out_aa(one(X), zero(Z))
U14_aaa(X, Z, succZ_out_aa(X, Z)) → addc_out_aaa(X, b, Z)
addc_in_aaa(b, Y, Z) → U15_aaa(Y, Z, succZ_in_aa(Y, Z))
U15_aaa(Y, Z, succZ_out_aa(Y, Z)) → addc_out_aaa(b, Y, Z)
addc_in_aaa(X, Y, Z) → U16_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(zero(X), zero(Y), one(Z)) → U23_aaa(X, Y, Z, addz_in_aaa(X, Y, Z))
U23_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), zero(Y), one(Z))
addC_in_aaa(zero(X), one(Y), zero(Z)) → U24_aaa(X, Y, Z, addX_in_aaa(X, Y, Z))
addX_in_aaa(zero(X), b, one(X)) → U17_aaa(X, binaryZ_in_a(X))
U17_aaa(X, binaryZ_out_a(X)) → addX_out_aaa(zero(X), b, one(X))
addX_in_aaa(one(X), b, zero(Z)) → U18_aaa(X, Z, succ_in_aa(X, Z))
U18_aaa(X, Z, succ_out_aa(X, Z)) → addX_out_aaa(one(X), b, zero(Z))
addX_in_aaa(X, Y, Z) → U19_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), zero(Y), zero(Z)) → U25_aaa(X, Y, Z, addY_in_aaa(X, Y, Z))
addY_in_aaa(b, zero(Y), one(Y)) → U20_aaa(Y, binaryZ_in_a(Y))
U20_aaa(Y, binaryZ_out_a(Y)) → addY_out_aaa(b, zero(Y), one(Y))
addY_in_aaa(b, one(Y), zero(Z)) → U21_aaa(Y, Z, succ_in_aa(Y, Z))
U21_aaa(Y, Z, succ_out_aa(Y, Z)) → addY_out_aaa(b, one(Y), zero(Z))
addY_in_aaa(X, Y, Z) → U22_aaa(X, Y, Z, addC_in_aaa(X, Y, Z))
addC_in_aaa(one(X), one(Y), one(Z)) → U26_aaa(X, Y, Z, addc_in_aaa(X, Y, Z))
U26_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), one(Y), one(Z))
U22_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addY_out_aaa(X, Y, Z)
U25_aaa(X, Y, Z, addY_out_aaa(X, Y, Z)) → addC_out_aaa(one(X), zero(Y), zero(Z))
U19_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addX_out_aaa(X, Y, Z)
U24_aaa(X, Y, Z, addX_out_aaa(X, Y, Z)) → addC_out_aaa(zero(X), one(Y), zero(Z))
U16_aaa(X, Y, Z, addC_out_aaa(X, Y, Z)) → addc_out_aaa(X, Y, Z)
U13_aaa(X, Y, Z, addc_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), one(Y), zero(Z))
U9_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addy_out_aaa(X, Y, Z)
U12_aaa(X, Y, Z, addy_out_aaa(X, Y, Z)) → addz_out_aaa(one(X), zero(Y), one(Z))
U6_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addx_out_aaa(X, Y, Z)
U11_aaa(X, Y, Z, addx_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), one(Y), one(Z))
U10_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → addz_out_aaa(zero(X), zero(Y), zero(Z))
U3_aaa(X, Y, Z, addz_out_aaa(X, Y, Z)) → add_out_aaa(X, Y, Z)
U37_aaa(R, S, RSS, add_out_aaa(S, zero(RS), RSS)) → times_out_aaa(one(R), S, RSS)
U35_aaa(R, S, RS, times_out_aaa(R, S, RS)) → times_out_aaa(zero(R), S, zero(RS))
U36_aag(R, S, RSS, times_out_aaa(R, S, RS)) → U37_aag(R, S, RSS, add_in_aag(S, zero(RS), RSS))
add_in_aag(b, b, b) → add_out_aag(b, b, b)
add_in_aag(X, b, X) → U1_aag(X, binaryZ_in_g(X))
binaryZ_in_g(zero(X)) → U29_g(X, binaryZ_in_g(X))
binaryZ_in_g(one(X)) → U30_g(X, binary_in_g(X))
binary_in_g(b) → binary_out_g(b)
binary_in_g(zero(X)) → U27_g(X, binaryZ_in_g(X))
U27_g(X, binaryZ_out_g(X)) → binary_out_g(zero(X))
binary_in_g(one(X)) → U28_g(X, binary_in_g(X))
U28_g(X, binary_out_g(X)) → binary_out_g(one(X))
U30_g(X, binary_out_g(X)) → binaryZ_out_g(one(X))
U29_g(X, binaryZ_out_g(X)) → binaryZ_out_g(zero(X))
U1_aag(X, binaryZ_out_g(X)) → add_out_aag(X, b, X)
add_in_aag(b, Y, Y) → U2_aag(Y, binaryZ_in_g(Y))
U2_aag(Y, binaryZ_out_g(Y)) → add_out_aag(b, Y, Y)
add_in_aag(X, Y, Z) → U3_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), zero(Y), zero(Z)) → U10_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(zero(X), one(Y), one(Z)) → U11_aag(X, Y, Z, addx_in_aag(X, Y, Z))
addx_in_aag(one(X), b, one(X)) → U4_aag(X, binary_in_g(X))
U4_aag(X, binary_out_g(X)) → addx_out_aag(one(X), b, one(X))
addx_in_aag(zero(X), b, zero(X)) → U5_aag(X, binaryZ_in_g(X))
U5_aag(X, binaryZ_out_g(X)) → addx_out_aag(zero(X), b, zero(X))
addx_in_aag(X, Y, Z) → U6_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), zero(Y), one(Z)) → U12_aag(X, Y, Z, addy_in_aag(X, Y, Z))
addy_in_aag(b, one(Y), one(Y)) → U7_aag(Y, binary_in_g(Y))
U7_aag(Y, binary_out_g(Y)) → addy_out_aag(b, one(Y), one(Y))
addy_in_aag(b, zero(Y), zero(Y)) → U8_aag(Y, binaryZ_in_g(Y))
U8_aag(Y, binaryZ_out_g(Y)) → addy_out_aag(b, zero(Y), zero(Y))
addy_in_aag(X, Y, Z) → U9_aag(X, Y, Z, addz_in_aag(X, Y, Z))
addz_in_aag(one(X), one(Y), zero(Z)) → U13_aag(X, Y, Z, addc_in_aag(X, Y, Z))
addc_in_aag(b, b, one(b)) → addc_out_aag(b, b, one(b))
addc_in_aag(X, b, Z) → U14_aag(X, Z, succZ_in_ag(X, Z))
succZ_in_ag(zero(X), one(X)) → U33_ag(X, binaryZ_in_g(X))
U33_ag(X, binaryZ_out_g(X)) → succZ_out_ag(zero(X), one(X))
succZ_in_ag(one(X), zero(Z)) → U34_ag(X, Z, succ_in_ag(X, Z))
succ_in_ag(b, one(b)) → succ_out_ag(b, one(b))
succ_in_ag(zero(X), one(X)) → U31_ag(X, binaryZ_in_g(X))
U31_ag(X, binaryZ_out_g(X)) → succ_out_ag(zero(X), one(X))
succ_in_ag(one(X), zero(Z)) → U32_ag(X, Z, succ_in_ag(X, Z))
U32_ag(X, Z, succ_out_ag(X, Z)) → succ_out_ag(one(X), zero(Z))
U34_ag(X, Z, succ_out_ag(X, Z)) → succZ_out_ag(one(X), zero(Z))
U14_aag(X, Z, succZ_out_ag(X, Z)) → addc_out_aag(X, b, Z)
addc_in_aag(b, Y, Z) → U15_aag(Y, Z, succZ_in_ag(Y, Z))
U15_aag(Y, Z, succZ_out_ag(Y, Z)) → addc_out_aag(b, Y, Z)
addc_in_aag(X, Y, Z) → U16_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(zero(X), zero(Y), one(Z)) → U23_aag(X, Y, Z, addz_in_aag(X, Y, Z))
U23_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addC_out_aag(zero(X), zero(Y), one(Z))
addC_in_aag(zero(X), one(Y), zero(Z)) → U24_aag(X, Y, Z, addX_in_aag(X, Y, Z))
addX_in_aag(zero(X), b, one(X)) → U17_aag(X, binaryZ_in_g(X))
U17_aag(X, binaryZ_out_g(X)) → addX_out_aag(zero(X), b, one(X))
addX_in_aag(one(X), b, zero(Z)) → U18_aag(X, Z, succ_in_ag(X, Z))
U18_aag(X, Z, succ_out_ag(X, Z)) → addX_out_aag(one(X), b, zero(Z))
addX_in_aag(X, Y, Z) → U19_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), zero(Y), zero(Z)) → U25_aag(X, Y, Z, addY_in_aag(X, Y, Z))
addY_in_aag(b, zero(Y), one(Y)) → U20_aag(Y, binaryZ_in_g(Y))
U20_aag(Y, binaryZ_out_g(Y)) → addY_out_aag(b, zero(Y), one(Y))
addY_in_aag(b, one(Y), zero(Z)) → U21_aag(Y, Z, succ_in_ag(Y, Z))
U21_aag(Y, Z, succ_out_ag(Y, Z)) → addY_out_aag(b, one(Y), zero(Z))
addY_in_aag(X, Y, Z) → U22_aag(X, Y, Z, addC_in_aag(X, Y, Z))
addC_in_aag(one(X), one(Y), one(Z)) → U26_aag(X, Y, Z, addc_in_aag(X, Y, Z))
U26_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addC_out_aag(one(X), one(Y), one(Z))
U22_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addY_out_aag(X, Y, Z)
U25_aag(X, Y, Z, addY_out_aag(X, Y, Z)) → addC_out_aag(one(X), zero(Y), zero(Z))
U19_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addX_out_aag(X, Y, Z)
U24_aag(X, Y, Z, addX_out_aag(X, Y, Z)) → addC_out_aag(zero(X), one(Y), zero(Z))
U16_aag(X, Y, Z, addC_out_aag(X, Y, Z)) → addc_out_aag(X, Y, Z)
U13_aag(X, Y, Z, addc_out_aag(X, Y, Z)) → addz_out_aag(one(X), one(Y), zero(Z))
U9_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addy_out_aag(X, Y, Z)
U12_aag(X, Y, Z, addy_out_aag(X, Y, Z)) → addz_out_aag(one(X), zero(Y), one(Z))
U6_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addx_out_aag(X, Y, Z)
U11_aag(X, Y, Z, addx_out_aag(X, Y, Z)) → addz_out_aag(zero(X), one(Y), one(Z))
U10_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → addz_out_aag(zero(X), zero(Y), zero(Z))
U3_aag(X, Y, Z, addz_out_aag(X, Y, Z)) → add_out_aag(X, Y, Z)
U37_aag(R, S, RSS, add_out_aag(S, zero(RS), RSS)) → times_out_aag(one(R), S, RSS)
U35_aag(R, S, RS, times_out_aag(R, S, RS)) → times_out_aag(zero(R), S, zero(RS))
TIMES_IN_AAG(zero(R), S, zero(RS)) → TIMES_IN_AAG(R, S, RS)
TIMES_IN_AAG(zero(RS)) → TIMES_IN_AAG(RS)
From the DPs we obtained the following set of size-change graphs: