Quot/Nominal/Abs.thy
author Cezary Kaliszyk <kaliszyk@in.tum.de>
Mon, 01 Feb 2010 12:06:46 +0100
changeset 1005 9d5d9e7ff71b
parent 995 ee0619b5adff
child 1006 ef34da709a0b
permissions -rw-r--r--
Monotonicity of ~~gen, needed for using it in inductive definitions.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
989
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 988
diff changeset
     1
theory Abs
984
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
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    29
datatype 'a rabst = 
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    30
  RAbst "atom set" "'a::pt"
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    31
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    32
fun map_fun 
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    33
where "map_fun f (RAbst bs x) = RAbst bs (f x)"
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    35
fun map_rel
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    36
where "map_rel R (RAbst bs x) (RAbst cs y) = R x y"
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    37
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    38
declare [[map "rabst" = (map_fun, map_rel)]]
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    39
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    40
instantiation rabst :: (pt) pt
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    41
begin
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
primrec
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    44
  permute_rabst
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
where
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    46
  "p \<bullet> (RAbst bs x) = RAbst (p \<bullet> bs) (p \<bullet> x)"
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
instance
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    49
apply(default)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
apply(case_tac [!] x)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    51
apply(simp_all)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    52
done
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    54
end
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
988
a987b5acadc8 improved the proof slightly by defining alpha as a function and completely characterised the equality between two abstractions
Christian Urban <urbanc@in.tum.de>
parents: 986
diff changeset
    56
fun
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    57
 alpha_gen 
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    58
where
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    59
 alpha_gen[simp del]:
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    60
   "(alpha_gen (bs, x) R f pi (cs, y)) \<longleftrightarrow> (f x - bs = f y - cs) \<and> ((f x - bs) \<sharp>* pi) \<and> (R (pi \<bullet> x) y)"
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    61
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    62
notation
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    63
  alpha_gen ("_ \<approx>gen _ _ _ _")
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    64
1005
9d5d9e7ff71b Monotonicity of ~~gen, needed for using it in inductive definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 995
diff changeset
    65
lemma [mono]: "R1 \<le> R2 \<Longrightarrow> alpha_gen x R1 \<le> alpha_gen x R2"
9d5d9e7ff71b Monotonicity of ~~gen, needed for using it in inductive definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 995
diff changeset
    66
  by (cases x) (auto simp add: le_fun_def le_bool_def alpha_gen.simps)
