Solution (source code)

= Solution

A <propositional variable> $p_i$ is a single symbol of the alphabet. Its only nonempty substring is that symbol itself. Every <propositional formula> is nonempty, so the only substring that is a <logical formula> is $p_i$. Therefore
$$
\boxed{\operatorname{Sub}(p_i)=\{p_i\}.}
$$
The subscript is part of the name of an atomic token; it does not introduce additional symbol positions inside the <logical variable>.