feat(kernel/expr): add mk_app that takes a list of arguments
This commit is contained in:
parent
950f9ff79f
commit
92a7c38260
2 changed files with 7 additions and 0 deletions
|
@ -406,6 +406,12 @@ expr mk_app(unsigned num_args, expr const * args, tag g) {
|
|||
return mk_app(mk_app(args[0], args[1], g), num_args - 2, args+2, g);
|
||||
}
|
||||
|
||||
expr mk_app(expr const & f, list<expr> const & args, tag g) {
|
||||
buffer<expr> _args;
|
||||
to_buffer(args, _args);
|
||||
return mk_app(f, _args, g);
|
||||
}
|
||||
|
||||
expr mk_rev_app(expr const & f, unsigned num_args, expr const * args, tag g) {
|
||||
expr r = f;
|
||||
unsigned i = num_args;
|
||||
|
|
|
@ -438,6 +438,7 @@ inline expr mk_app(buffer<expr> const & args, tag g = nulltag) { return mk_app(a
|
|||
inline expr mk_app(expr const & f, buffer<expr> const & args, tag g = nulltag) {
|
||||
return mk_app(f, args.size(), args.data(), g);
|
||||
}
|
||||
expr mk_app(expr const & f, list<expr> const & args, tag g = nulltag);
|
||||
expr mk_rev_app(expr const & f, unsigned num_args, expr const * args, tag g = nulltag);
|
||||
expr mk_rev_app(unsigned num_args, expr const * args, tag g = nulltag);
|
||||
inline expr mk_rev_app(buffer<expr> const & args, tag g = nulltag) { return mk_rev_app(args.size(), args.data(), g); }
|
||||
|
|
Loading…
Reference in a new issue