21 |
21 |
22 val thesisN = "thesis"; |
22 val thesisN = "thesis"; |
23 val thisN = "this"; |
23 val thisN = "this"; |
24 val assmsN = "assms"; |
24 val assmsN = "assms"; |
25 |
25 |
26 fun strip_judgment thy = Object_Logic.drop_judgment thy o Logic.strip_assums_concl; |
26 fun strip_judgment ctxt = Object_Logic.drop_judgment ctxt o Logic.strip_assums_concl; |
27 |
27 |
28 fun statement_binds thy name prop = |
28 fun statement_binds ctxt name prop = |
29 [((name, 0), SOME (fold_rev Term.abs (Logic.strip_params prop) (strip_judgment thy prop)))]; |
29 [((name, 0), SOME (fold_rev Term.abs (Logic.strip_params prop) (strip_judgment ctxt prop)))]; |
30 |
30 |
31 |
31 |
32 (* goal *) |
32 (* goal *) |
33 |
33 |
34 fun goal thy [prop] = statement_binds thy thesisN prop |
34 fun goal ctxt [prop] = statement_binds ctxt thesisN prop |
35 | goal _ _ = [((thesisN, 0), NONE)]; |
35 | goal _ _ = [((thesisN, 0), NONE)]; |
36 |
36 |
37 |
37 |
38 (* facts *) |
38 (* facts *) |
39 |
39 |
40 fun get_arg thy prop = |
40 fun get_arg ctxt prop = |
41 (case strip_judgment thy prop of |
41 (case strip_judgment ctxt prop of |
42 _ $ t => SOME (fold_rev Term.abs (Logic.strip_params prop) t) |
42 _ $ t => SOME (fold_rev Term.abs (Logic.strip_params prop) t) |
43 | _ => NONE); |
43 | _ => NONE); |
44 |
44 |
45 fun facts _ [] = [] |
45 fun facts _ [] = [] |
46 | facts thy props = |
46 | facts ctxt props = |
47 let val prop = List.last props |
47 let val prop = List.last props |
48 in [(Syntax_Ext.dddot_indexname, get_arg thy prop)] @ statement_binds thy thisN prop end; |
48 in [(Syntax_Ext.dddot_indexname, get_arg ctxt prop)] @ statement_binds ctxt thisN prop end; |
49 |
49 |
50 val no_facts = [(Syntax_Ext.dddot_indexname, NONE), ((thisN, 0), NONE)]; |
50 val no_facts = [(Syntax_Ext.dddot_indexname, NONE), ((thisN, 0), NONE)]; |
51 |
51 |
52 end; |
52 end; |