Parameterised Counting in Logspace

Logarithmic space-bounded complexity classes such as L\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\textbf{L} $$\end{document} and NL\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\textbf{NL} $$\end{document} play a central role in space-bounded computation. The study of counting versions of these complexity classes have lead to several interesting insights into the structure of computational problems such as computing the determinant and counting paths in directed acyclic graphs. Though parameterised complexity theory was initiated roughly three decades ago by Downey and Fellows, a satisfactory study of parameterised logarithmic space-bounded computation was developed only in the last decade by Elberfeld, Stockhusen and Tantau (IPEC 2013, Algorithmica 2015). In this paper, we introduce a new framework for parameterised counting in logspace, inspired by the parameterised space-bounded models developed by Elberfeld, Stockhusen and Tantau. They defined the operators paraW\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\textbf{para}_{\textbf{W}}$$\end{document} and paraβ\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\textbf{para}_\beta $$\end{document} for parameterised space complexity classes by allowing bounded nondeterminism with multiple-read and read-once access, respectively. Using these operators, they characterised the parameterised complexity of natural problems on graphs. In the spirit of the operators paraW\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\textbf{para}_{\textbf{W}}$$\end{document} and paraβ\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\textbf{para}_\beta $$\end{document} by Stockhusen and Tantau, we introduce variants based on tail-nondeterminism, paraW[1]\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\textbf{para}_{{\textbf{W}}[1]}$$\end{document} and paraβtail\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\textbf{para}_{\beta {\textbf{tail}}}$$\end{document}. Then, we consider counting versions of all four operators and apply them to the class L\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\textbf{L} $$\end{document}. We obtain several natural complete problems for the resulting classes: counting of paths in digraphs, counting first-order models for formulas, and counting graph homomorphisms. Furthermore, we show that the complexity of a parameterised variant of the determinant function for (0, 1)-matrices is #paraβtailL\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\#\textbf{para}_{\beta {\textbf{tail}}}\textbf{L} $$\end{document}-hard and can be written as the difference of two functions in #paraβtailL\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\#\textbf{para}_{\beta {\textbf{tail}}}\textbf{L} $$\end{document}. These problems exhibit the richness of the introduced counting classes. Our results further indicate interesting structural characteristics of these classes. For example, we show that the closure of #paraβtailL\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\#\textbf{para}_{\beta {\textbf{tail}}}\textbf{L} $$\end{document} under parameterised logspace parsimonious reductions coincides with #paraβL\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\#\textbf{para}_\beta \textbf{L} $$\end{document}. In other words, in the setting of read-once access to nondeterministic bits, tail-nondeterminism coincides with unbounded nondeterminism modulo parameterised reductions. Initiating the study of closure properties of these parameterised logspace counting classes, we show that all introduced classes are closed under addition and multiplication, and those without tail-nondeterminism are closed under parameterised logspace parsimonious reductions. Finally, we want to emphasise the significance of this topic by providing a promising outlook highlighting several open problems and directions for further research.

paths in digraphs, counting first-order models for formulas, and counting graph homomorphisms.Furthermore, we show that the complexity of a parameterised variant of the determinant function for (0, 1)-matrices is #para βtail L-hard and can be written as the difference of two functions in #para βtail L. These problems exhibit the richness of the introduced counting classes.Our results further indicate interesting structural characteristics of these classes.For example, we show that the closure of #para βtail L under parameterised logspace parsimonious reductions coincides with #para β L. In other words, in the setting of read-once access to nondeterministic bits, tail-nondeterminism coincides with unbounded nondeterminism modulo parameterised reductions.Initiating the study of closure properties of these parameterised logspace counting classes, we show that all introduced classes are closed under addition and multiplication, and those without tail-nondeterminism are closed under parameterised logspace parsi-

