equal
deleted
inserted
replaced
1 (* Title: Tools/code/code_wellsorted.ML |
1 (* Title: Tools/code/code_wellsorted.ML |
2 Author: Florian Haftmann, TU Muenchen |
2 Author: Florian Haftmann, TU Muenchen |
3 |
3 |
4 Retrieving, well-sorting and structuring code equations in graph |
4 Producing well-sorted systems of code equations in a graph |
5 with explicit dependencies -- the Waisenhaus algorithm. |
5 with explicit dependencies -- the Waisenhaus algorithm. |
6 *) |
6 *) |
7 |
7 |
8 signature CODE_FUNCGR = |
8 signature CODE_FUNCGR = |
9 sig |
9 sig |
299 val t' = Thm.term_of ct'; |
299 val t' = Thm.term_of ct'; |
300 val (t'', evaluator_eqngr) = evaluator t'; |
300 val (t'', evaluator_eqngr) = evaluator t'; |
301 val consts = map fst (consts_of t'); |
301 val consts = map fst (consts_of t'); |
302 val consts' = consts_of t''; |
302 val consts' = consts_of t''; |
303 val const_matches' = fold (fn (c, ty) => |
303 val const_matches' = fold (fn (c, ty) => |
304 insert (op =) (c, Sign.const_typargs thy (c, Logic.unvarifyT ty))) consts' []; |
304 insert (op =) (c, Sign.const_typargs thy (c, ty))) consts' []; |
305 val (algebra', arities_eqngr') = |
305 val (algebra', arities_eqngr') = |
306 extend_arities_eqngr thy consts const_matches' arities_eqngr; |
306 extend_arities_eqngr thy consts const_matches' arities_eqngr; |
307 in |
307 in |
308 (evaluator_lift (evaluator_eqngr algebra') thm (snd arities_eqngr'), |
308 (evaluator_lift (evaluator_eqngr algebra') thm (snd arities_eqngr'), |
309 arities_eqngr') |
309 arities_eqngr') |