Regular numerical predicate

From HandWiki

In computer science and mathematics, more precisely in automata theory, model theory and formal language, a regular numerical predicate is a kind of relation over integers. Regular numerical predicates can also be considered as a subset of [math]\displaystyle{ \mathbb N^r }[/math] for some arity [math]\displaystyle{ r }[/math]. One of the main interests of this class of predicates is that it can be defined in plenty of different ways, using different logical formalisms. Furthermore, most of the definitions use only basic notions, and thus allows to relate foundations of various fields of fundamental computer science such as automata theory, syntactic semigroup, model theory and semigroup theory.

The class of regular numerical predicate is denoted [math]\displaystyle{ \mathcal C_{lca} }[/math],[1]:140 [math]\displaystyle{ \mathcal N_{\mathtt{thres, mod}} }[/math][2] and REG.[3]

Definitions

The class of regular numerical predicate admits a lot of equivalent definitions. They are now given. In all of those definitions, we fix [math]\displaystyle{ r\in\mathbb N }[/math] and [math]\displaystyle{ P\subseteq\mathbb N^r }[/math] a (numerical) predicate of arity [math]\displaystyle{ r }[/math].

Automata with variables

The first definition encodes predicate as a formal language. A predicate is said to be regular if the formal language is regular.[3]:25

Let the alphabet [math]\displaystyle{ A }[/math] be the set of subset of [math]\displaystyle{ \{1,\dots,r\} }[/math]. Given a vector of [math]\displaystyle{ r }[/math] integers [math]\displaystyle{ \mathbf n=(n_0,\dots,n_{r-1})\in\mathbb N^r }[/math], it is represented by the word [math]\displaystyle{ \overline{\mathbf n} }[/math] of length [math]\displaystyle{ \max(n_0,\dots,n_{r-1}) }[/math] whose [math]\displaystyle{ i }[/math]-th letter is [math]\displaystyle{ \{j\mid n_j=i\} }[/math]. For example, the vector [math]\displaystyle{ (3,1,3) }[/math] is represented by the word [math]\displaystyle{ \emptyset\{1\}\emptyset\{0,2\} }[/math].

We then define [math]\displaystyle{ \overline P }[/math] as [math]\displaystyle{ \{\overline {\mathbf n}\mid\mathbf n\} }[/math].

The numerical predicate [math]\displaystyle{ P }[/math] is said to be regular if [math]\displaystyle{ \overline P }[/math] is a regular language over the alphabet [math]\displaystyle{ A }[/math]. This is the reason for the use of the word "regular" to describe this kind of numerical predicate.

Automata reading unary numbers

This second definition is similar to the previous one. Predicates are encoded into languages in a different way, and the predicate is said to be regular if and only if the language is regular.[3]:25

Our alphabet [math]\displaystyle{ A }[/math] is the set of vectors of [math]\displaystyle{ r }[/math] binary digits. That is: [math]\displaystyle{ \{0,1\}^r }[/math]. Before explaining how to encode a vector of numbers, we explain how to encode a single number.

Given a length [math]\displaystyle{ l }[/math] and a number [math]\displaystyle{ n\le l }[/math], the unary representation of [math]\displaystyle{ n }[/math] of length [math]\displaystyle{ l }[/math] is the word [math]\displaystyle{ \mid{n}\mid_l }[/math] over the binary alphabet [math]\displaystyle{ \{0,1\} }[/math], beginning by a sequence of [math]\displaystyle{ n }[/math] "1"'s, followed by [math]\displaystyle{ n-l }[/math] "0"'s. For example, the unary representation of 1 of length 4 is [math]\displaystyle{ 1000 }[/math].

Given a vector of [math]\displaystyle{ r }[/math] integers [math]\displaystyle{ \mathbf n=(n_0,\dots,n_{r-1})\in\mathbb N^r }[/math], let [math]\displaystyle{ l=\max(n_0,\dots,n_{r-1}) }[/math]. The vector [math]\displaystyle{ \mathbf n }[/math] is represented by the word [math]\displaystyle{ \overline{\mathbf n}\in\left(\{0,1\}^r\right)^* }[/math] such that, the projection of [math]\displaystyle{ \overline{\mathbf n} }[/math] over its [math]\displaystyle{ i }[/math]-th component is [math]\displaystyle{ \mid{n_i}\mid_{\max(n_0,\dots,n_{r-1})} }[/math]. For example, the representation of [math]\displaystyle{ (3,1,3) }[/math] is [math]\displaystyle{ \begin{array}{l|l|l}1&1&1\\1&0&0\\1&1&1\end{array} }[/math]. This is a word whose letters are the vectors [math]\displaystyle{ (1,1,1) }[/math], [math]\displaystyle{ (1,0,1) }[/math] and [math]\displaystyle{ (1,0,1) }[/math] and whose projection over each components are [math]\displaystyle{ 111 }[/math], [math]\displaystyle{ 100 }[/math] and [math]\displaystyle{ 111 }[/math].

