src/HOL/Tools/BNF/bnf_fp_util.ML
changeset 55945 e96383acecf9
parent 55932 68c5104d2204
child 55966 972f0aa7091b
equal deleted inserted replaced
55944:7ab8f003fe41 55945:e96383acecf9
   500   let
   500   let
   501     val pre_relphis = map (fn rel => Term.list_comb (rel, phis @ pre_phis)) pre_rels;
   501     val pre_relphis = map (fn rel => Term.list_comb (rel, phis @ pre_phis)) pre_rels;
   502     val relphis = map (fn rel => Term.list_comb (rel, phis)) rels;
   502     val relphis = map (fn rel => Term.list_comb (rel, phis)) rels;
   503     fun flip f x y = if fp = Greatest_FP then f y x else f x y;
   503     fun flip f x y = if fp = Greatest_FP then f y x else f x y;
   504 
   504 
   505     val arg_rels = map2 (flip mk_fun_rel) pre_relphis pre_phis;
   505     val arg_rels = map2 (flip mk_rel_fun) pre_relphis pre_phis;
   506     fun mk_transfer relphi pre_phi un_fold un_fold' =
   506     fun mk_transfer relphi pre_phi un_fold un_fold' =
   507       fold_rev mk_fun_rel arg_rels (flip mk_fun_rel relphi pre_phi) $ un_fold $ un_fold';
   507       fold_rev mk_rel_fun arg_rels (flip mk_rel_fun relphi pre_phi) $ un_fold $ un_fold';
   508     val transfers = map4 mk_transfer relphis pre_phis un_folds un_folds';
   508     val transfers = map4 mk_transfer relphis pre_phis un_folds un_folds';
   509 
   509 
   510     val goal = fold_rev Logic.all (phis @ pre_phis)
   510     val goal = fold_rev Logic.all (phis @ pre_phis)
   511       (HOLogic.mk_Trueprop (Library.foldr1 HOLogic.mk_conj transfers));
   511       (HOLogic.mk_Trueprop (Library.foldr1 HOLogic.mk_conj transfers));
   512   in
   512   in