Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List type in specifications #13

Open
5 of 6 tasks
Calvin-L opened this issue Oct 11, 2017 · 5 comments
Open
5 of 6 tasks

List type in specifications #13

Calvin-L opened this issue Oct 11, 2017 · 5 comments
Assignees

Comments

@Calvin-L
Copy link
Collaborator

Calvin-L commented Oct 11, 2017

Right now specifications can have bags (i.e. multisets) and sets. Cozy can use lists in output implementations, but having lists in specifications would also be useful: often the order of insertion is important. This comes up especially in caches that employ least-recently-used eviction.

Wishlist:

  • List<_> type
  • list indexing xs[i] plus the usual operators (min, empty, ...)
  • list slicing xs[start:end]
  • sorting: sort xs to sort by natural order and sort {\x -> f(x)} xs to sort by another property
  • add_front, add_back, remove_front, and remove_back update operations (we may also want remove to remove an instance of a given element from the list)
  • devise a good state maintenance sketch for lists (seems to be very hard!)
@Calvin-L Calvin-L self-assigned this Oct 17, 2017
@prateekiiest
Copy link

can I work on this issue?

@mernst
Copy link
Member

mernst commented Apr 4, 2018

If you know what to do, then certainly. Please open a pull request with the fix. Thanks!

@izgzhen
Copy link
Collaborator

izgzhen commented Sep 26, 2018

@Calvin-L I will help working out sort method for List type. I guess I need to:

  • define new syntax
  • define semantics in SMT solver
  • define cost model
  • codegen

@mernst
Copy link
Member

mernst commented Oct 25, 2018

@Calvin-L Does "devise a good state maintenance sketch" mean that one exists that is not good, or that none exists? (Also, in what file would that go? In state_maintenance.py? I didn't see anything about lists in there now.)

@Calvin-L
Copy link
Collaborator Author

Currently none exists. As a result, Cozy falls back to the default maintenance sketch, which is to recompute from scratch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants