progtut/Essential.thy
author Xingyuan Zhang <xingyuanzhang@126.com>
Sat, 13 Sep 2014 10:07:14 +0800
changeset 25 a5f5b9336007
permissions -rw-r--r--
thys2 added
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
     1
theory Essential
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
     2
imports FirstStep
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
     3
begin
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
     4
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
     5
ML {*
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
     6
fun pretty_helper aux env =
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
     7
  env |> Vartab.dest
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
     8
      |> map aux
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
     9
      |> map (fn (s1, s2) => Pretty.block [s1, Pretty.str " := ", s2])
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    10
      |> Pretty.enum "," "[" "]"
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    11
      |> pwriteln
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    12
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    13
fun pretty_tyenv ctxt tyenv =
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    14
let
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    15
  fun get_typs (v, (s, T)) = (TVar (v, s), T)
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    16
  val print = pairself (pretty_typ ctxt)
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    17
in
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    18
  pretty_helper (print o get_typs) tyenv
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    19
end
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    20
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    21
fun pretty_env ctxt env =
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    22
let
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    23
   fun get_trms (v, (T, t)) = (Var (v, T), t)
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    24
   val print = pairself (pretty_term ctxt)
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    25
in
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    26
   pretty_helper (print o get_trms) env
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    27
end
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    28
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    29
fun prep_trm thy (x, (T, t)) =
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    30
  (cterm_of thy (Var (x, T)), cterm_of thy t)
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    31
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    32
fun prep_ty thy (x, (S, ty)) =
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    33
  (ctyp_of thy (TVar (x, S)), ctyp_of thy ty)
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    34
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    35
fun matcher_inst thy pat trm i =
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    36
  let
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    37
     val univ = Unify.matchers thy [(pat, trm)]
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    38
     val env = nth (Seq.list_of univ) i
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    39
     val tenv = Vartab.dest (Envir.term_env env)
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    40
     val tyenv = Vartab.dest (Envir.type_env env)
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    41
  in
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    42
     (map (prep_ty thy) tyenv, map (prep_trm thy) tenv)
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    43
  end
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    44
*}
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    45
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    46
ML {*
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    47
  let
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    48
     val pat = Logic.strip_imp_concl (prop_of @{thm spec})
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    49
     val trm = @{term "Trueprop (Q True)"}
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    50
     val inst = matcher_inst @{theory} pat trm 1
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    51
  in
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    52
     Drule.instantiate_normalize inst @{thm spec}
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    53
  end
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    54
*}
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    55
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    56
ML {*
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    57
let
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    58
   val c = Const (@{const_name "plus"}, dummyT)
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    59
   val o = @{term "1::nat"}
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    60
   val v = Free ("x", dummyT)
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    61
in
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    62
   Syntax.check_term @{context} (c $ o $ v)
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    63
end
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    64
*}
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    65
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    66
ML {*
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    67
   val my_thm =
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    68
   let
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    69
      val assm1 = @{cprop "\<And> (x::nat). P x ==> Q x"}
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    70
      val assm2 = @{cprop "(P::nat => bool) t"}
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    71
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    72
      val Pt_implies_Qt =
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    73
        Thm.assume assm1
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    74
        |> tap (fn x => pwriteln (Pretty.str (@{make_string} x)))
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    75
        |> Thm.forall_elim @{cterm "t::nat"}
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    76
        |> tap (fn x => pwriteln (Pretty.str (@{make_string} x)))
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    77
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    78
      val Qt = Thm.implies_elim Pt_implies_Qt (Thm.assume assm2)
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    79
               |> tap (fn x => pwriteln (Pretty.str (@{make_string} x)))
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    80
   in
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    81
      Qt
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    82
      |> Thm.implies_intr assm2
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    83
      |> Thm.implies_intr assm1
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    84
   end
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    85
*}
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    86
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    87
local_setup {*
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    88
  Local_Theory.note ((@{binding "my_thm"}, []), [my_thm]) #> snd  
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    89
*}
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    90
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    91
local_setup {*
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    92
  Local_Theory.note ((@{binding "my_thm_simp"},
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    93
        [Attrib.internal (K Simplifier.simp_add)]), [my_thm]) #> snd
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    94
*}
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    95
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    96
(* pp 62 *)
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    97
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    98
ML {*
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
    99
   Thm.reflexive @{cterm "True"}
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   100
    |> Simplifier.rewrite_rule [@{thm True_def}]
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   101
    |> pretty_thm @{context}
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   102
    |> pwriteln
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   103
*}
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   104
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   105
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   106
ML {*
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   107
  val thm = @{thm list.induct} |> forall_intr_vars;
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   108
  thm |> forall_intr_vars |> cprop_of |> Object_Logic.atomize
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   109
  |> (fn x => Raw_Simplifier.rewrite_rule [x] thm)
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   110
*}
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   111
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   112
ML {*
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   113
fun atomize_thm thm =
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   114
let
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   115
  val thm' = forall_intr_vars thm
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   116
  val thm'' = Object_Logic.atomize (cprop_of thm')
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   117
in
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   118
  Raw_Simplifier.rewrite_rule [thm''] thm'
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   119
end
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   120
*}
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   121
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   122
ML {*
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   123
  @{thm list.induct} |> atomize_thm
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   124
*}
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   125
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   126
ML {*
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   127
   Skip_Proof.make_thm @{theory} @{prop "True = False"}
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   128
*}
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   129
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   130
ML {*
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   131
fun pthms_of (PBody {thms, ...}) = map #2 thms
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   132
val get_names = map #1 o pthms_of
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   133
val get_pbodies = map (Future.join o #3) o pthms_of
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   134
*}
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   135
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   136
lemma my_conjIa:
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   137
shows "A \<and> B \<Longrightarrow> A \<and> B"
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   138
apply(rule conjI)
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   139
apply(drule conjunct1)
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   140
apply(assumption)
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   141
apply(drule conjunct2)
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   142
apply(assumption)
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   143
done
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   144
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   145
lemma my_conjIb:
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   146
shows "A \<and> B \<Longrightarrow> A \<and> B"
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   147
apply(assumption)
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   148
done
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   149
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   150
lemma my_conjIc:
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   151
shows "A \<and> B \<Longrightarrow> A \<and> B"
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   152
apply(auto)
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   153
done
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   154
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   155
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   156
ML {*
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   157
@{thm my_conjIa}
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   158
  |> Thm.proof_body_of
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   159
  |> get_names
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   160
*}
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   161
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   162
ML {*
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   163
@{thm my_conjIa}
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   164
  |> Thm.proof_body_of
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   165
  |> get_pbodies
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   166
  |> map get_names
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   167
  |> List.concat
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   168
*}
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   169
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   170
ML {*
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   171
@{thm my_conjIb}
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   172
 |> Thm.proof_body_of
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   173
 |> get_pbodies
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   174
 |> map get_names
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   175
 |> List.concat
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   176
*}
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   177
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   178
ML {*
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   179
@{thm my_conjIc}
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   180
  |> Thm.proof_body_of
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   181
  |> get_pbodies
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   182
  |> map get_names
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   183
  |> List.concat
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   184
*}
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   185
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   186
ML {*
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   187
@{thm my_conjIa}
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   188
  |> Thm.proof_body_of
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   189
  |> get_pbodies
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   190
  |> map get_pbodies
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   191
  |> (map o map) get_names
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   192
  |> List.concat
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   193
  |> List.concat
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   194
  |> duplicates (op=)
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   195
*}
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   196
a5f5b9336007 thys2 added
Xingyuan Zhang <xingyuanzhang@126.com>
parents:
diff changeset
   197
end