src/HOL/UNITY/Lift_prog.ML
author wenzelm
Thu, 10 Feb 2000 13:34:52 +0100
changeset 8228 8283e416b680
parent 8216 e4b3192dfefa
child 8251 9be357df93d4
permissions -rw-r--r--
added easy_setup;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
     1
(*  Title:      HOL/UNITY/Lift_prog.ML
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
     2
    ID:         $Id$
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
     4
    Copyright   1998  University of Cambridge
7482
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
     5
7826
c6a8b73b6c2a working shapshot with "projecting" and "extending"
paulson
parents: 7688
diff changeset
     6
Arrays of processes.  Many results are instances of those in Extend & Project.
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
     7
*)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
     8
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
     9
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    10
(*** Basic properties ***)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    11
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    12
(** lift_set and drop_set **)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    13
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    14
Goalw [lift_set_def] "(f : lift_set i A) = (f i : A)";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    15
by Auto_tac;
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    16
qed "lift_set_iff";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    17
AddIffs [lift_set_iff];
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    18
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
    19
Goalw [lift_set_def] "lift_set i A Int lift_set i B = lift_set i (A Int B)";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
    20
by Auto_tac;
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
    21
qed "Int_lift_set";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
    22
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
    23
Goalw [lift_set_def] "lift_set i A Un lift_set i B = lift_set i (A Un B)";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    24
by Auto_tac;
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
    25
qed "Un_lift_set";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
    26
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
    27
Goalw [lift_set_def] "lift_set i A - lift_set i B = lift_set i (A-B)";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
    28
by Auto_tac;
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
    29
qed "Diff_lift_set";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
    30
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
    31
Addsimps [Int_lift_set, Un_lift_set, Diff_lift_set];
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    32
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    33
(** lift_act and drop_act **)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    34
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    35
(*For compatibility with the original definition and perhaps simpler proofs*)
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    36
Goalw [lift_act_def]
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    37
    "((f,f') : lift_act i act) = (EX s'. f' = f(i := s') & (f i, s') : act)";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    38
by Auto_tac;
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    39
by (rtac exI 1);
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    40
by Auto_tac;
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    41
qed "lift_act_eq";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    42
AddIffs [lift_act_eq];
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    43
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    44
(** lift_prog and drop_prog **)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    45
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    46
Goalw [lift_prog_def] "Init (lift_prog i F) = lift_set i (Init F)";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    47
by Auto_tac;
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    48
qed "Init_lift_prog";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    49
Addsimps [Init_lift_prog];
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    50
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    51
Goalw [lift_prog_def] "Acts (lift_prog i F) = lift_act i `` Acts F";
8041
e3237d8c18d6 working version with new theory ELT
paulson
parents: 7947
diff changeset
    52
by (auto_tac (claset() addIs [rev_image_eqI], simpset()));
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    53
qed "Acts_lift_prog";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    54
Addsimps [Acts_lift_prog];
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    55
7880
62fb24e28e5e exchanged the first two args of "project" and "drop_prog"
paulson
parents: 7878
diff changeset
    56
Goalw [drop_prog_def] "Init (drop_prog i C F) = drop_set i (Init F)";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    57
by Auto_tac;
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    58
qed "Init_drop_prog";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    59
Addsimps [Init_drop_prog];
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    60
7880
62fb24e28e5e exchanged the first two args of "project" and "drop_prog"
paulson
parents: 7878
diff changeset
    61
Goal "Acts (drop_prog i C F) = insert Id (drop_act i `` Restrict C `` Acts F)";
8041
e3237d8c18d6 working version with new theory ELT
paulson
parents: 7947
diff changeset
    62
by (auto_tac (claset() addIs [image_eqI], 
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    63
	      simpset() addsimps [drop_prog_def]));
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    64
qed "Acts_drop_prog";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    65
Addsimps [Acts_drop_prog];
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    66
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    67
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    68
(*** sub ***)
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    69
7947
b999c1ab9327 working again; new treatment of LocalTo
paulson
parents: 7915
diff changeset
    70
Goal "sub i f = f i";
b999c1ab9327 working again; new treatment of LocalTo
paulson
parents: 7915
diff changeset
    71
by (simp_tac (simpset() addsimps [sub_def]) 1);
b999c1ab9327 working again; new treatment of LocalTo
paulson
parents: 7915
diff changeset
    72