9d5d9e7ff71b Monotonicity of ~~gen, needed for using it in inductive definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 995
diff changeset
    67
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    68
lemma alpha_gen_refl:
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    69
  assumes a: "R x x"
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    70
  shows "(bs, x) \<approx>gen R f 0 (bs, x)"
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    71
  using a by (simp add: alpha_gen fresh_star_def fresh_zero_perm)
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    72
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    73
lemma alpha_gen_sym:
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    74
  assumes a: "(bs, x) \<approx>gen R f p (cs, y)"
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    75
  and     b: "R (p \<bullet> x) y \<Longrightarrow> R (- p \<bullet> y) x"
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    76
  shows "(cs, y) \<approx>gen R f (- p) (bs, x)"
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    77
  using a b by (simp add: alpha_gen fresh_star_def fresh_def supp_minus_perm)
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    78
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    79
lemma alpha_gen_trans:
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    80
  assumes a: "(bs, x) \<approx>gen R f p1 (cs, y)"
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    81
  and     b: "(cs, y) \<approx>gen R f p2 (ds, z)"
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    82
  and     c: "\<lbrakk>R (p1 \<bullet> x) y; R (p2 \<bullet> y) z\<rbrakk> \<Longrightarrow> R ((p2 + p1) \<bullet> x) z"
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    83
  shows "(bs, x) \<approx>gen R f (p2 + p1) (ds, z)"
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    84
  using a b c using supp_plus_perm
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    85
  apply(simp add: alpha_gen fresh_star_def fresh_def)
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    86
  apply(blast)
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    87
  done
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    88
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    89
lemma alpha_gen_eqvt:
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    90
  assumes a: "(bs, x) \<approx>gen R f q (cs, y)"
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    91
  and     b: "R (q \<bullet> x) y \<Longrightarrow> R (p \<bullet> (q \<bullet> x)) (p \<bullet> y)"
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    92
  and     c: "p \<bullet> (f x) = f (p \<bullet> x)"
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    93
  and     d: "p \<bullet> (f y) = f (p \<bullet> y)"
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    94
  shows "(p \<bullet> bs, p \<bullet> x) \<approx>gen R f (p \<bullet> q) (p \<bullet> cs, p \<bullet> y)"
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    95
  using a b
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    96
  apply(simp add: alpha_gen c[symmetric] d[symmetric] Diff_eqvt[symmetric])
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    97
  apply(simp add: permute_eqvt[symmetric])
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    98
  apply(simp add: fresh_star_permute_iff)
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
    99
  apply(clarsimp)
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   100
  done
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   101
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   102
fun
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   103
  alpha_rabst :: "('a::pt) rabst \<Rightarrow> 'a rabst \<Rightarrow> bool" ("_ \<approx>raw _") 
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   104
where
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   105
  "(RAbst bs x) \<approx>raw (RAbst cs y) = (\<exists>p. (bs, x) \<approx>gen (op=) supp p (cs, y))" 
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   106
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   107
lemma alpha_reflp:
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   108
  shows "abst \<approx>raw abst"
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   109
apply(induct abst)
988
a987b5acadc8 improved the proof slightly by defining alpha as a function and completely characterised the equality between two abstractions
Christian Urban <urbanc@in.tum.de>
parents: 986
diff changeset
   110
apply(simp)
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   111
apply(rule exI)
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   112
apply(rule alpha_gen_refl)
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   113
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
   114
done
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   115
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   116
lemma alpha_symp:
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   117
  assumes a: "abst1 \<approx>raw abst2"
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   118
  shows "abst2 \<approx>raw abst1"
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   119
using a
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   120
apply(induct rule: alpha_rabst.induct)
988
a987b5acadc8 improved the proof slightly by defining alpha as a function and completely characterised the equality between two abstractions
Christian Urban <urbanc@in.tum.de>
parents: 986
diff changeset
   121
apply(simp)
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   122
apply(erule exE)
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   123
apply(rule exI)
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   124
apply(rule alpha_gen_sym)
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   125
apply(assumption)
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   126
apply(clarsimp)
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   127
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   128
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   129
lemma alpha_transp:
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   130
  assumes a1: "abst1 \<approx>raw abst2"
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   131
  and     a2: "abst2 \<approx>raw abst3"
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   132
  shows "abst1 \<approx>raw abst3"
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   133
using a1 a2
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   134
apply(induct rule: alpha_rabst.induct)
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   135
apply(induct rule: alpha_rabst.induct)
988
a987b5acadc8 improved the proof slightly by defining alpha as a function and completely characterised the equality between two abstractions
Christian Urban <urbanc@in.tum.de>
parents: 986
diff changeset
   136
apply(simp)
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   137
apply(erule exE)+
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   138
apply(rule exI)
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   139
apply(rule alpha_gen_trans)
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   140
apply(assumption)
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   141
apply(assumption)
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   142
apply(simp)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   143
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   144
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   145
lemma alpha_eqvt:
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   146
  assumes a: "abst1 \<approx>raw abst2"
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   147
  shows "(p \<bullet> abst1) \<approx>raw(p \<bullet> abst2)"
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   148
using a
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   149
apply(induct abst1 abst2 rule: alpha_rabst.induct)
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   150
apply(simp)
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   151
apply(erule exE)
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   152
apply(rule exI)
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   153
apply(rule alpha_gen_eqvt)
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   154
apply(assumption)
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   155
apply(simp)
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   156
apply(simp add: supp_eqvt)
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   157
apply(simp add: supp_eqvt)
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   158
done
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   159
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   160
lemma test1:
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   161
  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
   162
  and     a2: "b \<notin> (supp x) - bs"
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   163
  shows "(RAbst bs x) \<approx>raw (RAbst ((a \<rightleftharpoons> b) \<bullet> bs) ((a \<rightleftharpoons> b) \<bullet> x))"
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   164
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
   165
