{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPTIONS --without-K #-}
module FOTC.Program.GCD.Partial.GCD where
open import FOTC.Base
open import FOTC.Base.Loop
open import FOTC.Data.Nat
open import FOTC.Data.Nat.Inequalities
postulate
gcd : D → D → D
gcd-eq : ∀ m n → gcd m n ≡
(if (iszero₁ n)
then (if (iszero₁ m)
then error
else m)
else (if (iszero₁ m)
then n
else (if (gt m n)
then gcd (m ∸ n) n
else gcd m (n ∸ m))))
{-# ATP axiom gcd-eq #-}