Related papers: Generating a Gray code for prefix normal words in …
With sound unification, Definite Clause Grammars and compact expression of combinatorial generation algorithms, logic programming is shown to conveniently host a declarative playground where interesting properties and behaviors emerge from…
We study descriptive complexity properties of the class of regular bifix-free languages, which is the intersection of prefix-free and suffix-free regular languages. We show that there exist a single ternary universal (stream of) bifix-free…
We consider the problem of lossless compression of binary trees, with the aim of reducing the number of code bits needed to store or transmit such trees. A lossless grammar-based code is presented which encodes each binary tree into a…
The computational complexity of the isomorphism problem for regular trees, regular linear orders, and regular words is analyzed. A tree is regular if it is isomorphic to the prefix order on a regular language. In case regular languages are…
Classic grammars and regular expressions can be used for a variety of purposes, including parsing, intent detection, and matching. However, the comparisons are performed at a structural level, with constituent elements (words or characters)…
A word is called closed if it has a prefix which is also its suffix and there is no internal occurrences of this prefix in the word. In this paper we study words that are rich in closed factors, i.e., which contain the maximal possible…
The purpose of this paper is to investigate the connection between context-free grammars and normal ordering problem, and then to explore various extensions of the Stirling grammar. We present grammatical characterizations of several well…
Cadences are structurally maximal arithmetic progressions of indices corresponding to equal characters in an underlying string. This paper provides a polynomial time detection algorithm for 3-cadences in grammar-compressed binary strings.…
When flipping a fair coin, let $W = L_1L_2...L_N$ with $L_i\in\{H,T\}$ be a binary word of length $N=2$ or $N=3$. In this paper, we establish second- and third-order linear recurrence relations and their generating functions to discuss the…
We investigate certain word-construction games with variable turn orders. In these games, Alice and Bob take turns on choosing consecutive letters of a word of fixed length, with Alice winning if the result lies in a predetermined target…
For a word $S$, let $f(S)$ be the largest integer $m$ such that there are two disjoints identical (scattered) subwords of length $m$. Let $f(n, \Sigma) = \min \{f(S): S \text{is of length} n, \text{over alphabet} \Sigma \}$. Here, it is…
In this note, we consider the problem of counting and verifying abelian border arrays of binary words. We show that the number of valid abelian border arrays of length \(n\) is \(2^{n-1}\). We also show that verifying whether a given array…
For an arbitrary word $w$ on an alphabet, we can define the alternating symbol graph, $G(w)$, as the graph in which the edge $(a, b)$ is in $E$ iff the letters $a$ and $b$ alternate in the word $w$. A graph $G = (V, E)$ is said to be…
Trapezoidal words are finite words having at most n+1 distinct factors of length n, for every n>=0. They encompass finite Sturmian words. We distinguish trapezoidal words into two disjoint subsets: open and closed trapezoidal words. A…
We present an algorithm to generate positive braids of a given length as words in Artin generators with a uniform probability. The complexity of this algorithm is polynomial in the number of strands and in the length of the generated…
We study some properties of the growth rate of $\mathcal{L}(\mathcal{A},\mathcal{F})$, that is, the language of words over the alphabet $\mathcal{A}$ avoiding the set of forbidden factors $\mathcal{F}$. We first provide a sufficient…
This paper presents lossless prefix codes optimized with respect to a pay-off criterion consisting of a convex combination of maximum codeword length and average codeword length. The optimal codeword lengths obtained are based on a new…
We prove that for any sequence of binary alphabets $\mathcal{A}_1,\mathcal{A}_2,\dots$, there exists a cube-free word $c_1c_2\dots$ so that $c_1\in\mathcal{A}_1,c_2\in\mathcal{A}_2,\dots$. In particular, for every $n$, there are at least…
In this paper, we study some new factorizations of period-doubling sequences over a $k$-letter alphabet, where $k\geq 2$. First, we define the combinatorial and arithmetic properties of these sequences. Then, we define the kernel words of…
Indexing strings via prefix (or suffix) sorting is, arguably, one of the most successful algorithmic techniques developed in the last decades. Can indexing be extended to languages? The main contribution of this paper is to initiate the…