Quot/Nominal/Abs.thy
author Christian Urban <urbanc@in.tum.de>
Thu, 28 Jan 2010 23:36:38 +0100
changeset 986 98375dde48fc
parent 984 8e2dd0b29466
child 988 a987b5acadc8
permissions -rw-r--r--
general abstraction operator and complete characterisation of its support and freshness
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
theory LamEx
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
imports "Nominal2_Atoms" "Nominal2_Eqvt" "Nominal2_Supp" "../QuotMain" 
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
begin
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
     5
(* lemmas that should be in Nominal \<dots>\<dots>must be cleaned *)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
     6
lemma in_permute_iff:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
     7
  shows "(p \<bullet> x) \<in> (p \<bullet> X) \<longleftrightarrow> x \<in> X"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
     8
apply(unfold mem_def permute_fun_def)[1]
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
     9
apply(simp add: permute_bool_def) 
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    10
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    11
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    12
lemma fresh_star_permute_iff:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    13
  shows "(p \<bullet> a) \<sharp>* (p \<bullet> x) \<longleftrightarrow> a \<sharp>* x"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    14
apply(simp add: fresh_star_def)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    15
apply(auto)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    16
apply(drule_tac x="p \<bullet> xa" in bspec)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    17
apply(unfold mem_def permute_fun_def)[1] 
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    18
apply(simp add: eqvts)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    19
apply(simp add: fresh_permute_iff)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    20
apply(rule_tac ?p1="- p" in fresh_permute_iff[THEN iffD1])
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    21
apply(simp)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    22
apply(drule_tac x="- p \<bullet> xa" in bspec)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    23
apply(rule_tac ?p1="p" in in_permute_iff[THEN iffD1])
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    24
apply(simp)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    25
apply(simp)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    26
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    27
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    28
datatype 'a ABS_raw = Abs_raw "atom set" "'a::pt"
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    29
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    30
primrec
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
  Abs_raw_map
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
where
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
  "Abs_raw_map f (Abs_raw as x) = Abs_raw as (f x)"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    35
fun
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    36
  Abs_raw_rel
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    37
where
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    38
  "Abs_raw_rel R (Abs_raw as x) (Abs_raw bs y) = R x y"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    39
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    40
declare [[map "ABS_raw" = (Abs_raw_map, Abs_raw_rel)]]
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    41
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
instantiation ABS_raw :: (pt) pt
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
begin
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
primrec
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
  permute_ABS_raw
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
where
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
  "permute_ABS_raw p (Abs_raw as x) = Abs_raw (p \<bullet> as) (p \<bullet> x)"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    49
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
instance
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    51
apply(default)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    52
apply(case_tac [!] x)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
apply(simp_all)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    54
done
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    56
end  
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    57
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    58
inductive
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    59
  alpha_abs :: "('a::pt) ABS_raw \<Rightarrow> 'a ABS_raw \<Rightarrow> bool"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
where
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    61
  "\<lbrakk>\<exists>pi. (supp x) - as = (supp y) - bs \<and>  ((supp x) - as) \<sharp>* pi \<and> pi \<bullet> x = y\<rbrakk> 
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    62
   \<Longrightarrow> alpha_abs (Abs_raw as x) (Abs_raw bs y)"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    63
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    64
lemma alpha_reflp:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    65
  shows "alpha_abs ab ab"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    66
apply(induct ab)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    67
apply(rule alpha_abs.intros)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    68
apply(rule_tac x="0" in exI)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    69
apply(simp add: fresh_star_def fresh_zero_perm)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    70
done
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    72
lemma alpha_symp:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    73
  assumes a: "alpha_abs ab1 ab2"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    74
  shows "alpha_abs ab2 ab1"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    75
using a
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    76
apply(erule_tac alpha_abs.cases)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    77
apply(clarify)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    78
apply(rule alpha_abs.intros)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    79
apply(rule_tac x="- pi" in exI)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    80
apply(auto)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    81
apply(auto simp add: fresh_star_def)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    82
apply(simp add: fresh_def supp_minus_perm)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    83
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    84
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    85
lemma alpha_transp:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    86
  assumes a1: "alpha_abs ab1 ab2"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    87
  and     a2: "alpha_abs ab2 ab3"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    88
  shows "alpha_abs ab1 ab3"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    89
using a1 a2
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    90
apply(erule_tac alpha_abs.cases)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    91
apply(erule_tac alpha_abs.cases)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    92
apply(clarify)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    93
apply(rule alpha_abs.intros)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    94
apply(rule_tac x="pia + pi" in exI)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    95
apply(simp)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    96
apply(auto simp add: fresh_star_def)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    97
using supp_plus_perm
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    98
apply(simp add: fresh_def)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
    99