apply(rule_tac x="(a \<rightleftharpoons> b)" in exI)
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   166
apply(simp add: alpha_gen)
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   167
apply(simp add: supp_eqvt[symmetric] Diff_eqvt[symmetric])
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   168
apply(simp add: swap_set_fresh[OF a1 a2])
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   169
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
   170
using a1 a2
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   171
apply(simp add: fresh_star_def fresh_def)
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(blast)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   173
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
   174
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   175
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   176
fun
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   177
  s_test
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   178
where
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   179
  "s_test (RAbst bs x) = (supp x) - bs"
986
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 s_test_lemma:
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   182
  assumes a: "x \<approx>raw y" 
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   183
  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
   184
using a
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   185
apply(induct rule: alpha_rabst.induct)
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   186
apply(simp add: alpha_gen)
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   187
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   188
  
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   189
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   190
quotient_type 'a abst = "('a::pt) rabst" / "alpha_rabst::('a::pt) rabst \<Rightarrow> 'a rabst \<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
   191
  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
   192
  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
   193
  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
   194
  done
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   195
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   196
quotient_definition
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   197
   "Abst::atom set \<Rightarrow> ('a::pt) \<Rightarrow> 'a abst"
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   198
as
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   199
   "RAbst"
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   200
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   201
lemma [quot_respect]:
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   202
  shows "((op =) ===> (op =) ===> alpha_rabst) RAbst RAbst"
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   203
apply(simp del: alpha_rabst.simps add: alpha_reflp)
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   204
done
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   205
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   206
lemma [quot_respect]:
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   207
  shows "((op =) ===> alpha_rabst ===> alpha_rabst) permute permute"
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   208
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
   209
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   210
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   211
lemma [quot_respect]:
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   212
  shows "(alpha_rabst ===> (op =)) s_test s_test"
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   213
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
   214
done
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   215
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   216
lemma abst_induct:
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   217
  "\<lbrakk>\<And>as (x::'a::pt). P (Abst as x)\<rbrakk> \<Longrightarrow> P t"
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   218
apply(lifting rabst.induct)
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   219
done
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   220
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   221
instantiation abst :: (pt) pt
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   222
begin
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   223
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   224
quotient_definition
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   225
  "permute_abst::perm \<Rightarrow> ('a::pt abst) \<Rightarrow> 'a abst"
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   226
as
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   227
  "permute::perm \<Rightarrow> ('a::pt rabst) \<Rightarrow> 'a rabst"
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   228
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   229
lemma permute_ABS [simp]:
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   230
  fixes x::"'a::pt"  (* ??? has to be 'a \<dots> 'b does not work *)
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   231
  shows "(p \<bullet> (Abst as x)) = Abst (p \<bullet> as) (p \<bullet> x)"
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   232
apply(lifting permute_rabst.simps(1))
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   233
done
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   234
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   235
instance
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   236
  apply(default)
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   237
  apply(induct_tac [!] x rule: abst_induct)
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   238
  apply(simp_all)
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   239
  done
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   240
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   241
end
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   242
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   243
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
   244
  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
   245
  and     a2: "b \<notin> (supp x) - bs"
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   246
  shows "(Abst bs x) = (Abst ((a \<rightleftharpoons> b) \<bullet> bs) ((a \<rightleftharpoons> b) \<bullet> x))"
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   247
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
   248
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
   249
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   250
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   251
lemma Abst_supports:
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   252
  shows "((supp x) - as) supports (Abst as x)"
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   253
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
   254
apply(clarify)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   255
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
   256
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
   257
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
   258
done
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
quotient_definition
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   261
  "s_test_lifted :: ('a::pt) abst \<Rightarrow> atom \<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
   262
as
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   263
  "s_test::('a::pt) rabst \<Rightarrow> atom \<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
   264
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   265
lemma s_test_lifted_simp:
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   266
  shows "s_test_lifted (Abst bs x) = (supp x) - bs"
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   267
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
   268
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   269
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   270
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
   271
  shows "(p \<bullet> (s_test_lifted ab)) = s_test_lifted (p \<bullet> ab)"
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   272
apply(induct ab rule: abst_induct)
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   273
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
   274
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   275
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   276
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
   277
  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
   278
  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
   279
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
   280
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
   281
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
   282
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
   283
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
   284
prefer 2
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   285
apply(assumption)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   286
apply(auto)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   287
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   288
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   289
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   290
lemma s_test_fresh_lemma:
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   291
  shows "(a \<sharp> Abst bs x) \<Longrightarrow> (a \<sharp> s_test_lifted (Abst bs x))"
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   292
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
   293
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
   294
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
   295
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
   296
apply(simp)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   297
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   298
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   299
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
   300
  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
   301
  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
   302
  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
   303
  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
   304
  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
   305
  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
   306
  apply(metis)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   307
  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
   308
  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
   309
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   310
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   311
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
   312
  fixes x::"'a::fs"
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   313
  shows "((supp x) - as) \<subseteq> (supp (Abst as x))"
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   314
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
   315
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
   316
apply(assumption)
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   317
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
   318
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
   319
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
   320
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
   321
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
   322
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
   323
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
   324
done
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   325
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   326
lemma supp_Abst:
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   327
  fixes x::"'a::fs"
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   328
  shows "supp (Abst as x) = (supp x) - as"
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   329
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
   330
apply(rule supp_is_subset)
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   331
apply(rule Abst_supports)
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   332
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
   333
apply(rule s_test_subset)
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   334
done
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   335
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   336
instance abst :: (fs) fs
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   337
apply(default)
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   338
apply(induct_tac x rule: abst_induct)
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   339
apply(simp add: supp_Abst)
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   340
apply(simp add: finite_supp)
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   341
done
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   342
988
a987b5acadc8 improved the proof slightly by defining alpha as a function and completely characterised the equality between two abstractions
Christian Urban <urbanc@in.tum.de>
parents: 986
diff changeset
   343
lemma fresh_abs:
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   344
  fixes x::"'a::fs"
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   345
  shows "a \<sharp> Abst bs x = (a \<in> bs \<or> (a \<notin> bs \<and> a \<sharp> x))"
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   346
apply(simp add: fresh_def)
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   347
apply(simp add: supp_Abst)
986
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   348
apply(auto)
98375dde48fc general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
parents: 984
diff changeset
   349
done
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   350
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   351
thm alpha_rabst.simps(1)
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   352
988
a987b5acadc8 improved the proof slightly by defining alpha as a function and completely characterised the equality between two abstractions
Christian Urban <urbanc@in.tum.de>
parents: 986
diff changeset
   353
lemma abs_eq:
995
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   354
  shows "(Abst bs x) = (Abst cs y) \<longleftrightarrow> (\<exists>p. (bs, x) \<approx>gen (op =) supp p (cs, y))"
ee0619b5adff introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
parents: 989
diff changeset
   355
apply(lifting alpha_rabst.simps(1))
984
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   356
done
8e2dd0b29466 attempt of a general abstraction operator
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   357
989
af02b193a19a the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
parents: 988
diff changeset
   358
end
988
a987b5acadc8 improved the proof slightly by defining alpha as a function and completely characterised the equality between two abstractions
Christian Urban <urbanc@in.tum.de>
parents: 986
diff changeset
   359