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
e436e174
Commit
e436e174
authored
Sep 27, 2008
by
Adam Chlipala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[tauto] and [intuition]
parent
537fdfa9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
1 deletion
+71
-1
Predicates.v
src/Predicates.v
+71
-1
No files found.
src/Predicates.v
View file @
e436e174
...
...
@@ -46,7 +46,7 @@ With that perspective in mind, this chapter is sort of a mirror image of the las
(
**
Let
us
begin
with
a
brief
tour
through
the
definitions
of
the
connectives
for
propositional
logic
.
We
will
work
within
a
Coq
section
that
provides
us
with
a
set
of
propositional
variables
.
In
Coq
parlance
,
these
are
just
terms
of
type
[
Prop
.
]
*
)
Section
Propositional
.
Variables
P
Q
:
Prop
.
Variables
P
Q
R
:
Prop
.
(
**
In
Coq
,
the
most
basic
propositional
connective
is
implication
,
written
[
->
]
,
which
we
have
already
used
in
almost
every
proof
.
Rather
than
being
defined
inductively
,
implication
is
built
into
Coq
as
the
function
type
constructor
.
...
...
@@ -206,5 +206,75 @@ subgoal 2 is:
left
;
assumption
.
Qed
.
(
*
begin
hide
*
)
(
*
In
-
class
exercises
*
)
Theorem
contra
:
P
->
~
P
->
R
.
Admitted
.
Theorem
and_assoc
:
(
P
/
\
Q
)
/
\
R
->
P
/
\
(
Q
/
\
R
)
.
Admitted
.
Theorem
or_assoc
:
(
P
\
/
Q
)
\
/
R
->
P
\
/
(
Q
\
/
R
)
.
Admitted
.
(
*
end
hide
*
)
(
**
It
would
be
a
shame
to
have
to
plod
manually
through
all
proofs
about
propositional
logic
.
Luckily
,
there
is
no
need
.
One
of
the
most
basic
Coq
automation
tactics
is
[
tauto
]
,
which
is
a
complete
decision
procedure
for
constructive
propositional
logic
.
(
More
on
what
"constructive"
means
in
the
next
section
.
)
We
can
use
[
tauto
]
to
dispatch
all
of
the
purely
propositional
theorems
we
have
proved
so
far
.
*
)
Theorem
or_comm
'
:
P
\
/
Q
->
Q
\
/
P
.
tauto
.
Qed
.
(
**
Sometimes
propositional
reasoning
forms
important
plumbing
for
the
proof
of
a
theorem
,
but
we
still
need
to
apply
some
other
smarts
about
,
say
,
arithmetic
.
[
intuition
]
is
a
generalization
of
[
tauto
]
that
proves
everything
it
can
using
propositional
reasoning
.
When
some
goals
remain
,
it
uses
propositional
laws
to
simplify
them
as
far
as
possible
.
Consider
this
example
,
which
uses
the
list
concatenation
operator
[
++
]
from
the
standard
library
.
*
)
Theorem
arith_comm
:
forall
ls1
ls2
:
list
nat
,
length
ls1
=
length
ls2
\
/
length
ls1
+
length
ls2
=
6
->
length
(
ls1
++
ls2
)
=
6
\
/
length
ls1
=
length
ls2
.
intuition
.
(
**
A
lot
of
the
proof
structure
has
been
generated
for
us
by
[
intuition
]
,
but
the
final
proof
depends
on
a
fact
about
lists
.
The
remaining
subgoal
hints
at
what
cleverness
we
need
to
inject
.
*
)
(
**
[[
ls1
:
list
nat
ls2
:
list
nat
H0
:
length
ls1
+
length
ls2
=
6
============================
length
(
ls1
++
ls2
)
=
6
\
/
length
ls1
=
length
ls2
]]
*
)
(
**
We
can
see
that
we
need
a
theorem
about
lengths
of
concatenated
lists
,
which
we
proved
last
chapter
and
is
also
in
the
standard
library
.
*
)
rewrite
app_length
.
(
**
[[
ls1
:
list
nat
ls2
:
list
nat
H0
:
length
ls1
+
length
ls2
=
6
============================
length
ls1
+
length
ls2
=
6
\
/
length
ls1
=
length
ls2
]]
*
)
(
**
Now
the
subgoal
follows
by
purely
propositional
reasoning
.
That
is
,
we
could
replace
[
length
ls1
+
length
ls2
=
6
]
with
[
P
]
and
[
length
ls1
=
length
ls2
]
with
[
Q
]
and
arrive
at
a
tautology
of
propositional
logic
.
*
)
tauto
.
Qed
.
(
**
[
intuition
]
is
one
of
the
main
bits
of
glue
in
the
implementation
of
[
crush
]
,
so
,
with
a
little
help
,
we
can
get
a
short
automated
proof
of
the
theorem
.
*
)
Theorem
arith_comm
'
:
forall
ls1
ls2
:
list
nat
,
length
ls1
=
length
ls2
\
/
length
ls1
+
length
ls2
=
6
->
length
(
ls1
++
ls2
)
=
6
\
/
length
ls1
=
length
ls2
.
Hint
Rewrite
app_length
:
cpdt
.
crush
.
Qed
.
End
Propositional
.
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