1

I have the two following expressions in isabelle:

consts drives ::"(Person × Car) set"

type_synonym drives="(Person × Car) set"

How they are different in terms of their semantics?

I think that type_synonym is just a brief name for the type specified in front of it. right?

But what const is for? (Isabelle tutorial document --page 119-- says: "This is Isabelle’s way of declaring a constant without defining it." But in what sense above expression can be a constant?!!)

Thanks

qartal
  • 2,024
  • 19
  • 31

1 Answers1

2

Indeed, type_synonym is just the a synonym for the type specified, it does not introduce any new type.

consts just states you will define a new constant of the given type, without actually specifying how it is defined. (Note that since in Isabelle/HOL every type is inhabit, nothing has to be proved that such a constant can even exist). Afterwards you can define other functions, definitions, etc. which may already use the newly defined constant (drives in your example, and drives_c in my example below). At some point you can then actually provide the definition of the constant via defs.

type_synonym drives_t = "(int * nat) set"

consts drives_c :: "(int * nat) set"

(* test_drives already used drives_c *)
definition test_drives :: "int => bool" where 
   "test_drives x == (x, 5) : drives_c"

(* here, you actually define drives_c *)
defs drives_c_def: "drives_c == {(3,2), (7,5)}"

However, standard definitions can more directly be performed via definition.

definition drives_c :: drives_t where
  "drives_c == {(3,2), (7,5)}"

Hope this helps, René

René Thiemann
  • 1,251
  • 6
  • 2
  • Thanks for your response and excuse me for the following naive question: when it is written "(x, 5) : drives_c" what does the colon between (x,5) and drives_c indicate? --considering that the drive_c is not a type! – qartal Nov 06 '14 at 20:12
  • 1
    The colon `:` ist just ASCII-syntax for set-membership, so `∈`. – René Thiemann Nov 07 '14 at 06:59
  • 1
    The colon ":" is the ASCII representation of the member operation on sets, and "drives_c" is some set of pairs of integers and natural number. The double colon "::" is used to constrain the type of a value. – Mathieu Nov 07 '14 at 07:04