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
Simcha van Collem
Iris
Commits
6a04e745
Commit
6a04e745
authored
8 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Simplify wp_unlock and rename into solve_of_val_unlock.
parent
4b2916c4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
heap_lang/wp_tactics.v
+8
-14
8 additions, 14 deletions
heap_lang/wp_tactics.v
with
8 additions
and
14 deletions
heap_lang/wp_tactics.v
+
8
−
14
View file @
6a04e745
...
...
@@ -44,20 +44,12 @@ Tactic Notation "wp_value" :=
|
_
=>
fail
"wp_value: not a wp"
end
.
Lemma
of_val_unlock
v
e
:
of_val
v
=
e
→
of_val
(
locked
v
)
=
e
.
Proof
.
by
unlock
.
Qed
.
(* Applied to goals that are equalities of expressions. Will try to unlock the
LHS once if necessary, to get rid of the lock added by the syntactic sugar. *)
Ltac
wp_unlock
:=
solve
[
reflexivity
|
(* If there are no locks, this is enough. *)
(* Otherwise, use unification to uncover the lock. *)
(* Step 1: Get the LHS into the form "of_val (locked v)" *)
let
v
:=
fresh
"v"
in
evar
(
v
:
val
);
trans
(
of_val
(
locked
v
));
subst
v
;
first
reflexivity
;
(* Step 2: Remove the lock from the LHS. *)
etrans
;
first
solve
[
apply
(
f_equal
of_val
);
symmetry
;
apply
lock
];
(* Now things should be convertible. *)
reflexivity
]
.
Ltac
solve_of_val_unlock
:=
try
apply
of_val_unlock
;
reflexivity
.
Tactic
Notation
"wp_rec"
:=
lazymatch
goal
with
...
...
@@ -65,7 +57,8 @@ Tactic Notation "wp_rec" :=
match
eval
hnf
in
e'
with
App
?e1
_
=>
(* hnf does not reduce through an of_val *)
(* match eval hnf in e1 with Rec _ _ _ => *)
wp_bind_core
K
;
etrans
;
[|
eapply
wp_rec
;
[
wp_unlock
|
wp_done
..]];
simpl_subst
;
wp_finish
wp_bind_core
K
;
etrans
;
[|
eapply
wp_rec
;
[
solve_of_val_unlock
|
wp_done
..]];
simpl_subst
;
wp_finish
(* end *)
end
)
||
fail
"wp_rec: cannot find 'Rec' in"
e
|
_
=>
fail
"wp_rec: not a 'wp'"
end
.
...
...
@@ -75,7 +68,8 @@ Tactic Notation "wp_lam" :=
|
|
-
_
⊢
wp
?E
?e
?Q
=>
reshape_expr
e
ltac
:(
fun
K
e'
=>
match
eval
hnf
in
e'
with
App
?e1
_
=>
(* match eval hnf in e1 with Rec BAnon _ _ => *)
wp_bind_core
K
;
etrans
;
[|
eapply
wp_lam
;
[
wp_unlock
|
wp_done
..]];
simpl_subst
;
wp_finish
wp_bind_core
K
;
etrans
;
[|
eapply
wp_lam
;
[
solve_of_val_unlock
|
wp_done
..]];
simpl_subst
;
wp_finish
(* end *)
end
)
||
fail
"wp_lam: cannot find 'Lam' in"
e
|
_
=>
fail
"wp_lam: not a 'wp'"
end
.
...
...
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