Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
stdpp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
23
Issues
23
List
Boards
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Iris
stdpp
Commits
e61a2997
Commit
e61a2997
authored
Feb 22, 2016
by
Ralf Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hide which exact functors the barrier needs
parent
741bf456
Changes
1
Hide whitespace changes
Inline
Sidebyside
Showing
1 changed file
with
26 additions
and
5 deletions
+26
5
theories/functions.v
theories/functions.v
+26
5
No files found.
theories/functions.v
View file @
e61a2997
...
...
@@ 31,20 +31,41 @@ Section functions.
End
functions
.
(** "Consing" of functions from nat to T *)
(* Coq's standard lists are not universe polymorphic. Hence we have to redefine them. Ouch.
TODO: If we decide to end up going with this, we should move this elsewhere. *)
Polymorphic
Inductive
plist
{
A
:
Type
}
:
Type
:
=

pnil
:
plist

pcons
:
A
→
plist
→
plist
.
Arguments
plist
:
clear
implicits
.
Polymorphic
Fixpoint
papp
{
A
:
Type
}
(
l1
l2
:
plist
A
)
:
plist
A
:
=
match
l1
with

pnil
=>
l2

pcons
a
l
=>
pcons
a
(
papp
l
l2
)
end
.
(* TODO: Notation is totally up for debate. *)
Infix
"`::`"
:
=
pcons
(
at
level
60
,
right
associativity
)
:
C_scope
.
Infix
"`++`"
:
=
papp
(
at
level
60
,
right
associativity
)
:
C_scope
.
Polymorphic
Definition
fn_cons
{
T
:
Type
}
(
t
:
T
)
(
f
:
nat
→
T
)
:
nat
→
T
:
=
λ
n
,
match
n
with

O
=>
t

S
n
=>
f
n
end
.
Polymorphic
Definition
fn_mcons
{
T
:
Type
}
(
ts
:
list
T
)
(
f
:
nat
→
T
)
:
nat
→
T
:
=
fold_right
fn_cons
f
ts
.
Polymorphic
Fixpoint
fn_mcons
{
T
:
Type
}
(
ts
:
plist
T
)
(
f
:
nat
→
T
)
:
nat
→
T
:
=
match
ts
with

pnil
=>
f

pcons
t
ts
=>
fn_cons
t
(
fn_mcons
ts
f
)
end
.
(* TODO: Notation is totally up for debate. *)
Infix
".::"
:
=
fn_cons
(
at
level
60
,
right
associativity
)
:
C_scope
.
Infix
".++"
:
=
fn_mcons
(
at
level
60
,
right
associativity
)
:
C_scope
.
Polymorphic
Lemma
fn_mcons_app
{
T
:
Type
}
(
ts1
ts2
:
list
T
)
f
:
(
ts1
++
ts2
)
.++
f
=
ts1
.++
(
ts2
.++
f
).
Polymorphic
Lemma
fn_mcons_app
{
T
:
Type
}
(
ts1
ts2
:
p
list
T
)
f
:
(
ts1
`
++
`
ts2
)
.++
f
=
ts1
.++
(
ts2
.++
f
).
Proof
.
unfold
fn_mcons
.
rewrite
fold_right_app
.
don
e
.
induction
ts1
;
simpl
;
eauto
.
congruenc
e
.
Qed
.
Write
Preview
Markdown
is supported
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