Function Repository Resource:

# ConnectedWolframModelQ

Determine whether a Wolfram model rule is left-connected

Contributed by: Max Piskunov
 ResourceFunction["ConnectedWolframModelQ"][rule] yields True if the left-hand side of the rule is connected, and the right-hand side is connected to the left-hand side. ResourceFunction["ConnectedWolframModelQ"][rule,All] yields True if both sides of the rule are separately connected, and also connected to each other.

## Details and Options

ResourceFunction["ConnectedWolframModelQ"][rule] yields True if the rule is local (left-hand side is connected). It may produce disconnected components, which it would not do if the right-hand side was connected to the left-hand side.
ResourceFunction["ConnectedWolframModelQ"][rule,All] also tests whether the right-hand side is connected. The rule can still however produce disconnected components even in ResourceFunction["ConnectedWolframModelQ"][rule,All].

## Examples

### Basic Examples (2)

An example of a connected rule:

 In[1]:=
 Out[1]=

An example of a disconnected rule:

 In[2]:=
 Out[2]=

### Scope (6)

Multiple rules are supported:

 In[3]:=
 Out[3]=
 In[4]:=
 Out[4]=

Unary edges are supported:

 In[5]:=
 Out[5]=
 In[6]:=
 Out[6]=
 In[7]:=
 Out[7]=

By default, the right-hand side is allowed to be disconnected:

 In[8]:=
 Out[8]=

Left- and right- hand sides should be connected to each other:

 In[9]:=
 Out[9]=

While the right-hand side can be disconnected, each piece must be connected to the left-hand side:

 In[10]:=
 Out[10]=

One can also require the right-hand side to be connected separately:

 In[11]:=
 Out[11]=