Skip to content

Commit

Permalink
When rewriting in the local env, do not fail on identity rewriting
Browse files Browse the repository at this point in the history
fix #463
  • Loading branch information
strub authored and bgregoir committed Nov 8, 2023
1 parent ff7b698 commit 9fd429a
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/ecLowGoal.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1606,13 +1606,16 @@ let t_rewrite
RApi.close tc (VRewrite (hd, rwpt));
RApi.tcenv_of_rtcenv tc

| Some (h : ident) ->
let hyps = oget (LDecl.hyp_convert h (fun _ _ -> tgfp) (RApi.tc_hyps tc)) in
let hd = RApi.newgoal tc ~hyps (RApi.tc_goal tc) in
let rwpt = { rpt_proof = pt; rpt_occrs = pos; rpt_lc = Some h; } in
| Some (h : ident) -> begin
match LDecl.hyp_convert h (fun _ _ -> tgfp) (RApi.tc_hyps tc) with
| Some hyps ->
let hd = RApi.newgoal tc ~hyps (RApi.tc_goal tc) in
let rwpt = { rpt_proof = pt; rpt_occrs = pos; rpt_lc = Some h; } in
RApi.close tc (VRewrite (hd, rwpt))

RApi.close tc (VRewrite (hd, rwpt));
RApi.tcenv_of_rtcenv tc
| None -> ()
end;
RApi.tcenv_of_rtcenv tc

(* -------------------------------------------------------------------- *)
let t_rewrite_hyp ?xconv ?mode ?donot (id : EcIdent.t) pos (tc : tcenv1) =
Expand Down

0 comments on commit 9fd429a

Please sign in to comment.