Moved Option out of IOA into core HOL
authornipkow
Tue Sep 24 09:02:34 1996 +0200 (1996-09-24)
changeset 2019b45d9f2042e0
parent 2018 bcd69cc47cf0
child 2020 586f3c075b05
Moved Option out of IOA into core HOL
src/HOL/Makefile
src/HOL/Option.ML
src/HOL/Option.thy
src/HOL/ROOT.ML
     1.1 --- a/src/HOL/Makefile	Tue Sep 24 08:59:24 1996 +0200
     1.2 +++ b/src/HOL/Makefile	Tue Sep 24 09:02:34 1996 +0200
     1.3 @@ -23,7 +23,7 @@
     1.4  COMP = $(ISABELLECOMP)
     1.5  NAMES = HOL Ord Set Fun subset equalities Prod Relation Trancl Sum WF \
     1.6          mono Lfp Gfp Nat intr_elim indrule Inductive Finite Arith \
     1.7 -        Sexp Univ List RelPow
     1.8 +        Sexp Univ List RelPow Option
     1.9  
    1.10  FILES = ROOT.ML add_ind_def.ML datatype.ML hologic.ML\
    1.11  	ind_syntax.ML cladata.ML simpdata.ML\
    1.12 @@ -111,7 +111,7 @@
    1.13  IOA_NTP_NAMES = Abschannel Action Correctness Impl Lemmas Multiset Packet\
    1.14                  Receiver Sender
    1.15  IOA_ABP_NAMES = Action Correctness Lemmas
    1.16 -IOA_MT_NAMES = Asig IOA Option Solve
    1.17 +IOA_MT_NAMES = Asig IOA Solve
    1.18  
    1.19  IOA_FILES = IOA/NTP/ROOT.ML IOA/ABP/ROOT.ML IOA/NTP/Spec.thy\
    1.20   $(IOA_NTP_NAMES:%=IOA/NTP/%.thy) $(IOA_NTP_NAMES:%=IOA/NTP/%.ML)\
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/src/HOL/Option.ML	Tue Sep 24 09:02:34 1996 +0200
     2.3 @@ -0,0 +1,31 @@
     2.4 +(*  Title:      Option.ML
     2.5 +    ID:         $Id$
     2.6 +    Author:     Tobias Nipkow
     2.7 +    Copyright   1996  TU Muenchen
     2.8 +
     2.9 +Derived rules
    2.10 +*)
    2.11 +
    2.12 +open Option;
    2.13 +
    2.14 +val [prem] = goal Option.thy "P(opt) ==> P(None) | (? x. P(Some(x)))";
    2.15 + br (prem RS rev_mp) 1;
    2.16 + by (option.induct_tac "opt" 1);
    2.17 + by (ALLGOALS(Fast_tac));
    2.18 +bind_thm("optionE", standard(result() RS disjE));
    2.19 +(*
    2.20 +goal Option.thy "opt=None | (? x.opt=Some(x))"; 
    2.21 +by (option.induct_tac "opt" 1);
    2.22 +by (Simp_tac 1);
    2.23 +by (rtac disjI2 1);
    2.24 +by (rtac exI 1);
    2.25 +by (Asm_full_simp_tac 1);
    2.26 +qed"option_cases";
    2.27 +*)
    2.28 +goal Option.thy "P(case opt of None => a | Some(x) => b(x)) = \
    2.29 +\                ((opt = None --> P a) & (!x. opt = Some x --> P(b(x))))";
    2.30 +by (option.induct_tac "opt" 1);
    2.31 +by (Simp_tac 1);
    2.32 +by (Asm_full_simp_tac 1);
    2.33 +by(Fast_tac 1);
    2.34 +qed"expand_option_case";
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/src/HOL/Option.thy	Tue Sep 24 09:02:34 1996 +0200
     3.3 @@ -0,0 +1,11 @@
     3.4 +(*  Title:      Option.thy
     3.5 +    ID:         $Id$
     3.6 +    Author:     Tobias Nipkow
     3.7 +    Copyright   1994  TU Muenchen
     3.8 +
     3.9 +Datatype 'a option
    3.10 +*)
    3.11 +
    3.12 +Option = Arith +
    3.13 +datatype 'a option = None | Some 'a
    3.14 +end
     4.1 --- a/src/HOL/ROOT.ML	Tue Sep 24 08:59:24 1996 +0200
     4.2 +++ b/src/HOL/ROOT.ML	Tue Sep 24 09:02:34 1996 +0200
     4.3 @@ -38,6 +38,7 @@
     4.4  use_thy "RelPow";
     4.5  use_thy "Finite";
     4.6  use_thy "Sexp";
     4.7 +use_thy "Option";
     4.8  use_thy "List";
     4.9  
    4.10  init_pps ();