Skip to content

Commit f29c99f

Browse files
committed
ecReduction: restore main's reduce_head Fapp(Fop) dispatch ordering
The deploy-tc rewrite of `reduce_head`'s `Fapp(Fop p, args)` case used `find_map_opt` over `[user; delta; tc]` after `reduce_logic`, catching only `NotRed NoHead` from each callback. This subtly differs from main when `reduce_user_gen` succeeds: with the new layout, head reduction fires of_realI on `of_reald (Real.inv X)`, then immediately delta- unfolds the resulting `Rp.inv (of_reald X)` back to `of_reald (Real.inv (to_real (of_reald X)))` — looping forever in the RedTbl-memoized `whnf` driver because each step produces a fresh form. Restoring main's ordering — try logic, then user_gen, and only fall through to delta+tc when *both* raised `NoHead` — short-circuits the loop in the cases that previously hung (split's lazy_match calls during `auto`). Also drops the file_exclude workaround that masked the symptom in three ehoare examples; they all run end-to-end on the deploy-tc test runner again.
1 parent 40c1cad commit f29c99f

2 files changed

Lines changed: 8 additions & 18 deletions

File tree

config/tests.config

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,6 @@ exclude = theories/prelude
99
[test-examples]
1010
okdirs = !examples
1111
exclude = examples/MEE-CBC examples/old examples/old/list-ddh !examples/incomplete examples/to-port !examples/tcstdlib !examples/typeclasses
12-
# TODO(deploy-tc): the three excluded ehoare examples expose a runaway
13-
# in cbv simplification when [auto.] runs t_progress on a non-PHL
14-
# subgoal involving xreal. The of_realI hint-simplify rule fires
15-
# repeatedly on cycling forms (~5 distinct hash tags) — disabling
16-
# of_realI removes the loop. Disabling [delta_tc] in full_red does
17-
# not help; the loop also persists with the merge sharing fixes
18-
# (see [Substitution: preserve physical sharing ...] commit).
19-
# adversary.ec / qselect.ec fail earlier on smt() under -script -no-eco.
20-
file_exclude = */ehoare/random_boolean_matrix.ec */ehoare/adversary.ec */ehoare/qselect/qselect.ec
2112

2213
[test-mee-cbc]
2314
okdirs = examples/MEE-CBC

src/ecReduction.ml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,15 +1116,14 @@ let reduce_head simplify ri env hyps f =
11161116
; reduce_tc ri env ]
11171117

11181118
| Fapp ({ f_node = Fop (p, _); }, args) -> begin
1119-
try
1120-
reduce_logic ri env hyps f p args
1121-
with NotRed _ ->
1122-
oget ~exn:needsubterm @@
1123-
List.find_map_opt
1124-
(fun cb -> try Some (cb f) with NotRed NoHead -> None)
1125-
[ reduce_user_gen simplify ri env hyps
1126-
; reduce_delta ri env
1127-
; reduce_tc ri env ]
1119+
try reduce_logic ri env hyps f p args
1120+
with NotRed kind1 ->
1121+
try reduce_user_gen simplify ri env hyps f
1122+
with NotRed kind2 ->
1123+
if kind1 = NoHead && kind2 = NoHead then
1124+
(try reduce_delta ri env f
1125+
with NotRed NoHead -> reduce_tc ri env f)
1126+
else raise needsubterm
11281127
end
11291128

11301129
| Ftuple _ -> begin

0 commit comments

Comments
 (0)