elliottt / easy-smt

Easy SMT solver interaction
Apache License 2.0
24 stars 4 forks source link

Request: `and_many` etc to work on single-element vectors #8

Closed avanhatt closed 1 year ago

avanhatt commented 1 year ago

Right now, if you pass a single-element vector to and_many, like:

s.and_many(vec![s.true_()]);

It fails with:

thread '<unnamed>' panicked at 'assertion failed: args.len() >= 3', /Users/avh/.cargo/git/checkouts/easy-smt-fe5539f05befcda8/18df991/src/context.rs:631:5

A common pattern is to dynamically build a list of expressions then call one of these variadic helpers, so it would be nice to not have to special case on a single element each time. The library could instead return the single value (at least for the helpers where that is correct).

elliottt commented 1 year ago

That seems reasonable to me! I can put together a PR this evening.