src/HOL/Tools/choice_specification.ML
changeset 44121 44adaa6db327
parent 42361 23f352990944
child 45592 8baa0b7f3f66
equal deleted inserted replaced
44120:01de796250a0 44121:44adaa6db327
    16 
    16 
    17 (* actual code *)
    17 (* actual code *)
    18 
    18 
    19 fun close_form t =
    19 fun close_form t =
    20     fold_rev (fn (s, T) => fn t => HOLogic.mk_all (s, T, t))
    20     fold_rev (fn (s, T) => fn t => HOLogic.mk_all (s, T, t))
    21              (map dest_Free (OldTerm.term_frees t)) t
    21              (map dest_Free (Misc_Legacy.term_frees t)) t
    22 
    22 
    23 local
    23 local
    24     fun mk_definitional [] arg = arg
    24     fun mk_definitional [] arg = arg
    25       | mk_definitional ((thname,cname,covld)::cos) (thy,thm) =
    25       | mk_definitional ((thname,cname,covld)::cos) (thy,thm) =
    26         case HOLogic.dest_Trueprop (concl_of thm) of
    26         case HOLogic.dest_Trueprop (concl_of thm) of
   120         val props' = rew_imps |>
   120         val props' = rew_imps |>
   121           map (HOLogic.dest_Trueprop o term_of o snd o Thm.dest_equals o cprop_of)
   121           map (HOLogic.dest_Trueprop o term_of o snd o Thm.dest_equals o cprop_of)
   122 
   122 
   123         fun proc_single prop =
   123         fun proc_single prop =
   124             let
   124             let
   125                 val frees = OldTerm.term_frees prop
   125                 val frees = Misc_Legacy.term_frees prop
   126                 val _ = forall (fn v => Sign.of_sort thy (type_of v,HOLogic.typeS)) frees
   126                 val _ = forall (fn v => Sign.of_sort thy (type_of v,HOLogic.typeS)) frees
   127                   orelse error "Specificaton: Only free variables of sort 'type' allowed"
   127                   orelse error "Specificaton: Only free variables of sort 'type' allowed"
   128                 val prop_closed = close_form prop
   128                 val prop_closed = close_form prop
   129             in
   129             in
   130                 (prop_closed,frees)
   130                 (prop_closed,frees)