As in the previous definition, the numerical predicate [math]\displaystyle{ P }[/math] is said to be regular if [math]\displaystyle{ \overline P }[/math] is a regular language over the alphabet [math]\displaystyle{ A }[/math].

[math]\displaystyle{ (\exists)MSO(+1) }[/math]

A predicate is regular if and only if it can be defined by a monadic second order formula [math]\displaystyle{ \phi(x_0,\dots,x_{r-1}) }[/math], or equivalently by an existential monadic second order formula, where the only atomic predicate is the successor function [math]\displaystyle{ y+1=z }[/math].[3]:26

[math]\displaystyle{ FO(\le,\mod) }[/math]

A predicate is regular if and only if it can be defined by a first order logic formula [math]\displaystyle{ \phi(x_0,\dots,x_{r-1}) }[/math], where the atomic predicates are:

  • the order relation [math]\displaystyle{ y\le z }[/math],
  • the predicate stating that a number is a multiple of a constant [math]\displaystyle{ m }[/math], that is [math]\displaystyle{ y\equiv 0\mod m }[/math].[3]:26

Congruence arithmetic

The language of congruence arithmetic[1]:140 is defined as the est of Boolean combinations, where the atomic predicates are:

  • the addition of a constant [math]\displaystyle{ x_i+c=x_j }[/math], with [math]\displaystyle{ c }[/math] an integral constant,
  • the order relation [math]\displaystyle{ x_i\le x_j }[/math],
  • the modular relations, with a fixed modular value. That is, predicates of the form [math]\displaystyle{ x_i\equiv c\mod m }[/math] where [math]\displaystyle{ c }[/math] and [math]\displaystyle{ m }[/math] are fixed constants and [math]\displaystyle{ x }[/math] is a variable.

A predicate is regular if and only if it can be defined in the language of congruence arithmetic. The equivalence with previous definition is due to quantifier elimination.[4]

Using recursion and patterns

This definition requires a fixed parameter [math]\displaystyle{ m }[/math]. A set is said to be regular if it is [math]\displaystyle{ m }[/math]-regular for some [math]\displaystyle{ m\ge2 }[/math]. In order to introduce the definition of [math]\displaystyle{ m }[/math]-regular, the trivial case where [math]\displaystyle{ r=0 }[/math] should be considered separately. When [math]\displaystyle{ r=0 }[/math], then the predicate [math]\displaystyle{ P }[/math] is either the constant true or the constant false. Those two predicates are said to be [math]\displaystyle{ m }[/math]-regular (for every [math]\displaystyle{ m }[/math]). Let us now assume that [math]\displaystyle{ r\ge1 }[/math]. In order to introduce the definition of regular predicate in this case, we need to introduce the notion of section of a predicate.

The section [math]\displaystyle{ P^{x_i=c} }[/math] of [math]\displaystyle{ P }[/math] is the predicate of arity [math]\displaystyle{ r-1 }[/math] where the [math]\displaystyle{ i }[/math]-th component is fixed to [math]\displaystyle{ c }[/math]. Formally, it is defined as [math]\displaystyle{ \{(x_0,\dots,x_{i-1},x_{i+1},\dots,x_{r-1})\mid P(x_0,\dots,x_{i-1},c,x_{i+1},\dots,x_{r-1})\} }[/math]. For example, let us consider the sum predicate [math]\displaystyle{ S=\{(n_0,n_1,n_2)\mid n_0+n_1=n_2\} }[/math]. Then [math]\displaystyle{ S^{x_0=c}=\{(n_1,n_2)\mid c+n_1=n_2\} }[/math] is the predicate which adds the constant [math]\displaystyle{ c }[/math], and [math]\displaystyle{ S^{x_2=c}=\{(n_0,n_1)\mid n_0+n_1=c\} }[/math] is the predicate which states that the sum of its two elements is [math]\displaystyle{ c }[/math].

The last equivalent definition of regular predicate can now be given. A predicate [math]\displaystyle{ P }[/math] of arity [math]\displaystyle{ r\ge1 }[/math] is [math]\displaystyle{ m }[/math]-regular if it satisfies the two following conditions:[5]

  • all of its sections are [math]\displaystyle{ m }[/math]-regular,
  • there exists a threshold [math]\displaystyle{ t\in\mathbb N }[/math] such that, for each vectors [math]\displaystyle{ (n_0,\dots,n_r)\in\mathbb N^r }[/math] with each [math]\displaystyle{ n_i\ge t }[/math], [math]\displaystyle{ P(n_0,\dots,n_r)\iff P(n_0+m,\dots,n_r+m) }[/math].

The second property intuitively means that, when number are big enough, then their exact value does not matter. The properties which matters are the order relation between the numbers and their value modulo the period [math]\displaystyle{ m }[/math].

Using recognizable semigroups

