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
Pierre Roux
Iris
Commits
551085f2
Commit
551085f2
authored
2 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
More tests.
parent
fdfe3d31
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
tests/bi.ref
+6
-0
6 additions, 0 deletions
tests/bi.ref
tests/bi.v
+19
-2
19 additions, 2 deletions
tests/bi.v
with
25 additions
and
2 deletions
tests/bi.ref
+
6
−
0
View file @
551085f2
The command has indeed failed with message:
In environment
PROP : bi
m : gmap nat nat
The term "m" has type "gmap nat nat" while it is expected to have type
"gmap nat Z" (cannot unify "nat" and "Z").
This diff is collapsed.
Click to expand it.
tests/bi.v
+
19
−
2
View file @
551085f2
From
iris
.
bi
Require
Import
bi
plainly
big_op
.
From
iris
.
bi
Require
Import
bi
plainly
big_op
.
Unset
Mangle
Names
.
(** See https://gitlab.mpi-sws.org/iris/iris/-/merge_requests/610 *)
(** See https://gitlab.mpi-sws.org/iris/iris/-/merge_requests/610 *)
Lemma
test_impl_persistent_1
`{
!
BiPlainly
PROP
,
!
BiPersistentlyImplPlainly
PROP
}
:
Lemma
test_impl_persistent_1
`{
!
BiPlainly
PROP
,
!
BiPersistentlyImplPlainly
PROP
}
:
Persistent
(
PROP
:=
PROP
)
(
True
→
True
)
.
Persistent
(
PROP
:=
PROP
)
(
True
→
True
)
.
...
@@ -38,8 +40,23 @@ Definition big_sepM_pattern_both
...
@@ -38,8 +40,23 @@ Definition big_sepM_pattern_both
{
PROP
:
bi
}
(
m
:
gmap
(
nat
*
nat
)
(
nat
*
nat
))
:
PROP
:=
{
PROP
:
bi
}
(
m
:
gmap
(
nat
*
nat
)
(
nat
*
nat
))
:
PROP
:=
[
∗
map
]
'
(
k
,_)
↦
'
(_,
y
)
∈
m
,
⌜
k
=
y
⌝.
[
∗
map
]
'
(
k
,_)
↦
'
(_,
y
)
∈
m
,
⌜
k
=
y
⌝.
Definition
big_sepM2_pattern
{
PROP
:
bi
}
(
m1
m2
:
gmap
nat
(
nat
*
nat
))
:
PROP
:=
[
∗
map
]
'
(
x
,_);
'
(_,
y
)
∈
m1
;
m2
,
⌜
x
=
y
⌝.
(** This fails, Coq will infer [x] to have type [Z] due to the equality, and
then sees a type mismatch with [m : gmap nat nat]. *)
Fail
Definition
big_sepM_implicit_type
{
PROP
:
bi
}
(
m
:
gmap
nat
nat
)
:
PROP
:=
[
∗
map
]
x
∈
m
,
⌜
10
%
Z
=
x
⌝.
(** With a cast, we can force Coq to type check the body with [x : nat] and
thereby insert the [nat] to [Z] coercion in the body. *)
Definition
big_sepM_cast
{
PROP
:
bi
}
(
m
:
gmap
nat
nat
)
:
PROP
:=
Definition
big_sepM_cast
{
PROP
:
bi
}
(
m
:
gmap
nat
nat
)
:
PROP
:=
[
∗
map
]
(
x
:
nat
)
∈
m
,
⌜
10
%
Z
=
x
⌝.
[
∗
map
]
(
x
:
nat
)
∈
m
,
⌜
10
%
Z
=
x
⌝.
Definition
big_sepM2_pattern
{
PROP
:
bi
}
(
m1
m2
:
gmap
nat
(
nat
*
nat
))
:
PROP
:=
Section
big_sepM_implicit_type
.
[
∗
map
]
'
(
x
,_);
'
(_,
y
)
∈
m1
;
m2
,
⌜
x
=
y
⌝.
Implicit
Types
x
:
nat
.
(** And we can do the same with an [Implicit Type]. *)
Definition
big_sepM_implicit_type
{
PROP
:
bi
}
(
m
:
gmap
nat
nat
)
:
PROP
:=
[
∗
map
]
x
∈
m
,
⌜
10
%
Z
=
x
⌝.
End
big_sepM_implicit_type
.
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