Skip to content

Commit a66989b

Browse files
committed
Fix search to resolve abbreviations by expanding their body
Previously, searching for a bare abbreviation name (e.g. `search mu1`) would wrap the abbreviation body in a lambda over its arguments, producing a pattern like `fun d x => mu d (pred1 x)`. No axiom contains such a lambda as a subformula, so the search always returned no results. Instead, register the abbreviation arguments as pattern variables and use the body directly as the search pattern. This correctly matches axioms containing the expanded form of the abbreviation.
1 parent fe9fba3 commit a66989b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/ecScope.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2684,11 +2684,11 @@ end
26842684
let es = e_subst tip in
26852685
let xs = List.map (snd_map (ty_subst tip)) nt.ont_args in
26862686
let bd = EcFol.form_of_expr (es nt.ont_body) in
2687-
let fp = EcFol.f_lambda (List.map (snd_map EcFol.gtty) xs) bd in
2687+
List.iter (fun (id, ty) -> ps := Mid.add id ty !ps) xs;
26882688

2689-
match fp.f_node with
2689+
match bd.f_node with
26902690
| Fop (pf, _) -> (pf :: paths, pts)
2691-
| _ -> (paths, (ps, ue, fp) ::pts)
2691+
| _ -> (paths, (ps, ue, bd) ::pts)
26922692
end
26932693

26942694
| _ -> (p :: paths, pts) in

0 commit comments

Comments
 (0)