127 |
127 |
128 (* No "real" literals means only type information (tfree_tcs, clsrel, or clsarity). *) |
128 (* No "real" literals means only type information (tfree_tcs, clsrel, or clsarity). *) |
129 fun is_only_type_information t = t aconv @{prop True} |
129 fun is_only_type_information t = t aconv @{prop True} |
130 |
130 |
131 (* Discard facts; consolidate adjacent lines that prove the same formula, since they differ only in |
131 (* Discard facts; consolidate adjacent lines that prove the same formula, since they differ only in |
132 type information.*) |
132 type information. *) |
133 fun add_line_pass1 (line as (name as (_, ss), role, t, rule, [])) lines = |
133 fun add_line_pass1 (line as (name as (_, ss), role, t, rule, [])) lines = |
134 (* No dependencies: lemma (for Z3), fact, conjecture, or (for Vampire) |
134 (* No dependencies: lemma (for Z3), fact, conjecture, or (for Vampire) |
135 internal facts or definitions. *) |
135 internal facts or definitions. *) |
136 if role = Lemma orelse role = Conjecture orelse role = Negated_Conjecture orelse |
136 if role = Lemma orelse role = Conjecture orelse role = Negated_Conjecture orelse |
137 role = Hypothesis orelse is_arith_rule rule then |
137 role = Hypothesis orelse is_arith_rule rule then |
209 fun relabel_steps _ _ _ [] = [] |
209 fun relabel_steps _ _ _ [] = [] |
210 | relabel_steps subst depth next (Prove (qs, xs, l, t, sub, by) :: steps) = |
210 | relabel_steps subst depth next (Prove (qs, xs, l, t, sub, by) :: steps) = |
211 let |
211 let |
212 val (l, subst, next) = (l, subst, next) |> fresh_label depth have_prefix |
212 val (l, subst, next) = (l, subst, next) |> fresh_label depth have_prefix |
213 val sub = relabel_proofs subst depth sub |
213 val sub = relabel_proofs subst depth sub |
214 val by = by |> relabel_byline subst |
214 val by = apfst (relabel_facts subst) by |
215 in |
215 in |
216 Prove (qs, xs, l, t, sub, by) :: relabel_steps subst depth next steps |
216 Prove (qs, xs, l, t, sub, by) :: relabel_steps subst depth next steps |
217 end |
217 end |
218 | relabel_steps subst depth next (step :: steps) = |
218 | relabel_steps subst depth next (step :: steps) = |
219 step :: relabel_steps subst depth next steps |
219 step :: relabel_steps subst depth next steps |
220 and relabel_proof subst depth (Proof (fix, assms, steps)) = |
220 and relabel_proof subst depth (Proof (fix, assms, steps)) = |
221 let val (assms, subst) = relabel_assms subst depth assms in |
221 let val (assms, subst) = relabel_assms subst depth assms in |
222 Proof (fix, assms, relabel_steps subst depth 1 steps) |
222 Proof (fix, assms, relabel_steps subst depth 1 steps) |
223 end |
223 end |
224 and relabel_byline subst byline = apfst (relabel_facts subst) byline |
|
225 and relabel_proofs subst depth = map (relabel_proof subst (depth + 1)) |
224 and relabel_proofs subst depth = map (relabel_proof subst (depth + 1)) |
226 in |
225 in |
227 relabel_proof [] 0 |
226 relabel_proof [] 0 |
228 end |
227 end |
229 |
228 |