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
7cfa82f6
Commit
7cfa82f6
authored
4 years ago
by
Tej Chajed
Committed by
Robbert Krebbers
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Set default name for unnamed binders to H
Fixes
#337
.
parent
e989ad6b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/proofmode.ref
+13
-0
13 additions, 0 deletions
tests/proofmode.ref
tests/proofmode.v
+12
-0
12 additions, 0 deletions
tests/proofmode.v
theories/proofmode/ident_name.v
+5
-2
5 additions, 2 deletions
theories/proofmode/ident_name.v
with
30 additions
and
2 deletions
tests/proofmode.ref
+
13
−
0
View file @
7cfa82f6
...
...
@@ -94,6 +94,19 @@ Tactic failure: iExistDestruct: cannot destruct P.
--------------------------------------□
P
"test_iDestruct_exists_anonymous"
: string
1 subgoal
PROP : bi
P : PROP
Φ : nat → PROP
H : nat
============================
"HΦ" : ∃ x : nat, Φ x
--------------------------------------∗
∃ x : nat, Φ x
"test_iIntros_forall_pure"
: string
1 subgoal
...
...
This diff is collapsed.
Click to expand it.
tests/proofmode.v
+
12
−
0
View file @
7cfa82f6
...
...
@@ -184,6 +184,18 @@ Proof.
iExists
y0
;
auto
.
Qed
.
(* regression test for #337 *)
Check
"test_iDestruct_exists_anonymous"
.
Lemma
test_iDestruct_exists_anonymous
P
Φ
:
(
∃
_:
nat
,
P
)
∗
(
∃
x
:
nat
,
Φ
x
)
-∗
P
∗
∃
x
,
Φ
x
.
Proof
.
iIntros
"[HP HΦ]"
.
(* this should not use [x] as the default name for the unnamed binder *)
iDestruct
"HP"
as
(?)
"$"
.
Show
.
iDestruct
"HΦ"
as
(
x
)
"HΦ"
.
by
iExists
x
.
Qed
.
Definition
an_exists
P
:
PROP
:=
(
∃
(
an_exists_name
:
nat
),
▷^
an_exists_name
P
)
%
I
.
(* should use the name from within [an_exists] *)
...
...
This diff is collapsed.
Click to expand it.
theories/proofmode/ident_name.v
+
5
−
2
View file @
7cfa82f6
...
...
@@ -27,8 +27,11 @@ Arguments as_ident_name {A B f} name : assert.
Ltac
solve_as_ident_name
:=
lazymatch
goal
with
|
|
-
AsIdentName
(
λ
x
,
_)
_
=>
let
name
:=
to_ident_name
x
in
(* The [H] here becomes the default name if the binder is anonymous. We use
[H] with the idea that an unnamed and unused binder is likely to be a
proposition. *)
|
|
-
AsIdentName
(
λ
H
,
_)
_
=>
let
name
:=
to_ident_name
H
in
notypeclasses
refine
(
as_ident_name
name
)
|
_
=>
notypeclasses
refine
(
to_ident_name
__
unknown
)
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