def dw
import bend-collections-laws-math@1.0.0.0/proofs/math/natural/gcd.bend as Gcdimport Base
88# the quotient g / d, for d | a (a == ka d) and d | b (b == kb d)
89def dw(fuel: Nat, +a: Nat, +b: Nat, +ka: Nat, +kb: Nat) -> Nat:
90 match fuel b:
91 case 0n _:
92 ka
93 case 1n+f 0n:
94 ka
95 case 1n+f 1n+ +bp:
96 dw(f, 1n+bp, Nat.mod(a, 1n+bp), kb, Nat.sub(ka, Nat.mul(Nat.div(a, 1n+bp), kb)))
Uses (5)
Used by (8)
- bend-collections-laws-math@1.0.0.0/proofs/math/natural/gcd:dvd_gcd
- bend-collections-laws-math@1.0.0.0/proofs/math/natural/lcm:lcm_dw
- bend-collections-laws-math@1.0.0.0/proofs/math/typed/combnat:sq
- bend-collections-laws-math@1.0.0.0/proofs/math/natural/lists:gw_dvd
- bend-collections-laws-math@1.0.0.0/proofs/math/natural/gcd:gcd_greatest
- …