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

Strict patterns and uniqueness #365

Open
Zolmeister opened this issue May 26, 2020 · 1 comment
Open

Strict patterns and uniqueness #365

Zolmeister opened this issue May 26, 2020 · 1 comment
Labels
evolution Modifies code for running the evolution of the model feature New functionality, or change in existing functionality

Comments

@Zolmeister
Copy link

This is perhaps more of a question than a feature.

My initial implementation of SetReplace treated pattern members as unique, and treated the resulting set as a unique set.

e.g. Given
{{1, 2}} -> {{2, 1}, {1, 3}}

These members would match
{1, 2}, {2, 3}, {3, 1}

However these would not
{1, 1}, {2, 2}, {3, 3}

Additionally I deduplicated set members, such that {{1, 1}, {1, 1}} collapses to {{1, 1}}.

I'd like to understand the rationale behind the looseness of the pattern matching and plurality of set members.

@Zolmeister Zolmeister added the feature New functionality, or change in existing functionality label May 26, 2020
@maxitg maxitg added question Further information is requested evolution Modifies code for running the evolution of the model feature New functionality, or change in existing functionality and removed feature New functionality, or change in existing functionality question Further information is requested labels May 26, 2020
@maxitg
Copy link
Owner

maxitg commented May 28, 2020

There is no real justification for either of these. It's just a question of simplicity, and which kind of systems can emulate one another easily.

The pattern members are treated here the same way as the pattern members in Replace, i.e., {1, 1} matches {a_, b_}, similarly, {{1, 2}} -> {{2, 1}, {1, 3}}, which corresponds to {{a_, b_}} :> Module[{c}, {{b, a}, {a, c}}] matches {{1, 1}}.

This also makes it easier to find good initial conditions, as multiple copies of the same self-loop are more likely to match repeatedly than, i.e., the left-hand side of the rule.

As for deduplication, this is related to the question of whether the history of an edge should be used to identify it, see also #146. If we do deduplicate edges, however, it would mean that a single edge could have multiple creator events, which in turn would introduce timelike loops in the causal graph.

I think it could be useful to add options to WolframModel to allow this kind of evolution (i.e., "AllowDuplicateVertices" and "MergeIdenticalEdges"), however, this issue should be split in two, and these are independent features of the evolution.

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 feature New functionality, or change in existing functionality
Projects
None yet
Development

No branches or pull requests

2 participants