264 val beta_norm_proof: zproof -> zproof |
264 val beta_norm_proof: zproof -> zproof |
265 val beta_norm_prooft: zproof -> zproof |
265 val beta_norm_prooft: zproof -> zproof |
266 val norm_type: Type.tyenv -> ztyp -> ztyp |
266 val norm_type: Type.tyenv -> ztyp -> ztyp |
267 val norm_term: theory -> Envir.env -> zterm -> zterm |
267 val norm_term: theory -> Envir.env -> zterm -> zterm |
268 val norm_proof: theory -> Envir.env -> term list -> zproof -> zproof |
268 val norm_proof: theory -> Envir.env -> term list -> zproof -> zproof |
|
269 val zproof_const_typargs: zproof_const -> ((indexname * sort) * ztyp) list |
|
270 val zproof_const_args: zproof_const -> ((indexname * ztyp) * zterm) list |
269 type zbox = serial * (zterm * zproof) |
271 type zbox = serial * (zterm * zproof) |
270 val zbox_ord: zbox ord |
272 val zbox_ord: zbox ord |
271 type zboxes = zbox Ord_List.T |
273 type zboxes = zbox Ord_List.T |
272 val union_zboxes: zboxes -> zboxes -> zboxes |
274 val union_zboxes: zboxes -> zboxes -> zboxes |
273 val unions_zboxes: zboxes list -> zboxes |
275 val unions_zboxes: zboxes list -> zboxes |
800 val inst = |
802 val inst = |
801 ZVars.build (A |> fold_vars (fn v => fn tab => |
803 ZVars.build (A |> fold_vars (fn v => fn tab => |
802 if ZVars.defined tab v then tab else ZVars.update (v, ZVar v) tab)); |
804 if ZVars.defined tab v then tab else ZVars.update (v, ZVar v) tab)); |
803 in ((a, A), (instT, inst)) end; |
805 in ((a, A), (instT, inst)) end; |
804 |
806 |
|
807 fun zproof_const_typargs (((_, A), (instT, _)): zproof_const) = |
|
808 ZTVars.build (A |> ZTVars.add_tvars) |> ZTVars.list_set |
|
809 |> map (fn v => (v, the_default (ZTVar v) (ZTVars.lookup instT v))); |
|
810 |
|
811 fun zproof_const_args (((_, A), (_, inst)): zproof_const) = |
|
812 ZVars.build (A |> ZVars.add_vars) |> ZVars.list_set |
|
813 |> map (fn v => (v, the_default (ZVar v) (ZVars.lookup inst v))); |
|
814 |
805 fun make_const_proof (f, g) ((a, insts): zproof_const) = |
815 fun make_const_proof (f, g) ((a, insts): zproof_const) = |
806 let |
816 let |
807 val typ = subst_type_same (Same.function (fn ((x, _), _) => try f x)); |
817 val typ = subst_type_same (Same.function (fn ((x, _), _) => try f x)); |
808 val term = Same.function (fn ZVar ((x, _), _) => try g x | _ => NONE); |
818 val term = Same.function (fn ZVar ((x, _), _) => try g x | _ => NONE); |
809 in ZConstp (a, Same.commit (map_insts_same typ term) insts) end; |
819 in ZConstp (a, Same.commit (map_insts_same typ term) insts) end; |