Given a subset [math]\displaystyle{ s\subseteq\{0,\dots,r-1\} }[/math], let [math]\displaystyle{ \overline s }[/math] be the characteristic vector of [math]\displaystyle{ s }[/math]. That is, the vector in [math]\displaystyle{ \{0,1\}^r }[/math] whose [math]\displaystyle{ i }[/math]-th component is 1 if [math]\displaystyle{ i\in s }[/math], and 0 otherwise. Given a sequence [math]\displaystyle{ \mathbf s=s_0\subsetneq\dots\subsetneq s_{p-1} }[/math] of sets, let [math]\displaystyle{ P_{\mathbf s}=\{(n_0,\dots,n_{p-1})\in\mathbb N^p\mid P(\sum n_ie_i)\} }[/math].

The predicate [math]\displaystyle{ P }[/math] is regular if and only if for each increasing sequence of set [math]\displaystyle{ \mathbf s }[/math], [math]\displaystyle{ P_{\mathbf s} }[/math] is a recognizable submonoid of [math]\displaystyle{ \mathbb N^p }[/math].[2]

Definition of non regular language

The predicate [math]\displaystyle{ P }[/math] is regular if and only if all languages which can be defined in first order logic with atomic predicates for letters and the atomic predicate [math]\displaystyle{ P }[/math] are regular. The same property would hold for the monadic second order logic, and with modular quantifiers.[1]

Reducing arity

The following property allows to reduce an arbitrarily complex non-regular predicate to a simpler binary predicate which is also non-regular.[5]

Let us assume that [math]\displaystyle{ P }[/math] is definable in Presburger Arithmetic. The predicate [math]\displaystyle{ P }[/math] is non regular if and only if there exists a formula in [math]\displaystyle{ \mathbf{FO}[\le,R] }[/math] which defines the multiplication by a rational [math]\displaystyle{ \frac pq\not\in\{0,1\} }[/math]. More precisely, it allows to define the non-regular predicate [math]\displaystyle{ \{(p\times n,q\times n)\mid n\in\mathbb N\} }[/math] for some [math]\displaystyle{ p\not\in{0,q} }[/math].

Properties

The class of regular numerical predicate satisfies many properties.

Satisfiability

As in previous case, let us assume that [math]\displaystyle{ P }[/math] is definable in Presburger Arithmetic. The satisfiability of [math]\displaystyle{ \exists\mathbf{MSO}(+1,P) }[/math] is decidable if and only if [math]\displaystyle{ P }[/math] is regular.

This theorem is due to the previous property and the fact that the satisfiability of [math]\displaystyle{ \exists\mathbf{MSO}(+1,\times{\frac pq}) }[/math] is undecidable when [math]\displaystyle{ p\ne0 }[/math] and [math]\displaystyle{ p\ne q }[/math].[citation needed]

Closure property

The class of regular predicates is closed under union, intersection, complement, taking a section, projection and Cartesian product. All of those properties follows directly from the definition of this class as the class of predicates definable in [math]\displaystyle{ \mathbf{FO}(\le, \mod) }[/math].[citation needed]

Decidability

It is decidable whether a predicate defined in Presburger arithmetic is regular.[2]

Elimination of quantifier

The logic [math]\displaystyle{ \mathbf{FO}(\le, +c,\mod) }[/math] considered above admit the elimination of quantifier. More precisely, the algorithm for elimination of quantifier by Cooper[6] does not introduce multiplication by constants nor sums of variable. Therefore, when applied to a [math]\displaystyle{ \mathbf{FO}(\le, +c,\mod) }[/math] it returns a quantifier-free formula in[math]\displaystyle{ \mathbf{FO}(\le, +c,\mod) }[/math].

References

  1. 1.0 1.1 1.2 Péladeau, Pierre (1992). "Formulas, regular languages and Boolean circuits". Theoretical Computer Science 101: 133–142. doi:10.1016/0304-3975(92)90152-6. 
  2. 2.0 2.1 2.2 Choffrut, Christian (January 2008). "Deciding whether a relation defined in Presburger logic can be defined in weaker logics". RAIRO - Theoretical Informatics and Applications 42 (1): 121–135. doi:10.1051/ita:2007047. http://www.numdam.org/articles/10.1051/ita:2007047/. 
  3. 3.0 3.1 3.2 3.3 3.4 Straubing, Howard (1994). Finite Automata, Formal Logic and Circuit Complexity. Birkhäser. ISBN 978-1-4612-0289-9. 
  4. Smoryński., Craig A. (1991). Logical number theory. 1. , an introduction.. Springer. p. 322. ISBN 978-3-642-75462-3. 
  5. 5.0 5.1 Milchior, Arthur (January 2017). "Undecidability of satisfiability of expansions of FO [<] with a Semilinear Non Regular Predicate over words.". The Nature of Computation: 161–170. 
  6. Cooper, D. C. (1972). "Theorem Proving in Arithmetic without Multiplication". Machine Intelligence 7: 91–99.