qed "sub_apply";
b999c1ab9327 working again; new treatment of LocalTo
paulson
parents: 7915
diff changeset
    73
Addsimps [sub_apply];
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    74
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    75
Goal "lift_set i {s. P s} = {s. P (sub i s)}";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    76
by (asm_simp_tac (simpset() addsimps [lift_set_def]) 1);
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    77
qed "lift_set_sub";
7343
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
    78
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    79
Goal "{s. P (s i)} = lift_set i {s. P s}";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    80
by (asm_simp_tac (simpset() addsimps [lift_set_def]) 1);
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    81
qed "Collect_eq_lift_set";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    82
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    83
Goal "sub i -`` A = lift_set i A";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    84
by (Force_tac 1);
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    85
qed "sub_vimage";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    86
Addsimps [sub_vimage];
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    87
8055
bb15396278fb abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents: 8041
diff changeset
    88
(*For tidying the result of "export"*)
bb15396278fb abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents: 8041
diff changeset
    89
Goal "v o (%z. z i) = v o sub i";
bb15396278fb abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents: 8041
diff changeset
    90
by (simp_tac (simpset() addsimps [sub_def]) 1);
bb15396278fb abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents: 8041
diff changeset
    91
qed "fold_o_sub";
bb15396278fb abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents: 8041
diff changeset
    92
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    93
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    94
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    95
(*** lift_prog and the lattice operations ***)
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    96
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    97
Goal "lift_prog i SKIP = SKIP";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    98
by (auto_tac (claset() addSIs [program_equalityI],
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    99
	      simpset() addsimps [SKIP_def, lift_prog_def]));
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   100
qed "lift_prog_SKIP";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   101
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   102
Goal "lift_prog i (F Join G) = (lift_prog i F) Join (lift_prog i G)";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   103
by (rtac program_equalityI 1);
7537
875754b599df working snapshot
paulson
parents: 7525
diff changeset
   104
by Auto_tac;
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   105
qed "lift_prog_Join";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   106
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   107
Goal "lift_prog i (JOIN J F) = (JN j:J. lift_prog i (F j))";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   108
by (rtac program_equalityI 1);
7537
875754b599df working snapshot
paulson
parents: 7525
diff changeset
   109
by Auto_tac;
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   110
qed "lift_prog_JN";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   111
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   112
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   113
(*** Equivalence with "extend" version ***)
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   114
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   115
Goalw [lift_map_def] "good_map (lift_map i)";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   116
by (rtac good_mapI 1);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   117
by (res_inst_tac [("f", "%f. (f i, f)")] surjI 1);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   118
by Auto_tac;
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   119
by (dres_inst_tac [("f", "%f. f i")] arg_cong 1);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   120
by Auto_tac;
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   121
qed "good_map_lift_map";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   122
8122
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   123
fun lift_export0 th = 
8055
bb15396278fb abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents: 8041
diff changeset
   124
    good_map_lift_map RS export th 
8216
e4b3192dfefa updated the Client example
paulson
parents: 8128
diff changeset
   125
       |> simplify (simpset() addsimps [fold_o_sub]);
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   126
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   127
Goal "fst (inv (lift_map i) g) = g i";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   128
by (rtac (good_map_lift_map RS good_map_is_surj RS fst_inv_equalityI) 1);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   129
by (auto_tac (claset(), simpset() addsimps [lift_map_def]));
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   130
qed "fst_inv_lift_map";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   131
Addsimps [fst_inv_lift_map];
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   132
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   133
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   134
Goal "lift_set i A = extend_set (lift_map i) A";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   135
by (auto_tac (claset(), 
8122
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   136
     simpset() addsimps [lift_export0 mem_extend_set_iff]));
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   137
qed "lift_set_correct";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   138
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   139
Goalw [drop_set_def, project_set_def, lift_map_def]
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   140
     "drop_set i A = project_set (lift_map i) A";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   141
