506 val (s, T) = dest_Const c |
506 val (s, T) = dest_Const c |
507 in if forall is_Var args then SOME (s, (T, (args, rhs))) else NONE |
507 in if forall is_Var args then SOME (s, (T, (args, rhs))) else NONE |
508 end handle TERM _ => NONE; |
508 end handle TERM _ => NONE; |
509 fun add_def thyname (name, t) = (case dest t of |
509 fun add_def thyname (name, t) = (case dest t of |
510 NONE => I |
510 NONE => I |
511 | SOME _ => (case dest (prep_def (Thm.get_axiom_i thy name)) of |
511 | SOME _ => (case dest (prep_def (Thm.axiom thy name)) of |
512 NONE => I |
512 NONE => I |
513 | SOME (s, (T, (args, rhs))) => Symtab.map_default (s, []) |
513 | SOME (s, (T, (args, rhs))) => Symtab.map_default (s, []) |
514 (cons (T, (thyname, split_last (rename_terms (args @ [rhs]))))))) |
514 (cons (T, (thyname, split_last (rename_terms (args @ [rhs]))))))) |
515 in |
515 in |
516 fold (fn (thyname, axms) => Symtab.fold (add_def thyname) axms) axmss Symtab.empty |
516 fold (fn (thyname, axms) => Symtab.fold (add_def thyname) axms) axmss Symtab.empty |