Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iGPS
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
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
FP
iGPS
Commits
fd80d33c
There was a problem fetching the pipeline summary.
Commit
fd80d33c
authored
8 years ago
by
Hai Dang
Browse files
Options
Downloads
Patches
Plain Diff
add 3 instances of GPS read
parent
77570203
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
coq/ra/gps_instances.v
+121
-7
121 additions, 7 deletions
coq/ra/gps_instances.v
with
122 additions
and
7 deletions
.gitignore
+
1
−
0
View file @
fd80d33c
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
*.d
*.d
*.glob
*.glob
*.vo
*.vo
*.vio
*.log
*.log
*.aux
*.aux
*.fdb_latexmk
*.fdb_latexmk
...
...
This diff is collapsed.
Click to expand it.
coq/ra/gps_instances.v
+
121
−
7
View file @
fd80d33c
...
@@ -15,7 +15,8 @@ Section Protocols.
...
@@ -15,7 +15,8 @@ Section Protocols.
Local
Notation
iProp
:=
(
iProp
Σ
).
Local
Notation
iProp
:=
(
iProp
Σ
).
Context
`
{
ParamDec
:
∀
x
y
:
Param
,
Decision
(
x
=
y
)
}
Context
`
{
ParamDec
:
∀
x
y
:
Param
,
Decision
(
x
=
y
)
}
{
ParamCount
:
Countable
Param
}
.
{
ParamCount
:
Countable
Param
}
{
ParamInhab
:
Inhabited
Param
}
.
Variables
(
F
F_past
:
Param
->
Pr_state
Prtcl
->
Z
->
@
vPred
Σ
).
Variables
(
F
F_past
:
Param
->
Pr_state
Prtcl
->
Z
->
@
vPred
Σ
).
Hypothesis
(
PastDup
:
∀
x
s
v
V
,
F_past
x
s
v
V
⊢
F_past
x
s
v
V
★
F_past
x
s
v
V
).
Hypothesis
(
PastDup
:
∀
x
s
v
V
,
F_past
x
s
v
V
⊢
F_past
x
s
v
V
★
F_past
x
s
v
V
).
...
@@ -39,37 +40,150 @@ Section Protocols.
...
@@ -39,37 +40,150 @@ Section Protocols.
∃
γ
,
n
=
Encoder
γ
x
★
WA
s
V
γ
.
∃
γ
,
n
=
Encoder
γ
x
★
WA
s
V
γ
.
Section
SW
.
Section
SW
.
Context
(
Np
Nl
:
namespace
)
(
NNpDisj
:
disjoint
N
Np
).
Context
(
Np
Nl
:
namespace
)
(
NNpDisj
:
disjoint
N
Np
)
(
NNlDisj
:
disjoint
N
Nl
).
Definition
G
S
P_RP
l
x
s
V
:
iProp
:=
Definition
GP
S
_RP
l
x
s
V
:
iProp
:=
persisted
Np
Nl
l
PrInvRaw
(
ReaderRaw
x
s
V
).
persisted
Np
Nl
l
PrInvRaw
(
ReaderRaw
x
s
V
).
Definition
G
S
P_WP
l
x
s
V
:
iProp
:=
Definition
GP
S
_WP
l
x
s
V
:
iProp
:=
persisted
Np
Nl
l
PrInvRaw
(
WriterRaw
x
s
V
).
persisted
Np
Nl
l
PrInvRaw
(
WriterRaw
x
s
V
).
Lemma
GPS_RP_Read
(
P
:
vPred
)
(
Q
:
Z
->
vPred
)
E
s
Φ
π
V
l
x
:
nclose
N
⊆
E
→
nclose
Nl
⊆
E
→
▷
(
⊩
(
∀
s
'
,
■
(
s
⊑
s
'
)
→
(
∀
v
,
F_past
x
s
'
v
★
P
={
E
∖
Nl
}=
★
Q
v
)
%
V
∨
(
∀
s
''
v
,
■
(
s
'
⊑
s
''
)
→
F
x
s
''
v
★
P
={
E
∖
Nl
}=
★
False
)))
★
invariants
.
inv
N
PSInv
★
Seen
π
V
★
▷
(
P
V
)
★
GPS_RP
l
x
s
V
★
(
∀
v
V
'
s
'
,
■
(
V
⊑
V
'
)
★
■
(
s
⊑
s
'
)
★
Seen
π
V
'
★
Q
v
V
'
★
GPS_RP
l
x
s
'
V
'
-
★
Φ
(
LitV
$
LitInt
v
,
π
))
⊢
WP
(
Load
at_hack
(
Lit
$
LitLoc
l
),
π
)
@
(
E
)
{{
Φ
}}
.
Proof
.
intros
.
iIntros
"(Hyp & #kI & #kS & oP & oR & Post)"
.
iVs
((
persistor_open
Np
Nl
)
with
"[oR]"
)
as
(
X
)
"(PrInvRaw & ReaderRaw & HClose)"
=>
//.
iDestruct
"ReaderRaw"
as
(
γ
)
"(% & RA)"
.
iDestruct
"PrInvRaw"
as
(
γ'
x
'
)
"(>% & PrInv)"
.
rewrite
H2
in
H1
.
destruct
(
Encoder_Inj
_
_
_
_
H1
)
as
[
Eqx
Eq
γ
].
subst
x
γ
.
iApply
((
RawProto_Read
N
))
=>
//.
-
apply
ndisj_subseteq_difference
=>
//.
-
iSplitL
"Hyp"
;
first
by
iNext
.
iSplit
=>
//.
iSplit
=>
//.
iSplitL
"oP"
=>
//.
iSplitL
"RA"
=>
//.
iSplitL
"PrInv"
=>
//.
iIntros
(
v
V
'
s
'
)
"(% & % & #kS' & kQ & kRA & PrInv)"
.
iAssert
(
GPS_RP
l
x
'
s
'
V
'
-
★
Φ
(
LitV
(
LitInt
v
),
π
))
with
"[Post kQ]"
as
"Post"
.
{
iIntros
"GPS"
.
iApply
(
"Post"
$
!
v
V
'
s
'
).
iFrame
.
repeat
iSplit
=>
//. }
iApply
"Post"
.
iApply
"HClose"
.
iSplitL
"PrInv"
.
+
iNext
.
iExists
γ'
,
x
'
.
by
iFrame
.
+
iExists
γ'
.
by
iFrame
.
Qed
.
End
SW
.
End
SW
.
Definition
PrInvRaw_WShare
l
n
:
iProp
:=
Definition
PrInvRaw_WShare
l
n
:
iProp
:=
∃
γ
x
,
n
=
Encoder
γ
x
★
PrInv
F
F_past
l
γ
x
★
∃
ζ
,
Writer
γ
ζ
.
∃
γ
x
,
n
=
Encoder
γ
x
★
PrInv
F
F_past
l
γ
x
★
∃
ζ
,
Writer
γ
ζ
.
Section
Plain
.
Section
Plain
.
Context
(
Np
Nl
:
namespace
)
(
NNpDisj
:
disjoint
N
Np
).
Context
(
Np
Nl
:
namespace
)
(
NNpDisj
:
disjoint
N
Np
)
(
NNlDisj
:
disjoint
N
Nl
).
Definition
G
S
P_Plain
l
x
s
V
:
iProp
:=
Definition
GP
S
_Plain
l
x
s
V
:
iProp
:=
persisted
Np
Nl
l
PrInvRaw_WShare
(
ReaderRaw
x
s
V
).
persisted
Np
Nl
l
PrInvRaw_WShare
(
ReaderRaw
x
s
V
).
Lemma
GPS_Plain_Read
(
P
:
vPred
)
(
Q
:
Z
->
vPred
)
E
s
Φ
π
V
l
x
:
nclose
N
⊆
E
→
nclose
Nl
⊆
E
→
▷
(
⊩
(
∀
s
'
,
■
(
s
⊑
s
'
)
→
(
∀
v
,
F_past
x
s
'
v
★
P
={
E
∖
Nl
}=
★
Q
v
)
%
V
∨
(
∀
s
''
v
,
■
(
s
'
⊑
s
''
)
→
F
x
s
''
v
★
P
={
E
∖
Nl
}=
★
False
)))
★
invariants
.
inv
N
PSInv
★
Seen
π
V
★
▷
(
P
V
)
★
GPS_Plain
l
x
s
V
★
(
∀
v
V
'
s
'
,
■
(
V
⊑
V
'
)
★
■
(
s
⊑
s
'
)
★
Seen
π
V
'
★
Q
v
V
'
★
GPS_Plain
l
x
s
'
V
'
-
★
Φ
(
LitV
$
LitInt
v
,
π
))
⊢
WP
(
Load
at_hack
(
Lit
$
LitLoc
l
),
π
)
@
(
E
)
{{
Φ
}}
.
Proof
.
intros
.
iIntros
"(Hyp & #kI & #kS & oP & oR & Post)"
.
iVs
((
persistor_open
Np
Nl
)
with
"[oR]"
)
as
(
X
)
"(PrInvRaw & ReaderRaw & HClose)"
=>
//.
iDestruct
"ReaderRaw"
as
(
γ
)
"(% & RA)"
.
iDestruct
"PrInvRaw"
as
(
γ'
x
'
)
"(>% & PrInv & Writer)"
.
rewrite
H2
in
H1
.
destruct
(
Encoder_Inj
_
_
_
_
H1
)
as
[
Eqx
Eq
γ
].
subst
x
γ
.
iApply
((
RawProto_Read
N
))
=>
//.
-
apply
ndisj_subseteq_difference
=>
//.
-
iSplitL
"Hyp"
;
first
by
iNext
.
iSplit
=>
//.
iSplit
=>
//.
iSplitL
"oP"
=>
//.
iSplitL
"RA"
=>
//.
iSplitL
"PrInv"
=>
//.
iIntros
(
v
V
'
s
'
)
"(% & % & #kS' & kQ & kRA & PrInv)"
.
iAssert
(
GPS_Plain
l
x
'
s
'
V
'
-
★
Φ
(
LitV
(
LitInt
v
),
π
))
with
"[Post kQ]"
as
"Post"
.
{
iIntros
"GPS"
.
iApply
(
"Post"
$
!
v
V
'
s
'
).
iFrame
.
repeat
iSplit
=>
//. }
iApply
"Post"
.
iApply
"HClose"
.
iSplitL
"PrInv Writer"
.
+
iNext
.
iExists
γ'
,
x
'
.
by
iFrame
.
+
iExists
γ'
.
by
iFrame
.
Qed
.
End
Plain
.
End
Plain
.
Section
Frac
.
Section
Frac
.
Context
(
Encoder
'
:
val
→
gname
→
val
)
Context
(
Encoder
'
:
val
→
gname
→
val
)
(
Encoder_Inj
'
:
∀
X1
γ
1
X2
γ
2
,
Encoder
'
X1
γ
1
=
Encoder
'
X2
γ
2
(
Encoder_Inj
'
:
∀
X1
γ
1
X2
γ
2
,
Encoder
'
X1
γ
1
=
Encoder
'
X2
γ
2
→
X1
=
X2
∧
γ
1
=
γ
2
).
→
X1
=
X2
∧
γ
1
=
γ
2
).
Context
(
Nl
:
namespace
).
Context
(
Nl
:
namespace
)
(
NNlDisj
:
disjoint
N
Nl
)
.
Context
`
{!
cinvG
Σ
}
.
Context
`
{!
cinvG
Σ
}
.
Definition
FracRaw
x
s
V
l
(
q
:
frac
)
n
:
iProp
:=
Definition
FracRaw
x
s
V
l
(
q
:
frac
)
n
:
iProp
:=
∃
γ
,
n
=
Encoder
γ
x
★
RA
s
V
γ
.
∃
γ
,
n
=
Encoder
γ
x
★
RA
s
V
γ
.
Definition
GSP_Frac
l
x
s
(
q
:
frac
)
V
:
iProp
:=
Definition
GSP_Frac
l
x
s
(
q
:
frac
)
V
:
iProp
:=
fractored
Nl
Encoder
'
l
PrInvRaw_WShare
(
FracRaw
x
s
V
)
q
.
fractored
Nl
Encoder
'
l
PrInvRaw_WShare
(
FracRaw
x
s
V
)
q
.
Lemma
GPS_Frac_Read
(
P
:
vPred
)
(
Q
:
Z
->
vPred
)
E
s
Φ
π
V
l
x
q
:
nclose
N
⊆
E
→
nclose
Nl
⊆
E
→
▷
(
⊩
(
∀
s
'
,
■
(
s
⊑
s
'
)
→
(
∀
v
,
F_past
x
s
'
v
★
P
={
E
∖
Nl
}=
★
Q
v
)
%
V
∨
(
∀
s
''
v
,
■
(
s
'
⊑
s
''
)
→
F
x
s
''
v
★
P
={
E
∖
Nl
}=
★
False
)))
★
invariants
.
inv
N
PSInv
★
Seen
π
V
★
▷
(
P
V
)
★
GSP_Frac
l
x
s
q
V
★
(
∀
v
V
'
s
'
,
■
(
V
⊑
V
'
)
★
■
(
s
⊑
s
'
)
★
Seen
π
V
'
★
Q
v
V
'
★
GSP_Frac
l
x
s
'
q
V
'
-
★
Φ
(
LitV
$
LitInt
v
,
π
))
⊢
WP
(
Load
at_hack
(
Lit
$
LitLoc
l
),
π
)
@
(
E
)
{{
Φ
}}
.
Proof
.
intros
.
iIntros
"(Hyp & #kI & #kS & oP & oR & Post)"
.
iVs
((
fractor_open
Nl
)
with
"[oR]"
)
as
(
X
)
"(PrInvRaw & FracRaw & HClose)"
=>
//.
iDestruct
"FracRaw"
as
(
γ
)
"(% & RA)"
.
iDestruct
"PrInvRaw"
as
(
γ'
x
'
)
"(>% & PrInv & Writer)"
.
rewrite
H2
in
H1
.
destruct
(
Encoder_Inj
_
_
_
_
H1
)
as
[
Eqx
Eq
γ
].
subst
x
γ
.
iApply
((
RawProto_Read
N
))
=>
//.
-
apply
ndisj_subseteq_difference
=>
//.
-
iSplitL
"Hyp"
;
first
by
iNext
.
iSplit
=>
//.
iSplit
=>
//.
iSplitL
"oP"
=>
//.
iSplitL
"RA"
=>
//.
iSplitL
"PrInv"
=>
//.
iIntros
(
v
V
'
s
'
)
"(% & % & #kS' & kQ & kRA & PrInv)"
.
iAssert
(
GSP_Frac
l
x
'
s
'
q
V
'
-
★
Φ
(
LitV
(
LitInt
v
),
π
))
with
"[Post kQ]"
as
"Post"
.
{
iIntros
"GPS"
.
iApply
(
"Post"
$
!
v
V
'
s
'
).
iFrame
.
repeat
iSplit
=>
//. }
iApply
"Post"
.
iApply
"HClose"
.
iSplitL
"PrInv Writer"
.
+
iNext
.
iExists
γ'
,
x
'
.
by
iFrame
.
+
iExists
γ'
.
by
iFrame
.
Qed
.
End
Frac
.
End
Frac
.
End
Protocols
.
End
Protocols
.
\ No newline at end of file
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