Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Add sequence support. #394
This is mostly working, but has four issues that I know of.
To parse these back into sbv, we need to evaluate them. This is doable, but its really surprising to me that sbv has to do this. I would expect normalized results back from z3. Also the representation is ridiculous (this is the best way they could think to represent lists in a lisp?). Perhaps I'm just doing something wrong.
Can you rebase this first? So we can see if it at least passes the current test suite.
Also, I'm a bit concerned that we have Strings and Sequences and there's quite a bit of duplication in between those two. Would be nice to unify them somehow I think; to have one interface to rule them all. (A String then can simply be a Sequence of characters.) Have you considered that kind of a design?
I agree, and I started with more of a unified design: no
I later added a typeclass both strings and sequences are instances of.
However, I found that this class provided no benefit, but sometimes caused typeclass resolution to fail. It also provided very little benefit in terms of code reuse, so I dropped it.
It's also not obvious to me how to share more of the current implementations, since there is
An update on the design: I tried out an idea to remove the
We also remove the
This seems to work, at least as far as I implemented in this sketch. It's not fully complete but I don't forsee any problems.
The downside to this approach is some extra duplication. Any time you might be dealing with a symbolic list is going to require an extra function. Eg:
Additionally, I had to duplicate
So, I'm not sure whether this route is better or worse. Thoughts?
This is now merged to master, with some changes. Some comments; addressing the questions you raised:
I think this addresses all the concerns regarding support for symbolic lists. If you can do some testing on your side, and give it a spin and maybe contribute another example; it'd be ready for release.
Thanks for the nice contribution! It was a great starting point charting out the different design points; really helped me in getting it integrated. Much appreciated.