src/HOL/Arith.thy
author wenzelm
Thu Mar 11 13:20:35 1999 +0100 (1999-03-11)
changeset 6349 f7750d816c21
parent 5183 89f162de39cf
child 8929 4829556a56f8
permissions -rw-r--r--
removed foo_build_completed -- now handled by session management (via usedir);
clasohm@923
     1
(*  Title:      HOL/Arith.thy
clasohm@923
     2
    ID:         $Id$
clasohm@923
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
clasohm@923
     4
    Copyright   1993  University of Cambridge
clasohm@923
     5
paulson@3366
     6
Arithmetic operators + - and * (for div, mod and dvd, see Divides)
clasohm@923
     7
*)
clasohm@923
     8
clasohm@923
     9
Arith = Nat +
clasohm@923
    10
clasohm@923
    11
instance
paulson@3366
    12
  nat :: {plus, minus, times, power}
clasohm@923
    13
nipkow@4360
    14
(* size of a datatype value; overloaded *)
nipkow@4360
    15
consts size :: 'a => nat
paulson@1796
    16
berghofe@5183
    17
primrec
paulson@3366
    18
  add_0    "0 + n = n"
paulson@3366
    19
  add_Suc  "Suc m + n = Suc(m + n)"
pusch@2681
    20
berghofe@5183
    21
primrec
paulson@3235
    22
  diff_0   "m - 0 = m"
nipkow@4360
    23
  diff_Suc "m - Suc n = (case m - n of 0 => 0 | Suc k => k)"
nipkow@4360
    24
berghofe@5183
    25
primrec
paulson@3366
    26
  mult_0   "0 * n = 0"
paulson@3366
    27
  mult_Suc "Suc m * n = n + (m * n)"
pusch@2681
    28
clasohm@923
    29
end