Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
stdpp
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Paolo G. Giarrusso
stdpp
Commits
5754ba71
Verified
Commit
5754ba71
authored
2 years ago
by
Paolo G. Giarrusso
Browse files
Options
Downloads
Patches
Plain Diff
Prevent [finite_countable] from solving unrelated evars
parent
c59b6199
No related branches found
No related tags found
No related merge requests found
Pipeline
#74673
passed
2 years ago
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
stdpp/base.v
+13
-0
13 additions, 0 deletions
stdpp/base.v
stdpp/finite.v
+2
-1
2 additions, 1 deletion
stdpp/finite.v
with
15 additions
and
1 deletion
stdpp/base.v
+
13
−
0
View file @
5754ba71
...
...
@@ -198,6 +198,19 @@ Global Existing Instance TCDiag_diag.
Global
Hint
Mode
TCDiag
!
!
!
-
:
typeclass_instances
.
Global
Hint
Mode
TCDiag
!
!
-
!
:
typeclass_instances
.
(** Perform at most one step of typeclass search, without affecting unrelated goals due to
https://github.com/coq/coq/issues/6583.
Useful for emulating [Hint Immediate] during TC search. Example (from [finite.v]):
<<
Global Hint Extern 1 (Countable _) =>
notypeclasses refine finite_countable; solve_tc_onestep : typeclass_instances.
>>
See docs for Iris's [iSolveTC] for further background.
*)
Ltac
solve_tc_onestep
:=
solve
[
once
(
typeclasses
eauto
1
)]
.
(** Given a proposition [P] that is a type class, [tc_to_bool P] will return
[true] iff there is an instance of [P]. It is often useful in Ltac programming,
where one can do [lazymatch tc_to_bool P with true => .. | false => .. end]. *)
...
...
This diff is collapsed.
Click to expand it.
stdpp/finite.v
+
2
−
1
View file @
5754ba71
...
...
@@ -25,7 +25,8 @@ Next Obligation.
rewrite
Nat2Pos
.
id
by
done
;
simpl
;
rewrite
Hi
;
simpl
.
destruct
(
list_find_Some
(
x
=.
)
xs
i
y
);
naive_solver
.
Qed
.
Global
Hint
Immediate
finite_countable
:
typeclass_instances
.
Global
Hint
Extern
1
(
Countable
_)
=>
notypeclasses
refine
finite_countable
;
solve_tc_onestep
:
typeclass_instances
.
Definition
find
`{
Finite
A
}
(
P
:
A
→
Prop
)
`{
∀
x
,
Decision
(
P
x
)}
:
option
A
:=
list_find
P
(
enum
A
)
≫=
decode_nat
∘
fst
.
...
...
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