equal
deleted
inserted
replaced
395 in if null subst then th else th |> hyps_rule (instantiate_tfrees thy subst) end; |
395 in if null subst then th else th |> hyps_rule (instantiate_tfrees thy subst) end; |
396 |
396 |
397 fun instT_morphism thy env = |
397 fun instT_morphism thy env = |
398 let val thy_ref = Theory.check_thy thy in |
398 let val thy_ref = Theory.check_thy thy in |
399 Morphism.morphism |
399 Morphism.morphism |
400 {binding = I, |
400 {binding = [I], |
401 typ = instT_type env, |
401 typ = [instT_type env], |
402 term = instT_term env, |
402 term = [instT_term env], |
403 fact = map (fn th => instT_thm (Theory.deref thy_ref) env th)} |
403 fact = [map (fn th => instT_thm (Theory.deref thy_ref) env th)]} |
404 end; |
404 end; |
405 |
405 |
406 |
406 |
407 (* instantiate types and terms *) |
407 (* instantiate types and terms *) |
408 |
408 |
444 end; |
444 end; |
445 |
445 |
446 fun inst_morphism thy envs = |
446 fun inst_morphism thy envs = |
447 let val thy_ref = Theory.check_thy thy in |
447 let val thy_ref = Theory.check_thy thy in |
448 Morphism.morphism |
448 Morphism.morphism |
449 {binding = I, |
449 {binding = [], |
450 typ = instT_type (#1 envs), |
450 typ = [instT_type (#1 envs)], |
451 term = inst_term envs, |
451 term = [inst_term envs], |
452 fact = map (fn th => inst_thm (Theory.deref thy_ref) envs th)} |
452 fact = [map (fn th => inst_thm (Theory.deref thy_ref) envs th)]} |
453 end; |
453 end; |
454 |
454 |
455 |
455 |
456 (* satisfy hypotheses *) |
456 (* satisfy hypotheses *) |
457 |
457 |
465 |
465 |
466 |
466 |
467 (* rewriting with equalities *) |
467 (* rewriting with equalities *) |
468 |
468 |
469 fun eq_morphism thy thms = if null thms then NONE else SOME (Morphism.morphism |
469 fun eq_morphism thy thms = if null thms then NONE else SOME (Morphism.morphism |
470 {binding = I, |
470 {binding = [], |
471 typ = I, |
471 typ = [], |
472 term = Raw_Simplifier.rewrite_term thy thms [], |
472 term = [Raw_Simplifier.rewrite_term thy thms []], |
473 fact = map (Raw_Simplifier.rewrite_rule thms)}); |
473 fact = [map (Raw_Simplifier.rewrite_rule thms)]}); |
474 |
474 |
475 |
475 |
476 (* transfer to theory using closure *) |
476 (* transfer to theory using closure *) |
477 |
477 |
478 fun transfer_morphism thy = |
478 fun transfer_morphism thy = |