word begins with a ${\textsf{c}}$, then it follows that the entry corresponding to the first ${\textsf{c}}$ may be inflated by any permutation in ${\operatorname{Av}}(312)$, while each subsequent entry corresponding to a ${\textsf{c}}$ may only be inflated by a decreasing permutation. Otherwise, it follows from our rules that the word must begin with an ${\textsf{a}}$, and there are two cases. If the entry corresponding to the first ${\textsf{a}}$ is inflated by a permutation containing a descent, then each entry corresponding to a ${\textsf{c}}$ must be inflated with a decreasing permutation. Otherwise, if the entry corresponding to the first ${\textsf{a}}$ is inflated by an increasing permutation, then the entry corresponding to the first ${\textsf{c}}$ must be inflated by a permutation from ${\operatorname{Av}}(312)$, while each subsequent entry corresponding to a ${\textsf{c}}$ must be inflated by a decreasing permutation. From our multivariate generating function for these simple permutations, it follows that the contribution of their inflations is $$\left(\frac{f-m}{f}+\frac{c}{f}+\frac{c}{m}\right)s(f,m,m,c)
=
\frac{cm^2(c-m+f+cf)}{1-2cm-cm^2-mf-cmf}.$$ Combining this with the generating functions for $f_\oplus$ and $f_\ominus$ and solving for $f$ yields the generating function for the class (or, rather, its minimal polynomial).

\[thm-4312-3142\] The generating function $f$ for ${\operatorname{Av}}(4312,3142)$ satisfies $$\begin{array}{rclcc}
(x^3-2x^2+x)f^4
&+&
(4x^3-9x^2+6x-1)f^3&&\\
&+&
(6x^3-12x^2+7x-1)f^2&&\\
&+&
(4x^3-5x^2+x)f&&\\
&+&
x^3
