src/HOL/ex/BinEx.thy
author paulson
Thu, 01 Oct 1998 18:30:05 +0200
changeset 5601 b6456ccd9e3e
parent 5545 9117a0e2bf31
child 6920 c912740c3545
permissions -rw-r--r--
revised for new treatment of integers
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5545
9117a0e2bf31 added correctness proofs for arithmetic
paulson
parents: 5199
diff changeset
     1
(*  Title:      HOL/ex/BinEx.thy
9117a0e2bf31 added correctness proofs for arithmetic
paulson
parents: 5199
diff changeset
     2
    ID:         $Id$
9117a0e2bf31 added correctness proofs for arithmetic
paulson
parents: 5199
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
9117a0e2bf31 added correctness proofs for arithmetic
paulson
parents: 5199
diff changeset
     4
    Copyright   1998  University of Cambridge
5199
be986f7a6def added ex/MonoidGroups (record example);
wenzelm
parents:
diff changeset
     5
5545
9117a0e2bf31 added correctness proofs for arithmetic
paulson
parents: 5199
diff changeset
     6
Definition of normal form for proving that binary arithmetic on
9117a0e2bf31 added correctness proofs for arithmetic
paulson
parents: 5199
diff changeset
     7
ormalized operands yields normalized results.
9117a0e2bf31 added correctness proofs for arithmetic
paulson
parents: 5199
diff changeset
     8
9117a0e2bf31 added correctness proofs for arithmetic
paulson
parents: 5199
diff changeset
     9
Normal means no leading 0s on positive numbers and no leading 1s on negatives.
9117a0e2bf31 added correctness proofs for arithmetic
paulson
parents: 5199
diff changeset
    10
*)
9117a0e2bf31 added correctness proofs for arithmetic
paulson
parents: 5199
diff changeset
    11
9117a0e2bf31 added correctness proofs for arithmetic
paulson
parents: 5199
diff changeset
    12
BinEx = Bin +
9117a0e2bf31 added correctness proofs for arithmetic
paulson
parents: 5199
diff changeset
    13
9117a0e2bf31 added correctness proofs for arithmetic
paulson
parents: 5199
diff changeset
    14
consts normal :: bin set
9117a0e2bf31 added correctness proofs for arithmetic
paulson
parents: 5199
diff changeset
    15
  
9117a0e2bf31 added correctness proofs for arithmetic
paulson
parents: 5199
diff changeset
    16
inductive "normal"
9117a0e2bf31 added correctness proofs for arithmetic
paulson
parents: 5199
diff changeset
    17
  intrs 
9117a0e2bf31 added correctness proofs for arithmetic
paulson
parents: 5199
diff changeset
    18
9117a0e2bf31 added correctness proofs for arithmetic
paulson
parents: 5199
diff changeset
    19
    Pls  "Pls: normal"
9117a0e2bf31 added correctness proofs for arithmetic
paulson
parents: 5199
diff changeset
    20
9117a0e2bf31 added correctness proofs for arithmetic
paulson
parents: 5199
diff changeset
    21
    Min  "Min: normal"
9117a0e2bf31 added correctness proofs for arithmetic
paulson
parents: 5199
diff changeset
    22
9117a0e2bf31 added correctness proofs for arithmetic
paulson
parents: 5199
diff changeset
    23
    BIT_F  "[| w: normal; w ~= Pls |] ==> w BIT False : normal"
9117a0e2bf31 added correctness proofs for arithmetic
paulson
parents: 5199
diff changeset
    24
9117a0e2bf31 added correctness proofs for arithmetic
paulson
parents: 5199
diff changeset
    25
    BIT_T  "[| w: normal; w ~= Min |] ==> w BIT True : normal"
9117a0e2bf31 added correctness proofs for arithmetic
paulson
parents: 5199
diff changeset
    26
9117a0e2bf31 added correctness proofs for arithmetic
paulson
parents: 5199
diff changeset
    27
end