doc-src/Exercises/2002/a6/a6.thy
author berghofe
Tue, 01 Jun 2004 15:02:05 +0200
changeset 14861 ca5cae7fb65a
parent 13739 f5d0a66c8124
permissions -rw-r--r--
Removed ~10000 hack in function idx that can lead to inconsistencies when unifying terms with a large number of abstractions.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13739
f5d0a66c8124 exercise collection
kleing
parents:
diff changeset
     1
(*<*)
f5d0a66c8124 exercise collection
kleing
parents:
diff changeset
     2
theory a6 = Main:
f5d0a66c8124 exercise collection
kleing
parents:
diff changeset
     3
(*>*)
f5d0a66c8124 exercise collection
kleing
parents:
diff changeset
     4
subsection {* The towers of Hanoi *}
f5d0a66c8124 exercise collection
kleing
parents:
diff changeset
     5
f5d0a66c8124 exercise collection
kleing
parents:
diff changeset
     6
text{*
f5d0a66c8124 exercise collection
kleing
parents:
diff changeset
     7
In section \ref{psv2000hanoi} we introduced the towers of Hanoi and
f5d0a66c8124 exercise collection
kleing
parents:
diff changeset
     8
defined a function @{term moves} to generate the moves to solve the
f5d0a66c8124 exercise collection
kleing
parents:
diff changeset
     9
puzzle.  Now it is time to show that @{term moves} is correct. This
f5d0a66c8124 exercise collection
kleing
parents:
diff changeset
    10
means that
f5d0a66c8124 exercise collection
kleing
parents:
diff changeset
    11
\begin{itemize}
f5d0a66c8124 exercise collection
kleing
parents:
diff changeset
    12
\item when executing the list of moves, the result is indeed the
f5d0a66c8124 exercise collection
kleing
parents:
diff changeset
    13
intended one, i.e.\ all disks are moved from one peg to another, and
f5d0a66c8124 exercise collection
kleing
parents:
diff changeset
    14
\item all of the moves are legal, i.e.\ never place a larger disk
f5d0a66c8124 exercise collection
kleing
parents:
diff changeset
    15
on top of a smaller one.
f5d0a66c8124 exercise collection
kleing
parents:
diff changeset
    16
\end{itemize}
f5d0a66c8124 exercise collection
kleing
parents:
diff changeset
    17
Hint: this is a nontrivial undertaking. The complexity of your proofs
f5d0a66c8124 exercise collection
kleing
parents:
diff changeset
    18
will depend crucially on your choice of model and you may have to
f5d0a66c8124 exercise collection
kleing
parents:
diff changeset
    19
revise your model as you proceed with the proof.
f5d0a66c8124 exercise collection
kleing
parents:
diff changeset
    20
*}
f5d0a66c8124 exercise collection
kleing
parents:
diff changeset
    21
f5d0a66c8124 exercise collection
kleing
parents:
diff changeset
    22
(*<*)
f5d0a66c8124 exercise collection
kleing
parents:
diff changeset
    23
end
f5d0a66c8124 exercise collection
kleing
parents:
diff changeset
    24
(*>*)