Generate random LTL Formulae
Perl 5, 251 bytes

249 bytes code + 2 for -pa.



$d=I;sub a{map"($d$_$d)",@_}@I=(w..z,-128..127,a qw{+ - * /});@L=(@B=(a..d,True,False,a qw{&lt; &lt;= &gt; &gt;= = !=}),B,FL,GL,XL,"!".($d=L),a qw{U W R &amp; |});$_=$L[rand@L];0while s/L|B|I/@{$&amp;}[rand@{$&amp;}]/e;$;=$_;s/[^()]//g;0while s/\)\(//g;$_=y/(//&gt;"@F"?redo:$


Try it online!