equal
deleted
inserted
replaced
1 (* Title: HOL/Tools/BNF/bnf_gfp_util.ML |
1 (* Title: HOL/Tools/BNF/bnf_gfp_util.ML |
2 Author: Dmitriy Traytel, TU Muenchen |
2 Author: Dmitriy Traytel, TU Muenchen |
3 Copyright 2012 |
3 Author: Jan van Brügge, TU Muenchen |
|
4 Copyright 2012, 2022 |
4 |
5 |
5 Library for the codatatype construction. |
6 Library for the codatatype construction. |
6 *) |
7 *) |
7 |
8 |
8 signature BNF_GFP_UTIL = |
9 signature BNF_GFP_UTIL = |
29 val mk_shift: term -> term -> term |
30 val mk_shift: term -> term -> term |
30 val mk_size: term -> term |
31 val mk_size: term -> term |
31 val mk_toCard: term -> term -> term |
32 val mk_toCard: term -> term -> term |
32 val mk_undefined: typ -> term |
33 val mk_undefined: typ -> term |
33 val mk_univ: term -> term |
34 val mk_univ: term -> term |
|
35 val mk_card_suc: term -> term |
34 |
36 |
35 val mk_specN: int -> thm -> thm |
37 val mk_specN: int -> thm -> thm |
36 |
38 |
37 val mk_InN_Field: int -> int -> thm |
39 val mk_InN_Field: int -> int -> thm |
38 val mk_InN_inject: int -> int -> thm |
40 val mk_InN_inject: int -> int -> thm |
139 fun mk_congruent R f = |
141 fun mk_congruent R f = |
140 Const (\<^const_name>\<open>congruent\<close>, fastype_of R --> fastype_of f --> HOLogic.boolT) $ R $ f; |
142 Const (\<^const_name>\<open>congruent\<close>, fastype_of R --> fastype_of f --> HOLogic.boolT) $ R $ f; |
141 |
143 |
142 fun mk_undefined T = Const (\<^const_name>\<open>undefined\<close>, T); |
144 fun mk_undefined T = Const (\<^const_name>\<open>undefined\<close>, T); |
143 |
145 |
|
146 fun mk_card_suc t = |
|
147 let |
|
148 val T = fst (dest_relT (fastype_of t)) |
|
149 val T' = Type (\<^type_name>\<open>suc\<close>, [T]) |
|
150 in Const (\<^const_name>\<open>card_suc\<close>, mk_relT (T, T) --> mk_relT (T', T')) $ t end; |
|
151 |
144 fun mk_rec_nat Zero Suc = |
152 fun mk_rec_nat Zero Suc = |
145 let val T = fastype_of Zero; |
153 let val T = fastype_of Zero; |
146 in Const (\<^const_name>\<open>old.rec_nat\<close>, T --> fastype_of Suc --> HOLogic.natT --> T) $ Zero $ Suc end; |
154 in Const (\<^const_name>\<open>old.rec_nat\<close>, T --> fastype_of Suc --> HOLogic.natT --> T) $ Zero $ Suc end; |
147 |
155 |
148 fun mk_rec_list Nil Cons = |
156 fun mk_rec_list Nil Cons = |