apply(blast)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   100
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   101
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   102
lemma alpha_eqvt:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   103
  assumes a: "alpha_abs ab1 ab2"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   104
  shows "alpha_abs (p \<bullet> ab1) (p \<bullet> ab2)"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   105
using a
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   106
apply(erule_tac alpha_abs.cases)
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   107
apply(clarify)
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   108
apply(simp)
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   109
apply(rule alpha_abs.intros)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   110
apply(rule_tac x="p \<bullet> pi" in exI)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   111
apply(rule conjI)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   112
apply(simp add: supp_eqvt[symmetric])
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   113
apply(simp add: Diff_eqvt[symmetric])
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   114
apply(rule conjI)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   115
apply(simp add: supp_eqvt[symmetric])
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   116
apply(simp add: Diff_eqvt[symmetric])
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   117
apply(simp only: fresh_star_permute_iff)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   118
apply(simp add: permute_eqvt[symmetric])
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   119
done
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   120
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   121
lemma test1:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   122
  assumes a1: "a \<notin> (supp x) - bs"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   123
  and     a2: "b \<notin> (supp x) - bs"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   124
  shows "alpha_abs (Abs_raw bs x) (Abs_raw ((a \<rightleftharpoons> b) \<bullet> bs) ((a \<rightleftharpoons> b) \<bullet> x))"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   125
apply(rule alpha_abs.intros)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   126
apply(rule_tac x="(a \<rightleftharpoons> b)" in exI)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   127
apply(rule_tac conjI)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   128
apply(simp add: supp_eqvt[symmetric])
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   129
apply(simp add: Diff_eqvt[symmetric])
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   130
using a1 a2
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   131
apply(simp add: swap_set_fresh)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   132
apply(rule conjI)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   133
prefer 2
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   134
apply(simp)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   135
apply(simp add: fresh_star_def)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   136
apply(simp add: fresh_def)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   137
apply(subgoal_tac "supp (a \<rightleftharpoons> b) \<subseteq> {a, b}")
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   138
using a1 a2
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   139
apply -
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   140
apply(blast)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   141
apply(simp add: supp_swap)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   142
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   143
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   144
fun
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   145
  s_test
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   146
where
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   147
  "s_test (Abs_raw bs x) = (supp x) - bs"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   148
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   149
lemma s_test_lemma:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   150
  assumes a: "alpha_abs x y" 
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   151
  shows "s_test x = s_test y"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   152
