# Is bounded-width SAT decidable in logspace?

Elberfeld, Jakoby, and Tantau 2010 (ECCC TR10-062) proved a space-efficient version of Bodlaender's theorem. They showed that for graphs with treewidth at most $k$, a tree decomposition of width $k$ can be found using logarithmic space. The constant factor in the space bound depends on $k$. (Bodlaender's theorem shows a linear time bound, with an exponential dependence on $k$ in the constant factor.)

SAT becomes easy when the set of clauses has low width. Specifically, Fischer, Makowsky, and Ravve 2008 showed that satisfiability of CNF formulas with treewidth of the incidence graph bounded by $k$ can be decided with at most $2^{O(k)} n$ arithmetic operations when the tree decomposition is given. By Bodlaender's theorem, computing the tree decomposition of the incidence graph for fixed $k$ can be done in linear time, and therefore SAT can be decided for bounded treewidth formulas in time that is a low-degree polynomial in the number of variables $n$.

One might then expect that SAT should actually be decidable using logarithmic space, for formulas with bounded treewidth of the incidence graph. It is not clear how to modify the Fischer et al. approach for deciding SAT into something space-efficient. The algorithm works by computing an expression for the number of solutions, via inclusion-exclusion, and recursively evaluating the number of solutions of smaller formulas. Although the bounded treewidth does help, the subformulas seem to be too large to compute in logarithmic space.

Is SAT for bounded treewidth formulas known to be in $\mathsf{L}$ or $\mathsf{NL}$?

• Doesn't the fact that SAT in L for bounded treewidth instances follow directly from the results in the paper you cited? The set of satisfiable formulas is MSO definable. Therefore, satisfiability can be solved in linear time on graphs of bounded treewidth via Bodlaender + Courcelle theorems. Elberfeld-Jakoby-Tantau-2010, show that MSO properties can be decided in logarithmic space on graphs of bounded treewidth by providing logarithmic space versions of Bodlaender + Courcelle's theorems. Therefore, SAT can be decided in logspace on graphs of bounded treewidth. – Mateus de Oliveira Oliveira Mar 24 '17 at 23:17
• @MateusdeOliveiraOliveira, the details don't seem clear to me. SAT is MSO-definable via a structure with two directed edge relations (Immerman Example 2.18), the union of which leads to the edges of the incidence graph once the direction is forgotten. However, it is not clear to me that it is possible to use the incidence graph as-is to MSO-define satisfiability (via set cover, for instance), so as to be able to apply Bodlaender/Courcelle/EJT. – András Salamon Mar 27 '17 at 13:33
• @AndrásSalomon Courcelle's theorem can be stated for graphs with colored vertices and edges. The treewidth of such colored graphs is the same as the treewidth of the uncolored versions. There are many ways of modeling arbitrary relational structures as colored graphs. – Mateus de Oliveira Oliveira Mar 27 '17 at 14:18
• In the case of Formulas you want to define a relational structure that encodes at the same time the formula and the incidence graph. (otherwise, how would you define satisfiability in first place? ) Then by using an appropriate notion of treewidth for such structure, we have that the treewidth of the structure (Formula + Incidence graph) is at most an additive constant bigger than the treewidth of the incidence graph alone. Note that there are many ways of defining such combined relational strucutres, and essentially each author uses the one that is most suitable for his/her context. – Mateus de Oliveira Oliveira Mar 27 '17 at 14:21
• @Mateus, thank you! That is a rather helpful comment; I wasn't aware of the "toolbox" nature of treewidth in descriptive complexity. Care to turn this into an answer? – András Salamon Mar 28 '17 at 8:42

3. A theorem of Bodlaender implies that if a relational structure has treewidth $t$, then a tree-decomposition of such structure can be found in time $f(t)\cdot n$. In other words, such a decomposition can be found in linear time on graphs of constant treewidth.
4. One can define suitable relational structure $\tau$ which can be used to encode a formula $F$ together with its incidence graph $I$. The treewidth of $\tau$ is at most a constant plus the treewidth of $I$.
5. The set of relational structures $\tau$ which encode satisfiable formulas + their incidence graphs is MSO definable.
8. Therefore, for each MSO formula $\varphi$, and each relational structure $\tau$, one can determine in logarithmic space whether $\tau$ satisfied $\varphi$.