Setup
Setup
I have deleted the C++ code from the SetReplace repository, and compiled the paclet without it to avoid any implication that it could be causing the weed.
In[]:=
<<SetReplace`
Verify C++ code is not available:
In[]:=
WolframModel[{{1,2}}{{1,3},{1,3},{3,2}},{{1,1}},4,Method"LowLevel"]
Out[]=
WolframModel[{{1,2}}{{1,3},{1,3},{3,2}},{{1,1}},4,MethodLowLevel]
In[]:=
SetOptions[WolframModel,Method"Symbolic"];
In[]:=
allrules32=;
In[]:=
IntersectionRule[s1_->list1_,s2_->list2_]/;!IntersectingQ[list1,list2]:={}
In[]:=
IntersectionRule[s1_->list1_,s2_->list2_]/;(SubsetQ[list1,list2]&&!SubsetQ[list2,list1]):={DirectedEdge[s1,s2]}
In[]:=
IntersectionRule[s1_->list1_,s2_->list2_]/;(SubsetQ[list2,list1]&&!SubsetQ[list1,list2]):={DirectedEdge[s2,s1]}
In[]:=
IntersectionRule[s1_->list1_,s2_->list2_]/;Sort[list1]===Sort[list2]:={DirectedEdge[s1,s2],DirectedEdge[s2,s1]}
In[]:=
IntersectionRule[s1_->list1_,s2_->list2_]/;(IntersectingQ[list1,list2]&&!SubsetQ[list1,list2]&&!SubsetQ[list2,list1]):={UndirectedEdge[s1,s2]}
In[]:=
getWolframModelCausallyConnectedRegionsAt[rules_,initialCondition_,initialTime_Integer,finalTime_Integer]:=Module[{newEventsInitialCausalGraph,newEventsFinalCausalGraph,causalGraph,initialEventsList,previousEventsList,newEventsList},newEventsInitialCausalGraph=WolframModel[rules,initialCondition,finalTime-1,"CausalGraph"];newEventsFinalCausalGraph=WolframModel[rules,initialCondition,finalTime,"CausalGraph"];initialEventsList=VertexList[WolframModel[rules,initialCondition,initialTime,"CausalGraph"]];previousEventsList=VertexList[WolframModel[rules,initialCondition,initialTime-1,"CausalGraph"]];newEventsList=Complement[VertexList[newEventsFinalCausalGraph],VertexList[newEventsInitialCausalGraph]];#->Intersection[newEventsList,VertexOutComponent[newEventsFinalCausalGraph,#]]&/@Complement[initialEventsList,previousEventsList]]
We know SimpleGraph causes crashes, and replacing it here with a custom version does appear to resolve the crash as well.
So, the working hypothesis is that this is the same SimpleGraph weed as #.
In[]:=
simpleGraph[graph_]:=Graph[VertexList[graph],Union[EdgeList[graph]/.{e_UndirectedEdgeSort[e],(UndirectedEdge|DirectedEdge)[v_,v_]Nothing}]]
In[]:=
WMCausalConnectionGraphAt[rule_,init_,ti_,tf_]:=With[{u=getWolframModelCausallyConnectedRegionsAt[rule,init,ti,tf]},simpleGraph[Flatten[Outer[IntersectionRule,u,u,1]]]]
In[]:=
WMCausalConnectionSummaryAt[rule_,init_,ti_,tf_]:=With[{g=WMCausalConnectionGraphAt[rule,init,ti,tf]},Fold[VertexContract[#1,#2]&,g,ConnectedComponents[g]]]
Weedy...
Weedy...
Still crashing even with C++ SetReplace code removed.
In[]:=
CanonicalGraph[WMCausalConnectionGraphAt[#,Automatic,5,10]]&/@{{{1,1},{1,1}}{{1,2},{2,3},{4,2}},{{1,1},{1,1}}{{1,2},{2,3},{4,3}},{{1,1},{1,1}}{{1,2},{3,2},{4,2}},{{1,1},{1,1}}{{2,1},{2,1},{1,2}},{{1,1},{1,1}}{{2,1},{2,1},{2,1}},{{1,1},{1,1}}{{2,2},{1,2},{1,2}},{{1,1},{1,1}}{{2,2},{2,1},{1,1}},{{1,1},{1,1}}{{2,2},{2,1},{1,2}},{{1,1},{1,1}}{{2,2},{2,1},{2,1}},{{1,1},{1,1}}{{2,2},{2,2},{1,2}},{{1,1},{1,1}}{{2,2},{2,2},{2,1}}}
Out[]=
Not needed
Not needed
In[]:=
CanonicalGraph[WMCausalConnectionSummaryAt[#,Automatic,5,10]]&/@{{{1,1},{1,1}}{{1,2},{2,3},{4,2}},{{1,1},{1,1}}{{1,2},{2,3},{4,3}},{{1,1},{1,1}}{{1,2},{3,2},{4,2}},{{1,1},{1,1}}{{2,1},{2,1},{1,2}},{{1,1},{1,1}}{{2,1},{2,1},{2,1}},{{1,1},{1,1}}{{2,2},{1,2},{1,2}},{{1,1},{1,1}}{{2,2},{2,1},{1,1}},{{1,1},{1,1}}{{2,2},{2,1},{1,2}},{{1,1},{1,1}}{{2,2},{2,1},{2,1}},{{1,1},{1,1}}{{2,2},{2,2},{1,2}},{{1,1},{1,1}}{{2,2},{2,2},{2,1}}}
Out[]=