Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
stdpp
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
Model registry
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
Iris
stdpp
Commits
c2b564ab
Commit
c2b564ab
authored
3 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
add some test cases by Robbert
parent
84a6c156
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!326
f_equiv: slightly better support for function relations
Pipeline
#54138
passed
3 years ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/proper.v
+35
-0
35 additions, 0 deletions
tests/proper.v
with
35 additions
and
0 deletions
tests/proper.v
+
35
−
0
View file @
c2b564ab
...
@@ -42,6 +42,41 @@ Global Instance from_option_proper_test2 `{Equiv A} {B} (R : relation B) (f : A
...
@@ -42,6 +42,41 @@ Global Instance from_option_proper_test2 `{Equiv A} {B} (R : relation B) (f : A
Proper
((
≡
)
==>
R
)
f
→
Proper
(
R
==>
(
≡
)
==>
R
)
(
from_option
f
)
.
Proper
((
≡
)
==>
R
)
f
→
Proper
(
R
==>
(
≡
)
==>
R
)
(
from_option
f
)
.
Proof
.
solve_proper
.
Qed
.
Proof
.
solve_proper
.
Qed
.
(** The following tests are inspired by Iris's [ofe] structure (here, simplified
to just a type an arbitrary relation), and the discrete function space [A -d> B]
on a Type [A] and OFE [B]. The tests occur when proving [Proper]s for
higher-order functions, which typically occurs while defining functions using
Iris's [fixpoint] operator. *)
Record
setoid
:=
Setoid
{
setoid_car
:>
Type
;
setoid_equiv
:
relation
setoid_car
}
.
Arguments
setoid_equiv
{_}
_
_
.
Definition
myfun
(
A
:
Type
)
(
B
:
setoid
)
:=
A
→
B
.
Definition
myfun_equiv
{
A
B
}
:
relation
(
myfun
A
B
)
:=
pointwise_relation
_
setoid_equiv
.
Definition
myfunS
(
A
:
Type
)
(
B
:
setoid
)
:=
Setoid
(
myfun
A
B
)
myfun_equiv
.
Section
setoid_tests
.
Context
{
A
:
setoid
}
(
f
:
A
→
A
)
(
h
:
A
→
A
→
A
)
.
Context
`{
!
Proper
(
setoid_equiv
==>
setoid_equiv
)
f
,
!
Proper
(
setoid_equiv
==>
setoid_equiv
==>
setoid_equiv
)
h
}
.
Definition
setoid_test1
(
rec
:
myfunS
nat
A
)
:
myfunS
nat
A
:=
λ
n
,
h
(
f
(
rec
n
))
(
rec
n
)
.
Goal
Proper
(
setoid_equiv
==>
setoid_equiv
)
setoid_test1
.
Proof
.
solve_proper
.
Qed
.
Definition
setoid_test2
(
rec
:
myfunS
nat
(
myfunS
nat
A
))
:
myfunS
nat
A
:=
λ
n
,
h
(
f
(
rec
n
n
))
(
rec
n
n
)
.
Goal
Proper
(
setoid_equiv
==>
setoid_equiv
)
setoid_test2
.
Proof
.
solve_proper
.
Qed
.
Definition
setoid_test3
(
rec
:
myfunS
nat
A
)
:
myfunS
nat
(
myfunS
nat
A
)
:=
λ
n
m
,
h
(
f
(
rec
n
))
(
rec
m
)
.
Goal
Proper
(
setoid_equiv
==>
setoid_equiv
)
setoid_test3
.
Proof
.
solve_proper
.
Qed
.
End
setoid_tests
.
Section
map_tests
.
Section
map_tests
.
Context
`{
FinMap
K
M
}
`{
Equiv
A
}
.
Context
`{
FinMap
K
M
}
`{
Equiv
A
}
.
...
...
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