TY - GEN
T1 - On the Complexity of Language Membership for Probabilistic Words
AU - Amarilli, Antoine
AU - Monet, Mikaël
AU - Raphaël, Paul
AU - Salvati, Sylvain
N1 - Publisher Copyright:
© Antoine Amarilli, Mikaël Monet, Paul Raphaël, and Sylvain Salvati.
PY - 2026/1/1
Y1 - 2026/1/1
N2 - We study the membership problem to context-free languages L (CFLs) on probabilistic words, that specify for each position a probability distribution on the letters (assuming independence across positions). Our task is to compute, given a probabilistic word, what is the probability that a word drawn according to the distribution belongs to L. This problem generalizes the problem of counting how many words of length n belong to L, or of counting how many completions of a partial word belong to L. We show that this problem is in polynomial time for unambiguous context-free languages (uCFLs), but can be #P-hard already for unions of two linear uCFLs. More generally, we show that the problem is in polynomial time for so-called poly-slicewise-unambiguous languages, where given a length n we can tractably compute an uCFL for the words of length n in the language. This class includes some inherently ambiguous languages, and implies the tractability of bounded CFLs and of languages recognized by unambiguous polynomial-time counter automata; but we show that the problem can be #P-hard for nondeterministic counter automata, even for Parikh automata with a single counter. We then introduce classes of circuits from knowledge compilation which we use for tractable counting, and show that this covers the tractability of poly-slicewise-unambiguous languages and of some CFLs that are not poly-slicewise-unambiguous. Extending these circuits with negation further allows us to show tractability for the language of primitive words, and for the language of concatenations of two palindromes. We finally show the conditional undecidability of the meta-problem that asks, given a CFG, whether the probabilistic membership problem for that CFG is tractable or #P-hard.
AB - We study the membership problem to context-free languages L (CFLs) on probabilistic words, that specify for each position a probability distribution on the letters (assuming independence across positions). Our task is to compute, given a probabilistic word, what is the probability that a word drawn according to the distribution belongs to L. This problem generalizes the problem of counting how many words of length n belong to L, or of counting how many completions of a partial word belong to L. We show that this problem is in polynomial time for unambiguous context-free languages (uCFLs), but can be #P-hard already for unions of two linear uCFLs. More generally, we show that the problem is in polynomial time for so-called poly-slicewise-unambiguous languages, where given a length n we can tractably compute an uCFL for the words of length n in the language. This class includes some inherently ambiguous languages, and implies the tractability of bounded CFLs and of languages recognized by unambiguous polynomial-time counter automata; but we show that the problem can be #P-hard for nondeterministic counter automata, even for Parikh automata with a single counter. We then introduce classes of circuits from knowledge compilation which we use for tractable counting, and show that this covers the tractability of poly-slicewise-unambiguous languages and of some CFLs that are not poly-slicewise-unambiguous. Extending these circuits with negation further allows us to show tractability for the language of primitive words, and for the language of concatenations of two palindromes. We finally show the conditional undecidability of the meta-problem that asks, given a CFG, whether the probabilistic membership problem for that CFG is tractable or #P-hard.
KW - Automaton
KW - context-free grammar
KW - membership problem
KW - probabilistic words
UR - https://www.scopus.com/pages/publications/105037326955
U2 - 10.4230/LIPIcs.STACS.2026.5
DO - 10.4230/LIPIcs.STACS.2026.5
M3 - Conference contribution
AN - SCOPUS:105037326955
T3 - Leibniz International Proceedings in Informatics, LIPIcs
BT - 43rd International Symposium on Theoretical Aspects of Computer Science, STACS 2026
A2 - Mahajan, Meena
A2 - Manea, Florin
A2 - McIver , Annabelle
A2 - Nguyen, KimThang
PB - Schloss Dagstuhl- Leibniz-Zentrum fur Informatik GmbH, Dagstuhl Publishing
T2 - 43rd International Symposium on Theoretical Aspects of Computer Science, STACS 2026
Y2 - 9 March 2026 through 13 March 2026
ER -