This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Monadicity of Non-deterministic Logical
Matrices is Undecidable

Pedro Filipe  Carlos Caleiro  Sérgio Marcelino 111Research funded by FCT/MCTES through national funds and when applicable co-funded by EU under the project UIDB/50008/2020. The first author acknowledges the grant PD/BD/135513/2018 by FCT, under the LisMath PhD programme. SQIG - Instituto de TelecomunicaçõesDep. Matemática, Instituto Superior Técnico,
Universidade de Lisboa, Portugal [email protected]  {ccal,smarcel}@math.tecnico.ulisboa.pt
Abstract

The notion of non-deterministic logical matrix (where connectives are interpreted as multi-functions) preserves many good properties of traditional semantics based on logical matrices (where connectives are interpreted as functions) whilst finitely characterizing a much wider class of logics, and has proven to be decisive in a myriad of recent compositional results in logic. Crucially, when a finite non-deterministic matrix satisfies monadicity (distinct truth-values can be separated by unary formulas) one can automatically produce an axiomatization of the induced logic. Furthermore, the resulting calculi are analytical and enable algorithmic proof-search and symbolic counter-model generation.

For finite (deterministic) matrices it is well known that checking monadicity is decidable. We show that, in the presence of non-determinism, the property becomes undecidable. As a consequence, we conclude that there is no algorithm for computing the set of all multi-functions expressible in a given finite Nmatrix. The undecidability result is obtained by reduction from the halting problem for deterministic counter machines.

1 Introduction

Logical matrices are arguably the most widespread semantic structures for propositional logics [18, 12]. After Łukasiewicz, a logical matrix consists in an underlying algebra, functionally interpreting logical connectives over a set of truth-values, together with a designated set of truth-values. The logical models (valuations) are obtained by considering homomorphisms from the free-algebra in the matrix similarity type into the algebra, and formulas that hold in the model are the ones that take designated values.

However, in recent years, it has become clear that there are advantages in departing from semantics based on logical matrices, by adopting a non-deterministic generalization of the standard notion. Non-deterministic logical matrices (Nmatrices) were introduced in the beginning of this century by Avron and his collaborators [4, 5], and interpret connectives by multi-functions instead of functions. The central idea is that a connective can non-deterministically pick from a set of possible values instead of its value being completely determined by the input values. Logical semantics based on Nmatrices are very malleable, allowing not only for finite characterizations of logics that do not admit finite semantics based on logical matrices, but also for general recipes for various practical problems in logic [14]. Further, Nmatrices still permit, whenever the underlying logical language is sufficiently expressive, to extend from logical matrices general techniques for effectively producing analytic calculi for the induced logics, over which a series of reasoning activities in a purely symbolic fashion can be automated, including proof-search and counter-model generation [17, 4, 5, 3, 10, 15, 8]. In its simplest form, the sufficient expressiveness requirement mentioned above corresponds to monadicity [17, 15, 8]. A Nmatrix is monadic when pairs of distinct truth-values can be separated by unary formulas of the logic. This crucial property is decidable, in a straightforward way, for finite logical matrices, as one can simply compute the set of all unary functions expressible in a given finite matrix. However, the computational character of monadicity with respect to Nmatrices has not been studied before.

In this paper we show that, in fact, monadicity is undecidable for Nmatrices. Our proof is obtained by means of a suitable reduction from the halting problem for counter machines, well known to be undecidable [16]. Several details of the construction are inspired by results about the inclusion of infectious values in Nmatrices [9], and also by undecidability results concerning term-dag-automata (a computational model that bears some interesting connections with Nmatrices) [2]. As a consequence, we conclude that the set of all unary multi-functions expressible in a given finite Nmatrix is not computable.

The paper is organized as follows. In Section 2 we introduce and illustrate our objects of study, namely logical matrices and Nmatrices, the logics they induce, and the monadicity property. Section 3 recalls the counter machine model of computation, and shows how its computations can be encoded into suitable Nmatrices. Finally, Section 4 establishes our main results, namely the undecidability of monadicity for Nmatrices, and as a corollary the uncomputability of expressible multi-functions. We conclude, in Section 5, with a discussion of the importance of the results obtained and several topics for further research.

2 Preliminaries

In this section we recall the notion of logical matrix, non-deterministic matrix, and their associated logics. We also introduce, exemplify and discuss the notion of monadicity.

Matrices, Nmatrices and their logics

A signature Σ\Sigma is a family of connectives indexed by their arity, Σ={Σ(k):k}\Sigma=\{\Sigma^{(k)}:k\in\mathbb{N}\}. The set of formulas over Σ\Sigma based on a set of propositional variables PP is denoted by L_Σ(P)L_{\_}\Sigma(P). The set of subformulas (resp, variables) of a formula φL_Σ(P)\varphi\in L_{\_}\Sigma(P) is denoted by 𝖲𝗎𝖻(φ)\operatorname{\mathsf{Sub}}(\varphi) (resp.,𝖵𝖺𝗋(φ)\operatorname{\mathsf{Var}}(\varphi)). There are two subsets of L_Σ(P)L_{\_}\Sigma(P) that will be of particular interest to us: the set of closed formulas, denoted by L_Σ()L_{\_}\Sigma(\emptyset), and the set of unary (or monadic) formulas, denoted by L_Σ({p})L_{\_}\Sigma(\{p\}).

A Σ\Sigma-Nmatrix, is a tuple 𝕄=A,_𝕄,D\mathbb{M}=\langle A,\cdot_{\_}\mathbb{M},D\rangle where AA is the set of truth-values, DAD\subseteq A is the set of designated truth-values, and for each ©Σ(k)\copyright\in\Sigma^{(k)}, the function ©_𝕄:Ak(A){}\copyright_{\_}\mathbb{M}:A^{k}\to\wp(A)\setminus\{\emptyset\} interprets the connective ©\copyright. A Σ\Sigma-Nmatrix 𝕄\mathbb{M} is finite if it contains only a finite number of truth-values and Σ\Sigma is finite. Clearly, this definition generalizes the usual definition of logical matrix, which is recovered when, for every ©Σ(k)\copyright\in\Sigma^{(k)} and a_1,,a_kAa_{\_}1,\ldots,a_{\_}k\in A, ©_𝕄(a_1,,a_k)\copyright_{\_}{\mathbb{M}}(a_{\_}1,\ldots,a_{\_}k) is a singleton. In this case we will sometimes refer to ©_𝕄\copyright_{\_}{\mathbb{M}} simply as a function. A valuation over 𝕄\mathbb{M} is a function v:L_Σ(P)Av:L_{\_}{\Sigma}(P)\rightarrow A, such that, v(©(φ_1,,φ_n))©_𝕄(v(φ_1),,v(φ_n))v(\copyright(\varphi_{\_}1,\dots,\varphi_{\_}n))\in\copyright_{\_}{\mathbb{M}}(v(\varphi_{\_}1),\dots,v(\varphi_{\_}n)) for every ©Σ(k)\copyright\in\Sigma^{(k)}. We use 𝖵𝖺𝗅(𝕄)\operatorname{\mathsf{Val}}(\mathbb{M}) to denote the set of all valuations over 𝕄\mathbb{M}. A valuation v𝖵𝖺𝗅(𝕄)v\in\operatorname{\mathsf{Val}}(\mathbb{M}) is said to satisfy a formula φ\varphi if v(φ)Dv(\varphi)\in D, and is said to falsify φ\varphi, otherwise. Note that every formula φL_Σ(P)\varphi\in L_{\_}{\Sigma}(P), with 𝖵𝖺𝗋(φ)={p_1,,p_k}\operatorname{\mathsf{Var}}(\varphi)=\{p_{\_}1,\ldots,p_{\_}k\}, defines a multi-function φ_𝕄:Ak(A){}\varphi_{\_}\mathbb{M}:A^{k}\to\wp(A)\setminus\{\emptyset\} as φ_𝕄(x_1,,x_k)={v(φ):v𝖵𝖺𝗅(𝕄),v(p_i)=x_i,1ik}\varphi_{\_}\mathbb{M}(x_{\_}1,\ldots,x_{\_}k)=\{v(\varphi):v\in\operatorname{\mathsf{Val}}(\mathbb{M}),v(p_{\_}i)=x_{\_}i,1\leq i\leq k\}. The multi-function φ_𝕄\varphi_{\_}\mathbb{M} is said to be represented, or expressed, by the formula φ\varphi in 𝕄\mathbb{M}. Furthermore, we say that a multi-function ff is expressible in an Nmatrix 𝕄\mathbb{M} if there is a formula φ\varphi such that φ_𝕄=f\varphi_{\_}{\mathbb{M}}=f.

The logic induced by an Nmatrix 𝕄\mathbb{M} is the Tarskian consequence relation _𝕄(L_Σ(P))×L_Σ(P)\vdash_{\_}\mathbb{M}\,\subseteq\wp(L_{\_}\Sigma(P))\times L_{\_}\Sigma(P) defined as Γ_𝕄φ\Gamma\vdash_{\_}\mathbb{M}\varphi whenever, for every v𝖵𝖺𝗅(𝕄)v\in\operatorname{\mathsf{Val}}(\mathbb{M}), if v(Γ)Dv(\Gamma)\subseteq D then v(φ)Dv(\varphi)\in D. This definition generalizes the usual logical matrix semantics [18, 12]. As usual, a formula φ\varphi is said to be a theorem of 𝕄\mathbb{M} if _𝕄φ\emptyset\vdash_{\_}\mathbb{M}\varphi.

Monadicity

Given a Σ\Sigma-Nmatrix 𝕄=A,_𝕄,D\mathbb{M}=\langle A,\cdot_{\_}\mathbb{M},D\rangle, we say that a,bAa,b\in A are separated, written a#ba\#b if aDa\in D and bDb\notin D, or vice-versa. A pair of sets of elements X,YAX,Y\subseteq A are separated, written X#YX\#Y, if for every aXa\in X and bYb\in Y we have that a#ba\#b. Note that X#YX\#Y precisely if XDX\subseteq D and YADY\subseteq A\setminus D, or vice versa. A monadic formula φL_Σ({p})\varphi\in L_{\_}{\Sigma}(\{p\}) such that φ_𝕄(a)#φ_𝕄(b)\varphi_{\_}{\mathbb{M}}(a)\#\varphi_{\_}{\mathbb{M}}(b) is said to separate aa and bb. We say that a set of monadic formulas 𝖲\mathsf{S} is a set of monadic separators for 𝕄\mathbb{M} when, for every pair of distinct truth-values of 𝕄\mathbb{M}, there is a formula of 𝖲\mathsf{S} separating them. An Nmatrix 𝕄\mathbb{M} satisfies monadicity (or simply, is monadic) if there is a set of monadic separators for 𝕄\mathbb{M}.

Example 2.1.

Consider the signature Σ={¬,,,}\Sigma=\{\neg,\vee,\wedge,\rightarrow\} and the Σ\Sigma-matrix 𝕄_Ł=A,_Ł,D\mathbb{M}_{\_}{\text{\L}}=\langle A,\cdot_{\_}{\text{\L}},D\rangle, with A={0,12,1}A=\{0,\frac{1}{2},1\} and D={1}D=\{1\}, corresponding to Łukasiewicz 33-valued logic, with interpretations as described in the following tables.

xx ¬_Ł(x)\neg_{\_}{\text{\L}}(x)
0 11
12\frac{1}{2} 12\frac{1}{2}
11 0
_Ł\vee_{\_}{\text{\L}} 0 12\frac{1}{2} 11
0 0 12\frac{1}{2} 11
12\frac{1}{2} 12\frac{1}{2} 12\frac{1}{2} 11
11 11 11 11
_Ł\wedge_{\_}{\text{\L}} 0 12\frac{1}{2} 11
0 0 0 0
12\frac{1}{2} 0 12\frac{1}{2} 12\frac{1}{2}
11 0 12\frac{1}{2} 11
_Ł\rightarrow_{\_}{\text{\L}} 0 12\frac{1}{2} 11
0 11 11 11
12\frac{1}{2} 12\frac{1}{2} 11 11
11 0 12\frac{1}{2} 11

𝕄Ł\mathbb{M}_{\text{\L}} is monadic with {p,¬p}\{p,\neg p\} as a set of separators. Indeed, pp separates 11 from 0, and also 11 from 12\frac{1}{2}, whereas ¬p\neg p separates 0 and 12\frac{1}{2}. One may wonder, though, whether one could separate 0 and 12\frac{1}{2} without using negation. \triangle

Remark 2.2.

Notice that we can decide if a given matrix 𝕄\mathbb{M} is monadic by algorithmically generating every unary function expressible in 𝕄\mathbb{M}, as it is usually done when calculating clones over finite algebras [13]. This procedure is, however, quite expensive, since there are, at most, nnn^{n} unary formulas from a set with nn values to itself. The next example illustrates this procedure.

Example 2.3.

Let 𝕄Ł\mathbb{M}_{\text{\L}}^{\prime} be the {,,}\{\vee,\wedge,\rightarrow\}-reduct of 𝕄Ł\mathbb{M}_{\text{\L}} introduced in Example 2.1, corresponding to the negationless fragment of Łukasiewicz 33-valued logic. Let us show that 𝕄Ł\mathbb{M}_{\text{\L}}^{\prime} is not monadic, by generating every unary expressible function. For simplicity, we represent a unary function h:AAh:A\rightarrow A as a tuple (h(0),h(12),h(1))(h(0),h(\frac{1}{2}),h(1)).

