src/HOL/Tools/Function/function_common.ML
changeset 42081 21697a5cb34a
parent 41846 b368a7aee46a
child 42361 23f352990944
equal deleted inserted replaced
42080:58b465952287 42081:21697a5cb34a
   241         val (fname, qs, gs, args, rhs) = split_def ctxt check_head geq
   241         val (fname, qs, gs, args, rhs) = split_def ctxt check_head geq
   242 
   242 
   243         val _ = length args > 0 orelse input_error "Function has no arguments:"
   243         val _ = length args > 0 orelse input_error "Function has no arguments:"
   244 
   244 
   245         fun add_bvs t is = add_loose_bnos (t, 0, is)
   245         fun add_bvs t is = add_loose_bnos (t, 0, is)
   246             val rvs = (subtract (op =) (fold add_bvs args []) (add_bvs rhs []))
   246         val rvs = (subtract (op =) (fold add_bvs args []) (add_bvs rhs []))
   247                         |> map (fst o nth (rev qs))
   247                     |> map (fst o nth (rev qs))
   248 
   248 
   249         val _ = null rvs orelse input_error
   249         val _ = null rvs orelse input_error
   250           ("Variable" ^ plural " " "s " rvs ^ commas_quote rvs ^
   250           ("Variable" ^ plural " " "s " rvs ^ commas_quote rvs ^
   251            " occur" ^ plural "s" "" rvs ^ " on right hand side only:")
   251            " occur" ^ plural "s" "" rvs ^ " on right hand side only:")
   252 
   252