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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Simon Spies
lambda-rust
Commits
4625e064
Commit
4625e064
authored
7 years ago
by
Jacques-Henri Jourdan
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of gitlab.mpi-sws.org:FP/LambdaRust-coq
parents
224ad3d4
11231ef7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
theories/lang/lib/arc.v
+22
-0
22 additions, 0 deletions
theories/lang/lib/arc.v
theories/typing/lib/join.v
+1
-0
1 addition, 0 deletions
theories/typing/lib/join.v
with
23 additions
and
0 deletions
theories/lang/lib/arc.v
+
22
−
0
View file @
4625e064
...
...
@@ -7,6 +7,28 @@ From iris.algebra Require Import excl csum frac auth.
From
lrust
.
lang
Require
Import
lang
proofmode
notation
new_delete
.
Set
Default
Proof
Using
"Type"
.
(* JH: while working on Arc, I think figured that the "weak count
locking" mechanism that Rust is using and that is verified below may
not be necessary.
Instead, what can be done in get_mut is the following:
- First, do a CAS on the strong count to put it to 0 from the expected
value 1. This has the effect, at the same time, of ensuring that no one
else has a strong reference, and of forbidding other weak references to
be upgraded (since the strong count is now at 0). If the CAS fail,
simply return None.
- Second, check the weak count. If it is at 1, then we are sure that
we are the only owner.
- Third, in any case write 1 in the strong count to cancel the CAS.
What's wrong with this protocol? The "only" problem I can see is that if
someone tries to upgrade a weak after we did the CAS, then this will
fail even though this could be possible.
RJ: Upgrade failing spuriously sounds like a problem severe enough to
justify the locking protocol.
*)
Definition
strong_count
:
val
:=
λ
:
[
"l"
],
!
ˢᶜ
"l"
.
...
...
This diff is collapsed.
Click to expand it.
theories/typing/lib/join.v
+
1
−
0
View file @
4625e064
...
...
@@ -81,6 +81,7 @@ Section join.
with
"[] LFT HE Hna HL Hk [-]"
);
last
first
.
{
rewrite
tctx_interp_cons
tctx_interp_singleton
!
tctx_hasty_val
.
iFrame
.
}
iApply
(
type_new_subtype
(
Π
[
uninit
R_A
.(
ty_size
);
uninit
R_B
.(
ty_size
)]));
(* FIXME: solve_typing should handle this without any aid. *)
rewrite
?Z_nat_add
;
[
solve_typing
..|]
.
iIntros
(
r
);
simpl_subst
.
iApply
(
type_memcpy
R_A
);
[
solve_typing
..|]
.
...
...
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