1225 | fill _ = NONE; |
1225 | fill _ = NONE; |
1226 val (rules, procs) = get_data thy; |
1226 val (rules, procs) = get_data thy; |
1227 val proof = rewrite_prf fst (rules, K fill :: procs) proof0; |
1227 val proof = rewrite_prf fst (rules, K fill :: procs) proof0; |
1228 in PBody {oracles = oracles, thms = thms, proof = proof} end; |
1228 in PBody {oracles = oracles, thms = thms, proof = proof} end; |
1229 |
1229 |
|
1230 fun fulfill_proof_future _ [] body = Future.value body |
|
1231 | fulfill_proof_future thy promises body = |
|
1232 Future.fork_deps (map snd promises) (fn () => |
|
1233 fulfill_proof thy (map (apsnd Future.join) promises) body); |
|
1234 |
1230 |
1235 |
1231 (***** theorems *****) |
1236 (***** theorems *****) |
1232 |
1237 |
1233 fun thm_proof thy name hyps prop promises body = |
1238 fun thm_proof thy name hyps prop promises body = |
1234 let |
1239 let |
1241 |
1246 |
1242 val proof0 = |
1247 val proof0 = |
1243 if ! proofs = 2 then |
1248 if ! proofs = 2 then |
1244 #4 (shrink_proof thy [] 0 (rew_proof thy (fold_rev implies_intr_proof hyps prf))) |
1249 #4 (shrink_proof thy [] 0 (rew_proof thy (fold_rev implies_intr_proof hyps prf))) |
1245 else MinProof; |
1250 else MinProof; |
1246 |
1251 val body0 = PBody {oracles = oracles0, thms = thms0, proof = proof0}; |
1247 fun new_prf () = (serial (), name, prop, |
1252 |
1248 Future.fork_deps (map snd promises) (fn () => |
1253 fun new_prf () = (serial (), name, prop, fulfill_proof_future thy promises body0); |
1249 fulfill_proof thy (map (apsnd Future.join) promises) |
|
1250 (PBody {oracles = oracles0, thms = thms0, proof = proof0}))); |
|
1251 |
|
1252 val (i, name, prop, body') = |
1254 val (i, name, prop, body') = |
1253 (case strip_combt (fst (strip_combP prf)) of |
1255 (case strip_combt (fst (strip_combP prf)) of |
1254 (PThm (i, ((old_name, prop', NONE), body')), args') => |
1256 (PThm (i, ((old_name, prop', NONE), body')), args') => |
1255 if (old_name = "" orelse old_name = name) andalso prop = prop' andalso args = args' |
1257 if (old_name = "" orelse old_name = name) andalso prop = prop' andalso args = args' |
1256 then (i, name, prop, body') |
1258 then (i, name, prop, body') |