The formulas pp, ppp\vee p and ppp\wedge p define the same function (0,12,1)(0,\frac{1}{2},1) and the formula ppp\rightarrow p defines the constant function (1,1,1)(1,1,1). It is easy to see that we cannot obtain new functions by further applying connectives, so (0,12,1)(0,\frac{1}{2},1) and (1,1,1)(1,1,1) are the only expressible unary functions. For example, ((pp)(pp))_𝕄Ł=(1,1,1)((p\rightarrow p)\rightarrow(p\rightarrow p))_{\_}{\mathbb{M}_{\text{\L}}^{\prime}}=(1,1,1). We conclude that 0 cannot be separated from 12\frac{1}{2}, and so 𝕄Ł\mathbb{M}_{\text{\L}}^{\prime} is not monadic. \triangle

Monadicity in Nmatrices

In the presence of non-determinism, we cannot follow the strategy described in Remark 2.2 and Example 2.3. A fundamental difference from the deterministic case is that the multi-functions represented by formulas in a Nmatrix are sensitive to the syntax since, even if there are multiple choices for the value of a subformula, all its occurrences need to have the same value. Crucially, on an Nmatrix 𝕄\mathbb{M}, the multi-function ©(φ_1,,φ_k)_𝕄\copyright(\varphi_{\_}1,\ldots,\varphi_{\_}k)_{\_}\mathbb{M} does not depend only on the multi-functions ©_𝕄\copyright_{\_}\mathbb{M} and (φ_1)_𝕄(\varphi_{\_}1)_{\_}\mathbb{M}, …, (φ_k)_𝕄(\varphi_{\_}k)_{\_}\mathbb{M}, as we shall see in the next example.

Hence, contrarily to what happens in the deterministic case, when generating the expressible multi-functions in an Nmatrix 𝕄\mathbb{M} (to find if 𝕄\mathbb{M} is monadic, or for any other purpose), we cannot just keep the information about the multi-functions themselves but also about the formulas that produce them. Otherwise, we might generate a non-expressible function (as every occurrence of a subformula must have the same value) or miss some multi-functions that are still expressible.

With the intent of making the notation lighter, when representing the interpretation of the connectives using tables, we drop the curly brackets around the elements of an output set. For example, in the table of Example 2.4 we simply write a,ca,c instead of {a,c}\{a,c\}.

Example 2.4.

Consider the signature Σ\Sigma with only one binary connective gg, and two Nmatrices 𝕄={a,b,c},_𝕄,D\mathbb{M}=\langle\{a,b,c\},\cdot_{\_}{\mathbb{M}},D\rangle and 𝕄={a,b,c},_𝕄,{c}\mathbb{M}^{\prime}=\langle\{a,b,c\},\cdot_{\_}{\mathbb{M}^{\prime}},\{c\}\rangle, with interpretation described in the following table.

g_𝕄g_{\_}\mathbb{M} aa bb cc
aa cc aa b,cb,c
bb bb cc a,ca,c
cc b,cb,c a,ca,c cc
g_𝕄g_{\_}{\mathbb{M}^{\prime}} aa bb cc
aa cc aa cc
bb bb cc aa
cc b,cb,c a,ca,c cc

Let φ=g(g(p,p),p)\varphi=g(g(p,p),p) and ψ=g(p,g(p,p))\psi=g(p,g(p,p)). In 𝕄\mathbb{M}, φ_𝕄=ψ_𝕄=({b,c},{a,c},{c})\varphi_{\_}{\mathbb{M}}=\psi_{\_}{\mathbb{M}}=(\{b,c\},\{a,c\},\{c\}). Although these formulas define the same multi-function, they are not interchangeable, as g(φ,φ)_𝕄=g(ψ,ψ)_𝕄=g(p,p)_𝕄=({c},{c},{c})g(\varphi,\varphi)_{\_}\mathbb{M}=g(\psi,\psi)_{\_}\mathbb{M}=g(p,p)_{\_}\mathbb{M}=(\{c\},\{c\},\{c\}) but g(φ,ψ)_𝕄=g(ψ,φ)_𝕄=({a,c},{b,c},{c})g(\varphi,\psi)_{\_}\mathbb{M}=g(\psi,\varphi)_{\_}\mathbb{M}=(\{a,c\},\{b,c\},\{c\}), thus illustrating the already mentioned sensitivity to the syntax. Still, consider v_x:L_Σ(P){a,b,c}v_{\_}x:L_{\_}{\Sigma}(P)\to\{a,b,c\}, with x{a,b,c}x\in\{a,b,c\}, defined as

