[isabelle] polymorphic enough friend



Dear list,

another question on corecursion and friends in Isabelle/HOL development
version 6703434c96d6:
In theory 'Foo' below I am able to show that function "some" which
depends on an inductive set "A" is friendly but when I try to do the
same for function "some'" defined similarly but depending on the
inductive set "C X" instead, I get the error message:

"Eps" not polymorphic enough to be applied like this and no friend

I'm not quite sure why the former works whereas the latter fails.
Maybe someone besides Jasmin is able to answer this one?

theory Foo
imports
  "~~/src/HOL/Library/Stream"
  "~~/src/HOL/Library/BNF_Corec"
begin

inductive_set A :: "'a stream set" where "s â A"

primcorec some :: "'a â 'a stream â 'a stream" where
  "some a s = (let t = SOME v. v â A in SCons a (stl t))"

friend_of_corec some :: "'a â 'a stream â 'a stream" where
  "some a s = (let t = SOME v. v â A in SCons a (stl t))"
by (auto simp add: stream.expand)

inductive_set C :: "'a set â 'a stream set" for X :: "'a set" where
"shd s â X â s â C X"

primcorec some' :: "'a set â 'a â 'a stream â 'a stream" where
  "some' X a s = (let t = SOME v. v â C X in SCons a (stl t))"

friend_of_corec some' :: "'a set â 'a â 'a stream â 'a stream" where
  "some' X a s = (let t = SOME v. v â C X in SCons a (stl t))"

end

Cheers,
Tom




This archive was generated by a fusion of Pipermail (Mailman edition) and MHonArc.