Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ReLoC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Iris
ReLoC
Commits
d6f4aacc
Commit
d6f4aacc
authored
4 years ago
by
Dan Frumin
Browse files
Options
Downloads
Patches
Plain Diff
add polyeq.v
parent
08e8d55a
No related branches found
No related tags found
No related merge requests found
Pipeline
#32771
passed
4 years ago
Stage: build
Changes
2
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
_CoqProject
+1
-0
1 addition, 0 deletions
_CoqProject
theories/lib/polyeq.v
+54
-0
54 additions, 0 deletions
theories/lib/polyeq.v
with
55 additions
and
0 deletions
_CoqProject
+
1
−
0
View file @
d6f4aacc
...
@@ -43,6 +43,7 @@ theories/lib/counter.v
...
@@ -43,6 +43,7 @@ theories/lib/counter.v
theories/lib/Y.v
theories/lib/Y.v
theories/lib/assert.v
theories/lib/assert.v
theories/lib/list.v
theories/lib/list.v
theories/lib/polyeq.v
theories/examples/bit.v
theories/examples/bit.v
theories/examples/or.v
theories/examples/or.v
...
...
This diff is collapsed.
Click to expand it.
theories/lib/polyeq.v
0 → 100644
+
54
−
0
View file @
d6f4aacc
(* ReLoC -- Relational logic for fine-grained concurrency *)
(** Polymorphic equality check macro. *)
From
reloc
Require
Import
reloc
typing
.
fundamental
.
Fixpoint
polyeq
(
τ
:
type
)
:
val
:=
match
τ
with
|
TUnit
=>
λ
:
"x"
"y"
,
#
true
|
TNat
=>
λ
:
"x"
"y"
,
"x"
=
"y"
|
TBool
=>
λ
:
"x"
"y"
,
"x"
=
"y"
|
TSum
τ1
τ2
=>
λ
:
"x"
"y"
,
match
:
"x"
with
InjL
"x"
=>
match
:
"y"
with
InjL
"y"
=>
(
polyeq
τ1
)
"x"
"y"
|
InjR
<>
=>
#
false
end
|
InjR
"x"
=>
match
:
"y"
with
InjL
<>
=>
#
false
|
InjR
"y"
=>
(
polyeq
τ2
)
"x"
"y"
end
end
|
TProd
τ1
τ2
=>
λ
:
"x"
"y"
,
polyeq
τ1
(
Fst
"x"
)
(
Fst
"y"
)
&&
polyeq
τ2
(
Snd
"x"
)
(
Snd
"y"
)
|
TRef
_
=>
λ
:
"x"
"y"
,
"x"
=
"y"
|
_
=>
λ
:
"x"
"y"
,
#
false
end
.
Section
proof
.
Context
`{
!
relocG
Σ
}
.
Lemma
polyeq_true
τ
v1
v2
:
EqType
τ
→
interp
τ
[]
v1
v2
-∗
REL
polyeq
τ
v1
v2
<<
#
true
:
lrel_bool
.
Proof
.
intros
Hτ
;
revert
v1
v2
.
induction
Hτ
=>
v1
v2
/=.
-
iDestruct
1
as
"[-> ->]"
.
rel_pures_l
.
rel_values
.
-
iDestruct
1
as
(
z
)
"[-> ->]"
.
rel_pures_l
.
rewrite
bool_decide_true
//.
rel_values
.
-
iDestruct
1
as
(
z
)
"[-> ->]"
.
rel_pures_l
.
rewrite
bool_decide_true
//.
rel_values
.
-
iDestruct
1
as
(
w1
w2
u1
u2
->
->
)
"[Hw Hu]"
.
rel_pures_l
.
rewrite
IHHτ1
IHHτ2
.
rel_bind_r
_
.
rel_bind_l
(
polyeq
τ
_
_)
.
iApply
(
refines_bind
with
"Hw"
)
.
iIntros
(
v
v'
)
.
iDestruct
1
as
(
b
)
"[-> ->]"
.
simpl
.
destruct
b
;
rel_pures_l
;
eauto
.
rel_values
.
-
iDestruct
1
as
(
w1
w2
)
"[(->&->&H)|(->&->&H)]"
;
rel_pures_l
.
+
by
iApply
IHHτ1
.
+
by
iApply
IHHτ2
.
Qed
.
End
proof
.
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