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
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Service Desk
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
Iris
lambda-rust
Commits
d224fef7
There was a problem fetching the pipeline summary.
Commit
d224fef7
authored
8 years ago
by
Jacques-Henri Jourdan
Browse files
Options
Downloads
Patches
Plain Diff
Simplify prood of sum_proper. Define LstCopy.
parent
ff35e4e4
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
theories/typing/product.v
+1
-3
1 addition, 3 deletions
theories/typing/product.v
theories/typing/sum.v
+4
-11
4 additions, 11 deletions
theories/typing/sum.v
theories/typing/type.v
+10
-5
10 additions, 5 deletions
theories/typing/type.v
with
15 additions
and
19 deletions
theories/typing/product.v
+
1
−
3
View file @
d224fef7
...
...
@@ -127,9 +127,7 @@ Section product.
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
.
(* FIXME : this instance is never going to be used, because Forall is
not a typeclass. *)
Global
Instance
product_copy
tys
:
Forall
Copy
tys
→
Copy
(
product
tys
)
.
Global
Instance
product_copy
tys
:
LstCopy
tys
→
Copy
(
product
tys
)
.
Proof
.
induction
1
;
apply
_
.
Qed
.
End
product
.
...
...
This diff is collapsed.
Click to expand it.
theories/typing/sum.v
+
4
−
11
View file @
d224fef7
...
...
@@ -110,18 +110,11 @@ Section sum.
Global
Instance
sum_proper
E
L
:
Proper
(
Forall2
(
eqtype
E
L
)
==>
eqtype
E
L
)
sum
.
Proof
.
(* TODO: Isn't there sth. showing that Forall2 is monotnous wrt. the predicate? *)
intros
tyl1
tyl2
Heq
.
assert
(
Forall2
(
subtype
E
L
)
tyl1
tyl2
∧
Forall2
(
subtype
E
L
)
tyl2
tyl1
)
.
{
induction
Heq
as
[|????
Heq
];
first
done
.
destruct_and
!.
destruct
Heq
.
split
;
constructor
;
done
.
}
destruct_and
!.
split
;
apply
sum_mono
;
done
.
intros
tyl1
tyl2
Heq
;
split
;
eapply
sum_mono
;
[|
rewrite
-
Forall2_flip
];
(
eapply
Forall2_impl
;
[
done
|
by
intros
??
[]])
.
Qed
.
(* TODO : Make the Forall parameter a typeclass *)
(* TODO : This next step is suspuciously slow. *)
Global
Instance
sum_copy
tyl
:
Forall
Copy
tyl
→
Copy
(
sum
tyl
)
.
Global
Instance
sum_copy
tyl
:
LstCopy
tyl
→
Copy
(
sum
tyl
)
.
Proof
.
intros
HFA
.
split
.
-
intros
tid
vl
.
...
...
@@ -142,7 +135,7 @@ Section sum.
rewrite
-
(
heap_mapsto_vec_prop_op
_
q'
q'12
);
last
(
by
intros
;
apply
ty_size_eq
)
.
rewrite
-!
Qp_plus_assoc
.
rewrite
-
(
heap_mapsto_vec_prop_op
_
q'
(
q'11
+
q'02
)
(
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
.
}
iDestruct
"Hownq"
as
"[Hownq1 Hownq2]"
.
iDestruct
"Hown"
as
"[Hown1 >Hown2]"
.
iDestruct
"Htail"
as
"[Htail1 Htail2]"
.
...
...
This diff is collapsed.
Click to expand it.
theories/typing/type.v
+
10
−
5
View file @
d224fef7
...
...
@@ -42,16 +42,21 @@ Section type.
}
.
Global
Existing
Instances
ty_shr_persistent
.
Class
Copy
(
t
:
type
)
:=
{
copy_persistent
tid
vl
:
PersistentP
(
t
.(
ty_own
)
tid
vl
);
Class
Copy
(
t
y
:
type
)
:=
{
copy_persistent
tid
vl
:
PersistentP
(
t
y
.(
ty_own
)
tid
vl
);
copy_shr_acc
κ
tid
E
F
l
q
:
mgmtE
∪
F
⊆
E
→
lft_ctx
-∗
t
.(
ty_shr
)
κ
tid
F
l
-∗
q
.[
κ
]
∗
na_own
tid
F
=
{
E
}
=∗
∃
q'
,
▷
l
↦∗
{
q'
}:
t
.(
ty_own
)
tid
∗
(
▷
l
↦∗
{
q'
}:
t
.(
ty_own
)
tid
=
{
E
}
=∗
q
.[
κ
]
∗
na_own
tid
F
)
lft_ctx
-∗
t
y
.(
ty_shr
)
κ
tid
F
l
-∗
q
.[
κ
]
∗
na_own
tid
F
=
{
E
}
=∗
∃
q'
,
▷
l
↦∗
{
q'
}:
t
y
.(
ty_own
)
tid
∗
(
▷
l
↦∗
{
q'
}:
t
y
.(
ty_own
)
tid
=
{
E
}
=∗
q
.[
κ
]
∗
na_own
tid
F
)
}
.
Global
Existing
Instances
copy_persistent
.
Class
LstCopy
(
tys
:
list
type
)
:=
lst_copy
:
Forall
Copy
tys
.
Global
Instance
lst_copy_nil
:
LstCopy
[]
:=
List
.
Forall_nil
_
.
Global
Instance
lst_copy_cons
ty
tys
:
Copy
ty
→
LstCopy
tys
→
LstCopy
(
ty
::
tys
)
:=
List
.
Forall_cons
_
_
_
.
(* We are repeating the typeclass parameter here jsut to make sure
that simple_type does depend on it. Otherwise, the coercion defined
bellow will not be acceptable by Coq. *)
...
...
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