src/HOL/Matrix/cplex/matrixlp.ML
changeset 35021 c839a4c670c6
parent 32957 675c0c7e6a37
child 36614 b6c031ad3690
equal deleted inserted replaced
35020:862a20ffa8e2 35021:c839a4c670c6
    16 structure MatrixLP : MATRIX_LP =
    16 structure MatrixLP : MATRIX_LP =
    17 struct
    17 struct
    18 
    18 
    19 fun inst_real thm =
    19 fun inst_real thm =
    20   let val certT = ctyp_of (Thm.theory_of_thm thm) in
    20   let val certT = ctyp_of (Thm.theory_of_thm thm) in
    21     Drule.standard (Thm.instantiate
    21     Drule.export_without_context (Thm.instantiate
    22       ([(certT (TVar (hd (OldTerm.term_tvars (prop_of thm)))), certT HOLogic.realT)], []) thm)
    22       ([(certT (TVar (hd (OldTerm.term_tvars (prop_of thm)))), certT HOLogic.realT)], []) thm)
    23   end
    23   end
    24 
    24 
    25 local
    25 local
    26 
    26 
    57     let
    57     let
    58         val certT = Thm.ctyp_of (Thm.theory_of_thm thm);
    58         val certT = Thm.ctyp_of (Thm.theory_of_thm thm);
    59         val ord = prod_ord (prod_ord string_ord int_ord) (list_ord string_ord)
    59         val ord = prod_ord (prod_ord string_ord int_ord) (list_ord string_ord)
    60         val v = TVar (hd (sort ord (OldTerm.term_tvars (prop_of thm))))
    60         val v = TVar (hd (sort ord (OldTerm.term_tvars (prop_of thm))))
    61     in
    61     in
    62         Drule.standard (Thm.instantiate ([(certT v, certT ty)], []) thm)
    62         Drule.export_without_context (Thm.instantiate ([(certT v, certT ty)], []) thm)
    63     end
    63     end
    64 
    64 
    65 fun inst_tvars [] thms = thms
    65 fun inst_tvars [] thms = thms
    66   | inst_tvars (ty::tys) thms = inst_tvars tys (map (inst_tvar ty) thms)
    66   | inst_tvars (ty::tys) thms = inst_tvars tys (map (inst_tvar ty) thms)
    67 
    67