src/HOL/UNITY/Traces.ML
author paulson
Thu, 03 Dec 1998 10:45:06 +0100
changeset 6012 1894bfc4aee9
parent 5969 e4fe567d10e5
child 6295 351b3c2b0d83
permissions -rw-r--r--
Addition of the States component; parts of Comp not working
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5111
8f4b72f0c15d Uncurried functions LeadsTo and reach
paulson
parents: 5069
diff changeset
     1
(*  Title:      HOL/UNITY/Traces
8f4b72f0c15d Uncurried functions LeadsTo and reach
paulson
parents: 5069
diff changeset
     2
    ID:         $Id$
8f4b72f0c15d Uncurried functions LeadsTo and reach
paulson
parents: 5069
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
8f4b72f0c15d Uncurried functions LeadsTo and reach
paulson
parents: 5069
diff changeset
     4
    Copyright   1998  University of Cambridge
8f4b72f0c15d Uncurried functions LeadsTo and reach
paulson
parents: 5069
diff changeset
     5
8f4b72f0c15d Uncurried functions LeadsTo and reach
paulson
parents: 5069
diff changeset
     6
Definitions of
8f4b72f0c15d Uncurried functions LeadsTo and reach
paulson
parents: 5069
diff changeset
     7
  * traces: the possible execution traces
8f4b72f0c15d Uncurried functions LeadsTo and reach
paulson
parents: 5069
diff changeset
     8
  * reachable: the set of reachable states
8f4b72f0c15d Uncurried functions LeadsTo and reach
paulson
parents: 5069
diff changeset
     9
8f4b72f0c15d Uncurried functions LeadsTo and reach
paulson
parents: 5069
diff changeset
    10
*)
8f4b72f0c15d Uncurried functions LeadsTo and reach
paulson
parents: 5069
diff changeset
    11
5596
b29d18d8c4d2 abstype of programs
paulson
parents: 5584
diff changeset
    12
b29d18d8c4d2 abstype of programs
paulson
parents: 5584
diff changeset
    13
(*** The abstract type of programs ***)
b29d18d8c4d2 abstype of programs
paulson
parents: 5584
diff changeset
    14
6012
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    15
Goalw [restrict_rel_def] "restrict_rel A Id = diag A";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    16
by (Blast_tac 1);
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    17
qed "restrict_rel_Id";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    18
Addsimps [restrict_rel_Id];
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    19
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    20
Goalw [restrict_rel_def] "restrict_rel A (diag B) = diag (A Int B)";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    21
by (Blast_tac 1);
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    22
qed "restrict_rel_diag";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    23
Addsimps [restrict_rel_diag];
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    24
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    25
Goalw [restrict_rel_def]
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    26
    "restrict_rel A (restrict_rel B r) = restrict_rel (A Int B) r";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    27
by (Blast_tac 1);
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    28
qed "restrict_rel_restrict_rel";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    29
Addsimps [restrict_rel_restrict_rel];
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    30
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    31
Goalw [restrict_rel_def] "restrict_rel A r <= A Times A";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    32
by (Blast_tac 1);
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    33
qed "restrict_rel_subset";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    34
Addsimps [restrict_rel_subset];
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    35
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    36
Goalw [restrict_rel_def]
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    37
    "((x,y) : restrict_rel A r) = ((x,y): r & x: A & y: A)";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    38
