src/HOL/Tools/Lifting/lifting_util.ML
author wenzelm
Sun, 20 May 2012 11:34:33 +0200
changeset 47884 21c42b095c84
parent 47777 f29e7dcd7c40
child 47951 8c8a03765de7
permissions -rw-r--r--
try to avoid races again (cf. 8c37cb84065f and fd3a36e48b09);
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
47698
18202d3d5832 move MRSL to a separate file
kuncar
parents:
diff changeset
     1
(*  Title:      HOL/Tools/Lifting/lifting_util.ML
18202d3d5832 move MRSL to a separate file
kuncar
parents:
diff changeset
     2
    Author:     Ondrej Kuncar
18202d3d5832 move MRSL to a separate file
kuncar
parents:
diff changeset
     3
18202d3d5832 move MRSL to a separate file
kuncar
parents:
diff changeset
     4
General-purpose functions used by the Lifting package.
18202d3d5832 move MRSL to a separate file
kuncar
parents:
diff changeset
     5
*)
18202d3d5832 move MRSL to a separate file
kuncar
parents:
diff changeset
     6
18202d3d5832 move MRSL to a separate file
kuncar
parents:
diff changeset
     7
signature LIFTING_UTIL =
18202d3d5832 move MRSL to a separate file
kuncar
parents:
diff changeset
     8
sig
18202d3d5832 move MRSL to a separate file
kuncar
parents:
diff changeset
     9
  val MRSL: thm list * thm -> thm
47699
bb6b147c6531 added useful Trueprop_conv
kuncar
parents: 47698
diff changeset
    10
  val Trueprop_conv: conv -> conv
47777
f29e7dcd7c40 use a quot_map theorem attribute instead of the complicated map attribute
kuncar
parents: 47699
diff changeset
    11
  val dest_Quotient: term -> term * term * term * term
47698
18202d3d5832 move MRSL to a separate file
kuncar
parents:
diff changeset
    12
end;
18202d3d5832 move MRSL to a separate file
kuncar
parents:
diff changeset
    13
18202d3d5832 move MRSL to a separate file
kuncar
parents:
diff changeset
    14
18202d3d5832 move MRSL to a separate file
kuncar
parents:
diff changeset
    15
structure Lifting_Util: LIFTING_UTIL =
18202d3d5832 move MRSL to a separate file
kuncar
parents:
diff changeset
    16
struct
18202d3d5832 move MRSL to a separate file
kuncar
parents:
diff changeset
    17
18202d3d5832 move MRSL to a separate file
kuncar
parents:
diff changeset
    18
infix 0 MRSL
18202d3d5832 move MRSL to a separate file
kuncar
parents:
diff changeset
    19
18202d3d5832 move MRSL to a separate file
kuncar
parents:
diff changeset
    20
fun ants MRSL thm = fold (fn rl => fn thm => rl RS thm) ants thm
18202d3d5832 move MRSL to a separate file
kuncar
parents:
diff changeset
    21
47699
bb6b147c6531 added useful Trueprop_conv
kuncar
parents: 47698
diff changeset
    22
fun Trueprop_conv cv ct =
bb6b147c6531 added useful Trueprop_conv
kuncar
parents: 47698
diff changeset
    23
  (case Thm.term_of ct of
bb6b147c6531 added useful Trueprop_conv
kuncar
parents: 47698
diff changeset
    24
    Const (@{const_name Trueprop}, _) $ _ => Conv.arg_conv cv ct
bb6b147c6531 added useful Trueprop_conv
kuncar
parents: 47698
diff changeset
    25
  | _ => raise CTERM ("Trueprop_conv", [ct]))
bb6b147c6531 added useful Trueprop_conv
kuncar
parents: 47698
diff changeset
    26
47777
f29e7dcd7c40 use a quot_map theorem attribute instead of the complicated map attribute
kuncar
parents: 47699
diff changeset
    27
fun dest_Quotient (Const (@{const_name Quotient}, _) $ rel $ abs $ rep $ cr)
f29e7dcd7c40 use a quot_map theorem attribute instead of the complicated map attribute
kuncar
parents: 47699
diff changeset
    28
      = (rel, abs, rep, cr)
f29e7dcd7c40 use a quot_map theorem attribute instead of the complicated map attribute
kuncar
parents: 47699
diff changeset
    29
  | dest_Quotient t = raise TERM ("dest_Quotient", [t])
f29e7dcd7c40 use a quot_map theorem attribute instead of the complicated map attribute
kuncar
parents: 47699
diff changeset
    30
47698
18202d3d5832 move MRSL to a separate file
kuncar
parents:
diff changeset
    31
end;