src/HOL/Numeral.thy
author wenzelm
Wed, 29 Aug 2001 21:17:24 +0200
changeset 11506 244a02a2968b
parent 11488 4ff900551340
child 11699 c7df55158574
permissions -rw-r--r--
avoid ML bindings;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6905
9bc05ec3497b added Numeral.thy, Tools/numeral_syntax.ML;
wenzelm
parents:
diff changeset
     1
(*  Title:      HOL/Numeral.thy
9bc05ec3497b added Numeral.thy, Tools/numeral_syntax.ML;
wenzelm
parents:
diff changeset
     2
    ID:         $Id$
9bc05ec3497b added Numeral.thy, Tools/numeral_syntax.ML;
wenzelm
parents:
diff changeset
     3
    Author:     Larry Paulson and Markus Wenzel
9bc05ec3497b added Numeral.thy, Tools/numeral_syntax.ML;
wenzelm
parents:
diff changeset
     4
9410
612ee826a409 removed selector syntax -- improper tuples are broken beyond repair :-(
wenzelm
parents: 9358
diff changeset
     5
Generic numerals represented as twos-complement bit strings.
6905
9bc05ec3497b added Numeral.thy, Tools/numeral_syntax.ML;
wenzelm
parents:
diff changeset
     6
*)
9bc05ec3497b added Numeral.thy, Tools/numeral_syntax.ML;
wenzelm
parents:
diff changeset
     7
9bc05ec3497b added Numeral.thy, Tools/numeral_syntax.ML;
wenzelm
parents:
diff changeset
     8
theory Numeral = Datatype
9035
371f023d3dbd removed explicit terminator (";");
wenzelm
parents: 6988
diff changeset
     9
files "Tools/numeral_syntax.ML":
6905
9bc05ec3497b added Numeral.thy, Tools/numeral_syntax.ML;
wenzelm
parents:
diff changeset
    10
9bc05ec3497b added Numeral.thy, Tools/numeral_syntax.ML;
wenzelm
parents:
diff changeset
    11
datatype
9bc05ec3497b added Numeral.thy, Tools/numeral_syntax.ML;
wenzelm
parents:
diff changeset
    12
  bin = Pls
9bc05ec3497b added Numeral.thy, Tools/numeral_syntax.ML;
wenzelm
parents:
diff changeset
    13
      | Min
9358
973672495414 added syntax for proper / improper selector functions;
wenzelm
parents: 9035
diff changeset
    14
      | Bit bin bool    (infixl "BIT" 90)
6905
9bc05ec3497b added Numeral.thy, Tools/numeral_syntax.ML;
wenzelm
parents:
diff changeset
    15
9bc05ec3497b added Numeral.thy, Tools/numeral_syntax.ML;
wenzelm
parents:
diff changeset
    16
axclass
9035
371f023d3dbd removed explicit terminator (";");
wenzelm
parents: 6988
diff changeset
    17
  number < "term"      (*for numeric types: nat, int, real, ...*)
6905
9bc05ec3497b added Numeral.thy, Tools/numeral_syntax.ML;
wenzelm
parents:
diff changeset
    18
9bc05ec3497b added Numeral.thy, Tools/numeral_syntax.ML;
wenzelm
parents:
diff changeset
    19
consts
9035
371f023d3dbd removed explicit terminator (";");
wenzelm
parents: 6988
diff changeset
    20
  number_of :: "bin => 'a::number"
6905
9bc05ec3497b added Numeral.thy, Tools/numeral_syntax.ML;
wenzelm
parents:
diff changeset
    21
11488
4ff900551340 constify numeral tokens in order to allow translations;
wenzelm
parents: 9410
diff changeset
    22
nonterminals
4ff900551340 constify numeral tokens in order to allow translations;
wenzelm
parents: 9410
diff changeset
    23
  numeral
4ff900551340 constify numeral tokens in order to allow translations;
wenzelm
parents: 9410
diff changeset
    24
6905
9bc05ec3497b added Numeral.thy, Tools/numeral_syntax.ML;
wenzelm
parents:
diff changeset
    25
syntax
11488
4ff900551340 constify numeral tokens in order to allow translations;
wenzelm
parents: 9410
diff changeset
    26
  "_constify" :: "xnum => numeral"    ("_")
4ff900551340 constify numeral tokens in order to allow translations;
wenzelm
parents: 9410
diff changeset
    27
  "_Numeral" :: "numeral => 'a"    ("_")
4ff900551340 constify numeral tokens in order to allow translations;
wenzelm
parents: 9410
diff changeset
    28
6905
9bc05ec3497b added Numeral.thy, Tools/numeral_syntax.ML;
wenzelm
parents:
diff changeset
    29
9035
371f023d3dbd removed explicit terminator (";");
wenzelm
parents: 6988
diff changeset
    30
setup NumeralSyntax.setup
6905
9bc05ec3497b added Numeral.thy, Tools/numeral_syntax.ML;
wenzelm
parents:
diff changeset
    31
9035
371f023d3dbd removed explicit terminator (";");
wenzelm
parents: 6988
diff changeset
    32
end