Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Iris
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
Package registry
Model registry
Operate
Terraform modules
Monitor
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
William Mansky
Iris
Commits
66f61d49
Commit
66f61d49
authored
9 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Improve heap_lang notations a bit.
parent
38d2f0d2
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
heap_lang/sugar.v
+8
-6
8 additions, 6 deletions
heap_lang/sugar.v
heap_lang/tests.v
+9
-8
9 additions, 8 deletions
heap_lang/tests.v
with
17 additions
and
14 deletions
heap_lang/sugar.v
+
8
−
6
View file @
66f61d49
...
...
@@ -32,7 +32,7 @@ Module notations.
(* What about Arguments for hoare triples?. *)
(* The colons indicate binders. "let" is not consistent here though,
thing are only bound in the "in". *)
Notation
"# n"
:=
(
Var
n
)
(
at
level
1
,
format
"# n"
)
:
lang_scope
.
Notation
"# n"
:=
(
ids
(
term
:=
expr
)
n
)
(
at
level
1
,
format
"# n"
)
:
lang_scope
.
Notation
"! e"
:=
(
Load
e
%
L
)
(
at
level
10
,
format
"! e"
)
:
lang_scope
.
Notation
"'ref' e"
:=
(
Alloc
e
%
L
)
(
at
level
30
)
:
lang_scope
.
Notation
"e1 + e2"
:=
(
Plus
e1
%
L
e2
%
L
)
...
...
@@ -41,12 +41,14 @@ Module notations.
Notation
"e1 < e2"
:=
(
Lt
e1
%
L
e2
%
L
)
(
at
level
70
)
:
lang_scope
.
(* The unicode ← is already part of the notation "_ ← _; _" for bind. *)
Notation
"e1 <- e2"
:=
(
Store
e1
%
L
e2
%
L
)
(
at
level
80
)
:
lang_scope
.
Notation
"e1 ; e2"
:=
(
Seq
e1
%
L
e2
%
L
)
(
at
level
100
)
:
lang_scope
.
Notation
"'let:' e1 'in' e2"
:=
(
Let
e1
%
L
e2
%
L
)
(
at
level
102
)
:
lang_scope
.
Notation
"'λ:' e"
:=
(
Lam
e
%
L
)
(
at
level
102
)
:
lang_scope
.
Notation
"'rec::' e"
:=
(
Rec
e
%
L
)
(
at
level
102
)
:
lang_scope
.
Notation
"e1 ; e2"
:=
(
Seq
e1
%
L
e2
%
L
)
(
at
level
100
,
e2
at
level
200
)
:
lang_scope
.
Notation
"'let:' e1 'in' e2"
:=
(
Let
e1
%
L
e2
%
L
)
(
at
level
102
,
e2
at
level
200
)
:
lang_scope
.
Notation
"'λ:' e"
:=
(
Lam
e
%
L
)
(
at
level
102
,
e
at
level
200
)
:
lang_scope
.
Notation
"'rec::' e"
:=
(
Rec
e
%
L
)
(
at
level
102
,
e
at
level
200
)
:
lang_scope
.
Notation
"'if' e1 'then' e2 'else' e3"
:=
(
If
e1
%
L
e2
%
L
e3
%
L
)
(
at
level
200
,
e1
,
e2
,
e3
at
level
200
,
only
parsing
)
:
lang_scope
.
(
at
level
200
,
e1
,
e2
,
e3
at
level
200
)
:
lang_scope
.
End
notations
.
Section
suger
.
...
...
This diff is collapsed.
Click to expand it.
heap_lang/tests.v
+
9
−
8
View file @
66f61d49
...
...
@@ -54,16 +54,15 @@ Module LiftingTests.
(* TODO: once asimpl preserves notation, we don't need
FindPred' anymore. *)
(* FIXME: fix notation so that we do not need parenthesis or %L *)
Definition
FindPred'
n1
Sn1
n2
f
:
expr
:=
Definition
FindPred'
(
n1
Sn1
n2
f
:
expr
)
:
expr
:=
if
Sn1
<
n2
then
f
Sn1
else
n1
.
Definition
FindPred
n2
:
expr
:=
rec
::
(
let
:
#
1
+
1
in
FindPred'
#
2
#
0
n2
.[
ren
(
+
3
)]
#
1
)
%
L
.
Definition
FindPred
(
n2
:
expr
)
:
expr
:=
rec
::
let
:
#
1
+
1
in
FindPred'
#
2
#
0
n2
.[
ren
(
+
3
)]
#
1
.
Definition
Pred
:
expr
:=
λ
:
(
if
#
0
≤
0
then
0
else
FindPred
#
0
0
)
%
L
.
λ
:
if
#
0
≤
0
then
0
else
FindPred
#
0
0
.
Lemma
FindPred_spec
n1
n2
E
Q
:
(
■
(
n1
<
n2
)
∧
Q
(
pred
n2
))
⊑
wp
E
(
FindPred
n2
n1
)
Q
.
(
■
(
n1
<
n2
)
∧
Q
(
pred
n2
))
⊑
wp
E
(
FindPred
n2
n1
)
Q
.
Proof
.
revert
n1
.
apply
löb_all_1
=>
n1
.
rewrite
-
wp_rec
//.
asimpl
.
...
...
@@ -71,8 +70,10 @@ Module LiftingTests.
etransitivity
;
first
(
etransitivity
;
last
eapply
equiv_spec
,
later_and
)
.
{
apply
and_mono
;
first
done
.
by
rewrite
-
later_intro
.
}
apply
later_mono
.
(* Go on. *)
rewrite
-
(
wp_let
_
_
(
FindPred'
n1
#
0
n2
(
FindPred
n2
)))
.
(* "rewrite -(wp_let _ _ (FindPred' n1 #0 n2 (FindPred n2)))" started to
fail after we changed # n to use ids instead of Var *)
pose
proof
(
wp_let
(
Σ
:=
Σ
)
E
(
n1
+
1
)
%
L
(
FindPred'
n1
#
0
n2
(
FindPred
n2
))
Q
)
.
unfold
Let
,
Lam
in
H
;
rewrite
-
H
.
rewrite
-
wp_plus
.
asimpl
.
rewrite
-
(
wp_bindi
(
CaseCtx
_
_))
.
rewrite
-!
later_intro
/=.
...
...
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