Introduction
Parameterised complexity theory, introduced by Downey and Fellows [1], takes a twodimensional view on the computational complexity of problems and has revolutionised the algorithmic world.Two-dimensional here refers to the fact that the complexity of a parameterised problem is analysed with respect to the input size n and a parameter k associated with the given input as two independent quantities.The notion of fixedparameter tractability is the proposed notion of efficient computation.A parameterised problem is fixed-parameter tractable (fpt, or in the class FPT) if there are a computable function f and a deterministic algorithm deciding it in time f (k) • n O (1) time for any input of length n with parameter k.The primary notion of intractability in this setting is captured by the W-hierarchy.
Since its inception, the focus of parameterised complexity theory has been to identify parameterisations of NP-hard problems that allow for efficient parameterised algorithms, and to address structural aspects of the classes in the W-hierarchy and related complexity classes [2].This led to the development of machine-based and logical characterisations of parameterised complexity classes (see the book by Flum and Grohe [2] for more details).While the structure of classes in hierarchies such as the W-hierarchy and the related A-hierarchy is well understood, a parameterised view of parallel and space-bounded computation lacked attention.
In 2013, Elberfeld et al. [3,4] focused on parameterised space complexity classes and initiated the study of parameterised circuit complexity classes.In fact, they introduced parameterised analogues of deterministic and nondeterministic logarithmic space-bounded classes.The machine-based characterisation of W[P] (the class of problems that are fpt-reducible to a certain weighted circuit satisfiability question), and the type of access to nondeterministic choices (multi-read or read-once) led to two different variants of parameterised logspace (para-logspace), namely, para W L and para β L. Elberfeld et al. [4] obtained several natural complete problems for these classes, such as parameterised variants of reachability in graphs.
Bannach, Stockhusen and Tantau [5] further studied parameterised parallel algorithms.They used colour coding techniques [6] to obtain efficient parameterised parallel algorithms for several natural problems.A year later, Chen and Flum [7] proved parameterised lower bounds for AC 0 by adapting circuit lower bound techniques.
Apart from decision problems, counting problems have found a prominent place in complexity theory.Valiant [8] introduced the notion of counting complexity classes that capture natural counting problems such as counting the number of perfect matchings in a graph, or counting the number of satisfying assignments of a CNF formula.Informally, #P (resp., #L) consists of all functions F : {0, 1} * → N such that there is a nondeterministic Turing machine (NTM) running in polynomial time (resp., logarithmic space) in the input length whose number of accepting paths on every input x ∈ {0, 1} * is equal to F(x).Valiant's theory of #P-completeness led to several structural insights into complexity classes around NP and interactive proof systems, as well as to the seminal result of Toda [9].
While exact counting problems in #P stayed in the focus of research for long, the study of the determinant by Damm [10], Vinay [11], and Toda [12] established that the complexity of computing the determinant of an integer matrix characterises the class #L up to a closure under subtraction.Allender and Ogihara [13] analysed the structure of complexity classes based on #L.The importance of counting classes based on logspace-bounded Turing machines (TMs) was further established by Allender, Beals and Ogihara [14].They characterised the complexity of testing feasibility of linear equations by a class which is based on #L.Beigel and Fu [15] then showed that small depth circuits built with oracle access to #L functions lead to a hierarchy of classes which can be seen as the logspace version of the counting hierarchy.In a remarkable result, Ogihara [16] showed that this hierarchy collapses to the first level.Further down the complexity hierarchy, Caussinus et al. [17] introduced counting versions of NC 1  based on various characterisations of NC 1 .The counting and probabilistic analogues of NC 1 exhibit properties similar to their logspace counterparts [18].Moreover, counting and gap variants of the class AC 0 were defined by Agrawal et al. [19].
The theory of parameterised counting classes was pioneered by Flum and Grohe [20] as well as McCartin [21].The class #W [1] is the counting analogue of W [1] and consists of all parameterised counting problems that reduce to the problem of counting k-cliques in a graph.Flum and Grohe [20] proved that counting cycles of length k is complete for #W [1].Curticapean [22] further showed that counting matchings with k edges in a graph is also complete for #W [1].These results led to several remarkable completeness results and new techniques (see, e.g., the works of Curticapean [23,24], Curticapean, Dell and Marx [25], Jerrum and Meeks [26], Brand and Roth [27], as well as recent advances [28,29]).study of the impact of tail-nondeterminism in the setting of our comparatively small classes, leading to the new operators para W [1] and para βtail .
Studying counting complexity often improves the understanding of related classical problems and classes (e.g., Toda's theorem [9]).With regard to space-bounded complexity, there are several characterisations of logspace-bounded counting classes in terms of natural problems.For example, counting paths in directed graphs is complete for #L, and checking if an integer matrix is singular or not is complete for the class C = L (see Allender et al. [14]).Testing if a system of linear equations is feasible or not can be done in L with queries to any complete language for C = L.
Moreover, two hierarchies built over counting classes for logarithmic space collapse either to the first level [16] or to the second level [14].Apart from this, the separation of various counting classes defined in terms of logarithmic space computations remains widely open.For example, it is not known whether the class C = L is closed under complementation.
We consider different parameterised variants of the logspace-bounded counting class #L to give a new perspective on its fine structure.

Results
We introduce counting variants of parameterised space-bounded computation.More precisely, we define natural counting counterparts for the parameterised logspace complexity classes defined by Stockhusen and Tantau [3].By also considering tail-nondeterminism in the setting of the resulting classes, we obtain four different variants of parameterised logspace counting classes, namely, #para W L, #para β L, #para W[1] L, and #para βtail L. We show that #para W L and #para β L are closed under para-logspace parsimonious reductions and that all four of our new classes are closed under addition and multiplication.
Furthermore, we develop a complexity theory in the setting of parameterised spacebounded counting by obtaining natural complete problems for the new classes.We introduce variants of the problem of counting walks of parameter-bounded length that are complete for the classes #para β L (Theorems 14, 15 and 18) and #para βtail L (Theorem 16).Since the same problem is shown to be complete for both #para β L and #para βtail L, we get the somewhat surprising result that the closure of #para βtail L under para-logspace parsimonious reductions coincides with #para β L (Corollary 17).Also, we show that a parameterised version of the problem of counting homomorphisms from coloured path structures to arbitrary structures is complete for #para β L with respect to para-logspace parsimonious reductions (Theorem 26).
Afterwards, we study variants of the problem of counting satisfying assignments to free first-order variables in a quantifier-free FO-formula.We identify complete problems for the classes #para β L and #para W [1] L in this context.More specifically, counting satisfying assignments to free first-order variables in a quantifier-free formula with relation symbols of bounded arity and the syntactical locality of the variables in the formula being restricted ( p-#MC(Σ r -local 0 ) a ) is shown to be complete for the classes #para βtail L and #para β L with respect to para-logspace parsimonious reductions (Theorem 21).When there is no restriction on the locality of the variables, counting the number of satisfying assignments to free first-order variables in a quantifier-free formula of bounded arity in a given structure ( p-#MC(Σ 0 ) a ) is Finally, we consider a parameterised variant of the determinant function ( p-det) introduced by Chauhan and Rao [32].By adapting the arguments of Mahajan and Vinay [33], we show that p-det on (0, 1)-matrices can be expressed as the difference of two functions in #para β L, and is #para βtail L-hard with respect to para-logspace many-one reductions (Theorem 31).
Figure 1 shows a class diagram including the complete problems we identified.
Main Techniques Our primary contribution is laying the foundations for the study of parameterised logspace-bounded counting complexity classes.The completeness results in Theorems 15 and 22 required a quantised normal form for k-bounded nondeterministic Turing Machines (NTMs) (Lemma 9).This normal form quantises the nondeterministic steps of a k-bounded NTM into chunks of log n-many steps such that the total number of accepting paths remains the same.We believe that the normal form given in Lemma 9 will be useful in the structural study of parameterised counting classes.
The study of p-det involved definitions of so-called parameterised clow sequences generalising the classical notion [33].Besides, a careful assignment of signs to clow sequences was necessary for our complexity analysis of p-det.[34] investigated the complexity of counting homomorphisms and provided generalisations of results by Grohe [35] to the counting setting.Chen and Müller [36] studied the parameterised complexity of evaluating conjunctive queries, a problem closely related to the homomorphism problem.In both cases, a classification of the complexity of the respective problem was obtained based on the structure of the input.A similar classification in our setting could give new insights into the complexity of the homomorphism problem (Open Problem 3).The behaviour of our classes with respect to reductions is similar to the one observed for W [1] by Bottesch [37,38].For sub-graph problems a good survey paper exists by Meeks [39].Parameterised approximation counting is a related branch of research [40][41][42][43][44][45].Counting answers to conjunctive queries has been studied by Chen, Durand and Mengel [46,47].

Related Results Dalmau and Johnson
Outline In Sect.2, we introduce the considered machine model, as well as needed foundations of parameterised complexity theory and logic.Section 3 presents structural results regarding our introduced notions in the parameterised counting context.Afterwards, in Sect.4, our main results on counting walks, FO-assignments, homomorphisms as well as regarding the determinant are shown.Finally, we conclude in Sect. 5.
Prior Work This is an extended version of the conference publication [48].A major difference to the conference version is incorporating the full proof details of all results.
Compared to the conference version, we made the definition of configurations and related notions more precise.Furthermore, we corrected inaccuracies in different proofs of the paper, some of which resulted from imprecisions in the definitions of configurations and related notions which have been made accurate, now.Unfortunately, two results could not be salvaged and are now open for further research: Namely, the graph-based problems we claimed to be complete for para W L do not seem to be contained in that class.While one could further restrict these problems to arrive at promise problems complete for the class, these do not seem to be natural problems anymore.Consequently, we removed these two problems from this version of the paper.

Preliminaries
In this section, we describe the computational models and complexity classes that are relevant to parameterised complexity theory.We use standard notions and notations from parameterised complexity theory [1,2], as well as from graph theory [49].As we are working with problems that deal with functions (see Sect. 3), we will use a fraktur alphabet letter G for a graph to avoid confusions with a function G whenever both appear simultaneously.Finally, without loss of generality, we only consider binary inputs for our computation models.
Turing Machines (TMs) with Random Access to the Input We consider an intermediate model between TMs and Random Access Machines (RAMs) on words.Particularly, we make use of TMs that have random access to the input tape and can query relations in input structures in constant time.This can be achieved with two additional tapes of logarithmic size (in the input length), called the random access tape and the relation query tape.On the former, the machine can write the index of an input position to get the value of the respective bit of the input.On the relation query tape, the machine can write a tuple t of the input structure together with a relation identifier R to get the bit stating whether t is in the relation specified by R. Note that our model achieves linear speed-up for accessing the input compared to the standard TM model.(This is further justified by Remark 7.) For convenience, in the following, whenever we speak about TMs we mean the TM model with random access to the input.
Nondeterministic Turing Machines (NTMs) are a generalisation of TMs where multiple transitions from a given configuration are allowed.This can be formalised by allowing the transition to be a relation rather than a function.An NTM N accepts a given input x if there is a valid sequence of configurations starting from the initial configuration that terminate in an accepting configuration.(See, e.g., [30] for more details.) Denote by SPACETIME(s, t) (NSPACETIME(s, t)) with s, t : N → N the class of languages that are accepted by (nondeterministic) TMs with space-bound O(s) and time-bound Sometimes, it is helpful to view NTMs as TMs with an additional tape, called the (nondeterministic) choice tape which is typically read-only.Let M be a deterministic TM with a choice tape.
The language accepted by M, L(M) is defined as x ∈ {0, 1} * ∃y ∈ {0, 1} * s.t.M accepts x when the choice tape is initialised with y .
Notice that in this framework the machine M may have two-way or one-way access to the choice tape.The power of computation varies depending on the type of access allowed to the choice tape.Furthermore, in a space-bounded computation, the choice tape must be read-only and hence the space occupied by the choice tape is not counted for space bounds.Note that TMs with a read-once choice tape can be simulated by NTMs with the similar resource bounds.In fact, an NTM can guess the bits in the choice tape first and then simulate the machine in a deterministic fashion.Conversely, TMs with read-once choice tape can simulate NTMs as well: From the above, we can treat NTMs as TMs with a choice tape.In this paper, we regard nondeterministic TMs as deterministic ones with a choice tape.
Before we proceed to the definition of parameterised complexity classes, a clarification on the choice of the model is due.Note that RAMs and NRAMs are often appropriate in the parameterised setting as exhibited by several authors (see, e.g., the textbook of Flum and Grohe [2]).They allow to define bounded nondeterminism quite naturally.On the other hand, in the classical setting, branching programs (BPs) are one of the fundamental models that represent space-bounded computation, in particular logarithmic space.Since BPs inherently use bit access, this relationship suggests the use of a bit access model.
Consequently, we consider a hybrid computational model: Turing machines with random access to the input.While the computational power of this model is the same as that of Turing machines and RAMs, it seems to be a natural choice to guarantee a certain robustness, allowing for desirable characterisations of our classes.

Parameterised Complexity Classes
Let FPT denote the class of parameterised problems that can be decided by a deterministic TM running in time f (k) • p(|x|) for any input (x, k), where f is a computable function and p is a polynomial.Similarly, let XP be the class obtained by allowing time |x| f (k) instead.Furthermore, naturally lift the notion of SPACETIME(•, •)/NSPACETIME(•, •) to parameterised problems.
Two central classes in parameterised complexity theory are W[1] and W[P] which were originally defined via special types of circuit satisfiability [2].Flum, Chen and Grohe [50] obtained a characterisation of these two classes using the following notion of k-bounded NTMs.
Definition 2 (k-bounded NTMs) An NTM M, working on inputs of the form (x, k) with x ∈ {0, 1} * , k ∈ N, is said to be k-bounded if for all inputs (x, k) it reads at most f (k) • log |x| bits from the choice tape on input (x, k), where f is a computable function.
Note that it is irrelevant how k is encoded as the parametric value appears only in the function f .
Here, we will work with the following characterisation of W[P].The characterisation for W [1] needs another concept that will be defined on the next page.Proposition 3 ([2, 50]) W[P] is the set of all parameterised problems that are accepted by some k-bounded FPT-machine with a choice tape.Now, we recall three complexity theoretic operators that define parameterised complexity classes from an arbitrary classical complexity class, namely para, para W and para β , following the notation of Stockhusen [51].

Definition 4 ([52]
) Let C be any complexity class.Then paraC is the class of all parameterised problems P ⊆ {0, 1} * × N for which there is a computable function π : N → {0, 1} * and a language L ∈ C with L ⊆ {0, 1} * × {0, 1} * such that for all A paraC-machine for C = SPACETIME(s, t) (C = NSPACETIME(s, t)) is a (nondeterministic) TM, working on inputs of the form (x, k), that is O(s(|x| + f (k))) space-bounded and O(t(|x|+ f (k))) time-bounded where f is a computable function.Notice that paraP = FPT is the standard precomputation characterisation of FPT and even more, FPT can equivalently be defined with either running times of the form O( f (k) • poly(|x|)) or O( f (k) + poly(|x|)) for some computable function f [52].Now, consider the class paraL, which can be seen as the parameterised version of L. By the above definiton, it is the class of parameterised problems decidable in space O( f (k) + log |x|) for some computable function f .Here, changing the definition to allow space O( f (k) • log |x|) instead would likely change the class and not even yield a subclass of FPT, as such computations may take time O(|x| f (k) ), only showing membership in XP.This further indicates that paraL is the right way to define parameterised logspace.
The class XP and the W-hierarchy [2] capture intractability of parameterised problems.Though the W-hierarchy was defined using the weighted satisfiability of formulas with bounded weft, which is the number of alternations between gates of high fan-in, Flum and Grohe [52] characterised central classes in this context using bounded nondeterminism.Stockhusen and Tantau [3,51]

Definition 5
Let C = SPACETIME(s, t) for some s, t : N → N.Then, para W C is the class of all parameterised problems Q that are accepted by some k-bounded paraC-machine with a choice tape.
For example, para W L denotes the parameterised version of NL with k-bounded nondeterminism.One can also restrict this model by only giving one-way access to the nondeterministic tape.The following definition is a more formal version of the one of Stockhusen and Tantau [3, Def.2.1] who use the symbol para∃ → f log instead.Definition 6 Let C = SPACETIME(s, t) for some s, t : N → N. Then para β C denotes the class of all parameterised problems Q that can be accepted by a k-bounded paraC-machine with a choice tape with one-way read access to the choice tape.
As there is only read-once access to the nondeterministic bits, para β C can be equivalently defined via nondeterministic transitions and without using a choice tape.
Another notion studied in parameterised complexity is tail-nondeterminism.A kbounded machine M is tail-nondeterministic if there exists a computable function g such that on all inputs (x, k), after its first nondeterministic step, M makes at most g(k) • log |x| further steps in the computation.The value of this concept is evidenced by the machine characterisation of W[1] (Chen et al. [50]).We hope to get new insights by transferring this concept to space-bounded computation.In consequence, we introduce the tail-nondeterministic versions of para W C and para β C, which are denoted by para W [1] C and para βtail C.
Note that the restriction of the above classes to k-boundedness is crucial in the context of logarithmic space.If we drop this restriction, the machines are able to access 2 f (k)+log |x| , i.e., fpt-many nondeterministic bits.Regarding multiple-read access, this allows for solving SAT in logarithmic space (with constant parameterisation).That is, the class would contain a paraNP-complete problem.For read-once access, we expect a similar result for paraNL.When adding tail-nondeterminism, k-boundedness is always implicitly given.

Configurations
Let M be a TM with choice tape.A configuration of M on an input (x, k), is the snapshot of M at some point during the computation on M on input (x, k).Disregarding the input query tape and relation query tape for the moment, a configuration more formally is a tuple where p is the state, γ is the content of the work tapes, h 1 is the head position on the work tape, h 2 is the head position on the input tape and h 3 is the head position on the choice tape.In the case of machines with multiple work tapes, the notion of a configuration can be modified accordingly by adding for each of them both the content and the head position to the configuration.Input query tape and relation query tape are treated in the same way as a usual work tape.For an s space-bounded machine, a configuration is of size O(s).Note that we do not store the contents of input and choice tapes in a configuration.
A configuration C is said to be nondeterministic if the next configuration is dependent on the content of the choice tape at the current head position.
Remark 7 Note that it is important to have random access to the input tape in the case of tail-nondeterminism.Without random access to input bits and input relations, a TM cannot even make reasonable queries to the input in time g(k) • log(n).

Logic
We assume basic familiarity with first-order logic (FO).A vocabulary is a finite ordered set of relation symbols and constants.Each relation symbol R has an associated arity arity(R) ∈ N. Let τ be a vocabulary.A τ -structure A consists of a nonempty finite set dom(A) (its universe), and an interpretation R A ⊆ dom(A) arity(R) for every relation symbol R ∈ τ .Syntax and semantics are defined as usual (see, e.g., the textbook of Ebbinghaus et al. [53]).
Let A be a structure with universe A. We denote by |A| the size of a binary encoding of A, i.e., the number of bits required to represent the universe and relations as lists of tuples.For example, if R is a relation symbol of arity 3, then R A is represented as a subset of A 3 , i.e., a set of triples over A. This requires O(|R A | • arity(R)) • log |A|) bits to represent the relation R A , assuming log |A| bits to represent an element in A.

