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

Storing substitutions in memory #2

Open
cameel opened this issue Aug 16, 2020 · 2 comments
Open

Storing substitutions in memory #2

cameel opened this issue Aug 16, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@cameel
Copy link
Collaborator

cameel commented Aug 16, 2020

The current engine assumes that Substitution.Info is in storage but this means that we need to clear the substitutions after every call to Prolog.query(). I think it would be better to store substitutions in memory because we don't really need to persist them between contract calls.

Another disadvantage of having them in storage is that functions that would not otherwise modify contract state cannot be view or pure.

@cameel cameel added the enhancement New feature or request label Aug 16, 2020
@leonardoalt
Copy link
Owner

One way of potentially implementing this is to implement a RB tree data structure and use it in memory.

@cameel
Copy link
Collaborator Author

cameel commented Aug 19, 2020

That would be a good idea for a nice, reusable library if we had templates in Solidity...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants