src/HOL/AxClasses/Tutorial/BoolGroupInsts.thy
author wenzelm
Mon, 22 Jun 1998 17:26:46 +0200
changeset 5069 3ea049f7979d
parent 2907 0e272e4c7cb2
permissions -rw-r--r--
isatool fixgoal;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1247
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
     1
(*  Title:      HOL/AxClasses/Tutorial/BoolGroupInsts.thy
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
     2
    ID:         $Id$
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
     3
    Author:     Markus Wenzel, TU Muenchen
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
     4
2907
0e272e4c7cb2 inv -> inverse
nipkow
parents: 1247
diff changeset
     5
Define overloaded constants "<*>", "inverse", "1" on type "bool"
1247
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
     6
appropriately, then prove that this forms a group.
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
     7
*)
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
     8
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
     9
BoolGroupInsts = Group +
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    10
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    11
(* bool as abelian group *)
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    12
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    13
defs
2907
0e272e4c7cb2 inv -> inverse
nipkow
parents: 1247
diff changeset
    14
  prod_bool_def     "x <*> y   == x ~= (y::bool)"
0e272e4c7cb2 inv -> inverse
nipkow
parents: 1247
diff changeset
    15
  inverse_bool_def  "inverse x == x::bool"
0e272e4c7cb2 inv -> inverse
nipkow
parents: 1247
diff changeset
    16
  unit_bool_def     "1         == False"
1247
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    17
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    18
instance
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    19
  bool :: agroup                {| ALLGOALS (fast_tac HOL_cs) |}
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    20
  (*"instance" automatically uses above defs, 
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    21
    the remaining goals are proven 'inline'*)
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    22
18b1441fb603 Various axiomatic type class demos;
wenzelm
parents:
diff changeset
    23
end