src/HOL/Option.thy
author paulson
Wed, 05 Nov 1997 13:23:46 +0100
changeset 4153 e534c4c32d54
parent 4133 0a08c2b9b1ed
child 4192 c38ab5af38b5
permissions -rw-r--r--
Ran expandshort, especially to introduce Safe_tac
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2019
b45d9f2042e0 Moved Option out of IOA into core HOL
nipkow
parents:
diff changeset
     1
(*  Title:      Option.thy
b45d9f2042e0 Moved Option out of IOA into core HOL
nipkow
parents:
diff changeset
     2
    ID:         $Id$
b45d9f2042e0 Moved Option out of IOA into core HOL
nipkow
parents:
diff changeset
     3
    Author:     Tobias Nipkow
b45d9f2042e0 Moved Option out of IOA into core HOL
nipkow
parents:
diff changeset
     4
    Copyright   1994  TU Muenchen
b45d9f2042e0 Moved Option out of IOA into core HOL
nipkow
parents:
diff changeset
     5
b45d9f2042e0 Moved Option out of IOA into core HOL
nipkow
parents:
diff changeset
     6
Datatype 'a option
b45d9f2042e0 Moved Option out of IOA into core HOL
nipkow
parents:
diff changeset
     7
*)
b45d9f2042e0 Moved Option out of IOA into core HOL
nipkow
parents:
diff changeset
     8
b45d9f2042e0 Moved Option out of IOA into core HOL
nipkow
parents:
diff changeset
     9
Option = Arith +
4133
0a08c2b9b1ed added the, option_map, and case analysis theorems
oheimb
parents: 2019
diff changeset
    10
2019
b45d9f2042e0 Moved Option out of IOA into core HOL
nipkow
parents:
diff changeset
    11
datatype 'a option = None | Some 'a
4133
0a08c2b9b1ed added the, option_map, and case analysis theorems
oheimb
parents: 2019
diff changeset
    12
0a08c2b9b1ed added the, option_map, and case analysis theorems
oheimb
parents: 2019
diff changeset
    13
constdefs
0a08c2b9b1ed added the, option_map, and case analysis theorems
oheimb
parents: 2019
diff changeset
    14
0a08c2b9b1ed added the, option_map, and case analysis theorems
oheimb
parents: 2019
diff changeset
    15
  the		:: "'a option => 'a"
0a08c2b9b1ed added the, option_map, and case analysis theorems
oheimb
parents: 2019
diff changeset
    16
 "the Ú %y. case y of None => arbitrary | Some x => x"
0a08c2b9b1ed added the, option_map, and case analysis theorems
oheimb
parents: 2019
diff changeset
    17
0a08c2b9b1ed added the, option_map, and case analysis theorems
oheimb
parents: 2019
diff changeset
    18
  option_map	:: "('a => 'b) => ('a option => 'b option)"
0a08c2b9b1ed added the, option_map, and case analysis theorems
oheimb
parents: 2019
diff changeset
    19
 "option_map Ú %f y. case y of None => None | Some x => Some (f x)"
0a08c2b9b1ed added the, option_map, and case analysis theorems
oheimb
parents: 2019
diff changeset
    20
2019
b45d9f2042e0 Moved Option out of IOA into core HOL
nipkow
parents:
diff changeset
    21
end