I am just starting using sets in Isabelle and have I have the following:
theory telephone
imports
Main
begin
typedecl NAME
typedecl TELEPHONE
record TelephoneBook =
KNOWN :: " NAME set"
NUMBER :: "(NAME * TELEPHONE) set"
locale telephone_book =
fixes known :: " NAME set"
and number :: "(NAME * TELEPHONE) set"
assumes "known = Domain number"
begin
definition FindBirthday ::
"TelephoneBook => TelephoneBook => NAME => TELEPHONE => bool"
where
"FindTelephone telephonebook telephonebook' name telephone == (
(name \<in> known)
∧
(telephone = number name)
)"
The problem lies with the line telephone = number name
where i have the error message
Type unification failed: Clash of types " _ => _" and "_ set"
Type error in application: operator not of function type
Operator: number :: (NAME × TELEPHONE) set
Operand: name :: NAME
I've tried added parenthesis (telephone = number (name))
or tilda (telephone = number~name)
but it still has the same problem.
I know that number wants a NAME and TELEPHONE but i want to show that definition is correct when the output telephone
should be the telephone
when name
is its domain.