by (Blast_tac 1);
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    39
qed "restrict_rel_iff";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    40
Addsimps [restrict_rel_iff];
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    41
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    42
Goalw [restrict_rel_def] "r <= A Times A ==> restrict_rel A r = r";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    43
by (Blast_tac 1);
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    44
qed "restrict_rel_eq";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    45
Addsimps [restrict_rel_eq];
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    46
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    47
Goal "acts <= Pow (A Times A) ==> restrict_rel A `` acts = acts";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    48
by Auto_tac;
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    49
by (rtac image_eqI 1);
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    50
by (assume_tac 2);
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    51
by (set_mp_tac 1);
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    52
by (Force_tac 1);
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    53
qed "restrict_rel_image";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    54
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    55
Goalw [restrict_rel_def] "Domain (restrict_rel A r) <= A Int Domain r";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    56
by (Blast_tac 1);
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    57
qed "Domain_restrict_rel";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    58
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    59
Goalw [restrict_rel_def] "restrict_rel A r ^^ B <= A Int (r ^^ B)";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    60
by (Blast_tac 1);
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    61
qed "Image_restrict_rel";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    62
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    63
Addsimps [diag_iff];
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    64
5596
b29d18d8c4d2 abstype of programs
paulson
parents: 5584
diff changeset
    65
val rep_ss = simpset() addsimps 
6012
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    66
                [Int_lower1, image_subset_iff, diag_subset_Times,
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    67
		 States_def, Init_def, Acts_def, 
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    68
		 mk_program_def, Program_def, Rep_Program, 
5596
b29d18d8c4d2 abstype of programs
paulson
parents: 5584
diff changeset
    69
		 Rep_Program_inverse, Abs_Program_inverse];
b29d18d8c4d2 abstype of programs
paulson
parents: 5584
diff changeset
    70
b29d18d8c4d2 abstype of programs
paulson
parents: 5584
diff changeset
    71
6012
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    72
(** Basic laws guaranteed by the abstract type "program" **)
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    73
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    74
Goal "Init F <= States F";
5620
3ac11c4af76a tidying and renaming
paulson
parents: 5608
diff changeset
    75
by (cut_inst_tac [("x", "F")] Rep_Program 1);
5596
b29d18d8c4d2 abstype of programs
paulson
parents: 5584
diff changeset
    76
by (auto_tac (claset(), rep_ss));
6012
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    77
qed "Init_subset_States";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    78
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    79
Goal "Acts F <= Pow(States F Times States F)";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    80
by (cut_inst_tac [("x", "F")] Rep_Program 1);
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    81
by (force_tac (claset(),rep_ss) 1);
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    82
qed "Acts_subset_Pow_States";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    83
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    84
Goal "diag (States F) : Acts F";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    85
by (cut_inst_tac [("x", "F")] Rep_Program 1);
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    86
by (auto_tac (claset(), rep_ss));
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    87
qed "diag_in_Acts";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    88
AddIffs [diag_in_Acts];
5584
aad639e56d4e Now id:(Acts prg) is implicit
paulson
parents: 5426
diff changeset
    89
aad639e56d4e Now id:(Acts prg) is implicit
paulson
parents: 5426
diff changeset
    90
6012
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    91
(** Inspectors for type "program" **)
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    92
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    93
Goal "States (mk_program (states,init,acts)) = states";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    94
by (auto_tac (claset(), rep_ss));
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    95
qed "States_eq";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    96
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
    97
Goal "Init (mk_program (states,init,acts)) = states Int init";
5596
b29d18d8c4d2 abstype of programs
paulson
parents: 5584
diff changeset
    98
by (auto_tac (claset(), rep_ss));
b29d18d8c4d2 abstype of programs
paulson
parents: 5584
diff changeset
    99
qed "Init_eq";
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
   100
6012
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   101
Goal "Acts (mk_program (states,init,acts)) = \
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   102
\     insert (diag states) (restrict_rel states `` acts)";
5596
b29d18d8c4d2 abstype of programs
paulson
parents: 5584
diff changeset
   103
by (auto_tac (claset(), rep_ss));
6012
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   104
qed "Acts_eq_raw";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   105
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   106
Goal "acts <= Pow(states Times states) \
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   107
\     ==> Acts (mk_program (states,init,acts)) = insert (diag states) acts";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   108
by (asm_simp_tac (simpset() addsimps [Acts_eq_raw, restrict_rel_image]) 1);
5423
c57c87628bb4 two new thms
paulson
parents: 5313
diff changeset
   109
qed "Acts_eq";
c57c87628bb4 two new thms
paulson
parents: 5313
diff changeset
   110
