src/ZF/UNITY/Union.thy
changeset 24893 b8ef7afe3a6b
parent 16417 9bc16273c2d4
child 32960 69916a850301
equal deleted inserted replaced
24892:c663e675e177 24893:b8ef7afe3a6b
     9 
     9 
    10 Theory ported form HOL..
    10 Theory ported form HOL..
    11 
    11 
    12 *)
    12 *)
    13 
    13 
    14 theory Union imports SubstAx FP begin
    14 theory Union imports SubstAx FP
    15 
    15 begin
    16 constdefs
    16 
    17 
    17 definition
    18   (*FIXME: conjoin Init(F) Int Init(G) \<noteq> 0 *) 
    18   (*FIXME: conjoin Init(F) Int Init(G) \<noteq> 0 *) 
    19   ok :: "[i, i] => o"     (infixl "ok" 65)
    19   ok :: "[i, i] => o"     (infixl "ok" 65)  where
    20     "F ok G == Acts(F) \<subseteq> AllowedActs(G) &
    20     "F ok G == Acts(F) \<subseteq> AllowedActs(G) &
    21                Acts(G) \<subseteq> AllowedActs(F)"
    21                Acts(G) \<subseteq> AllowedActs(F)"
    22 
    22 
       
    23 definition
    23   (*FIXME: conjoin (\<Inter>i \<in> I. Init(F(i))) \<noteq> 0 *) 
    24   (*FIXME: conjoin (\<Inter>i \<in> I. Init(F(i))) \<noteq> 0 *) 
    24   OK  :: "[i, i=>i] => o"
    25   OK  :: "[i, i=>i] => o"  where
    25     "OK(I,F) == (\<forall>i \<in> I. \<forall>j \<in> I-{i}. Acts(F(i)) \<subseteq> AllowedActs(F(j)))"
    26     "OK(I,F) == (\<forall>i \<in> I. \<forall>j \<in> I-{i}. Acts(F(i)) \<subseteq> AllowedActs(F(j)))"
    26 
    27 
    27    JOIN  :: "[i, i=>i] => i"
    28 definition
       
    29   JOIN  :: "[i, i=>i] => i"  where
    28   "JOIN(I,F) == if I = 0 then SKIP else
    30   "JOIN(I,F) == if I = 0 then SKIP else
    29                  mk_program(\<Inter>i \<in> I. Init(F(i)), \<Union>i \<in> I. Acts(F(i)),
    31                  mk_program(\<Inter>i \<in> I. Init(F(i)), \<Union>i \<in> I. Acts(F(i)),
    30                  \<Inter>i \<in> I. AllowedActs(F(i)))"
    32                  \<Inter>i \<in> I. AllowedActs(F(i)))"
    31 
    33 
    32   Join :: "[i, i] => i"    (infixl "Join" 65)
    34 definition
       
    35   Join :: "[i, i] => i"    (infixl "Join" 65)  where
    33   "F Join G == mk_program (Init(F) Int Init(G), Acts(F) Un Acts(G),
    36   "F Join G == mk_program (Init(F) Int Init(G), Acts(F) Un Acts(G),
    34 				AllowedActs(F) Int AllowedActs(G))"
    37 				AllowedActs(F) Int AllowedActs(G))"
       
    38 definition
    35   (*Characterizes safety properties.  Used with specifying AllowedActs*)
    39   (*Characterizes safety properties.  Used with specifying AllowedActs*)
    36   safety_prop :: "i => o"
    40   safety_prop :: "i => o"  where
    37   "safety_prop(X) == X\<subseteq>program &
    41   "safety_prop(X) == X\<subseteq>program &
    38       SKIP \<in> X & (\<forall>G \<in> program. Acts(G) \<subseteq> (\<Union>F \<in> X. Acts(F)) --> G \<in> X)"
    42       SKIP \<in> X & (\<forall>G \<in> program. Acts(G) \<subseteq> (\<Union>F \<in> X. Acts(F)) --> G \<in> X)"
    39   
    43   
    40 syntax
    44 syntax
    41   "@JOIN1"     :: "[pttrns, i] => i"         ("(3JN _./ _)" 10)
    45   "@JOIN1"     :: "[pttrns, i] => i"         ("(3JN _./ _)" 10)
    42   "@JOIN"      :: "[pttrn, i, i] => i"       ("(3JN _:_./ _)" 10)
    46   "@JOIN"      :: "[pttrn, i, i] => i"       ("(3JN _:_./ _)" 10)
    43 
    47 
    44 translations
    48 translations
    45   "JN x:A. B"   == "JOIN(A, (%x. B))"
    49   "JN x:A. B"   == "CONST JOIN(A, (%x. B))"
    46   "JN x y. B"   == "JN x. JN y. B"
    50   "JN x y. B"   == "JN x. JN y. B"
    47   "JN x. B"     == "JOIN(state,(%x. B))"
    51   "JN x. B"     == "CONST JOIN(CONST state,(%x. B))"
    48 
    52 
    49 syntax (symbols)
    53 notation (xsymbols)
    50    SKIP     :: i                      ("\<bottom>")
    54   SKIP  ("\<bottom>") and
    51   Join      :: "[i, i] => i"          (infixl "\<squnion>" 65)
    55   Join  (infixl "\<squnion>" 65)
       
    56 
       
    57 syntax (xsymbols)
    52   "@JOIN1"  :: "[pttrns, i] => i"     ("(3\<Squnion> _./ _)" 10)
    58   "@JOIN1"  :: "[pttrns, i] => i"     ("(3\<Squnion> _./ _)" 10)
    53   "@JOIN"   :: "[pttrn, i, i] => i"   ("(3\<Squnion> _ \<in> _./ _)" 10)
    59   "@JOIN"   :: "[pttrn, i, i] => i"   ("(3\<Squnion> _ \<in> _./ _)" 10)
    54 
    60 
    55 
    61 
    56 subsection{*SKIP*}
    62 subsection{*SKIP*}
   574 apply (drule_tac G = G in safety_prop_Acts_iff)
   580 apply (drule_tac G = G in safety_prop_Acts_iff)
   575 apply (cut_tac F = G in AllowedActs_type)
   581 apply (cut_tac F = G in AllowedActs_type)
   576 apply (cut_tac F = G in Acts_type, auto)
   582 apply (cut_tac F = G in Acts_type, auto)
   577 done
   583 done
   578 
   584 
   579 
       
   580 ML
       
   581 {*
       
   582 val safety_prop_def = thm "safety_prop_def";
       
   583 
       
   584 val reachable_SKIP = thm "reachable_SKIP";
       
   585 val ok_programify_left = thm "ok_programify_left";
       
   586 val ok_programify_right = thm "ok_programify_right";
       
   587 val Join_programify_left = thm "Join_programify_left";
       
   588 val Join_programify_right = thm "Join_programify_right";
       
   589 val SKIP_in_constrains_iff = thm "SKIP_in_constrains_iff";
       
   590 val SKIP_in_Constrains_iff = thm "SKIP_in_Constrains_iff";
       
   591 val SKIP_in_stable = thm "SKIP_in_stable";
       
   592 val SKIP_in_Stable = thm "SKIP_in_Stable";
       
   593 val Join_in_program = thm "Join_in_program";
       
   594 val JOIN_in_program = thm "JOIN_in_program";
       
   595 val Init_Join = thm "Init_Join";
       
   596 val Acts_Join = thm "Acts_Join";
       
   597 val AllowedActs_Join = thm "AllowedActs_Join";
       
   598 val Join_commute = thm "Join_commute";
       
   599 val Join_left_commute = thm "Join_left_commute";
       
   600 val Join_assoc = thm "Join_assoc";
       
   601 val cons_id = thm "cons_id";
       
   602 val Join_SKIP_left = thm "Join_SKIP_left";
       
   603 val Join_SKIP_right = thm "Join_SKIP_right";
       
   604 val Join_absorb = thm "Join_absorb";
       
   605 val Join_left_absorb = thm "Join_left_absorb";
       
   606 val OK_programify = thm "OK_programify";
       
   607 val JN_programify = thm "JN_programify";
       
   608 val JN_empty = thm "JN_empty";
       
   609 val Init_JN = thm "Init_JN";
       
   610 val Acts_JN = thm "Acts_JN";
       
   611 val AllowedActs_JN = thm "AllowedActs_JN";
       
   612 val JN_cons = thm "JN_cons";
       
   613 val JN_cong = thm "JN_cong";
       
   614 val JN_absorb = thm "JN_absorb";
       
   615 val JN_Un = thm "JN_Un";
       
   616 val JN_constant = thm "JN_constant";
       
   617 val JN_Join_distrib = thm "JN_Join_distrib";
       
   618 val JN_Join_miniscope = thm "JN_Join_miniscope";
       
   619 val JN_Join_diff = thm "JN_Join_diff";
       
   620 val JN_constrains = thm "JN_constrains";
       
   621 val Join_constrains = thm "Join_constrains";
       
   622 val Join_unless = thm "Join_unless";
       
   623 val Join_constrains_weaken = thm "Join_constrains_weaken";
       
   624 val JN_constrains_weaken = thm "JN_constrains_weaken";
       
   625 val JN_stable = thm "JN_stable";
       
   626 val initially_JN_I = thm "initially_JN_I";
       
   627 val invariant_JN_I = thm "invariant_JN_I";
       
   628 val Join_stable = thm "Join_stable";
       
   629 val initially_JoinI = thm "initially_JoinI";
       
   630 val invariant_JoinI = thm "invariant_JoinI";
       
   631 val FP_JN = thm "FP_JN";
       
   632 val JN_transient = thm "JN_transient";
       
   633 val Join_transient = thm "Join_transient";
       
   634 val Join_transient_I1 = thm "Join_transient_I1";
       
   635 val Join_transient_I2 = thm "Join_transient_I2";
       
   636 val JN_ensures = thm "JN_ensures";
       
   637 val Join_ensures = thm "Join_ensures";
       
   638 val stable_Join_constrains = thm "stable_Join_constrains";
       
   639 val stable_Join_Always1 = thm "stable_Join_Always1";
       
   640 val stable_Join_Always2 = thm "stable_Join_Always2";
       
   641 val stable_Join_ensures1 = thm "stable_Join_ensures1";
       
   642 val stable_Join_ensures2 = thm "stable_Join_ensures2";
       
   643 val ok_SKIP1 = thm "ok_SKIP1";
       
   644 val ok_SKIP2 = thm "ok_SKIP2";
       
   645 val ok_Join_commute = thm "ok_Join_commute";
       
   646 val ok_commute = thm "ok_commute";
       
   647 val ok_sym = thm "ok_sym";
       
   648 val ok_iff_OK = thm "ok_iff_OK";
       
   649 val ok_Join_iff1 = thm "ok_Join_iff1";
       
   650 val ok_Join_iff2 = thm "ok_Join_iff2";
       
   651 val ok_Join_commute_I = thm "ok_Join_commute_I";
       
   652 val ok_JN_iff1 = thm "ok_JN_iff1";
       
   653 val ok_JN_iff2 = thm "ok_JN_iff2";
       
   654 val OK_iff_ok = thm "OK_iff_ok";
       
   655 val OK_imp_ok = thm "OK_imp_ok";
       
   656 val Allowed_SKIP = thm "Allowed_SKIP";
       
   657 val Allowed_Join = thm "Allowed_Join";
       
   658 val Allowed_JN = thm "Allowed_JN";
       
   659 val ok_iff_Allowed = thm "ok_iff_Allowed";
       
   660 val OK_iff_Allowed = thm "OK_iff_Allowed";
       
   661 val safety_prop_Acts_iff = thm "safety_prop_Acts_iff";
       
   662 val safety_prop_AllowedActs_iff_Allowed = thm "safety_prop_AllowedActs_iff_Allowed";
       
   663 val Allowed_eq = thm "Allowed_eq";
       
   664 val def_prg_Allowed = thm "def_prg_Allowed";
       
   665 val safety_prop_constrains = thm "safety_prop_constrains";
       
   666 val safety_prop_constrainsI = thm "safety_prop_constrainsI";
       
   667 val safety_prop_stable = thm "safety_prop_stable";
       
   668 val safety_prop_stableI = thm "safety_prop_stableI";
       
   669 val safety_prop_Int = thm "safety_prop_Int";
       
   670 val safety_prop_Inter = thm "safety_prop_Inter";
       
   671 val def_UNION_ok_iff = thm "def_UNION_ok_iff";
       
   672 
       
   673 val Join_ac = thms "Join_ac";
       
   674 *}
       
   675 
       
   676 
       
   677 end
   585 end