Skip to content

Commit 1e3b2ba

Browse files
authored
fix duplication of typing goals when there is no proof script (#1383)
fix #1382
1 parent 4552ab9 commit 1e3b2ba

1 file changed

Lines changed: 17 additions & 14 deletions

File tree

src/handle/command.ml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -579,20 +579,23 @@ let get_proof_data : compiler -> sig_state -> p_command -> cmd_output =
579579
(* Create the proof state. *)
580580
let pdata_state =
581581
let proof_goals = add_goals_of_problem p [] in
582-
if p_sym_def then
583-
(* Add a new focused goal and refine on it. *)
584-
let m = LibMeta.fresh p a 0 in
585-
let g = Goal.of_meta m in
586-
let ps = {proof_name = p_sym_nam; proof_term = Some m;
587-
proof_goals = g :: proof_goals} in
588-
match pt, t with
589-
| Some pt, Some t ->
590-
let gt = match g with Typ gt -> gt | _ -> assert false in
591-
Tactic.tac_refine ~check:false pt.pos ps gt proof_goals p t.elt
592-
| _, _ -> Tactic.tac_solve pos ps
593-
else
594-
let ps = {proof_name = p_sym_nam; proof_term = None; proof_goals} in
595-
Tactic.tac_solve pos ps
582+
let ps =
583+
if p_sym_def then
584+
(* Add a new focused goal for the definition. *)
585+
let m = LibMeta.fresh p a 0 in
586+
let proof_goals =
587+
match t with
588+
| Some t ->
589+
(* Refine the focused goal with the given term. *)
590+
LibMeta.set p m (bind_mvar [||] t.elt);
591+
proof_goals
592+
| _ -> Goal.of_meta m :: proof_goals
593+
in
594+
{proof_name = p_sym_nam; proof_term = Some m; proof_goals}
595+
else
596+
{proof_name = p_sym_nam; proof_term = None; proof_goals}
597+
in
598+
Tactic.tac_solve pos ps
596599
in
597600
if p_sym_prf = None && not (finished pdata_state) then wrn pos
598601
"Some metavariables could not be solved: a proof must be given";

0 commit comments

Comments
 (0)