using a
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   153
apply(induct)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   154
apply(simp)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   155
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   156
  
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   157
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   158
quotient_type 'a ABS = "('a::pt) ABS_raw" / "alpha_abs::('a::pt) ABS_raw \<Rightarrow> 'a ABS_raw \<Rightarrow> bool"
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   159
  apply(rule equivpI)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   160
  unfolding reflp_def symp_def transp_def
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   161
  apply(auto intro: alpha_reflp alpha_symp alpha_transp)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   162
  done
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   163
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   164
quotient_definition
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   165
   "Abs::atom set \<Rightarrow> ('a::pt) \<Rightarrow> 'a ABS"
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   166
as
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   167
   "Abs_raw"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   168
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   169
lemma [quot_respect]:
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   170
  shows "((op =) ===> (op =) ===> alpha_abs) Abs_raw Abs_raw"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   171
apply(auto)
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   172
apply(rule alpha_reflp)
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   173
done
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   174
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   175
lemma [quot_respect]:
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   176
  shows "((op =) ===> alpha_abs ===> alpha_abs) permute permute"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   177
apply(auto)
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   178
apply(simp add: alpha_eqvt)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   179
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   180
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   181
lemma [quot_respect]:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   182
  shows "(alpha_abs ===> (op =)) s_test s_test"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   183
apply(simp add: s_test_lemma)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   184
done
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   185
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   186
lemma ABS_induct:
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   187
  "\<lbrakk>\<And>as (x::'a::pt). P (Abs as x)\<rbrakk> \<Longrightarrow> P t"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   188
apply(lifting ABS_raw.induct)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   189
done
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   190
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   191
instantiation ABS :: (pt) pt
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   192
begin
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   193
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   194
quotient_definition
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   195
  "permute_ABS::perm \<Rightarrow> ('a::pt ABS) \<Rightarrow> 'a ABS"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   196
as
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   197
  "permute::perm \<Rightarrow> ('a::pt ABS_raw) \<Rightarrow> 'a ABS_raw"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   198
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   199
lemma permute_ABS [simp]:
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   200
  fixes x::"'b::pt"  (* ??? has to be 'b \<dots> 'a doe not work *)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   201
  shows "(p \<bullet> (Abs as x)) = Abs (p \<bullet> as) (p \<bullet> x)"
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   202
apply(lifting permute_ABS_raw.simps(1))
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   203
done
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   204
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   205
instance
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   206
  apply(default)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   207
  apply(induct_tac [!] x rule: ABS_induct)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   208
  apply(simp_all)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   209
  done
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   210
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   211
end
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   212
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   213
lemma test1_lifted:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   214
  assumes a1: "a \<notin> (supp x) - bs"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   215
  and     a2: "b \<notin> (supp x) - bs"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   216
  shows "(Abs bs x) = (Abs ((a \<rightleftharpoons> b) \<bullet> bs) ((a \<rightleftharpoons> b) \<bullet> x))"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   217
using a1 a2
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   218
apply(lifting test1)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   219
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   220
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   221
lemma Abs_supports:
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   222
  shows "((supp x) - as) supports (Abs as x) "
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   223
unfolding supports_def
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   224
apply(clarify)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   225
apply(simp (no_asm))
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   226
apply(subst test1_lifted[symmetric])
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   227
apply(simp_all)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   228
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   229
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   230
quotient_definition
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   231
  "s_test_lifted :: ('a::pt) ABS \<Rightarrow> atom \<Rightarrow> bool"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   232
as
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   233
  "s_test::('a::pt) ABS_raw \<Rightarrow> atom \<Rightarrow> bool"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   234
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   235
lemma s_test_lifted_simp:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   236
  shows "s_test_lifted (Abs bs x) = (supp x) - bs"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   237
apply(lifting s_test.simps(1))
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   238
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   239
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   240
lemma s_test_lifted_eqvt:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   241
  shows "(p \<bullet> (s_test_lifted ab)) = s_test_lifted (p \<bullet> ab)"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   242
apply(induct ab rule: ABS_induct)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   243
apply(simp add: s_test_lifted_simp supp_eqvt Diff_eqvt)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   244
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   245
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   246
lemma fresh_f_empty_supp:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   247
  assumes a: "\<forall>p. p \<bullet> f = f"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   248
  shows "a \<sharp> x \<Longrightarrow> a \<sharp> (f x)"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   249
apply(simp add: fresh_def)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   250
apply(simp add: supp_def)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   251
apply(simp add: permute_fun_app_eq)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   252
apply(simp add: a)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   253
apply(rule finite_subset)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   254
prefer 2
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   255
apply(assumption)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   256
apply(auto)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   257
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   258
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   259
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   260
lemma s_test_fresh_lemma:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   261
  shows "(a \<sharp> Abs bs x) \<Longrightarrow> (a \<sharp> s_test_lifted (Abs bs x))"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   262
apply(rule fresh_f_empty_supp)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   263
apply(rule allI)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   264
apply(subst permute_fun_def)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   265
apply(simp add: s_test_lifted_eqvt)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   266
apply(simp)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   267
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   268
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   269
lemma supp_finite_set:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   270
  fixes S::"atom set"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   271
  assumes "finite S"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   272
  shows "supp S = S"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   273
  apply(rule finite_supp_unique)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   274
  apply(simp add: supports_def)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   275
  apply(auto simp add: permute_set_eq swap_atom)[1]
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   276
  apply(metis)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   277
  apply(rule assms)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   278
  apply(auto simp add: permute_set_eq swap_atom)[1]
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   279
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   280
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   281
lemma s_test_subset:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   282
  fixes x::"'a::fs"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   283
  shows "((supp x) - as) \<subseteq> (supp (Abs as x))"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   284
apply(rule subsetI)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   285
apply(rule contrapos_pp)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   286
apply(assumption)
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   287
unfolding fresh_def[symmetric]
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   288
apply(drule_tac s_test_fresh_lemma)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   289
apply(simp only: s_test_lifted_simp)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   290
apply(simp add: fresh_def)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   291
apply(subgoal_tac "finite (supp x - as)")
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   292
apply(simp add: supp_finite_set)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   293
apply(simp add: finite_supp)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   294
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   295
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   296
lemma supp_Abs:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   297
  fixes x::"'a::fs"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   298
  shows "supp (Abs as x) = (supp x) - as"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   299
apply(rule subset_antisym)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   300
apply(rule supp_is_subset)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   301
apply(rule Abs_supports)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   302
apply(simp add: finite_supp)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   303
apply(rule s_test_subset)
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   304
done
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   305
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   306
instance ABS :: (fs) fs
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   307
apply(default)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   308
apply(induct_tac x rule: ABS_induct)
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   309
apply(simp add: supp_Abs)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   310
apply(simp add: finite_supp)
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   311
done
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   312
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   313
lemma fresh_abs1:
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   314
  fixes x::"'a::fs"
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   315
  shows "a \<sharp> Abs bs x = (a \<in> bs \<or> (a \<notin> bs \<and> a \<sharp> x))"
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   316
apply(simp add: fresh_def)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   317
apply(simp add: supp_Abs)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   318
apply(auto)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   319
done
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   320
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   321
done
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   322