6012
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   111
Addsimps [States_eq, Acts_eq, Init_eq];
5596
b29d18d8c4d2 abstype of programs
paulson
parents: 5584
diff changeset
   112
5423
c57c87628bb4 two new thms
paulson
parents: 5313
diff changeset
   113
6012
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   114
(** The notation of equality for type "program" **)
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   115
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   116
Goal "[| States F = States G; Init F = Init G; Acts F = Acts G |] ==> F = G";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   117
by (subgoals_tac ["EX x. Rep_Program F = x",
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   118
		  "EX x. Rep_Program G = x"] 1);
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   119
by (REPEAT (Blast_tac 2));
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   120
by (Clarify_tac 1);
5596
b29d18d8c4d2 abstype of programs
paulson
parents: 5584
diff changeset
   121
by (auto_tac (claset(), rep_ss));
6012
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   122
by (REPEAT (dres_inst_tac [("f", "Abs_Program")] arg_cong 1));
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   123
by (asm_full_simp_tac rep_ss 1);
5596
b29d18d8c4d2 abstype of programs
paulson
parents: 5584
diff changeset
   124
qed "program_equalityI";
5426
566f47250bd0 A new approach, using simp_of_act and simp_of_set to activate definitions when
paulson
parents: 5423
diff changeset
   125
5969
e4fe567d10e5 new theorem program_equalityE
paulson
parents: 5648
diff changeset
   126
val [major,minor] =
6012
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   127
Goal "[| F = G; \
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   128
\        [| States F = States G; Init F = Init G; Acts F = Acts G |] ==> P \
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   129
\     |] ==> P";
5969
e4fe567d10e5 new theorem program_equalityE
paulson
parents: 5648
diff changeset
   130
by (rtac minor 1);
e4fe567d10e5 new theorem program_equalityE
paulson
parents: 5648
diff changeset
   131
by (auto_tac (claset(), simpset() addsimps [major]));
e4fe567d10e5 new theorem program_equalityE
paulson
parents: 5648
diff changeset
   132
qed "program_equalityE";
5426
566f47250bd0 A new approach, using simp_of_act and simp_of_set to activate definitions when
paulson
parents: 5423
diff changeset
   133
6012
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   134
(*** These rules allow "lazy" definition expansion 
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   135
     They avoid expanding the full program, which is a large expression
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   136
***)
5426
566f47250bd0 A new approach, using simp_of_act and simp_of_set to activate definitions when
paulson
parents: 5423
diff changeset
   137
6012
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   138
Goal "[| F == mk_program (states,init,acts) |] \
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   139
\     ==> States F = states";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   140
by Auto_tac;
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   141
qed "def_prg_States";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   142
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   143
Goal "[| F == mk_program (states,init,acts); init <= states |] \
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   144
\     ==> Init F = init";
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5620
diff changeset
   145
by Auto_tac;
fe887910e32e specifications as sets of programs
paulson
parents: 5620
diff changeset
   146
qed "def_prg_Init";
fe887910e32e specifications as sets of programs
paulson
parents: 5620
diff changeset
   147
6012
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   148
Goal "[| F == mk_program (states,init,acts); \
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   149
\        acts <= Pow(states Times states) |] \
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   150
\     ==> Acts F = insert (diag states) acts";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   151
by (asm_simp_tac (simpset() addsimps [restrict_rel_image]) 1);
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   152
qed "def_prg_Acts";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   153
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5620
diff changeset
   154
(*The program is not expanded, but its Init and Acts are*)
6012
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   155
Goal "[| F == mk_program (states,init,acts); \
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   156
\        init <= states;  acts <= Pow(states Times states) |] \
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   157
\     ==> Init F = init & Acts F = insert (diag states) acts";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   158
by (asm_simp_tac (HOL_ss addsimps [def_prg_Init, def_prg_Acts]) 1);
5426
566f47250bd0 A new approach, using simp_of_act and simp_of_set to activate definitions when
paulson
parents: 5423
diff changeset
   159
