src/HOLCF/IOA/NTP/Impl.ML
author wenzelm
Thu, 15 Feb 2001 17:18:54 +0100
changeset 11145 3e47692e3a3e
parent 9636 a0d4d9de9893
child 12218 6597093b77e7
permissions -rw-r--r--
eliminate get_def;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
     1
(*  Title:      HOL/IOA/NTP/Impl.ML
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
     2
    ID:         $Id$
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
     3
    Author:     Tobias Nipkow & Konrad Slind
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
     4
    Copyright   1994  TU Muenchen
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
     5
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
     6
The implementation --- Invariants
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
     7
*)
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
     8
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
     9
8741
61bc5ed22b62 removal of less_SucI, le_SucI from default simpset
paulson
parents: 7322
diff changeset
    10
Addsimps [Let_def, le_SucI];
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    11
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    12
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    13
open Abschannel Impl;
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    14
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    15
val impl_ioas =
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    16
  [Impl.impl_def,
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    17
   Sender.sender_ioa_def, 
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    18
   Receiver.receiver_ioa_def, 
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    19
   srch_ioa_thm RS eq_reflection,
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    20
   rsch_ioa_thm RS eq_reflection];
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    21
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    22
val transitions = [Sender.sender_trans_def, Receiver.receiver_trans_def,
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    23
                   srch_trans_def, rsch_trans_def];
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    24
 
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    25
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    26
Addsimps [ioa_triple_proj, starts_of_par, trans_of_par4,
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    27
          in_sender_asig, in_receiver_asig, in_srch_asig,
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    28
          in_rsch_asig];
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    29
Addcongs [let_weak_cong];
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    30
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4833
diff changeset
    31
Goal
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    32
  "fst(x) = sen(x)            & \
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    33
\  fst(snd(x)) = rec(x)       & \
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    34
\  fst(snd(snd(x))) = srch(x) & \
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    35
\  snd(snd(snd(x))) = rsch(x)";
4423
a129b817b58a expandshort;
wenzelm
parents: 4377
diff changeset
    36
by (simp_tac (simpset() addsimps
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    37
             [sen_def,rec_def,srch_def,rsch_def]) 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    38
Addsimps [result()];
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    39
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4833
diff changeset
    40
Goal "a:actions(sender_asig)   \
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    41
\            | a:actions(receiver_asig) \
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    42
\            | a:actions(srch_asig)     \
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    43
\            | a:actions(rsch_asig)";
5192
704dd3a6d47d Adapted to new datatype package.
berghofe
parents: 5068
diff changeset
    44
  by (induct_tac "a" 1);
4423
a129b817b58a expandshort;
wenzelm
parents: 4377
diff changeset
    45
  by (ALLGOALS (Simp_tac));
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    46
Addsimps [result()];
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    47
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    48
Delsimps [split_paired_All];
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    49
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    50
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    51
(* Three Simp_sets in different sizes 
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    52
----------------------------------------------
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    53
4098
71e05eb27fb6 isatool fixclasimp;
wenzelm
parents: 3073
diff changeset
    54
1) simpset() does not unfold the transition relations 
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    55
2) ss unfolds transition relations 
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    56
3) renname_ss unfolds transitions and the abstract channel *)
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    57
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    58
6918
63c9df6b5c4b Now if_weak_cong is a standard congruence rule
paulson
parents: 6129
diff changeset
    59
val ss = (simpset() addsimps transitions);     
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    60
val rename_ss = (ss addsimps unfold_renaming);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    61
4833
2e53109d4bc8 Renamed expand_const -> split_const
nipkow
parents: 4731
diff changeset
    62
val tac     = asm_simp_tac (ss addcongs [conj_cong] addsplits [split_if]);
2e53109d4bc8 Renamed expand_const -> split_const
nipkow
parents: 4731
diff changeset
    63
val tac_ren = asm_simp_tac (rename_ss addcongs [conj_cong] addsplits [split_if]);
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    64
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    65
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    66
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    67
(* INVARIANT 1 *)
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    68
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4833
diff changeset
    69
