From: Thomas Genet <Thomas.Genet@irisa.fr>
True, it fixes the problem. Thanks a lot.
Thomas
From: Thomas Genet <Thomas.Genet@irisa.fr>
Dear all Isabelle users,
I am playing a bit with Isabelle (MacOSX version, Isabelle2009-2.dmg)
and had the following problem: quickcheck always answers
*** Term to be tested contains type variables
*** At command "quickcheck".
whatever the theorem to be proved. I even tried with the example of the
quickcheck paper:
theory ToyList3
imports Datatype
begin
datatype 'a list= Nil ("[]")
| Cons 'a "'a list" (infix "#" 65)
primrec take::"nat => 'a list => 'a list"
where
"take n [] = []" |
"take n (x # xs) =
(case n of
0 => [] |
Suc m => x # take m xs)"
primrec drop::"nat => 'a list => 'a list"
where
"drop n [] = []"|
"drop n (x # xs) =
(case n of
0 => x # xs |
Suc m => drop m xs)"
theorem "take j (drop i xs) = drop i (take j xs)"
quickcheck
Note that nitpick succeeds to find a counterexample.
What did I do wrong?
Thanks in advance,
Thomas
From: Florian Haftmann <florian.haftmann@informatik.tu-muenchen.de>
Hi Thomas,
The issue is actually located here: in user space, you are always
expected to include the Main theory among you imports (directly or
transitively). The toy list examples in the tutorial are just there to
demonstrate for beginners how lists are done in the system, therefore
they start at a theory which does not contain lists already.
Beneath theory Main there is an intricate bootstrap of various
components which are then plugged together to get the basic tool setup
that the user expects: also quickcheck is not monolithic but can be
thought of as a "microkernel service". The good thing is that as a user
you need not spend much thought on it: start with Main and leave the
issues beneath to developers. An analogy: starting beneath Main is like
using a Unix without init or Upstart.
Hope this helps,
Florian
signature.asc
Last updated: Nov 21 2024 at 12:39 UTC