by Auto_tac;
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   142
by (rtac image_eqI 2);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   143
by (rtac exI 1);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   144
by (stac (refl RS fun_upd_idem) 1);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   145
by Auto_tac;
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   146
qed "drop_set_correct";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   147
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   148
Goal "lift_act i = extend_act (lift_map i)";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   149
by (rtac ext 1);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   150
by Auto_tac;
8122
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   151
by (forward_tac [lift_export0 extend_act_D] 2);
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   152
by (auto_tac (claset(), simpset() addsimps [extend_act_def]));
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   153
by (auto_tac (claset(), simpset() addsimps [extend_act_def, lift_map_def]));
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   154
by (rtac bexI 1);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   155
by (auto_tac (claset() addSIs [exI], simpset()));
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   156
qed "lift_act_correct";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   157
7878
43b03d412b82 working version with localTo[C] instead of localTo
paulson
parents: 7840
diff changeset
   158
Goal "drop_act i = project_act (lift_map i)";
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   159
by (rtac ext 1);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   160
by (rewrite_goals_tac [project_act_def, drop_act_def, lift_map_def]);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   161
by Auto_tac;
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   162
by (REPEAT_FIRST (ares_tac [exI, conjI]));
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   163
by Auto_tac;
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   164
by (REPEAT_FIRST (assume_tac ORELSE' stac (refl RS fun_upd_idem)));
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   165
qed "drop_act_correct";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   166
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   167
Goal "lift_prog i = extend (lift_map i)";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   168
by (rtac (program_equalityI RS ext) 1);
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   169
by (simp_tac (simpset() addsimps [lift_set_correct]) 1);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   170
by (simp_tac (simpset() 
8122
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   171
	      addsimps [lift_export0 Acts_extend, 
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   172
			lift_act_correct]) 1);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   173
qed "lift_prog_correct";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   174
7880
62fb24e28e5e exchanged the first two args of "project" and "drop_prog"
paulson
parents: 7878
diff changeset
   175
Goal "drop_prog i C = project (lift_map i) C";
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   176
by (rtac (program_equalityI RS ext) 1);
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   177
by (simp_tac (simpset() addsimps [drop_set_correct]) 1);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   178
by (simp_tac (simpset() 
7547
a72a551b6d79 new proof of drop_prog_correct for new definition of project_act
paulson
parents: 7537
diff changeset
   179
	      addsimps [Acts_project, drop_act_correct]) 1);
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   180
qed "drop_prog_correct";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   181
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   182
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   183
(** Injectivity of lift_set, lift_act, lift_prog **)
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   184
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   185
Goalw [lift_set_def, drop_set_def] "drop_set i (lift_set i F) = F";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   186
by Auto_tac;
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   187
qed "lift_set_inverse";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   188
Addsimps [lift_set_inverse];
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   189
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   190
Goal "inj (lift_set i)";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   191
by (rtac inj_on_inverseI 1);
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   192
by (rtac lift_set_inverse 1);
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   193
qed "inj_lift_set";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   194
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   195
(*Because A and B could differ outside i, cannot generalize result to 
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   196
   drop_set i (A Int B) = drop_set i A Int drop_set i B
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   197
*)
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   198
Goalw [lift_set_def, drop_set_def]
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   199
     "drop_set i ((lift_set i A) Int B) = A Int (drop_set i B)";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   200
by Auto_tac;
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   201
qed "drop_set_Int_lift_set";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   202
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   203
Goalw [lift_set_def, drop_set_def]
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   204
     "drop_set i (B Int (lift_set i A)) = (drop_set i B) Int A";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   205
by Auto_tac;
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   206
qed "drop_set_Int_lift_set2";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   207
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   208
Goalw [drop_set_def]
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   209
     "i : I ==> drop_set i (INT j:I. lift_set j A) = A";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   210
by Auto_tac;
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   211
qed "drop_set_INT";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   212
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   213
Goal "lift_set i UNIV = UNIV";
8128
3a5864b465e2 still working; a bit of polishing
paulson
parents: 8122
diff changeset
   214
by (simp_tac (simpset() addsimps [lift_set_correct, 
3a5864b465e2 still working; a bit of polishing
paulson
parents: 8122
diff changeset
   215
				  lift_export0 extend_set_UNIV_eq]) 1);
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   216
qed "lift_set_UNIV_eq";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   217
Addsimps [lift_set_UNIV_eq];
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   218
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   219
Goal "inj (lift_prog i)";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   220
by (simp_tac
8122
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   221
    (simpset() addsimps [lift_prog_correct, lift_export0 inj_extend]) 1);
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   222
qed "inj_lift_prog";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   223
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   224
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   225
(*** More Lemmas ***)
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   226
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   227
Goal "lift_act i act ^^ lift_set i A = lift_set i (act^^A)";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   228
by (asm_simp_tac (simpset() addsimps [lift_set_correct, lift_act_correct,
8122
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   229
				      lift_export0 extend_act_Image]) 1);
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   230
qed "lift_act_Image";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   231
Addsimps [lift_act_Image];
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   232
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   233
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   234
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   235
(*** Safety: co, stable, invariant ***)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   236
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   237
(** Safety and lift_prog **)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   238
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   239
Goal "(lift_prog i F : (lift_set i A) co (lift_set i B))  =  \
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   240
\     (F : A co B)";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   241
by (auto_tac (claset(), 
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   242
	      simpset() addsimps [constrains_def]));
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   243
by (Force_tac 1);
7343
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   244
qed "lift_prog_constrains";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   245
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   246
Goal "(lift_prog i F : stable (lift_set i A)) = (F : stable A)";
7343
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   247
by (simp_tac (simpset() addsimps [stable_def, lift_prog_constrains]) 1);
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   248
qed "lift_prog_stable";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   249
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   250
Goal "(lift_prog i F : invariant (lift_set i A)) = (F : invariant A)";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   251
by (auto_tac (claset(),
7343
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   252
	      simpset() addsimps [invariant_def, lift_prog_stable]));
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   253
qed "lift_prog_invariant";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   254
7826
c6a8b73b6c2a working shapshot with "projecting" and "extending"
paulson
parents: 7688
diff changeset
   255
Goal "[| lift_prog i F : A co B |] \
c6a8b73b6c2a working shapshot with "projecting" and "extending"
paulson
parents: 7688
diff changeset
   256
\     ==> F : (drop_set i A) co (drop_set i B)";
c6a8b73b6c2a working shapshot with "projecting" and "extending"
paulson
parents: 7688
diff changeset
   257
by (asm_full_simp_tac
c6a8b73b6c2a working shapshot with "projecting" and "extending"
paulson
parents: 7688
diff changeset
   258
    (simpset() addsimps [drop_set_correct, lift_prog_correct, 
8122
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   259
			 lift_export0 extend_constrains_project_set]) 1);
7826
c6a8b73b6c2a working shapshot with "projecting" and "extending"
paulson
parents: 7688
diff changeset
   260
qed "lift_prog_constrains_drop_set";
c6a8b73b6c2a working shapshot with "projecting" and "extending"
paulson
parents: 7688
diff changeset
   261
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   262
(*This one looks strange!  Proof probably is by case analysis on i=j.
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   263
  If i~=j then lift_prog j (F j) does nothing to lift_set i, and the 
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   264
  premise ensures A<=B.*)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   265
Goal "F i : A co B  \
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   266
\     ==> lift_prog j (F j) : (lift_set i A) co (lift_set i B)";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   267
by (auto_tac (claset(), 
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   268
	      simpset() addsimps [constrains_def]));
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   269
by (REPEAT (Blast_tac 1));
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   270
qed "constrains_imp_lift_prog_constrains";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   271
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   272
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   273
(** Safety and drop_prog **)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   274
7880
62fb24e28e5e exchanged the first two args of "project" and "drop_prog"
paulson
parents: 7878
diff changeset
   275
Goal "(drop_prog i C F : A co B)  =  \
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   276
\     (F : (C Int lift_set i A) co (lift_set i B) & A <= B)";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   277
by (simp_tac
8128
3a5864b465e2 still working; a bit of polishing
paulson
parents: 8122
diff changeset
   278
    (simpset() addsimps [drop_prog_correct, lift_set_correct, 
3a5864b465e2 still working; a bit of polishing
paulson
parents: 8122
diff changeset
   279
			 lift_export0 project_constrains]) 1);
7343
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   280
qed "drop_prog_constrains";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   281
7880
62fb24e28e5e exchanged the first two args of "project" and "drop_prog"
paulson
parents: 7878
diff changeset
   282
Goal "(drop_prog i UNIV F : stable A)  =  (F : stable (lift_set i A))";
7343
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   283
by (simp_tac (simpset() addsimps [stable_def, drop_prog_constrains]) 1);
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   284
qed "drop_prog_stable";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   285
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   286
7343
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   287
(*** Weak safety primitives: Co, Stable ***)
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   288
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   289
(** Reachability **)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   290
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   291
Goal "reachable (lift_prog i F) = lift_set i (reachable F)";
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   292
by (simp_tac
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   293
    (simpset() addsimps [lift_prog_correct, lift_set_correct, 
8122
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   294
			 lift_export0 reachable_extend_eq]) 1);
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   295
qed "reachable_lift_prog";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   296
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   297
Goal "(lift_prog i F : (lift_set i A) Co (lift_set i B))  =  \
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   298
\     (F : A Co B)";
7947
b999c1ab9327 working again; new treatment of LocalTo
paulson
parents: 7915
diff changeset
   299
by (simp_tac
b999c1ab9327 working again; new treatment of LocalTo
paulson
parents: 7915
diff changeset
   300
    (simpset() addsimps [lift_prog_correct, lift_set_correct, 
8122
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   301
			 lift_export0 extend_Constrains]) 1);
7343
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   302
qed "lift_prog_Constrains";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   303
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   304
Goal "(lift_prog i F : Stable (lift_set i A)) = (F : Stable A)";
7343
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   305
by (simp_tac (simpset() addsimps [Stable_def, lift_prog_Constrains]) 1);
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   306
qed "lift_prog_Stable";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   307
8128
3a5864b465e2 still working; a bit of polishing
paulson
parents: 8122
diff changeset
   308
Goal "F Join drop_prog i (reachable (lift_prog i F Join G)) G : A Co B  \
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   309
\     ==> lift_prog i F Join G : (lift_set i A) Co (lift_set i B)";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   310
by (asm_full_simp_tac
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   311
    (simpset() addsimps [lift_prog_correct, drop_prog_correct, 
8122
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   312
		     lift_set_correct, lift_export0 project_Constrains_D]) 1);
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   313
qed "drop_prog_Constrains_D";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   314
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   315
Goalw [Stable_def]
8128
3a5864b465e2 still working; a bit of polishing
paulson
parents: 8122
diff changeset
   316
     "F Join drop_prog i (reachable (lift_prog i F Join G)) G : Stable A  \
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   317
\     ==> lift_prog i F Join G : Stable (lift_set i A)";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   318
by (asm_simp_tac (simpset() addsimps [drop_prog_Constrains_D]) 1);
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   319
qed "drop_prog_Stable_D";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   320
8128
3a5864b465e2 still working; a bit of polishing
paulson
parents: 8122
diff changeset
   321
Goal "F Join drop_prog i (reachable (lift_prog i F Join G)) G : Always A  \
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   322
\     ==> lift_prog i F Join G : Always (lift_set i A)";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   323
by (asm_full_simp_tac
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   324
    (simpset() addsimps [lift_prog_correct, drop_prog_correct, 
8122
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   325
		     lift_set_correct, lift_export0 project_Always_D]) 1);
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   326
qed "drop_prog_Always_D";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   327
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   328
Goalw [Increasing_def]
8128
3a5864b465e2 still working; a bit of polishing
paulson
parents: 8122
diff changeset
   329
 "F Join drop_prog i (reachable (lift_prog i F Join G)) G : Increasing func \
3a5864b465e2 still working; a bit of polishing
paulson
parents: 8122
diff changeset
   330
\ ==> lift_prog i F Join G : Increasing (func o (sub i))";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   331
by Auto_tac;
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   332
by (stac Collect_eq_lift_set 1);
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   333
by (asm_simp_tac (simpset() addsimps [drop_prog_Stable_D]) 1); 
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   334
qed "project_Increasing_D";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   335
7361
477e1bdf230f changed "guar" back to "guarantees" (sorry)
paulson
parents: 7343
diff changeset
   336
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   337
(*** Progress: transient, ensures ***)
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   338
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   339
Goal "(lift_prog i F : transient (lift_set i A)) = (F : transient A)";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   340
by (simp_tac (simpset() addsimps [lift_set_correct, lift_prog_correct,
8122
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   341
			  lift_export0 extend_transient]) 1);
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   342
qed "lift_prog_transient";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   343
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   344
Goal "(lift_prog i F : transient (lift_set j A)) = \
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   345
\     (i=j & F : transient A | A={})";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   346
by (case_tac "i=j" 1);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   347
by (auto_tac (claset(), simpset() addsimps [lift_prog_transient]));
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   348
by (auto_tac (claset(), simpset() addsimps [lift_prog_def, transient_def]));
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   349
by (Force_tac 1);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   350
qed "lift_prog_transient_eq_disj";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   351
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   352
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   353
(*** guarantees properties ***)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   354
8065
658e0d4e4ed9 first working version to Alloc/System_Client_Progress;
paulson
parents: 8055
diff changeset
   355
Goal "lift_prog i F : preserves (v o sub j) = \
658e0d4e4ed9 first working version to Alloc/System_Client_Progress;
paulson
parents: 8055
diff changeset
   356
\     (if i=j then F : preserves v else True)";
658e0d4e4ed9 first working version to Alloc/System_Client_Progress;
paulson
parents: 8055
diff changeset
   357
by (simp_tac (simpset() addsimps [lift_prog_correct,
8122
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   358
				  lift_export0 extend_preserves]) 1);
8065
658e0d4e4ed9 first working version to Alloc/System_Client_Progress;
paulson
parents: 8055
diff changeset
   359
by (auto_tac (claset(),
658e0d4e4ed9 first working version to Alloc/System_Client_Progress;
paulson
parents: 8055
diff changeset
   360
	      simpset() addsimps [preserves_def, extend_def, extend_act_def, 
658e0d4e4ed9 first working version to Alloc/System_Client_Progress;
paulson
parents: 8055
diff changeset
   361
				  stable_def, constrains_def, lift_map_def]));
658e0d4e4ed9 first working version to Alloc/System_Client_Progress;
paulson
parents: 8055
diff changeset
   362
qed "lift_prog_preserves_sub";
658e0d4e4ed9 first working version to Alloc/System_Client_Progress;
paulson
parents: 8055
diff changeset
   363
658e0d4e4ed9 first working version to Alloc/System_Client_Progress;
paulson
parents: 8055
diff changeset
   364
Addsimps [lift_prog_preserves_sub];
658e0d4e4ed9 first working version to Alloc/System_Client_Progress;
paulson
parents: 8055
diff changeset
   365
8055
bb15396278fb abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents: 8041
diff changeset
   366
Goal "G : preserves (v o sub i) ==> drop_prog i C G : preserves v";
bb15396278fb abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents: 8041
diff changeset
   367
by (asm_simp_tac
bb15396278fb abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents: 8041
diff changeset
   368
    (simpset() addsimps [drop_prog_correct, fold_o_sub,
8122
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   369
			 lift_export0 project_preserves_I]) 1);
8055
bb15396278fb abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents: 8041
diff changeset
   370
qed "drop_prog_preserves_I";
bb15396278fb abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents: 8041
diff changeset
   371
8041
e3237d8c18d6 working version with new theory ELT
paulson
parents: 7947
diff changeset
   372
(*The raw version*)
e3237d8c18d6 working version with new theory ELT
paulson
parents: 7947
diff changeset
   373
val [xguary,drop_prog,lift_prog] =
8055
bb15396278fb abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents: 8041
diff changeset
   374
Goal "[| F : X guarantees[v] Y;  \
8122
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   375
\        !!G. lift_prog i F Join G : X' ==> F Join drop_prog i (C G) G : X;  \
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   376
\        !!G. [| F Join drop_prog i (C G) G : Y; lift_prog i F Join G : X'; \
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   377
\                G : preserves (v o sub i) |] \
8041
e3237d8c18d6 working version with new theory ELT
paulson
parents: 7947
diff changeset
   378
\             ==> lift_prog i F Join G : Y' |] \
8055
bb15396278fb abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents: 8041
diff changeset
   379
\     ==> lift_prog i F : X' guarantees[v o sub i] Y'";
8041
e3237d8c18d6 working version with new theory ELT
paulson
parents: 7947
diff changeset
   380
by (rtac (xguary RS guaranteesD RS lift_prog RS guaranteesI) 1);
8055
bb15396278fb abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents: 8041
diff changeset
   381
by (etac drop_prog_preserves_I 1);
8041
e3237d8c18d6 working version with new theory ELT
paulson
parents: 7947
diff changeset
   382
by (etac drop_prog 1);
8122
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   383
by Auto_tac;
8041
e3237d8c18d6 working version with new theory ELT
paulson
parents: 7947
diff changeset
   384
qed "drop_prog_guarantees_raw";
e3237d8c18d6 working version with new theory ELT
paulson
parents: 7947
diff changeset
   385
8055
bb15396278fb abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents: 8041
diff changeset
   386
Goal "[| F : X guarantees[v] Y;  \
bb15396278fb abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents: 8041
diff changeset
   387
\        projecting  C (lift_map i) F X' X;  \
bb15396278fb abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents: 8041
diff changeset
   388
\        extending w C (lift_map i) F Y' Y; \
bb15396278fb abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents: 8041
diff changeset
   389
\        preserves w <= preserves (v o sub i) |] \
bb15396278fb abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents: 8041
diff changeset
   390
\     ==> lift_prog i F : X' guarantees[w] Y'";
bb15396278fb abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents: 8041
diff changeset
   391
by (asm_simp_tac
bb15396278fb abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents: 8041
diff changeset
   392
    (simpset() addsimps [lift_prog_correct, fold_o_sub,
8122
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   393
			 lift_export0 project_guarantees]) 1);
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   394
qed "drop_prog_guarantees";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   395
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   396
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   397
(** Are these two useful?? **)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   398
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   399
(*The other direction fails: having FF : Stable {s. z <= f (s i)} does not
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   400
  ensure that F has the form lift_prog i F for some F.*)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   401
Goal "lift_prog i `` Stable {s. P (f s)} <= Stable {s. P (f (s i))}";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   402
by Auto_tac;
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   403
by (stac Collect_eq_lift_set 1); 
7343
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   404
by (asm_simp_tac (simpset() addsimps [lift_prog_Stable]) 1);
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   405
qed "image_lift_prog_Stable";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   406
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   407
Goal "lift_prog i `` Increasing f <= Increasing (f o sub i)";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   408
by (simp_tac (simpset() addsimps [Increasing_def,
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   409
				  inj_lift_prog RS image_INT]) 1);
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   410
by (blast_tac (claset() addIs [impOfSubs image_lift_prog_Stable]) 1);
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   411
qed "image_lift_prog_Increasing";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   412
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   413
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   414
(*** guarantees corollaries ***)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   415
8055
bb15396278fb abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents: 8041
diff changeset
   416
Goal "F : UNIV guarantees[v] increasing func \
bb15396278fb abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents: 8041
diff changeset
   417
\   ==> lift_prog i F : UNIV guarantees[v o sub i] increasing (func o sub i)";
8122
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   418
by (dtac (lift_export0 extend_guar_increasing) 1);
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   419
by (asm_full_simp_tac (simpset() addsimps [lift_prog_correct, o_def]) 1);
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   420
qed "lift_prog_guar_increasing";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   421
8055
bb15396278fb abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents: 8041
diff changeset
   422
Goal "F : UNIV guarantees[v] Increasing func \
bb15396278fb abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents: 8041
diff changeset
   423
\   ==> lift_prog i F : UNIV guarantees[v o sub i] Increasing (func o sub i)";
8122
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   424
by (dtac (lift_export0 extend_guar_Increasing) 1);
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   425
by (asm_full_simp_tac (simpset() addsimps [lift_prog_correct, o_def]) 1);
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   426
qed "lift_prog_guar_Increasing";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   427
8055
bb15396278fb abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents: 8041
diff changeset
   428
Goal "F : Always A guarantees[v] Always B \
bb15396278fb abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents: 8041
diff changeset
   429
\ ==> lift_prog i F : \
bb15396278fb abolition of localTo: instead "guarantees" has local vars as extra argument
paulson
parents: 8041
diff changeset
   430
\       Always(lift_set i A) guarantees[v o sub i] Always (lift_set i B)";
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   431
by (asm_simp_tac
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   432
    (simpset() addsimps [lift_set_correct, lift_prog_correct, 
8122
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   433
			 lift_export0 extend_guar_Always]) 1);
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   434
qed "lift_prog_guar_Always";
8122
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   435
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   436
(*version for outside use*)
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   437
fun lift_export th = 
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   438
    good_map_lift_map RS export th 
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   439
       |> simplify
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   440
             (simpset() addsimps [fold_o_sub, 
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   441
				  drop_set_correct RS sym, 
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   442
				  lift_set_correct RS sym, 
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   443
				  drop_prog_correct RS sym, 
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   444
				  lift_prog_correct RS sym]);;
b43ad07660b9 working version, with Alloc now working on the same state space as the whole
paulson
parents: 8065
diff changeset
   445