Skip to content

Commit 22b0fb4

Browse files
committed
[pose]: do not use conversion when matching did not use it
1 parent 3d043bb commit 22b0fb4

1 file changed

Lines changed: 18 additions & 15 deletions

File tree

src/ecHiGoal.ml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -729,23 +729,26 @@ let process_delta ~und_delta ?target (s, o, p) tc =
729729
with EcEnv.NotReducible -> fp
730730
in
731731

732-
let matches =
733-
try ignore (PT.pf_find_occurence ptenv ~ptn:fp target); true
734-
with PT.FindOccFailure _ -> false
735-
in
732+
begin
733+
match PT.pf_find_occurence ptenv ~ptn:fp target with
734+
| (_, occmode) ->
735+
let p = concretize_form ptenv p in
736+
let fp = concretize_form ptenv fp in
737+
let cpos =
738+
try
739+
FPosition.select_form
740+
~xconv:(if occmode.k_conv then `Conv else `AlphaEq)
741+
~keyed:occmode.k_keyed
742+
hyps o fp target
743+
with InvalidOccurence ->
744+
tc_error !!tc "invalid occurences selector" in
736745

737-
if matches then begin
738-
let p = concretize_form ptenv p in
739-
let fp = concretize_form ptenv fp in
740-
let cpos =
741-
try FPosition.select_form hyps o fp target
742-
with InvalidOccurence ->
743-
tc_error !!tc "invalid occurences selector"
744-
in
746+
let target = FPosition.map cpos (fun _ -> p) target in
747+
t_change ~ri ?target:idtg target tc
745748

746-
let target = FPosition.map cpos (fun _ -> p) target in
747-
t_change ~ri ?target:idtg target tc
748-
end else t_id tc
749+
| exception (PT.FindOccFailure _) ->
750+
t_id tc
751+
end
749752

750753
(* -------------------------------------------------------------------- *)
751754
let process_rewrite1_r ttenv ?target ri tc =

0 commit comments

Comments
 (0)