| Some lazy_term ->
(fun context metasenv ugraph ->
let what, metasenv, ugraph = lazy_term context metasenv ugraph in
- ProofEngineReduction.unfold ~what, metasenv, ugraph)
+ let unfold ctx t =
+ try
+ ProofEngineReduction.unfold ~what ctx t
+ with
+ (* Not what we would like to have; however, this is required
+ right now for the case of a definition in the context:
+ if it works only in the body (or only in the type), that should
+ be accepted *)
+ ProofEngineTypes.Fail _ -> t
+ in
+ unfold, metasenv, ugraph)
in
mk_tactic (reduction_tac ~reduction ~pattern)