In Isabelle's NEWS
file, I found
Command 'typedef' now works within a local theory context -- without introducing dependencies on parameters or assumptions, which is not possible in Isabelle/Pure/HOL. Note that the logical environment may contain multiple interpretations of local typedefs (with different non-emptiness proofs), even in a global theory context.
(which dates back to Isabelle2009-2). Is this the latest news with respect to typedef
and local theory contexts? Further, what does the restriction "without introducing dependencies on parameters or assumptions" actually mean?
If it would mean that I cannot use locale parameters in the defining set of a typedef
, then I would not consider typedef
to be localized at all (since the only allowed instances can easily be moved outside the local context, or am I missing something?).
Is it (or should it, or will it ever be) possible to do something along the lines (where the set used for a typedef
depends on the locale parameter V
):
datatype ('a, 'b) "term" = Var 'b | Fun 'a "('a, 'b) term list"
locale term_algebra =
fixes F :: "'a set"
and V :: "'b set"
begin
definition "domain α = {x : V. α x ~= Var x}"
typedef ('a, 'b) subst =
"{α :: 'b => ('a, 'b) term. finite (domain α)}"
end
for which I currently obtain:
Locally fixed type arguments "'a", "'b" in type declaration "subst"