Function Repository Resource:

EnumerateWolframModelRules

Source Notebook

Enumerate canonical Wolfram model rules with a particular signature

Contributed by: Ed Pegg Jr and Max Piskunov

ResourceFunction["EnumerateWolframModelRules"][signature]

generates a list of all canonical connected Wolfram model rules with the specified signature.

ResourceFunction["EnumerateWolframModelRules"][signature,s]

allows only up to s distinct elements.

ResourceFunction["EnumerateWolframModelRules"][signature,type]

generates all possible rules with the specified type of connectivity.

ResourceFunction["EnumerateWolframModelRules"][signature,{s,type}]

uses up to s distinct elements, with specified connectivity type.

Details

Signatures are given in the form {{n1L,k1L},{n2L,k2L},}{{n1R,k1R},}.
The connectivity types can be:
Allrequire both left- and right-hand sides to be connected individually and together
Automaticrequire left-hand side to be connected, and connected to right-hand side
Nonedo not constrain based on connectivity
ResourceFunction["EnumerateWolframModelRules"] by default uses parallel computation and takes ParallelMap options.

Examples

Basic Examples (1) 

Show all Wolfram model rules with the signature :

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

Scope (3) 

Wolfram model rules with signature and up to two distinct elements:

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

Wolfram model rules with signature and no connectivity constraints:

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

Enumerate Wolfram model rules with signature and connected left- and right-hand sides:

In[4]:=
ResourceFunction[
 "EnumerateWolframModelRules"][{{2, 2}} -> {{1, 2}}, All]
Out[4]=

Possible Issues (1) 

Enumeration may take a long time even for moderately complicated signatures:

In[5]:=
ResourceFunction[
   "EnumerateWolframModelRules"][{{2, 3}, {2, 2}} -> {{3, 2}}, 2] // Short // AbsoluteTiming
Out[5]=

Version History

  • 3.0.1 – 10 October 2025
  • 3.0.0 – 13 April 2020
  • 2.0.0 – 19 December 2019
  • 1.0.0 – 13 December 2019

Related Resources

License Information