qed "def_prg_simps";
566f47250bd0 A new approach, using simp_of_act and simp_of_set to activate definitions when
paulson
parents: 5423
diff changeset
   160
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5620
diff changeset
   161
(*An action is expanded only if a pair of states is being tested against it*)
6012
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   162
Goal "[| act == {(s,s'). P s s'} |] ==> ((s,s') : act) = P s s'";
5426
566f47250bd0 A new approach, using simp_of_act and simp_of_set to activate definitions when
paulson
parents: 5423
diff changeset
   163
by Auto_tac;
566f47250bd0 A new approach, using simp_of_act and simp_of_set to activate definitions when
paulson
parents: 5423
diff changeset
   164
qed "def_act_simp";
566f47250bd0 A new approach, using simp_of_act and simp_of_set to activate definitions when
paulson
parents: 5423
diff changeset
   165
566f47250bd0 A new approach, using simp_of_act and simp_of_set to activate definitions when
paulson
parents: 5423
diff changeset
   166
fun simp_of_act def = def RS def_act_simp;
566f47250bd0 A new approach, using simp_of_act and simp_of_set to activate definitions when
paulson
parents: 5423
diff changeset
   167
5648
fe887910e32e specifications as sets of programs
paulson
parents: 5620
diff changeset
   168
(*A set is expanded only if an element is being tested against it*)
6012
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   169
Goal "A == B ==> (x : A) = (x : B)";
5426
566f47250bd0 A new approach, using simp_of_act and simp_of_set to activate definitions when
paulson
parents: 5423
diff changeset
   170
by Auto_tac;
566f47250bd0 A new approach, using simp_of_act and simp_of_set to activate definitions when
paulson
parents: 5423
diff changeset
   171
qed "def_set_simp";
566f47250bd0 A new approach, using simp_of_act and simp_of_set to activate definitions when
paulson
parents: 5423
diff changeset
   172
566f47250bd0 A new approach, using simp_of_act and simp_of_set to activate definitions when
paulson
parents: 5423
diff changeset
   173
fun simp_of_set def = def RS def_set_simp;
566f47250bd0 A new approach, using simp_of_act and simp_of_set to activate definitions when
paulson
parents: 5423
diff changeset
   174
5596
b29d18d8c4d2 abstype of programs
paulson
parents: 5584
diff changeset
   175
b29d18d8c4d2 abstype of programs
paulson
parents: 5584
diff changeset
   176
(*** traces and reachable ***)
b29d18d8c4d2 abstype of programs
paulson
parents: 5584
diff changeset
   177
6012
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   178
Goal "reachable F <= States F";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   179
by Safe_tac;
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   180
by (etac reachable.induct 1);
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   181
by (blast_tac (claset() addDs [impOfSubs Acts_subset_Pow_States]) 2);
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   182
by (blast_tac (claset() addIs [impOfSubs Init_subset_States]) 1);
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   183
qed "reachable_subset_States";
1894bfc4aee9 Addition of the States component; parts of Comp not working
paulson
parents: 5969
diff changeset
   184
5620
3ac11c4af76a tidying and renaming
paulson
parents: 5608
diff changeset
   185
Goal "reachable F = {s. EX evs. (s,evs): traces (Init F) (Acts F)}";
5596
b29d18d8c4d2 abstype of programs
paulson
parents: 5584
diff changeset
   186
by Safe_tac;
b29d18d8c4d2 abstype of programs
paulson
parents: 5584
diff changeset
   187
by (etac traces.induct 2);
b29d18d8c4d2 abstype of programs
paulson
parents: 5584
diff changeset
   188
by (etac reachable.induct 1);
5620
3ac11c4af76a tidying and renaming
paulson
parents: 5608
diff changeset
   189
by (ALLGOALS (blast_tac (claset() addIs reachable.intrs @ traces.intrs)));
5596
b29d18d8c4d2 abstype of programs
paulson
parents: 5584
diff changeset
   190
qed "reachable_equiv_traces";