Goalw impl_ioas "invariant impl_ioa inv1";
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    70
by (rtac invariantI 1);
4423
a129b817b58a expandshort;
wenzelm
parents: 4377
diff changeset
    71
by (asm_full_simp_tac (simpset()
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    72
   addsimps [inv1_def, hdr_sum_def, Sender.srcvd_def,
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    73
             Sender.ssent_def, Receiver.rsent_def,Receiver.rrcvd_def]) 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    74
4423
a129b817b58a expandshort;
wenzelm
parents: 4377
diff changeset
    75
by (simp_tac (simpset() delsimps [trans_of_par4]
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    76
                addsimps [fork_lemma,inv1_def]) 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    77
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    78
(* Split proof in two *)
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    79
by (rtac conjI 1); 
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    80
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    81
(* First half *)
4681
a331c1f5a23e expand_if is now by default part of the simpset.
nipkow
parents: 4423
diff changeset
    82
by (asm_full_simp_tac (simpset() addsimps [Impl.inv1_def]
4833
2e53109d4bc8 Renamed expand_const -> split_const
nipkow
parents: 4731
diff changeset
    83
                                 delsplits [split_if]) 1);
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    84
by (rtac Action.action.induct 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    85
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    86
by (EVERY1[tac, tac, tac, tac]);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    87
by (tac 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    88
by (tac_ren 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    89
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    90
(* 5 + 1 *)
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    91
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    92
by (tac 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    93
by (tac_ren 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    94
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    95
(* 4 + 1 *)
4423
a129b817b58a expandshort;
wenzelm
parents: 4377
diff changeset
    96
by (EVERY1[tac, tac, tac, tac]);
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    97
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    98
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
    99
(* Now the other half *)
4681
a331c1f5a23e expand_if is now by default part of the simpset.
nipkow
parents: 4423
diff changeset
   100
by (asm_full_simp_tac (simpset() addsimps [Impl.inv1_def]
4833
2e53109d4bc8 Renamed expand_const -> split_const
nipkow
parents: 4731
diff changeset
   101
                                 delsplits [split_if]) 1);
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   102
by (rtac Action.action.induct 1);
4423
a129b817b58a expandshort;
wenzelm
parents: 4377
diff changeset
   103
by (EVERY1[tac, tac]);
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   104
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   105
(* detour 1 *)
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   106
by (tac 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   107
by (tac_ren 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   108
by (rtac impI 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   109
by (REPEAT (etac conjE 1));
4098
71e05eb27fb6 isatool fixclasimp;
wenzelm
parents: 3073
diff changeset
   110
by (asm_simp_tac (simpset() addsimps [hdr_sum_def, Multiset.count_def,
4377
2cba48b0f1c4 Cleaned up arithmetic mess.
nipkow
parents: 4098
diff changeset
   111
                                      Multiset.countm_nonempty_def]
4833
2e53109d4bc8 Renamed expand_const -> split_const
nipkow
parents: 4731
diff changeset
   112
                            addsplits [split_if]) 1);
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   113
(* detour 2 *)
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   114
by (tac 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   115
by (tac_ren 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   116
by (rtac impI 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   117
by (REPEAT (etac conjE 1));
4098
71e05eb27fb6 isatool fixclasimp;
wenzelm
parents: 3073
diff changeset
   118
by (asm_full_simp_tac (simpset() addsimps [Impl.hdr_sum_def, 
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   119
                                         Multiset.count_def,
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   120
                                         Multiset.countm_nonempty_def,
4377
2cba48b0f1c4 Cleaned up arithmetic mess.
nipkow
parents: 4098
diff changeset
   121
                                         Multiset.delm_nonempty_def]
4833
2e53109d4bc8 Renamed expand_const -> split_const
nipkow
parents: 4731
diff changeset
   122
                                 addsplits [split_if]) 1);
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   123
by (rtac allI 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   124
by (rtac conjI 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   125
by (rtac impI 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   126
by (hyp_subst_tac 1);
4377
2cba48b0f1c4 Cleaned up arithmetic mess.
nipkow
parents: 4098
diff changeset
   127
by (rtac (pred_suc RS iffD1) 1);
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   128
by (dtac less_le_trans 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   129
by (cut_facts_tac [rewrite_rule[Packet.hdr_def]
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   130
                   eq_packet_imp_eq_hdr RS countm_props] 1);;
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   131
by (assume_tac 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   132
by (assume_tac 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   133
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   134
by (rtac (countm_done_delm RS mp RS sym) 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   135
by (rtac refl 1);
4098
71e05eb27fb6 isatool fixclasimp;
wenzelm
parents: 3073
diff changeset
   136
by (asm_simp_tac (simpset() addsimps [Multiset.count_def]) 1);
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   137
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   138
by (rtac impI 1);
4098
71e05eb27fb6 isatool fixclasimp;
wenzelm
parents: 3073
diff changeset
   139
by (asm_full_simp_tac (simpset() addsimps [neg_flip]) 1);
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   140
by (hyp_subst_tac 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   141
by (rtac countm_spurious_delm 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   142
by (Simp_tac 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   143
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   144
by (EVERY1[tac, tac, tac, tac, tac, tac]);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   145
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   146
qed "inv1";
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   147
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   148
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   149
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   150
(* INVARIANT 2 *)
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   151
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4833
diff changeset
   152
Goal "invariant impl_ioa inv2";
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   153
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   154
  by (rtac invariantI1 1); 
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   155
  (* Base case *)
4098
71e05eb27fb6 isatool fixclasimp;
wenzelm
parents: 3073
diff changeset
   156
  by (asm_full_simp_tac (simpset() addsimps (inv2_def ::
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   157
                          (receiver_projections 
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   158
                           @ sender_projections @ impl_ioas)))
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   159
      1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   160
4833
2e53109d4bc8 Renamed expand_const -> split_const
nipkow
parents: 4731
diff changeset
   161
  by (asm_simp_tac (simpset() addsimps impl_ioas delsplits [split_if]) 1);
5192
704dd3a6d47d Adapted to new datatype package.
berghofe
parents: 5068
diff changeset
   162
  by (induct_tac "a" 1);
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   163
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   164
  (* 10 cases. First 4 are simple, since state doesn't change *)
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   165
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   166
val tac2 = asm_full_simp_tac (ss addsimps [inv2_def]);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   167
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   168
  (* 10 - 7 *)
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   169
  by (EVERY1[tac2,tac2,tac2,tac2]);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   170
  (* 6 *)
4423
a129b817b58a expandshort;
wenzelm
parents: 4377
diff changeset
   171
  by (forward_tac [rewrite_rule [Impl.inv1_def]
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   172
                               (inv1 RS invariantE) RS conjunct1] 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   173
  (* 6 - 5 *)
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   174
  by (EVERY1[tac2,tac2]);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   175
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   176
  (* 4 *)
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   177
  by (forward_tac [rewrite_rule [Impl.inv1_def]
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   178
                                (inv1 RS invariantE) RS conjunct1] 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   179
  by (tac2 1);
7322
d16d7ddcc842 isatool expandshort;
wenzelm
parents: 6918
diff changeset
   180
  by (arith_tac 1);
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   181
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   182
  (* 3 *)
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   183
  by (forward_tac [rewrite_rule [Impl.inv1_def] (inv1 RS invariantE)] 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   184
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   185
  by (tac2 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   186
  by (fold_tac [rewrite_rule [Packet.hdr_def]Impl.hdr_sum_def]);
7322
d16d7ddcc842 isatool expandshort;
wenzelm
parents: 6918
diff changeset
   187
  by (arith_tac 1);
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   188
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   189
  (* 2 *)
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   190
  by (tac2 1);
4423
a129b817b58a expandshort;
wenzelm
parents: 4377
diff changeset
   191
  by (forward_tac [rewrite_rule [Impl.inv1_def]
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   192
                               (inv1 RS invariantE) RS conjunct1] 1);
6081
aa97eb904692 Some simplifications.
nipkow
parents: 5274
diff changeset
   193
  by (strip_tac 1);
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   194
  by (REPEAT (etac conjE 1));
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   195
  by (Asm_full_simp_tac 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   196
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   197
  (* 1 *)
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   198
  by (tac2 1);
4423
a129b817b58a expandshort;
wenzelm
parents: 4377
diff changeset
   199
  by (forward_tac [rewrite_rule [Impl.inv1_def]
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   200
                               (inv1 RS invariantE) RS conjunct2] 1);
6081
aa97eb904692 Some simplifications.
nipkow
parents: 5274
diff changeset
   201
  by (strip_tac 1);
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   202
  by (REPEAT (etac conjE 1));
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   203
  by (fold_tac  [rewrite_rule[Packet.hdr_def]Impl.hdr_sum_def]);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   204
  by (Asm_full_simp_tac 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   205
qed "inv2";
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   206
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   207
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   208
(* INVARIANT 3 *)
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   209
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4833
diff changeset
   210
Goal "invariant impl_ioa inv3";
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   211
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   212
  by (rtac invariantI 1); 
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   213
  (* Base case *)
4098
71e05eb27fb6 isatool fixclasimp;
wenzelm
parents: 3073
diff changeset
   214
  by (asm_full_simp_tac (simpset() addsimps 
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   215
                    (Impl.inv3_def :: (receiver_projections 
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   216
                                       @ sender_projections @ impl_ioas))) 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   217
4833
2e53109d4bc8 Renamed expand_const -> split_const
nipkow
parents: 4731
diff changeset
   218
  by (asm_simp_tac (simpset() addsimps impl_ioas delsplits [split_if]) 1);
5192
704dd3a6d47d Adapted to new datatype package.
berghofe
parents: 5068
diff changeset
   219
  by (induct_tac "a" 1);
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   220
6081
aa97eb904692 Some simplifications.
nipkow
parents: 5274
diff changeset
   221
val tac3 = asm_full_simp_tac (ss addsimps [inv3_def]);
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   222
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   223
  (* 10 - 8 *)
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   224
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   225
  by (EVERY1[tac3,tac3,tac3]);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   226
 
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   227
  by (tac_ren 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   228
  by (strip_tac  1 THEN REPEAT (etac conjE 1));
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   229
  by (hyp_subst_tac 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   230
  by (etac exE 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   231
  by (Asm_full_simp_tac 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   232
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   233
  (* 7 *)
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   234
  by (tac3 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   235
  by (tac_ren 1);
9636
a0d4d9de9893 fixed a proof that had stopped working ???
paulson
parents: 8741
diff changeset
   236
  by (Force_tac 1);	
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   237
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   238
  (* 6 - 3 *)
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   239
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   240
  by (EVERY1[tac3,tac3,tac3,tac3]);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   241
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   242
  (* 2 *)
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   243
  by (asm_full_simp_tac ss 1);
4098
71e05eb27fb6 isatool fixclasimp;
wenzelm
parents: 3073
diff changeset
   244
  by (simp_tac (simpset() addsimps [inv3_def]) 1);
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   245
  by (strip_tac  1 THEN REPEAT (etac conjE 1));
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   246
  by (rtac (imp_or_lem RS iffD2) 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   247
  by (rtac impI 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   248
  by (forward_tac [rewrite_rule [Impl.inv2_def] (inv2 RS invariantE)] 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   249
  by (Asm_full_simp_tac 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   250
  by (REPEAT (etac conjE 1));
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   251
  by (res_inst_tac [("j","count (ssent(sen s)) (~sbit(sen s))"),
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   252
                    ("k","count (rsent(rec s)) (sbit(sen s))")] le_trans 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   253
  by (forward_tac [rewrite_rule [inv1_def]
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   254
                                (inv1 RS invariantE) RS conjunct2] 1);
4098
71e05eb27fb6 isatool fixclasimp;
wenzelm
parents: 3073
diff changeset
   255
  by (asm_full_simp_tac (simpset() addsimps
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   256
                         [hdr_sum_def, Multiset.count_def]) 1);
4377
2cba48b0f1c4 Cleaned up arithmetic mess.
nipkow
parents: 4098
diff changeset
   257
  by (rtac add_le_mono 1);
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   258
  by (rtac countm_props 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   259
  by (Simp_tac 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   260
  by (rtac countm_props 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   261
  by (Simp_tac 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   262
  by (assume_tac 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   263
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   264
  (* 1 *)
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   265
  by (tac3 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   266
  by (strip_tac  1 THEN REPEAT (etac conjE 1));
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   267
  by (rtac (imp_or_lem RS iffD2) 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   268
  by (rtac impI 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   269
  by (forward_tac [rewrite_rule [Impl.inv2_def] (inv2 RS invariantE)] 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   270
  by (Asm_full_simp_tac 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   271
qed "inv3";
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   272
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   273
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   274
(* INVARIANT 4 *)
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   275
5068
fb28eaa07e01 isatool fixgoal;
wenzelm
parents: 4833
diff changeset
   276
Goal "invariant impl_ioa inv4";
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   277
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   278
  by (rtac invariantI 1); 
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   279
  (* Base case *)
4098
71e05eb27fb6 isatool fixclasimp;
wenzelm
parents: 3073
diff changeset
   280
  by (asm_full_simp_tac (simpset() addsimps 
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   281
                    (Impl.inv4_def :: (receiver_projections 
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   282
                                       @ sender_projections @ impl_ioas))) 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   283
4833
2e53109d4bc8 Renamed expand_const -> split_const
nipkow
parents: 4731
diff changeset
   284
  by (asm_simp_tac (simpset() addsimps impl_ioas delsplits [split_if]) 1);
5192
704dd3a6d47d Adapted to new datatype package.
berghofe
parents: 5068
diff changeset
   285
  by (induct_tac "a" 1);
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   286
6081
aa97eb904692 Some simplifications.
nipkow
parents: 5274
diff changeset
   287
val tac4 =  asm_full_simp_tac (ss addsimps [inv4_def]);
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   288
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   289
  (* 10 - 2 *)
6081
aa97eb904692 Some simplifications.
nipkow
parents: 5274
diff changeset
   290
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   291
  by (EVERY1[tac4,tac4,tac4,tac4,tac4,tac4,tac4,tac4,tac4]);
4731
0196377b5703 New Asm_full_simp_tac shortens proof.
nipkow
parents: 4681
diff changeset
   292
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   293
 (* 2 b *)
6081
aa97eb904692 Some simplifications.
nipkow
parents: 5274
diff changeset
   294
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   295
  by (strip_tac  1 THEN REPEAT (etac conjE 1));
4423
a129b817b58a expandshort;
wenzelm
parents: 4377
diff changeset
   296
  by (forward_tac [rewrite_rule [Impl.inv2_def]
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   297
                               (inv2 RS invariantE)] 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   298
  by (Asm_full_simp_tac 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   299
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   300
  (* 1 *)
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   301
  by (tac4 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   302
  by (strip_tac  1 THEN REPEAT (etac conjE 1));
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   303
  by (rtac ccontr 1);
4423
a129b817b58a expandshort;
wenzelm
parents: 4377
diff changeset
   304
  by (forward_tac [rewrite_rule [Impl.inv2_def]
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   305
                               (inv2 RS invariantE)] 1);
4423
a129b817b58a expandshort;
wenzelm
parents: 4377
diff changeset
   306
  by (forward_tac [rewrite_rule [Impl.inv3_def]
3073
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   307
                               (inv3 RS invariantE)] 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   308
  by (Asm_full_simp_tac 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   309
  by (eres_inst_tac [("x","m")] allE 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   310
  by (Asm_full_simp_tac 1);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   311
qed "inv4";
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   312
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   313
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   314
(* rebind them *)
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   315
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   316
val inv1 = rewrite_rule [Impl.inv1_def] (inv1 RS invariantE);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   317
val inv2 = rewrite_rule [Impl.inv2_def] (inv2 RS invariantE);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   318
val inv3 = rewrite_rule [Impl.inv3_def] (inv3 RS invariantE);
88366253a09a Old NTP files now running under the IOA meta theory based on HOLCF;
mueller
parents:
diff changeset
   319
val inv4 = rewrite_rule [Impl.inv4_def] (inv4 RS invariantE);