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

Use SubsetReplace for Symbolic implementation #401

Open
maxitg opened this issue Aug 31, 2020 · 0 comments
Open

Use SubsetReplace for Symbolic implementation #401

maxitg opened this issue Aug 31, 2020 · 0 comments
Labels
evolution Modifies code for running the evolution of the model optimization Does not change functionality but makes code faster wolfram language Requires Wolfram Language implementation

Comments

@maxitg
Copy link
Owner

maxitg commented Aug 31, 2020

The problem

Wolfram Language (Method -> "Symbolic") implementation is currently quite complex and inefficient. Since it was introduced, however, a new Wolfram Language version was released, which now has SubsetReplace. It's more efficient than the current implementation, supports arbitrary WL patterns, and we should use it in the symbolic implementation.

Note, that it is not sufficient to simply use SubsetReplace instead of, say, WolframModel because WolframModel offers more evolution options (such as step limits based on different properties of the states), and analysis tools (such as causal graphs).

Possible solution

Using SubsetReplace should eliminate the need for toNormalRules, however, incorporating it is not as simple as calling it in setReplace$wl because we still need to care about evolution order. SubsetReplace does not offer many options to control evolution, and we will need to find a way around that.

Alternative solutions

We could also modify the C++ implementation to call back Wolfram Kernel and support arbitrary expressions. That would eliminate a lot of code duplication. However, that is also non-trivial to do, and having two independent implementations is useful for testing.

@maxitg maxitg added help wanted Extra attention is needed optimization Does not change functionality but makes code faster evolution Modifies code for running the evolution of the model wolfram language Requires Wolfram Language implementation labels Aug 31, 2020
@daneelsan daneelsan self-assigned this Oct 13, 2020
@maxitg maxitg removed the help wanted Extra attention is needed label Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
evolution Modifies code for running the evolution of the model optimization Does not change functionality but makes code faster wolfram language Requires Wolfram Language implementation
Projects
None yet
Development

No branches or pull requests

2 participants