Releases: maxitg/SetReplace
Spacelike Multiway System
This release introduces the spacelike multiway system. This is the "normal" kind of a multiway system that only matches spacelike separated expressions. It can be used with an option "EventSelectionFunction" -> "MultiwaySpacelike"
.
In[] := WolframModel[{{1, 1, 2}, {3, 4, 2}} ->
{{4, 4, 1}, {5, 1, 4}, {5, 3, 2}}, {{1, 1, 1}, {2, 3, 1}}, 6,
"EventSelectionFunction" ->
"MultiwaySpacelike"]["ExpressionsEventsGraph"]
In addition, the evolution object now has "ExpressionsSeparation"
property, which can tell you if a pair of expressions is timelike, spacelike, or branchlike separated.
You can also now use conditions spanning multiple input expressions in pattern rules.
Finally, we made improvements to libSetReplace and the installation script.
Thanks to @aokellermann and @taliesinb for contributing to this release!
WolframPhysicsProjectStyleData Improvements
This release makes using WolframPhysicsProjectStyleData
a bit easier. Many graphs now have a "Function"
property which, if passed a graph, would restyle it. No need to manually search for relevant properties anymore.
In[] := WolframPhysicsProjectStyleData["CausalGraph", "Function"]@
Graph[{1 -> 2, 1 -> 2, 1 -> 3, 1 -> 3, 2 -> 4, 2 -> 4, 2 -> 5,
2 -> 6, 3 -> 5, 3 -> 6}]
Partial generations trimming fix
This release fixes the incorrect trimming of partial generations that could occur if using non-standard event ordering functions. As an example, this caused issues if using Automatic
steps with, i.e., "EventOrderingFunction" -> "Random"
.
It also introduces "GenerationEdgeIndices"
property, which allows one to extract indices for edges at a particular generation. This complements the previously introduced "StateEdgeIndicesAfterEvent"
, and is useful for precisely distinguishing between edges with identical atoms but different histories.
We also made some small improvements to the low-level evolution code.
Kudos to @aokellermann for contributing to this release.
Match-All Local Multiway System
This release introduces local multiway systems. Specifically, the match-all system, which indiscriminately matches spacelike, branchlike, and timelike expressions. It can be accessed by setting "EventSelectionFunction" -> None
.
To accommodate multiway systems, the format for the evolution object has changed as well and is now events- rather than expressions-based.
We have also introduced "ExpressionsEventsGraph"
. It is a superset of a "CausalGraph"
, which also has vertices corresponding to expressions in addition to event-vertices. It makes it very easy to see multiway branching:
Finally, we optimized the multi-rule evolution, in which different rules now automatically run on different CPU cores.
Shoutout to @sw1sh, @phcerdan, and @aokellermann for contributing, and to @ToddRowland30 and @delaix for reviewing contributions to this release!
Evolution performance improvements
This release primarily focused on performance and stability improvements to libSetReplace
, the C++ implementation of the Wolfram model.
Specifically, evolution performance increased up to 24% (1.3x) for some rules:
Single-input rule 19.42 ± 0.20 %
Medium rule 11.83 ± 0.22 %
Sequential rule 10.14 ± 0.29 %
Large rule 10.82 ± 0.33 %
Exponential-match-count rule 24.08 ± 0.24 %
CA emulator 0.71 ± 0.13 %
We also fixed "VertexNamingFunction"
for the cases where non-atom non-list edges appear as set elements. Last but not least, we made significant under-the-hood improvements, such as performance testing and code formatting tools.
Big thanks for @aokellermann, @phcerdan, and @KorKozan for contributing to this release!
Physics Project Launch
This is the release containing all of the functionality for the Wolfram Physics Project. There are many new features. Some of the most significant ones include:
SetSubstitutionSystem
is renamed toWolframModel
, and can now accept properties directly.SetSubstitutionEvolution
is renamed toWolframModelEvolutionObject
, and now has many more properties.HypergraphPlot
is renamed toWolframModelPlot
, and it now uses"Polygons"
rendering by default, which does not rely on color.RulePlot
ofWolframModel
can now visualize rules.- New utility functions:
WolframModelRuleValue
,GeneralizedGridGraph
,HypergraphAutomorphismGroup
,HypergraphUnifications
, andWolframPhysicsProjectStyleData
. - We now have comprehensive documentation in README, and contributing guidelines.
[alpha] Wolfram Summer School 2019
This release contains the unmodified changes implemented during the Wolfram Summer School 2019 (which is a hackaton-like event). Thus, it is significantly less stable than a normal release, and is incomplete, as argument checks, unit tests, usage messages, etc. are missing. Only guaranteed to work with the final project file of the summer school as a proof of concept.
New features
- New symbol
SetSubstitutionSymbol
is implemented, which performs an entire layer of replacements at a time (likeSubstitutionSystem
), and yields aSetSubstitutionEvolution
object as an output. SetSubstitutionEvolution
stores the data about the entire evolution of the system, its causal network, and some other metadata.- Sets of different generations can be accessed with
SetSubstitutionEvolution[...][k]
, wherek = 0
corresponds to initial condition,k = 1
to applying substitution once to every non-overlapping network in the initial condition, etc. - Causal network can be obtained as
SetSubstitutionEvolution[...]["CausalNetwork"]
. - If causal network is a tree graph that is a good sufficient condition for the system to be in complexity class 1 or 2 (nesting or simpler). Thus,
SetSubstitutionEvolution[...]["NestingQ"]
will check for that. - If
SetSubstitutionSystem
is supplied with option"CheckConfluence" -> False
, then evaluatingSetSubstitutionEvolution[...]["ConfluentQ"]
will either yieldFalse
if the evolution is not confluent, orMissing[...]
otherwise. Sufficient condition for confluence is not implemented. - New symbol
SetCases
which returns all subsets matching a particular pattern.
Breaking changes
SetReplace
now evaluates substitution events in a different order. Specifically, it applies replacements generation-by-generation instead of prioritizing earlier rules, so for instance,
In[] := SetReplace[{0, 1, 2}, {{0, 2} -> x, {1} -> y}]
Out[] = {0, 2, y}
- Only macOS version is available at the moment. Windows and Linux version can probably be built from the source code possibly with minor changes to C++ code.
Initial release
Features
- C++ and Wolfram Language implementations of
SetReplace
. - Support for Linux, macOS, and Windows.
HypergraphPlot
to visualize sets of lists.- Wolfram Language implementations of
SetReplaceAll
,SetReplaceList
,SetReplaceFixedPoint
, andSetReplaceFixedPointList
. - Shorthand rule specification with
FromAnonymousRules
.
Known issues
- There is no Wolfram-style documentation as of right now. The only documentation is in README.
- C++ implementation is only available for
SetReplace
, not other functions, such asSetReplaceAll
. - C++ implementation only works for local rules and is slow for graphs with large vertex degrees.
- Wolfram Language and C++ implementations name newly created vertices differently.
- There is no way to specify the order of rule applications.
Installation
- Evaluate
PacletInstall["path_to_SetReplace-0.1.paclet"]
. - Evaluate
<<SetReplace`
after every restart of Wolfram Kernel.