Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Janno
iris-coq
Commits
038f8e0e
Commit
038f8e0e
authored
Jan 07, 2017
by
Robbert Krebbers
Browse files
Make instances EqDecision and Countable of gmultiset less eager.
Fix fixes issue #63.
parent
64c3fda3
Changes
1
Hide whitespace changes
Inline
Side-by-side
theories/prelude/gmultiset.v
View file @
038f8e0e
...
...
@@ -7,14 +7,18 @@ Record gmultiset A `{Countable A} := GMultiSet { gmultiset_car : gmap A nat }.
Arguments
GMultiSet
{
_
_
_
}
_
.
Arguments
gmultiset_car
{
_
_
_
}
_
.
Instance
gmultiset_eq_dec
`
{
Countable
A
}
:
EqDecision
(
gmultiset
A
).
Lemma
gmultiset_eq_dec
`
{
Countable
A
}
:
EqDecision
(
gmultiset
A
).
Proof
.
solve_decision
.
Defined
.
Hint
Extern
1
(
Decision
(@
eq
(
gmultiset
_
)
_
_
))
=>
eapply
@
gmultiset_eq_dec
:
typeclass_instances
.
Program
Instance
gmultiset_countable
`
{
Countable
A
}
:
Program
Definition
gmultiset_countable
`
{
Countable
A
}
:
Countable
(
gmultiset
A
)
:
=
{|
encode
X
:
=
encode
(
gmultiset_car
X
)
;
decode
p
:
=
GMultiSet
<$>
decode
p
|}.
Next
Obligation
.
intros
A
??
[
X
]
;
simpl
.
by
rewrite
decode_encode
.
Qed
.
Hint
Extern
1
(
Countable
(
gmultiset
_
))
=>
eapply
@
gmultiset_countable
:
typeclass_instances
.
Section
definitions
.
Context
`
{
Countable
A
}.
...
...
Write
Preview
Supports
Markdown
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