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
89b1d898
Commit
89b1d898
authored
Nov 11, 2012
by
Adam Chlipala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Batch of changes based on proofreader feedback
parent
a4ec840a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
7 deletions
+13
-7
Coinductive.v
src/Coinductive.v
+3
-5
DataStruct.v
src/DataStruct.v
+2
-2
updates.rss
staging/updates.rss
+8
-0
No files found.
src/Coinductive.v
View file @
89b1d898
...
@@ -617,8 +617,7 @@ Section evalCmd_coind.
...
@@ -617,8 +617,7 @@ Section evalCmd_coind.
cofix
;
intros
;
destruct
c
.
cofix
;
intros
;
destruct
c
.
rewrite
(
AssignCase
H
)
;
constructor
.
rewrite
(
AssignCase
H
)
;
constructor
.
destruct
(
SeqCase
H
)
as
[
?
[
?
?
]]
;
econstructor
;
eauto
.
destruct
(
SeqCase
H
)
as
[
?
[
?
?
]]
;
econstructor
;
eauto
.
destruct
(
WhileCase
H
)
as
[[
?
?
]
|
[
?
[
?
[
?
?
]]]]
;
subst
;
destruct
(
WhileCase
H
)
as
[[
?
?
]
|
[
?
[
?
[
?
?
]]]]
;
subst
;
econstructor
;
eauto
.
[
econstructor
|
econstructor
4
]
;
eauto
.
Qed
.
Qed
.
End
evalCmd_coind
.
End
evalCmd_coind
.
...
@@ -644,13 +643,12 @@ Fixpoint optCmd (c : cmd) : cmd :=
...
@@ -644,13 +643,12 @@ Fixpoint optCmd (c : cmd) : cmd :=
Lemma
optExp_correct
:
forall
vs
e
,
evalExp
vs
(
optExp
e
)
=
evalExp
vs
e
.
Lemma
optExp_correct
:
forall
vs
e
,
evalExp
vs
(
optExp
e
)
=
evalExp
vs
e
.
induction
e
;
crush
;
induction
e
;
crush
;
repeat
(
match
goal
with
repeat
(
match
goal
with
|
[
|-
context
[
match
?
E
with
Const
_
=>
_
|
Var
_
=>
_
|
[
|-
context
[
match
?
E
with
Const
_
=>
_
|
_
=>
_
end
]
]
=>
destruct
E
|
Plus
_
_
=>
_
end
]
]
=>
destruct
E
|
[
|-
context
[
match
?
E
with
O
=>
_
|
S
_
=>
_
end
]
]
=>
destruct
E
|
[
|-
context
[
match
?
E
with
O
=>
_
|
S
_
=>
_
end
]
]
=>
destruct
E
end
;
crush
)
.
end
;
crush
)
.
Qed
.
Qed
.
Hint
Rewrite
optExp_correct
.
Hint
Rewrite
optExp_correct
.
(
**
The
final
theorem
is
easy
to
establish
,
using
our
co
-
induction
principle
and
a
bit
of
Ltac
smarts
that
we
leave
unexplained
for
now
.
Curious
readers
can
consult
the
Coq
manual
,
or
wait
for
the
later
chapters
of
this
book
about
proof
automation
.
At
a
high
level
,
we
show
inclusions
between
behaviors
,
going
in
both
directions
between
original
and
optimized
programs
.
*
)
(
**
The
final
theorem
is
easy
to
establish
,
using
our
co
-
induction
principle
and
a
bit
of
Ltac
smarts
that
we
leave
unexplained
for
now
.
Curious
readers
can
consult
the
Coq
manual
,
or
wait
for
the
later
chapters
of
this
book
about
proof
automation
.
At
a
high
level
,
we
show
inclusions
between
behaviors
,
going
in
both
directions
between
original
and
optimized
programs
.
*
)
...
...
src/DataStruct.v
View file @
89b1d898
...
@@ -74,7 +74,7 @@ Section ilist.
...
@@ -74,7 +74,7 @@ Section ilist.
end
end
end
.
end
.
]]
]]
%
\
vspace
{-
.15
in
}%
Now
the
first
[
match
]
case
type
-
checks
,
and
we
see
that
the
problem
with
the
[
Cons
]
case
is
that
the
pattern
-
bound
variable
[
idx
'
]
does
not
have
an
apparent
type
compatible
with
[
ls
'
]
.
In
fact
,
the
error
message
Coq
gives
for
this
exact
code
can
be
confusing
,
thanks
to
an
overenthusiastic
type
inference
heuristic
.
We
are
told
that
the
[
Nil
]
case
body
has
type
[
match
X
with
|
0
=>
A
|
S
_
=>
unit
end
]
for
a
unification
variable
[
X
]
,
while
it
is
expected
to
have
type
[
A
]
.
We
can
see
that
setting
[
X
]
to
[
0
]
resolves
the
conflict
,
but
Coq
is
not
yet
smart
enough
to
do
this
unification
automatically
.
Repeating
the
function
'
s
type
in
a
[
return
]
annotation
,
used
with
an
[
in
]
annotation
,
leads
us
to
a
more
informative
error
message
,
saying
that
[
idx
'
]
has
type
[
fin
n1
]
while
it
is
expected
to
have
type
[
fin
n0
]
,
where
[
n0
]
is
bound
by
the
[
Cons
]
pattern
and
[
n1
]
by
the
[
Next
]
pattern
.
As
the
code
is
written
above
,
nothing
forces
these
two
natural
numbers
to
be
equal
,
though
we
know
intuitively
that
they
must
be
.
%
\
vspace
{-
.15
in
}%
Now
the
first
[
match
]
case
type
-
checks
,
and
we
see
that
the
problem
with
the
[
Cons
]
case
is
that
the
pattern
-
bound
variable
[
idx
'
]
does
not
have
an
apparent
type
compatible
with
[
ls
'
]
.
In
fact
,
the
error
message
Coq
gives
for
this
exact
code
can
be
confusing
,
thanks
to
an
overenthusiastic
type
inference
heuristic
.
We
are
told
that
the
[
Nil
]
case
body
has
type
[
match
X
with
|
O
=>
A
|
S
_
=>
unit
end
]
for
a
unification
variable
[
X
]
,
while
it
is
expected
to
have
type
[
A
]
.
We
can
see
that
setting
[
X
]
to
[
O
]
resolves
the
conflict
,
but
Coq
is
not
yet
smart
enough
to
do
this
unification
automatically
.
Repeating
the
function
'
s
type
in
a
[
return
]
annotation
,
used
with
an
[
in
]
annotation
,
leads
us
to
a
more
informative
error
message
,
saying
that
[
idx
'
]
has
type
[
fin
n1
]
while
it
is
expected
to
have
type
[
fin
n0
]
,
where
[
n0
]
is
bound
by
the
[
Cons
]
pattern
and
[
n1
]
by
the
[
Next
]
pattern
.
As
the
code
is
written
above
,
nothing
forces
these
two
natural
numbers
to
be
equal
,
though
we
know
intuitively
that
they
must
be
.
We
need
to
use
[
match
]
annotations
to
make
the
relationship
explicit
.
Unfortunately
,
the
usual
trick
of
postponing
argument
binding
will
not
help
us
here
.
We
need
to
match
on
both
[
ls
]
and
[
idx
]
;
one
or
the
other
must
be
matched
first
.
To
get
around
this
,
we
apply
the
convoy
pattern
that
we
met
last
chapter
.
This
application
is
a
little
more
clever
than
those
we
saw
before
;
we
use
the
natural
number
predecessor
function
[
pred
]
to
express
the
relationship
between
the
types
of
these
variables
.
We
need
to
use
[
match
]
annotations
to
make
the
relationship
explicit
.
Unfortunately
,
the
usual
trick
of
postponing
argument
binding
will
not
help
us
here
.
We
need
to
match
on
both
[
ls
]
and
[
idx
]
;
one
or
the
other
must
be
matched
first
.
To
get
around
this
,
we
apply
the
convoy
pattern
that
we
met
last
chapter
.
This
application
is
a
little
more
clever
than
those
we
saw
before
;
we
use
the
natural
number
predecessor
function
[
pred
]
to
express
the
relationship
between
the
types
of
these
variables
.
[[
[[
...
@@ -623,7 +623,7 @@ Qed.
...
@@ -623,7 +623,7 @@ Qed.
Lemma
sum_inc
'
:
forall
n
(
f1
f2
:
ffin
n
->
nat
)
,
Lemma
sum_inc
'
:
forall
n
(
f1
f2
:
ffin
n
->
nat
)
,
(
forall
idx
,
f1
idx
>=
f2
idx
)
(
forall
idx
,
f1
idx
>=
f2
idx
)
->
rifoldr
plus
0
f1
>=
rifoldr
plus
0
f2
.
->
rifoldr
plus
O
f1
>=
rifoldr
plus
O
f2
.
Hint
Resolve
plus_ge
.
Hint
Resolve
plus_ge
.
induction
n
;
crush
.
induction
n
;
crush
.
...
...
staging/updates.rss
View file @
89b1d898
...
@@ -11,6 +11,14 @@
...
@@ -11,6 +11,14 @@
<webMaster>
adam@chlipala.net
</webMaster>
<webMaster>
adam@chlipala.net
</webMaster>
<docs>
http://blogs.law.harvard.edu/tech/rss
</docs>
<docs>
http://blogs.law.harvard.edu/tech/rss
</docs>
<item>
<title>
Batch of changes based on proofreader feedback
</title>
<pubDate>
Sun, 11 Nov 2012 18:16:46 EST
</pubDate>
<link>
http://adam.chlipala.net/cpdt/
</link>
<author>
adamc@csail.mit.edu
</author>
<description>
Thanks to everyone who is helping with the final proofreading!
</description>
</item>
<item>
<item>
<title>
Batch of changes based on proofreader feedback
</title>
<title>
Batch of changes based on proofreader feedback
</title>
<pubDate>
Thu, 25 Oct 2012 08:40:19 EDT
</pubDate>
<pubDate>
Thu, 25 Oct 2012 08:40:19 EDT
</pubDate>
...
...
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