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
Isaac van Bakel
Iris
Commits
492d5a9a
Commit
492d5a9a
authored
1 year ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
remove the super hacky non-CPS version of string_to_ident
parent
ef29659d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
iris/proofmode/string_ident.v
+2
-12
2 additions, 12 deletions
iris/proofmode/string_ident.v
tests/string_ident.v
+2
-2
2 additions, 2 deletions
tests/string_ident.v
with
4 additions
and
14 deletions
iris/proofmode/string_ident.v
+
2
−
12
View file @
492d5a9a
...
@@ -80,15 +80,5 @@ by ident [id] into the name given by string [s]. *)
...
@@ -80,15 +80,5 @@ by ident [id] into the name given by string [s]. *)
Ltac
rename_by_string
id
s
:=
Ltac
rename_by_string
id
s
:=
StringToIdent
.
string_to_ident_cps
s
ltac
:(
fun
x
=>
rename
id
into
x
)
.
StringToIdent
.
string_to_ident_cps
s
ltac
:(
fun
x
=>
rename
id
into
x
)
.
(** We can also use this to write Ltac that *returns* the desired ident.
(* We also directly expose the CPS primitive. *)
However, this function will produce wrong results under [Set Mangle Names], so
Ltac
string_to_ident_cps
:=
StringToIdent
.
string_to_ident_cps
.
use with caution. *)
Ltac
string_to_ident
s
:=
let
s
:=
(
eval
cbv
in
s
)
in
let
x
:=
constr
:(
ltac
:(
clear
;
(* needed since s might already be in scope
where this is called *)
StringToIdent
.
string_to_ident_cps
s
ltac
:(
fun
x
=>
intros
x
);
exact
tt
)
:
unit
->
unit
)
in
match
x
with
|
(
fun
(
name
:_)
=>
_)
=>
name
end
.
This diff is collapsed.
Click to expand it.
tests/string_ident.v
+
2
−
2
View file @
492d5a9a
...
@@ -32,7 +32,7 @@ Lemma test_string_to_ident_not_fresh (n:nat) : ∀ (n:nat), nat.
...
@@ -32,7 +32,7 @@ Lemma test_string_to_ident_not_fresh (n:nat) : ∀ (n:nat), nat.
Proof
.
Proof
.
(* we want to check that this [string_to_ident "n"] call succeeds even with
(* we want to check that this [string_to_ident "n"] call succeeds even with
[n] in the context *)
[n] in the context *)
let
x
:=
string_to_ident
"n"
in
string_to_ident
_cps
"n"
ltac
:(
fun
x
=>
let
x
:=
fresh
x
in
let
x
:=
fresh
x
in
intros
x
.
intros
x
)
.
Abort
.
Abort
.
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