Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
Iris
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Simon Spies
Iris
Commits
0a39a2a6
Commit
0a39a2a6
authored
Jun 18, 2019
by
Ralf Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
factor vals_cas_compare_safe handling into subtactic
parent
475425da
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
18 deletions
+12
-18
theories/heap_lang/proofmode.v
theories/heap_lang/proofmode.v
+12
-18
No files found.
theories/heap_lang/proofmode.v
View file @
0a39a2a6
...
...
@@ -530,6 +530,12 @@ Tactic Notation "wp_store" :=
|
_
=>
fail
"wp_store: not a 'wp'"
end
.
Local
Ltac
solve_vals_cas_compare_safe
:
=
(* The first branch is for when we have [vals_cas_compare_safe] in the context.
The other two branches are for when either one of the branches reduces to
[True] or we have it in the context. *)
fast_done
||
(
left
;
fast_done
)
||
(
right
;
fast_done
).
Tactic
Notation
"wp_cas"
"as"
simple_intropattern
(
H1
)
"|"
simple_intropattern
(
H2
)
:
=
let
solve_mapsto
_
:
=
let
l
:
=
match
goal
with
|-
_
=
Some
(
_
,
(
?l
↦
{
_
}
_
)%
I
)
=>
l
end
in
...
...
@@ -543,9 +549,7 @@ Tactic Notation "wp_cas" "as" simple_intropattern(H1) "|" simple_intropattern(H2
[
iSolveTC
|
solve_mapsto
()
|
pm_reflexivity
|
(* vals_cas_compare_safe. This is a disjunction, so to solve cases like
[True ∨ False] we need to call [left]/[right]. *)
try
(
fast_done
||
(
left
;
fast_done
)
||
(
right
;
fast_done
))
|
try
solve_vals_cas_compare_safe
|
intros
H1
;
wp_finish
|
intros
H2
;
wp_finish
]
|
|-
envs_entails
_
(
twp
?E
?e
?Q
)
=>
...
...
@@ -554,9 +558,7 @@ Tactic Notation "wp_cas" "as" simple_intropattern(H1) "|" simple_intropattern(H2
|
fail
1
"wp_cas: cannot find 'CAS' in"
e
]
;
[
solve_mapsto
()
|
pm_reflexivity
|
(* vals_cas_compare_safe. This is a disjunction, so to solve cases like
[True ∨ False] we need to call [left]/[right]. *)
try
(
fast_done
||
(
left
;
fast_done
)
||
(
right
;
fast_done
))
|
try
solve_vals_cas_compare_safe
|
intros
H1
;
wp_finish
|
intros
H2
;
wp_finish
]
|
_
=>
fail
"wp_cas: not a 'wp'"
...
...
@@ -575,9 +577,7 @@ Tactic Notation "wp_cas_fail" :=
[
iSolveTC
|
solve_mapsto
()
|
try
(
simpl
;
congruence
)
(* value inequality *)
|
(* vals_cas_compare_safe. This is a disjunction, so to solve cases like
[True ∨ False] we need to call [left]/[right]. *)
try
(
fast_done
||
(
left
;
fast_done
)
||
(
right
;
fast_done
))
|
try
solve_vals_cas_compare_safe
|
wp_finish
]
|
|-
envs_entails
_
(
twp
?s
?E
?e
?Q
)
=>
first
...
...
@@ -585,9 +585,7 @@ Tactic Notation "wp_cas_fail" :=
|
fail
1
"wp_cas_fail: cannot find 'CAS' in"
e
]
;
[
solve_mapsto
()
|
try
(
simpl
;
congruence
)
(* value inequality *)
|
(* vals_cas_compare_safe. This is a disjunction, so to solve cases like
[True ∨ False] we need to call [left]/[right]. *)
try
(
fast_done
||
(
left
;
fast_done
)
||
(
right
;
fast_done
))
|
try
solve_vals_cas_compare_safe
|
wp_finish
]
|
_
=>
fail
"wp_cas_fail: not a 'wp'"
end
.
...
...
@@ -606,9 +604,7 @@ Tactic Notation "wp_cas_suc" :=
|
solve_mapsto
()
|
pm_reflexivity
|
try
(
simpl
;
congruence
)
(* value equality *)
|
(* vals_cas_compare_safe. This is a disjunction, so to solve cases like
[True ∨ False] we need to call [left]/[right]. *)
try
(
fast_done
||
(
left
;
fast_done
)
||
(
right
;
fast_done
))
|
try
solve_vals_cas_compare_safe
|
wp_finish
]
|
|-
envs_entails
_
(
twp
?s
?E
?e
?Q
)
=>
first
...
...
@@ -617,9 +613,7 @@ Tactic Notation "wp_cas_suc" :=
[
solve_mapsto
()
|
pm_reflexivity
|
try
(
simpl
;
congruence
)
(* value equality *)
|
(* vals_cas_compare_safe. This is a disjunction, so to solve cases like
[True ∨ False] we need to call [left]/[right]. *)
try
(
fast_done
||
(
left
;
fast_done
)
||
(
right
;
fast_done
))
|
try
solve_vals_cas_compare_safe
|
wp_finish
]
|
_
=>
fail
"wp_cas_suc: not a 'wp'"
end
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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