Let there be a square truth table of size $n^2$. An algorithm takes two arbitrary rows as input ($a$ and $b$ such that $a$ < $b$), and then performs a fixed number of logical operations ($s$) on them. The result is a series of Boolean values.
To perform the above operations on all combinations of $a$ and $b$ requires $sn^2$ steps, which means the time complexity is $O(n^2)$.
Now consider the case in which the result of each iteration as described above returns some unknown number of TRUE values $c$ such that $c < b - a - 1$ and exactly $c$ additional operations must be performed before starting over with a new $a$ and $b$. In the absolutely worst case, $b = n$, $a = 1$, and $c = n - 2$.
What is the time complexity now?
Let's assume the worst case scenario, in which the number of additional operations for each pair of rows $(a, b)$ is $c=b-a-2$. Adding this number to the initial fixed number of operations $s$ in each pair and summing over all the pairs we obtain the expression $$ N=\sum_{b=2}^{n}\sum_{a=1}^{b-1}(s+b-a-2). \tag{1} $$ This sum can be computed exactly, but to obtain its asymptotic behavior for $n\gg 1$ we may approximate it by an integral: \begin{align} N &\sim \int_0^n\int_0^b(s+b-a-2)\,da\,db \\ &=\int_0^n\left[(s+b-2)b-\frac{b^2}{2}\right]db \\ &=(s-2)\frac{n^2}{2}+\frac{n^3}{6}. \tag{2} \end{align} Therefore, the time complexity in the worst case is $O(n^3)$.