src/CTT/Arith.thy
author paulson
Tue Nov 14 13:26:48 2000 +0100 (2000-11-14)
changeset 10467 e6e7205e9e91
parent 3837 d7f033c74b38
child 12110 f8b4b11cd79d
permissions -rw-r--r--
x-symbol support for Pi, Sigma, -->, : (membership)
note that "lam" is displayed as TWO lambda-symbols
clasohm@1474
     1
(*  Title:      CTT/arith
clasohm@0
     2
    ID:         $Id$
clasohm@1474
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
clasohm@0
     4
    Copyright   1991  University of Cambridge
clasohm@0
     5
clasohm@0
     6
Arithmetic operators and their definitions
clasohm@0
     7
clasohm@0
     8
Proves about elementary arithmetic: addition, multiplication, etc.
clasohm@0
     9
Tests definitions and simplifier.
clasohm@0
    10
*)
clasohm@0
    11
clasohm@0
    12
Arith = CTT +
clasohm@0
    13
clasohm@1474
    14
consts "#+","-","|-|"   :: "[i,i]=>i"   (infixr 65)
clasohm@1474
    15
       "#*",div,mod     :: "[i,i]=>i"   (infixr 70)
clasohm@0
    16
paulson@10467
    17
syntax (symbols)
paulson@10467
    18
  "op #*"      :: [i, i] => i   (infixr "#\\<times>" 70)
paulson@10467
    19
paulson@10467
    20
syntax (HTML output)
paulson@10467
    21
  "op #*"      :: [i, i] => i   (infixr "#\\<times>" 70)
paulson@10467
    22
clasohm@0
    23
rules
wenzelm@3837
    24
  add_def     "a#+b == rec(a, b, %u v. succ(v))"  
wenzelm@3837
    25
  diff_def    "a-b == rec(b, a, %u v. rec(v, 0, %x y. x))"  
clasohm@0
    26
  absdiff_def "a|-|b == (a-b) #+ (b-a)"  
clasohm@0
    27
  mult_def    "a#*b == rec(a, 0, %u v. b #+ v)"  
wenzelm@3837
    28
  mod_def     "a mod b == rec(a, 0, %u v. rec(succ(v) |-| b, 0, %x y. succ(v)))"
wenzelm@3837
    29
  div_def     "a div b == rec(a, 0, %u v. rec(succ(u) mod b, succ(v), %x y. v))"
clasohm@0
    30
end