- [T.Change (st, et, "")]
- | None -> []
-
-let eta_expand n t =
- let ty = C.AImplicit ("", None) in
- let name i = Printf.sprintf "%s%u" expanded_premise i in
- let lambda i t = C.ALambda ("", C.Name (name i), ty, t) in
- let arg i n = T.mk_arel (n - i) (name i) in
- let rec aux i f a =
- if i >= n then f, a else aux (succ i) (comp f (lambda i)) (arg i n :: a)
- in
- let absts, args = aux 0 id [] in
- match Cn.lift 1 n t with
- | C.AAppl (id, ts) -> absts (C.AAppl (id, ts @ args))
- | t -> absts (C.AAppl ("", t :: args))
-
-let appl_expand n = function
- | C.AAppl (id, ts) ->
- let before, after = T.list_split (List.length ts + n) ts in
- C.AAppl ("", C.AAppl (id, before) :: after)
- | _ -> assert false
+ let e = Cn.mk_pattern 0 (T.mk_arel 1 "") in
+ match name with
+ | None -> [T.Change (st, et, None, e, "")]
+ | Some id -> [T.Change (st, et, Some (id, id), e, ""); T.ClearBody (id, "")]