doc-src/Tutorial/Misc/GCD.thy
author wenzelm
Thu, 28 Oct 1999 19:53:24 +0200
changeset 7967 942274e0f7a8
parent 5377 efb799c5ed3c
permissions -rw-r--r--
fixed deps;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5377
efb799c5ed3c *** empty log message ***
nipkow
parents:
diff changeset
     1
GCD = WF_Rel +
efb799c5ed3c *** empty log message ***
nipkow
parents:
diff changeset
     2
consts gcd :: "nat*nat => nat"
efb799c5ed3c *** empty log message ***
nipkow
parents:
diff changeset
     3
recdef gcd "measure ((%(m,n).n))"
efb799c5ed3c *** empty log message ***
nipkow
parents:
diff changeset
     4
  simpset "simpset() addsimps [mod_less_divisor]"
efb799c5ed3c *** empty log message ***
nipkow
parents:
diff changeset
     5
    "gcd (m, n) = (if n=0 then m else gcd(n, m mod n))"
efb799c5ed3c *** empty log message ***
nipkow
parents:
diff changeset
     6
end