C++/Wolfram Language package for exploring set and graph rewriting systems
This release introduces "MaxDestroyerEvents"
stopping condition to WolframModel
. It allows one to generate partial multihistories (local multiway systems), which are intermediate between "GlobalMultiway"
and "MultiwaySpacelike"
event selection functions:
In[] := WolframModel[
{{1, 2}, {2, 3}} -> {{1, 3}},
Partition[Range[10], 2, 1],
<|"MaxDestroyerEvents" -> 2|>,
"EventSelectionFunction" -> "MultiwaySpacelike"][
"ExpressionsEventsGraph", VertexLabels -> Automatic]
Kudos to @daneelsan for implementing this feature!
This release introduces CausalDensityDimension
which allows one to estimate Myrheim-Meyer dimension of causal graphs:
Needs["GeneralUtilities`"];
dimensionsPlot[rule_, init_, generationCount_, eventOrderingFunction_, sampleSize_] := ModuleScope[
history = WolframModel[rule, init, generationCount, "EventOrderingFunction" -> eventOrderingFunction];
eventRangesForGenerations = # + {1, 0} & /@ Partition[Accumulate @ history["GenerationEventsCountList"], 2, 1];
causalGraph = history["CausalGraph"];
dimensionsForGenerations = Join[
{Missing[]},
MeanAround /@
ParallelMap[CausalDensityDimension[causalGraph, {1, #}] &,
RandomSample[#, UpTo[sampleSize]] & /@ Range @@@ eventRangesForGenerations,
{2}]];
ListPlot[dimensionsForGenerations, PlotRange -> All, Frame -> True, FrameLabel -> {"Generations", "Dimension"}]
];
In[] := dimensionsPlot[
{{1, 2, 3}, {4, 3, 5}} -> {{6, 3, 7}, {6, 1, 2}, {3, 4, 1}}, {{1, 1, 1}, {1, 1, 1}}, 60, Automatic, 30]
In other news:
"FeatureAssociation"
property allows one to extract an association with named features (more work still needs to be done on the features themselves).WolframPhysicsProjectStyleData
is now renamed to SetReplaceStyleData
. The old name still works for backwards compatibility.Thanks to @SantiagoGiner, @mrektor, and @daneelsan for contributing to this release!
This release introduces:
AcyclicGraphTake
function that allows one to easily take "causal diamonds" between two vertices of a DAG:In[] := With[{
graph = WolframModel[
{{{1, 2}, {1, 3}, {1, 4}} -> {{2, 2}, {2, 5}, {3, 2}, {3, 4}, {4, 5}}}, {{1, 1}, {1, 1}, {1, 1}}, 15][
"CausalGraph", VertexStyle -> LightGray, EdgeStyle -> Gray]},
HighlightGraph[graph, AcyclicGraphTake[graph, {4, 268}]]
]
[❗Breaking change❗] VertexCoordinateRules
is now renamed to VertexCoordinates
to be consistent with Wolfram Language conventions.
Syntax highlighting is improved for options.
Thanks to @SantiagoGiner, @daneelsan and @aokellermann for contributing to this release!
In this release, we focused on the improvements to the development process, testing, and refactoring.
Some notable changes are:
WolframModelPlot
is now renamed back to HypergraphPlot
. The old name still works for backward compatibility.If you are a developer, here are some of the improvements to the workflow:
Get[FileNameJoin[{$SetReplaceRoot, "Kernel", "init.m"}]]
We also started working on a feature extractor that would allow one to use machine learning functions with Wolfram models. The work on that is in the early stage of development.
Kudos to @mrektor, @taliesinb, @daneelsan, and @aokellermann for contributing to this release!
We now have RandomHypergraph
! You can either specify a signature or a single number to vary the arities randomly:
In[] := WolframModelPlot @ RandomHypergraph[1000]
Thanks to @daneelsan and @taliesinb for contributing to this release!
This release introduces HypergraphToGraph
. It can convert ordered hypergraphs to graphs in multiple ways, either preserving distances or in a lossless way:
In[] := Graph3D @ HypergraphToGraph[
WolframModel[
{{1, 2, 2}, {3, 4, 5}} -> {{5, 6, 6}, {7, 2, 5}, {8, 2, 6}, {2, 1, 3}}, Automatic, 50, "FinalState"],
"StructurePreserving"]
Thanks to that lossless conversion, we now also have IsomorphicHypergraphQ
.
Also, we added "MultiwayQ"
property, which can tell you if a given evolution contains any multiway branching.
Kudos to @wawo9193, @daneelsan, and @taliesinb for contributing to this release!
In addition to improvements to stability and performance, we have introduced the IndexHypergraph
function:
In[] := IndexHypergraph[{{a, b, c}, {b, d, e}, {c, f, g}}]
Out[] = {{1, 2, 3}, {2, 4, 5}, {3, 6, 7}}
Also, you can now pass evolution objects directly to RulePlot
:
Thanks to @daneelsan and @aokellermann for contributing to this release!
In this release, we focused on stability, performance, and streamlining SetReplace for our users and developers:
We introduced Subhypergraph
and WeakSubhypergraph
functions.
In[] := With[{
evolution = WolframModel[{{1, 2}, {2, 3}} -> {{4, 2}, {4, 1}, {2, 1}, {3, 4}}, Automatic, Automatic]},
evolution["FinalStatePlot",
EdgeStyle -> LightGray,
GraphHighlight -> WeakSubhypergraph[evolution["FinalState"], Range[9, 16]]]]
We have a new event ordering function called "Any"
, which generates an undefined evolution order. There is not much use for it yet, but it paves the road for some powerful optimizations in the future.
You can now use VertexLabels -> "Index"
in "ExpressionsEventsGraph"
that displays the indices of events and expressions in a much more compact way than VertexLabels -> "Name"
.
We also did some weed whacking:
./build.wls
script should no longer fail if the repository is located under a symbolic link.
Vertex names which are themselves lists now work correctly in WolframModel
.
Huge thanks to @aokellermann and @daneelsan for contributing to this release!
SetReplace is now fully compatible with Wolfram Language version 12.2.
If you were running 12.2 and were having issues with WolframModelPlot
, these are now resolved.
This release introduces event deduplication. If two events have the same set of inputs and the outputs identical up to the renaming of new atoms, they can now be deduplicated using "EventDeduplication" -> "SameInputSetIsomorphicOutputs"
.
In[] := WolframModel[{{1, 2}, {1, 3}} -> {{1, 2}, {1, 4}, {2, 4}, {3,
4}}, {{1, 1}, {1, 1}}, 3,
"EventSelectionFunction" -> "MultiwaySpacelike",
"EventDeduplication" ->
"SameInputSetIsomorphicOutputs"]["ExpressionsEventsGraph",
GraphLayout -> "SpringElectricalEmbedding"]
Also, the weed where the output graph's size would reset after each re-evaluation is now fixed.