0

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.

lburski
  • 109
  • 9

1 Answers1

1

It is exactly what Isabelle says, i.e. that you can't use a set as a function, so you can't apply an argument to a set, in your case you can't apply name to number. What you may want is

(name, telephone) : number

or

(name, telephone) ∈ number.

Mathieu
  • 726
  • 3
  • 11