| author | wenzelm |
| Fri, 17 Sep 2010 15:51:11 +0200 | |
| changeset 39439 | 1c294d150ded |
| parent 39357 | fe84bc307be6 |
| child 39457 | b505208f435d |
| permissions | -rw-r--r-- |
| 36062 | 1 |
(* Title: HOL/Tools/Sledgehammer/sledgehammer_util.ML |
| 35963 | 2 |
Author: Jasmin Blanchette, TU Muenchen |
3 |
||
4 |
General-purpose functions used by the Sledgehammer modules. |
|
5 |
*) |
|
6 |
||
7 |
signature SLEDGEHAMMER_UTIL = |
|
8 |
sig |
|
|
38818
61cf050f8b2e
improve SPASS hack, when a clause comes from several facts
blanchet
parents:
38752
diff
changeset
|
9 |
val find_first_in_list_vector : (''a * 'b) list vector -> ''a -> 'b option
|
|
36142
f5e15e9aae10
make Sledgehammer "minimize" output less confusing + round up (not down) time limits to nearest second
blanchet
parents:
36062
diff
changeset
|
10 |
val plural_s : int -> string |
| 35963 | 11 |
val serial_commas : string -> string list -> string list |
|
38738
0ce517c1970f
make sure that "undo_ascii_of" is the inverse of "ascii_of", also for non-printable characters -- and avoid those in ``-style facts
blanchet
parents:
38698
diff
changeset
|
12 |
val simplify_spaces : string -> string |
|
0ce517c1970f
make sure that "undo_ascii_of" is the inverse of "ascii_of", also for non-printable characters -- and avoid those in ``-style facts
blanchet
parents:
38698
diff
changeset
|
13 |
val strip_spaces_except_between_ident_chars : string -> string |
| 35963 | 14 |
val parse_bool_option : bool -> string -> string -> bool option |
15 |
val parse_time_option : string -> string -> Time.time option |
|
|
37962
d7dbe01f48d7
keep track of clause numbers for SPASS now that we generate FOF rather than CNF problems;
blanchet
parents:
37575
diff
changeset
|
16 |
val scan_integer : string list -> int * string list |
|
36486
c2d7e2dff59e
support Vampire definitions of constants as "let" constructs in Isar proofs
blanchet
parents:
36478
diff
changeset
|
17 |
val nat_subscript : int -> string |
|
36478
1aba777a367f
fix types of "fix" variables to help proof reconstruction and aid readability
blanchet
parents:
36402
diff
changeset
|
18 |
val unyxml : string -> string |
|
1aba777a367f
fix types of "fix" variables to help proof reconstruction and aid readability
blanchet
parents:
36402
diff
changeset
|
19 |
val maybe_quote : string -> string |
|
36555
8ff45c2076da
expand combinators in Isar proofs constructed by Sledgehammer;
blanchet
parents:
36496
diff
changeset
|
20 |
val monomorphic_term : Type.tyenv -> term -> term |
|
38652
e063be321438
perform eta-expansion of quantifier bodies in Sledgehammer translation when needed + transform elim rules later;
blanchet
parents:
38608
diff
changeset
|
21 |
val eta_expand : typ list -> term -> int -> term |
|
e063be321438
perform eta-expansion of quantifier bodies in Sledgehammer translation when needed + transform elim rules later;
blanchet
parents:
38608
diff
changeset
|
22 |
val transform_elim_term : term -> term |
|
36555
8ff45c2076da
expand combinators in Isar proofs constructed by Sledgehammer;
blanchet
parents:
36496
diff
changeset
|
23 |
val specialize_type : theory -> (string * typ) -> term -> term |
| 38044 | 24 |
val subgoal_count : Proof.state -> int |
|
37995
06f02b15ef8a
generate full first-order formulas (FOF) in Sledgehammer
blanchet
parents:
37962
diff
changeset
|
25 |
val strip_subgoal : thm -> int -> (string * typ) list * term list * term |
|
38696
4c6b65d6a135
quote facts whose names collide with a keyword or command name (cf. "subclass" in "Jinja/J/TypeSafe.thy")
blanchet
parents:
38652
diff
changeset
|
26 |
val reserved_isar_keyword_table : unit -> unit Symtab.table |
| 35963 | 27 |
end; |
| 39318 | 28 |
|
| 35963 | 29 |
structure Sledgehammer_Util : SLEDGEHAMMER_UTIL = |
30 |
struct |
|
31 |
||
|
38818
61cf050f8b2e
improve SPASS hack, when a clause comes from several facts
blanchet
parents:
38752
diff
changeset
|
32 |
fun find_first_in_list_vector vec key = |
|
61cf050f8b2e
improve SPASS hack, when a clause comes from several facts
blanchet
parents:
38752
diff
changeset
|
33 |
Vector.foldl (fn (ps, NONE) => AList.lookup (op =) ps key |
|
61cf050f8b2e
improve SPASS hack, when a clause comes from several facts
blanchet
parents:
38752
diff
changeset
|
34 |
| (_, value) => value) NONE vec |
|
38698
d19c3a7ce38b
clean handling of whether a fact is chained or not;
blanchet
parents:
38696
diff
changeset
|
35 |
|
|
36142
f5e15e9aae10
make Sledgehammer "minimize" output less confusing + round up (not down) time limits to nearest second
blanchet
parents:
36062
diff
changeset
|
36 |
fun plural_s n = if n = 1 then "" else "s" |
| 36062 | 37 |
|
| 35963 | 38 |
fun serial_commas _ [] = ["??"] |
39 |
| serial_commas _ [s] = [s] |
|
40 |
| serial_commas conj [s1, s2] = [s1, conj, s2] |
|
41 |
| serial_commas conj [s1, s2, s3] = [s1 ^ ",", s2 ^ ",", conj, s3] |
|
42 |
| serial_commas conj (s :: ss) = s ^ "," :: serial_commas conj ss |
|
43 |
||
| 39357 | 44 |
fun strip_spaces_in_list _ [] = [] |
45 |
| strip_spaces_in_list _ [c1] = if Char.isSpace c1 then [] else [str c1] |
|
|
38738
0ce517c1970f
make sure that "undo_ascii_of" is the inverse of "ascii_of", also for non-printable characters -- and avoid those in ``-style facts
blanchet
parents:
38698
diff
changeset
|
46 |
| strip_spaces_in_list is_evil [c1, c2] = |
| 39357 | 47 |
strip_spaces_in_list is_evil [c1] @ strip_spaces_in_list is_evil [c2] |
|
38738
0ce517c1970f
make sure that "undo_ascii_of" is the inverse of "ascii_of", also for non-printable characters -- and avoid those in ``-style facts
blanchet
parents:
38698
diff
changeset
|
48 |
| strip_spaces_in_list is_evil (c1 :: c2 :: c3 :: cs) = |
|
37962
d7dbe01f48d7
keep track of clause numbers for SPASS now that we generate FOF rather than CNF problems;
blanchet
parents:
37575
diff
changeset
|
49 |
if Char.isSpace c1 then |
|
38738
0ce517c1970f
make sure that "undo_ascii_of" is the inverse of "ascii_of", also for non-printable characters -- and avoid those in ``-style facts
blanchet
parents:
38698
diff
changeset
|
50 |
strip_spaces_in_list is_evil (c2 :: c3 :: cs) |
|
37962
d7dbe01f48d7
keep track of clause numbers for SPASS now that we generate FOF rather than CNF problems;
blanchet
parents:
37575
diff
changeset
|
51 |
else if Char.isSpace c2 then |
|
d7dbe01f48d7
keep track of clause numbers for SPASS now that we generate FOF rather than CNF problems;
blanchet
parents:
37575
diff
changeset
|
52 |
if Char.isSpace c3 then |
|
38738
0ce517c1970f
make sure that "undo_ascii_of" is the inverse of "ascii_of", also for non-printable characters -- and avoid those in ``-style facts
blanchet
parents:
38698
diff
changeset
|
53 |
strip_spaces_in_list is_evil (c1 :: c3 :: cs) |
|
37962
d7dbe01f48d7
keep track of clause numbers for SPASS now that we generate FOF rather than CNF problems;
blanchet
parents:
37575
diff
changeset
|
54 |
else |
| 39357 | 55 |
str c1 :: (if forall is_evil [c1, c3] then [" "] else []) @ |
|
38738
0ce517c1970f
make sure that "undo_ascii_of" is the inverse of "ascii_of", also for non-printable characters -- and avoid those in ``-style facts
blanchet
parents:
38698
diff
changeset
|
56 |
strip_spaces_in_list is_evil (c3 :: cs) |
|
37962
d7dbe01f48d7
keep track of clause numbers for SPASS now that we generate FOF rather than CNF problems;
blanchet
parents:
37575
diff
changeset
|
57 |
else |
| 39357 | 58 |
str c1 :: strip_spaces_in_list is_evil (c2 :: c3 :: cs) |
59 |
fun strip_spaces is_evil = |
|
60 |
implode o strip_spaces_in_list is_evil o String.explode |
|
|
38738
0ce517c1970f
make sure that "undo_ascii_of" is the inverse of "ascii_of", also for non-printable characters -- and avoid those in ``-style facts
blanchet
parents:
38698
diff
changeset
|
61 |
|
|
0ce517c1970f
make sure that "undo_ascii_of" is the inverse of "ascii_of", also for non-printable characters -- and avoid those in ``-style facts
blanchet
parents:
38698
diff
changeset
|
62 |
val simplify_spaces = strip_spaces (K true) |
|
0ce517c1970f
make sure that "undo_ascii_of" is the inverse of "ascii_of", also for non-printable characters -- and avoid those in ``-style facts
blanchet
parents:
38698
diff
changeset
|
63 |
|
|
0ce517c1970f
make sure that "undo_ascii_of" is the inverse of "ascii_of", also for non-printable characters -- and avoid those in ``-style facts
blanchet
parents:
38698
diff
changeset
|
64 |
fun is_ident_char c = Char.isAlphaNum c orelse c = #"_" |
|
0ce517c1970f
make sure that "undo_ascii_of" is the inverse of "ascii_of", also for non-printable characters -- and avoid those in ``-style facts
blanchet
parents:
38698
diff
changeset
|
65 |
val strip_spaces_except_between_ident_chars = strip_spaces is_ident_char |
|
37962
d7dbe01f48d7
keep track of clause numbers for SPASS now that we generate FOF rather than CNF problems;
blanchet
parents:
37575
diff
changeset
|
66 |
|
| 35963 | 67 |
fun parse_bool_option option name s = |
68 |
(case s of |
|
69 |
"smart" => if option then NONE else raise Option |
|
70 |
| "false" => SOME false |
|
71 |
| "true" => SOME true |
|
72 |
| "" => SOME true |
|
73 |
| _ => raise Option) |
|
74 |
handle Option.Option => |
|
75 |
let val ss = map quote ((option ? cons "smart") ["true", "false"]) in |
|
76 |
error ("Parameter " ^ quote name ^ " must be assigned " ^
|
|
77 |
space_implode " " (serial_commas "or" ss) ^ ".") |
|
78 |
end |
|
79 |
||
80 |
fun parse_time_option _ "none" = NONE |
|
81 |
| parse_time_option name s = |
|
82 |
let |
|
83 |
val msecs = |
|
84 |
case space_explode " " s of |
|
85 |
[s1, "min"] => 60000 * the (Int.fromString s1) |
|
86 |
| [s1, "s"] => 1000 * the (Int.fromString s1) |
|
87 |
| [s1, "ms"] => the (Int.fromString s1) |
|
88 |
| _ => 0 |
|
89 |
in |
|
90 |
if msecs <= 0 then |
|
91 |
error ("Parameter " ^ quote name ^ " must be assigned a positive time \
|
|
92 |
\value (e.g., \"60 s\", \"200 ms\") or \"none\".") |
|
93 |
else |
|
94 |
SOME (Time.fromMilliseconds msecs) |
|
95 |
end |
|
96 |
||
|
37962
d7dbe01f48d7
keep track of clause numbers for SPASS now that we generate FOF rather than CNF problems;
blanchet
parents:
37575
diff
changeset
|
97 |
fun is_head_digit s = Char.isDigit (String.sub (s, 0)) |
|
d7dbe01f48d7
keep track of clause numbers for SPASS now that we generate FOF rather than CNF problems;
blanchet
parents:
37575
diff
changeset
|
98 |
val scan_integer = Scan.many1 is_head_digit >> (the o Int.fromString o implode) |
|
d7dbe01f48d7
keep track of clause numbers for SPASS now that we generate FOF rather than CNF problems;
blanchet
parents:
37575
diff
changeset
|
99 |
|
|
36486
c2d7e2dff59e
support Vampire definitions of constants as "let" constructs in Isar proofs
blanchet
parents:
36478
diff
changeset
|
100 |
val subscript = implode o map (prefix "\<^isub>") o explode |
| 37321 | 101 |
fun nat_subscript n = |
102 |
n |> string_of_int |> print_mode_active Symbol.xsymbolsN ? subscript |
|
|
36486
c2d7e2dff59e
support Vampire definitions of constants as "let" constructs in Isar proofs
blanchet
parents:
36478
diff
changeset
|
103 |
|
|
36478
1aba777a367f
fix types of "fix" variables to help proof reconstruction and aid readability
blanchet
parents:
36402
diff
changeset
|
104 |
fun plain_string_from_xml_tree t = |
|
1aba777a367f
fix types of "fix" variables to help proof reconstruction and aid readability
blanchet
parents:
36402
diff
changeset
|
105 |
Buffer.empty |> XML.add_content t |> Buffer.content |
|
1aba777a367f
fix types of "fix" variables to help proof reconstruction and aid readability
blanchet
parents:
36402
diff
changeset
|
106 |
val unyxml = plain_string_from_xml_tree o YXML.parse |
|
1aba777a367f
fix types of "fix" variables to help proof reconstruction and aid readability
blanchet
parents:
36402
diff
changeset
|
107 |
|
|
1aba777a367f
fix types of "fix" variables to help proof reconstruction and aid readability
blanchet
parents:
36402
diff
changeset
|
108 |
val is_long_identifier = forall Syntax.is_identifier o space_explode "." |
|
1aba777a367f
fix types of "fix" variables to help proof reconstruction and aid readability
blanchet
parents:
36402
diff
changeset
|
109 |
fun maybe_quote y = |
|
1aba777a367f
fix types of "fix" variables to help proof reconstruction and aid readability
blanchet
parents:
36402
diff
changeset
|
110 |
let val s = unyxml y in |
|
1aba777a367f
fix types of "fix" variables to help proof reconstruction and aid readability
blanchet
parents:
36402
diff
changeset
|
111 |
y |> ((not (is_long_identifier (perhaps (try (unprefix "'")) s)) andalso |
|
1aba777a367f
fix types of "fix" variables to help proof reconstruction and aid readability
blanchet
parents:
36402
diff
changeset
|
112 |
not (is_long_identifier (perhaps (try (unprefix "?")) s))) orelse |
|
36960
01594f816e3a
prefer structure Keyword, Parse, Parse_Spec, Outer_Syntax;
wenzelm
parents:
36555
diff
changeset
|
113 |
Keyword.is_keyword s) ? quote |
|
36478
1aba777a367f
fix types of "fix" variables to help proof reconstruction and aid readability
blanchet
parents:
36402
diff
changeset
|
114 |
end |
|
1aba777a367f
fix types of "fix" variables to help proof reconstruction and aid readability
blanchet
parents:
36402
diff
changeset
|
115 |
|
|
36555
8ff45c2076da
expand combinators in Isar proofs constructed by Sledgehammer;
blanchet
parents:
36496
diff
changeset
|
116 |
fun monomorphic_term subst t = |
|
8ff45c2076da
expand combinators in Isar proofs constructed by Sledgehammer;
blanchet
parents:
36496
diff
changeset
|
117 |
map_types (map_type_tvar (fn v => |
|
8ff45c2076da
expand combinators in Isar proofs constructed by Sledgehammer;
blanchet
parents:
36496
diff
changeset
|
118 |
case Type.lookup subst v of |
|
8ff45c2076da
expand combinators in Isar proofs constructed by Sledgehammer;
blanchet
parents:
36496
diff
changeset
|
119 |
SOME typ => typ |
|
8ff45c2076da
expand combinators in Isar proofs constructed by Sledgehammer;
blanchet
parents:
36496
diff
changeset
|
120 |
| NONE => raise TERM ("monomorphic_term: uninstanitated schematic type \
|
|
8ff45c2076da
expand combinators in Isar proofs constructed by Sledgehammer;
blanchet
parents:
36496
diff
changeset
|
121 |
\variable", [t]))) t |
|
8ff45c2076da
expand combinators in Isar proofs constructed by Sledgehammer;
blanchet
parents:
36496
diff
changeset
|
122 |
|
|
38652
e063be321438
perform eta-expansion of quantifier bodies in Sledgehammer translation when needed + transform elim rules later;
blanchet
parents:
38608
diff
changeset
|
123 |
fun eta_expand _ t 0 = t |
|
e063be321438
perform eta-expansion of quantifier bodies in Sledgehammer translation when needed + transform elim rules later;
blanchet
parents:
38608
diff
changeset
|
124 |
| eta_expand Ts (Abs (s, T, t')) n = |
|
e063be321438
perform eta-expansion of quantifier bodies in Sledgehammer translation when needed + transform elim rules later;
blanchet
parents:
38608
diff
changeset
|
125 |
Abs (s, T, eta_expand (T :: Ts) t' (n - 1)) |
|
e063be321438
perform eta-expansion of quantifier bodies in Sledgehammer translation when needed + transform elim rules later;
blanchet
parents:
38608
diff
changeset
|
126 |
| eta_expand Ts t n = |
|
e063be321438
perform eta-expansion of quantifier bodies in Sledgehammer translation when needed + transform elim rules later;
blanchet
parents:
38608
diff
changeset
|
127 |
fold_rev (fn T => fn t' => Abs ("x" ^ nat_subscript n, T, t'))
|
|
e063be321438
perform eta-expansion of quantifier bodies in Sledgehammer translation when needed + transform elim rules later;
blanchet
parents:
38608
diff
changeset
|
128 |
(List.take (binder_types (fastype_of1 (Ts, t)), n)) |
|
e063be321438
perform eta-expansion of quantifier bodies in Sledgehammer translation when needed + transform elim rules later;
blanchet
parents:
38608
diff
changeset
|
129 |
(list_comb (incr_boundvars n t, map Bound (n - 1 downto 0))) |
|
e063be321438
perform eta-expansion of quantifier bodies in Sledgehammer translation when needed + transform elim rules later;
blanchet
parents:
38608
diff
changeset
|
130 |
|
|
e063be321438
perform eta-expansion of quantifier bodies in Sledgehammer translation when needed + transform elim rules later;
blanchet
parents:
38608
diff
changeset
|
131 |
(* Converts an elim-rule into an equivalent theorem that does not have the |
|
e063be321438
perform eta-expansion of quantifier bodies in Sledgehammer translation when needed + transform elim rules later;
blanchet
parents:
38608
diff
changeset
|
132 |
predicate variable. Leaves other theorems unchanged. We simply instantiate |
|
e063be321438
perform eta-expansion of quantifier bodies in Sledgehammer translation when needed + transform elim rules later;
blanchet
parents:
38608
diff
changeset
|
133 |
the conclusion variable to False. (Cf. "transform_elim_theorem" in |
|
e063be321438
perform eta-expansion of quantifier bodies in Sledgehammer translation when needed + transform elim rules later;
blanchet
parents:
38608
diff
changeset
|
134 |
"Clausifier".) *) |
|
e063be321438
perform eta-expansion of quantifier bodies in Sledgehammer translation when needed + transform elim rules later;
blanchet
parents:
38608
diff
changeset
|
135 |
fun transform_elim_term t = |
|
e063be321438
perform eta-expansion of quantifier bodies in Sledgehammer translation when needed + transform elim rules later;
blanchet
parents:
38608
diff
changeset
|
136 |
case Logic.strip_imp_concl t of |
|
e063be321438
perform eta-expansion of quantifier bodies in Sledgehammer translation when needed + transform elim rules later;
blanchet
parents:
38608
diff
changeset
|
137 |
@{const Trueprop} $ Var (z, @{typ bool}) =>
|
|
e063be321438
perform eta-expansion of quantifier bodies in Sledgehammer translation when needed + transform elim rules later;
blanchet
parents:
38608
diff
changeset
|
138 |
subst_Vars [(z, @{const False})] t
|
|
e063be321438
perform eta-expansion of quantifier bodies in Sledgehammer translation when needed + transform elim rules later;
blanchet
parents:
38608
diff
changeset
|
139 |
| Var (z, @{typ prop}) => subst_Vars [(z, @{prop False})] t
|
|
e063be321438
perform eta-expansion of quantifier bodies in Sledgehammer translation when needed + transform elim rules later;
blanchet
parents:
38608
diff
changeset
|
140 |
| _ => t |
|
e063be321438
perform eta-expansion of quantifier bodies in Sledgehammer translation when needed + transform elim rules later;
blanchet
parents:
38608
diff
changeset
|
141 |
|
|
36555
8ff45c2076da
expand combinators in Isar proofs constructed by Sledgehammer;
blanchet
parents:
36496
diff
changeset
|
142 |
fun specialize_type thy (s, T) t = |
|
8ff45c2076da
expand combinators in Isar proofs constructed by Sledgehammer;
blanchet
parents:
36496
diff
changeset
|
143 |
let |
|
8ff45c2076da
expand combinators in Isar proofs constructed by Sledgehammer;
blanchet
parents:
36496
diff
changeset
|
144 |
fun subst_for (Const (s', T')) = |
|
8ff45c2076da
expand combinators in Isar proofs constructed by Sledgehammer;
blanchet
parents:
36496
diff
changeset
|
145 |
if s = s' then |
|
8ff45c2076da
expand combinators in Isar proofs constructed by Sledgehammer;
blanchet
parents:
36496
diff
changeset
|
146 |
SOME (Sign.typ_match thy (T', T) Vartab.empty) |
|
8ff45c2076da
expand combinators in Isar proofs constructed by Sledgehammer;
blanchet
parents:
36496
diff
changeset
|
147 |
handle Type.TYPE_MATCH => NONE |
|
8ff45c2076da
expand combinators in Isar proofs constructed by Sledgehammer;
blanchet
parents:
36496
diff
changeset
|
148 |
else |
|
8ff45c2076da
expand combinators in Isar proofs constructed by Sledgehammer;
blanchet
parents:
36496
diff
changeset
|
149 |
NONE |
|
8ff45c2076da
expand combinators in Isar proofs constructed by Sledgehammer;
blanchet
parents:
36496
diff
changeset
|
150 |
| subst_for (t1 $ t2) = |
|
8ff45c2076da
expand combinators in Isar proofs constructed by Sledgehammer;
blanchet
parents:
36496
diff
changeset
|
151 |
(case subst_for t1 of SOME x => SOME x | NONE => subst_for t2) |
|
8ff45c2076da
expand combinators in Isar proofs constructed by Sledgehammer;
blanchet
parents:
36496
diff
changeset
|
152 |
| subst_for (Abs (_, _, t')) = subst_for t' |
|
8ff45c2076da
expand combinators in Isar proofs constructed by Sledgehammer;
blanchet
parents:
36496
diff
changeset
|
153 |
| subst_for _ = NONE |
|
8ff45c2076da
expand combinators in Isar proofs constructed by Sledgehammer;
blanchet
parents:
36496
diff
changeset
|
154 |
in |
|
8ff45c2076da
expand combinators in Isar proofs constructed by Sledgehammer;
blanchet
parents:
36496
diff
changeset
|
155 |
case subst_for t of |
|
8ff45c2076da
expand combinators in Isar proofs constructed by Sledgehammer;
blanchet
parents:
36496
diff
changeset
|
156 |
SOME subst => monomorphic_term subst t |
|
8ff45c2076da
expand combinators in Isar proofs constructed by Sledgehammer;
blanchet
parents:
36496
diff
changeset
|
157 |
| NONE => raise Type.TYPE_MATCH |
|
8ff45c2076da
expand combinators in Isar proofs constructed by Sledgehammer;
blanchet
parents:
36496
diff
changeset
|
158 |
end |
|
8ff45c2076da
expand combinators in Isar proofs constructed by Sledgehammer;
blanchet
parents:
36496
diff
changeset
|
159 |
|
| 38044 | 160 |
val subgoal_count = Logic.count_prems o prop_of o #goal o Proof.goal |
161 |
||
|
37995
06f02b15ef8a
generate full first-order formulas (FOF) in Sledgehammer
blanchet
parents:
37962
diff
changeset
|
162 |
fun strip_subgoal goal i = |
|
06f02b15ef8a
generate full first-order formulas (FOF) in Sledgehammer
blanchet
parents:
37962
diff
changeset
|
163 |
let |
|
06f02b15ef8a
generate full first-order formulas (FOF) in Sledgehammer
blanchet
parents:
37962
diff
changeset
|
164 |
val (t, frees) = Logic.goal_params (prop_of goal) i |
|
06f02b15ef8a
generate full first-order formulas (FOF) in Sledgehammer
blanchet
parents:
37962
diff
changeset
|
165 |
val hyp_ts = t |> Logic.strip_assums_hyp |> map (curry subst_bounds frees) |
|
06f02b15ef8a
generate full first-order formulas (FOF) in Sledgehammer
blanchet
parents:
37962
diff
changeset
|
166 |
val concl_t = t |> Logic.strip_assums_concl |> curry subst_bounds frees |
|
06f02b15ef8a
generate full first-order formulas (FOF) in Sledgehammer
blanchet
parents:
37962
diff
changeset
|
167 |
in (rev (map dest_Free frees), hyp_ts, concl_t) end |
|
36555
8ff45c2076da
expand combinators in Isar proofs constructed by Sledgehammer;
blanchet
parents:
36496
diff
changeset
|
168 |
|
|
38696
4c6b65d6a135
quote facts whose names collide with a keyword or command name (cf. "subclass" in "Jinja/J/TypeSafe.thy")
blanchet
parents:
38652
diff
changeset
|
169 |
fun reserved_isar_keyword_table () = |
|
4c6b65d6a135
quote facts whose names collide with a keyword or command name (cf. "subclass" in "Jinja/J/TypeSafe.thy")
blanchet
parents:
38652
diff
changeset
|
170 |
union (op =) (Keyword.dest_keywords ()) (Keyword.dest_commands ()) |
|
4c6b65d6a135
quote facts whose names collide with a keyword or command name (cf. "subclass" in "Jinja/J/TypeSafe.thy")
blanchet
parents:
38652
diff
changeset
|
171 |
|> map (rpair ()) |> Symtab.make |
|
4c6b65d6a135
quote facts whose names collide with a keyword or command name (cf. "subclass" in "Jinja/J/TypeSafe.thy")
blanchet
parents:
38652
diff
changeset
|
172 |
|
| 35963 | 173 |
end; |