You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
author = {Conrado, Giovanna Kobus and Kjelstr\o{}m, Adam Husted and van de Pol, Jaco and Pavlogiannis, Andreas},
2191
+
title = {Program Analysis via Multiple Context Free Language Reachability},
2192
+
year = {2025},
2193
+
issue_date = {January 2025},
2194
+
publisher = {Association for Computing Machinery},
2195
+
address = {New York, NY, USA},
2196
+
volume = {9},
2197
+
number = {POPL},
2198
+
url = {https://doi.org/10.1145/3704854},
2199
+
doi = {10.1145/3704854},
2200
+
abstract = {Context-free language (CFL) reachability is a standard approach in static analyses, where the analysis question (e.g., is there a dataflow from x to y ?) is phrased as a language reachability problem on a graph G wrt a CFL L. However, CFLs lack the expressiveness needed for high analysis precision. On the other hand, common formalisms for context-sensitive languages are too expressive, in the sense that the corresponding reachability problem becomes undecidable. Are there useful context-sensitive language-reachability models for static analysis?In this paper, we introduce Multiple Context-Free Language (MCFL) reachability as an expressive yet tractable model for static program analysis. MCFLs form an infinite hierarchy of mildly context sensitive languages parameterized by a dimension d and a rank r. Larger d and r yield progressively more expressive MCFLs, offering tunable analysis precision. We showcase the utility of MCFL reachability by developing a family of MCFLs that approximate interleaved Dyck reachability, a common but undecidable static analysis problem.Given the increased expressiveness of MCFLs, one natural question pertains to their algorithmic complexity, i.e., how fast can MCFL reachability be computed? We show that the problem takes On2d+1 time on a graph of n nodes when r=1, and Ondr+1 time when r>1. Moreover, we show that when r=1, even the simpler membership problem has a lower bound of n2d based on the Strong Exponential Time Hypothesis, while reachability for d=1 has a lower bound of n3 based on the combinatorial Boolean Matrix Multiplication Hypothesis. Thus, for r=1, our algorithm is optimal within a factor n for all levels of the hierarchy based on the dimension d (and fully optimal for d=1).We implement our MCFL reachability algorithm and evaluate it by underapproximating interleaved Dyck reachability for a standard taint analysis for Android. When combined with existing overapproximate methods, MCFL reachability discovers all tainted information on 8 out of 11 benchmarks, while it has remarkable coverage (confirming 94.3\% of the reachable pairs reported by the overapproximation) on the remaining 3. To our knowledge, this is the first report of high and provable coverage for this challenging benchmark set.},
% (m*(k-1))-MCFL(r-k) subset m-MCFL(r) по Seki1991 -- при k=1 даёт 0-MCFL(r-1), что не определено.
16
+
% 4. Замкнутость относительно гомоморфизмов (строка 299--300): сверить по Rambow1999,
17
+
% доказывается ли там замкнутость относительно всех трёх операций (гомоморфизм,
18
+
% обратный гомоморфизм, подстановка) или только части.
19
+
% 5. Определение well-nested (строки 90--93): соответствует ли формальное условие
20
+
% (с регулярным выражением) стандартному определению из Seki1991 / Kanazawa2009.
21
+
% 6. Доказательство незамкнутости (строки 312--324): конструкция языков L_1, L_2
22
+
% нуждается в верификации по Seki1991; текущее определение может давать пустое пересечение.
23
+
% 7. Ссылка nakanishi1997efficient: проверить, действительно ли в этой работе
24
+
% (MOL5, proceedings) содержится доказательство теоремы о нормальной форме.
7
25
8
26
\textit{Многокомпонентные контекстно-свободные грамматики} (Multiple Context-Free Grammars, MCFG)~--- это расширение контекстно-свободных грамматик, в котором нетерминальные символы могут порождать кортежи строк, а не отдельные строки.
9
27
Данный класс грамматик был впервые предложен Поллардом~\sidecite{pollard1984generalized} для описания синтаксиса естественных языков, а затем систематически изучен Секи с соавторами~\sidecite{seki1991multiple}.
@@ -94,11 +112,11 @@ \section{Разновидности MCFG}
94
112
\end{itemize}
95
113
96
114
\begin{example}
97
-
Следующее правило является well-nested (переменные каждого нетерминала образуют непрерывные интервалы):
115
+
Следующее правило является well-nested (несмотря на то, что переменные $B$ не идут подряд, никакие два различных нетерминала не содержат запрещённого паттерна чередования вида $B_j \ldots C_{j'} \ldots B_{j+1} \ldots C_{j'+1}$):
Оба языка являются MCFL, но их пересечение не является MCFL в силу иерархической теоремы~\ref{thm:hierarchy_m}.
336
+
Язык $L_1$ является $(m+1)$-MCFL($1$) (теорема~\ref{thm:hierarchy_m}), язык $L_2$ является $2$-MCFL (строится парой $(a_1^n\cdots a_{m+1}^n,\; b_1^n\cdots b_{m+1}^n)$, каждый компонент которой является КС-языком).
337
+
В~\cite{seki1991multiple} показано, что $L_1\cap L_2$ не является MCFL: при надлежащем выборе $m$ ранг, требуемый для порождения пересечения, превосходит $m$, а конструкция допускает масштабирование на произвольно большие значения~--- таким образом, пересечение не принадлежит ни одному из классов $m$-MCFL.
319
338
320
339
Незамкнутость относительно дополнения следует из незамкнутости относительно пересечения по законам де Моргана:
321
340
если бы MCFL были замкнуты относительно дополнения, то $L_1\cap L_2 = \overline{\overline{L_1} \cup\overline{L_2}}$ также был бы MCFL, что неверно.
@@ -344,16 +363,15 @@ \section{Языки MIX и $O_n$}
344
363
Другие важные представители MCFL:
345
364
346
365
\begin{itemize}
347
-
\item\textbf{Многомерный язык Дика}: существует $2$-MCFG для трёхмерного языка Дика~\sidecite{10.1007/978-3-662-59620-3_5}\footnote{\url{https://link.springer.com/chapter/10.1007/978-3-662-59620-3_5}}.
348
-
\item\textbf{Шафл языков Дика}: задача контекстно-зависимого анализа графа зависимостей может быть сведена к MCFL-достижимости с использованием шафла языков Дика~\sidecite{10.1145/3009837.3009848}\footnote{\url{https://dl.acm.org/doi/10.1145/3093333.3009848}}.
366
+
\item\textbf{Многомерный язык Дика}: вопрос о существовании $2$-MCFG для трёхмерного языка Дика$D^3$ остаётся открытым, хотя и предпринимались попытки построения, использующие технику метаграмматик~\sidecite{10.1007/978-3-662-59620-3_5}.
367
+
\item\textbf{Шафл языков Дика}: в качестве приближения задачи контекстно-зависимого межпроцедурного анализа кода может быть использована к MCFL-достижимости с использованием шафла языков Дика~\sidecite{10.1145/3704854}\footnote{\url{https://dl.acm.org/doi/10.1145/3704854}}.
349
368
\end{itemize}
350
369
351
-
\section{Вопросы и задачи}
370
+
%\section{Вопросы и задачи}
352
371
353
-
\begin{enumerate}
354
-
\item Покажите, что язык $\{a^n b^n c^n \mid n \ge0\}$ не является MCFL.
355
-
\item Постройте MCFG для языка $\{a^n b^m c^n d^m \mid n,m \ge0\}$.
356
-
\item Является ли язык $\{a^n b^{n^2} \mid n \ge0\}$ MCFL? Ответ обоснуйте.
357
-
\item Покажите, что $2$-MCFG могут порождать язык копий $\{ww \mid w \in\{a,b\}^*\}$.
358
-
\item Докажите, что $1$-MCFL($2$) строго шире $1$-MCFL($1$).
359
-
\end{enumerate}
372
+
%\begin{enumerate}
373
+
% \item Покажите, что язык $\{a^n b^n c^n \mid n \ge 0\}$ не является MCFL.
374
+
% \item Постройте MCFG для языка $\{a^n b^m c^n d^m \mid n,m \ge 0\}$.
375
+
% \item Является ли язык $\{a^n b^{n^2} \mid n \ge 0\}$ MCFL? Ответ обоснуйте.
376
+
% \item Покажите, что $2$-MCFG могут порождать язык копий $\{ww \mid w \in \{a,b\}^*\}$.
0 commit comments