Wolfram Research

Function Repository Resource:

RandomWolframModel

Source Notebook

Generate a random canonical Wolfram model rule with a particular signature

Contributed by: Stephen Wolfram & Max Piskunov

ResourceFunction["RandomWolframModel"][signature]

generates a random Wolfram model rule with the specified signature.

ResourceFunction["RandomWolframModel"][signature,n]

generates a random Wolfram model using at most n distinct elements.

Details and Options

The signature is given in the form lhsrhs, where each lhs or rhs is a list of pairs {count,arity} where count gives the number of hyperedges of specified arity.
ResourceFunction["RandomWolframModel"] gives a canonical form of each rule it returns.

Examples

Basic Examples

Generate a random 23 32 Wolfram model rule:

In[1]:=
ResourceFunction["RandomWolframModel"][{{2, 3}} -> {{3, 2}}]
Out[1]=

Generate a 23 32 Wolfram model rule, restricting to two distinct elements:

In[2]:=
ResourceFunction["RandomWolframModel"][{{2, 3}} -> {{3, 2}}, 2]
Out[2]=

Generate a random 23 32 Wolfram model rule:

In[3]:=
ResourceFunction["RandomWolframModel"][{{2, 3}} -> {{3, 2}}]
Out[3]=

Generate a random 23224382 with at most 12 elements:

In[4]:=
ResourceFunction[
 "RandomWolframModel"][{{2, 3}, {2, 2}} -> {{4, 3}, {8, 2}}, 12]
Out[4]=

Generate a random rule containing two different transformations:

In[5]:=
ResourceFunction[
 "RandomWolframModel"][{{{2, 3}} -> {{3, 2}}, {{2, 4}} -> {{3, 1}}}]
Out[5]=

Possible Issues

By default (Automatic connectedness), disconnected right-hand sides can be generated as long as all of their components are still connected to the left-hand side:

In[6]:=
SeedRandom[38]; RulePlot[
 ResourceFunction["WolframModel"][
  ResourceFunction["RandomWolframModel"][{{2, 3}} -> {{3, 3}}, 7]]]
Out[6]=

Note that evolution may still be connected in this case if there are other edges connecting vertices on the left-hand side:

In[7]:=
ResourceFunction["WolframModel"][SeedRandom[38]; ResourceFunction["RandomWolframModel"][{{2, 3}} -> {{3, 3}}, 7], {{1, 1, 1}, {1, 1, 1}}, 5, "StatesPlotsList"]
Out[7]=

Resource History

Related Resources

AuthorNotes

In its present form, this will not correctly weight all canonical forms the same.

License Information