| 6905 |      1 | (*  Title:      HOL/Numeral.thy
 | 
|  |      2 |     ID:         $Id$
 | 
|  |      3 |     Author:     Larry Paulson and Markus Wenzel
 | 
|  |      4 | 
 | 
|  |      5 | Generic numerals represented as twos-complement bitstrings.
 | 
|  |      6 | *)
 | 
|  |      7 | 
 | 
|  |      8 | theory Numeral = Datatype
 | 
|  |      9 | files "Tools/numeral_syntax.ML":;
 | 
|  |     10 | 
 | 
|  |     11 | datatype
 | 
|  |     12 |   bin = Pls
 | 
|  |     13 |       | Min
 | 
|  |     14 |       | Bit bin bool	(infixl "BIT" 90);
 | 
|  |     15 | 
 | 
|  |     16 | axclass
 | 
| 6988 |     17 |   number < "term";      (*for numeric types: nat, int, real, ...*)
 | 
| 6905 |     18 | 
 | 
|  |     19 | consts
 | 
| 6988 |     20 |   number_of :: "bin => 'a::number";
 | 
| 6905 |     21 | 
 | 
|  |     22 | syntax
 | 
|  |     23 |   "_Numeral" :: "xnum => 'a"	("_");
 | 
|  |     24 | 
 | 
|  |     25 | setup NumeralSyntax.setup;
 | 
|  |     26 | 
 | 
|  |     27 | 
 | 
|  |     28 | end;
 |