Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Simon Spies
Iris
Commits
6d021c73
Commit
6d021c73
authored
Sep 27, 2016
by
Robbert Krebbers
Browse files
Put notations for proofmode environment manipulation into a module.
parent
f774d316
Changes
2
Hide whitespace changes
Inline
Side-by-side
proofmode/coq_tactics.v
View file @
6d021c73
...
...
@@ -3,13 +3,7 @@ From iris.algebra Require Import upred_big_op upred_tactics.
From
iris
.
proofmode
Require
Export
environments
classes
.
From
iris
.
prelude
Require
Import
stringmap
hlist
.
Import
uPred
.
Local
Notation
"Γ !! j"
:
=
(
env_lookup
j
Γ
).
Local
Notation
"x ← y ; z"
:
=
(
match
y
with
Some
x
=>
z
|
None
=>
None
end
).
Local
Notation
"' ( x1 , x2 ) ← y ; z"
:
=
(
match
y
with
Some
(
x1
,
x2
)
=>
z
|
None
=>
None
end
).
Local
Notation
"' ( x1 , x2 , x3 ) ← y ; z"
:
=
(
match
y
with
Some
(
x1
,
x2
,
x3
)
=>
z
|
None
=>
None
end
).
Import
env_notations
.
Record
envs
(
M
:
ucmraT
)
:
=
Envs
{
env_persistent
:
env
(
uPred
M
)
;
env_spatial
:
env
(
uPred
M
)
}.
...
...
proofmode/environments.v
View file @
6d021c73
...
...
@@ -10,18 +10,21 @@ Arguments Esnoc {_} _ _%string _.
Instance
:
Params
(@
Enil
)
1
.
Instance
:
Params
(@
Esnoc
)
1
.
Local
Notation
"x ← y ; z"
:
=
(
match
y
with
Some
x
=>
z
|
None
=>
None
end
).
Local
Notation
"' ( x1 , x2 ) ← y ; z"
:
=
(
match
y
with
Some
(
x1
,
x2
)
=>
z
|
None
=>
None
end
).
Local
Notation
"' ( x1 , x2 , x3 ) ← y ; z"
:
=
(
match
y
with
Some
(
x1
,
x2
,
x3
)
=>
z
|
None
=>
None
end
).
Fixpoint
env_lookup
{
A
}
(
i
:
string
)
(
Γ
:
env
A
)
:
option
A
:
=
match
Γ
with
|
Enil
=>
None
|
Esnoc
Γ
j
x
=>
if
decide
(
i
=
j
)
then
Some
x
else
env_lookup
i
Γ
end
.
Local
Notation
"Γ !! j"
:
=
(
env_lookup
j
Γ
).
Module
env_notations
.
Notation
"x ← y ; z"
:
=
(
match
y
with
Some
x
=>
z
|
None
=>
None
end
).
Notation
"' ( x1 , x2 ) ← y ; z"
:
=
(
match
y
with
Some
(
x1
,
x2
)
=>
z
|
None
=>
None
end
).
Notation
"' ( x1 , x2 , x3 ) ← y ; z"
:
=
(
match
y
with
Some
(
x1
,
x2
,
x3
)
=>
z
|
None
=>
None
end
).
Notation
"Γ !! j"
:
=
(
env_lookup
j
Γ
).
End
env_notations
.
Import
env_notations
.
Inductive
env_wf
{
A
}
:
env
A
→
Prop
:
=
|
Enil_wf
:
env_wf
Enil
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment