In[]:=
ResourceFunction["CombinatorEvolve"][s[x][s[x][y][z]][y[k[x][y][k[x][y]]]],1,"SKGlyphs"->{s,k}]
Out[]=
x[y[k[x][y][k[x][y]]]][s[x][y][z][y[k[x][y][k[x][y]]]]]
In[]:=
ResourceFunction["CombinatorEvolve"][ResourceFunction["SKCombinatorCompile"][f[g[x][y]][y],{x,y}][x][y],20,"SKGlyphs"->{CombinatorS,CombinatorK}]
Out[]=
f[g[x][y]][y]
In[]:=
Catenate@Values@TwoWayMultiReplaceList[{S[x_][y_][z_]<->x_[z_][y_[z_]],K[x_][y_]<->x_},2,"Identity"->False,"Deduplicate"->True,"Canonicalize"->True]//Short
Out[]//Short=
{S[x_][y_][z_]x_[z_][y_[z_]],K[x_][y_]x_,176,S[a_][b_][c_]a_[c_][K[b_[K[c_][d_]]][e_]],S[a_][b_][c_]K[a_[c_][b_[K[c_][d_]]]][e_]}
In[]:=
CombinatorS[f[a_,b_]][a_][b_]<->CombinatorK[a_][b_]CombinatorS[f[a_,b_]][a_][b_]<->a_f[a_,b_][a_][a_[b_]]<->a_CombinatorS[f[a_,b_]][a_][a_[b_]]<->a_f[a_,b_][a_][a_[a_[b_]]]<->a_
Out[]=
S[f[a_,b_]][a_][b_]K[a_][b_]
Out[]=
S[f[a_,b_]][a_][b_]a_
Out[]=
f[a_,b_][a_][a_[b_]]a_
Out[]=
S[f[a_,b_]][a_][a_[b_]]a_
Out[]=
f[a_,b_][a_][a_[a_[b_]]]a_
In[]:=
combinatorTree[comb_]:=If[Length[comb]==0,Tree[comb,{}],With[{head=combinatorTree[comb[[0]]],child=combinatorTree[comb[[1]]]},If[Length@TreeChildren[head]==0,Tree[TreeData@head,{child}],TreeInsert[head,child,-1]]]]
In[]:=
Map[combinatorTree(*ResourceFunction["CombinatorExpressionGraph"]*),formalizePatterns/@DeleteDuplicates@Catenate@Values@TwoWayMultiReplaceList[{S[a_][b_][c_]a_[c_][b_[c_]],K[a_][b_]a_},2,"Identity"->False,"Deduplicate"->True,"Canonicalize"->True,"SubstitutionLemmas"->False,"CriticalPairLemmas"->True,"Sample"->5],{2}]//Short
Out[]//Short=
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,190,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,