src/CTT/arith.thy
changeset 0 a5a9c433f639
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/CTT/arith.thy	Thu Sep 16 12:20:38 1993 +0200
     1.3 @@ -0,0 +1,24 @@
     1.4 +(*  Title: 	CTT/arith
     1.5 +    ID:         $Id$
     1.6 +    Author: 	Lawrence C Paulson, Cambridge University Computer Laboratory
     1.7 +    Copyright   1991  University of Cambridge
     1.8 +
     1.9 +Arithmetic operators and their definitions
    1.10 +
    1.11 +Proves about elementary arithmetic: addition, multiplication, etc.
    1.12 +Tests definitions and simplifier.
    1.13 +*)
    1.14 +
    1.15 +Arith = CTT +
    1.16 +
    1.17 +consts "#+","-","|-|"	:: "[i,i]=>i"	(infixr 65)
    1.18 +       "#*",div,mod     :: "[i,i]=>i"	(infixr 70)
    1.19 +
    1.20 +rules
    1.21 +  add_def     "a#+b == rec(a, b, %u v.succ(v))"  
    1.22 +  diff_def    "a-b == rec(b, a, %u v.rec(v, 0, %x y.x))"  
    1.23 +  absdiff_def "a|-|b == (a-b) #+ (b-a)"  
    1.24 +  mult_def    "a#*b == rec(a, 0, %u v. b #+ v)"  
    1.25 +  mod_def     "a mod b == rec(a, 0, %u v. rec(succ(v) |-| b, 0, %x y.succ(v)))"
    1.26 +  div_def     "a div b == rec(a, 0, %u v. rec(succ(u) mod b, succ(v), %x y.v))"
    1.27 +end