v_x(γ)={xif γPcotherwise.v_{\_}x(\gamma)=\begin{cases}x&\text{if }\gamma\in P\\ c&\text{otherwise}.\end{cases}

These functions can easily be shown to be valuations over 𝕄\mathbb{M} for every choice of xx and so, for every unary formula φp\varphi\neq p, we have that cφ_𝕄(a)φ_𝕄(b)φ_𝕄(c)c\in\varphi_{\_}{\mathbb{M}}(a)\cap\varphi_{\_}{\mathbb{M}}(b)\cap\varphi_{\_}{\mathbb{M}}(c). We conclude that, apart from pp, no unary formula can separate elements of {a,b,c}\{a,b,c\}, and so 𝕄\mathbb{M} is not monadic, for any choice of DD.

In 𝕄\mathbb{M}^{\prime} the outcome is radically different. As g(p,p)_𝕄(x)={c}g(p,p)_{\_}{\mathbb{M}^{\prime}}(x)=\{c\} for every x{a,b,c}x\in\{a,b,c\}, we have g(p,g(p,p))_𝕄(a)={c}g(p,g(p,p))_{\_}{\mathbb{M}^{\prime}}(a)=\{c\} and g(p,g(p,p))_𝕄(b)={a}g(p,g(p,p))_{\_}{\mathbb{M}^{\prime}}(b)=\{a\} and so, in this case, 𝕄\mathbb{M}^{\prime} is monadic with set of separators {p,g(p,g(p,p))}\{p,g(p,g(p,p))\}. \triangle

3 Counter machines and Nmatrices

In this section we recall the essentials of counter machines, and define a suitable finite Nmatrix representing the computations of any given counter machine.

Counter machines

A (deterministic) counter machine is a tuple 𝒞=n,Q,q𝗂𝗇𝗂𝗍,δ\mathcal{C}=\langle n,Q,q_{\mathsf{init}},\delta\rangle, where nn\in\mathbb{N} is the number of counters, QQ is a finite set of states, q𝗂𝗇𝗂𝗍Qq_{\mathsf{init}}\in Q is the initial state, and δ\delta is a partial transition function δ:Q↛({i++:1in}×Q)({i𝗍𝖾𝗌𝗍:1in}×Q2)\delta:Q\not\to(\{i^{++}:1\leq i\leq n\}\times Q)\cup(\{i^{\mathsf{test}}:1\leq i\leq n\}\times Q^{2}).

The set of halting states of 𝒞\mathcal{C} is denoted by H={qQ:δ(q) is undefined}H=\{q\in Q:\delta(q)\text{ is undefined}\}.

A configuration of 𝒞\mathcal{C} is a tuple C=(q,x)Q×_0nC=(q,\vec{x})\in Q\times\mathbb{N}_{\_}0^{n}, where qq is a state, and x=x_1,,x_n\vec{x}=x_{\_}1,\ldots,x_{\_}n are the values of the counters. Let 𝖢𝗈𝗇𝖿(𝒞)\mathsf{Conf}(\mathcal{C}) be the set of all configurations. C𝖢𝗈𝗇𝖿(𝒞)C\in\mathsf{Conf}(\mathcal{C}) is said to be the initial configuration if q=q𝗂𝗇𝗂𝗍q=q_{\mathsf{init}} and x=0\vec{x}=\vec{0}. CC is said to be a halting configuration if qHq\in H.

When (q,y)(q,\vec{y}) is not a halting configuration, the transition function δ\delta completely determines the next configuration nxt(q,y)\textsf{nxt}(q,\vec{y}) as follows:

nxt(q,y)={(q,y+𝖾_i)if δ(q)=i++,q,(q′′,y)if δ(q)=i𝗍𝖾𝗌𝗍,q′′,q′′′ and x_i=0,(q′′′,y𝖾_i)if δ(q)=i𝗍𝖾𝗌𝗍,q′′,q′′′ and x_i0,\textsf{nxt}(q,\vec{y})=\begin{cases}(q^{\prime},\vec{y}+\vec{\mathsf{e}_{\_}i})&\text{if }\delta(q)=\langle i^{++},q^{\prime}\rangle,\\ (q^{\prime\prime},\vec{y})&\text{if }\delta(q)=\langle i^{\mathsf{test}},q^{\prime\prime},q^{\prime\prime\prime}\rangle\text{ and }x_{\_}i=0,\\ (q^{\prime\prime\prime},\vec{y}-\vec{\mathsf{e}_{\_}i})&\text{if }\delta(q)=\langle i^{\mathsf{test}},q^{\prime\prime},q^{\prime\prime\prime}\rangle\text{ and }x_{\_}i\neq 0,\end{cases}

where 𝖾_i\vec{\mathsf{e}_{\_}i} is such that (𝖾_i)_i=1(\mathsf{e}_{\_}i)_{\_}i=1 and (𝖾_i)_j=0(\mathsf{e}_{\_}i)_{\_}j=0, for all jij\neq i.

The computation of 𝒞\mathcal{C} is a finite or infinite sequence of configurations C_i_i<η\langle C_{\_}i\rangle_{\_}{i<\eta}, where η_0{ω}\eta\in\mathbb{N}_{\_}0\cup\{\omega\} such that C_0C_{\_}0 is the initial configuration, and for each i<ηi<\eta, either C_iC_{\_}i is a halting configuration and i+1=ηi+1=\eta is the length of the computation, or else C_i+1=nxt(C_i)C_{\_}{i+1}=\textsf{nxt}(C_{\_}i).

The intuition behind the transitions of a counter machine is clear from the underlying notion of computation, and in particular the definition of the next configuration. Clearly, δ(q)=i++,r\delta(q)=\langle i^{++},r\rangle results in incrementing the ii-th counter and moving to state rr, whereas δ(q)=i𝗍𝖾𝗌𝗍,r,s\delta(q)=\langle i^{\mathsf{test}},r,s\rangle either moves to state rr, leaving the counters unchanged, when the value of the ii-th counter is zero, or moves to state ss, and decrements the ii-th counter, when its value is not zero. As usual in counter machine models (see [16]), and also for the sake of simplicity, we are assuming that in the initial configuration all counters have value 0. This is well known not to hinder the computational power of the model, as a machine can always start by setting the counters to other desired input values. We will base our undecidability result on the following well known result about counter machines.

Theorem 3.1 ([16]).

It is undecidable if a given counter machine halts when starting with all counters set to zero.

In what follows, given xAn\vec{x}\in A^{n} and f:ABf:A\rightarrow B, we define f(x)Bnf(\vec{x})\in B^{n} as f(x)=f(x_i):1inf(\vec{x})=\langle f(x_{\_}i):1\leq i\leq n\rangle. For a given counter machine 𝒞=n,Q,q𝗂𝗇𝗂𝗍,δ\mathcal{C}=\langle n,Q,q_{\mathsf{init}},\delta\rangle, we define the signature Σ_𝒞\Sigma_{\_}{\mathcal{C}} such that Σ_𝒞(0)={𝗓𝖾𝗋𝗈,ϵ}\Sigma_{\_}{\mathcal{C}}^{(0)}=\{\mathsf{zero},\epsilon\}, Σ_𝒞(1)={𝗌𝗎𝖼}\Sigma_{\_}{\mathcal{C}}^{(1)}=\{\mathsf{suc}\}, Σ_𝒞(n+1)={𝗌𝗍𝖾𝗉_q:qQ}\Sigma_{\_}{\mathcal{C}}^{(n+1)}=\{\mathsf{step}_{\_}q:q\in Q\} and Σ_𝒞(j)=\Sigma_{\_}{\mathcal{C}}^{(j)}=\emptyset, for all j{0,1,n+1}j\notin\{0,1,n+1\}. As usual, 𝗓𝖾𝗋𝗈\mathsf{zero} and 𝗌𝗎𝖼\mathsf{suc} allow us to encode every k_0k\in\mathbb{N}_{\_}0 as the closed formula 𝖾𝗇𝖼(k)=𝗌𝗎𝖼k(𝗓𝖾𝗋𝗈)\mathsf{enc}(k)=\mathsf{suc}^{k}(\mathsf{zero}). Moreover, we can encode every finite sequence of configurations C_0,,C_k\langle C_{\_}0,\ldots,C_{\_}k\rangle as a sequence formula in the following way:

  • 𝗌𝖾𝗊()=ϵ\mathsf{seq}(\langle\rangle)=\epsilon, and 𝗌𝖾𝗊(C_0,,C_k1,(q,y))=𝗌𝗍𝖾𝗉_q(𝗌𝖾𝗊(C_0,,C_k1),𝖾𝗇𝖼(y))\mathsf{seq}(\langle C_{\_}0,\ldots,C_{\_}{k-1},(q,\vec{y})\rangle)=\mathsf{step}_{\_}q(\mathsf{seq}(\langle C_{\_}0,\ldots,C_{\_}{k-1}\rangle),\mathsf{enc}(\vec{y})).

We will construct a finite Nmatrix 𝕄_𝒞\mathbb{M}_{\_}\mathcal{C} over Σ_𝒞\Sigma_{\_}\mathcal{C} that recognizes as a theorem precisely the finite computation of 𝒞\mathcal{C}, if it exists. This means that 𝕄_𝒞\mathbb{M}_{\_}\mathcal{C} can only falsify a formula φ\varphi if it is not a sequence formula, or if φ=𝗌𝖾𝗊(C_0,,C_k)\varphi=\mathsf{seq}(\langle C_{\_}0,\ldots,C_{\_}k\rangle) but C_0C_{\_}0 is not the initial configuration of 𝒞\mathcal{C}, or C_kC_{\_}k is not a halting configuration of 𝒞\mathcal{C}, or nxt(C_i)C_i+1\textsf{nxt}(C_{\_}i)\neq C_{\_}{i+1} for some 0i<k0\leq i<k.

From counter machines to Nmatrices

For a given counter machine 𝒞=n,Q,q𝗂𝗇𝗂𝗍,δ\mathcal{C}=\langle n,Q,q_{\mathsf{init}},\delta\rangle let

Rm={𝚛_=0,𝚛_0,𝚛_1,𝚛_2} and 𝐂𝐨𝐧𝐟={𝚌𝚘𝚗𝚏_q,𝚛:qQ,𝚛Rmn}\textbf{Rm}=\{\mathtt{r}_{\_}{=0},\mathtt{r}_{\_}{\geq 0},\mathtt{r}_{\_}{\geq 1},\mathtt{r}_{\_}{\geq 2}\}\qquad\text{ and }\qquad\mathbf{Conf}=\{\mathtt{conf}_{\_}{q,\overrightarrow{\mathtt{r}}}:q\in Q,\overrightarrow{\mathtt{r}}\in\textbf{Rm}^{n}\}

and consider the Nmatrix 𝕄_𝒞=A,_𝕄_𝒞,D\mathbb{M}_{\_}\mathcal{C}=\langle A,\cdot_{\_}{\mathbb{M}_{\_}\mathcal{C}},D\rangle over Σ_𝒞\Sigma_{\_}\mathcal{C}, where

A=Rm𝐂𝐨𝐧𝐟{𝚒𝚗𝚒𝚝,𝚎𝚛𝚛𝚘𝚛} and D={𝚌𝚘𝚗𝚏_q,𝚛:qH,𝚛Rmn} and\displaystyle A=\textbf{Rm}\cup\mathbf{Conf}\cup\{\mathtt{init},\mathtt{error}\}\qquad\text{ and }\qquad D=\{\mathtt{conf}_{\_}{q,\overrightarrow{\mathtt{r}}}:q\in H,\overrightarrow{\mathtt{r}}\in\textbf{Rm}^{n}\}\qquad\text{ and }
𝗓𝖾𝗋𝗈_𝕄_𝒞={𝚛_=0,𝚛_0}ϵ_𝕄_𝒞={𝚒𝚗𝚒𝚝}𝗌𝗎𝖼_𝕄_𝒞(x)={{𝚛_1}if x=𝚛_=0{𝚛_0,𝚛_1}if x=𝚛_0{𝚛_2}if x{𝚛_1,𝚛_2}{𝚎𝚛𝚛𝚘𝚛}otherwise\mathsf{zero}_{\_}{\mathbb{M}_{\_}\mathcal{C}}=\{\mathtt{r}_{\_}{=0},\mathtt{r}_{\_}{\geq 0}\}\qquad\epsilon_{\_}{\mathbb{M}_{\_}\mathcal{C}}=\{\mathtt{init}\}\qquad\mathsf{suc}_{\_}{\mathbb{M}_{\_}\mathcal{C}}(x)=\begin{cases}\{\mathtt{r}_{\_}{\geq 1}\}&\quad\text{if }x=\mathtt{r}_{\_}{=0}\\ \{\mathtt{r}_{\_}{\geq 0},\mathtt{r}_{\_}{\geq 1}\}&\quad\text{if }x=\mathtt{r}_{\_}{\geq 0}\\ \{\mathtt{r}_{\_}{\geq 2}\}&\quad\text{if }x\in\{\mathtt{r}_{\_}{\geq 1},\mathtt{r}_{\_}{\geq 2}\}\\ \{\mathtt{error}\}&\quad\text{otherwise}\end{cases}
(𝗌𝗍𝖾𝗉_q)_𝕄_𝒞(x,z)={{𝚌𝚘𝚗𝚏_q,z}if x=𝚒𝚗𝚒𝚝,q=q_𝗂𝗇𝗂𝗍 and z{𝚛_=0}n{𝚛_0}n, orif x=𝚌𝚘𝚗𝚏_q,y,zRmn, and δ(q)=i𝗍𝖾𝗌𝗍,q,s,y_i{𝚛_=0,𝚛_0} and y=z, or δ(q)=i𝗍𝖾𝗌𝗍,s,q,y_i𝗌𝗎𝖼_𝕄_𝒞(z_i) and z_j=y_j for ji, or δ(q)=i++,q,z_i𝗌𝗎𝖼_𝕄_𝒞(y_i) and z_j=y_j for ji{𝚎𝚛𝚛𝚘𝚛}otherwise(\mathsf{step}_{\_}q)_{\_}{\mathbb{M}_{\_}\mathcal{C}}(x,\vec{z})=\begin{cases}\{\mathtt{conf}_{\_}{q,\vec{z}}\}&\text{if }x=\mathtt{init},q=q_{\_}{\mathsf{init}}\text{ and }\vec{z}\in\{\mathtt{r}_{\_}{=0}\}^{n}\cup\{\mathtt{r}_{\_}{\geq 0}\}^{n},\text{ or}\\ &\text{if }x=\mathtt{conf}_{\_}{q^{\prime},\overrightarrow{y}},\overrightarrow{z}\in\textbf{Rm}^{n},\text{ and }\\ &\,\,\delta(q^{\prime})=\langle i^{\mathsf{test}},q,s\rangle,y_{\_}i\in\{\mathtt{r}_{\_}{=0},\mathtt{r}_{\_}{\geq 0}\}\text{ and }\overrightarrow{y}=\overrightarrow{z},\text{ or }\\ &\,\,\delta(q^{\prime})=\langle i^{\mathsf{test}},s,q\rangle,y_{\_}i\in\mathsf{suc}_{\_}{\mathbb{M}_{\_}\mathcal{C}}(z_{\_}i)\text{ and }z_{\_}j=y_{\_}j\text{ for }j\neq i,\text{ or }\\ &\,\,\delta(q^{\prime})=\langle i^{++},q\rangle,z_{\_}i\in\mathsf{suc}_{\_}{\mathbb{M}_{\_}\mathcal{C}}(y_{\_}i)\text{ and }z_{\_}j=y_{\_}j\text{ for }j\neq i\\ \{\mathtt{error}\}&\text{otherwise}\end{cases}

where, sQs\in Q represents an arbitrary state.

𝕄_𝒞\mathbb{M}_{\_}\mathcal{C} is conceived as a finite way of representing the behavior of 𝒞\mathcal{C}. For that purpose, it is useful to understand the operations 𝗓𝖾𝗋𝗈\mathsf{zero} and 𝗌𝗎𝖼\mathsf{suc} as means of representing the natural number values of the counters. Their interpretation, however, is finitely defined over the abstract values Rm. In fact, in order to check if some formula φ\varphi encodes a sequence of computations respecting nxt, it is not essential to distinguish all natural values. Indeed, it is easy to conclude from the definition of counter machine that in each computation step its counters either retain their previous values, or else they are incremented or decremented. As we set the initial configuration with all counters set to zero and the effect of test transitions also depends on detecting zero values, it is sufficient to being able to characterize unambiguously the value 0 and, additionally, being able to recognize pairs of values whose difference is larger than one. This is successfully accomplished with the proposed non-deterministic interpretation of 𝗌𝗎𝖼\mathsf{suc}, as shall be made clear below. The ϵ\epsilon and 𝗌𝗍𝖾𝗉\mathsf{step} operations are then meant to represent sequences of configurations, whereas their interpretation over the abstract values 𝐂𝐨𝐧𝐟{𝚒𝚗𝚒𝚝}\mathbf{Conf}\cup\{\mathtt{init}\} guarantees that consecutive configurations respect nxt. Of course, the designated values of 𝕄_𝒞\mathbb{M}_{\_}\mathcal{C} are those corresponding to halting configurations. The 𝚎𝚛𝚛𝚘𝚛\mathtt{error} value is absorbing with respect to the interpretation of all operations, and gathers all meaningless situations. Overall, as we will show, 𝕄_𝒞\mathbb{M}_{\_}{\mathcal{C}} induces a logic that has at most one theorem, corresponding to the computation of 𝒞\mathcal{C}, if it is halting.

The inner workings of the construction

In the next examples we will illustrate the way the Nmatrix 𝕄_𝒞\mathbb{M}_{\_}\mathcal{C} encodes the computations of 𝒞\mathcal{C}. Proofs of the general statements are postponed to the next section.

In order for _𝕄_𝒞\vdash_{\_}{\mathbb{M}_{\_}\mathcal{C}} to have, at most, the formula representing the computation of 𝒞\mathcal{C} as theorem, 𝖵𝖺𝗅(𝕄_𝒞)\operatorname{\mathsf{Val}}(\mathbb{M}_{\_}\mathcal{C}) must contain enough valuations to refute every formula not representing the computation of 𝒞\mathcal{C}. These valuations are presented in the following example

Example 3.2.

By definition of 𝗌𝖾𝗊\mathsf{seq}, it is clear that no formula containing variables corresponds to a sequence of configurations. Furthermore, no formula containing variables can be a theorem of 𝕄_𝒞\mathbb{M}_{\_}\mathcal{C} since these formulas are easily refuted by any valuation sending the variables to the truth value 𝚎𝚛𝚛𝚘𝚛\mathtt{error}, as this value is absorbing (aka infectious), that is, 𝗌𝗎𝖼_𝕄_𝒞(x)=𝚎𝚛𝚛𝚘𝚛\mathsf{suc}_{\_}{\mathbb{M}_{\_}{\mathcal{C}}}(x)=\mathtt{error} whenever x=𝚎𝚛𝚛𝚘𝚛x=\mathtt{error} and (𝗌𝗍𝖾𝗉_q)_𝕄_𝒞(x,z)=𝚎𝚛𝚛𝚘𝚛(\mathsf{step}_{\_}q)_{\_}{\mathbb{M}_{\_}\mathcal{C}}(x,\vec{z})=\mathtt{error} whenever x=𝚎𝚛𝚛𝚘𝚛x=\mathtt{error} or z_i=𝚎𝚛𝚛𝚘𝚛z_{\_}i=\mathtt{error}. Because of this, from here onwards, we concern ourselves only with the truth-values assigned to closed formulas.

We do not have much freedom left, but it will be enough. The interpretations of the connectives are all deterministic, except in the case of 𝗓𝖾𝗋𝗈_𝕄_𝒞\mathsf{zero}_{\_}{\mathbb{M}_{\_}\mathcal{C}} and 𝗌𝗎𝖼_𝕄_𝒞(𝚛_0)\mathsf{suc}_{\_}{\mathbb{M}_{\_}\mathcal{C}}(\mathtt{r}_{\_}{\geq 0}). This means that, if v𝖵𝖺𝗅(𝕄_𝒞)v\in\operatorname{\mathsf{Val}}(\mathbb{M}_{\_}\mathcal{C}) and v(𝗓𝖾𝗋𝗈)=𝚛_=0v(\mathsf{zero})=\mathtt{r}_{\_}{=0}, then there is no choice left for the values assigned by vv to the remaining closed formulas. Consider, therefore, the following valuation

v_=0(ψ)={𝚛_=0if ψ=𝗓𝖾𝗋𝗈,𝚛_1if ψ=𝖾𝗇𝖼(1),𝚛_2if ψ=𝖾𝗇𝖼(j) with j2,𝚒𝚗𝚒𝚝if ψ=ϵ,(𝗌𝗍𝖾𝗉_q)_𝕄_𝒞(v_=0(φ),z)if ψ=𝗌𝗍𝖾𝗉_q(φ,ψ_1,,ψ_n) and z_i=v_=0(ψ_i),𝚎𝚛𝚛𝚘𝚛,otherwise.v^{=}_{\_}0(\psi)=\begin{cases}\mathtt{r}_{\_}{=0}&\text{if }\psi=\mathsf{zero},\\ \mathtt{r}_{\_}{\geq 1}&\text{if }\psi=\mathsf{enc}(1),\\ \mathtt{r}_{\_}{\geq 2}&\text{if }\psi=\mathsf{enc}(j)\text{ with }j\geq 2,\\ \mathtt{init}&\text{if }\psi=\epsilon,\\ (\mathsf{step}_{\_}q)_{\_}{\mathbb{M}_{\_}\mathcal{C}}(v^{=}_{\_}0(\varphi),\vec{z})&\text{if }\psi=\mathsf{step}_{\_}q(\varphi,\psi_{\_}1,\dots,\psi_{\_}n)\text{ and }z_{\_}i=v^{=}_{\_}0(\psi_{\_}i),\\ \mathtt{error},&\text{otherwise}.\end{cases}

If v(𝗓𝖾𝗋𝗈)=𝚛_0v(\mathsf{zero})=\mathtt{r}_{\_}{\geq 0}, however, we can still loop the truth values assigned to formulas of the form 𝖾𝗇𝖼(j)\mathsf{enc}(j). The amount of loops could be infinite or finite, though the infinite case is of no interest to us, since it does not allow us to falsify any of the formulas that we want to falsify.

Let k_0k\in\mathbb{N}_{\_}0, consider the valuations

v_k(ψ)={𝚛_0if ψ=𝖾𝗇𝖼(j) with jk,𝚛_1if ψ=𝖾𝗇𝖼(j) with j=k+1,𝚛_2if ψ=𝖾𝗇𝖼(j) with jk+2,𝚒𝚗𝚒𝚝if ψ=ϵ,(𝗌𝗍𝖾𝗉_q)_𝕄_𝒞(v_k(φ),z)if ψ=𝗌𝗍𝖾𝗉_q(φ,ψ_1,,ψ_n) and z_i=v_k(ψ_i),𝚎𝚛𝚛𝚘𝚛,otherwise.v_{\_}k(\psi)=\begin{cases}\mathtt{r}_{\_}{\geq 0}&\text{if }\psi=\mathsf{enc}(j)\text{ with }j\leq k,\\ \mathtt{r}_{\_}{\geq 1}&\text{if }\psi=\mathsf{enc}(j)\text{ with }j=k+1,\\ \mathtt{r}_{\_}{\geq 2}&\text{if }\psi=\mathsf{enc}(j)\text{ with }j\geq k+2,\\ \mathtt{init}&\text{if }\psi=\epsilon,\\ (\mathsf{step}_{\_}q)_{\_}{\mathbb{M}_{\_}\mathcal{C}}(v_{\_}k(\varphi),\vec{z})&\text{if }\psi=\mathsf{step}_{\_}q(\varphi,\psi_{\_}1,\dots,\psi_{\_}n)\text{ and }z_{\_}i=v_{\_}k(\psi_{\_}i),\\ \mathtt{error},&\text{otherwise}.\end{cases}

\triangle

As previously discussed, it is crucial for the valuations in 𝖵𝖺𝗅(𝕄_𝒞)\operatorname{\mathsf{Val}}(\mathbb{M}_{\_}\mathcal{C}) to be able to identify whenever two given numbers a,b_0a,b\in\mathbb{N}_{\_}0 are not consecutive, or different. To this aim, for every pair a,b(_0)2a,b\in(\mathbb{N}_{\_}0)^{2}, we denote by μ_+a,b,μ_a,b,μ_a,b\mu^{+}_{\_}{a,b},\mu^{-}_{\_}{a,b},\mu^{\neq}_{\_}{a,b} the valuations determined by the following conditions

μ_+a,b={v_aif ba+1,v_a1if ba and a0,v_=0if ba and a=0.μ_a,b={v_a2if ba2,v_a1if ba1 and a0,v_=0if ba1 and a=0.μ_a,b={v_=0if a=0,v_a1if a0.\mu^{+}_{\_}{a,b}=\begin{cases}v_{\_}a&\text{if }b\geq a+1,\\ v_{\_}{a-1}&\text{if }b\leq a\text{ and }a\neq 0,\\ v^{=}_{\_}0&\text{if }b\leq a\text{ and }a=0.\end{cases}\quad\mu^{-}_{\_}{a,b}=\begin{cases}v_{\_}{a-2}&\text{if }b\leq a-2,\\ v_{\_}{a-1}&\text{if }b\geq a-1\text{ and }a\neq 0,\\ v^{=}_{\_}0&\text{if }b\geq a-1\text{ and }a=0.\end{cases}\quad\mu^{\neq}_{\_}{a,b}=\begin{cases}v^{=}_{\_}0&\text{if }a=0,\\ v_{\_}{a-1}&\text{if }a\neq 0.\end{cases}
Remark 3.3.

The following properties can be easily checked by inspecting the corresponding definition:

  • if ba+1b\neq a+1 then μ_+a,b(𝖾𝗇𝖼(b))𝗌𝗎𝖼_𝕄_𝒞(μ_+a,b(𝖾𝗇𝖼(a)))\mu^{+}_{\_}{a,b}(\mathsf{enc}(b))\notin\mathsf{suc}_{\_}{\mathbb{M}_{\_}\mathcal{C}}(\mu^{+}_{\_}{a,b}(\mathsf{enc}(a))),

  • if ba1b\neq a-1 then μ_a,b(𝖾𝗇𝖼(a))𝗌𝗎𝖼_𝕄_𝒞(μ_a,b(𝖾𝗇𝖼(b)))\mu^{-}_{\_}{a,b}(\mathsf{enc}(a))\notin\mathsf{suc}_{\_}{\mathbb{M}_{\_}\mathcal{C}}(\mu^{-}_{\_}{a,b}(\mathsf{enc}(b))), and

  • if bab\neq a then μ_a,b(𝖾𝗇𝖼(b))μ_a,b(𝖾𝗇𝖼(a))\mu^{\neq}_{\_}{a,b}(\mathsf{enc}(b))\neq\mu^{\neq}_{\_}{a,b}(\mathsf{enc}(a)).

In the following two examples we consider two different machines that should make clear the soundness of our construction. In the first one, we show how every valuation validates the formula encoding a finite computation. We also see how sequences of configurations can fail to respect nxt in different ways and how we can use the valuations presented in Example 3.2 to falsify formulas encoding them. In the second example, we show a counter machine that never halts.

Example 3.4.

Consider the counter machine 𝒞=1,Q,q𝗂𝗇𝗂𝗍,δ\mathcal{C}=\langle 1,Q,q_{\mathsf{init}},\delta\rangle with Q={q𝗂𝗇𝗂𝗍,q_1,q_2,q_3}Q=\{q_{\mathsf{init}},q_{\_}1,q_{\_}2,q_{\_}3\} and δ\delta as defined in the following table

qq q𝗂𝗇𝗂𝗍q_{\mathsf{init}} q_1q_{\_}1 q_2q_{\_}2 q_3q_{\_}3
δ(q)\delta(q) 1++,q_1\langle 1^{++},q_{\_}1\rangle 1𝗍𝖾𝗌𝗍,q_3,q_2\langle 1^{\mathsf{test}},q_{\_}3,q_{\_}2\rangle 1𝗍𝖾𝗌𝗍,q_3,q_3\langle 1^{\mathsf{test}},q_{\_}3,q_{\_}3\rangle undefined

The only halting state of 𝒞\mathcal{C} is q_3q_{\_}3 and the machine 𝒞\mathcal{C} has the following finite computation

(q𝗂𝗇𝗂𝗍,0),(q_1,1),(q_2,0),(q_3,0).\langle(q_{\mathsf{init}},0),(q_{\_}1,1),(q_{\_}2,0),(q_{\_}3,0)\rangle.

For every v𝖵𝖺𝗅(𝕄_𝒞)v\in\operatorname{\mathsf{Val}}(\mathbb{M}_{\_}\mathcal{C}), we have v(ϵ)=𝚒𝚗𝚒𝚝v(\epsilon)=\mathtt{init}. The values of v(𝖾𝗇𝖼(k))v(\mathsf{enc}(k)) are dependent on vv: if v=v_=0v=v^{=}_{\_}0 then v(𝖾𝗇𝖼(0))=𝚛_=0v(\mathsf{enc}(0))=\mathtt{r}_{\_}{=0} and v(𝖾𝗇𝖼(1))=𝚛_1v(\mathsf{enc}(1))=\mathtt{r}_{\_}{\geq 1}. If vv_=0v\neq v^{=}_{\_}0 then v(𝖾𝗇𝖼(0))=𝚛_0v(\mathsf{enc}(0))=\mathtt{r}_{\_}{\geq 0} and v(𝖾𝗇𝖼(1))(𝗌𝗎𝖼)_𝕄_𝒞(𝚛_0)={𝚛_0,𝚛_1}v(\mathsf{enc}(1))\in(\mathsf{suc})_{\_}{\mathbb{M}_{\_}\mathcal{C}}(\mathtt{r}_{\_}{\geq 0})=\{\mathtt{r}_{\_}{\geq 0},\mathtt{r}_{\_}{\geq 1}\}.

Let φ_j\varphi_{\_}j be the formula representing the prefix with only the first j+1j+1 configurations, we obtain, from the above equalities and the definition of 𝗌𝗍𝖾𝗉_𝕄\mathsf{step}_{\_}\mathbb{M}, that

v(φ_0)\displaystyle v(\varphi_{\_}0) =v(𝗌𝗍𝖾𝗉_q𝗂𝗇𝗂𝗍(ϵ,𝖾𝗇𝖼(0)))=(𝗌𝗍𝖾𝗉_q𝗂𝗇𝗂𝗍)_𝕄(𝚒𝚗𝚒𝚝,v(𝖾𝗇𝖼(0)))=𝚌𝚘𝚗𝚏_q𝗂𝗇𝗂𝗍,v(𝖾𝗇𝖼(0))\displaystyle=v(\mathsf{step}_{\_}{q_{\mathsf{init}}}(\epsilon,\mathsf{enc}(0)))=(\mathsf{step}_{\_}{q_{\mathsf{init}}})_{\_}\mathbb{M}(\mathtt{init},v(\mathsf{enc}(0)))=\mathtt{conf}_{\_}{q_{\mathsf{init}},v(\mathsf{enc}(0))}
v(φ_1)\displaystyle v(\varphi_{\_}1) =v(𝗌𝗍𝖾𝗉_q_1(φ_0,𝖾𝗇𝖼(1)))=(𝗌𝗍𝖾𝗉_q_1)_𝕄(𝚌𝚘𝚗𝚏_q𝗂𝗇𝗂𝗍,v(𝖾𝗇𝖼(0)),v(𝖾𝗇𝖼(1)))=𝚌𝚘𝚗𝚏_q_1,v(𝖾𝗇𝖼(1))\displaystyle=v(\mathsf{step}_{\_}{q_{\_}1}(\varphi_{\_}0,\mathsf{enc}(1)))=(\mathsf{step}_{\_}{q_{\_}1})_{\_}\mathbb{M}(\mathtt{conf}_{\_}{q_{\mathsf{init}},v(\mathsf{enc}(0))},v(\mathsf{enc}(1)))=\mathtt{conf}_{\_}{q_{\_}1,v(\mathsf{enc}(1))}
v(φ_2)\displaystyle v(\varphi_{\_}2) =v(𝗌𝗍𝖾𝗉_q_2(φ_1,𝖾𝗇𝖼(0)))=(𝗌𝗍𝖾𝗉_q_2)_𝕄(𝚌𝚘𝚗𝚏_q_1,v(𝖾𝗇𝖼(1)),v(𝖾𝗇𝖼(0)))=𝚌𝚘𝚗𝚏_q_2,v(𝖾𝗇𝖼(0))\displaystyle=v(\mathsf{step}_{\_}{q_{\_}2}(\varphi_{\_}1,\mathsf{enc}(0)))=(\mathsf{step}_{\_}{q_{\_}2})_{\_}\mathbb{M}(\mathtt{conf}_{\_}{q_{\_}1,v(\mathsf{enc}(1))},v(\mathsf{enc}(0)))=\mathtt{conf}_{\_}{q_{\_}2,v(\mathsf{enc}(0))}
v(φ_3)\displaystyle v(\varphi_{\_}3) =v(𝗌𝗍𝖾𝗉_q_3(φ_2,𝖾𝗇𝖼(0)))=(𝗌𝗍𝖾𝗉_q_3)_𝕄(𝚌𝚘𝚗𝚏_q_2,v(𝖾𝗇𝖼(0)),v(𝖾𝗇𝖼(0)))=𝚌𝚘𝚗𝚏_q_3,v(𝖾𝗇𝖼(0))\displaystyle=v(\mathsf{step}_{\_}{q_{\_}3}(\varphi_{\_}2,\mathsf{enc}(0)))=(\mathsf{step}_{\_}{q_{\_}3})_{\_}\mathbb{M}(\mathtt{conf}_{\_}{q_{\_}2,v(\mathsf{enc}(0))},v(\mathsf{enc}(0)))=\mathtt{conf}_{\_}{q_{\_}3,v(\mathsf{enc}(0))}

The formula φ_3\varphi_{\_}3 encodes the finite computation of 𝒞\mathcal{C} and, since 𝚌𝚘𝚗𝚏_q_3,v(𝖾𝗇𝖼(0))D\mathtt{conf}_{\_}{q_{\_}3,v(\mathsf{enc}(0))}\in D, _𝕄_𝒞φ_3\emptyset\vdash_{\_}{\mathbb{M}_{\_}\mathcal{C}}\varphi_{\_}3. Furthermore, the formulas φ_i\varphi_{\_}i with 0i30\leq i\leq 3, that encode its strict prefixes, are falsified by all valuations, since q_3q_{\_}3 is the only halting state.

Formulas not representing sequences of configurations, like 𝗌𝗎𝖼(ψ)\mathsf{suc}(\psi) with ψ𝖾𝗇𝖼(j)\psi\neq\mathsf{enc}(j), are falsified by every v𝖵𝖺𝗅(𝕄_𝒞)v\in\operatorname{\mathsf{Val}}(\mathbb{M}_{\_}\mathcal{C}) since v(𝗌𝗎𝖼(ψ))=𝗌𝗎𝖼_𝕄=𝚎𝚛𝚛𝚘𝚛v(\mathsf{suc}(\psi))=\mathsf{suc}_{\_}{\mathbb{M}}=\mathtt{error}. Formulas encoding sequences of configurations not starting in the initial configuration of 𝕄\mathbb{M} are also falsifiable: v_0(𝗌𝗍𝖾𝗉_q(ψ,𝖾𝗇𝖼(j)))=𝚎𝚛𝚛𝚘𝚛v_{\_}0(\mathsf{step}_{\_}q(\psi,\mathsf{enc}(j)))=\mathtt{error} whenever, either qq𝗂𝗇𝗂𝗍q\neq q_{\mathsf{init}} and ψ=ϵ\psi=\epsilon, or, q=q𝗂𝗇𝗂𝗍q=q_{\mathsf{init}}, ψ=ϵ\psi=\epsilon and j0j\neq 0. For example, v_0(𝗌𝗍𝖾𝗉_q𝗂𝗇𝗂𝗍(ϵ,𝖾𝗇𝖼(1)))=(𝗌𝗍𝖾𝗉_q𝗂𝗇𝗂𝗍)_𝕄_𝒞(𝚒𝚗𝚒𝚝,𝚛_1)=𝚎𝚛𝚛𝚘𝚛v_{\_}0(\mathsf{step}_{\_}{q_{\mathsf{init}}}(\epsilon,\mathsf{enc}(1)))=(\mathsf{step}_{\_}{q_{\mathsf{init}}})_{\_}{\mathbb{M}_{\_}{\mathcal{C}}}(\mathtt{init},\mathtt{r}_{\_}{\geq 1})=\mathtt{error}.

The sequence (q𝗂𝗇𝗂𝗍,0),(q_1,2)\langle(q_{\mathsf{init}},0),(q_{\_}1,2)\rangle, encoded by ψ=𝗌𝗍𝖾𝗉_q_1(φ_0,𝖾𝗇𝖼(2))\psi=\mathsf{step}_{\_}{q_{\_}1}(\varphi_{\_}0,\mathsf{enc}(2)), illustrates a situation where the value in the counter was incremented by two while the transition δ(q_1)=1++,q_2\delta(q_{\_}1)=\langle 1^{++},q_{\_}2\rangle required it to increase by only one. In this case, we have μ_+0,2(ψ)=v_=0(ψ)=(𝗌𝗍𝖾𝗉_q_1)_𝕄(𝚌𝚘𝚗𝚏_q𝗂𝗇𝗂𝗍,𝚛_=0,𝚛_2)=𝚎𝚛𝚛𝚘𝚛\mu^{+}_{\_}{0,2}(\psi)=v^{=}_{\_}0(\psi)=(\mathsf{step}_{\_}{q_{\_}1})_{\_}\mathbb{M}(\mathtt{conf}_{\_}{q_{\mathsf{init}},\mathtt{r}_{\_}{=0}},\mathtt{r}_{\_}{\geq 2})=\mathtt{error}. In the same way, we also have μ_2,0(γ)=𝚎𝚛𝚛𝚘𝚛\mu^{-}_{\_}{2,0}(\gamma)=\mathtt{error} with γ=𝗌𝗍𝖾𝗉_q_2(φ_1,𝖾𝗇𝖼(2))\gamma=\mathsf{step}_{\_}{q_{\_}2}(\varphi_{\_}1,\mathsf{enc}(2)). This reflects the fact that γ\gamma encodes the sequence resulting from appending (q_2,2)(q_{\_}2,2) to the sequence encoded by φ_1\varphi_{\_}1, hence incrementing the value the counter while δ(q_1)\delta(q_{\_}1) required it to be decremented by one.

Finally, consider ξ=𝗌𝗍𝖾𝗉_q_3(φ_2,𝖾𝗇𝖼(1))\xi=\mathsf{step}_{\_}{q_{\_}3}(\varphi_{\_}2,\mathsf{enc}(1)) encoding the sequence resulting from appending (q_3,1)(q_{\_}3,1) to the sequence encoded by φ_2\varphi_{\_}2. As the value in the first counter was incremented, while the transition δ(q_2)=1𝗍𝖾𝗌𝗍,q_3,q_3\delta(q_{\_}2)=\langle 1^{\mathsf{test}},q_{\_}3,q_{\_}3\rangle required it to remain unchanged we obtain μ_0,1(ξ)=v_=0(ξ)=𝚎𝚛𝚛𝚘𝚛\mu^{\neq}_{\_}{0,1}(\xi)=v^{=}_{\_}0(\xi)=\mathtt{error}. \triangle

Example 3.5.

Consider the counter machine 𝒞=2,Q,q𝗂𝗇𝗂𝗍,δ\mathcal{C}=\langle 2,Q,q_{\mathsf{init}},\delta\rangle with Q={q𝗂𝗇𝗂𝗍,q_1,q_2,q_3,q_4}Q=\{q_{\mathsf{init}},q_{\_}1,q_{\_}2,q_{\_}3,q_{\_}4\} and δ\delta as defined in following table

qq q𝗂𝗇𝗂𝗍q_{\mathsf{init}} q_1q_{\_}1 q_2q_{\_}2 q_3q_{\_}3 q_4q_{\_}4
δ(q)\delta(q) 1++,q_1\langle 1^{++},q_{\_}1\rangle 2++,q_2\langle 2^{++},q_{\_}2\rangle 1𝗍𝖾𝗌𝗍,q_4,q_3\langle 1^{\mathsf{test}},q_{\_}4,q_{\_}3\rangle 1++,q𝗂𝗇𝗂𝗍\langle 1^{++},q_{\mathsf{init}}\rangle undefined

This machine does not have a finite computation, and its infinite computation loops indefinitely in the following cycle consisting of 44 transitions. It starts by incrementing both counters. Then it tests if the first counter has the value 0. As the counter has just been incremented, the test is bound to fail and hence that counter is decremented. It then increments the same counter, and returns to the initial state.

The halting state q_4q_{\_}4 could only be reached if at a certain point the test would succeed, but this never happens since, at the point the tests are made, the value of the first counter is never 0. Thus, the machine 𝒞\mathcal{C} has the following infinite computation

(q𝗂𝗇𝗂𝗍,0,0),(q_1,1,0),(q_2,1,1),(q_3,0,1),(q𝗂𝗇𝗂𝗍,1,1),(q_1,2,1),(q_2,2,2),(q_3,1,2),(q𝗂𝗇𝗂𝗍,2,2),\langle(q_{\mathsf{init}},0,0),(q_{\_}1,1,0),(q_{\_}2,1,1),(q_{\_}3,0,1),(q_{\mathsf{init}},1,1),(q_{\_}1,2,1),(q_{\_}2,2,2),(q_{\_}3,1,2),(q_{\mathsf{init}},2,2),\ldots\rangle

As we show in the next section, since 𝒞\mathcal{C} has no finite computations, 𝕄_𝒞\mathbb{M}_{\_}{\mathcal{C}} has no theorems. Let k1k\geq 1 and consider the sequence resulting from adding (q_3,k1,k+1)(q_{\_}3,k-1,k+1) to the prefix of the infinite computation of 𝒞\mathcal{C} with 4(k1)+34(k-1)+3 elements, and let φ_k\varphi_{\_}k encode this sequence. In this case, the value of the second counter is increased, when it should have remained the same, and we have

μ_k,k+1(φ_k)=v_k1(φ_k)=(𝗌𝗍𝖾𝗉_q_3)_𝕄_𝒞(𝚌𝚘𝚗𝚏_q_2,𝚛_1,𝚛_1,𝚛_0,𝚛_2)=𝚎𝚛𝚛𝚘𝚛.\mu^{\neq}_{\_}{k,k+1}(\varphi_{\_}k)=v_{\_}{k-1}(\varphi_{\_}k)=(\mathsf{step}_{\_}{q_{\_}3})_{\_}{\mathbb{M}_{\_}\mathcal{C}}(\mathtt{conf}_{\_}{q_{\_}2,\mathtt{r}_{\_}{\geq 1},\mathtt{r}_{\_}{\geq 1}},\mathtt{r}_{\_}{\geq 0},\mathtt{r}_{\_}{\geq 2})=\mathtt{error}.

\triangle

4 Monadicity of Nmatrices is undecidable

In this section we show that 𝕄_𝒞\mathbb{M}_{\_}\mathcal{C} really does what is intended. The main result of the paper then follows, after we additionally introduce a construction connecting the existence of a theorem with monadicity.

𝕄_𝒞\mathbb{M}_{\_}\mathcal{C} validates the finite computation of 𝒞\mathcal{C}

In the following propositions we show that 𝕄_𝒞\mathbb{M}_{\_}\mathcal{C} is interpreting computations of 𝒞\mathcal{C} as it should. Thus, formulas encoding computations of 𝒞\mathcal{C} that do not end in a halting state can be falsified, whilst the one encoding the finite computation of 𝒞\mathcal{C} is always designated.

Proposition 4.1.

Let 𝒞=n,Q,q𝗂𝗇𝗂𝗍,δ\mathcal{C}=\langle n,Q,q_{\mathsf{init}},\delta\rangle be a deterministic nn-counter machine. If nxt(q,y)=(q,z)\textsf{nxt}(q,\vec{y})=(q^{\prime},\vec{z}) then

(𝗌𝗍𝖾𝗉_q)_𝕄_𝒞(𝚌𝚘𝚗𝚏_q,v(𝖾𝗇𝖼(y)),v(𝖾𝗇𝖼(z)))={𝚌𝚘𝚗𝚏_q,v(𝖾𝗇𝖼(z))}, for every v𝖵𝖺𝗅(𝕄_𝒞).(\mathsf{step}_{\_}{q^{\prime}})_{\_}{\mathbb{M}_{\_}\mathcal{C}}(\mathtt{conf}_{\_}{q,v(\mathsf{enc}(\vec{y}))},v(\mathsf{enc}(\vec{z})))=\{\mathtt{conf}_{\_}{q^{\prime},v(\mathsf{enc}(\vec{z}))}\},\text{ for every }v\in\operatorname{\mathsf{Val}}(\mathbb{M}_{\_}\mathcal{C}). (1)
Proof.

Suppose that nxt(q,y)=(q,z)\textsf{nxt}(q,\vec{y})=(q^{\prime},\vec{z}). We have to consider three cases, depending on δ(q)\delta(q).

If δ(q)=(i++,q)\delta(q)=(i^{++},q^{\prime}) and z=y+𝖾_i\vec{z}=\vec{y}+\vec{\mathsf{e}_{\_}i} then, for every jij\neq i and v𝖵𝖺𝗅(𝕄_𝒞)v\in\operatorname{\mathsf{Val}}(\mathbb{M}_{\_}\mathcal{C}), we have z_j=y_jz_{\_}j=y_{\_}j and v(𝖾𝗇𝖼(z_j))=v(𝖾𝗇𝖼(y_j))v(\mathsf{enc}(z_{\_}j))=v(\mathsf{enc}(y_{\_}j)). Furthermore, z_i=y_i+1z_{\_}i=y_{\_}i+1, so 𝖾𝗇𝖼(z_i)=𝗌𝗎𝖼(𝖾𝗇𝖼(y_i))\mathsf{enc}(z_{\_}i)=\mathsf{suc}(\mathsf{enc}(y_{\_}i)) and, for every v𝖵𝖺𝗅(𝕄_𝒞)v\in\operatorname{\mathsf{Val}}(\mathbb{M}_{\_}\mathcal{C}), v(𝖾𝗇𝖼(z_i))=v(𝗌𝗎𝖼(𝖾𝗇𝖼(y_i)))𝗌𝗎𝖼_𝕄_𝒞(v(𝖾𝗇𝖼(y_i)))v(\mathsf{enc}(z_{\_}i))=v(\mathsf{suc}(\mathsf{enc}(y_{\_}i)))\in\mathsf{suc}_{\_}{\mathbb{M}_{\_}\mathcal{C}}(v(\mathsf{enc}(y_{\_}i))).

Otherwise, δ(q)=i𝗍𝖾𝗌𝗍,s_1,s_2\delta(q)=\langle i^{\mathsf{test}},s_{\_}1,s_{\_}2\rangle for some machine states s_1s_{\_}1 and s_2s_{\_}2.

If s_1=qs_{\_}1=q^{\prime}, y_i=0y_{\_}i=0 and z=y\vec{z}=\vec{y}. Then, for every v𝖵𝖺𝗅(𝕄_𝒞)v\in\operatorname{\mathsf{Val}}(\mathbb{M}_{\_}\mathcal{C}), we have v(𝖾𝗇𝖼(z))=v(𝖾𝗇𝖼(y))v(\mathsf{enc}(\vec{z}))=v(\mathsf{enc}(\vec{y})) and v(𝖾𝗇𝖼(z_i))=v(𝖾𝗇𝖼(y_i))=v(𝗓𝖾𝗋𝗈){𝚛_=0,𝚛_0}v(\mathsf{enc}(z_{\_}i))=v(\mathsf{enc}(y_{\_}i))=v(\mathsf{zero})\in\{\mathtt{r}_{\_}{=0},\mathtt{r}_{\_}{\geq 0}\}.

If s_2=qs_{\_}2=q^{\prime}, y_i0y_{\_}i\neq 0 and y=z+𝖾_i\vec{y}=\vec{z}+\vec{\mathsf{e}_{\_}i}. Then, for every jij\neq i and v𝖵𝖺𝗅(𝕄_𝒞)v\in\operatorname{\mathsf{Val}}(\mathbb{M}_{\_}\mathcal{C}), we have z_j=y_jz_{\_}j=y_{\_}j and so v(𝖾𝗇𝖼(z_j))=v(𝖾𝗇𝖼(y_j))v(\mathsf{enc}(z_{\_}j))=v(\mathsf{enc}(y_{\_}j)). Furthermore, y_i=z_i+1y_{\_}i=z_{\_}i+1, so 𝖾𝗇𝖼(y_i)=𝗌𝗎𝖼(𝖾𝗇𝖼(z_i))\mathsf{enc}(y_{\_}i)=\mathsf{suc}(\mathsf{enc}(z_{\_}i)) and, for every v𝖵𝖺𝗅(𝕄_𝒞)v\in\operatorname{\mathsf{Val}}(\mathbb{M}_{\_}\mathcal{C}), v(𝖾𝗇𝖼(y_i))=v(𝗌𝗎𝖼(𝖾𝗇𝖼(z_i)))𝗌𝗎𝖼_𝕄_𝒞(v(𝖾𝗇𝖼(z_i)))v(\mathsf{enc}(y_{\_}i))=v(\mathsf{suc}(\mathsf{enc}(z_{\_}i)))\in\mathsf{suc}_{\_}{\mathbb{M}_{\_}\mathcal{C}}(v(\mathsf{enc}(z_{\_}i))).

In all the three cases we conclude (1) directly by the definition of (𝗌𝗍𝖾𝗉_q)_𝕄_𝒞(\mathsf{step}_{\_}{q^{\prime}})_{\_}{\mathbb{M}_{\_}\mathcal{C}}. ∎

Theorem 4.2.

Let 𝒞=n,Q,q𝗂𝗇𝗂𝗍,δ\mathcal{C}=\langle n,Q,q_{\mathsf{init}},\delta\rangle be a deterministic nn-counter machine with a finite computation C_0,,C_k\langle C_{\_}0,\dots,C_{\_}k\rangle, then _𝕄_𝒞𝗌𝖾𝗊(C_0,,C_k)\emptyset\vdash_{\_}{\mathbb{M}_{\_}\mathcal{C}}\mathsf{seq}(\langle C_{\_}0,\dots,C_{\_}k\rangle).

Proof.

Suppose that C_0,,C_k\langle C_{\_}0,\dots,C_{\_}k\rangle is the finite computation of 𝒞\mathcal{C}. Then we have that C_0=(q𝗂𝗇𝗂𝗍,𝗓𝖾𝗋𝗈)C_{\_}0=(q_{\mathsf{init}},\vec{\mathsf{zero}}), where 𝗓𝖾𝗋𝗈=𝗓𝖾𝗋𝗈,,𝗓𝖾𝗋𝗈\vec{\mathsf{zero}}=\langle\mathsf{zero},\dots,\mathsf{zero}\rangle, nxt(C_j)=C_j+1\textsf{nxt}(C_{\_}j)=C_{\_}{j+1} for every 0j<k0\leq j<k and C_k=(q_k,z)C_{\_}k=(q_{\_}k,\vec{z}) is a halting configuration. For every v𝖵𝖺𝗅(𝕄_𝒞)v\in\operatorname{\mathsf{Val}}(\mathbb{M}_{\_}\mathcal{C}) we have v(𝗌𝖾𝗊(C_0))=𝚌𝚘𝚗𝚏_q𝗂𝗇𝗂𝗍,v(𝗓𝖾𝗋𝗈)v(\mathsf{seq}(\langle C_{\_}0\rangle))=\mathtt{conf}_{\_}{q_{\mathsf{init}},v(\vec{\mathsf{zero}})} and, by proposition 4.1, v(C_0,,C_k)=𝚌𝚘𝚗𝚏_q_k,v(𝖾𝗇𝖼(z))v(\langle C_{\_}0,\dots,C_{\_}k\rangle)=\mathtt{conf}_{\_}{q_{\_}k,v(\mathsf{enc}(\vec{z}))}, where C_k=(q_k,z)C_{\_}k=(q_{\_}k,\vec{z}). Since C_kC_{\_}k is a halting configuration, we conclude that 𝚌𝚘𝚗𝚏_q_k,v(𝖾𝗇𝖼(z))D\mathtt{conf}_{\_}{q_{\_}k,v(\mathsf{enc}(\vec{z}))}\in D, and so _𝕄_𝒞𝗌𝖾𝗊(C_0,,C_k)\emptyset\vdash_{\_}{\mathbb{M}_{\_}\mathcal{C}}\mathsf{seq}(\langle C_{\_}0,\dots,C_{\_}k\rangle). ∎

𝕄_𝒞\mathbb{M}_{\_}\mathcal{C} can falsify everything else

The following propositions deal with all the possible ways in which a formula can fail to represent a halting computation of 𝒞\mathcal{C}.

Proposition 4.3.

Let 𝒞=n,Q,q𝗂𝗇𝗂𝗍,δ\mathcal{C}=\langle n,Q,q_{\mathsf{init}},\delta\rangle be a deterministic nn-counter machine. If φLΣ_𝒞()\varphi\in\textbf{L}_{\Sigma_{\_}\mathcal{C}}(\emptyset) does not represent a sequence of configurations of 𝒞\mathcal{C} then v(φ)𝚌𝚘𝚗𝚏_q,yv(\varphi)\neq\mathtt{conf}_{\_}{q,\vec{y}} for all v𝖵𝖺𝗅_𝒞v\in\operatorname{\mathsf{Val}}_{\_}{\mathcal{C}}, qQq\in Q and yRmn\vec{y}\in\textbf{Rm}^{n}.

Proof.

The proof follows by induction on the structure of the formula φLΣ_𝒞()\varphi\in\textbf{L}_{\Sigma_{\_}\mathcal{C}}(\emptyset).

In the base case we have φ{𝗓𝖾𝗋𝗈,ϵ}\varphi\in\{\mathsf{zero},\epsilon\}. The statement then holds since, for all v𝖵𝖺𝗅_𝒞v\in\operatorname{\mathsf{Val}}_{\_}{\mathcal{C}}, v(φ){𝗓𝖾𝗋𝗈,𝚒𝚗𝚒𝚝}v(\varphi)\in\{\mathsf{zero},\mathtt{init}\}.

For the step we have two cases. In the first case, φ=𝗌𝗎𝖼(ψ)\varphi=\mathsf{suc}(\psi) and v(𝗌𝗎𝖼(ψ))Rm{𝚎𝚛𝚛𝚘𝚛}v(\mathsf{suc}(\psi))\in\textbf{Rm}\cup\{\mathtt{error}\}. In the second case, φ=𝚜𝚝𝚎𝚙_q(ψ,ψ_1,,ψ_n)\varphi=\mathtt{step}_{\_}q(\psi,\psi_{\_}1,\ldots,\psi_{\_}n) and, if φ\varphi does not represent any sequence of configurations, then one of the following must hold

  • ψ\psi does not represent a sequence of configurations, in which case, by induction hypothesis, v(ψ)𝚌𝚘𝚗𝚏_q,yv(\psi)\neq\mathtt{conf}_{\_}{q,\vec{y}}, or

  • ψ_i𝖾𝗇𝖼(j)\psi_{\_}i\neq\mathsf{enc}(j), for some 1in1\leq i\leq n, so v(ψ_i)Rmv(\psi_{\_}i)\notin\textbf{Rm}.

In both cases we have v(φ)=𝗌𝗎𝖼_𝕄_𝒞(v(ψ),v(ψ_1),,v(ψ_n))=𝚎𝚛𝚛𝚘𝚛v(\varphi)=\mathsf{suc}_{\_}{\mathbb{M}_{\_}\mathcal{C}}(v(\psi),v(\psi_{\_}1),\ldots,v(\psi_{\_}n))=\mathtt{error}. ∎

Proposition 4.4.

Given a deterministic counter machine 𝒞=n,Q,q𝗂𝗇𝗂𝗍,δ\mathcal{C}=\langle n,Q,q_{\mathsf{init}},\delta\rangle. If nxt(q,y)(q,z)\textsf{nxt}(q,\vec{y})\neq(q^{\prime},\vec{z}) then

(𝗌𝗍𝖾𝗉_q)_𝕄_𝒞(𝚌𝚘𝚗𝚏_q,v(𝖾𝗇𝖼(y)),v(𝖾𝗇𝖼(z)))={𝚎𝚛𝚛𝚘𝚛},(\mathsf{step}_{\_}{q^{\prime}})_{\_}{\mathbb{M}_{\_}\mathcal{C}}(\mathtt{conf}_{\_}{q,v(\mathsf{enc}(\vec{y}))},v(\mathsf{enc}(\vec{z})))=\{\mathtt{error}\}, (2)

for some v𝖵𝖺𝗅(𝕄_𝒞)v\in\operatorname{\mathsf{Val}}(\mathbb{M}_{\_}\mathcal{C}).

Proof.

Assume nxt(q,y)(q,z)\textsf{nxt}(q,\vec{y})\neq(q^{\prime},\vec{z}) and notice that, if δ(q)\delta(q) concerns the iith counter and y_jz_jy_{\_}j\neq z_{\_}j, for some jij\neq i, then μ_y_j,z_j(𝖾𝗇𝖼(y_j))μ_y_j,z_j(𝖾𝗇𝖼(z_j))\mu^{\neq}_{\_}{y_{\_}j,z_{\_}j}(\mathsf{enc}(y_{\_}j))\neq\mu^{\neq}_{\_}{y_{\_}j,z_{\_}j}(\mathsf{enc}(z_{\_}j)), by remark 3.3. Therefore, equality (2) holds for v=μ_y_j,z_jv=\mu^{\neq}_{\_}{y_{\_}j,z_{\_}j}. Because of this, throughout the rest of the proof, we assume that, y_j=z_jy_{\_}j=z_{\_}j, for every jij\neq i, and concern ourselves only with the values taken by y_iy_{\_}i and z_iz_{\_}i. We have to consider three cases, depending on δ(q)\delta(q).

If δ(q)=i++,s\delta(q)=\langle i^{++},s\rangle, for some machine state ss. Then either qsq^{\prime}\neq s, in which case equality (2) holds for every v𝖵𝖺𝗅(𝕄_𝒞)v\in\operatorname{\mathsf{Val}}(\mathbb{M}_{\_}\mathcal{C}), or z_iy_i+1z_{\_}i\neq y_{\_}i+1. In this later case, also by remark 3.3, we have μ_+y_i,z_i(𝖾𝗇𝖼(z_i))𝗌𝗎𝖼_𝕄_𝒞(μ_+y_i,z_i(𝖾𝗇𝖼(y_i)))\mu^{+}_{\_}{y_{\_}i,z_{\_}i}(\mathsf{enc}(z_{\_}i))\notin\mathsf{suc}_{\_}{\mathbb{M}_{\_}\mathcal{C}}(\mu^{+}_{\_}{y_{\_}i,z_{\_}i}(\mathsf{enc}(y_{\_}i))), so equality (2) holds for v=μ_+y_i,z_iv=\mu^{+}_{\_}{y_{\_}i,z_{\_}i}.

Otherwise, δ(q)=i𝗍𝖾𝗌𝗍,s_1,s_2\delta(q)=\langle i^{\mathsf{test}},s_{\_}1,s_{\_}2\rangle for some machine states s_1s_{\_}1 and s_2s_{\_}2.

If y_i=0y_{\_}i=0, then either qs_1q^{\prime}\neq s_{\_}1 or z_iy_iz_{\_}i\neq y_{\_}i. Consider the valuation μ_=y_i,z_i=v_=0\mu^{=}_{\_}{y_{\_}i,z_{\_}i}=v^{=}_{\_}0. Since v_=0(y_i)=𝚛_=0𝗌𝗎𝖼_𝕄_𝒞(v_=0(𝖾𝗇𝖼(z_i)))v^{=}_{\_}0(y_{\_}i)=\mathtt{r}_{\_}{=0}\notin\mathsf{suc}_{\_}{\mathbb{M}_{\_}\mathcal{C}}(v^{=}_{\_}0(\mathsf{enc}(z_{\_}i))), the second condition concerning i𝗍𝖾𝗌𝗍i^{\mathsf{test}}, in the definition of (𝗌𝗍𝖾𝗉_q)_𝕄_𝒞(\mathsf{step}_{\_}{q^{\prime}})_{\_}{\mathbb{M}_{\_}\mathcal{C}}, is not satisfied whenever v=μ_=y_i,z_iv=\mu^{=}_{\_}{y_{\_}i,z_{\_}i}. The first condition is also not satisfied if qs_1q^{\prime}\neq s_{\_}1, directly, or if z_iy_iz_{\_}i\neq y_{\_}i, since in this case μ_=y_i,z_i(z_i)μ_=y_i,z_i(y_i)\mu^{=}_{\_}{y_{\_}i,z_{\_}i}(z_{\_}i)\neq\mu^{=}_{\_}{y_{\_}i,z_{\_}i}(y_{\_}i), by remark 3.3. We conclude that equality (2) holds for v=μ_=y_i,z_iv=\mu^{=}_{\_}{y_{\_}i,z_{\_}i}.

If y_i0y_{\_}i\neq 0, then either qs_2q^{\prime}\neq s_{\_}2 or z_iy_i1z_{\_}i\neq y_{\_}i-1. Note that, in any case, μ_y_i,z_i(𝖾𝗇𝖼(y_i)){𝚛_=0,𝚛_0}\mu^{-}_{\_}{y_{\_}i,z_{\_}i}(\mathsf{enc}(y_{\_}i))\notin\{\mathtt{r}_{\_}{=0},\mathtt{r}_{\_}{\geq 0}\}, which can easily be checked using the definition of μ_y_i,z_i\mu^{-}_{\_}{y_{\_}i,z_{\_}i}. Therefore, the first condition concerning i𝗍𝖾𝗌𝗍i^{\mathsf{test}}, in the definition of (𝗌𝗍𝖾𝗉_q)_𝕄_𝒞(\mathsf{step}_{\_}{q^{\prime}})_{\_}{\mathbb{M}_{\_}\mathcal{C}}, is not satisfied whenever v=μ_y_i,z_iv=\mu^{-}_{\_}{y_{\_}i,z_{\_}i}. The second condition is also not satisfied if qs_2q^{\prime}\neq s_{\_}2, directly, or if z_iy_i1z_{\_}i\neq y_{\_}i-1, since in this case μ_y_i,z_i(𝖾𝗇𝖼(y_i))𝗌𝗎𝖼_𝕄_𝒞(μ_y_i,z_i(𝖾𝗇𝖼(z_i)))\mu^{-}_{\_}{y_{\_}i,z_{\_}i}(\mathsf{enc}(y_{\_}i))\notin\mathsf{suc}_{\_}{\mathbb{M}_{\_}\mathcal{C}}(\mu^{-}_{\_}{y_{\_}i,z_{\_}i}(\mathsf{enc}(z_{\_}i))), by remark 3.3. We conclude that equality (2) holds for v=μ_y_i,z_iv=\mu^{-}_{\_}{y_{\_}i,z_{\_}i}. ∎

Proposition 4.5.

Given a deterministic counter machine 𝒞=n,Q,q𝗂𝗇𝗂𝗍,δ\mathcal{C}=\langle n,Q,q_{\mathsf{init}},\delta\rangle and φLΣ_𝒞()\varphi\in\textbf{L}_{\Sigma_{\_}\mathcal{C}}(\emptyset) such that φ=𝗌𝖾𝗊(C_0,,C_k)\varphi=\mathsf{seq}(\langle C_{\_}0,\dots,C_{\_}k\rangle). If C_0,,C_k\langle C_{\_}0,\dots,C_{\_}k\rangle is not the computation of 𝒞\mathcal{C} then ⊬_𝕄_𝒞φ\emptyset\not\vdash_{\_}{\mathbb{M}_{\_}\mathcal{C}}\varphi.

Proof.

If C_0,,C_k\langle C_{\_}0,\dots,C_{\_}k\rangle is not the computation of 𝒞\mathcal{C}, then one of the following must hold: (i) C_0C_{\_}0 is not the initial configuration of 𝒞\mathcal{C}, (ii) C_kC_{\_}k is not a halting configuration of 𝒞\mathcal{C}, or (iii) there is some 1i<k1\leq i<k such that nxt(C_i)C_i+1\textsf{nxt}(C_{\_}i)\neq C_{\_}{i+1}. We deal with each situation separately.

If (i) holds and C_0=(q,y)C_{\_}0=(q,\vec{y}) then either qq𝗂𝗇𝗂𝗍q\neq q_{\mathsf{init}} or y_j0y_{\_}j\neq 0, for some 1jn1\leq j\leq n. In the first case, for all v𝖵𝖺𝗅(𝕄_𝒞)v\in\operatorname{\mathsf{Val}}(\mathbb{M}_{\_}\mathcal{C}), we have (𝗌𝗍𝖾𝗉_q)_𝕄_𝒞(𝚒𝚗𝚒𝚝,v(𝖾𝗇𝖼(y)))=𝚎𝚛𝚛𝚘𝚛(\mathsf{step}_{\_}q)_{\_}{\mathbb{M}_{\_}\mathcal{C}}(\mathtt{init},v(\mathsf{enc}(\vec{y})))=\mathtt{error}. In the second case, v_y_j1(𝖾𝗇𝖼(y_j)){𝚛_=0,𝚛_0}v_{\_}{y_{\_}j-1}(\mathsf{enc}(y_{\_}j))\notin\{\mathtt{r}_{\_}{=0},\mathtt{r}_{\_}{\geq 0}\} and (𝗌𝗍𝖾𝗉_q𝗂𝗇𝗂𝗍)_𝕄_𝒞(𝚒𝚗𝚒𝚝,v_y_j1(𝖾𝗇𝖼(y)))=𝚎𝚛𝚛𝚘𝚛(\mathsf{step}_{\_}{q_{\mathsf{init}}})_{\_}{\mathbb{M}_{\_}\mathcal{C}}(\mathtt{init},v_{\_}{y_{\_}j-1}(\mathsf{enc}(\vec{y})))=\mathtt{error}.

If (ii) holds and C_k=(q,y)C_{\_}k=(q,\vec{y}) then qq is not a halting state and v(φ){𝚎𝚛𝚛𝚘𝚛,𝚌𝚘𝚗𝚏_q,v(y)}ADv(\varphi)\in\{\mathtt{error},\mathtt{conf}_{\_}{q,v(\vec{y})}\}\subseteq A\setminus D, for all v𝖵𝖺𝗅(𝕄_𝒞)v\in\operatorname{\mathsf{Val}}(\mathbb{M}_{\_}\mathcal{C}).

If (iii) holds then, by proposition 4.4, there is v𝖵𝖺𝗅(𝕄_𝒞)v\in\operatorname{\mathsf{Val}}(\mathbb{M}_{\_}\mathcal{C}) such that v(𝗌𝖾𝗊(C_0,,C_i+1))=𝚎𝚛𝚛𝚘𝚛v(\mathsf{seq}(\langle C_{\_}0,\dots,C_{\_}{i+1}\rangle))=\mathtt{error}.

In any of the cases, there is some v𝖵𝖺𝗅(𝕄_𝒞)v\in\operatorname{\mathsf{Val}}(\mathbb{M}_{\_}\mathcal{C}) such that v(φ)Dv(\varphi)\notin D, so ⊬_𝕄_𝒞φ\emptyset\not\vdash_{\_}{\mathbb{M}_{\_}\mathcal{C}}\varphi. ∎

Having seen how to refute any formula not representing a computation of 𝒞\mathcal{C} we conclude 𝕄_𝒞\mathbb{M}_{\_}\mathcal{C} does exactly what we intended.

Theorem 4.6.

Let 𝒞=n,Q,q𝗂𝗇𝗂𝗍,δ\mathcal{C}=\langle n,Q,q_{\mathsf{init}},\delta\rangle be a deterministic counter machine. For any formula φLΣ_𝒞(P)\varphi\in\textbf{L}_{\Sigma_{\_}\mathcal{C}}(P) we have _𝕄_𝒞φ\emptyset\vdash_{\_}{\mathbb{M}_{\_}\mathcal{C}}\varphi if and only if φ=𝗌𝖾𝗊(C_0,,C_k)\varphi=\mathsf{seq}(\langle C_{\_}0,\dots,C_{\_}k\rangle) and C_0,,C_k\langle C_{\_}0,\dots,C_{\_}k\rangle is a finite computation of 𝒞\mathcal{C}.

Proof.

From right to left, if C_0,,C_k\langle C_{\_}0,\dots,C_{\_}k\rangle is a finite computation of 𝒞\mathcal{C} and φ=𝗌𝖾𝗊(C_0,,C_k)\varphi=\mathsf{seq}(\langle C_{\_}0,\dots,C_{\_}k\rangle) then, by theorem 4.2, we have that _𝕄_𝒞φ\emptyset\vdash_{\_}{\mathbb{M}_{\_}\mathcal{C}}\varphi. In the other direction, suppose _𝕄_𝒞φ\emptyset\vdash_{\_}{\mathbb{M}_{\_}\mathcal{C}}\varphi then, as discussed in example 3.2, φ\varphi must be a closed formula. By proposition 4.3, φ=𝗌𝖾𝗊(C_0,,C_k)\varphi=\mathsf{seq}(\langle C_{\_}0,\dots,C_{\_}k\rangle) for some sequence of configurations 𝗌𝖾𝗊(C_0,,C_k)\mathsf{seq}(\langle C_{\_}0,\dots,C_{\_}k\rangle), and, by proposition 4.5, 𝗌𝖾𝗊(C_0,,C_k)\mathsf{seq}(\langle C_{\_}0,\dots,C_{\_}k\rangle) must be the computation of 𝒞\mathcal{C}. ∎

From theoremhood to monadicity

In order to obtain the announced undecidability result we need one last construction. We will show how to build an Nmatrix 𝕄_𝗆\mathbb{M}_{\_}{\mathsf{m}} from an Nmatrix 𝕄\mathbb{M}, under certain conditions, such that 𝕄_𝗆\mathbb{M}_{\_}{\mathsf{m}} is monadic if and only if _𝕄\vdash_{\_}{\mathbb{M}} has theorems.

Given a finite Σ\Sigma-Nmatrix 𝕄=A,_𝕄,D\mathbb{M}=\langle A,\cdot_{\_}\mathbb{M},D\rangle, let Σ_𝗆\Sigma_{\_}{\mathsf{m}} be such that Σ_𝗆(2)=Σ(2){f_a:aA}\Sigma_{\_}{\mathsf{m}}^{(2)}=\Sigma^{(2)}\cup\{f_{\_}a:a\in A\} and Σ_𝗆(k)=Σ(k)\Sigma_{\_}{\mathsf{m}}^{(k)}=\Sigma^{(k)}, for every k2k\neq 2.

Let A_𝗆=A{1}A_{\_}{\mathsf{m}}=A\cup\{1\}, assuming w.l.g. that 1A1\notin A, consider 𝕄_𝗆=A_𝗆,_𝗆,{1}\mathbb{M}_{\_}{\mathsf{m}}=\langle A_{\_}{\mathsf{m}},\cdot_{\_}{\mathsf{m}},\{1\}\rangle the Σ_𝗆\Sigma_{\_}{\mathsf{m}}-Nmatrix where, for each gΣ(k)g\in\Sigma^{(k)},

g_𝗆(x_1,,x_k)={g_𝕄(x_1,,x_k) if x_1,,x_kAA_𝗆 otherwise g_{\_}{\mathsf{m}}(x_{\_}1,\ldots,x_{\_}k)=\begin{cases}g_{\_}\mathbb{M}(x_{\_}1,\ldots,x_{\_}k)&\text{ if }x_{\_}1,\ldots,x_{\_}k\in A\\ A_{\_}{\mathsf{m}}&\text{ otherwise }\end{cases}

and, for every aAa\in A,

(f_a)_𝗆(x,y)={{1} if x=a and yDA if xA{a} and yDA_𝗆 otherwise (f_{\_}{a})_{\_}{\mathsf{m}}(x,y)=\begin{cases}\{1\}&\text{ if }x=a\text{ and }y\in D\\ \;A&\text{ if }x\in A\setminus\{a\}\text{ and }y\in D\\ \;A_{\_}{\mathsf{m}}&\text{ otherwise }\end{cases}

The following theorem targets Nmatrices with infectious values. Recall that * is infectious in 𝕄\mathbb{M} if for every connective ©\copyright in the signature of 𝕄\mathbb{M} we have ©_𝕄(x_1,,x_k)=\copyright_{\_}{\mathbb{M}}(x_{\_}1,\ldots,x_{\_}k)=* whenever {x_1,,x_k}*\in\{x_{\_}1,\ldots,x_{\_}k\}.

Proposition 4.7.

Given Nmatrix 𝕄\mathbb{M} with at least two truth-values and among them an infectious non-designated value, _𝕄\vdash_{\_}\mathbb{M} has theorems if and only if 𝕄_𝗆\mathbb{M}_{\_}{\mathsf{m}} is monadic.

Proof.

Let us denote the infectious non-designated value of 𝕄\mathbb{M} by *. Clearly, * ceases to be infectious in 𝕄_𝗆\mathbb{M}_{\_}{\mathsf{m}} as (f_a)_𝕄_𝗆(f_{\_}a)_{\_}{\mathbb{M}_{\_}{\mathsf{m}}} does not necessarily output * when it receives it as input. The value 11 is also not infectious in 𝕄_𝗆\mathbb{M}_{\_}{\mathsf{m}}, quite the opposite, when given as input to any connective the output can take any value. That is, for every connective ©Σ_𝗆\copyright\in\Sigma_{\_}{\mathsf{m}} we have ©_𝕄_𝗆(x_1,,x_k)=A_𝗆\copyright_{\_}{\mathbb{M}_{\_}{\mathsf{m}}}(x_{\_}1,\ldots,x_{\_}k)=A_{\_}\mathsf{m} whenever 1{x_1,,x_k}1\in\{x_{\_}1,\ldots,x_{\_}k\}. This immediately implies that if ψ𝖲𝗎𝖻(φ){φ}\psi\in\operatorname{\mathsf{Sub}}(\varphi)\setminus\{\varphi\} and 1ψ_𝕄_𝗆(x)1\in\psi_{\_}{\mathbb{M}_{\_}\mathsf{m}}(x) then φ_𝕄_𝗆(x)=A_𝗆\varphi_{\_}{\mathbb{M}_{\_}\mathsf{m}}(x)=A_{\_}\mathsf{m} for any xA_𝗆x\in A_{\_}\mathsf{m}.

If _𝕄φ\emptyset\vdash_{\_}\mathbb{M}\varphi then φ\varphi must be a closed formula due to the presence of *. Hence, for v𝖵𝖺𝗅(𝕄_𝗆)v\in\operatorname{\mathsf{Val}}(\mathbb{M}_{\_}{\mathsf{m}}) we have v(φ)Dv(\varphi)\in D. Thus, {p}{f_a(p,φ):aA}\{p\}\cup\{f_{\_}a(p,\varphi):a\in A\} is a set of monadic separators for 𝕄_𝗆\mathbb{M}_{\_}{\mathsf{m}}, as pp separates 11 from the elements in AA, and f_a(p,φ)f_{\_}a(p,\varphi) separates aa from every bAb\in A.

If instead there are no theorems in _𝕄\vdash_{\_}\mathbb{M}, let us consider an arbitrary monadic formula φL_Σ_𝗆({p})\varphi\in L_{\_}{\Sigma_{\_}{\mathsf{m}}}(\{p\}) and show it cannot separate * from the other elements of AA. We need to consider two cases.

  • If φL_Σ({p})\varphi\in L_{\_}{\Sigma}(\{p\}) then φ_𝕄_𝗆(a)=φ_𝕄(a)A∌1\varphi_{\_}{\mathbb{M}_{\_}{\mathsf{m}}}(a)=\varphi_{\_}{\mathbb{M}}(a)\subseteq A\not\ni 1 for every aAa\in A. In which case φ\varphi cannot separate any pair of distinct elements of AA and, in particular, cannot separate * from any other element of AA.

  • If φL_Σ_𝗆({p})L_Σ({p})\varphi\in L_{\_}{\Sigma_{\_}{\mathsf{m}}}(\{p\})\setminus L_{\_}{\Sigma}(\{p\}) then there is f_a(ψ_1,ψ_2)𝖲𝗎𝖻(φ)f_{\_}a(\psi_{\_}1,\psi_{\_}2)\in\operatorname{\mathsf{Sub}}(\varphi) with ψ_1,ψ_2L_Σ({p})\psi_{\_}1,\psi_{\_}2\in L_{\_}{\Sigma}(\{p\}). If pp occurs in ψ_2\psi_{\_}2 then (ψ_2)_𝕄_𝗆()=(ψ_2)_𝕄()={}(\psi_{\_}2)_{\_}{\mathbb{M}_{\_}\mathsf{m}}(*)=(\psi_{\_}2)_{\_}{\mathbb{M}}(*)=\{*\} and (f_a(ψ_1,ψ_2))_𝕄_𝗆()=A_𝗆(f_{\_}a(\psi_{\_}1,\psi_{\_}2))_{\_}{\mathbb{M}_{\_}{\mathsf{m}}}(*)=A_{\_}{\mathsf{m}}, since D*\notin D. If pp does not occur in ψ_2\psi_{\_}2 then, since ⊬_𝕄ψ_2\emptyset\not\vdash_{\_}\mathbb{M}\psi_{\_}2, (ψ_2)_𝕄(AD)(\psi_{\_}2)_{\_}{\mathbb{M}}\cap(A\setminus D)\neq\emptyset and we also obtain (f_a(ψ_1,ψ_2))_𝕄_𝗆()=A_𝗆(f_{\_}a(\psi_{\_}1,\psi_{\_}2))_{\_}{\mathbb{M}_{\_}{\mathsf{m}}}(*)=A_{\_}{\mathsf{m}}.

    Therefore, φ_𝕄_𝗆()=A_𝗆\varphi_{\_}{\mathbb{M}_{\_}{\mathsf{m}}}(*)=A_{\_}{\mathsf{m}} since either φ=f_a(ψ_1,ψ_2)\varphi=f_{\_}a(\psi_{\_}1,\psi_{\_}2) or f_a(ψ_1,ψ_2)𝖲𝗎𝖻(φ){φ}f_{\_}a(\psi_{\_}1,\psi_{\_}2)\in\operatorname{\mathsf{Sub}}(\varphi)\setminus\{\varphi\} and 1(f_a(ψ_1,ψ_2))_𝕄_𝗆()1\in(f_{\_}a(\psi_{\_}1,\psi_{\_}2))_{\_}{\mathbb{M}_{\_}{\mathsf{m}}}(*). As φ_𝕄_𝗆()\varphi_{\_}{\mathbb{M}_{\_}{\mathsf{m}}}(*) contains both designated and non-designated elements it cannot separate * from any other element of AA.

As we are assuming that AA has at least two elements, we conclude that 𝕄_𝗆\mathbb{M}_{\_}{\mathsf{m}} is not monadic. ∎

Finally, we get to the main result of this paper.

Theorem 4.8.

The problem of determining if a given finite Σ\Sigma-Nmatrix is monadic is undecidable.

Proof.

For every counter machine 𝒞\mathcal{C}, the Nmatrix 𝕄_𝒞\mathbb{M}_{\_}{\mathcal{C}} is in the conditions of Theorem 4.7, as it has more than two truth-values and 𝚎𝚛𝚛𝚘𝚛\mathtt{error} is infectious. Therefore, by applying successively Theorem 4.6 and 4.7, we reduce the halting problem for counter machines to the problem of checking if a finite Nmatrix is monadic. Indeed, for a given counter machine 𝒞\mathcal{C}, 𝒞\mathcal{C} halts if and only if _𝕄_𝒞\vdash_{\_}{\mathbb{M}_{\_}\mathcal{C}} has theorems if and only if (𝕄_𝒞)_𝗆(\mathbb{M}_{\_}\mathcal{C})_{\_}{\mathsf{m}} is monadic. Furthermore, the presented constructions are all computable and (𝕄_𝒞)_𝗆(\mathbb{M}_{\_}\mathcal{C})_{\_}{\mathsf{m}} is always finite since, if 𝒞\mathcal{C} has mm states and nn counters, then 𝕄_𝒞\mathbb{M}_{\_}\mathcal{C} has m×4n+6m\times 4^{n}+6 truth-values and Σ_𝒞\Sigma_{\_}\mathcal{C} has 3+m3+m connectives. Therefore, (𝕄_𝒞)_𝗆(\mathbb{M}_{\_}\mathcal{C})_{\_}{\mathsf{m}} has m×4n+7m\times 4^{n}+7 truth-values and (Σ_𝒞)_𝗆(\Sigma_{\_}{\mathcal{C}})_{\_}{\mathsf{m}} has m×4n+m+9m\times 4^{n}+m+9 connectives. We can therefore conclude the proof just by invoking Theorem 3.1. ∎

As a simple corollary we obtain that following result about Nmatrices, or better, about their underlying multi-algebras.

Corollary 4.9.

The problem of generating all expressible unary multi-functions in an arbitrary finite Nmatrix is not computable.

Proof.

Just note that if we could compute the set of all expressible unary multi-functions, as the set is necessarily finite, we could test each of them for the separation of values, as illustrated in the case of matrices in Example 2.3. ∎

5 Conclusion

In this paper we have shown that, contrarily to the most common case of logical matrices, the monadicity property is undecidable for non-deterministic matrices. As a consequence, we conclude that the set of all multi-functions expressible in a given finite Nmatrix is not computable, in general. These results, of course, do not spoil the usefulness of the techniques for obtaining axiomatizations, analytical calculi and automated proof-search for monadic non-deterministic matrices. This is especially the case since, for a given Nmatrix, one can always define a monadic Nmatrix over an enriched signature, such that its logic is a conservative extension of the logic of the previous Nmatrix, as described in [15]. The results show, however, that tool support for logics based on non-deterministic matrices must necessarily have its limitations.

On a closer perspective, the reduction we have obtained from counter machines to Nmatrices (of which non-determinism is a fundamental ingredient) just adds to the initial perception that allowing for non-determinism brings a substantial amount of expressive power to logical matrices. Concretely, it opens the door for studying the computational hardness of other fundamental meta-theoretical questions regarding logics defined by Nmatrices. In particular, we will be interested in studying the problem of deciding whether two given finite Nmatrices define the same logic, a fundamental question raised by Zohar and Avron in [6], for which only necessary or sufficient conditions are known.

Additionally, we deem it important to further explore the connections between Nmatrices and term-dag-automata (an interesting computational model for term languages [11, 2]) and which informed our undecidability result. Another relevant direction for further investigation is the systematic study of infectious semantics, in the lines of [9, 7], whose variable inclusion properties also played an important role in our results.

References

  • [1]
  • [2] Siva Anantharaman, Paliath Narendran & Michael Rusinowitch (2005): Closure properties and decision problems of dag automata. Information Processing Letters 94(5), pp. 231–240, 10.1016/j.ipl.2005.02.004.
  • [3] Arnon Avron, Beata Konikowska & Anna Zamansky (2013): Cut-free Sequent Calculi for C-systems with Generalized Finite-valued Semantics. Journal of Logic and Computation 23(3), pp. 517–540, 10.1093/logcom/exs039.
  • [4] Arnon Avron & Iddo Lev (2005): Non-deterministic multiple-valued structures. Journal of Logic and Computation 15(3), pp. 241–261, 10.1093/logcom/exi001.
  • [5] Arnon Avron & Anna Zamansky (2011): Non-deterministic semantics for logical systems. In Dov M. Gabbay & Franz Guenthner, editors: Handbook of Philosophical Logic, 16, Springer, pp. 227–304, 10.1007/978-94-007-0479-4_4.
  • [6] Arnon Avron & Yoni Zohar (2019): Rexpansions of non-deterministic matrices and their applications. The Review of Symbolic Logic 12(1), pp. 173–200, 10.1017/S1755020318000321.
  • [7] Stefano Bonzio, Tommaso Moraschini & Michele Pra Baldi (2020): Logics of left variable inclusion and Płonka sums of matrices. Archive for Mathematical Logic 60, pp. 49–76, 10.1007/s00153-020-00727-6.
  • [8] Carlos Caleiro & Sérgio Marcelino (2019): Analytic calculi for monadic PNmatrices. In Rosalie Iemhoff, Michael Moortgat & Ruy de Queiroz, editors: Logic, Language, Information, and Computation (WoLLIC 2019), LNCS 11541, Springer-Verlag, pp. 84–98, 10.1007/978-3-662-59533-6_6.
  • [9] Carlos Caleiro, Sérgio Marcelino & Pedro Filipe (2020): Infectious semantics and analytic calculi for even more inclusion logics. In: 2020 IEEE 50th International Symposium on Multiple-Valued Logic, pp. 224–229, 10.1109/ISMVL49045.2020.000-1.
  • [10] Carlos Caleiro, João Marcos & Marco Volpe (2015): Bivalent semantics, generalized compositionality and analytic classic-like tableaux for finite-valued logics. Theoretical Computer Science 603, pp. 84–110, 10.1016/j.tcs.2015.07.016.
  • [11] Witold Charatonik (1999): Automata on DAG Representations of Finite Trees. Technical Report MPI-I-1999-2-001, Max-Planck-Institut für Informatik, Saarbrücken, Germany.
  • [12] Josep Font (2016): Abstract Algebraic Logic. Mathematical Logic and Foundations 60, College Publications.
  • [13] Dietlinde Lau (2006): Function Algebras on Finite Sets, A Basic Course on Many-Valued Logic and Clone Theory. Springer Monographs in Mathematics, Springer, 10.1007/3-540-36023-9.
  • [14] Sérgio Marcelino & Carlos Caleiro (2017): Disjoint fibring of non-deterministic matrices. In Juliette Kennedy & Ruy J.G.B. de Queiroz, editors: Logic, Language, Information, and Computation (WoLLIC 2017), LNCS 10388, Springer-Verlag, pp. 242–255, 10.1007/978-3-662-55386-2_17.
  • [15] Sérgio Marcelino & Carlos Caleiro (2019): Axiomatizing non-deterministic many-valued generalized consequence relations. Synthese 198, pp. 5373–5390, 10.1007/s11229-019-02142-8.
  • [16] Marvin Minsky (1967): Computation: Finite and Infinite Machines. Prentice-Hall.
  • [17] David John Shoesmith & Timothy Smiley (1978): Multiple-conclusion logic. Cambridge University Press, 10.1017/CBO9780511565687.
  • [18] Ryszard Wójcicki (1988): Theory of Logical Calculi. Synthese Library 199, Kluwer, 10.1007/978-94-015-6942-2.