author | nipkow |
Tue, 05 Sep 2000 13:53:39 +0200 | |
changeset 9844 | 8016321c7de1 |
parent 9792 | bbefb6ce5cb2 |
child 11456 | 7eb63f63e6c6 |
permissions | -rw-r--r-- |
nipkow@8745 | 1 |
(*<*) |
nipkow@8745 | 2 |
theory prime_def = Main:; |
nipkow@8745 | 3 |
consts prime :: "nat \\<Rightarrow> bool" |
nipkow@8745 | 4 |
(*>*) |
nipkow@9844 | 5 |
text{* |
nipkow@9844 | 6 |
\begin{warn} |
nipkow@9844 | 7 |
A common mistake when writing definitions is to introduce extra free |
nipkow@9844 | 8 |
variables on the right-hand side as in the following fictitious definition: |
nipkow@9844 | 9 |
@{term[display,quotes]"prime(p) == 1 < p & (m dvd p --> (m=1 | m=p))"} |
nipkow@9792 | 10 |
where @{text"dvd"} means ``divides''. |
nipkow@9792 | 11 |
Isabelle rejects this ``definition'' because of the extra @{term"m"} on the |
nipkow@9458 | 12 |
right-hand side, which would introduce an inconsistency (why?). What you |
nipkow@8745 | 13 |
should have written is |
nipkow@9844 | 14 |
@{term[display,quotes]"prime(p) == 1 < p & (!m. m dvd p --> (m=1 | m=p))"} |
nipkow@9844 | 15 |
\end{warn} |
nipkow@8745 | 16 |
*} |
nipkow@8745 | 17 |
(*<*) |
nipkow@8745 | 18 |
end |
nipkow@8745 | 19 |
(*>*) |