As analysed by Flum et al. [54, Sect. 2.3], this means that |A| ∈ Θ((|A| + |τ | +
Recall the following important classes of FO-formulas.A formula is in prenex normal form if it begins with a quantifier prefix followed by a quantifier-free formula.Moreover, Σ i (for i ∈ N) refers to the fragment of FO containing all formulas in prenex normal form with i quantifier blocks alternating between existential and universal quantifiers and the outermost quantifier being existential.
Counting Problems A counting problem is a function of the form f : Σ * → N, where Σ is a finite alphabet.The counting class #P is characterised by the set of all functions that can be expressed as the number of accepting paths in a nondeterministic polynomial time-bounded Turing Machine.Valiant [8] developed the theory of counting problems by showing that counting the number of perfect matchings in a graph is complete for #P.
For any counting problem f : Σ * → N, the associated decision problem is the problem of deciding f (x) > 0 or not.For example, the associated decision problem for #SAT is the well known problem of SAT.For further details, we refer the reader to an excellent book on counting problems by Jerrum [55].

Parameterised Counting in Logarithmic Space
A good survey article on counting problems in parameterised complexity is by Curticapean [56].Now, we define the counting counterparts based on the parameterised classes defined using bounded nondeterminism.A parameterised function is a function F : {0, 1} * × N → N.For an input (x, k) of F with x ∈ {0, 1} * , k ∈ N, we call k the parameter of that input.If C is a complexity class and a parameterised function F belongs to C, we say that F is C-computable.Let M be an NTM.We denote by #acc M (x) the number of words y such that M on input x with the choice tape initialised with y accepts and reads y completely during its computation.When transforming a Turing machine with a choice tape into a standard nondeterministic Turing machine, this notion coincides with the number of accepting computation paths of M on input x.
there is such an M with read-once access to its nondeterministic bits, • #para W[1] C if there is such an M that is tail-nondeterministic, and • #para βtail C if there is such an M with read-once access to its nondeterministic bits that is tail-nondeterministic.

By definition, we get #para
The following lemma shows that paraL-machines can be normalised in a specific way.This normalisation will play a major role in Sect. 4.

Lemma 9
For any k-bounded nondeterministic paraL-machine M there exists a kbounded nondeterministic paraL-machine M with #acc M (x, k) = #acc M (x, k) for all inputs (x, k) such that M has the following properties:

M has a unique accepting configuration, 2. on any input (x, k), every computation path of M accesses exactly g(k) • log |x| nondeterministic bits (for some computable function g), and M counts on an extra tape (tape S) the number of nondeterministic steps, and 3. M has an extra tape (tape C) on which it remembers previous nondeterministic
bits, resetting the tape after every log |x|-many nondeterministic steps.
Additionally, if M has read-once access to its nondeterministic bits, or is tailnondeterministic, or both, then M also has these properties.
Proof We construct the machine M with the three desired properties and the same number of accepting computation paths as M step by step, ensuring that the properties from previous steps are preserved.
First, note that without loss of generality M can be assumed to have a single accepting state.We can modify M so that upon reaching an accepting state, it erases everything in the work tape and moves the head positions of every tape to the left end marker.This ensures that M has a unique accepting configuration, which is property (1).This does not alter the number of accepting paths of M on any input.
To ensure (2), we construct a new machine N that behaves as M but additionally maintains a counter on tape S for the number of nondeterministic bits that have already been accessed: Every time a new nondeterministic bit is accessed, the counter is incremented.If M halts with the counter being less than g(k)•log |x|, then the modified machine N keeps making nondeterministic choices until the count is g(k) • log |x|.
As the machine has multiple read access to nondeterministic bits, it is not clear when exactly new bits are accessed.This can be handled using two additional counters: One stores the index of the rightmost position on the choice tape that has already been accessed and one stores the current head position on the choice tape.As we use at most g(k) • log |x| nondeterministic bits, these counters can be stored by a paraL-machine.We define N to accept if and only if M accepts and all of the additional nondeterministic bits guessed by N have the value 0. Note that N does not use any additional space except for maintaining and updating the counter.For all (x, k) ∈ {0, 1} * × N, the machine N accesses exactly g(k) • log |x| nondeterministic bits on all computation paths and #acc M (x, k) = #acc N (x, k).Also, N still has property (1), since the tape S has the same content and head position for all accepting configurations and the remaining part of accepting configurations does not change compared to M.
Finally, to ensure (3), we modify N from the previous step to obtain M as follows.The new machine M has an additional tape (tape C) on which it initially marks exactly log |x| cells, placing the head on the left-most cell afterwards.Whenever N reads a nondeterministic bit, M copies the nondeterministic bit to tape C (that is, M copies the bit to tape C and moves the head position to the right).If the current head position in tape C is on the right-most marked cell, then M erases the content of tape C in the marked cells and copies the nondeterministic bit currently being read to the first marked cell on tape C. Finally, M accepts if and only if N accepts.Since this modification does not introduce new nondeterministic steps, the number of accepting computation paths of M on any input is the same as that of N and the modification preserves property (2).To re-establish property (1), whenever we would reach an accepting configuration, we first clear tape C and then accept.
The following result follows from a simple simulation of nondeterministic machines by deterministic ones.Let FFPT be the class of functions computable by FPTmachines with output.
, G can be constructed in FPT time given the input (x, k).Now, #acc M (x, k) is equal to the number of paths from the starting configuration s(x, k) of M on input (x, k) to the unique accepting configuration C acc (by virtue of Lemma 9).Note that computing #acc M (x, k) can be done by counting the number of paths from the initial configuration to the accepting configuration in G(x, k).This can be done via a simple dynamic programming algorithm (in the fashion of matrix multiplication) computing the number of paths from the initial configuration to a given configuration in a dynamic fashion.Let C 0 be the initial configuration.Initialise L(C 0 ) = 1 and L(C) = 0 for every other configuration C in G(x, k).At every iteration, update the value of L(C) for every configuration C based on the values of all configurations that have an edge to C. For every C, after |G(x, k)| many iterations, L(C) will the the number of paths from C 0 to C. Since |G(x, k)| is fpt, this can be implemented in fpt time.
Using the notion of oracle machines (see, e.g., [57]), we define Turing, metric, and parsimonious reductions computable in paraL.In the space-bounded setting, we need to assume that the oracle tape is write-once.Further, the answer to an oracle query is written on a read-once tape.
With the above assumptions, the oracle tape is always exempted from space restrictions which is often the case in the context of logspace Turing reductions [58].A study on the effect of changing this assumption might be interesting.

For any reducibility relation and any complexity class C, [C] :
Next, we show that both new classes that are not restricted to tail-nondeterminism are closed under ≤ plog pars .

Lemma 12
The classes #para W L and #para β L are closed under Let M σ , M h with space-bounds s σ , s h be the machines computing σ , h.To show that F ∈ #para W L, we construct a new k-bounded nondeterministic paraL-machine M F as follows.
On input (x, k), the machine M F simulates M F on (σ (x, k), h(x, k)) using M σ and M h .Initially, h(x, k) is computed using M h and the value is stored.Then, whenever M F reads the i-th input symbol, M F runs M σ on (x, k) until it outputs the i-th symbol and uses it as the next input symbol.For this, note that |σ (x, k)| is fpt-bounded.Afterwards, M F continues the simulation of M F .On (x, k) the number of accepting paths of M F is exactly the number of accepting paths of M F on (σ (x, k), h(x, k)), which is equal to F (σ (x, k), h(x, k)) = F(x, k) as required.The space required by M F is bounded by the sum of the following: The space required to compute and store h(x, k), the space used by M F on input (σ (x, k), h(x, k)), the space used by M σ on input (x, k), and bookkeeping.Regarding bookkeeping, we need an index counter for M F 's input head position.Formally, the space is bounded by where s bk (|x|, k) is the space required for bookkeeping.This sum is in The number of nondeterministic bits required by M F is the same as M F on input (σ (x, k), h(x, k)).Consequently, the computation of M F is still k-bounded as the number of nondeterministic bits is bounded by where f , f are computable functions.This is due to |σ (x, k)| being fpt-bounded and h(x, k) being bounded by a computable function in k.
We continue with #para β L. The proof is analogous but M F has read-once access to its nondeterministic bits.Note that the only time M F accesses nondeterministic bits is when M F accesses its nondeterministic bits.Moreover, the order in which nondeterministic bits are accessed is preserved.Consequently, M F has read-once access to its nondeterministic bits.
It is not clear whether the classes restricted to tail-nondeterminisnm share this closure property.In Corollary 16, we will show that in case of read-once access and tail-nondeterminisnm, taking the closure under para-logspace parsimonious reductions is as powerful as lifting the restriction to tail-nondeterminism, i.e.Another important question is whether classes are closed under certain arithmetic operations.We show that all newly introduced classes are closed under addition and multiplication.

Theorem 13 For any o ∈ {W, W[1], β, β-tail}, the class #para o L is closed under addition and multiplication.
Proof Let C be any class #para o L, where o ∈ {W, W[1], β, β-tail}.Let F 1 , F 2 be in C via the NTMs M 1 and M 2 , respectively.Let h be a computable function such that M 1 and M 2 both are O(log |x| + h(k)) space-bounded.We start by showing that the above classes are closed under addition.We first consider #para W L and #para β L. The argument is similar for both of the classes.We give details for #para W L. We construct a new machine M as follows: M nondeterministically chooses whether to simulate the machine M 1 or the machine M 2 on the given input using a single additional nondeterministic bit.By construction we have space-bounded and k-bounded, since apart from the initial step choosing which machine to run, it behaves exactly like either M 1 or M 2 .
We conclude that the class #para W L is closed under addition.The same argument works for C = para β L, as read-once access to nondeterministic bits is preserved by the construction.
For #para W[1] L and #para βtail L, we modify M as follows: M first simulates the deterministic parts up until the first nondeterministic step of both machines M 1 and M 2 .That is M first runs M 1 until the first nondeterminstic step is reached.Say C 1 is the corresponding configuration.Store C 1 , and now simulate M 2 until the fist nondeterminstic step.Let C 2 be the corresponding configuration.We then nondeterministically choose a ∈ {0, 1}.If a = 1, then continue with the simulation of M 1 starting at C 1 , discard the configuration C 2 .If a = 0, then continue with simulation of M 2 starting at C 2 and discard C 1 .Accept if and only if the simulated machine accepts.This ensures that M is tail-nondeterministic if M 1 and M 2 are tail-nondeterministic.Also, readonce access to nondeterministic bits is still preserved.Further, M accepts an input if and only if either M 1 accepts it or M 2 accepts it.Further, the number of accepting path of M is equal to the sum of the number of accepting paths of M 1 and M 2 .Total space requirement of M is bounded by the sum of the spaces used by M 1 and M 2 .
We now show that the above classes are closed under multiplication, starting again with #para W L and #para β L. We construct a new machine M .On input (x, k), M first simulates M 1 on input (x, k).Whenever, M 1 needs a nondeterministic bit, M gets it from its choice tape, moving the head direction as done by M 1 .Additionally, we keep two counters (c 1 and c 2 ) to keep track of the position on the choice tape.Initially, c 1 = c 2 = 1, indicating that the head is at the first bit on the choice tape.The first counter (c 1 ) is incremented if M 1 moves the head on the choice tape to the right, and is decremented if the M 1 moves the choice tape head to the left.Whenever M 1 moves the choice tape head to the right, we increment c 2 if c 1 = c 2 .If M 1 accepts, then M simulates M 2 on (x, k) such that the start of the choice tape head is at position c 2 .The machine M never lets M 2 move the choice tape head to the left of position c 2 .(M will reject if M 2 ever tries to do so.)Finally, M accepts if and only if M 2 accepts.Note that we use the counters c 1 and c 2 to ensure that simulations of M 1 and M 2 are done on disjoint sets of nondeterministic choices.This is needed especially for #para W L. When M 1 and M 2 both have read-once access to nondeterministic choices, we do not need to use the counters c 1 and c 2 .
Since M 1 and M 2 are k-bounded, M is also k-bounded.The space used by M is at most the maximum of that of M 1 and M 2 .By construction we have Accordingly, the class C = #para W L is closed under multiplication.Additionally, if M 1 and M 2 only have read-once access to the nondeterministic bits, so has the new machine M .We conclude that #para β L is closed under multiplication.
We now cover the case of #para W[1] L and #para βtail L. Here, M 1 and M 2 are tailnondeterministic.We modify the constructed machine M similar to what was done to show that these classes are closed under addition.M first simulates the deterministic parts up until the first nondeterministic configuration of both machines M 1 and M 2 .Then M simulates M 1 starting from the first nondeterministic configuration.If M 1 accepts, M simulates M 2 starting from the first nondeterministic configuration and accepts if and only if M 2 accepts.As both M 1 and M 2 are tail-nondeterministic, the number of steps of M 1 and M 2 starting from their first nondeterministic configuration is k-bounded.Furthermore, the machine M does not perform any nondeterministic steps until it starts simulating M 1 from configuration C 1 .This ensures that M is tail-nondeterministic.
Formally, let C 1 be the first nondeterministic configuration of M 1 on input (x, k) and C 2 be the first nondeterministic configuration of M 2 on (x, k).The new machine M runs M 1 on (x, k) until the configuration C 1 is reached.Then M stores the configuration C 1 and runs M 2 on (x, k) until the configuration C 2 is reached.Storing C 2 in a separate tape, M now proceeds with the nondeterministic computation of M 1 starting with the configuration C 1 .For every accepting configuration of M 1 , the machine M starts the computation of M 2 from configuration C 2 accepting on all paths where M 2 does.Further, when M 1 and M 2 have two-way access to the nondeterministic bits (that is in the case of #para W[1] L), we need two counters c 1 and c 2 as done in the case of #para W L.
By construction, we have #acc and M is tail-nondeterministic.Moreover, it can again be seen that read-once access to nondeterministic bits is preserved by the construction.
Closure properties of counting classes under various operations are studied a lot in the literature.Apart from addition and multiplication, operations of decrement (i.e., max of n −1 and 0), and monus have received wide attention in the literature.There are several results in the literature concerning closure of counting classes under the monus operation (see, e.g., [59,60]).We believe that knowing the closure properties of the parameterised counting classes introduced in this article under the monus operation might be interesting in its own right: Open Problem 1 Which of the classes are closed under monus, that is, max{F −G, 0}?

Complete Problems
In this section, we study complete problems for the previously defined classes.The complete problems are related to counting walks in directed graphs, model-checking for FO formulas, and counting homomorphisms between FO-structures, as well as a parameterised version of the determinant.

Counting Walks
We start with parameterised variants of counting walks in directed graphs, which will be shown to be complete for the introduced classes.
guess a number j between 1 and b 7: if For the lower bound, using Lemma 9, construct the configuration graph G restricted to nondeterministic configurations and the unique accepting configuration C acc , where the edge relation expresses whether a configuration is reachable with exactly one nondeterministic, but an arbitrary number of deterministic steps.Accepting computations of the machine correspond to paths from the first nondeterministic configuration to Now we turn to the details of the proof.Algorithm 1 shows membership.The algorithm first checks the constraint on a. Then it starts from vertex s and guesses an arbitrary path of length exactly a, using the fact that the out-degree of all vertices is bounded by b to limit the number of nondeterministic bits needed for this task.More precisely, we choose a natural ordering depending on the encoding of vertices and use this to reference successors of the current node by numbers 0, . . ., b − 1.The needed number of nondeterministic bits is a • log(b) ∈ O(k • log |V |).Furthermore, at any point of time, the encoding of at most two vertices as well as one number bounded by a constant are stored, so the algorithm uses logarithmic space.
Regarding the lower bound, let F ∈ #para β L via the machine M. Using Lemma 9, we can assume that M has a unique accepting configuration C acc and there is a computable function f such that for any input (x, k) all accepting computation paths of M on input (x, k) use exactly f (k) • log |x| nondeterministic bits.Let (x, k) be an input of M. Consider the graph G(x, k) = (V (x, k), E(x, k)) where V (x, k) is the set containing all nondeterministic configurations of M on input (x, k) as well as C acc and E(x, k) contains an edge (C, C ) if and only if C is reached from C using exactly one nondeterministic step and any number of deterministic steps in the computation of M on input (x, k).Now the number of accepting computation paths of M on input (x, k) is exactly the number of paths of length f (k) • log |x| from the first nondeterministic configuration s(x, k) reached in the computation of M on input (x, k) to the unique accepting configuration in G.To ensure that the length of accepting paths is bounded by f (k) • log |G|, we further assume, without loss of generality, that |V (x, k)| ≥ |x|.This can be ensured as follows: In the beginning of the computation, guess log |x| nondeterministic bits.If all these bits are 0, continue with the original computation of M. Otherwise, reject.This results in 2 log |x| ≥ |x| additional nondeterministic configurations.Note that no (directed) cycle is reachable from the initial configuration in the configuration graph of M on any input.For that reason, no cycle is reachable from s(x, k) in G and hence every s-t-walk in G is an s-t-path.We now have for all (x, k) that The output G(x, k) needs to be on a write-once tape.We note that the adjacency within G(x, k) can be computed from (x, k) in parameterised logspace.That is, given two nodes C, C ∈ V (x, k), we can decide whether (C, C ) ∈ E(x, k) or not in parameterised logspace.We run the machine M starting from C as long as M uses at most one nondeterministc choice.This essentially means exploring two paths in the computation of M starting from the configuration C.This can be done by storing at most three configurations at any point of time.If C 1 is the first nondeterministic configuration reached starting from C, we store C 1 and explore the subsequent configurations originating from C 1 with the nondeterministic choice as 0 until we reach a nondeterministic configuration.Then abandon this path and restart with C 1 with nondeterministic choice as 1 and proceed until a nondeterministic configuration is reached.During this, check if the configuration reached at any point is the same as C .If yes, then output the edge (C, C ).We repeat this for every pair (C, C ) of vertices in V (x, k).
In the above, the reduction outputs an edge list representation of G(x, k) on a write-once tape.The argument can be extended to the case when an adjacency matrix representation is needed.
Furthermore, the new parameter is bounded by a computable function in the old parameter.Accordingly, the construction yields a para-logspace parsimonious reduction.
In the above problem, the out-degree b could also be taken as part of the parameter instead of being fixed, maintaining #para β L-completeness.Hardness immediately transfers, while membership can be shown with essentially the same algorithm.Let n be the input length, and k+b be the parameter.The required space is still in paralogspace, as the algorithm still only needs to store two vertices and one number between 1 and b at any point.The number of nondeterministic bits used is in O(k log n log b) as log b nondeterministic bits are needed in each of the k log n iterations, which is clearly k-bounded.
Now consider the problem p-#REACH, defined as follows.

Problem: p-#REACH
Input: number of s-t-walks of length exactly k.
In contrast to the previous problem, nodes can here have unbounded out-degree, but we count walks of length k instead of length a ≤ k • log |x|.Note that the analogue problem for counting paths is #W[1]-complete [20].However, we will see now that the problem for walks is #para β L-complete.
Proof For membership, we modify Algorithm 1.As the length of the path is exactly k, lines 1-3 are omitted and the loop in line 5 now runs for 1 ≤ i < k.In lines 6-11, instead of guessing the index of a successor, we directly guess any vertex v 2 and reject, if it is not a successor of v 1 .As a successor is only guessed less than k times, the new algorithm is still k-bounded.
Regarding hardness, let F ∈ #para β L via the machine M. Without loss of generality, M is in the normal form from Lemma 9. Let f be the computable function such that M on any input (x, k) uses exactly f (k) • log |x| nondeterministic bits.Also, assume without loss of generality that the accepting configuration of M is deterministic.Fix an input (x, k).We reduce the problem of counting the accepting computation paths of M on input (x, k) to the problem of counting walks in a modified version of the configuration graph of M on input (x, k).The difference to the hardness proof of Theorem 14 is that edges now encode computations comprised of log |x|-many nondeterministic steps.More precisely, define G = (V , E) and s, t ∈ V as follows: V consists of all nondeterministic configurations of M on input (x, k) and the (unique) accepting configuration C acc of M. For C = C acc , (C, C ) ∈ E if and only if configuration C is reachable from C in exactly log |x|-many nondeterministic steps (and any number of deterministic steps) in the computation of M on input (x, k).Furthermore, (C, C acc ) ∈ E if and only if C acc is reachable from C using exactly one nondeterministic step and any number of deterministic steps, i.e. no additional nondeterministic configurations appear.Finally, s is the first nondeterministic configuration reached in the computation of M on input (x, k) and t = C acc .
Since all accepting computation paths in the configuration graph of M on input (x, k) use exactly f (k) • log |x| nondeterministic bits, the change made compared to the reduction used for Theorem 14 does not change the number of paths and we can simply count paths of length exactly f (k) in the new graph.By the above we have Note that this equality crucially depends on the machine storing the last log |x| nondeterministic bits on the extra tape which can be assumed thanks to Lemma 9.
The set E can still be computed by a paraL-machine: To check whether an edge (C, C ) is present, we simply loop over all values for the next log |x| nondeterministic bits and verify whether the corresponding sequence of configurations starting from C is a path ending in C in the configuration graph of M on input (x, k).Consequently, the construction yields a para-logspace parsimonious reduction.
As the length of paths that are counted in p-#REACH is k, the runtime of the whole algorithm used to prove membership in the previous theorem is actually bounded by k • log |x| on input (x, k).This means that the computation is tail-nondeterministic.Also, it may be noted that query access to the input is necessary to ensure tailnondeterminism.Apart from Theorem 16 we need this assumptions in Theorems 21 and 14.
Proof This almost immediately follows from the proof of Theorem 15.For membership, first observe that finding the j-th successor is not a problem thanks to the RAM access.Furthermore, the runtime of the modified algorithm described in that proof is bounded by O(k • log n), and hence the algorithm is already tail-nondeterministic.For hardness, it suffices that the problem is #para β L-hard and #para βtail L ⊆ #para β L.
The previous results together with the fact that #para β L is closed under ≤ plog pars yield the following surprising collapse (a similar behaviour was observed by Bottesch [37,38]).

Corollary 17 [#para
We continue with another variant of p-#LOGREACH b , namely p-#LOGWALK b .Here, all walks of length a are counted, if a ≤ k • log |x| (and s, t are not part of the input).
Proof For membership, we use Algorithm 1 but nondeterministically guess nodes s, t ∈ V .
For hardness, let F ∈ #para β L via the machine M. Without loss of generality assume that M is in the normal form from Lemma 9 and that f is a computable function such that on input (x, k), M uses exactly f (k) • log |x| nondeterministic bits., E(x, k)) be the modified configuration graph where edges represent one nondeterministic step and an arbitrary number of deterministic steps.Furthermore, we extend G(x, k) by adding a path of fresh vertices v 1 , . . ., v log |x| with (v i , v i+1 ) ∈ E(x) for 1 ≤ i < log |x|.The reason for this construction lies in possible "bad" paths that start in some configuration that is not reachable from the starting configuration, but end in the unique accepting configuration.Such paths are depicted in Fig. 2.
Furthermore, without loss of generality we assume |V (x, k)| ≥ |x|.Now, any path in G(x, k) going from v 1 to the initial configuration s(x, k) and then to the accepting configuration t is of length (x, k) := ( f (k) + 1) • log |x|.Notice, that the number of such v 1 -t-paths is equivalent to the number of accepting paths of M on input x.
Next, consider the graph G (x, k) obtained from G(x, k) by removing the edge (v 1 , v 2 ).This ensures that in G (x, k), among paths of length (x, k), exactly the "good" accepting paths are missing compared to G(x, k).Consequently, the number of accepting computation paths #acc M (x, k) is exactly the difference between the number of paths of length (x, k) in G(x, k) and in G (x, k): These numbers of paths cannot be stored on the worktape as they are only bounded by 2 (x,k) = 2 ( f (k)+1)•log |x| .Hence, for a ≤ plog T -reduction, we need to compute the difference bit by bit by querying both oracles for each bit and only storing the carry bit and a counter for the current position in the output.As the output only has O(( f (k) + 1) • log |x|) many bits, this is possible in para-logspace.

Remark 19
Though the completeness in Theorem 18 is stated for Turing reductions, the reduction does not use the full power of Turing reductions.In fact, we need only a difference of the results of two queries.Such a reduction is studied in the literature and is known as a subtractive reduction [61].Due to the technicalities involved in extending the notion of subtractive reductions to the parameterised logspace setting, we have stated the completeness for Turing reductions.
Furthermore, one might think that a simple layering of the graph might be enough to make the reduction parsimonious instead of Turing.However, this does not work, for the target problem counts all walks of given length, not only s-t-walks.However, we need to extract the number of s-t-paths in the configuration graph.It is not clear how layering helps here.Even with layering, p-#LOGWALK b will count the number of walks from the first layer to the last layer.We will still need two queries.
It may be noted that the decision versions of the problems p-#REACH and p-#LOGREACH b are complete for the respective decision complexity classes.Stockhusen [51] presents path variants of these problems and proves completeness for those problems.However, Stockhusen considers paths of length at most k, where as our variants seek paths of length exactly k.We do not know if the counting versions of the path related problems in [51] are contained in the corresponding counting classes.It will be interesting to see if the counting versions of parameterised path problems in [51] characterise the corresponding counting classes as well.

Counting FO-Assignments
Let F be a class of first-order formulas.The problem of counting satisfying assignments to free FO-variables in F-formulas, p-#MC(F), is defined as follows.

Problem:
p-#MC(F) Here, ϕ(A) is the set of satisfying assignments of ϕ in A: We investigate parameterisations of variants of this problem and in this way obtain complete problems for some of our new complexity classes in the setting of first-order model-checking.Denote by p-#MC(F) a the variant where for all relations the arity is at most a ∈ N. Furthermore, we consider a fragment of FO obtained by restricting the occurrence of variables in the syntactic tree of a formula in a purely syntactic manner.Formally, the syntax tree of a quantifier-free FO-formula ϕ is a tree with edge-ordering whose leaves are labelled by atoms of ϕ and whose inner vertices are labelled by Boolean connectives.We now introduce a purely syntactical notion of locality.Note that the definition for the Σ i -classes can be found at page 18 in the subsection on 'Logic' within the preliminaries.Definition 20 Let r ∈ N and ϕ be a quantifier-free FO-formula.Let θ 1 , . . ., θ m be the atoms of ϕ in the order of their occurrence in the standard encoding of ϕ as a string.We say that ϕ is r -local if for any θ i , θ j that involve the same variable, we have |i − j| ≤ r .
We define Σ r -local 0 Using this syntactic notion of locality, we obtain a complete problem for our classes with read-once access to nondeterministic bits in the setting of first-order model-checking.The following proofs will utilise the straightforward model-counting algorithm for Σ 0 -formulae of bounded arity, see Algorithm 2. Proof Let us start with a proof idea.Regarding membership, Algorithm 2 can be used with a slight modification.Note that the whole running time of the algorithm is bounded by f (|ϕ|)•log |A| for some computable function f and thereby the procedure is tail-nondeterministic.Furthermore, we need to ensure that any assignment to a free variable, which is stored globally, is removed when the variable cannot occur anymore due to r -locality.After removing an assignment, the space can be reused for further assignments in the computation.For this, note that the algorithm visits the atoms in the order of their occurrence in the standard encoding of ϕ as a string.Hence, r -locality ensures that the number of assignments that need to be stored at any point is bounded sufficiently.
Regarding the lower bound, we reduce from p-#REACH and use the formula Now, we are ready to present the proof details.We show both completeness results by showing membership in #para βtail L and hardness for #para β L.
For membership, let ϕ ∈ Σ r -local 0 be a formula over some vocabulary σ of bounded arity, A be a σ -structure and k ∈ N. Without loss of generality, |ϕ| ≤ k, since we can immediately reject otherwise.Now Algorithm 2 can be used to count the satisfying assignments of ϕ in A. Here, the assignments for variables are guessed nondeterministically whenever a variable first occurs and are stored globally.The only parts of the algorithm that depend on the structure A are the stored assignments as well as the tuples written to the relation query tape.Hence, the space needed for book-keeping of the recursion is bounded by a computable function in |ϕ| ≤ k.As ϕ has bounded arity, the tuples written to the relation query tape are of size O(log n).Also, the total number of nondeterministic bits used by the algorithm is k-bounded, as there are at most |ϕ| ≤ k variables and each gets an assignment of O(log n) bits.
Leaving the algorithm unchanged means that we also need O(k log n) bits to store all assignments.To avoid this, we use the fact that ϕ is r -local and has bounded arity.We store any assignment x i → a as the pair (i, a) followed by the delimiter #.By r -locality, we can then remove any assignment after evaluating r more atoms and reuse the space.For this, after reaching an atom, we check for all assignments that are currently stored how many atoms occur in ϕ before the first occurrence of that variable and the current atom.If this number exceeds r , the assignment can be removed.This means that at any point during the computation, we store an assignment only for the variables that occurred in the previous r atoms, that is, for at most a • r variables.
Finally, we need to argue that the algorithm is tail-nondeterministic.This is trivial, as the running time of the whole algorithm is k-bounded.For this, observe that the size of the recursion tree of the algorithm is bounded by a computable function in the parameter.Furthermore, the running time for connectives is constant, while the running time for atoms is bounded by the time needed to search for a constant number of assignments as well as writing a tuple on the relation query tape.As the space needed by all assignments is in O(log n) and the tuples written to the relation query tape are of bounded arity, both operations can be done in time O(log n).This means that the running time of the algorithm is k-bounded and, consequently, it is tail-nondeterministic.
To show hardness, we reduce from p-#REACH, which is #para β L-complete by Theorem 15.Define the vocabulary σ := (E, s, t).Fix an input ((G = (V , E), s, t), k) of p-#REACH.The formula expresses that a tuple of vertices (v 1 , . . ., v k ) is an s A -t A -walk in the input structure A. We define the σ -structure G as (V , E, s, t).By construction, the number of satisfying assignments of ϕ in structure G is exactly the number of s-t-paths of length k in G. Also, |ϕ| is bounded by k.As a result, the mapping ((G, s, t), k) → ((ϕ k , G), |ϕ|) is the desired reduction.
We will now consider the more general problem p-#MC(Σ 0 ) a for a ∈ N and show that it is complete for tail-nondeterministic para-logspace with multiple-read access to nondeterministic bits.Note that the decision version of p-#MC(Σ 0 ) a asks whether there is an assignment to the free variables satisfying the formula.Hence, the free variables can be viewed as existentially quantified and the problem is equivalent to parameterised model-checking for Σ 1 -sentences.This problem has received wide attention in the literature [2,Chapter 7.4].We prove: Proof Membership in #para W[1] L again follows from a modified version of Algorithm 2. Here, the modification consists of using the contents of the choice tape as assignments to the free variables.The number of nondeterministic bits needed is still in O(k •log n), where k is the parameter and n is the input length.As we have multipleread access to the choice tape, we do not need to store the assignments on a work tape.Instead, we copy them to the relation query tape directly from the choice tape whenever needed.This means that the considerations for space and running time given in the proof of Theorem 21 mostly still apply.The only difference comes from the time needed to access an assignment.To access the assignment to a single variable, we at most need to go over the whole relevant part of the choice tape once and copying a word of length O(log n), needing time at most O(k log n) in total.As there are at most |ϕ| ≤ k occurrences of variables in the formula, accessing the correct assignments and copying them to the relation query tape needs time at most O(k 2 log n) in total.In total, this still results in a k-bounded running time, meaning that the algorithm is still tail-nondeterministic.
Regarding hardness, let F ∈ #para W[1] L via the NTM M. Without loss of generality, assume that M is in the normal form from Lemma 9. Furthermore, let f be a computable function such that M is O(log |x| + f (k)) space-bounded and M uses exactly f (k) • log |x| nondeterministic bits on any input (x, k).Fix an input (x, k).The idea for the reduction is to construct from (x, k) the configuration graph of M on input (x, k) as a first-order structure A together with a formula ϕ(b).The formula ϕ expresses that M accepts (x, k), if the choice tape contains the binary word encoded by b.
A naive approach would now be to use a relation R with the following interpretation.Let (C, C , b) ∈ R A , if C is reached from C in the computation of M, when the choice tape contains the binary word encoded by b.The problem is that this would lead to the size of A not being fpt-bounded.Hence, we instead construct R A in such a way that (C, C , a) ∈ R A , if C is reached from C using exactly log |x| nondeterministic and any number of deterministic steps in the computation of M, when the nondeterministic bits accessed by M in these steps are exactly the bits of a.As a now only needs to encode log |x| bits, the resulting structure is fpt-bounded.
As it is not clear in advance which bits of b are used at what point of the computation, we need an additional tuple a of free variables encoding the actual nondeterministic bits encountered in the computation.Moreover, we need additional relation symbols S 0 , . . ., S f (k)−1 specifying whether the bits of a actually encode the nondeterministic bits encountered by the computation of M starting from a given configuration, when the choice tape contains the binary word encoded by b.This is done by letting (C, a, b) ∈ S A j , if the bits of a being the actual next log |x| nondeterministic bits accessed by M starting from configuration C is consistent with b encoding the content of the j-th block of length log |x| on the choice tape.More precisely: Consider the next log |x| nondeterministic configurations reached by M starting from C, when the bits of a are the bits read from the choice tape in these steps.Let pos 1 , . . ., pos log |x| be the indices of the cells of the choice tape accessed in those configurations in the order they are reached.Now (C, a, b) ∈ S A j means that for all i, if pos i lies in the j-th block of length log |x| on the choice tape, i.e. pos i / log |x| = j, then the i-th bit of a is exactly the corresponding bit on the choice tape as given by b, i.e. the i-th bit of a equals the (pos i MOD log |x|)-th bit of b.In this construction, both a and b are tuples of arity f (k) and each element encodes a binary word with log |x| bits.
Finally, we need the constants C 0 and C acc for the first nondeterministic configuration of M on input (x, k) and the unique accepting configuration, respectively.This results in the vocabulary σ = (R 3 , S 3 0 , . . ., S 3 f (k)−1 ; C 0 , C acc ).Given the above construction of A and σ , we can now define ϕ as follows: where b = (b 0 , . . ., b f (k)−1 ), a = (a 0 , . . ., a f (k)−1 ), and x = (x 0 , . . ., x f (k) ).On a high level, ϕ expresses that C acc is reached from C 0 within f (k) batches of log |x| steps each, when the choice tape contais the binary word encoded by b.This is done as follows: The tuple x encodes a sequence of configurations starting from the first nondeterministic configuration and ending in the unique accepting configuration.Using R, ϕ expresses that configuration x i+1 is reached from x i in exactly log |x| nondeterministic steps and any number of deterministic steps in the computation of M, provided that a i encodes the nondeterministic bits that are accessed in these steps.Using the relations S j , the formula further expresses that a i encodes the actual nondeterministic bits accessed within the i-th batch, when b encodes the content of the choice tape.
For correctness, also note that, if ϕ is satisfiable, the assignments to both a and x are uniquely determined by the assignment to b.

Counting Homomorphisms
This subsection is devoted to the study of the problem of counting homomorphisms between two structures in the parameterised setting.Typically, the size of the universe of the first structure is considered as the parameter.The complexity of counting homomorphisms has been intensively investigated for almost two decades [34][35][36]62].
A bijective homomorphism h between two structures A, B such that the inverse of h is also a homomorphism is called an isomorphism.If there is an isomorphism between A and B, then A is said to be isomorphic to B. Notice that B can be any structure.
For n ≥ 2, let P n be the canonical undirected path of length n, that is, the (E)structure with universe {1, . . ., n} and E P n = { (i, i + 1), Let P be the class of structures isomorphic to some P n .We next want to show that p-#Hom(P * ) is #para β L-complete with respect to ≤ plog pars .For this, we will reduce to p-#REACH for membership, and from a normalised, coloured variant of p-#REACH

Output:
number of s-t-paths Proof sketch The proof is very similar to that of Theorem 15.For membership, the algorithm additionally needs to check in each step of the path whether the guessed successor is consistent with the labeling.
Regarding hardness, we outline the main difference and the process of labeling the vertices.Let F ∈ #para β L via a k-bounded log-space NTM M which has read-once access to nondeterministic bits.Consider an input (x, k) and let G = (V , E) be the configuration graph of M on input (x, k) as defined in the proof of Theorem 15.For a nondeterministic configuration C ∈ V , let (C) be the number represented in tape S in the configuration C. Now it is not hard to see that F(x, k) = p-#REACH * (G, s, t, ), where s is the first nondeterministic configuration reachable from the initial configuration of M on (x, k) and t is the unique accepting configuration of M.
The reduction is given by the mapping ((A, B), k) → ((G, s, t), |A| + 2).We show correctness by giving a 1-1-correspondence between homomorphisms from A to B and s-t-walks in G of length |A| + 2. This correspondence is given by the following mapping.Let h be a homomorphism from A to B. This homomorphism is bijectively mapped to an s-t-path as follows.The homomorphism yields a sequence From this, we obtain the s-t-path (s, h(a 1 ), . . ., h(a n ), t) in G.
Regarding surjectivity, let (s, v 1 , . . ., v n , t) be an s-t-path in G. Now, (s, v 1 ), Consequently, the function h with h(a i ) = v i for all i is a homomorphism from A to B as well as a preimage of (s, v 1 , . . ., v n , t) under the given mapping.
The reduction can be computed by a paraL-machine as follows.The vertex set of the graph is just the universe B extended by two new vertices.Store the sequence a 1 , . . ., a n .To compute E , the machine identifies all vertices x ∈ C B a 1 and prints for each the edge (s, x); similarly for all edges (x, t) with x ∈ C B a n .Then, for each edge (x, y) ∈ E B , we find and store the index i such that x ∈ C B a i and check whether y ∈ C B a i+1 is true.The machine only queries relations of B for individual tuples which can be achieved with binary counters.

. , k}, E
The mapping is injective due to the fact that each node in the path contributes to the construction of the homomorphism.The mapping is surjective as for each homomorphism h the path (h(1), . . ., h(k)) is a colour-respecting s-t-path in G and a preimage of h.
We now argue that the above reduction can be computed in paraL.The structure A only depends on the parameter.The universe of structure B is a copy.The relation E B is the symmetric closure of E (i.e., for every (u, v) ∈ E, E B contains both (u, v) and (v, u)) with the additional condition that edges have to be consistent with the labeling function .The relations C B i require a log |V |-counter to check for each u ∈ V whether (u) = i.This completes the proof.
Open Problem 3 Is there a natural class of structures A such that p-#Hom(A) is #para W[1] L-complete with respect to ≤ plog pars ?

The Parameterised Complexity of the Determinant
In this section, we consider a parameterised variant of the determinant function introduced by Chauhan and Rao [32].For n > 0 let S n denote the set of all permutations of {1, . . ., n}.For each k ≤ n, we define the subset S n,k of S n containing all permutations with exactly k non-fixpoints: We define the parameterised determinant function of an n × n square matrix A = (a i, j ) 1≤i, j≤n as Remark 27 The reader might wonder why the product in the above definition is over i such that π(i) = i.The original idea in the definition was to have p-det as a polynomial function of degree bounded by the parameter, so that it will be of use in the development of parameterised algebraic complexity theory.The two notions are equivalent if we ensure that diagonal entries are all 1's, i.e., the underlying graph has a self-loop at every vertex.
In the following, we will assume that A is a matrix with entries from {0, 1}.Using an interpolation argument, it can be shown that p-det is in FP when k is part of the input and thereby in FFPT [32].In fact, the same interpolation argument can be used to show that p-det is in GapL (the class of functions f (x) such that for some NL-machine, f (x) is the number of accepting minus the number of rejecting paths).However, this does not give a space efficient algorithm for p-det in the sense of parameterised classes.The GapL algorithm may require a large number of nondeterministic steps and accordingly is not k-bounded.We show that the space efficient algorithm for the determinant given by Mahajan and Vinay [33] can be adapted to the parameterised setting, proving that p-det can be written as the difference of two #para β L functions.Recall the notion of a clow sequence introduced by Mahajan and Vinay [33].
Definition 28 (Clow) Let G = (V , E) be a directed graph with V = {1, . . ., n} for some n ∈ N. A clow in G is a walk C = (w 1 , . . ., w r −1 , w r = w 1 ) where w 1 is the minimal vertex among w 1 , . . ., w r −1 with respect to the natural ordering of V and w 1 = w j for all 1 < j < r .Node w 1 is called the head of C, denoted by head(C).

Definition 29 (Clow sequence) A clow sequence of a graph
• the heads of the sequence are in ascending order, that is, head(C 1 ) < • • • < head(C ), and • the total number of edges (including multiplicities), that is, exactly n, where |C| denotes the number of edges in the clow C.
For a clow sequence W of some graph G = ({1, . . ., n}, E) consisting of r clows the sign of W , sign(W ), is defined as (−1) n+r .Note that, if the clow sequence is a cycle cover σ , then (−1) n+r is equal to the sign of the permutation represented by σ (that is, (−1) #inversions in σ ).Mahajan and Vinay came up with this sign-function to derive their formula for the determinant.
For an (n×n)-matrix A, G A is the weighted directed graph with vertex set {1, . . ., n} and weighted adjacency matrix A. For a clow (sequence) W , weight(W ) is the product of weights of the edges (clows) in w.For any G as above, W G is the set of all clow sequences of G. Mahajan and Vinay proved that det(A) = W ∈W G A sign(W ) • weight(W ) [33].
We adapt these notions to the parameterised setting.First observe that for a permutation σ ∈ S n,k , we have that sign(σ ) = (−1) n+r , where r is the number of cycles in the permutation.However, the number of cycles in σ is n − k + r , where r is the number of cycles of length at least two in σ , the rest being fixed points, i.e., self loops.Accordingly, we have sign(σ ) = (−1) 2n−k+r .Adapting the definition of a clow sequence, for k ≥ 0, define a k-clow sequence to be a clow sequence where the total number of edges (including multiplicity) in the sequence is exactly k, every clow has at least two edges, and no self loop edge of the form (i, i) occurs in any of the clows.For any graph G with vertex set {1, . . ., n} for n ∈ N, W G,k is the set of all k-clow sequences of G.For a k-clow sequence W ∈ W G,k , sign(W ) is (−1) 2n−k+r , where r is the number of clows in W . Mahajan and Vinay showed that the signed sum of the weights of all clow sequences is equal to the determinant [33, Theorem 1].At the outset, this is a bit surprising, since the determinant is equal to the signed sum of weights of cycle covers, whereas there are clow sequences that are not cycle covers.Mahajan and Vinay observed that every clow sequence that is not a cycle cover can be associated with a unique clow sequence of opposite sign, and thereby all such clow sequences cancel out [33].We observe a parameterised version of the above result [33,Theorem 1].
Proof The statement essentially follows from the arguments of Mahajan and Vinay [33,Theorem 1].The reader is referred to the original article for a full construction.Their proof involves defining an involution η (i.e., η is a bijection whose inverse is itself) on the set of clow sequences such that η is the identity on the set of all cycle covers (i.e., η(C) = C for any cycle cover C) and for any clow sequence W that is not a cycle cover, we have sign(W ) = −sign(η(W )).
We briefly describe the involution η given by Mahajan and Vinay [33].For a clow sequence W = (W 1 , . . ., W r ), the clow sequence η(W ) is obtained from W as follows.Let i ∈ {1, . . ., r } be the smallest index such that clows W i+1 , . . ., W r are vertex disjoint simple cycles.Traverse the clow W i starting from the head until we reach some vertex v such that either v is in some W j for i + 1 ≤ j ≤ r or v completes a simple cycle within W i .In the former case, we merge the simple cycle W j with the clow W i and remove W j from the sequence to get the clow sequence η(W ).In the latter case, we split the clow W i at the vertex v to get a new clow W i and a simple cycle C .Then η(W ) is the clow sequence obtained by replacing W i by the new clow W i and inserting the cycle C into the resulting clow sequence.The remaining clows in W are kept untouched.
We now give a brief justification for why η is self-inverse and consequently an involution, which was proven by Mahajan and Vinay [33,Theorem 1].Restricted to cycle covers, η is the identity function and hence clearly self-inverse.Otherwise, the operations applied in the two cases of the construction of η are opposite to each other: In the first case a simple cycle is merged into another clow in the sequence, while in the second case a clow in the sequence is split by extracting a simple cycle from it.Showing that η is indeed an involution now boils down to verifying the following: Whenever η(W ) is obtained from W by merging two clows, another application of η will reverse that operation by splitting the merged clow.Whenever η(W ) is obtained from W by splitting a clow, another application of η will reverse that operation by merging the two parts of the split clow.
We note that the involution η described above does not require that the clow sequence W has exactly n edges.In particular, η(W ) is well defined even when W ∈ W G,k for some graph G. Furthermore, for W ∈ W G,k we have η(W ) ∈ W G,k and sign(W ) = −sign(η(W )), since η(W ) has the same number of edges as W and in case that W is not a cycle cover either has one clow more than W or one clow less than W . Combining with the argument that η is indeed an involution, and that p-det(A, k) is the alternating sum of weights of cycle covers with exactly k non-self-loop edges, we get: This concludes the proof.
Using this characterisation, the upper bound in the following theorem can be obtained.For hardness a reduction from p-#REACH suffices.

Theorem 31
The problem p-det for (0, 1)-matrices can be written as the difference of two functions in #para βtail L, and is #para βtail L-hard with respect to ≤ plog met .
Proof We prove this using a parameterised version of the algorithm given by Mahajan and Vinay [33,Thm. 2].Let A be the adjacency matrix of a directed graph G.We construct two k-bounded nondeterministic paraL-machines M 0 and M 1 that have read-once access to their nondeterministic bits such that p-det(A, k) = #acc M 0 (A, k) − #acc M 1 (A, k).
Both M 0 and M 1 behave exactly the same except for the last step, where their answer is flipped.More precisely, both machines nondeterministically guess a k-clow sequence, and M 0 accepts if the guessed clow sequence has a positive sign while M 1 accepts if the guessed clow sequence has a negative sign.Then, it follows from Lemma 30 that p-det(A, k) = #acc M 0 (A, k) − #acc M 1 (A, k).Now, we describe the process of guessing nondeterministic bits.The process is the same for both M 0 and M 1 .We need the following variables throughout the process: curr-head, curr-vertex, parity, count, ccount.The variable curr-head contains the head of the clow currently being constructed, while parity holds the sign of the partial clow sequence constructed so far and is initialised to (−1) 2n−k .In fact, for a partial clow sequence W, its sign is defined as (−1) 2n−k+r , where r is the number of clows in W. Note that we have choosen (−1) 2n−k as the initial value of parity because we are going to compute the sign of a clow sequence W as (−1) 2n−k+r , where r is the number of clows in W with at least two edges.The variable count keeps track of the total number of edges used in the partial clow sequence constructed so far and ccount keeps track of the number of edges in the current clow.The machines M 0 and M 1 are described in Algorithm 3.
Note that the guess a = 0 in step 5 leads to expansion of the current clow with addition of a newly guessed edge.The guess a = 1 in step 5 leads to completion of the current clow by chosing the back edge to the head (step 10, only the existence of such an edge needs to be checked), and guessing the head for a new clow.Since the parity of the number of clows changes for the case when a = 1, we flip the parity (step 16).Note that the algorithm reaches step 20 if and only if the nondeterministic choices correspond to a clow sequence with exactly k edges.Hence, for b ∈ {0, 1} the machine M b accepts on all nondeterministic paths where the guessed k-clow sequence has sign (−1) b which completes the correctness proof.
Since both M 0 and M 1 guess exactly k vertices, they are k-bounded.Also, only curr-vertex and curr-head need to be stored at any point of time, consequently the machines only need read-once access to nondeterministic bits.Finally, the machines use O(log |A| + log k) space and are tail-deterministic, taking only O(k • log |A|) steps after the first nondeterministic step.
For hardness we give a reduction from p-#REACH.Note that, even when the input graph is a directed acyclic graph (i.e., a DAG), p-#REACH remains #para βtail L hard.Let G, s, t be an instance of p-#REACH, where G is a DAG.Let G be the graph obtained by adding the "back edge" (t, s) to G. Note that the set of all s-t paths in G is in bijective correspondence with the set of cycles in G .This correspondence is given by mapping any s-t path to the cycle obtained by adding the edge (t, s) to that path.As each cycle in G contains the edge (t, s), this means that there is also a bijection between the set of s-t paths in G of length k and the set of clow sequences consisting of one simple cycle and containing k + 1 edges in G .More precisely: Let A be the adjacency matrix of G .Then p-det(A , k + 1) = (−1) 2n−k • R where R is the number of s-t paths in G.As a result, R can be retrieved from p-det(A , k) in deterministic logspace.This completes the proof.

Conclusions and Outlook
We developed foundations for the study of parameterised space complexity of counting problems.Our results show interesting characterisations for classes defined in Require: G = (V , E) as the adjacency matrix A. 1: Guess a vertex v ∈ {1, . . ., n} 2: curr-head ← v, curr-vertex ← v 3: parity ← (−1) 2n−k , count ← 0, ccount ← 0. 4: while count ≤ k − 1 do 5: Guess a ∈ {0, 1} 6: if a = 0 then 7: Guess terms of k-bounded para-logspace NTMs.We believe that our results will lead to further research of parameterised logspace counting complexity.Notice that the studied walk problems in Sect.4.1 can be considered restricted to DAGs yielding the same completeness results.
Comparing our newly introduced classes to the W-hierarchy (which is defined in terms of weighted satisfiability problems for circuits of so-called bounded weft), one might ponder whether there is an alternative definition of our classes in terms of such circuit satisfiability problems.While we did not explore weighted satisfiability in this article, the closely related problem p-MC(Σ 0 ) a sheds some light on this.Theorem 22 shows that p-MC(Σ 0 ) a is complete for para W [1] L (in fact, we show this for their counting versions) under ≤ plog m -reductions.However, if we take FPT-reductions, p-MC(Σ 0 ) a is complete for W [1]. Interestingly, this phenomenon is more general as witnessed by the following observation whose proof has been pointed out by an anonymous reviewer.

Fig. 1
Fig. 1 Diagram of studied classes with list of complete problems, assuming pair-wise difference between classes [#para βtail L] ≤ plog pars = #para β L. Open Problem 2 on page 44 asks what class corresponds to the corresponding closure of #para W[1] L.

Fig. 2
Fig.2Construction of G(x) in the proof of Theorem 18.The black chains of unnamed vertices depict possibly occurring "bad" configuration sequences in the configuration graph that should not be considered as they are unreachable from the initial configuration

Open Problem 2
Corollary 17 that [#para βtail L] ≤ plog pars = #para β L, we want to conclude this subsection with the question of whether the ≤ plog pars -closure of #para W[1] L also coincides with some known class.Is the class [#para W[1] L] ≤ plog pars equivalent to some known class?

Definition 24
Let A be a structure with universe A. We denote by A * the extension of A by a fresh unary relation symbol C a interpreted as C A a = {a} for each a ∈ dom(A).For a class of structures A, we analogously denote the class { A * | A ∈ A } by A * .Define p-#Hom(A) as the following problem.Given a pair of structures (A, B) where A ∈ A, and parameter k, output the number of homomorphisms from A to B, if |dom(A)| ≤ k, and 0 otherwise.structures (A, B) where A ∈ A. Parameter: k ∈ N. Output: the number of homomorphisms from A to B if |dom(A)| ≤ k, 0 otherwise.

Fig. 3
Fig. 3 Example for the membership proof of Theorem 26

Theorem 26 p
-#Hom(P * ) is #para β L-complete with respect to ≤ plog pars .Regarding membership, we will show p-#Hom(P * ) ≤ plog pars p-#REACH, where the latter is in #para β L by Theorem 15.The proof idea is visualised in Fig. 3 with an example.Consider an arbitrary input ((A, B), k) to p-#Hom(P * ) with FO-structures A, B and k ∈ N. By definition of the problem we have A ∈ P * .Let A = dom(A), B = dom(B).We assume that A and B have the same underlying vocabulary σ and |A| ≤ k, since the remaining cases can easily be handled.Let E be the edge relation symbol in σ .Furthermore, let A = {a 1 , . . ., a n } with n ∈ N be the universe of A such that (a i , a i+1 ) ∈ E A and let B be the universe of B. Now, define the directed graph G = (B ∪ {s, t}, E ) with s, t / ∈ B and

Observation 32 [
para W[1] L] ≤ fpt m = W[1].In other words, any problem that is para W[1] L-complete under ≤ plog m -reductions is complete for W[1] under FPT reductions.To see that this is true, take a para W[1] Lcomplete problem A under ≤ plog pars -reductions.Now, it suffices that the W[1]-complete problem p-CLIQUE FPT-reduces to A. Since p-CLIQUE is in para W[1] L and since A there is a paraL oracle TM M that computes F with oracle F and the parameter of any oracle query of M is bounded by a computable function in the parameter.2. F is para-logspace metrically reducible to F , F ≤ plog met F , if there is such an M that uses only one oracle query.3. F is para-logspace parsimoniously reducible to F , F ≤ plog pars F , if there is such an M that returns the answer of the first oracle query.
v 1 has less than j successors then Input:directed graph G = (V , E) with out-degree b, s, t ∈ V and a ∈ N.Parameter: k ∈ N. Output: number of s-t-walks of length a if a ≤ k • log |V |, 0 otherwise.Theorem 14 For every b > 2, p-#LOGREACH b is #para β L-complete with respect to ≤ plog pars -reductions.Proof We start with the proof idea.For the upper bound, guess a path of length exactly a.The number of nondeterministic bits is bounded by O(k • log |V |) since successors can be referenced by numbers in {0, . . ., b − 1}.