149 val {induction, rules, tcs} = |
149 val {induction, rules, tcs} = |
150 proof_stage strict cs ss wfs thy |
150 proof_stage strict cs ss wfs thy |
151 {f = f, R = R, rules = rules, |
151 {f = f, R = R, rules = rules, |
152 full_pats_TCs = full_pats_TCs, |
152 full_pats_TCs = full_pats_TCs, |
153 TCs = TCs} |
153 TCs = TCs} |
154 val rules' = map (Drule.export_without_context o ObjectLogic.rulify_no_asm) |
154 val rules' = map (Drule.export_without_context o Object_Logic.rulify_no_asm) |
155 (R.CONJUNCTS rules) |
155 (R.CONJUNCTS rules) |
156 in {induct = meta_outer (ObjectLogic.rulify_no_asm (induction RS spec')), |
156 in {induct = meta_outer (Object_Logic.rulify_no_asm (induction RS spec')), |
157 rules = ListPair.zip(rules', rows), |
157 rules = ListPair.zip(rules', rows), |
158 tcs = (termination_goals rules') @ tcs} |
158 tcs = (termination_goals rules') @ tcs} |
159 end |
159 end |
160 handle U.ERR {mesg,func,module} => |
160 handle U.ERR {mesg,func,module} => |
161 error (mesg ^ |
161 error (mesg ^ |
178 fun solve_eq (th, [], i) = |
178 fun solve_eq (th, [], i) = |
179 error "derive_init_eqs: missing rules" |
179 error "derive_init_eqs: missing rules" |
180 | solve_eq (th, [a], i) = [(a, i)] |
180 | solve_eq (th, [a], i) = [(a, i)] |
181 | solve_eq (th, splitths as (_ :: _), i) = |
181 | solve_eq (th, splitths as (_ :: _), i) = |
182 (writeln "Proving unsplit equation..."; |
182 (writeln "Proving unsplit equation..."; |
183 [((Drule.export_without_context o ObjectLogic.rulify_no_asm) |
183 [((Drule.export_without_context o Object_Logic.rulify_no_asm) |
184 (CaseSplit.splitto splitths th), i)]) |
184 (CaseSplit.splitto splitths th), i)]) |
185 (* if there's an error, pretend nothing happened with this definition |
185 (* if there's an error, pretend nothing happened with this definition |
186 We should probably print something out so that the user knows...? *) |
186 We should probably print something out so that the user knows...? *) |
187 handle ERROR s => |
187 handle ERROR s => |
188 (warning ("recdef (solve_eq): " ^ s); map (fn x => (x,i)) splitths); |
188 (warning ("recdef (solve_eq): " ^ s); map (fn x => (x,i)) splitths); |