Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lambda-rust
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michael Sammler
lambda-rust
Commits
363ce0ef
Commit
363ce0ef
authored
8 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
Coq anomaly
parent
a3fb7a8b
Branches
ralf/anomaly
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
theories/typing/product.v
+4
-3
4 additions, 3 deletions
theories/typing/product.v
theories/typing/sum.v
+44
-32
44 additions, 32 deletions
theories/typing/sum.v
with
48 additions
and
35 deletions
theories/typing/product.v
+
4
−
3
View file @
363ce0ef
...
@@ -83,10 +83,11 @@ Section product.
...
@@ -83,10 +83,11 @@ Section product.
Proper
(
eqtype
E
L
==>
eqtype
E
L
==>
eqtype
E
L
)
product2
.
Proper
(
eqtype
E
L
==>
eqtype
E
L
==>
eqtype
E
L
)
product2
.
Proof
.
by
intros
??
[]
??
[];
split
;
apply
product2_mono
.
Qed
.
Proof
.
by
intros
??
[]
??
[];
split
;
apply
product2_mono
.
Qed
.
Global
Program
Instance
product2_copy
`
(
!
Copy
ty1
)
`
(
!
Copy
ty2
)
:
Global
Instance
product2_copy
`
(
!
Copy
ty1
)
`
(
!
Copy
ty2
)
:
Copy
(
product2
ty1
ty2
).
Copy
(
product2
ty1
ty2
).
Next
Obligation
.
Proof
.
intros
ty1
?
ty2
?
κ
tid
E
F
l
q
?
.
iIntros
"#LFT H [[Htok1 Htok2] Htl]"
.
split
;
first
(
intros
;
apply
_
).
intros
κ
tid
E
F
l
q
?
.
iIntros
"#LFT H [[Htok1 Htok2] Htl]"
.
iDestruct
"H"
as
(
E1
E2
)
"(% & H1 & H2)"
.
iDestruct
"H"
as
(
E1
E2
)
"(% & H1 & H2)"
.
assert
(
F
=
E1
∪
E2
∪
F
∖
(
E1
∪
E2
))
as
->
.
assert
(
F
=
E1
∪
E2
∪
F
∖
(
E1
∪
E2
))
as
->
.
{
rewrite
-
union_difference_L
;
set_solver
.
}
{
rewrite
-
union_difference_L
;
set_solver
.
}
...
...
This diff is collapsed.
Click to expand it.
theories/typing/sum.v
+
44
−
32
View file @
363ce0ef
...
@@ -79,41 +79,53 @@ Section sum.
...
@@ -79,41 +79,53 @@ Section sum.
-
by
iApply
(
frac_bor_shorten
with
"Hord"
).
-
by
iApply
(
frac_bor_shorten
with
"Hord"
).
Qed
.
Qed
.
Global
Instance
sum_mono
E
L
:
Proper
(
Forall2
(
subtype
E
L
)
==>
subtype
E
L
)
sum
.
Proof
.
intros
tyl1
tyl2
Htyl
.
iIntros
"#LFT #? %"
.
iSplit
;
last
(
iSplit
;
iAlways
).
-
simpl
.
iInduction
Htyl
as
l
"IH"
.
induction
Htyl
;
first
done
.
iPureIntro
.
do
2
f_equal
.
simpl
.
f_equal
;
last
done
.
Global
Instance
product_proper
E
L
:
Proper
(
Forall2
(
eqtype
E
L
)
==>
eqtype
E
L
)
product
.
Proof
.
intros
??
.
induction
1.
done
.
by
simpl
;
f_equiv
.
Qed
.
*
)
(
*
TODO
:
Make
the
Forall
parameter
a
typeclass
*
)
(
*
TODO
:
Make
the
Forall
parameter
a
typeclass
*
)
(
*
TODO
:
This
next
step
is
suspuciously
slow
.
*
)
(
*
TODO
:
This
next
step
is
suspuciously
slow
.
*
)
Global
Program
Instance
sum_copy
tyl
:
Global
Instance
sum_copy
tyl
:
Forall
Copy
tyl
→
Copy
(
sum
tyl
).
Forall
Copy
tyl
→
Copy
(
sum
tyl
).
Next
Obligation
.
Proof
.
intros
tyl
HFA
tid
vl
.
intros
HFA
.
split
.
cut
(
∀
i
vl
'
,
PersistentP
(
ty_own
(
nth
i
tyl
∅
)
tid
vl
'
)).
by
apply
_.
-
intros
tid
vl
.
intros
.
apply
@
copy_persistent
.
edestruct
nth_in_or_default
as
[
|
->
];
cut
(
∀
i
vl
'
,
PersistentP
(
ty_own
(
nth
i
tyl
∅
)
tid
vl
'
)).
by
apply
_.
[
by
eapply
List
.
Forall_forall
|
apply
_
].
intros
.
apply
@
copy_persistent
.
edestruct
nth_in_or_default
as
[
|
->
];
Qed
.
[
by
eapply
List
.
Forall_forall
|
apply
_
].
Next
Obligation
.
-
intros
κ
tid
E
F
l
q
?
.
intros
tyl
HFA
κ
tid
E
F
l
q
?
.
iIntros
"#LFT #H[[Htok1 [Htok2 Htok3]] Htl]"
.
iIntros
"#LFT #H[[Htok1 [Htok2 Htok3]] Htl]"
.
setoid_rewrite
split_sum_mt
.
iDestruct
"H"
as
(
i
)
"[Hshr0 [Hshr Hshrtail]]"
.
setoid_rewrite
split_sum_mt
.
iDestruct
"H"
as
(
i
)
"[Hshr0 [Hshr Hshrtail]]"
.
iMod
(
frac_bor_acc
with
"LFT Hshr0 Htok1"
)
as
(
q
'1
)
"[Hown Hclose]"
.
set_solver
.
iMod
(
frac_bor_acc
with
"LFT Hshr0 Htok1"
)
as
(
q
'1
)
"[Hown Hclose]"
.
set_solver
.
iMod
(
frac_bor_acc
with
"LFT Hshrtail Htok2"
)
as
(
q
'
2
)
"[Htail Hclose']"
.
set_solver
.
iMod
(
frac_bor_acc
with
"LFT Hshrtail Htok2"
)
as
(
q
'
2
)
"[Htail Hclose']"
.
set_solver
.
iMod
(
@
copy_shr_acc
_
_
(
nth
i
tyl
∅
)
with
"LFT Hshr [Htok3 $Htl]"
)
iMod
(
@
copy_shr_acc
_
_
(
nth
i
tyl
∅
)
with
"LFT Hshr [Htok3 $Htl]"
)
as
(
q
'
3
)
"[Hownq Hclose'']"
;
try
done
.
as
(
q
'
3
)
"[Hownq Hclose'']"
;
try
done
.
{
edestruct
nth_in_or_default
as
[
|
->
];
last
by
apply
_.
{
edestruct
nth_in_or_default
as
[
|
->
];
last
by
apply
_.
by
eapply
List
.
Forall_forall
.
}
by
eapply
List
.
Forall_forall
.
}
destruct
(
Qp_lower_bound
q
'1
q
'
2
)
as
(
q
'0
&
q
'01
&
q
'0
2
&
->
&
->
).
destruct
(
Qp_lower_bound
q
'1
q
'
2
)
as
(
q
'0
&
q
'01
&
q
'0
2
&
->
&
->
).
destruct
(
Qp_lower_bound
q
'0
q
'
3
)
as
(
q
'
&
q
'11
&
q
'1
2
&
->
&
->
).
destruct
(
Qp_lower_bound
q
'0
q
'
3
)
as
(
q
'
&
q
'11
&
q
'1
2
&
->
&
->
).
rewrite
-
(
heap_mapsto_vec_prop_op
_
q
'
q
'1
2
);
last
(
by
intros
;
apply
ty_size_eq
).
rewrite
-
(
heap_mapsto_vec_prop_op
_
q
'
q
'1
2
);
last
(
by
intros
;
apply
ty_size_eq
).
rewrite
-!
Qp_plus_assoc
.
rewrite
-!
Qp_plus_assoc
.
rewrite
-
(
heap_mapsto_vec_prop_op
_
q
'
(
q
'11
+
q
'0
2
)
rewrite
-
(
heap_mapsto_vec_prop_op
_
q
'
(
q
'11
+
q
'0
2
)
(
list_max
(
map
ty_size
tyl
)
-
(
ty_size
(
nth
i
tyl
∅
)))
%
nat
);
last
first
.
(
list_max
(
map
ty_size
tyl
)
-
(
ty_size
(
nth
i
tyl
∅
)))
%
nat
);
last
first
.
{
intros
.
iIntros
(
<-
).
iPureIntro
.
by
rewrite
minus_plus
.
}
{
intros
.
iIntros
(
<-
).
iPureIntro
.
by
rewrite
minus_plus
.
}
iDestruct
"Hownq"
as
"[Hownq1 Hownq2]"
.
iDestruct
"Hown"
as
"[Hown1 >Hown2]"
.
iDestruct
"Hownq"
as
"[Hownq1 Hownq2]"
.
iDestruct
"Hown"
as
"[Hown1 >Hown2]"
.
iDestruct
"Htail"
as
"[Htail1 Htail2]"
.
iDestruct
"Htail"
as
"[Htail1 Htail2]"
.
iExists
q
'
.
iModIntro
.
iSplitL
"Hown1 Hownq1 Htail1"
.
iExists
q
'
.
iModIntro
.
iSplitL
"Hown1 Hownq1 Htail1"
.
+
iNext
.
iExists
i
.
by
iFrame
.
-
iNext
.
iExists
i
.
by
iFrame
.
+
iIntros
"H"
.
iDestruct
"H"
as
(
i
'
)
"[>Hown1 [Hownq1 Htail1]]"
.
-
iIntros
"H"
.
iDestruct
"H"
as
(
i
'
)
"[>Hown1 [Hownq1 Htail1]]"
.
iDestruct
(
heap_mapsto_agree
with
"[$Hown1 $Hown2]"
)
as
%
[
=
->%
Z_of_nat_inj
].
iDestruct
(
heap_mapsto_agree
with
"[$Hown1 $Hown2]"
)
as
%
[
=
->%
Z_of_nat_inj
].
iMod
(
"Hclose''"
with
"[$Hownq1 $Hownq2]"
).
iMod
(
"Hclose'"
with
"[$Htail1 $Htail2]"
).
iMod
(
"Hclose''"
with
"[$Hownq1 $Hownq2]"
).
iMod
(
"Hclose'"
with
"[$Htail1 $Htail2]"
).
iMod
(
"Hclose"
with
"[$Hown1 $Hown2]"
)
as
"$"
.
by
iFrame
.
iMod
(
"Hclose"
with
"[$Hown1 $Hown2]"
)
as
"$"
.
by
iFrame
.
Qed
.
Qed
.
End
sum
.
End
sum
.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment