Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
cpdt
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
research
cpdt
Commits
00cba52d
Commit
00cba52d
authored
Nov 28, 2008
by
Adam Chlipala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start of Generic
parent
7422c99a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
80 additions
and
1 deletion
+80
-1
Makefile
Makefile
+1
-1
Generic.v
src/Generic.v
+76
-0
Intro.v
src/Intro.v
+2
-0
toc.html
src/toc.html
+1
-0
No files found.
Makefile
View file @
00cba52d
...
...
@@ -2,7 +2,7 @@ MODULES_NODOC := Axioms AxiomsImpred Tactics MoreSpecif DepList
MODULES_PROSE
:=
Intro
MODULES_CODE
:=
StackMachine InductiveTypes Predicates Coinductive Subset
\
MoreDep DataStruct Equality Match Reflection Firstorder Hoas Interps
\
Extensional Intensional Impure
Extensional Intensional Impure
Generic
MODULES_DOC
:=
$(MODULES_PROSE)
$(MODULES_CODE)
MODULES
:=
$(MODULES_NODOC)
$(MODULES_DOC)
VS
:=
$
(
MODULES:%
=
src/%.v
)
...
...
src/Generic.v
0 → 100644
View file @
00cba52d
(
*
Copyright
(
c
)
2008
,
Adam
Chlipala
*
*
This
work
is
licensed
under
a
*
Creative
Commons
Attribution
-
Noncommercial
-
No
Derivative
Works
3.0
*
Unported
License
.
*
The
license
text
is
available
at
:
*
http
:
//creativecommons.org/licenses/by-nc-nd/3.0/
*
)
(
*
begin
hide
*
)
Require
Import
List
.
Require
Import
Tactics
DepList
.
Set
Implicit
Arguments
.
(
*
end
hide
*
)
(
**
%
\
part
{
Chapters
to
be
Moved
Earlier
}
\
chapter
{
Generic
Programming
}%
*
)
(
**
TODO
:
Prose
for
this
chapter
*
)
(
**
*
Simple
Algebraic
Datatypes
*
)
Record
constructor
:
Type
:=
Con
{
nonrecursive
:
Type
;
recursive
:
nat
}.
Definition
datatype
:=
list
constructor
.
Definition
Empty_set_dt
:
datatype
:=
nil
.
Definition
unit_dt
:
datatype
:=
Con
unit
0
::
nil
.
Definition
bool_dt
:
datatype
:=
Con
unit
0
::
Con
unit
0
::
nil
.
Definition
nat_dt
:
datatype
:=
Con
unit
0
::
Con
unit
1
::
nil
.
Definition
list_dt
(
A
:
Type
)
:
datatype
:=
Con
unit
0
::
Con
A
1
::
nil
.
Section
tree
.
Variable
A
:
Type
.
Inductive
tree
:
Type
:=
|
Leaf
:
A
->
tree
|
Node
:
tree
->
tree
->
tree
.
End
tree
.
Definition
tree_dt
(
A
:
Type
)
:
datatype
:=
Con
A
0
::
Con
unit
2
::
nil
.
Section
denote
.
Variable
T
:
Type
.
Definition
constructorDenote
(
c
:
constructor
)
:=
nonrecursive
c
->
ilist
T
(
recursive
c
)
->
T
.
Definition
datatypeDenote
:=
hlist
constructorDenote
.
End
denote
.
Notation
"[ ! , ! ~> x ]"
:=
((
fun
_
_
=>
x
)
:
constructorDenote
_
(
Con
_
_
))
.
Notation
"[ v , ! ~> x ]"
:=
((
fun
v
_
=>
x
)
:
constructorDenote
_
(
Con
_
_
))
.
Notation
"[ ! , r # n ~> x ]"
:=
((
fun
_
r
=>
x
)
:
constructorDenote
_
(
Con
_
n
))
.
Notation
"[ v , r # n ~> x ]"
:=
((
fun
v
r
=>
x
)
:
constructorDenote
_
(
Con
_
n
))
.
Definition
Empty_set_den
:
datatypeDenote
Empty_set
Empty_set_dt
:=
hnil
.
Definition
unit_den
:
datatypeDenote
unit
unit_dt
:=
[
!,
!
~>
tt
]
:::
hnil
.
Definition
bool_den
:
datatypeDenote
bool
bool_dt
:=
[
!,
!
~>
true
]
:::
[
!,
!
~>
false
]
:::
hnil
.
Definition
nat_den
:
datatypeDenote
nat
nat_dt
:=
[
!,
!
~>
O
]
:::
[
!,
r
#
1
~>
S
(
hd
r
)]
:::
hnil
.
Definition
list_den
(
A
:
Type
)
:
datatypeDenote
(
list
A
)
(
list_dt
A
)
:=
[
!,
!
~>
nil
]
:::
[
x
,
r
#
1
~>
x
::
hd
r
]
:::
hnil
.
Definition
tree_den
(
A
:
Type
)
:
datatypeDenote
(
tree
A
)
(
tree_dt
A
)
:=
[
v
,
!
~>
Leaf
v
]
:::
[
!,
r
#
2
~>
Node
(
hd
r
)
(
hd
(
tl
r
))]
:::
hnil
.
src/Intro.v
View file @
00cba52d
...
...
@@ -215,6 +215,8 @@ Intensional Transformations & \texttt{Intensional.v} \\
\
hline
Modeling
Impure
Languages
&
\
texttt
{
Impure
.
v
}
\
\
\
hline
Generic
Programming
&
\
texttt
{
Generic
.
v
}
\
\
\
hline
\
end
{
tabular
}
\
end
{
center
}
%
*
)
src/toc.html
View file @
00cba52d
...
...
@@ -21,5 +21,6 @@
<li><a
href=
"Extensional.html"
>
Extensional Transformations
</a>
<li><a
href=
"Intensional.html"
>
Intensional Transformations
</a>
<li><a
href=
"Impure.html"
>
Modeling Impure Languages
</a>
<li><a
href=
"Generic.html"
>
Generic Programming
</a>
</body></html>
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