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
9df93b33
Commit
9df93b33
authored
9 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Move global functor construction to its own file and define notations.
And now the part that I forgot to commit.
parent
cac0152f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/functions.v
+0
-41
0 additions, 41 deletions
theories/functions.v
with
0 additions
and
41 deletions
theories/functions.v
+
0
−
41
View file @
9df93b33
...
...
@@ -27,45 +27,4 @@ Section functions.
Lemma
fn_lookup_alter_ne
(
g
:
T
→
T
)
(
f
:
A
→
T
)
a
b
:
a
≠
b
→
alter
g
a
f
b
=
f
b
.
Proof
.
unfold
alter
,
fn_alter
.
by
destruct
(
decide
(
a
=
b
))
.
Qed
.
End
functions
.
(** "Cons-ing" of functions from nat to T *)
(* Coq's standard lists are not universe polymorphic. Hence we have to re-define 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
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
:
plist
T
)
f
:
(
ts1
`++`
ts2
)
.
++
f
=
ts1
.
++
(
ts2
.
++
f
)
.
Proof
.
induction
ts1
;
simpl
;
eauto
.
congruence
.
Qed
.
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