1

In Isabelle is there a way to ensure that a type variable could be an interpretation of a locale?

I know that I can, for example, ensure that a type variable is of a particular class:

isValid :: 'a::ord =>: bool

However, I can't find how to extend this idea to a locale:

class address ....
<snip>
locale Message =
   fixes
     sender   :: "'message => 'address::address" and
     receiver :: "'message => 'address::address" and
     isValid ::  "'message => bool"

locale Filter =
  fixes
    fiterFunc :: "'filter => 'message::Message => filterResult"

The Filter locale gives errors such as Undefined class. Is there a way to write such an expression?

1 Answers1

0

Locale interpretation is described in the tutorial on the locales and in the reference manual. One of my previous answers on SO contains relevant references: link.

From section 3.3.6 in the reference manual: "Sorts have a very simple inner syntax, which is either a single class name c or a list {c1, ..., cn} referring to the intersection of these classes". Therefore, it is not possible to use a locale as part of a sort of a type variable. The locale interpretation mechanism is different.