Datasets:
Tasks:
Text Generation
Modalities:
Text
Sub-tasks:
language-modeling
Languages:
English
Size:
100K - 1M
License:
File size: 1,048 Bytes
4365a98 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
namespace tactic
meta def prove_goal_asyncI (tac : tactic unit) : tactic unit := do
ctx β local_context, unfreezing (revert_lst ctx),
tgt β target, tgt β instantiate_mvars tgt,
env β get_env, tgt β return $ env.unfold_untrusted_macros tgt,
when tgt.has_meta_var (fail "goal contains metavariables"),
params β return tgt.collect_univ_params,
lemma_name β new_aux_decl_name,
proof β run_async (do
goal_meta β mk_meta_var tgt,
set_goals [goal_meta],
ctx.mmap' (Ξ»c, unfreezing (intro c.local_pp_name)),
tac,
proof β instantiate_mvars goal_meta,
proof β return $ env.unfold_untrusted_macros proof,
when proof.has_meta_var $ fail "async proof failed: contains metavariables",
return proof),
add_decl $ declaration.thm lemma_name params tgt proof,
exact (expr.const lemma_name (params.map level.param))
namespace interactive
open interactive.types
/-- Proves the first goal asynchronously as a separate lemma. -/
meta def asyncI (tac : itactic) : tactic unit :=
prove_goal_asyncI tac
end interactive
end tactic
|