Require Import Coq.Lists.List.
Import ListNotations.
Require Import Cap.
Require Import CapSets.
Require Import CapGroups.
Require Import Notations.
Ltac unfold_classes :=
repeat unfold
alias,
unalias,
blob,
blob_combine,
blob_combine_one,
elemOf,
elemOf_union,
elemOf_list,
elemOf_bot,
READABLE,
NONWRITABLE,
WRITABLE,
STABLE,
ISO,
TRN,
REF,
VAL,
BOX,
TAG in *.
Ltac finish :=
solve [
subst;
unfold_classes;
tauto].
Hint Extern 4 (~(
_ =
_)) =>
discriminate.
Hint Extern 4 ((
_ =
_)) =>
symmetry.
Hint Extern 4 =>
unfold_classes.
Tactic Notation "
destruct_ecap"
constr(
e) :=
(
destruct e as [[]| |]).
Tactic Notation "
destruct_ecap"
constr(
e1) ","
constr(
e2) :=
(
destruct_ecap e1 ;
destruct_ecap e2).
Tactic Notation "
destruct_ecap"
constr(
e1) ","
constr(
e2) ","
constr(
e3) :=
(
destruct_ecap e1 ;
destruct_ecap e2 ;
destruct_ecap e3).
Tactic Notation "
destruct'"
constr(
H) :=
destruct H.
Tactic Notation "
destruct'"
constr(
H) "
by"
tactic(
tac) :=
(
let h :=
fresh "
H"
in assert H as h by tac;
destruct h).
Tactic Notation "
destruct'"
constr(
H) "
as"
simple_intropattern(
pat) "
by"
tactic(
tac) :=
(
let h :=
fresh "
H"
in assert H as h by tac;
destruct h as pat).
Tactic Notation "
replace'"
constr(
e1) "
with"
constr(
e2) "
by"
tactic(
tac) :=
replace e1 with e2 in *
by (
symmetry;
tac).
Lemma lemma1 {
A} :
forall (
x y:
A),
In x [
y] ->
x =
y.
Proof.
intros. destruct H; [auto | destruct H]. Qed.
Hint Resolve lemma1.
Lemma lemma2 {
A} :
forall (
x:
A) (
xs:
list A),
In x (
x::
xs).
Proof.
simpl. finish. Qed.
Hint Resolve lemma2.
Lemma lemma3 {
A} :
forall (
x y:
A) (
xs:
list A),
In y xs ->
In y (
x::
xs).
Proof.
simpl. finish. Qed.
Hint Resolve lemma3.
Lemma lemma4 :
forall λ λ
s κ,
λ ∈ (λ
s ∘ κ) ->
exists o λ0, λ0 ∈ λ
s /\
adapt o λ0 κ =
Some λ.
Proof with
auto.
intros.
induction λ
s as [|λ0].
-
exfalso.
auto.
-
assert (λ ∈ (λ
s ∘ κ) ->
exists (
o :
op) (λ1 :
ecap), λ1 ∈ (λ0::λ
s) /\
adapt o λ1 κ =
Some λ)
as IHλ
s'.
+
intro.
destruct IHλ
s as [
o [λ10 [? ?]]].
auto.
exists o, λ10.
split.
apply lemma3.
auto.
auto.
+
unfold_classes;
unfold combine_one in H;
fold combine_one in H.
destruct (
adapt read λ0 κ)
eqn:?;
destruct (
adapt extract λ0 κ)
eqn:?.
1:
inversion_clear H; [
subst;
eexists read, λ0;
eauto |
rename H0 into H].
1-3:
inversion_clear H; [
subst;
eexists _, λ0;
eauto |].
all:
apply IHλ
s';
auto.
Qed.
Lemma lemma5:
forall o λ0 λ
s κ λ1,
λ0 ∈ λ
s ->
adapt o λ0 κ =
Some λ1 -> λ1 ∈ (λ
s ∘ κ).
Proof with
auto.
intros.
induction λ
s.
-
inversion H.
-
destruct H;
unfold_classes;
unfold combine_one.
+
destruct o.
*
subst.
rewrite H0.
destruct (
adapt extract λ0 κ)...
*
subst.
rewrite H0.
destruct (
adapt read λ0 κ)...
+
destruct (
adapt extract a κ);
destruct (
adapt read a κ)...
Qed.
Lemma lemma6:
forall λ λ',
subcap λ λ' ->
subcap λ' λ -> λ = λ'.
Proof with
auto.
intros.
destruct_ecap λ, λ';
inversion H; inversion H0; auto.
Qed.
Lemma lemma7:
forall λ λ' λ'',
subcap λ λ' ->
subcap λ' λ'' ->
subcap λ λ''.
Proof.
intros.
inversion H; inversion H0; subst; try inversion H3; auto.
Qed.
Lemma lemma8:
forall κ κ',
unalias κ =
unalias κ' -> κ = κ'.
Proof with
auto.
destruct κ, κ';
unfold unalias;
inversion 1...
Qed.
Lemma lemma9:
forall λ
s κ κ',
λ
s ∈ (
G κ) ->
λ
s ∈ (
G κ') ->
κ = κ'.
Proof with
auto.
intros λ
s κ κ' [
Hκ
A Hκ
B] [
Hκ'
A Hκ'
B].
apply lemma8,
lemma6...
Qed.
Lemma lemma10:
forall λ κ κ',
adapt extract (
unalias κ) κ' =
Some λ ->
unalias (
alias λ) = λ.
Proof.
intros.
destruct κ, κ'; inversion H; subst; auto.
Qed.
Lemma lemma11:
forall λ κ κ',
adapt extract (
unalias κ) κ' =
None ->
adapt read (
unalias κ) κ' =
Some λ ->
unalias (
alias λ) = λ.
Proof.
intros.
destruct κ, κ'; inversion H0; inversion H; subst; auto.
Qed.
Lemma lemma12:
forall o λ0 λ0' κ λ1 λ1',
subcap λ0 λ0' ->
adapt o λ0 κ =
Some λ1 ->
adapt o λ0' κ =
Some λ1' ->
subcap λ1 λ1'.
Proof.
intros.
inversion H.
1:
subst.
rewrite H0 in H1.
inversion H1.
subst.
apply subcap_refl.
all:
destruct o, κ ;
subst;
inversion H0;
inversion H1;
auto.
Qed.
Lemma lemma13:
forall κ κ' λ
e λ
r,
adapt extract (
unalias κ) κ' =
Some λ
e ->
adapt read (
unalias κ) κ' =
Some λ
r ->
subcap λ
e λ
r.
Proof with
auto.
destruct κ, κ'; inversion 1; inversion 1; subst...
Qed.
Lemma lemma14:
forall λ κ λ
e,
adapt extract λ κ =
Some λ
e ->
exists λ
r,
adapt read λ κ =
Some λ
r.
Proof with
auto.
intros.
destruct (
adapt read λ κ)
as [λ
r|]
eqn:?.
-
exists λ
r...
-
destruct_ecap λ;
destruct κ;
inversion Heqo;
inversion H.
Qed.
Lemma lemma15 :
forall λ
s κ κ' λ,
λ
s ∈ (
G κ) ->
adapt extract (
unalias κ) κ' =
Some λ ->
(λ
s ∘ κ') ∈ (
G (
alias λ)).
Proof with
Lemma lemma16 :
forall λ
s κ κ' λ,
λ
s ∈ (
G κ) -> λ ∈ λ
s ->
adapt extract (
unalias κ) κ' =
None ->
adapt extract λ κ' =
None.
Proof.
intros.
assert (
subcap (
unalias κ) λ)
by (
apply H;
auto).
destruct_ecap λ;
destruct κ, κ';
simpl in *;
inversion H1;
inversion H2;
auto.
Qed.
Lemma lemma17 :
forall λ
s κ κ' λ,
λ
s ∈ (
G κ) ->
adapt extract (
unalias κ) κ' =
None ->
adapt read (
unalias κ) κ' =
Some λ ->
(λ
s ∘ κ') ∈ (
G (
alias λ)).
Proof with
Lemma lemma18 :
forall λ
s κ,
(λ
s ∈ (
G iso ∪
G trn ∪
G val)) ->
(λ
s ∘ κ ∈ (
G iso ∪
G trn ∪
G val) \/ κ =
tag).
Proof with
auto.
intros.
destruct H as [|[|]].
all:
try solve [
destruct κ
eqn:?;
eassert ((λ
s ∘ κ) ∈ (
G _))
by (
eapply lemma15 +
eapply lemma17;
eauto;
subst κ;
finish);
subst κ;
finish].
Qed.
Lemma lemma19 :
forall λ
s κ
s κ,
λ
s ∘ (κ
s++[κ]) = λ
s ∘ κ
s ∘ κ.
Proof.
Lemma lemma20: [
C ref] ∈ (
G ref).
Proof with
auto.
split;
simpl;
auto.
intros.
rewrite lemma1 with (
y:=
C ref);
auto.
Qed.
Hint Resolve lemma20.
Lemma lemma21 {
A}:
forall (
xs:
list A),
(
forall x,
x ∈
xs ->
False) ->
xs = [].
Proof.
intros.
destruct xs; [
auto |
exfalso;
apply H with (
x:=
a);
apply lemma2].
Qed.
Lemma lemma22:
forall (λ
s:
capset) (κ:
cap),
λ
s ∈
TAG -> (λ
s ∘ κ) ∈
BOT.
Proof.
intros.
unfold_classes.
apply lemma21.
intros λ1 ?.
edestruct lemma4 as [
o [λ0 [?
Hadapt]]];
only 1:
apply H0.
assert (
subcap (
C tag) λ0)
by (
apply H;
auto).
assert (λ0 =
C tag)
by (
inversion H2;
auto).
subst λ0.
destruct o, κ;
inversion Hadapt.
Qed.
Lemma lemma23:
forall (λ
s:
capset) (κ:
cap),
λ
s ∈
BOT -> (λ
s ∘ κ) ∈
BOT.
Proof.
intros;
unfold_classes;
subst λ
s;
unfold combine_one;
trivial.
Qed.
Lemma lemma24:
forall (λ
s:
capset) (κ:
cap),
λ
s ∈
READABLE ->
exists κ', (λ
s ∘ κ) ∈
G(κ').
Proof.
intros.
destruct_READABLE H.
all:
destruct κ
eqn:?;
eassert ((λ
s ∘ κ) ∈ (
G (
alias _)))
by (
eapply lemma15 +
eapply lemma17;
eauto;
subst κ;
finish);
eexists _;
subst;
apply H0.
Qed.
Lemma lemma25:
forall λ
s (κ:
cap),
λ
s ∈
G κ -> λ
s ∈
STABLE.
Proof.
intros.
destruct κ;
unfold STABLE;
unfold_classes;
finish.
Qed.
Hint Resolve lemma25.
Lemma lemma26:
forall λ
s (κ:
cap),
λ
s ∈
STABLE -> (λ
s ∘ κ) ∈
STABLE.
Proof with
auto.
intros.
unfold STABLE in *.
destruct_STABLE H.
1-5:
edestruct lemma24 with (λ
s:=λ
s);
[
unfold_classes;
unfold READABLE;
auto
|
eapply lemma25;
eauto].
all:
assert ((λ
s ∘ κ) ∈
BOT)
by (
apply lemma22 +
apply lemma23;
auto);
unfold_classes;
finish.
Qed.
Hint Resolve lemma26.
Lemma lemma27:
forall λ
s (κ
s:
list cap),
λ
s ∈
STABLE -> (λ
s ∘ κ
s) ∈
STABLE.
Proof.
Hint Resolve lemma27.
Lemma lemma28:
forall (λ
s:
capset),
λ
s ∈
READABLE -> λ
s ∘
tag ∈
TAG.
Proof with
Lemma lemma29 :
forall λ
s,
λ
s ∈
STABLE -> λ
s ∘
tag ∈
TAG \/ λ
s ∘
tag ∈
BOT.
Proof with
Lemma lemma30 :
forall κ, [
unalias κ] ∈
G κ.
Proof.
split.
unfold_classes; auto.
inversion 1; [subst; auto | inversion H0].
Qed.
Hint Resolve lemma30.
Lemma lemma31 :
forall κ, [
unalias κ] ∈
STABLE.
Proof.
intros.
assert ([
unalias κ] ∈
G κ)
by apply lemma30.
destruct κ;
finish.
Qed.
Hint Resolve lemma31.
Lemma lemma32 : [
C ref] ∈
STABLE.
Proof.
Hint Resolve lemma32.
Lemma lemma34 :
forall (λ
s:
capset) (κ
s:
list cap),
(λ
s ∈ (
ISO ∪
TRN ∪
VAL)) ->
λ
s ∘ κ
s ∈ (
ISO ∪
TRN ∪
VAL)
\/ (λ
s ∘ κ
s ∈
TAG /\ [
C ref] ∘ κ
s ∈
TAG)
\/ ([
C ref] ∘ κ
s ∈
BOT).
Proof with
Lemma lemma35 :
forall λ
s (κ
s:
list cap),
λ
s ∈ (
ISO ∪
TRN ∪
VAL) ->
λ
s ∘ κ
s ∈
TAG ->
[
C ref] ∘ κ
s ∈
TAG ∪
BOT.
Proof with
finish.
intros.
edestruct lemma34 as [|[|]];
eauto.
-
destruct H1 as [|[|]];
eassert (
_=
tag)
as H2 by (
eapply lemma9; [
eapply H1 |
eapply H0]);
inversion H2.
-
finish.
Qed.
Lemma lemma36 :
forall (λ
s:
capset) (κ:
cap),
λ
s ∈
G κ -> λ
s ∈
BOT ->
False.
Proof.
intros.
inversion H0. subst.
destruct H. destruct H.
Qed.
Lemma lemma37 :
forall (λ
s:
capset) (κ:
cap) (κ':
cap),
λ
s ∈
STABLE -> λ
s ∘ κ ∈
G κ' -> λ
s ∈
READABLE.
Proof.
intros.
destruct_STABLE H.
1-5:
finish.
-
exfalso;
eapply lemma36; [
apply H0 |
apply lemma22;
auto].
-
exfalso;
eapply lemma36; [
apply H0 |
apply lemma23;
auto].
Qed.
Lemma lemma38 :
forall (λ
s λ
s':
capset) (κ1:
cap) (κ κ':
cap),
λ
s ∈
G κ -> λ
s' ∈
G κ -> λ
s ∘ κ1 ∈
G κ' ->
λ
s' ∘ κ1 ∈
G κ'.
Proof with
finish.
intros.
assert (λ
s ∈
READABLE)
by (
eapply lemma37; [
eapply lemma25|];
eauto).
destruct_READABLE H2;
try (
eassert (κ=
_)
by (
eapply lemma9; [
apply H |
apply H2]);
subst κ;
destruct κ1
eqn:?; (
eassert (κ' =
alias _)
by (
eapply lemma9; [
apply H1 |
eapply lemma15 +
eapply lemma17; [
apply H2 |
tauto..]]);
subst κ';
eapply lemma15 +
eapply lemma17 ; [
apply H0 |
solve [
auto]..]
)
).
Qed.
Lemma lemma39 (
P:
capset ->
Prop):
(
forall λ
s,
P λ
s) -> (
forall λ
s (κ:
cap),
P λ
s ->
P (λ
s ∘ κ)) ->
forall λ
s κ
s,
P (λ
s ∘ κ
s).
Proof.
intros.
induction κ
s as [|κ0]
using rev_ind.
-
apply H.
-
rewrite lemma19.
apply H0.
apply IHκ
s.
Qed.
Lemma lemma40 :
forall (λ
s:
capset), λ
s ∈
READABLE ->
exists κ, λ
s ∈
G κ.
Proof.
intros.
destruct_READABLE H.
1-5: eexists _; apply H.
Qed.
Lemma lemma41 :
forall (κ κ':
cap) (λ
s λ
s':
capset) (κ
s:
list cap),
λ
s ∈
G κ ->
λ
s' ∈
G κ ->
λ
s ∘ κ
s ∈
G κ' ->
λ
s' ∘ κ
s ∈
G κ'.
Proof with
finish.
intros.
generalize dependent λ
s;
generalize dependent λ
s';
generalize dependent κ;
generalize dependent κ'.
induction κ
s as [|κ]
using rev_ind.
-
intros.
assert (κ=κ')
by (
eapply lemma9; [
apply H |
apply H1]).
subst.
auto.
-
intros κ2 κ0.
intros.
rewrite lemma19 in *.
destruct lemma40 with (λ
s:=
combine λ
s κ
s)
as [κ1];
auto.
eapply lemma37; [
apply lemma27;
eapply lemma25;
apply H |
apply H1].
apply lemma38 with (λ
s:=
combine λ
s κ
s) (κ:=κ1);
auto.
apply IHκ
s with (κ:=κ0) (λ
s:=λ
s);
auto.
Qed.
Lemma lemma42 :
forall λ
s (κ
s:
list cap),
λ
s ∈
WRITABLE ->
λ
s ∘ κ
s ∈
TAG ->
[
C ref] ∘ κ
s ∈
TAG ∪
BOT.
Proof.
intros.
destruct_WRITABLE H.
1-2:
eapply lemma35;
unfold_classes;
eauto.
assert ([
C ref] ∘ κ
s ∈
TAG)
by (
apply lemma41 with (λ
s:=λ
s) (κ:=
ref);
auto).
finish.
Qed.
Lemma lemma43 :
forall (κ κ':
cap),
compatible (
C κ) (
C κ') ->
compatible (
unalias κ) (
unalias κ').
Proof.
intros.
inversion H;
unfold unalias;
auto.
Qed.
Lemma lemma44 :
forall (λ λ' λ'':
ecap),
compatible λ λ' ->
subcap λ' λ'' ->
compatible λ λ''.
Proof.
intros.
inversion H; subst; inversion H0; subst; auto.
Qed.
Lemma lemma45 :
forall (λ1 λ2:
ecap),
compatible λ1 λ2 ->
compatible λ2 λ1.
Proof.
intros.
inversion H; auto.
- destruct_ecap λ2; auto.
Qed.
Lemma lemma46 :
forall (λ1 λ1' λ2 λ2':
ecap),
compatible λ1 λ2 ->
subcap λ1 λ1' ->
subcap λ2 λ2' ->
compatible λ1' λ2'.
Proof.
Lemma lemma47 :
forall (κ κ':
cap),
compatible (
unalias κ) (
unalias κ') ->
compatible (
C κ) (
C κ').
Proof.
intros.
destruct κ, κ'; inversion H; auto.
Qed.
Lemma lemma48 :
forall (λ
s λ
s':
capset) (κ κ':
cap),
λ
s ∈
G κ ->
λ
s' ∈
G κ' ->
compatible (
C κ) (
C κ') ->
compatible_set λ
s λ
s'.
Proof.
Lemma lemma49 :
forall (λ
s λ
s':
capset) (κ κ':
cap),
λ
s ∈
G κ ->
λ
s' ∈
G κ' ->
compatible_set λ
s λ
s' ->
compatible (
C κ) (
C κ').
Proof.
intros.
apply lemma47.
apply H1; [
apply H |
apply H0 ].
Qed.
Lemma lemma50 :
forall (λ
s:
capset),
λ
s ∈
STABLE -> λ
s ∈
BOT \/
exists κ, λ
s ∈
G κ.
Proof.
intros.
destruct_STABLE H;
solve [ right; eexists _; apply H | auto ].
Qed.
Lemma lemma52 :
forall (λ
s λ
s':
capset),
λ
s ∈
BOT ->
compatible_set λ
s λ
s'.
Proof.
intros.
unfold compatible_set.
unfold_classes.
intros.
subst.
inversion H0.
Qed.
Lemma lemma54 :
forall (λ
s:
capset) (λ:
ecap),
λ
s ∈
TAG -> λ ∈ λ
s -> λ =
C tag.
Proof.
intros.
assert (
subcap (
C tag) λ)
by (
apply H,
H0).
inversion H1.
auto.
Qed.
Lemma lemma55 :
forall (λ
s λ
s':
capset),
λ
s ∈
TAG ->
compatible_set λ
s λ
s'.
Proof.
Lemma lemma56 :
forall o λ λ' κ,
adapt o λ κ =
None ->
subcap λ λ' ->
adapt o λ' κ =
None.
Proof.
intros.
inversion H0; subst; auto;
destruct o, κ; inversion H; auto.
Qed.
Lemma lemma57 :
forall (λ
s:
capset) (κ:
cap),
λ
s ∈
G κ ->
unalias κ :: λ
s ∈
G κ.
Proof.
intros.
split; auto.
intros.
destruct H0; [subst | apply H]; auto.
Qed.
Lemma lemma58 :
forall λ
s κ κ',
(
unalias κ :: λ
s) ∈ (
G κ) ->
adapt extract (
unalias κ) κ' =
None ->
adapt read (
unalias κ) κ' =
None ->
(
unalias κ :: λ
s) ∘ κ' ∈
BOT.
Proof with
Lemma lemma59 :
forall (λ
s:
capset) (κ:
cap) (λ:
ecap) (λ1:
ecap),
λ1 ∈ λ
s ∘ κ ->
λ1 ∈ (λ :: λ
s) ∘ κ.
Proof.
intros.
destruct lemma4 with λ1 λ
s κ
as [
o [λ0 [? ?]]];
auto.
apply lemma5 with o λ0; [
apply lemma3|];
auto.
Qed.
Lemma lemma60 :
forall (λ
s:
capset) (κ:
cap) (λ:
ecap),
(λ :: λ
s) ∘ κ ∈
BOT ->
λ
s ∘ κ ∈
BOT.
Proof.
intros.
apply lemma21.
intros λ1 ?.
assert (λ1 ∈ (λ :: λ
s) ∘ κ)
by (
apply lemma59;
auto).
unfold_classes.
rewrite H in H1.
destruct H1.
Qed.
Lemma lemma61 :
forall (λ
s:
capset) (κ κ':
cap),
λ
s ∈ (
G κ) ->
adapt extract (
unalias κ) κ' =
None ->
adapt read (
unalias κ) κ' =
None ->
λ
s ∘ κ' ∈
BOT.
Proof with
Inductive group_adapt :
cap ->
cap ->
cap ->
Prop :=
|
group_adapt_iso_iso :
group_adapt iso iso iso
|
group_adapt_iso_trn :
group_adapt iso trn iso
|
group_adapt_iso_ref :
group_adapt iso ref iso
|
group_adapt_iso_val :
group_adapt iso val val
|
group_adapt_iso_box :
group_adapt iso box val
|
group_adapt_iso_tag :
group_adapt iso tag tag
|
group_adapt_trn_iso :
group_adapt trn iso iso
|
group_adapt_trn_trn :
group_adapt trn trn trn
|
group_adapt_trn_ref :
group_adapt trn ref trn
|
group_adapt_trn_val :
group_adapt trn val val
|
group_adapt_trn_box :
group_adapt trn box val
|
group_adapt_trn_tag :
group_adapt trn tag tag
|
group_adapt_ref_iso :
group_adapt ref iso iso
|
group_adapt_ref_trn :
group_adapt ref trn trn
|
group_adapt_ref_ref :
group_adapt ref ref ref
|
group_adapt_ref_val :
group_adapt ref val val
|
group_adapt_ref_box :
group_adapt ref box box
|
group_adapt_ref_tag :
group_adapt ref tag tag
|
group_adapt_val_iso :
group_adapt val iso val
|
group_adapt_val_trn :
group_adapt val trn val
|
group_adapt_val_ref :
group_adapt val ref val
|
group_adapt_val_val :
group_adapt val val val
|
group_adapt_val_box :
group_adapt val box val
|
group_adapt_val_tag :
group_adapt val tag tag
|
group_adapt_box_iso :
group_adapt box iso tag
|
group_adapt_box_trn :
group_adapt box trn box
|
group_adapt_box_ref :
group_adapt box ref box
|
group_adapt_box_val :
group_adapt box val val
|
group_adapt_box_box :
group_adapt box box box
|
group_adapt_box_tag :
group_adapt box tag tag
.
Hint Constructors group_adapt.
Lemma lemma62 :
forall (λ
s:
capset) (κ κ' κ'':
cap),
λ
s ∈
G κ ->
λ
s ∘ κ' ∈
G κ'' <->
group_adapt κ κ' κ''.
Proof.
intros.
split.
-
intro.
destruct κ
eqn:?, κ'
eqn:?;
(
destruct (
adapt extract (
unalias κ) κ')
as [λ|]
eqn:
Hextract;
[|
destruct (
adapt read (
unalias κ) κ')
as [λ|]
eqn:
Hread];
[
replace κ''
with (
alias λ)
by (
apply lemma9 with (λ
s ∘ κ'); [
apply lemma15 with κ|];
subst;
auto);
(
subst;
inversion Hextract;
auto)
|
replace κ''
with (
alias λ)
by (
apply lemma9 with (λ
s ∘ κ'); [
apply lemma17 with κ|];
subst;
auto);
(
subst;
inversion Hread;
auto)
|
exfalso;
subst;
eapply lemma36;
eauto;
eapply lemma61;
eauto
]).
inversion Hextract.
inversion Hextract.
-
intro.
assert (
forall κ,
G κ =
G (
alias (
unalias κ)))
as Hrewrite
by (
destruct 0;
auto).
rewrite Hrewrite.
inversion H0;
subst;
solve [
eapply lemma15;
eauto |
eapply lemma17;
eauto].
Qed.
Lemma lemma62a :
forall (λ
s:
capset) (κ κ' κ'':
cap),
λ
s ∈
G κ ->
λ
s ∘ κ' ∈
G κ'' ->
group_adapt κ κ' κ''.
Proof.
Ltac destruct_group_adapt κ κ' κ'' :=
let H :=
fresh "
H"
in
eassert (
group_adapt κ κ' κ'')
as H; [
apply ->
lemma62 |
inversion H].
Lemma lemma63 :
forall (κ:
cap),
[
C ref] ∘ κ ∈
ISO -> κ =
iso.
Proof.
intros.
destruct_group_adapt ref κ
iso;
eauto. Qed.
Lemma lemma64 (κ:
cap) :
forall (λ
s λ
s':
capset),
λ
s ∈
STABLE ->
λ
s' ∈
G κ ->
compatible_set λ
s λ
s' ->
match κ
with
|
iso => λ
s ∈
TAG ∪
BOT
|
trn => λ
s ∈
BOX ∪
TAG ∪
BOT
|
ref => λ
s ∈
REF ∪
BOX ∪
TAG ∪
BOT
|
val => λ
s ∈
VAL ∪
BOX ∪
TAG ∪
BOT
|
box => λ
s ∈
TRN ∪
REF ∪
VAL ∪
BOX ∪
TAG ∪
BOT
|
tag => λ
s ∈
ISO ∪
TRN ∪
REF ∪
VAL ∪
BOX ∪
TAG ∪
BOT
end.
Proof with
finish.
intros.
destruct lemma50 with λ
s as [|[κ' ?]];
auto.
-
destruct κ;
finish.
-
assert (
compatible (
C κ') (
C κ))
as Hcompat
by (
eapply lemma49;
eauto).
destruct κ;
inversion Hcompat...
Qed.
Lemma lemma66 :
forall (λ
s:
capset),
λ
s ∈
WRITABLE -> λ
s ∈
STABLE.
Proof.
finish. Qed.
Hint Resolve lemma66.
Lemma lemma67 :
forall λ
s (κ
s:
list cap),
λ
s ∈ (
ISO ∪
TRN ∪
VAL) ->
λ
s ∘ κ
s ∈
BOT ->
[
C ref] ∘ κ
s ∈
BOT.
Proof with
finish.
intros.
edestruct lemma34 as [|[|]];
eauto.
-
exfalso;
destruct H1 as [|[|]];
eapply lemma36;
eauto.
-
exfalso;
eapply lemma36 with (λ
s:=λ
s ∘ κ
s); [
eapply H1 |
auto].
Qed.
Lemma lemma68 :
forall λ
s (κ
s:
list cap),
λ
s ∈
WRITABLE ->
λ
s ∘ κ
s ∈
BOT ->
[
C ref] ∘ κ
s ∈
BOT.
Proof with
finish.
intros.
destruct_writable λ
s by auto.
1-2:
eapply lemma67 with λ
s...
edestruct lemma50 with ([
C ref] ∘ κ
s)
as [|[κ]];
[
apply lemma27,
lemma32|..];
auto.
exfalso.
apply lemma36 with (λ
s:=λ
s ∘ κ
s) (κ:=κ);
auto.
apply lemma41 with (λ
s:=[
C ref]) (κ:=
ref);
auto.
Qed.
Lemma lemma69 :
forall λ
s (κ
s:
list cap),
λ
s ∈ (
ISO ∪
TRN ∪
VAL) ->
λ
s ∘ κ
s ∈
BOX ->
[
C ref] ∘ κ
s ∈
BOT.
Proof with
finish.
intros.
edestruct lemma34 as [[|[|]]|[|]];
eauto;
eassert (
_=
box)
as H2 by (
eapply lemma9 with (λ
s:=λ
s ∘ κ
s); [
apply H1 |
apply H0]);
inversion H2.
Qed.
Lemma lemma70 :
forall λ
s (κ
s:
list cap),
λ
s ∈
WRITABLE ->
λ
s ∘ κ
s ∈
BOX ->
[
C ref] ∘ κ
s ∈
BOX ∪
BOT.
Proof with
finish.
intros.
destruct_writable λ
s by auto.
1-2:
right;
eapply lemma69 with λ
s...
left;
apply lemma41 with ref λ
s;
auto.
Qed.
Lemma lemma71 :
forall λ
s (κ
s:
list cap),
λ
s ∈
WRITABLE ->
λ
s ∘ κ
s ∈
BOX ∪
TAG ∪
BOT ->
[
C ref] ∘ κ
s ∈
BOX ∪
TAG ∪
BOT.
Proof with
Lemma lemma72 :
forall λ
s (κ
s:
list cap),
λ
s ∈
WRITABLE ->
λ
s ∘ κ
s ∈
TAG ∪
BOT ->
[
C ref] ∘ κ
s ∈
TAG ∪
BOT.
Proof with
finish.
intros.
destruct H0 as [|].
-
assert ([
C ref] ∘ κ
s ∈
TAG ∪
BOT)
by (
eapply lemma42;
eauto)...
-
assert ([
C ref] ∘ κ
s ∈
BOT)
by (
eapply lemma68;
eauto)...
Qed.
Lemma lemma73 :
forall (λ
s1 λ
s2:
capset),
compatible_set λ
s1 λ
s2 ->
compatible_set λ
s2 λ
s1.
Proof.
Lemma lemma74 :
forall (λ
s1 λ
s2:
capset) (κ:
cap),
λ
s1 ∈
STABLE -> λ
s2 ∈
STABLE ->
λ
s1 ∘ κ ∈
ISO ->
λ
s2 ∘ κ ∈
TRN ∪
REF ->
λ
s1 ∈
ISO /\ λ
s2 ∈
TRN ∪
REF.
Proof.
intros.
destruct' (
exists κ1 :
cap, λ
s1 ∈
G κ1)
as [κ1]
by (
destruct lemma50 with λ
s1 as [|[]]; [|
exfalso ;
apply lemma36 with (λ
s1 ∘ κ)
iso; [|
apply lemma23];
eauto |];
eauto).
destruct H2 as [
H2|
H2];
(
destruct' (
exists κ2 :
cap, λ
s2 ∈
G κ2)
as [κ2]
by (
destruct lemma50 with λ
s2 as [|[]]; [|
exfalso ;
eapply lemma36 with (λ
s2 ∘ κ)
_; [|
apply lemma23];
eauto |];
eauto));
eassert (
group_adapt κ1 κ
iso)
as Hadapt1 by (
apply ->
lemma62;
eauto);
eassert (
group_adapt κ2 κ
_)
as Hadapt2 by (
apply ->
lemma62;
eauto);
inversion Hadapt1;
subst;
inversion Hadapt2;
subst;
finish.
Qed.
Lemma lemma75 :
forall (λ
s1 λ
s2:
capset) (κ
s:
list cap),
λ
s1 ∈
STABLE -> λ
s2 ∈
STABLE ->
λ
s1 ∘ κ
s ∈
ISO ->
λ
s2 ∘ κ
s ∈
TRN ∪
REF ->
λ
s1 ∈
ISO /\ λ
s2 ∈
TRN ∪
REF.
Proof.
intros.
induction κ
s as [|κ]
using rev_ind;
auto.
-
rewrite lemma19 in *.
destruct lemma74 with (λ
s1 ∘ κ
s) (λ
s2 ∘ κ
s) κ;
eauto.
Qed.
Lemma lemma76 :
forall (λ
s:
capset) (κ:
cap),
λ
s ∈
STABLE ->
λ
s ∘ κ ∈
ISO ->
λ
s ∈
ISO \/ κ =
iso.
Proof.
intros.
assert (
exists κ, λ
s ∈
G κ)
as [κ0]
by (
apply lemma40;
apply lemma37 with κ
iso;
eauto).
destruct_group_adapt κ0 κ
iso;
subst;
eauto.
Qed.
Lemma lemma77 :
forall (κ κ':
cap),
[
unalias κ] ∈
G κ' -> κ = κ'.
Proof.
Lemma lemma78 :
forall (λ
s:
capset) (κ0 κ1 κ2:
cap),
λ
s ∈
G κ0 ->
λ
s ∘ κ1 ∈
G κ2 ->
adapt extract (
unalias κ0) κ1 =
Some (
unalias κ2) \/
adapt extract (
unalias κ0) κ1 =
None /\
adapt read (
unalias κ0) κ1 =
Some (
unalias κ2).
Proof.
intros.
destruct_group_adapt κ0 κ1 κ2; eauto.
Qed.
Lemma lemma79:
forall o λ0 λ0' κ λ1',
subcap λ0 λ0' ->
adapt o λ0' κ =
Some λ1' ->
exists λ1,
adapt o λ0 κ =
Some λ1 /\
subcap λ1 λ1'.
Proof.
intros.
inversion H.
1:
subst.
exists λ1'.
auto.
all:
destruct o, κ ;
subst;
inversion H0;
(
eexists _;
unfold adapt;
eauto).
Qed.
Lemma lemma81 :
forall (κ:
cap),
alias (
unalias κ) = κ.
Proof.
destruct 0; auto. Qed.
Lemma lemma82 :
forall (κ κ':
cap) λ,
adapt extract (
unalias κ) κ' =
Some λ ->
exists κ'', λ =
unalias κ''.
Proof.
intros.
destruct κ, κ';
inversion H;
exists (
alias λ);
subst;
auto.
Qed.
Lemma lemma83 :
forall (κ κ':
cap) λ,
adapt extract (
unalias κ) κ' =
None ->
adapt read (
unalias κ) κ' =
Some λ ->
exists κ'', λ =
unalias κ''.
Proof.
intros.
destruct κ, κ';
inversion H0;
exists (
alias λ);
subst;
auto.
all:
inversion H.
Qed.
Lemma lemma84 :
forall (λ
s λ
s':
capset) (κ0 κ0' κ1' κ:
cap),
λ
s ∈
G κ0 ->
λ
s' ∈
G κ0' ->
λ
s' ∘ κ ∈
G κ1' ->
subcap (
unalias κ0) (
unalias κ0') ->
exists κ1, λ
s ∘ κ ∈
G κ1 /\
subcap (
unalias κ1) (
unalias κ1').
Proof.
Lemma lemma85 :
forall (λ
s λ
s':
capset) (κ0 κ0' κ1':
cap) (κ
s:
list cap),
λ
s ∈
G κ0 ->
λ
s' ∈
G κ0' ->
λ
s' ∘ κ
s ∈
G κ1' ->
subcap (
unalias κ0) (
unalias κ0') ->
exists κ1, λ
s ∘ κ
s ∈
G κ1 /\
subcap (
unalias κ1) (
unalias κ1').
Proof.
intros.
generalize dependent κ0.
generalize dependent κ0'.
generalize dependent κ1'.
induction κ
s as [|κ]
using rev_ind;
auto.
-
intros.
exists κ0.
replace κ1'
with κ0'
by (
eapply lemma9;
eauto).
auto.
-
intros.
rewrite lemma19 in *.
destruct lemma40 with (λ
s' ∘ κ
s); [
eapply lemma37|];
eauto.
edestruct IHκ
s as [? []];
eauto.
eapply lemma84 with (λ
s:=λ
s ∘ κ
s) (λ
s':=λ
s' ∘ κ
s);
eauto.
Qed.
Lemma lemma86 :
forall (λ
s:
capset) (κ
s:
list cap),
λ
s ∈
WRITABLE ->
[
C ref] ∘ κ
s ∈
ISO ->
λ
s ∘ κ
s ∈
ISO.
Proof.
intros.
(
destruct_writable λ
s by auto); (
edestruct lemma85 with (λ
s:=λ
s) (λ
s':=[
C ref]) (κ0':=
ref) (κ
s:=κ
s)
as [κ1 [?
Hsubcap]];
eauto;
destruct κ1;
inversion Hsubcap;
auto
).
Qed.
Lemma lemma87 :
forall (λ
s:
capset) (κ:
cap),
λ
s ∈
STABLE ->
λ
s ∘ κ ∈
REF ->
λ
s ∈
REF /\ κ =
ref.
Proof.
Lemma lemma89 {
A} :
forall (
xs:
list A) (
x y:
A),
In x (
xs ++ [
y]) ->
In x xs \/
x =
y.
Proof.
Hint Resolve lemma89.
Lemma lemma88 {
A} :
forall (
xs:
list A) (
x y:
A),
In x xs ->
In x (
xs ++ [
y]).
Proof.
Hint Resolve lemma88.
Lemma lemma90 {
A} :
forall (
xs:
list A) (
x:
A),
In x (
xs ++ [
x]).
Proof.
Hint Resolve lemma90.
Lemma lemma91 :
forall (λ
s:
capset) (κ
s:
list cap),
λ
s ∈
STABLE ->
λ
s ∘ κ
s ∈
REF ->
λ
s ∈
REF /\ (
forall κ, κ ∈ κ
s -> κ =
ref).
Proof.
intros.
induction κ
s as [|κ]
using rev_ind;
auto.
rewrite lemma19 in *.
destruct lemma87 with (λ
s ∘ κ
s) κ;
auto;
subst.
split.
-
apply IHκ
s;
auto.
-
intros.
destruct (@
lemma89 cap)
with κ
s κ
ref;
auto.
apply IHκ
s;
auto.
Qed.
Lemma lemma92 :
forall (λ
s:
capset) (κ
s:
list cap),
λ
s ∈
REF ->
(
forall κ, κ ∈ κ
s -> κ =
ref) ->
λ
s ∘ κ
s ∈
REF.
Proof.
intros.
induction κ
s as [|κ]
using rev_ind;
auto.
rewrite lemma19 in *.
eapply lemma62.
-
apply IHκ
s; (
intros;
apply H0;
apply lemma88;
auto).
-
replace κ
with ref by (
symmetry;
apply H0;
apply lemma90).
auto.
Qed.
Lemma lemma94 :
forall (λ
s:
capset) (κ
s:
list cap),
λ
s ∈
STABLE ->
λ
s ∘ κ
s ∈
REF ->
λ
s ∈
REF /\ (
forall κ, κ ∈ κ
s -> κ =
ref).
Proof.
intros.
induction κ
s as [|κ]
using rev_ind;
auto.
rewrite lemma19 in *.
destruct lemma87 with (λ
s ∘ κ
s) κ;
auto;
subst.
split.
-
apply IHκ
s;
auto.
-
intros.
destruct (@
lemma89 cap)
with κ
s κ
ref;
auto.
apply IHκ
s;
auto.
Qed.
Lemma lemma99:
forall λ
s κ κ',
λ
s ∈
G κ ->
match κ, κ'
with
|
iso,
iso => λ
s ∘ κ' ∈
ISO
|
iso,
trn => λ
s ∘ κ' ∈
ISO
|
iso,
ref => λ
s ∘ κ' ∈
ISO
|
iso,
val => λ
s ∘ κ' ∈
VAL
|
iso,
box => λ
s ∘ κ' ∈
VAL
|
iso,
tag => λ
s ∘ κ' ∈
TAG
|
trn,
iso => λ
s ∘ κ' ∈
ISO
|
trn,
trn => λ
s ∘ κ' ∈
TRN
|
trn,
ref => λ
s ∘ κ' ∈
TRN
|
trn,
val => λ
s ∘ κ' ∈
VAL
|
trn,
box => λ
s ∘ κ' ∈
VAL
|
trn,
tag => λ
s ∘ κ' ∈
TAG
|
ref,
iso => λ
s ∘ κ' ∈
ISO
|
ref,
trn => λ
s ∘ κ' ∈
TRN
|
ref,
ref => λ
s ∘ κ' ∈
REF
|
ref,
val => λ
s ∘ κ' ∈
VAL
|
ref,
box => λ
s ∘ κ' ∈
BOX
|
ref,
tag => λ
s ∘ κ' ∈
TAG
|
val,
iso => λ
s ∘ κ' ∈
VAL
|
val,
trn => λ
s ∘ κ' ∈
VAL
|
val,
ref => λ
s ∘ κ' ∈
VAL
|
val,
val => λ
s ∘ κ' ∈
VAL
|
val,
box => λ
s ∘ κ' ∈
VAL
|
val,
tag => λ
s ∘ κ' ∈
TAG
|
box,
iso => λ
s ∘ κ' ∈
TAG
|
box,
trn => λ
s ∘ κ' ∈
BOX
|
box,
ref => λ
s ∘ κ' ∈
BOX
|
box,
val => λ
s ∘ κ' ∈
VAL
|
box,
box => λ
s ∘ κ' ∈
BOX
|
box,
tag => λ
s ∘ κ' ∈
TAG
|
tag,
_ => λ
s ∘ κ' ∈
BOT
end.
Proof.
intros.
destruct κ, κ';
solve [
eapply lemma62;
eauto |
apply lemma22;
auto].
Qed.
Lemma lemma101 (
A:
Type):
forall (
P:
A ->
Prop) (
x:
A) (
xs:
list A),
(
forall y,
In y (
xs++[
x]) ->
P y) ->
(
forall y,
In y xs ->
P y).
Proof.
auto. Qed.
Lemma lemma102 (
A:
Type):
forall (
P:
A ->
Prop) (
x:
A) (
xs:
list A),
(
forall y,
In y (
xs++[
x]) ->
P y) ->
P x.
Proof.
auto. Qed.
Lemma lemma104:
forall λ
s, λ
s ∘ [] = λ
s.
Proof.
finish. Qed.
Lemma lemma105:
forall λ
s κ κ',
λ
s ∈
G κ -> λ
s ∈
G κ' -> κ <> κ' ->
False.
Proof.
intros;
apply H1;
eapply lemma9;
eauto. Qed.
Lemma lemma100:
forall λ
s (κ:
cap),
λ
s ∈
REF ∪
BOX ∪
TAG ∪
BOT ->
(κ =
ref \/ κ =
box \/ κ =
tag) ->
λ
s ∘ κ ∈
REF ∪
BOX ∪
TAG ∪
BOT.
Proof.
intros.
destruct H as [|[|[|]]];
destruct H0 as [|[|]];
subst κ.
all:
solve
[
left;
eapply lemma62;
eauto
|
right;
left;
eapply lemma62;
eauto
|
right;
right;
left;
eapply lemma62;
eauto
|
right;
right;
right;
apply lemma22;
auto
|
right;
right;
right;
apply lemma23;
auto].
Qed.
Lemma lemma103:
forall λ
s (κ
s:
list cap),
λ
s ∈
REF ∪
BOX ∪
TAG ∪
BOT ->
(
forall κ, κ ∈ κ
s -> κ =
ref) ->
λ
s ∘ κ
s ∈
REF ∪
BOX ∪
TAG ∪
BOT.
Proof.
Lemma lemma107:
forall λ
s (κ:
cap),
λ
s ∈
STABLE ->
λ
s ∘ κ ∈
BOT ->
λ
s ∈
BOT ∪
TAG.
Proof.
intros.
destruct lemma50 with λ
s as [|[κ' ?]];
auto.
-
pose (
lemma99 λ
s κ' κ)
as H2.
destruct κ
eqn:?, κ'
eqn:?;
solve [
exfalso;
eapply lemma36; [
apply H2;
auto |
auto ]
|
finish ].
Qed.
Lemma lemma109:
forall λ
s,
λ
s ∈
STABLE ->
λ
s ∘
tag ∈
TAG ∪
BOT.
Proof.
intros.
(
destruct_stable λ
s by auto);
solve [
eassert (λ
s ∘
tag ∈
G _)
by (
eapply lemma62;
eauto);
finish
|
assert (λ
s ∘
tag ∈
BOT)
by (
apply lemma22;
auto);
finish
|
assert (λ
s ∘
tag ∈
BOT)
by (
apply lemma23;
auto);
finish ].
Qed.
Lemma lemma114 :
forall λ
s,
λ
s ∈
STABLE ->
compatible_set λ
s [
C iso] ->
λ
s ∈
TAG ∪
BOT.
Proof.
intros.
destruct lemma50 with λ
s as [|[κ' ?]];
auto.
destruct κ';
solve [
eassert (
compatible _ (
C _))
as Hcompat by (
apply H0; [
apply H1 |
auto]);
inversion Hcompat
|
finish ].
Qed.
Lemma lemma115 :
forall λ
s,
λ
s ∈
STABLE ->
compatible_set λ
s [
C trn] ->
λ
s ∈
BOX ∪
TAG ∪
BOT.
Proof.
intros.
destruct lemma50 with λ
s as [|[κ' ?]];
auto.
destruct κ';
solve [
eassert (
compatible _ (
C _))
as Hcompat by (
apply H0; [
apply H1 |
auto]);
inversion Hcompat
|
finish ].
Qed.
Lemma lemma117:
forall (λ
s:
capset) (κ:
cap),
λ
s ∈
ISO ∪
TRN ∪
VAL ->
(λ
s ∘ κ) ∈
TAG ->
κ =
tag.
Proof.
intros.
destruct H as [|[|]].
-
destruct_group_adapt iso κ
tag;
eauto.
-
destruct_group_adapt trn κ
tag;
eauto.
-
destruct_group_adapt val κ
tag;
eauto.
Qed.
Lemma lemma119:
forall (λ
s:
capset) (κ:
cap),
λ
s ∈
ISO ∪
TRN ∪
VAL ->
(λ
s ∘ κ) ∈
TAG ->
([
C ref] ∘ κ) ∈
TAG.
Proof.
intros.
replace' κ
with tag by (
apply lemma117 with λ
s;
auto).
eapply lemma62;
eauto.
Qed.
Lemma lemma121:
forall (λ
s:
capset) (κ:
cap),
λ
s ∈
ISO ∪
TRN ∪
VAL ->
(λ
s ∘ κ) ∈
ISO ∪
TRN ∪
VAL \/ κ =
tag.
Proof.
intros.
destruct κ;
auto;
left;
destruct H as [|[|]];
solve [
left;
eapply lemma62;
eauto
|
right;
left;
eapply lemma62;
eauto
|
right;
right;
eapply lemma62;
eauto ].
Qed.
Lemma lemma122:
forall λ
s (κ:
cap),
λ
s ∈
TAG ∪
BOT ->
λ
s ∘ κ ∈
BOT.
Proof.
intros.
destruct H.
-
apply lemma22;
auto.
-
apply lemma23;
auto.
Qed.
Lemma lemma123:
forall (λ
s:
capset) (κ
s:
list cap),
λ
s ∈
ISO ∪
TRN ∪
VAL ->
(λ
s ∘ κ
s) ∈
ISO ∪
TRN ∪
VAL \/ ([
C ref] ∘ κ
s) ∈
TAG ∪
BOT.
Proof.
intros.
induction κ
s as [|κ]
using rev_ind;
auto.
repeat rewrite lemma19 in *.
destruct IHκ
s.
-
destruct lemma121 with (λ
s ∘ κ
s) κ;
auto.
right.
subst.
apply lemma109.
auto.
-
right.
right.
apply lemma122.
auto.
Qed.
Lemma lemma124:
forall (λ
s:
capset) (κ
s:
list cap),
λ
s ∈
ISO ∪
TRN ∪
VAL ->
(λ
s ∘ κ
s) ∈
TAG ∪
BOT ->
([
C ref] ∘ κ
s) ∈
TAG ∪
BOT.
Proof.
intros.
destruct lemma123 with λ
s κ
s;
auto.
exfalso.
destruct H0.
-
destruct H1 as [|[|]];
(
eapply lemma105 with (λ
s:=λ
s ∘ κ
s); [
apply H0 |
apply H1 |
auto ]).
-
destruct H1 as [|[|]];
(
eapply lemma36 with (λ
s:=λ
s ∘ κ
s);
eauto).
Qed.
Lemma lemma125:
forall (λ
s λ
s':
capset) (κ:
cap) (κ
s:
list cap),
λ
s ∈
G κ ->
λ
s' ∈
G κ ->
λ
s ∘ κ
s ∈
BOT ->
λ
s' ∘ κ
s ∈
BOT.
Proof.
intros.
induction κ
s as [|κ']
using rev_ind;
intros.
-
exfalso;
apply lemma36 with λ
s κ;
auto.
-
rewrite lemma19 in *.
destruct lemma107 with (λ
s ∘ κ
s) κ';
eauto.
+
apply lemma23.
apply IHκ
s.
auto.
+
apply lemma22.
apply lemma41 with (κ:=κ) (λ
s:=λ
s);
auto.
Qed.
Lemma lemma130:
forall (λ
s:
capset) (κ
s:
list cap),
λ
s ∈
WRITABLE ->
(λ
s ∘ κ
s) ∈
TAG ∪
BOT ->
([
C ref] ∘ κ
s) ∈
TAG ∪
BOT.
Proof.
intros.
destruct_writable λ
s by auto.
-
apply lemma124 with λ
s;
finish.
-
apply lemma124 with λ
s;
finish.
-
destruct H0.
+
left;
apply lemma41 with ref λ
s;
auto.
+
right;
apply lemma125 with λ
s ref;
auto.
Qed.
Lemma lemma133:
forall (λ
s:
capset) (κ
s:
list cap),
λ
s ∈
WRITABLE ->
(λ
s ∘ κ
s) ∈
REF ∪
BOX ∪
TAG ∪
BOT ->
([
C ref] ∘ κ
s) ∈
REF ∪
BOX ∪
TAG ∪
BOT.
Proof.
intros.
destruct H0 as [|[|]].
1-2:
(
destruct_writable λ
s by auto);
try solve [
destruct lemma123 with λ
s κ
s; [
finish| |
finish];
exfalso;
destruct H2 as [|[|]]; (
eapply lemma105 with (λ
s:=λ
s ∘ κ
s); [
apply H0|
apply H2|
auto])
| (
left + (
right;
left));
apply lemma41 with ref λ
s;
auto ].
right;
right;
apply lemma130 with λ
s;
auto.
Qed.
Lemma lemma134:
forall (λ
s1 λ
s2:
capset),
λ
s1 ∈
REF ∪
BOX ∪
TAG ∪
BOT ->
λ
s2 ∈
REF ∪
BOX ∪
TAG ∪
BOT ->
compatible_set λ
s1 λ
s2.
Proof.
Lemma lemma135 :
forall (λ
s:
capset) (λ:
ecap),
λ
s ∈
STABLE ->
safe_to_write λ
ref ->
compatible_set λ
s ([
C (
alias λ)]) ->
λ
s ∈
REF ∪
BOX ∪
TAG ∪
BOT.
Proof.
Lemma lemma150 :
forall (κ:
cap) (κ
s:
list cap),
[
unalias κ] ∘ κ
s ∈
VAL ->
(κ =
val \/ κ =
box) \/ (
val ∈ κ
s \/
box ∈ κ
s).
Proof.
intros.
induction κ
s as [|κ']
using rev_ind;
auto.
-
left.
left.
apply lemma77.
auto.
-
rewrite lemma19 in *.
destruct_stable ([
unalias κ] ∘ κ
s)
by auto.
+
destruct_group_adapt iso κ'
val;
[
apply H |
apply H0 |
auto..].
+
destruct_group_adapt trn κ'
val;
[
apply H |
apply H0 |
auto..].
+
destruct_group_adapt ref κ'
val;
[
apply H |
apply H0 |
auto..].
+
destruct IHκ
s;
auto.
destruct H1;
auto.
+
destruct_group_adapt box κ'
val;
[
apply H |
apply H0 |
auto..].
+
destruct_group_adapt tag κ'
val;
[
apply H |
apply H0 |
auto..].
+
exfalso.
apply lemma36 with (([
unalias κ] ∘ κ
s) ∘ κ')
val;
auto.
apply lemma23;
auto.
Qed.
Lemma lemma151 :
forall (κ κ':
cap),
κ =
val \/ κ =
box ->
subcap (
C κ) (
C κ') ->
κ' =
val \/ κ' =
box \/ κ' =
tag.
Proof.
intros.
inversion H; inversion H0; subst; auto.
Qed.
Lemma lemma152 :
forall (λ
s:
capset) (κ:
cap),
λ
s ∈
NONWRITABLE ->
λ
s ∘ κ ∈
NONWRITABLE.
Proof.
intros.
destruct H as [|[|[|]]];
destruct κ;
solve [
left;
eapply lemma62;
eauto
|
right;
left;
eapply lemma62;
eauto
|
right;
right;
left;
eapply lemma62;
eauto
|
right;
right;
right;
eapply lemma22;
eauto
|
right;
right;
right;
eapply lemma23;
eauto ].
Qed.
Lemma lemma153 :
forall (λ
s:
capset) (κ
s:
list cap),
λ
s ∈
NONWRITABLE ->
λ
s ∘ κ
s ∈
NONWRITABLE.
Proof.
Lemma lemma154 :
forall (λ
s:
capset) (κ:
cap),
λ
s ∈
STABLE ->
κ =
val \/ κ =
box \/ κ =
tag ->
λ
s ∘ κ ∈
NONWRITABLE.
Proof.
intros.
(
destruct_stable λ
s by auto);
destruct H0 as [|[|]];
subst;
solve [
left;
eapply lemma62;
eauto
|
right;
left;
eapply lemma62;
eauto
|
right;
right;
left;
eapply lemma62;
eauto
|
right;
right;
right;
eapply lemma22;
eauto
|
right;
right;
right;
eapply lemma23;
eauto ].
Qed.
Lemma lemma155 :
forall (λ
s:
capset) (κ:
cap) (κ
s:
list cap),
λ
s ∈
STABLE ->
κ =
val \/ κ =
box \/ κ =
tag ->
λ
s ∘ κ ∘ κ
s ∈
NONWRITABLE.
Proof.
Lemma lemma156:
forall (λ
s:
capset) (κ:
cap),
λ
s ∈
STABLE ->
λ
s ∘ κ ∈
BOT ->
λ
s ∈
TAG ∪
BOT.
Proof.
intros.
destruct_stable λ
s by auto.
6-7:
finish.
all:
exfalso;
destruct κ;
(
eapply lemma36; [|
apply H0]);
eapply lemma62;
eauto.
Qed.
Lemma lemma160 :
forall (λ
s:
capset) (κ:
cap),
λ
s ∈
STABLE ->
λ
s ∘ κ ∈
NONWRITABLE ->
λ
s ∈
NONWRITABLE \/ (κ =
val \/ κ =
box \/ κ =
tag).
Proof.
intros.
destruct_stable λ
s by auto.
4-7:
finish.
-
destruct H0 as [|[|[|]]].
+
destruct_group_adapt iso κ
val;
eauto.
+
destruct_group_adapt iso κ
box;
eauto.
+
destruct_group_adapt iso κ
tag;
eauto.
+
assert (λ
s ∈
TAG ∪
BOT)
by (
apply lemma156 with κ;
auto);
finish.
-
destruct H0 as [|[|[|]]].
+
destruct_group_adapt trn κ
val;
eauto.
+
destruct_group_adapt trn κ
box;
eauto.
+
destruct_group_adapt trn κ
tag;
eauto.
+
assert (λ
s ∈
TAG ∪
BOT)
by (
apply lemma156 with κ;
auto);
finish.
-
destruct H0 as [|[|[|]]].
+
destruct_group_adapt ref κ
val;
eauto.
+
destruct_group_adapt ref κ
box;
eauto.
+
destruct_group_adapt ref κ
tag;
eauto.
+
assert (λ
s ∈
TAG ∪
BOT)
by (
apply lemma156 with κ;
auto);
finish.
Qed.
Lemma lemma161 :
forall (λ
s:
capset),
λ
s ∈
WRITABLE ->
λ
s ∈
NONWRITABLE ->
False.
Proof.
intros.
destruct H0 as [|[|[|]]];
destruct_writable λ
s;
auto;
solve [
eapply lemma105; [
apply H0 |
apply H1 |
auto]
|
eapply lemma36;
eauto ].
Qed.
Lemma lemma162 :
forall (λ
s:
capset) (κ
s:
list cap),
λ
s ∈
WRITABLE ->
λ
s ∘ κ
s ∈
NONWRITABLE ->
[
C ref] ∘ κ
s ∈
NONWRITABLE.
Proof.
Lemma lemma163 :
forall (λ
s1 λ
s2:
capset),
λ
s1 ∈
NONWRITABLE ->
λ
s2 ∈
NONWRITABLE ->
compatible_set λ
s1 λ
s2.
Proof.
Lemma lemma164 :
forall λ
s (κ
s:
list cap) (κ:
cap),
λ
s ∘ (κ::κ
s) = λ
s ∘ κ ∘ κ
s.
Proof.
auto. Qed.
Lemma lemma165 :
forall (λ
s:
capset) (κ
s:
list cap),
λ
s ∈
STABLE ->
val ∈ κ
s \/
box ∈ κ
s ->
λ
s ∘ κ
s ∈
NONWRITABLE.
Proof.
intros.
generalize dependent λ
s.
induction κ
s;
intros.
-
destruct H0;
destruct H0.
-
rewrite lemma164.
destruct H0;
(
destruct H0; [
subst;
apply lemma155;
tauto |
apply IHκ
s;
auto ] ).
Qed.
Lemma lemma177 {
A} :
forall (
x:
A) (
y:
A),
x <>
y ->
not (
x ∈ [
y]).
Proof.
auto. Qed.
Hint Resolve lemma177.
Lemma lemma178 {
A} :
forall (
x:
A) (
xs ys:
list A),
not (
x ∈
xs) ->
not (
x ∈
ys) ->
not (
x ∈
xs ++
ys).
Proof.
intros.
intro;
subst.
destruct in_app_or with A xs ys x;
auto.
Qed.
Hint Resolve lemma178.
Lemma lemma179 {
A} :
forall (
x y:
A) (
xs:
list A),
not (
y ∈
xs) ->
x <>
y ->
not (
y ∈
xs ++ [
x]).
Proof.
eauto. Qed.
Hint Resolve lemma179.
Lemma lemma180 :
forall (κ:
cap) (κ
s:
list cap),
[
unalias κ] ∘ κ
s ∈
BOX ->
κ =
box \/
box ∈ κ
s.
Proof.
intros.
induction κ
s as [|κ']
using rev_ind;
auto.
-
left.
apply lemma77.
auto.
-
rewrite lemma19 in *.
destruct_stable ([
unalias κ] ∘ κ
s)
by auto.
+
destruct_group_adapt iso κ'
box;
[
apply H |
apply H0 |
auto..].
+
destruct_group_adapt trn κ'
box;
[
apply H |
apply H0 |
auto..].
+
destruct_group_adapt ref κ'
box;
[
apply H |
apply H0 |
auto..].
+
destruct_group_adapt val κ'
box;
[
apply H |
apply H0 |
auto..].
+
destruct IHκ
s;
auto.
+
destruct_group_adapt tag κ'
box;
[
apply H |
apply H0 |
auto..].
+
exfalso.
apply lemma36 with (([
unalias κ] ∘ κ
s) ∘ κ')
box;
auto.
apply lemma23;
auto.
Qed.
Lemma lemma181 :
forall (κ:
cap) (κ
s:
list cap),
[
unalias κ] ∘ κ
s ∈
REF ∪
BOX ->
κ <>
val /\
not (
val ∈ κ
s).
Proof.
intros.
induction κ
s as [|κ']
using rev_ind;
auto.
-
destruct H.
+ (
replace' κ
with ref by (
apply lemma77;
auto));
auto.
+ (
replace' κ
with box by (
apply lemma77;
auto));
auto.
-
rewrite lemma19 in *.
destruct H;
destruct_stable ([
unalias κ] ∘ κ
s)
by auto.
+
destruct_group_adapt iso κ'
ref;
[
apply H |
apply H0 |
auto..].
+
destruct_group_adapt trn κ'
ref;
[
apply H |
apply H0 |
auto..].
+
destruct_group_adapt ref κ'
ref;
[
apply H |
apply H0 |
auto..].
destruct IHκ
s;
auto.
+
destruct_group_adapt val κ'
ref;
[
apply H |
apply H0 |
auto..].
+
destruct_group_adapt box κ'
ref;
[
apply H |
apply H0 |
auto..];
subst;
destruct IHκ
s;
auto.
+
destruct_group_adapt tag κ'
ref;
[
apply H |
apply H0 |
auto..].
+
exfalso.
apply lemma36 with (([
unalias κ] ∘ κ
s) ∘ κ')
ref;
auto.
apply lemma23;
auto.
+
destruct_group_adapt iso κ'
box;
[
apply H |
apply H0 |
auto..].
+
destruct_group_adapt trn κ'
box;
[
apply H |
apply H0 |
auto..].
+
destruct_group_adapt ref κ'
box;
[
apply H |
apply H0 |
auto..];
destruct IHκ
s;
auto.
+
destruct_group_adapt val κ'
box;
[
apply H |
apply H0 |
auto..].
+
destruct_group_adapt box κ'
box;
[
apply H |
apply H0 |
auto..];
subst;
destruct IHκ
s;
auto.
+
destruct_group_adapt tag κ'
box;
[
apply H |
apply H0 |
auto..].
+
exfalso.
apply lemma36 with (([
unalias κ] ∘ κ
s) ∘ κ')
box;
auto.
apply lemma23;
auto.
Qed.
Lemma lemma182 :
forall (λ
s:
capset) (κ:
cap),
λ
s ∈
BOX ∪
TAG ∪
BOT ->
κ <>
val ->
λ
s ∘ κ ∈
BOX ∪
TAG ∪
BOT.
Proof.
intros.
destruct H as [|[|]];
destruct κ;
solve [
left;
eapply lemma62;
eauto
|
right;
left;
eapply lemma62;
eauto
|
right;
right;
eapply lemma22;
eauto
|
right;
right;
eapply lemma23;
eauto
|
elim H0;
auto ].
Qed.
Lemma lemma183 {
A} :
forall (
x y:
A) (
xs:
list A),
not (
y ∈
xs ++ [
x]) ->
x <>
y.
Proof.
intros.
intro; subst.
apply H. auto.
Qed.
Hint Resolve lemma183.
Lemma lemma184 :
forall (λ
s:
capset) (κ
s:
list cap),
λ
s ∈
BOX ∪
TAG ∪
BOT ->
not (
val ∈ κ
s) ->
λ
s ∘ κ
s ∈
BOX ∪
TAG ∪
BOT.
Proof.
intros.
induction κ
s as [|κ0]
using rev_ind;
auto.
rewrite lemma19.
apply lemma182.
-
apply IHκ
s.
auto.
-
eauto.
Qed.
Lemma lemma185 :
forall (λ
s:
capset) (κ:
cap),
λ
s ∈
REF ∪
BOX ∪
TAG ∪
BOT ->
κ =
box \/ κ =
tag ->
λ
s ∘ κ ∈
BOX ∪
TAG ∪
BOT.
Proof.
intros.
destruct H0;
subst;
destruct H as [|].
-
left;
eapply lemma62;
eauto.
-
apply lemma182;
eauto.
-
right;
left;
eapply lemma62;
eauto.
-
apply lemma182;
eauto.
Qed.
Lemma lemma186 :
forall (λ
s1 λ
s2:
capset),
λ
s1 ∈
BOX ∪
TAG ∪
BOT ->
λ
s2 ∈
TRN ∪
REF ∪
VAL ∪
BOX ∪
TAG ∪
BOT ->
compatible_set λ
s1 λ
s2.
Proof.
Lemma lemma188 :
forall (λ
s:
capset) (λ:
ecap),
λ
s ∈
STABLE ->
safe_to_write λ
box ->
compatible_set λ
s ([
C (
alias λ)]) ->
λ
s ∈
REF ∪
BOX ∪
TAG ∪
BOT.
Proof.
Lemma lemma189 :
forall (λ
s:
capset) (κ:
cap),
λ
s ∈
STABLE ->
λ
s ∘ κ ∈
BOX ->
(λ
s ∈
BOX /\ (κ =
trn \/ κ =
ref \/ κ =
box)) \/
(λ
s ∈
REF /\ (κ =
box)).
Proof.
intros.
(
destruct_stable λ
s by auto);
solve [
epose (
lemma62a _ _ _ box H1 H0);
inversion g
|
epose (
lemma62a _ _ _ box H1 H0);
inversion g;
subst;
auto
|
exfalso;
apply lemma36 with (λ
s ∘ κ)
box; [|
apply lemma23];
auto ].
Qed.
Lemma lemma187 {
A} :
forall (
P:
A ->
Prop),
forall x,
x ∈ [] ->
P x.
Proof.
intros; inversion H. Qed.
Lemma lemma191 {
A} :
forall (
P:
A ->
Prop) (
xs ys:
list A),
(
forall x,
x ∈
xs ->
P x) ->
(
forall x,
x ∈
ys ->
P x) ->
(
forall x,
x ∈
xs ++
ys ->
P x).
Proof.
intros.
destruct in_app_or with A xs ys x;
auto.
Qed.
Lemma lemma192 {
A} :
forall (
P:
A ->
Prop) (
x:
A),
P x -> (
forall y,
y ∈ [
x] ->
P y).
Proof.
intros; replace y with x; auto. Qed.
Lemma lemma200 :
forall (λ
s:
capset) (κ
s:
list cap),
λ
s ∈
STABLE ->
λ
s ∘ κ
s ∈
BOX ->
(λ
s ∈
BOX /\
forall κ, κ ∈ κ
s -> κ =
trn \/ κ =
ref \/ κ =
box) \/
exists κ
s' κ
s'', (κ
s = κ
s' ++ [
box] ++ κ
s'' /\ λ
s ∘ κ
s' ∈
REF /\
forall κ, κ ∈ κ
s'' -> κ =
trn \/ κ =
ref \/ κ =
box).
Proof.
intros.
induction κ
s as [|κ]
using rev_ind.
-
left.
split.
auto.
apply lemma187.
-
rewrite lemma19 in *.
destruct lemma189 with (λ
s ∘ κ
s) κ
as [[? ?]|[? ?]];
auto.
+
destruct IHκ
s as [[? ?]|[κ
s' [κ
s'' [? [? ?]]]]];
auto.
*
left;
split; [|
apply lemma191; [|
apply lemma192]];
auto.
*
right.
eexists κ
s';
eexists (κ
s''++[κ]).
split; [|
split].
--
subst κ
s;
repeat rewrite <-
app_assoc;
auto.
--
auto.
--
apply lemma191; [|
apply lemma192];
auto.
+
right.
eexists κ
s;
eexists [].
split; [
subst κ|
split];
auto.
Qed.
Lemma lemma201 :
forall (λ
s:
capset) (κ:
cap),
λ
s ∈
BOX ∪
TAG ∪
BOT ->
κ =
trn \/ κ =
ref \/ κ =
box ->
λ
s ∘ κ ∈
BOX ∪
TAG ∪
BOT.
Proof.
intros.
destruct H0 as [|[|]];
subst;
destruct H as [|[|]];
try solve [
left;
eapply lemma62;
eauto
|
right;
left;
eapply lemma62;
eauto
|
right;
right;
eapply lemma22;
eauto
|
right;
right;
eapply lemma23;
eauto ].
Qed.
Lemma lemma202 :
forall (λ
s:
capset) (κ
s:
list cap),
λ
s ∈
BOX ∪
TAG ∪
BOT ->
(
forall κ, κ ∈ κ
s -> κ =
trn \/ κ =
ref \/ κ =
box) ->
λ
s ∘ κ
s ∈
BOX ∪
TAG ∪
BOT.
Proof.
Lemma lemma203 :
forall λ
s κ
s κ
s',
λ
s ∘ (κ
s++κ
s') = λ
s ∘ κ
s ∘ κ
s'.
Proof.
Lemma lemma204 :
forall (λ
s:
capset) (κ
s κ
s':
list cap),
λ
s ∘ κ
s ∈
REF ∪
BOX ∪
TAG ∪
BOT ->
(
forall κ, κ ∈ κ
s' -> κ =
trn \/ κ =
ref \/ κ =
box) ->
λ
s ∘ (κ
s ++ [
box] ++ κ
s') ∈
BOX ∪
TAG ∪
BOT.
Proof.
Lemma lemma205 : [
C ref] ∈
WRITABLE.
Proof.
unfold WRITABLE.
right;
right.
auto.
Qed.
Hint Resolve lemma205.
Lemma lemma206 :
forall (λ
s:
capset) (κ
s:
list cap),
λ
s ∈
WRITABLE ->
λ
s ∘ κ
s ∈
TRN ∪
REF ∪
VAL ∪
BOX ∪
TAG ∪
BOT ->
[
C ref] ∘ κ
s ∈
TRN ∪
REF ∪
VAL ∪
BOX ∪
TAG ∪
BOT.
Proof.
intros.
destruct_stable ([
C ref] ∘ κ
s);
auto.
destruct H0 as [|[|[|[|[|]]]]];
exfalso;
solve [
eapply lemma105; [
apply H0 |
apply lemma86 | .. ];
auto
|
eapply lemma36; [
apply lemma86 |
apply H0 | .. ];
auto ].
all:
finish.
Qed.
Lemma lemmaB1 :
forall (λ
s:
capset) (κ
s1 κ
s3 κ
s4:
list cap) (κ κ2:
cap),
λ
s ∈
WRITABLE ->
compatible_set (λ
s ∘ κ
s4) ([
unalias κ] ∘ κ
s3) ->
[
unalias κ] ∘ κ
s3 ∈
ISO ->
compatible_set ([
C ref] ∘ κ
s4) ([
C ref] ∘ κ
s1 ∘ κ2 ∘ κ
s3).
Proof.
Lemma lemmaB2 :
forall (λ
s:
capset) (λ:
ecap) (κ
s1 κ
s3 κ
s4:
list cap) (κ κ2:
cap),
λ
s ∈
WRITABLE ->
subcap (
unalias κ) (
C κ2) ->
safe_to_write λ κ ->
compatible_set (λ
s ∘ κ
s4) ([
unalias κ] ∘ κ
s3) ->
compatible_set (λ
s ∘ κ
s1) ([
C (
alias λ)]) ->
[
unalias κ] ∘ κ
s3 ∈
TRN ->
compatible_set ([
C ref] ∘ κ
s4) ([
C ref] ∘ κ
s1 ∘ κ2 ∘ κ
s3).
Proof.
intros.
-κ ∘ κs3 ∈ TRN *)
assert (λ
s ∘ κ
s4 ∈
BOX ∪
TAG ∪
BOT)
by (
eapply (
lemma64 trn); [
apply lemma27 | ..];
eauto).
assert ([
C ref] ∘ κ
s4 ∈
BOX ∪
TAG ∪
BOT)
as [|[|]]
by (
apply lemma71 with λ
s;
auto).
TAG and BOT are compatible with anything else. *)2-3:
solve [
apply lemma55;
auto |
apply lemma52;
auto ].
ref ∘ κs4 ∈ BOX *)
All cases except ISO are compatible with BOX. *)
destruct_stable ([
C ref] ∘ κ
s1 ∘ κ2 ∘ κ
s3)
by eauto.
2-7:
solve [
eapply lemma48;
eauto |
apply lemma73,
lemma52;
auto ].
ref ∘ κs1 ∘ κ2 ∘ κs3 ∈ ISO *)
assert ([
C ref] ∘ κ
s1 ∘ κ2 ∈
ISO /\ [
unalias κ] ∈
TRN ∪
REF)
as []
by (
apply lemma75 with κ
s3;
eauto;
finish).
assert ([
C ref] ∘ κ
s1 ∈
ISO \/ κ2 =
iso)
as [|]
by (
apply lemma76;
eauto).
κ2 = iso is impossible as -κ < κ2 and -κ = trn or -κ = ref *)2:
solve [
destruct H9;
[
assert (κ=
trn)
by (
apply lemma77;
auto)
|
assert (κ=
ref)
by (
apply lemma77;
auto)];
subst;
inversion H0
].
ref ∘ κs1 ∈ ISO *)
assert (λ
s ∘ κ
s1 ∈
ISO)
by (
apply lemma86;
auto).
assert (
compatible (
unalias iso) (
C (
alias λ)))
by (
apply H3; [
apply H11|
auto]).
destruct λ
as [[]| |]
eqn:?;
inversion H12.
2:
solve [
inversion H1 ].
λ = C iso *)
κ = iso \/ κ = val \/ κ = tag *)
inversion H1;
(
destruct H9;
[
assert (κ=
trn)
by (
apply lemma77;
auto)
|
assert (κ=
ref)
by (
apply lemma77;
auto)]);
subst;
inversion H13.
Qed.
Lemma lemmaB3 :
forall (λ
s:
capset) (λ:
ecap) (κ
s1 κ
s3 κ
s4:
list cap) (κ κ2:
cap),
λ
s ∈
WRITABLE ->
subcap (
unalias κ) (
C κ2) ->
safe_to_write λ κ ->
compatible_set (λ
s ∘ κ
s4) ([
unalias κ] ∘ κ
s3) ->
compatible_set (λ
s ∘ κ
s1) ([
C (
alias λ)]) ->
[
unalias κ] ∘ κ
s3 ∈
REF ->
compatible_set ([
C ref] ∘ κ
s4) ([
C ref] ∘ κ
s1 ∘ κ2 ∘ κ
s3).
Proof.
Lemma lemmaB4 :
forall (λ
s:
capset) (λ:
ecap) (κ
s1 κ
s3 κ
s4:
list cap) (κ κ2:
cap),
λ
s ∈
WRITABLE ->
subcap (
unalias κ) (
C κ2) ->
safe_to_write λ κ ->
compatible_set (λ
s ∘ κ
s4) ([
unalias κ] ∘ κ
s3) ->
compatible_set (λ
s ∘ κ
s1) ([
C (
alias λ)]) ->
[
unalias κ] ∘ κ
s3 ∈
VAL ->
compatible_set ([
C ref] ∘ κ
s4) ([
C ref] ∘ κ
s1 ∘ κ2 ∘ κ
s3).
Proof.
Lemma lemmaB5 :
forall (λ
s:
capset) (λ:
ecap) (κ
s1 κ
s3 κ
s4:
list cap) (κ κ2:
cap),
λ
s ∈
WRITABLE ->
subcap (
unalias κ) (
C κ2) ->
safe_to_write λ κ ->
compatible_set (λ
s ∘ κ
s4) ([
unalias κ] ∘ κ
s3) ->
compatible_set (λ
s ∘ κ
s1) ([
C (
alias λ)]) ->
[
unalias κ] ∘ κ
s3 ∈
BOX ->
compatible_set ([
C ref] ∘ κ
s4) ([
C ref] ∘ κ
s1 ∘ κ2 ∘ κ
s3).
Proof.
Lemma lemmaB :
forall (λ
s:
capset) (λ:
ecap) (κ
s1 κ
s3 κ
s4:
list cap) (κ κ2:
cap),
λ
s ∈
WRITABLE ->
subcap (
unalias κ) (
C κ2) ->
safe_to_write λ κ ->
compatible_set (λ
s ∘ κ
s4) ([
unalias κ] ∘ κ
s3) ->
compatible_set (λ
s ∘ κ
s1) ([
C (
alias λ)]) ->
compatible_set ([
C ref] ∘ κ
s4) ([
C ref] ∘ κ
s1 ∘ κ2 ∘ κ
s3).
Proof with
finish.
intros.
destruct_stable ([
unalias κ] ∘ κ
s3)
by auto.
-
apply lemmaB1 with λ
s κ...
-
apply lemmaB2 with λ
s λ κ...
-
apply lemmaB3 with λ
s λ κ...
-
apply lemmaB4 with λ
s λ κ...
-
apply lemmaB5 with λ
s λ κ...
-
admit.
-
admit.
Admitted.