src/Tools/more_conv.ML
author wenzelm
Thu, 01 Oct 2009 23:27:05 +0200
changeset 32843 c8f5a7c8353f
parent 32821 99843bbfaeb2
permissions -rw-r--r--
moved cache_conv to src/Pure/conv.ML, use Thm.cterm_cache;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
32843
c8f5a7c8353f moved cache_conv to src/Pure/conv.ML, use Thm.cterm_cache;
wenzelm
parents: 32821
diff changeset
     1
(*  Title:       Tools/more_conv.ML
c8f5a7c8353f moved cache_conv to src/Pure/conv.ML, use Thm.cterm_cache;
wenzelm
parents: 32821
diff changeset
     2
    Author:      Sascha Boehme, TU Muenchen
32402
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
     3
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
     4
Further conversions and conversionals.
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
     5
*)
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
     6
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
     7
signature MORE_CONV =
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
     8
sig
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
     9
  val rewrs_conv: thm list -> conv
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    10
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    11
  val sub_conv: (Proof.context -> conv) -> Proof.context -> conv
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    12
  val bottom_conv: (Proof.context -> conv) -> Proof.context -> conv
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    13
  val top_conv: (Proof.context -> conv) -> Proof.context -> conv
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    14
  val top_sweep_conv: (Proof.context -> conv) -> Proof.context -> conv
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    15
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    16
  val binder_conv: (Proof.context -> conv) -> Proof.context -> conv
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    17
end
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    18
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    19
structure More_Conv : MORE_CONV =
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    20
struct
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    21
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    22
fun rewrs_conv eqs = Conv.first_conv (map Conv.rewr_conv eqs)
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    23
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    24
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    25
fun sub_conv conv ctxt =
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    26
  Conv.comb_conv (conv ctxt) else_conv
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    27
  Conv.abs_conv (fn (_, cx) => conv cx) ctxt else_conv
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    28
  Conv.all_conv
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    29
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    30
fun bottom_conv conv ctxt ct =
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    31
  (sub_conv (bottom_conv conv) ctxt then_conv conv ctxt) ct
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    32
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    33
fun top_conv conv ctxt ct =
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    34
  (conv ctxt then_conv sub_conv (top_conv conv) ctxt) ct
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    35
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    36
fun top_sweep_conv conv ctxt ct =
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    37
  (conv ctxt else_conv sub_conv (top_sweep_conv conv) ctxt) ct
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    38
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    39
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    40
fun binder_conv cv ctxt =
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    41
  Conv.arg_conv (Conv.abs_conv (fn (_, cx) => cv cx) ctxt)
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    42
5731300da417 added further conversions and conversionals
boehmes
parents:
diff changeset
    43
end