Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iris-coq
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
iris-coq
Commits
fafc06fe
Commit
fafc06fe
authored
6 years ago
by
Dan Frumin
Browse files
Options
Downloads
Patches
Plain Diff
Lemmas about subst_map on closed expressions
parent
fe1efece
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/heap_lang/metatheory.v
+20
-0
20 additions, 0 deletions
theories/heap_lang/metatheory.v
with
20 additions
and
0 deletions
theories/heap_lang/metatheory.v
+
20
−
0
View file @
fafc06fe
...
...
@@ -111,6 +111,9 @@ Definition binder_insert {A} (x : binder) (v : A) (vs : gmap string A) : gmap st
Lemma
binder_insert_fmap
{
A
B
:
Type
}
(
f
:
A
→
B
)
(
x
:
A
)
b
vs
:
f
<$>
binder_insert
b
x
vs
=
binder_insert
b
(
f
x
)
(
f
<$>
vs
)
.
Proof
.
destruct
b
;
rewrite
?fmap_insert
//.
Qed
.
Lemma
lookup_binder_delete_None
{
A
:
Type
}
(
vs
:
gmap
string
A
)
x
y
:
binder_delete
x
vs
!!
y
=
None
↔
x
=
BNamed
y
∨
vs
!!
y
=
None
.
Proof
.
destruct
x
;
rewrite
/=
?lookup_delete_None
;
naive_solver
.
Qed
.
Fixpoint
subst_map
(
vs
:
gmap
string
val
)
(
e
:
expr
)
:
expr
:=
match
e
with
...
...
@@ -166,3 +169,20 @@ Lemma subst_map_binder_insert b v vs e :
subst_map
(
binder_insert
b
v
vs
)
e
=
subst'
b
v
(
subst_map
(
binder_delete
b
vs
)
e
)
.
Proof
.
destruct
b
;
rewrite
?subst_map_insert
//.
Qed
.
(* subst_map on closed expressions *)
Lemma
subst_map_is_closed
X
e
vs
:
is_closed_expr
X
e
→
(
∀
x
,
x
∈
X
→
vs
!!
x
=
None
)
→
subst_map
vs
e
=
e
.
Proof
.
revert
X
vs
.
assert
(
∀
x
x1
x2
X
(
vs
:
gmap
string
val
),
(
∀
x
,
x
∈
X
→
vs
!!
x
=
None
)
→
x
∈
x2
:
b
:
x1
:
b
:
X
→
binder_delete
x1
(
binder_delete
x2
vs
)
!!
x
=
None
)
.
{
intros
x
x1
x2
X
vs
??
.
rewrite
!
lookup_binder_delete_None
.
set_solver
.
}
induction
e
=>
X
vs
/=
?
HX
;
repeat
case_match
;
naive_solver
eauto
with
f_equal
.
Qed
.
Lemma
subst_map_is_closed_nil
e
vs
:
is_closed_expr
[]
e
→
subst_map
vs
e
=
e
.
Proof
.
intros
.
apply
subst_map_is_closed
with
[];
set_solver
.
Qed
.
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