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

Department of Computer Science, Technion, Israel and https://shaull.cswp.cs.technion.ac.il/ [email protected]://orcid.org/0000-0001-9021-1175supported by the Israel Science Foundation grant 989/22 Reichman University, Herzliya, [email protected] Reichman University, Herzliya, Israel and https://faculty.runi.ac.il/udiboker/[email protected]://orcid.org/0000-0003-4322-8892supported by the Israel Science Foundation grant 2410/22 \CopyrightShaull Almagor, Daniel Assa, and Udi Boker \ccsdesc[300]Theory of computation Formal languages and automata theory \EventEditorsPatricia Bouyer and Srikanth Srinivasan \EventNoEds2 \EventLongTitle43rd IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science (FSTTCS 2023) \EventShortTitleFSTTCS 2023 \EventAcronymFSTTCS \EventYear2023 \EventDateDecember 18–20, 2023 \EventLocationIIIT Hyderabad, Telangana, India \EventLogo \SeriesVolume284 \ArticleNo15

Synchronized CTL over One-Counter Automata

Shaull Almagor    Daniel Assa    Udi Boker
Abstract

We consider the model-checking problem of Synchronized Computation-Tree Logic (CTL+Sync) over One-Counter Automata (OCAs). CTL+Sync augments CTL with temporal operators that require several paths to satisfy properties in a synchronous manner, e.g., the property “all paths should eventually see pp at the same time”. The model-checking problem for CTL+Sync over finite-state Kripke structures was shown to be in 𝖯𝖭𝖯𝖭𝖯{\mathsf{P}}^{{\mathsf{NP}}^{\mathsf{NP}}}. OCAs are labelled transition systems equipped with a non-negative counter that can be zero-tested. Thus, they induce infinite-state systems whose computation trees are not regular. The model-checking problem for CTL over OCAs was shown to be 𝖯𝖲𝖯𝖠𝖢𝖤{\mathsf{PSPACE}}-complete.

We show that the model-checking problem for CTL+Sync over OCAs is decidable. However, the upper bound we give is non-elementary. We therefore proceed to study the problem for a central fragment of CTL+Sync, extending CTL with operators that require all paths to satisfy properties in a synchronous manner, and show that it is in 𝖤𝖷𝖯𝖭𝖤𝖷𝖯\mathsf{EXP}^{\mathsf{NEXP}} (and in particular in 𝖤𝖷𝖯𝖲𝖯𝖠𝖢𝖤\mathsf{EXPSPACE}), by exhibiting a certain “segmented periodicity” in the computation trees of OCAs.

keywords:
CTL, Synchronization, One Counter Automata, Model Checking
category:
\relatedversion

1 Introduction

Branching-time model checking is a central avenue in formal verification, as it enables reasoning about multiple computations of the system with both an existential and universal quantification. As systems become richer, the classical paradigm of e.g., CTL model checking over finite-state systems becomes insufficient. To this end, researchers have proposed extensions both of the logics [2, 6, 5, 3, 4, 1] and of the systems [7, 22, 9, 13].

In the systems’ frontier, of particular interest are infinite-state models. Typically, such models can quickly lead to undecidability (e.g., two-counter machines [18]). However, some models can retain decidability while still having rich modelling power. One such model that has received a lot of attention in recent years is One Counter Automata (OCAs) [21, 15] – finite state machines equipped with a non-negative counter that can be zero-tested. Model checking CTL over OCAs was studied in [13], where it was shown to be decidable in 𝖯𝖲𝖯𝖠𝖢𝖤{\mathsf{PSPACE}}. The main tool used there is the fact that despite the infinite configuration space, the computations of an OCA do admit some periodic behavior, which can be exploited to exhibit a small-model property for the satisfaction of Until formulas.

In the logics’ frontier, a useful extension of CTL is that of CTL with Synchronization operators (CTL+Sync), introduced in [4]. CTL+Sync extends CTL with operators that express synchronization properties of computation trees. Specifically, two new operators are introduced: Until All and Until Exists. The former, denoted by ψ1UAψ2\psi_{1}UA\psi_{2}, holds in state ss if there is a uniform bound kk\in\mathbb{N} such that ψ2\psi_{2} holds in all paths from ss after exactly kk steps, and ψ1\psi_{1} holds in all paths up to step kk. Thus, intuitively, it requires all the computations to synchronize the satisfaction of the Until operator. The latter, somewhat less natural operator, denoted by ψ1UEψ2\psi_{1}UE\psi_{2}, requires that there exists a uniform bound kk such that in every level j<kj<k of the computation tree, some path satisfies ψ1\psi_{1} and can be continued to satisfy ψ2\psi_{2} at level kk.

In comparison, the standard CTL operators Aψ1Uψ2A\psi_{1}U\psi_{2} and Eψ1Uψ2E\psi_{1}U\psi_{2} require that all paths/some path satisfy the Until formula, but there is no requirement that the bounds coincide. We illustrate the differences between the semantics in Figure 1. As discussed in [4], CTL+Sync can describe non ω\omega-regular properties of trees, and hence goes beyond MSO, while retaining a decidable model-checking problem over finite Kripke structures.

Refer to caption
(a) 𝚝𝚛𝚞𝚎UA\mathtt{true}\,U\!A\,\leavevmode\hbox to8pt{\vbox to8pt{\pgfpicture\makeatletter\hbox{\hskip 4.0pt\lower-4.0pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{}{{}}{}{{{}} {}{}{}{}{}{}{}{} }\pgfsys@beginscope\pgfsys@invoke{ }\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@invoke{ }\pgfsys@color@gray@fill{0}\pgfsys@invoke{ }\definecolor[named]{pgffillcolor}{rgb}{0,0,0}\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@moveto{4.0pt}{0.0pt}\pgfsys@curveto{4.0pt}{2.20917pt}{2.20917pt}{4.0pt}{0.0pt}{4.0pt}\pgfsys@curveto{-2.20917pt}{4.0pt}{-4.0pt}{2.20917pt}{-4.0pt}{0.0pt}\pgfsys@curveto{-4.0pt}{-2.20917pt}{-2.20917pt}{-4.0pt}{0.0pt}{-4.0pt}\pgfsys@curveto{2.20917pt}{-4.0pt}{4.0pt}{-2.20917pt}{4.0pt}{0.0pt}\pgfsys@closepath\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@fill\pgfsys@invoke{ } \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}} and EUE\,\leavevmode\hbox to8.4pt{\vbox to8.4pt{\pgfpicture\makeatletter\hbox{\hskip 4.2pt\lower-4.2pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{}{{}}{}{{{}} {}{}{}{}{}{}{}{} }\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgffillcolor}{rgb}{0.9,0.9,0.9}\pgfsys@color@gray@fill{0.9}\pgfsys@invoke{ }\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@invoke{ }{}\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@moveto{4.0pt}{0.0pt}\pgfsys@curveto{4.0pt}{2.20917pt}{2.20917pt}{4.0pt}{0.0pt}{4.0pt}\pgfsys@curveto{-2.20917pt}{4.0pt}{-4.0pt}{2.20917pt}{-4.0pt}{0.0pt}\pgfsys@curveto{-4.0pt}{-2.20917pt}{-2.20917pt}{-4.0pt}{0.0pt}{-4.0pt}\pgfsys@curveto{2.20917pt}{-4.0pt}{4.0pt}{-2.20917pt}{4.0pt}{0.0pt}\pgfsys@closepath\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@fillstroke\pgfsys@invoke{ } \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}\,U\,\leavevmode\hbox to8.4pt{\vbox to8.4pt{\pgfpicture\makeatletter\hbox{\hskip 4.2pt\lower-4.2pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{}{{}}{}{{{}} {}{}{}{}{}{}{}{} }\pgfsys@beginscope\pgfsys@invoke{ }\definecolor[named]{pgf@tempcolor}{rgb}{0,0,0}\pgfsys@invoke{\lxSVG@setpatternuncolored@{3}{0}{0}{0} }{}\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@moveto{4.0pt}{0.0pt}\pgfsys@curveto{4.0pt}{2.20917pt}{2.20917pt}{4.0pt}{0.0pt}{4.0pt}\pgfsys@curveto{-2.20917pt}{4.0pt}{-4.0pt}{2.20917pt}{-4.0pt}{0.0pt}\pgfsys@curveto{-4.0pt}{-2.20917pt}{-2.20917pt}{-4.0pt}{0.0pt}{-4.0pt}\pgfsys@curveto{2.20917pt}{-4.0pt}{4.0pt}{-2.20917pt}{4.0pt}{0.0pt}\pgfsys@closepath\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@fillstroke\pgfsys@invoke{ } \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}} are satisfied.
Refer to caption
(b) A𝚝𝚛𝚞𝚎UA\,\mathtt{true}\,U\,\leavevmode\hbox to8pt{\vbox to8pt{\pgfpicture\makeatletter\hbox{\hskip 4.0pt\lower-4.0pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{}{{}}{}{{{}} {}{}{}{}{}{}{}{} }\pgfsys@beginscope\pgfsys@invoke{ }\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@invoke{ }\pgfsys@color@gray@fill{0}\pgfsys@invoke{ }\definecolor[named]{pgffillcolor}{rgb}{0,0,0}\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@moveto{4.0pt}{0.0pt}\pgfsys@curveto{4.0pt}{2.20917pt}{2.20917pt}{4.0pt}{0.0pt}{4.0pt}\pgfsys@curveto{-2.20917pt}{4.0pt}{-4.0pt}{2.20917pt}{-4.0pt}{0.0pt}\pgfsys@curveto{-4.0pt}{-2.20917pt}{-2.20917pt}{-4.0pt}{0.0pt}{-4.0pt}\pgfsys@curveto{2.20917pt}{-4.0pt}{4.0pt}{-2.20917pt}{4.0pt}{0.0pt}\pgfsys@closepath\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@fill\pgfsys@invoke{ } \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}} and UE\leavevmode\hbox to8.4pt{\vbox to8.4pt{\pgfpicture\makeatletter\hbox{\hskip 4.2pt\lower-4.2pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{}{{}}{}{{{}} {}{}{}{}{}{}{}{} }\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgffillcolor}{rgb}{0.9,0.9,0.9}\pgfsys@color@gray@fill{0.9}\pgfsys@invoke{ }\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@invoke{ }{}\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@moveto{4.0pt}{0.0pt}\pgfsys@curveto{4.0pt}{2.20917pt}{2.20917pt}{4.0pt}{0.0pt}{4.0pt}\pgfsys@curveto{-2.20917pt}{4.0pt}{-4.0pt}{2.20917pt}{-4.0pt}{0.0pt}\pgfsys@curveto{-4.0pt}{-2.20917pt}{-2.20917pt}{-4.0pt}{0.0pt}{-4.0pt}\pgfsys@curveto{2.20917pt}{-4.0pt}{4.0pt}{-2.20917pt}{4.0pt}{0.0pt}\pgfsys@closepath\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@fillstroke\pgfsys@invoke{ } \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}\,U\!E\,\leavevmode\hbox to8.4pt{\vbox to8.4pt{\pgfpicture\makeatletter\hbox{\hskip 4.2pt\lower-4.2pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{}{{}}{}{{{}} {}{}{}{}{}{}{}{} }\pgfsys@beginscope\pgfsys@invoke{ }\definecolor[named]{pgf@tempcolor}{rgb}{0,0,0}\pgfsys@invoke{\lxSVG@setpatternuncolored@{3}{0}{0}{0} }{}\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@moveto{4.0pt}{0.0pt}\pgfsys@curveto{4.0pt}{2.20917pt}{2.20917pt}{4.0pt}{0.0pt}{4.0pt}\pgfsys@curveto{-2.20917pt}{4.0pt}{-4.0pt}{2.20917pt}{-4.0pt}{0.0pt}\pgfsys@curveto{-4.0pt}{-2.20917pt}{-2.20917pt}{-4.0pt}{0.0pt}{-4.0pt}\pgfsys@curveto{2.20917pt}{-4.0pt}{4.0pt}{-2.20917pt}{4.0pt}{0.0pt}\pgfsys@closepath\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@fillstroke\pgfsys@invoke{ } \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}} are satisfied.
Figure 1: The computation tree in (1(b)) satisfies A𝚝𝚛𝚞𝚎UA\,\mathtt{true}\,U\,\leavevmode\hbox to8pt{\vbox to8pt{\pgfpicture\makeatletter\hbox{\hskip 4.0pt\lower-4.0pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{}{{}}{}{{{}} {}{}{}{}{}{}{}{} }\pgfsys@beginscope\pgfsys@invoke{ }\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@invoke{ }\pgfsys@color@gray@fill{0}\pgfsys@invoke{ }\definecolor[named]{pgffillcolor}{rgb}{0,0,0}\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@moveto{4.0pt}{0.0pt}\pgfsys@curveto{4.0pt}{2.20917pt}{2.20917pt}{4.0pt}{0.0pt}{4.0pt}\pgfsys@curveto{-2.20917pt}{4.0pt}{-4.0pt}{2.20917pt}{-4.0pt}{0.0pt}\pgfsys@curveto{-4.0pt}{-2.20917pt}{-2.20917pt}{-4.0pt}{0.0pt}{-4.0pt}\pgfsys@curveto{2.20917pt}{-4.0pt}{4.0pt}{-2.20917pt}{4.0pt}{0.0pt}\pgfsys@closepath\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@fill\pgfsys@invoke{ } \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}, since every path eventually reaches . However, it does not satisfy 𝚝𝚛𝚞𝚎UA\mathtt{true}\,U\!A\,\leavevmode\hbox to8pt{\vbox to8pt{\pgfpicture\makeatletter\hbox{\hskip 4.0pt\lower-4.0pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{}{{}}{}{{{}} {}{}{}{}{}{}{}{} }\pgfsys@beginscope\pgfsys@invoke{ }\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@invoke{ }\pgfsys@color@gray@fill{0}\pgfsys@invoke{ }\definecolor[named]{pgffillcolor}{rgb}{0,0,0}\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@moveto{4.0pt}{0.0pt}\pgfsys@curveto{4.0pt}{2.20917pt}{2.20917pt}{4.0pt}{0.0pt}{4.0pt}\pgfsys@curveto{-2.20917pt}{4.0pt}{-4.0pt}{2.20917pt}{-4.0pt}{0.0pt}\pgfsys@curveto{-4.0pt}{-2.20917pt}{-2.20917pt}{-4.0pt}{0.0pt}{-4.0pt}\pgfsys@curveto{2.20917pt}{-4.0pt}{4.0pt}{-2.20917pt}{4.0pt}{0.0pt}\pgfsys@closepath\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@fill\pgfsys@invoke{ } \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}, since this eventuality does not happen synchronously. In contrast, the tree in (1(a)) does satisfy 𝚝𝚛𝚞𝚎UA\mathtt{true}\,U\!A\,\leavevmode\hbox to8pt{\vbox to8pt{\pgfpicture\makeatletter\hbox{\hskip 4.0pt\lower-4.0pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{}{{}}{}{{{}} {}{}{}{}{}{}{}{} }\pgfsys@beginscope\pgfsys@invoke{ }\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@invoke{ }\pgfsys@color@gray@fill{0}\pgfsys@invoke{ }\definecolor[named]{pgffillcolor}{rgb}{0,0,0}\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@moveto{4.0pt}{0.0pt}\pgfsys@curveto{4.0pt}{2.20917pt}{2.20917pt}{4.0pt}{0.0pt}{4.0pt}\pgfsys@curveto{-2.20917pt}{4.0pt}{-4.0pt}{2.20917pt}{-4.0pt}{0.0pt}\pgfsys@curveto{-4.0pt}{-2.20917pt}{-2.20917pt}{-4.0pt}{0.0pt}{-4.0pt}\pgfsys@curveto{2.20917pt}{-4.0pt}{4.0pt}{-2.20917pt}{4.0pt}{0.0pt}\pgfsys@closepath\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@fill\pgfsys@invoke{ } \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}.
The formula EUE\,\leavevmode\hbox to8.4pt{\vbox to8.4pt{\pgfpicture\makeatletter\hbox{\hskip 4.2pt\lower-4.2pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{}{{}}{}{{{}} {}{}{}{}{}{}{}{} }\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgffillcolor}{rgb}{0.9,0.9,0.9}\pgfsys@color@gray@fill{0.9}\pgfsys@invoke{ }\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@invoke{ }{}\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@moveto{4.0pt}{0.0pt}\pgfsys@curveto{4.0pt}{2.20917pt}{2.20917pt}{4.0pt}{0.0pt}{4.0pt}\pgfsys@curveto{-2.20917pt}{4.0pt}{-4.0pt}{2.20917pt}{-4.0pt}{0.0pt}\pgfsys@curveto{-4.0pt}{-2.20917pt}{-2.20917pt}{-4.0pt}{0.0pt}{-4.0pt}\pgfsys@curveto{2.20917pt}{-4.0pt}{4.0pt}{-2.20917pt}{4.0pt}{0.0pt}\pgfsys@closepath\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@fillstroke\pgfsys@invoke{ } \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}\,U\,\leavevmode\hbox to8.4pt{\vbox to8.4pt{\pgfpicture\makeatletter\hbox{\hskip 4.2pt\lower-4.2pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{}{{}}{}{{{}} {}{}{}{}{}{}{}{} }\pgfsys@beginscope\pgfsys@invoke{ }\definecolor[named]{pgf@tempcolor}{rgb}{0,0,0}\pgfsys@invoke{\lxSVG@setpatternuncolored@{3}{0}{0}{0} }{}\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@moveto{4.0pt}{0.0pt}\pgfsys@curveto{4.0pt}{2.20917pt}{2.20917pt}{4.0pt}{0.0pt}{4.0pt}\pgfsys@curveto{-2.20917pt}{4.0pt}{-4.0pt}{2.20917pt}{-4.0pt}{0.0pt}\pgfsys@curveto{-4.0pt}{-2.20917pt}{-2.20917pt}{-4.0pt}{0.0pt}{-4.0pt}\pgfsys@curveto{2.20917pt}{-4.0pt}{4.0pt}{-2.20917pt}{4.0pt}{0.0pt}\pgfsys@closepath\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@fillstroke\pgfsys@invoke{ } \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}} is satisfied in (1(a)) (along the left branch), but not in (1(b)), which only satisfies the weaker UE\leavevmode\hbox to8.4pt{\vbox to8.4pt{\pgfpicture\makeatletter\hbox{\hskip 4.2pt\lower-4.2pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{}{{}}{}{{{}} {}{}{}{}{}{}{}{} }\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgffillcolor}{rgb}{0.9,0.9,0.9}\pgfsys@color@gray@fill{0.9}\pgfsys@invoke{ }\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@invoke{ }{}\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@moveto{4.0pt}{0.0pt}\pgfsys@curveto{4.0pt}{2.20917pt}{2.20917pt}{4.0pt}{0.0pt}{4.0pt}\pgfsys@curveto{-2.20917pt}{4.0pt}{-4.0pt}{2.20917pt}{-4.0pt}{0.0pt}\pgfsys@curveto{-4.0pt}{-2.20917pt}{-2.20917pt}{-4.0pt}{0.0pt}{-4.0pt}\pgfsys@curveto{2.20917pt}{-4.0pt}{4.0pt}{-2.20917pt}{4.0pt}{0.0pt}\pgfsys@closepath\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@fillstroke\pgfsys@invoke{ } \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}\,U\!E\,\leavevmode\hbox to8.4pt{\vbox to8.4pt{\pgfpicture\makeatletter\hbox{\hskip 4.2pt\lower-4.2pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{}{{}}{}{{{}} {}{}{}{}{}{}{}{} }\pgfsys@beginscope\pgfsys@invoke{ }\definecolor[named]{pgf@tempcolor}{rgb}{0,0,0}\pgfsys@invoke{\lxSVG@setpatternuncolored@{3}{0}{0}{0} }{}\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@moveto{4.0pt}{0.0pt}\pgfsys@curveto{4.0pt}{2.20917pt}{2.20917pt}{4.0pt}{0.0pt}{4.0pt}\pgfsys@curveto{-2.20917pt}{4.0pt}{-4.0pt}{2.20917pt}{-4.0pt}{0.0pt}\pgfsys@curveto{-4.0pt}{-2.20917pt}{-2.20917pt}{-4.0pt}{0.0pt}{-4.0pt}\pgfsys@curveto{2.20917pt}{-4.0pt}{4.0pt}{-2.20917pt}{4.0pt}{0.0pt}\pgfsys@closepath\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@fillstroke\pgfsys@invoke{ } \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}. The boxed nodes on each level show that holds along a path to at level 66.

In this work, we show the decidability of CTL+Sync model checking over OCAs: Given an OCA 𝒜{\mathcal{A}} and a CTL+Sync formula φ\varphi, the problem of whether 𝒜{\mathcal{A}} satisfies φ\varphi. We thus combine the expressiveness of CTL+Sync with the rich modeling power of OCAs.

On the technical side, the approach taken in [4] to solve model-checking of CTL+Sync over Kripke structures does not seem to be very useful in our case. The solution there is based on the observation that every two levels of the computation tree that share the same set of Kripke-states must also share the same satisfaction value to every CTL+Sync formula. Hence, in that case, the algorithm can follow the computation tree of the powerset of the given Kripke structure, and terminate when encountering a level that has the same set of states as some previous level. In contrast, for OCAs, the unbounded counter prevents the ability to consider subsets of configurations.

On the other hand, the approach taken in [13] to solve model-checking of OCAs with respect to CTL is indeed useful in our case. Specifically, the algorithm in [13] is based on an analysis of the periodic behavior of the set of counter values that satisfy a given CTL formula in a given state of the OCA. We extend this approach, taking into account the additional complexity that stems from the synchronization requirements; see Section 5.

We start with establishing the decidability of CTL+Sync model checking using Presburger Arithmetic (see Section 4). This, however, yields a procedure with non-elementary runtime.

We then proceed to our main technical contribution (Section 5), providing an algorithm for model checking the central fragment of CTL+Sync that extends CTL with the UAUA operator, which requires all paths to satisfy properties in a synchronous manner. Its running time is in 𝖤𝖷𝖯𝖭𝖤𝖷𝖯\mathsf{EXP}^{\mathsf{NEXP}} (and in particular in 𝖤𝖷𝖯𝖲𝖯𝖠𝖢𝖤\mathsf{EXPSPACE}), and for a fixed OCA and formulas of a fixed nesting depth, it is in 𝖯𝖭𝖯{\mathsf{P}}^{\mathsf{NP}} (and in particular in 𝖯𝖲𝖯𝖠𝖢𝖤{\mathsf{PSPACE}}).

Since CTL+Sync makes assertions on the behavior of different paths at the same time step (namely the same level of the computation tree), we need to reason about which configurations occur at each level of the tree. More precisely, in order to establish decidability we wish to exhibit a small-model property of the form if the computation tree from some configuration (s,v)(s,v), for a state ss and counter value vv, satisfies the formula φ\varphi, then the computation tree from some configuration (s,v)(s,v^{\prime}) for a small vv^{\prime} satisfies φ\varphi as well. Unfortunately, the computation trees of an OCA from two configurations (s,v)(s,v) and (s,v)(s,v^{\prime}) cannot be easily obtained from one another using simple pumping arguments, due to the zero tests. This is in contrast to the case where one does not care about the length of a path, as in [13]. To overcome this, we show that computation trees of an OCA 𝒜{\mathcal{A}} can be split into several segments, polynomially many in the size of 𝒜{\mathcal{A}}, and that within each segment we can find a bounded prefix that is common to all trees after a certain counter threshold, and such that the remainder of the segment is periodic. Using this, we establish the small model property above. The toolbox used for proving this, apart from careful cycle analysis, includes 2TVASS – a variant of 2VASS studied in [17] that allows for one counter of the 2VASS to be zero-tested.

We believe that this structural result (Lemma 5.9) is of independent interest for reasoning about multiple traces in an OCA computation tree, when the length of paths plays a role.

2 Preliminaries

Let ={0,1,}\mathbb{N}=\{0,1,\ldots\} be the natural numbers. For a finite set AA\subseteq\mathbb{N} we denote by lcm(A)\mathrm{lcm}(A) the least common multiple of the elements in AA.

For a finite sequence ξ=t0t1th1\xi=t_{0}t_{1}\cdots t_{h{-}1} and integers x,yx,y, such that 0xyh10\leq x\leq y\leq h{-}1, we write ξ[x..y]\xi[x..y] for the infix of ξ\xi between positions xx and yy, namely for txtx+1tyt_{x}t_{x+1}\cdots t_{y}. We also use the parentheses ‘(’ and ‘)’ for a non-inclusive range, e.g., [x..y)=[x..y1][x..y)=[x..y{-}1], and abbreviate ξ[x..x]\xi[x..x] by ξ[x]\xi[x]. We denote the length of ξ\xi by |ξ|=h|\xi|=h.

One Counter Automata

A One Counter Automaton (OCA) is a triple 𝒜=S,Δ,L{\mathcal{A}}=\langle S,\Delta,L\rangle, where SS is a finite set of states, Δ(S×{=0,>0}×{0,+1,1}×S)\Delta\subseteq(S\times\{\texttt{=0},\texttt{>0}\}\times\{0,+1,-1\}\times S) is a transition relation, and L:SAPL:S\to AP, for some finite set APAP of atomic propositions, is the state labeling.

A pair (s,v)S×(s,v)\in S\times\mathbb{N} is a configuration of 𝒜{\mathcal{A}}. We write (s,v)t(s,v)(s,v)\to_{t}(s^{\prime},v^{\prime}) for a transition tΔt\in\Delta if one of the following holds:

  • t=(s,=0,e,s)t=(s,\texttt{=0},e,s^{\prime}), with e{0,+1}e\in\{0,+1\}, v=0v=0 and v=ev^{\prime}=e, or

  • t=(s,>0,e,s)t=(s,\texttt{>0},e,s^{\prime}), with e{0,+1,1}e\in\{0,+1,-1\}, v>0v>0 and v=v+ev^{\prime}=v+e.

We write (s,v)(s,v)(s,v)\to(s^{\prime},v^{\prime}) if (s,v)t(s,v)(s,v)\to_{t}(s^{\prime},v^{\prime}) for some tΔt\in\Delta.

We require that Δ\Delta is total, in the sense that for every configuration (s,v)(s,v) we have (s,v)(s,v)(s,v)\to(s^{\prime},v^{\prime}) for some configuration (s,v)(s^{\prime},v^{\prime}). Note that this is a syntactic requirement — every state should have outgoing transitions on both =0 and >0. This corresponds to the standard requirement of Kripke structures that there are no deadlocks. We denote by |𝒜||{\mathcal{A}}| the number of states of 𝒜{\mathcal{A}}. Note that the description size of 𝒜{\mathcal{A}} is therefore polynomial in |𝒜||{\mathcal{A}}|.

A path of 𝒜{\mathcal{A}} is a sequence of transitions τ=t1,,tk\tau=t_{1},\ldots,t_{k} such that there exist states s0,,sks_{0},\ldots,s_{k} where ti=(si1,i,ei,si)t_{i}=(s_{i-1},\bowtie_{i},e_{i},s_{i}) with i{=0,>0}\bowtie_{i}\in\{\texttt{=0},\texttt{>0}\} for all 1ik1\leq i\leq k. We say that τ\tau is valid from starting counter v0v_{0} (or from configuration (s0,v0)(s_{0},v_{0})), if there are counters v0,,vkv_{0},\ldots,v_{k}\in\mathbb{N} such that for all 1i<k1\leq i<k we have (si1,vi1)ti(si,vi)(s_{i-1},v_{i-1})\to_{t_{i}}(s_{i},v_{i}). We abuse notation and refer to the sequence of configurations also as a path, starting in (s0,v0)(s_{0},v_{0}) and ending in (sk,vk)(s_{k},v_{k}). The length of the path τ\tau is kk, and we define its effect(π)=i=1kei\emph{effect}(\pi)=\sum_{i=1}^{k}e_{i}.

We also allow infinite paths, in which case there are no end configurations and the length is \infty. In this case we explicitly mention that the path is infinite. We say that τ\tau is balanced/positive/negative if effect(τ)\emph{effect}(\tau) is zero/positive/negative, respectively. It is a cycle if s0=sks_{0}=s_{k}, and it has a cycle β\beta, if β\beta is a cycle and is a contiguous infix of τ\tau.

CTL+Sync

A CTL+Sync formula φ\varphi is given by the following syntax, where qq stands for an atomic proposition from a finite set APAP of atomic propositions.

φ::=𝚝𝚛𝚞𝚎qφφ¬φEXφEφUφAφUφStandard CTLφUAφφUEφSync operators\varphi::=\underbrace{\mathtt{true}\mid q\mid\varphi\land\varphi\mid\neg\varphi\mid EX\varphi\mid E\varphi U\varphi\mid A\varphi U\varphi}_{\text{Standard CTL}}\mid\underbrace{\varphi UA\varphi\mid\varphi UE\varphi}_{\text{Sync operators}}

We proceed to the semantics. Consider an OCA 𝒜=S,Δ,L{\mathcal{A}}=\langle S,\Delta,L\rangle, a configuration (s,v)(s,v), and a CTL+Sync formula φ\varphi. Then 𝒜(s,v){\mathcal{A}}^{(s,v)} satisfies φ\varphi, denoted by 𝒜(s,v)φ{\mathcal{A}}^{(s,v)}\models\varphi , as defined below.

  • Boolean Opeartors:

    • 𝒜(s,v)𝚝𝚛𝚞𝚎{\mathcal{A}}^{(s,v)}\models\mathtt{true}; 𝒜(s,v)⊧̸𝚏𝚊𝚕𝚜𝚎{\mathcal{A}}^{(s,v)}\not\models\mathtt{false}  •  𝒜(s,v)q{\mathcal{A}}^{(s,v)}\models q if qL(s)q\in L(s).

    • 𝒜(s,v)¬φ{\mathcal{A}}^{(s,v)}\models\neg\varphi if 𝒜(s,v)⊧̸φ{\mathcal{A}}^{(s,v)}\not\models\varphi.       •  𝒜(s,v)φψ{\mathcal{A}}^{(s,v)}\models\varphi\land\psi if 𝒜(s,v)φ{\mathcal{A}}^{(s,v)}\models\varphi and 𝒜(s,v)ψ{\mathcal{A}}^{(s,v)}\models\psi .

  • CTL temporal operators:

    • 𝒜(s,v)EXφ{\mathcal{A}}^{(s,v)}\models EX\varphi if (s,v)(s,v)(s,v)\to(s^{\prime},v^{\prime}) for some configuration (s,v)(s^{\prime},v^{\prime}) such that 𝒜(s,v)φ{\mathcal{A}}^{(s^{\prime},v^{\prime})}\models\varphi.

    • 𝒜(s,v)EφUψ{\mathcal{A}}^{(s,v)}\models E\varphi U\psi if there exists a valid path τ\tau from (s,v)(s,v) and k0k\geq 0, such that 𝒜τ[k]ψ{\mathcal{A}}^{\tau[k]}\models\psi and for every j[0..k1]j\in[0..k-1], we have 𝒜τ[j]φ{\mathcal{A}}^{\tau[j]}\models\varphi.

    • 𝒜(s,v)AφUψ{\mathcal{A}}^{(s,v)}\models A\varphi U\psi if for every valid path τ\tau from (s,v)(s,v) there exists k0k\geq 0, such that 𝒜τ[k]ψ{\mathcal{A}}^{\tau[k]}\models\psi and for every j[0..k1]j\in[0..k-1], we have 𝒜τ[j]φ{\mathcal{A}}^{\tau[j]}\models\varphi.

  • Synchronization operators:

    • 𝒜(s,v)φUAψ{\mathcal{A}}^{(s,v)}\models\varphi UA\psi if there exists k0k\geq 0, such that for every valid path τ\tau from (s,v)(s,v) of length kk and for every j[0..k1]j\in[0..k-1] we have 𝒜τ[j]φ{\mathcal{A}}^{\tau[j]}\models\varphi and 𝒜τ[k]ψ{\mathcal{A}}^{\tau[k]}\models\psi.

    • 𝒜(s,v)φUEψ{\mathcal{A}}^{(s,v)}\models\varphi UE\psi if there exists k0k\geq 0, such that for every j[0..k1]j\in[0..k-1] there exists a valid path τ\tau from (s,v)(s,v) of length kk such that 𝒜τ[j]φ{\mathcal{A}}^{\tau[j]}\models\varphi and 𝒜τ[k]ψ{\mathcal{A}}^{\tau[k]}\models\psi.

Remark 2.1 (Additional operators).

Standard additional Boolean and CTL operators, e.g., ,EF,EG\lor,EF,EG, etc. can be expressed by means of the given syntax. Similar shorthands can be defined for the synchronization operators, e.g., FEFE and GEGE, etc. We remark that one can also consider operators such as XEψXE\psi with the semantics “in the next step there exists a path satisfying ψ\psi”. However, the semantics of this coincides with the CTL operator EXEX.

Presburger Arithmetic

Presburger Arithmetic (PA) [20] is the first-order theory Th(,0,1,+,<,=)\textrm{Th}(\mathbb{N},0,1,+,<,=) of \mathbb{N} with addition and order. We briefly survey the results we need about PA, and refer the reader to [14] for a detailed survey.

For our purposes, a PA formula φ(x1,,xd)\varphi(x_{1},\ldots,x_{d}), where x1,,xdx_{1},\ldots,x_{d} are free variables, is evaluated over d\mathbb{N}^{d}, and defines the set {(a1,,ad)d(a1,,ad)φ(x1,,xd)}\{(a_{1},\ldots,a_{d})\in\mathbb{N}^{d}\mid(a_{1},\ldots,a_{d})\models\varphi(x_{1},\ldots,x_{d})\}. It is known that PA is decidable in 2-\NEXP [8, 11].

A linear set is a set of the form Lin(B,P)={𝒃+λ1𝒑𝟏+λk𝒑𝒌𝒃B,λ1,λk}\mathrm{Lin}(B,P)=\{\boldsymbol{b}+\lambda_{1}\boldsymbol{p_{1}}+\ldots\lambda_{k}\boldsymbol{p_{k}}\mid\boldsymbol{b}\in B,\ \lambda_{1}\ldots,\lambda_{k}\in\mathbb{N}\} where BdB\subseteq\mathbb{N}^{d} is a finite basis and P={𝒑𝟏,,𝒑𝒌}dP=\{\boldsymbol{p_{1}},\ldots,\boldsymbol{p_{k}}\}\subseteq\mathbb{N}^{d} are the periods. A semilinear set is then a finite union of linear sets. A fundamental result about PA [12] is that the sets definable in PA are exactly the semilinear sets, and moreover, one can effectively obtain from a PA formula φ\varphi a description of the semilinear set satisfying a formula φ\varphi, and vice versa.

{observation}

In dimension 11, semilinear sets are finite unions of arithmetic progressions. By taking the lcm\mathrm{lcm} of the (nonzero) periods of the progressions and modifying the basis accordingly, we can assume a uniform nonzero period, and an additional finite set (corresponding to the zero period). That is, a semilinear set SS\subseteq\mathbb{N} is Lin(B,{p})C\mathrm{Lin}(B,\{p\})\cup C for effectively computable finite sets B,CB,C\subseteq\mathbb{N} and pp\in\mathbb{N}.

3 Periodicity and Flatness over OCAs

Recall that the configuration space of an OCA is S×S\times\mathbb{N}. The underlying approach we take to solve CTL+Sync model checking is to show that satisfaction of CTL+Sync formulas over these configurations exhibits some periodicity. Moreover, the run tree of the OCA can be captured, to an extent, using a small number of cycles (a property called flatness). These properties will be relied upon in proving our main results.

3.1 Periodicity

In this subsection we formalize our notions of ultimate periodicity, show how they suffice for model-checking, and cite important results about periodicity in CTL.

Consider a CTL+Sync formula φ\varphi. We say that φ\varphi is (𝚝(φ),𝚙(φ))(\mathtt{t}(\varphi),\mathtt{p}(\varphi))-periodic with respect to an OCA 𝒜{\mathcal{A}} (or just periodic, if we do not care about the constants) if for every state sSs\in S and counters v,v>𝚝(φ)v,v^{\prime}>\mathtt{t}(\varphi), if vvmod𝚙(φ)v\equiv v^{\prime}\mod\mathtt{p}(\varphi) then (s,v)φ(s,v)φ(s,v)\models\varphi\iff(s,v^{\prime})\models\varphi. We think of 𝚝(φ)\mathtt{t}(\varphi) as its threshold and of 𝚙(φ)\mathtt{p}(\varphi) as its period. We say that φ\varphi is totally (𝚝(φ),𝚙(φ))(\mathtt{t}(\varphi),\mathtt{p}(\varphi))-periodic with respect to 𝒜{\mathcal{A}} if every subformula of φ\varphi (including φ\varphi itself) is (𝚝(φ),𝚙(φ))(\mathtt{t}(\varphi),\mathtt{p}(\varphi))-periodic with respect to 𝒜{\mathcal{A}}. We usually omit 𝒜{\mathcal{A}}, as it is clear from context.

Total-periodicity is tantamount to periodicity for each subformula, in the following sense.

Proposition 3.1.

A CTL+Sync formula φ\varphi is totally (𝚝(φ),𝚙(φ))(\mathtt{t}(\varphi),\mathtt{p}(\varphi))-periodic if and only if every subformula ψ\psi of φ\varphi is (𝚝(ψ),𝚙(ψ))(\mathtt{t}^{\prime}(\psi),\mathtt{p}^{\prime}(\psi))-periodic for some constants 𝚝(ψ),𝚙(ψ)\mathtt{t}^{\prime}(\psi),\mathtt{p}^{\prime}(\psi).

For a totally periodic formula, model checking over OCA can be reduced to model checking over finite Kripke structures, as follows. Intuitively, we simply “unfold” the OCA and identify states with high counter values according to their modulo of 𝚙(φ)\mathtt{p}(\varphi).

Proposition 3.2.

Consider an OCA 𝒜{\mathcal{A}} and a totally (𝚝(φ),𝚙(φ))(\mathtt{t}(\varphi),\mathtt{p}(\varphi))-periodic CTL+Sync formula φ\varphi, then we can effectively construct a Kripke structure 𝒦{\mathcal{K}} of size |𝒜|(𝚝(φ)+𝚙(φ))|{\mathcal{A}}|\cdot(\mathtt{t}(\varphi)+\mathtt{p}(\varphi)) such that 𝒜φ{\mathcal{A}}\models\varphi if and only if 𝒦φ{\mathcal{K}}\models\varphi.

In [13, Theorem 1] it is proved that every CTL formula φ\varphi over OCA is periodic. Our goal is to give a similar result for CTL+Sync, which in particular contains CTL. In order to avoid replicating the proof in [13] for CTL, we observe that the proof therein is by structural induction over φ\varphi, and that moreover – the inductive assumption requires only periodicity of the subformulas of φ\varphi. We can thus restate [13, Theorem 1] with the explicit inductive assumption, so that we can directly plug our results about CTL+Sync into it.

Denote by k=|S|k=|S| the number of states of 𝒜{\mathcal{A}}, and let K=lcm({1,,k})K=\mathrm{lcm}(\{1,\ldots,k\}).

Theorem 3.3 (Theorem 1 in [13], restated).

Consider a CTL+Sync formula φ\varphi whose outermost operator is a CTL operator, and whose subformulas are periodic, then φ\varphi is periodic, and we have the following.

  • If φ=𝚝𝚛𝚞𝚎\varphi=\mathtt{true}, φ=𝚏𝚊𝚕𝚜𝚎\varphi=\mathtt{false}, or φ=p\varphi=p for pAPp\in AP, then φ\varphi is (0,1)(0,1)-periodic.

  • If φ=¬ψ\varphi=\neg\psi then 𝚝(φ)=𝚝(ψ)\mathtt{t}(\varphi)=\mathtt{t}(\psi) and 𝚙(φ)=𝚙(ψ)\mathtt{p}(\varphi)=\mathtt{p}(\psi).

  • If φ=ψ1ψ2\varphi=\psi_{1}\wedge\psi_{2} then 𝚝(φ)=max{𝚝(ψ1),𝚝(ψ2)}\mathtt{t}(\varphi)=\max\{\mathtt{t}(\psi_{1}),\mathtt{t}(\psi_{2})\} and 𝚙(φ)=lcm(𝚙(ψ1),𝚙(ψ2))\mathtt{p}(\varphi)=\mathrm{lcm}(\mathtt{p}(\psi_{1}),\mathtt{p}(\psi_{2})).

  • If φ=EXψ\varphi=EX\psi then 𝚝(φ)=𝚝(ψ)+𝚙(ψ)\mathtt{t}(\varphi)=\mathtt{t}(\psi)+\mathtt{p}(\psi) and 𝚙(φ)=K𝚙(ψ)\mathtt{p}(\varphi)=K\cdot\mathtt{p}(\psi)

  • If φ=Eψ1Uψ2\varphi=E\psi_{1}U\psi_{2} or φ=Aψ1Uψ2\varphi=A\psi_{1}U\psi_{2} then111Note that in [13] the case of Aψ1Uψ2A\psi_{1}U\psi_{2} is not stated, but rather the dual Release operator Eψ1Rψ2E\psi_{1}R\psi_{2}, which follows the same proof. 𝚝(φ)=max{𝚝(ψ1),𝚝(ψ2)}+2k2lcm(K𝚙(ψ1),𝚙(ψ2))\mathtt{t}(\varphi)=\max\{\mathtt{t}(\psi_{1}),\mathtt{t}(\psi_{2})\}+2\cdot k^{2}\cdot\mathrm{lcm}(K\cdot\mathtt{p}(\psi_{1}),\mathtt{p}(\psi_{2})) and 𝚙(φ)=lcm(K𝚙(ψ1),𝚙(ψ2))\mathtt{p}(\varphi)=\mathrm{lcm}(K\cdot\mathtt{p}(\psi_{1}),\mathtt{p}(\psi_{2})).

3.2 Linear Path Schemes

The runs of an OCA can take intricate shapes. Fortunately, however, we can use the results of [17] about flatness of a variant of 2-VASS with some zero tests, referred to as 2-TVASS, to obtain a simple form that characterizes reachability, namely linear path schemes.

A linear path scheme (LPS) is an expression of the form π=α0β1α1βkαk\pi=\alpha_{0}\beta_{1}^{*}\alpha_{1}\cdots\beta_{k}^{*}\alpha_{k} where each αiΔ\alpha_{i}\in\Delta^{*} is a path in 𝒜{\mathcal{A}} and each βiΔ\beta_{i}\in\Delta^{*} is a cycle in 𝒜{\mathcal{A}}. The flat length of π\pi is |π|=|α0β1α1βkαk||\pi|=|\alpha_{0}\beta_{1}\alpha_{1}\cdots\beta_{k}\alpha_{k}|, the size of π\pi is kk.

A concrete path τ\tau in 𝒜{\mathcal{A}} is π\pi-shaped if there exist e1,,eke_{1},\ldots,e_{k} such that τ=α0β1e1α1βkekαk\tau=\alpha_{0}\beta_{1}^{e_{1}}\alpha_{1}\cdots\beta_{k}^{e_{k}}\alpha_{k}.

Our first step is to use a result of [17] on 2-TVASS to show that paths of a fixed length in 𝒜{\mathcal{A}} admit a short LPS. The idea is to transform the OCA 𝒜{\mathcal{A}} to a 2-TVASS 𝒜{\mathcal{A}}^{\prime} by introducing a length-counting component. That is, in every transition of 𝒜{\mathcal{A}}^{\prime} as a 2-TVASS, the second component increments by 1.

Lemma 3.4.

Let (s,v)(s,v) and (s,v)(s^{\prime},v^{\prime}) be configurations of 𝒜{\mathcal{A}}. If there exists a path τ\tau of length \ell from (s,v)(s,v) to (s,v)(s^{\prime},v^{\prime}), then there is also a π\pi-shaped path τ\tau^{\prime} of length \ell from (s,v)(s,v) to (s,v)(s^{\prime},v^{\prime}), where π\pi is some linear path scheme of flat length poly(|S|)\text{poly}(|S|) and size O(|S|3)O(|S|^{3}).

By Lemma 3.4, we can focus our attention to π\pi-shaped paths where π\pi is “short”. Henceforth, we call a path τ\tau basic if it is π\pi-shaped for some LPS π\pi as per Lemma 3.4.

Using standard acceleration techniques (see e.g., [16, 10, 17]), we also get from Lemma 3.4 that the reachability relation of an OCA (including path length) is effectively semilinear. More precisely, we have the following.

Corollary 3.5.

We can effectively compute, for every s,sSs,s^{\prime}\in S, a PA formula Paths,s(x,y,x,y)Path_{s,s^{\prime}}(x,y,x^{\prime},y^{\prime}) such that (v,,v,)Paths,s(x,y,x,y)(v,\ell,v^{\prime},\ell^{\prime})\models Path_{s,s^{\prime}}(x,y,x^{\prime},y^{\prime}) if and only if a path of length \ell ending222It is more natural to assume =0\ell=0 and simply consider paths starting at (s,v)(s,v). However, our formulation makes things easier later on. at (s,v)(s,v) can be continued to a path of length \ell^{\prime} ending at (s,v)(s^{\prime},v^{\prime}).

4 Model Checking CTL+Sync via Presburger Arithmetic

In this section we show that model checking CTL+Sync over OCAs is decidable, by reducing it to the satisfiability problem of a PA formula.

We start with a simple observation.

Lemma 4.1.

Consider a totally (𝚝(φ),𝚙(φ))(\mathtt{t}(\varphi),\mathtt{p}(\varphi))-periodic CTL+Sync formula φ\varphi, then for every state sSs\in S we can compute a PA formula Pφ,s(x)P_{\varphi,s}(x) such vPφ,s(x)v\models P_{\varphi,s}(x) if and only if (s,v)φ(s,v)\models\varphi.

Next, we show that from a PA formula as above we can obtain a threshold and a period.

Lemma 4.2.

Consider a CTL+Sync formula φ\varphi and PA formulas Pφ,s(x)P_{\varphi,s}(x), for every state ss, such that vPφ,s(x)v\models P_{\varphi,s}(x) iff (s,v)φ(s,v)\models\varphi. Then φ\varphi is (𝚝(φ),𝚙(φ))(\mathtt{t}(\varphi),\mathtt{p}(\varphi))-periodic for computable constants 𝚝(φ)\mathtt{t}(\varphi) and 𝚙(φ)\mathtt{p}(\varphi).

Combining Theorems 3.3 and 4.1 we obtain that every CTL formula (without Sync) can be translated to PA formulas. We now turn to include the Sync operators.

Consider a CTL+Sync formula φ\varphi. We construct, by induction on the structure of φ\varphi, PA formulas Ps,φ(v)P_{s,\varphi}(v), for every state sSs\in S, such that Ps,φ(v)P_{s,\varphi}(v) holds if and only if (s,v)φ(s,v)\models\varphi. For the Sync operators, this utilizes the PA formulas of Corollary 3.5.

  • If φ=p\varphi=p for an atomic proposition pp, then Ps,φ(v)=TrueP_{s,\varphi}(v)=\text{True} if ss is labeled with pp and False otherwise.

  • If φ=¬ψ\varphi=\neg\psi, then Ps,φ(v)=¬Ps,ψ(v)P_{s,\varphi}(v)=\neg P_{s,\psi}(v).

  • If φ=ψ1ψ2\varphi=\psi_{1}\land\psi_{2}, then Ps,φ(v)=Ps,ψ1(v)Ps,ψ2(v)P_{s,\varphi}(v)=P_{s,\psi_{1}}(v)\land P_{s,\psi_{2}}(v).

  • If φ=EXψ\varphi=\text{EX}\psi, φ=Aψ1Uψ2\varphi=\text{A}\psi_{1}\text{U}\psi_{2} or φ=Eψ1Uψ2\varphi=\text{E}\psi_{1}\text{U}\psi_{2} then by the induction hypothesis, ψ\psi, ψ1\psi_{1} and ψ2\psi_{2} have corresponding PA formulas, and by Lemma 4.2 we can compute 𝚝(ψ)\mathtt{t}(\psi) and 𝚙(ψ)\mathtt{p}(\psi) (and similarly for ψ1\psi_{1} and ψ2\psi_{2}) such that ψ\psi is (𝚝(ψ),𝚙(ψ))(\mathtt{t}(\psi),\mathtt{p}(\psi))-periodic. Then, by Theorem 3.3 we can compute 𝚝(φ),𝚙(φ)\mathtt{t}(\varphi),\mathtt{p}(\varphi) such that φ\varphi is (𝚝(φ),𝚙(φ))(\mathtt{t}(\varphi),\mathtt{p}(\varphi))-periodic. Thus, we can apply Lemma 4.1 to obtain PA formulas for φ\varphi.

  • If φ=ψ1UEψ2\varphi=\psi_{1}\text{UE}\psi_{2}, then Ps,φ(v)=.<.(sS(v.(Paths,s(v,0,v,)Ps,ψ1(v)s′′Sv′′.Paths,s′′(v,,v′′,)Ps′′,ψ2(v′′))))P_{s,\varphi}(v)=\exists\ell.\forall\ell^{\prime}<\ell.\biggl{(}\bigvee_{s^{\prime}\in S}\Bigl{(}\exists v^{\prime}.\bigl{(}Path_{s,s^{\prime}}(v,0,v^{\prime},\ell^{\prime})\land P_{s^{\prime},\psi_{1}}(v^{\prime})\land\bigvee_{s^{\prime\prime}\in S}\exists v^{\prime\prime}.Path_{s^{\prime},s^{\prime\prime}}(v^{\prime},\ell^{\prime},v^{\prime\prime},\ell)\land P_{s^{\prime\prime},\psi_{2}}(v^{\prime\prime})\bigr{)}\Bigr{)}\biggr{)}

  • If φ=ψ1UAψ2\varphi=\psi_{1}\text{UA}\psi_{2}, then Ps,φ(v)=.((v.sS(Paths,s(v,0,v,)Ps,ψ2(v)))(sSv.(Paths,s(v,0,v,)Ps,ψ2(v)))P_{s,\varphi}(v)=\exists\ell.\biggl{(}\Bigl{(}\exists v^{\prime}.\bigvee_{s^{\prime}\in S}\bigl{(}Path_{s,s^{\prime}}(v,0,v^{\prime},\ell)\land P_{s^{\prime},\psi_{2}}(v^{\prime})\bigr{)}\Bigr{)}\leavevmode\nobreak\ \land\Bigl{(}\bigwedge_{s^{\prime}\in S}\forall v^{\prime}.\bigl{(}Path_{s,s^{\prime}}(v,0,v^{\prime},\ell)\to P_{s^{\prime},\psi_{2}}(v^{\prime})\bigr{)}\Bigr{)}\leavevmode\nobreak\ \land
    <.(sSv.(Paths,s(v,0,v,)Ps,ψ1(v))))\forall\ell^{\prime}<\ell.\Bigl{(}\bigwedge_{s^{\prime}\in S}\forall v^{\prime}.\bigl{(}Path_{s,s^{\prime}}(v,0,v^{\prime},\ell^{\prime})\to P_{s^{\prime},\psi_{1}}(v^{\prime})\bigr{)}\Bigr{)}\biggr{)}

The semantics of the obtained PA formulas match the semantics of the respective Sync operators. By Lemma 4.2 we now have that for every CTL+Sync formula φ\varphi we can compute 𝚝(φ),𝚙(φ)\mathtt{t}(\varphi),\mathtt{p}(\varphi) such that φ\varphi is (𝚝(φ),𝚙(φ))(\mathtt{t}(\varphi),\mathtt{p}(\varphi))-periodic. By Proposition 3.1 we can further assume that φ\varphi is totally (𝚝(φ),𝚙(φ))(\mathtt{t}(\varphi),\mathtt{p}(\varphi))-periodic. Finally, by Proposition 3.2 we can decide whether 𝒜φ{\mathcal{A}}\models\varphi.

Remark 4.3 (Complexity).

Observe that the complexity of our decision procedure via PA formulas is non-elementary. Indeed, when using a CTL subformula, we translate it, using Lemma 4.1, to a PA formula that may be exponential in the size of the formula and of the OCA. Thus, we might incur an exponential blowup in every step of the recursive construction, leading to a tower of exponents.

5 Model Checking the CTL+UA Fragment

In this section we consider the fragment of CTL+Sync induced by augmenting CTL with only the Sync operator ψ1UAψ2\psi_{1}UA\psi_{2}. For this fragment, we are able to obtain a much better upper bound for model checking, via careful analysis of the run tree of an OCA.

Throughout this section, we fix an OCA 𝒜=S,Δ,L{\mathcal{A}}=\langle S,\Delta,L\rangle with n=|S|3n=|S|\geq 3 states, and a CTL+UA formula φ\varphi. Consider a configuration (s,v)(s,v) of 𝒜{\mathcal{A}} and a CTL+UA formula φ=ψ1UAψ2\varphi=\psi_{1}UA\psi_{2} with UAUA being the outermost operator. The satisfaction of φ\varphi from (s,v)(s,v) is determined by the computation tree of 𝒜{\mathcal{A}} from (s,v)(s,v). Specifically, we have that 𝒜(s,v)φ{\mathcal{A}}^{(s,v)}\models\varphi if there exists some bound kk\in\mathbb{N} such that ψ2\psi_{2} holds in all configurations of level kk of the computation tree, and ψ1\psi_{1} holds in all configurations of levels \ell for 0<k0\leq\ell<k.

Therefore, in order to reason about the satisfaction of φ\varphi, it is enough to know which configurations appear in each level of the computation tree. This is in contrast with UE, where we would also need to consider the paths themselves. Fortunately, it means we can use the LPS of Lemma 3.4 to simplify the proofs.

Theorem 5.1.

Given an OCA 𝒜{\mathcal{A}} with n=|𝒜|n=|{\mathcal{A}}| and a CTL+UA formula φ\varphi, we can compute a counter threshold cT and a counter period P, both single exponential in nn and in the nesting depth of φ\varphi, such that φ\varphi is (cT,P)(\texttt{cT},\texttt{P})-periodic with respect to 𝒜{\mathcal{A}}.

Before we delve into the proof of Theorem 5.1, we show how it implies our main result.

Theorem 5.2.

The model-checking problem for CTL+UA is decidable in EXPNEXP\textsc{EXP}^{\textsc{NEXP}}.

Proof 5.3.

Consider a CTL+UA formula φ\varphi and an OCA 𝒜{\mathcal{A}}. By Theorem 5.1 we can compute cT,P\texttt{cT},\texttt{P} single exponential in |φ||\varphi| and |𝒜||{\mathcal{A}}|, such that φ\varphi is (cT,P)(\texttt{cT},\texttt{P})-periodic. We then apply Proposition 3.2 to reduce the problem to model checking φ\varphi against a Kripke structure 𝒦{\mathcal{K}} of size |𝒜|(cT+\cP)|{\mathcal{A}}|\cdot(\texttt{cT}+\cP).

Finally, the proof of [4, Theorem 1] shows that model checking the CTL+UA fragment can be done in 𝖯𝖭𝖯{\mathsf{P}}^{\mathsf{NP}} in the size of the Kripke structure and the formula, yielding an EXPNEXP\textsc{EXP}^{\textsc{NEXP}} bound in our setting.

Remark 5.4 (Lower Bounds).

The \PSPACE-hardness of model checking CTL over OCA from [13] immediately implies \PSPACE-hardness in our setting as well. However, tightening the gap between the lower and upper bounds remains an open problem.

The remainder of the paper is devoted to proving Theorem 5.1.

Cycle Manipulation and Slope Manipulation.

A fundamental part of our proof involves delicately pumping and removing cycles to achieve specific counter values and/or lengths of paths. We do this with the following technical tools.

For a path τ\tau, we define the slope of τ\tau as effect(τ)|τ|\frac{\emph{effect}(\tau)}{|\tau|}. Recall that a basic path is of the form τ=α0β1e1α1βkekαk\tau=\alpha_{0}\beta_{1}^{e_{1}}\alpha_{1}\cdots\beta_{k}^{e_{k}}\alpha_{k} adhering to some LPS, where k=O(|𝒜|)k=O(|{\mathcal{A}}|) and each αi\alpha_{i} and βi\beta_{i} is of length poly(|𝒜|)poly(|{\mathcal{A}}|). We denote by bb the maximum flat length of any LPS for a basic path. In particular, bb bounds the flat length of the LPS, the size of it, and the length of any cycle or path in it.

We call a cycle basic if it is of length at most bb. A slope of a path is basic if it may be the slope of a basic cycle, namely if it equals xy\frac{x}{y}, where x[b..b],y[1..b]x\in[-b..b],y\in[1..b] and |x|y|x|\leq y. We denote the basic slopes by si\texttt{s}_{i}, starting with s1\texttt{s}_{1} for the smallest. For example for b=3b=3, the basic slopes are (s1=1,s2=23,s3=12,s4=13,s5=0,s6=13,s7=12,s8=23,s9=1)(\texttt{s}_{1}\!\!=\!\!-1,\,\texttt{s}_{2}\!\!=\!\!-\frac{2}{3},\,\texttt{s}_{3}\!\!=\!\!-\frac{1}{2},\,\texttt{s}_{4}\!\!=\!\!-\frac{1}{3},\,\texttt{s}_{5}\!\!=\!\!0,\,\texttt{s}_{6}\!\!=\!\!\frac{1}{3},\,\texttt{s}_{7}\!\!=\!\!\frac{1}{2},\,\texttt{s}_{8}\!\!=\!\!\frac{2}{3},\,\texttt{s}_{9}\!\!=\!\!1). Observe that for every ii, we have |si|1b|\texttt{s}_{i}|\geq\frac{1}{b}, and for every j>ij>i, we have sjsi1b2\texttt{s}_{j}-\texttt{s}_{i}\geq\frac{1}{b^{2}} and when they are both negative, also sjsi11b2\frac{\texttt{s}_{j}}{\texttt{s}_{i}}\leq 1-\frac{1}{b^{2}}.

Proposition 5.5.

Consider a basic path τ\tau and basic cycles c1,c2,c3c_{1},c_{2},c_{3} in τ\tau with effects e1,e2,e3[b..b]e_{1},e_{2},e_{3}\in[-b..b], respectively, and lengths 1,2,3[1..b]\ell_{1},\ell_{2},\ell_{3}\in[1..b], respectively, such that e11e22e33\frac{e_{1}}{\ell_{1}}\leq\frac{e_{2}}{\ell_{2}}\leq\frac{e_{3}}{\ell_{3}}. Then there are numbers k1,k3[0..b2]k_{1},k_{3}\in[0..b^{2}], such that the combination of k1k_{1} repetitions of c1c_{1} and k3k_{3} repetitions of c3c_{3} yield an effect and length whose ratio is e22\frac{e_{2}}{\ell_{2}}.

Proposition 5.6.

Consider a path π\pi with cycles c1,c2c_{1},c_{2} with effects e1,e2[b..b]e_{1},e_{2}\in[-b..b] and lengths 1,2[1..b]\ell_{1},\ell_{2}\in[1..b], respectively, such that e11<e22\frac{e_{1}}{\ell_{1}}<\frac{e_{2}}{\ell_{2}}, and a length xx that is divisible by lcm[1..2b2]\mathrm{lcm}[1..2b^{2}]. Then there are numbers k1,k2[0..bx]k_{1},k_{2}\in[0..b\cdot x], such that the addition or removal of k1k_{1} repetitions of c1c_{1} and the addition or removal of k2k_{2} repetitions of c2c_{2} yield a path of the same effect as π\pi and of a length shorter or longer, as desired, by xx (provided enough cycle repetitions exist).

In order to prove Theorem 5.1, we show that every computation tree of 𝒜{\mathcal{A}}, starting from a big enough counter value v>cTv>\texttt{cT}, has a ‘segmented periodic’ structure with respect to φ\varphi. That is, we can divide its levels into poly(n)poly(n) many segments, such that only the first sTExp(n,|φ|\texttt{sT}\in Exp(n,|\varphi|) levels in each segment are in the ‘core’, while every other level \ell is a sort-of repetition of the level P\ell-\texttt{P}, for a period \cP\cP. We further show that there is a similarity between the cores of computation trees starting with counter values vv and v+Pv+\texttt{P}. We depict the segmentation in Figure 2, and formalize it as follows.

Consider a formula φ=ψ1UAψ2\varphi=\psi_{1}UA\psi_{2}, where ψ1\psi_{1} and ψ2\psi_{2} are (cT(ψ1),P(ψ1))(\texttt{cT}(\psi_{1}),\texttt{P}(\psi_{1}))- and (cT(ψ2),P(ψ2))(\texttt{cT}(\psi_{2}),\texttt{P}(\psi_{2}))-periodic, respectively. We define several constants to use throughout the proof.

  • Constants depending only on the number nn of states in the OCA

  • bPoly(n)b\in Poly(n): the bound on the length of a linear path scheme on 𝒜{\mathcal{A}}.

  • B=lcm[1..2b3]B=\mathrm{lcm}[1..2b^{3}].

  • Constants depending on nn and the CTL+UA formula φ\varphi

  • Pprev(φ)=lcm(P(ψ1),P(ψ2)){\texttt{P}_{prev}}(\varphi)=\mathrm{lcm}(\texttt{P}(\psi_{1}),\texttt{P}(\psi_{2})) – the unified period of the subformulas.

  • cTprev(φ)=max(cT(ψ1),cT(ψ2)){\texttt{cT}_{prev}}(\varphi)=\max(\texttt{cT}(\psi_{1}),\texttt{cT}(\psi_{2})) – the unified counter threshold of the subformulas.

  • P(φ)=BPprev(φ)\texttt{P}(\varphi)=B\cdot{\texttt{P}_{prev}}(\varphi) – the ‘period’ of φ\varphi.

  • sT(φ)=b9P(φ)\texttt{sT}(\varphi)=b^{9}\cdot\texttt{P}(\varphi) – the ‘segment threshold’ of φ\varphi.

  • cT(φ)=b11P(φ)\texttt{cT}(\varphi)=b^{11}\cdot\texttt{P}(\varphi) – the ‘counter threshold’ of φ\varphi.

Eventually, these periodicity constants are plugged into the inductive cases of Theorem 3.3, as shown in the proof of Theorem 5.1. Then, all the constants are single-exponential in nn and the nesting depth of φ\varphi. Notice that the following relationship holds between the constants.

Proposition 5.7.

P(φ)>cTprev(φ)\texttt{P}(\varphi)>{\texttt{cT}_{prev}}(\varphi) for b2b\geq 2.

When clear from the context, we omit the parameter φ\varphi from P,sT,cT,Pprev,cTprev\texttt{P},\texttt{sT},\texttt{cT},{\texttt{P}_{prev}},{\texttt{cT}_{prev}}.

We provide below an intuitive explanation for the choice of constants above.

Refer to caption
Figure 2: A computation tree from (s,v)(s,v) above and from (s,v+P)(s,v+\texttt{P}) below, demonstrating the segmented periodicity. Each segment ii starts at §i\mathsection_{i} and ends at §i+11\mathsection_{i+1}-1 (except for the last, which never ends). The core of the computation tree is the union of the first sT positions from each segment. Following these sT positions, there is within each segment periodicity of length P, meaning that for every path of length \ell, there exists an equivalent path of length +P\ell+\texttt{P}, as shown for the three points with the same state ss and equivalent counter values v1v2v3v_{1}\equiv v_{2}\equiv v_{3}. Between the trees, there is equivalence between the core positions, mapped via the shift function, as shown for the two points with the same state ss^{\prime} and the equivalent counter values vv′′v^{\prime}\equiv v^{\prime\prime}.
Intuition for the period P.

The period has two different roles: level-periodicity within each segment of a computation tree, and counter-value periodicity between two computation trees starting with different counter values.

Level periodicity within a segment: For lengthening or shortening a basic path by P, we add and/or remove some copies of its cycles. Adding or removing Pprev{\texttt{P}_{prev}} copies of the same cycle guarantees that the end counter values of the original and new paths are equivalent modulo Pprev{\texttt{P}_{prev}}. Since the cycles in a basic path are of length in [0..b][0..b], setting P to be divisible by Pprevlcm[1..b]{\texttt{P}_{prev}}\cdot\mathrm{lcm}[1..b], allows to add or remove P|c|\frac{\texttt{P}}{|c|} copies of a cycle cc, where P|c|\frac{\texttt{P}}{|c|} is divisible by Pprev{\texttt{P}_{prev}}, as desired. Yet, we might need to add copies of one cycle and remove copies of another, thus, as per Proposition 5.6, we need P to be divisible by Pprevlcm[1..2b2]{\texttt{P}_{prev}}\cdot lcm[1..2b^{2}].

Counter periodicity between computation trees: We change a path τ\tau that starts with a counter value vv to a path that starts with a counter value v+Pv+\texttt{P}, or vice versa, by lengthening or shortening it by Ps\frac{\texttt{P}}{\texttt{s}}, respectively, where s is a positive basic slope. In some cases, we need to also make sure that the longer or shorter path has a drop bigger or smaller, respectively, than τ\tau by exactly P.

As Ps\frac{\texttt{P}}{\texttt{s}} is bounded by bPb\cdot\texttt{P}, if there are at least bPb\cdot\texttt{P} repetitions of a cycle cc in τ\tau whose slope is s-\texttt{s}, we can just add or remove bP|c|\frac{b\cdot\texttt{P}}{|c|} copies of cc, so we need P to be divisible by Pprevlcm[1..b]{\texttt{P}_{prev}}\cdot\mathrm{lcm}[1..b], for guaranteeing that the counter values at the end of the original and new paths are equivalent. Yet, in some cases we need to combine two cycles, as per Proposition 5.5. As the combination of the two cycles might be of length up to 2b32b^{3}, we need P to be divisible by Pprevlcm[1..2b3]{\texttt{P}_{prev}}\cdot\mathrm{lcm}[1..2b^{3}].

Intuition for the counter threshold cT and the segment threshold sT.

In order to apply Propositions 5.5 and 5.6, we need to have in the handled path many repetitions of two cycles of different slopes. We thus choose cT and sT to be large enough so that paths in which only one (negative) cycle slope is repeated many times must hit zero within a special region called the ‘core’ of the tree, as defined below.

The core of a computation tree.

For every counter value v>cT{v}>\texttt{cT}, the ‘core’ with respect to a fixed formula φ\varphi, denoted by core(v)\texttt{core}({v})\subseteq\mathbb{N}, of a computation tree of 𝒜{\mathcal{A}} that starts with a counter value v{v} consists of m+1<b2m+1<b^{2} segments, with each segment corresponding to a negative basic slope and having sT consequent numbers. For every i[0..m]i\in[0..m], the start of Segment ii depends on the initial counter value vv of the computation tree, it is denoted by §i(v)\mathsection_{i}(v), and it is defined as follows:

  • §0(v)=0\mathsection_{0}(v)=0,

  • For i[1..m]i\in[1..m], we set §i(v)=1si(vcTprev)b8P\mathsection_{i}(v)=\frac{-1}{\texttt{s}_{i}}(v-{\texttt{cT}_{prev}})-b^{8}\cdot\texttt{P}.

  • For convenience, we also define §m+1(v)=\mathsection_{m{+}1}(v)=\infty.

Then, we define core(v)=i=0m[§i(v)..(§i(v)+sT1)]\texttt{core}(v)=\bigcup_{i=0}^{m}[\mathsection_{i}(v)..(\mathsection_{i}(v)+\texttt{sT}-1)].

Observe that the core of every tree is an ordered list of ((m+1)sT)((m+1)\cdot\texttt{sT}) numbers (levels), while just the starting level of every segment depends on the initial counter value vv. We can thus define a bijection shift:core(v)core(v+P)\textsf{shift}:\texttt{core}(v)\to\texttt{core}(v+\texttt{P}) that maps the ii-th number in core(v)\texttt{core}({v}) to the ii-th number in core(v+P)\texttt{core}({v+\texttt{P}}) (see also Figure 2).

Recall that we define sT so that, intuitively, if a path is long enough to reach §i(v)+sT\mathsection_{i}(v)+\texttt{sT} without reaching counter value cTprev{\texttt{cT}_{prev}}, then the path must have many cycles with a slope larger than si\texttt{s}_{i}, and if the path manages to reach cTprev{\texttt{cT}_{prev}} before §i+1(v)\mathsection_{i+1}(v) (namely the end of Segment ii), then it must have many cycles with a slope at least as small as si\texttt{s}_{i}. This is formalized as follows.

Lemma 5.8.

Let τ\tau be a basic path, or a prefix of it, of length \ell starting from counter value v>cTv>\texttt{cT}, and let i[0..m]i\in[0..m].

  1. 1.

    If §i(v)+sT2\ell\geq\mathsection_{i}(v)+\frac{\texttt{sT}}{2} and the counter values of τ\tau stay above cTprev{cT_{prev}}, then τ\tau has a cycle with slope sj\texttt{s}_{j} for j>ij>i that repeats at least b4Pb^{4}\cdot\texttt{P} times.

  2. 2.

    If <§i+1(v)\ell<\mathsection_{i+1}(v) and the counter values of τ\tau reach cTprev{cT_{prev}}, then τ\tau has a cycle with slope sj\texttt{s}_{j} for jij\leq i that repeats at least b4Pb^{4}\cdot\texttt{P} times.

As a sanity check, the lemma states that if a path τ\tau reaches cTprev{\texttt{cT}_{prev}} for the first time at length [§1(v)+sT2..§2(v))\ell\in[\mathsection_{1}(v){+}\frac{\texttt{sT}}{2}\leavevmode\nobreak\ ..\leavevmode\nobreak\ \mathsection_{2}(v)), then it has many cycles with slope s1=1\texttt{s}_{1}=-1 (enough to decrease down to cTprev{\texttt{cT}_{prev}} before §2(v)\mathsection_{2}(v)), as well as many cycle with slope at least s2=(b1)b\texttt{s}_{2}=\frac{-(b-1)}{b} (enough to keep above cTprev{\texttt{cT}_{prev}} through §1(v)+sT2\mathsection_{1}(v)+\frac{\texttt{sT}}{2}). Observe also that a path cannot reach cTprev{\texttt{cT}_{prev}} at Segment 0, namely before §1(v)\mathsection_{1}(v).

The segment and shift periodicity.

Consider a threshold TT and period PP. We say that counter values u,vu,v are (T,P)(T,P)-equivalent, denoted by uT,Pvu\equiv_{T,P}v if either u,vTu,v\geq T and PP divides |uv||u-v|, or u,v<Tu,v<T and u=vu=v. That is, either both u,vu,v are greater than TT, in which case they are equivalent modulo PP, or they are both smaller than TT and are equal.

The segment periodicity within a computation tree is then stated as Claim 1 in Lemma 5.9 below, while the similarity between computation trees starting from counters vv and v+Pv+\texttt{P} as Claim 2. (By (s,v)(s,v)(s,v)\stackrel{{\scriptstyle\ell}}{{\leadsto}}(s^{\prime},v^{\prime}) we mean that the computation tree starting with state ss and counter value vv has a path of length \ell ending in state ss^{\prime} and counter value vv^{\prime}.)

Lemma 5.9.

Consider states ss and ee, a counter value v>cTv>\texttt{cT}, an arbitrary counter value uu, and an arbitrary path length \ell.

  1. 1.

    If core(v)\ell\not\in\texttt{core}(v) then:

    1. (a)

      (s,v)(e,u)(s,v)P(e,u)(s,v)\stackrel{{\scriptstyle\ell}}{{\leadsto}}(e,u)\implies(s,v)\stackrel{{\scriptstyle\ell-\texttt{P}}}{{\leadsto}}(e,u^{\prime}), and

    2. (b)

      (s,v)P(e,u)(s,v)(e,u~)(s,v)\stackrel{{\scriptstyle\ell-\texttt{P}}}{{\leadsto}}(e,u)\implies(s,v)\stackrel{{\scriptstyle\ell}}{{\leadsto}}(e,\tilde{u}),

    for some counter values uu^{\prime} and u~\tilde{u}, such that ucTprev,PprevucTprev,Pprevu~u\equiv_{{\texttt{cT}_{prev}},{\texttt{P}_{prev}}}u^{\prime}\equiv_{{\texttt{cT}_{prev}},{\texttt{P}_{prev}}}\tilde{u}.

  2. 2.

    If core(v)\ell\in\texttt{core}(v) then:

    1. (a)

      (s,v+P)shift()(e,u)(s,v)(e,u)(s,v+\texttt{P})\stackrel{{\scriptstyle\textsf{shift}(\ell)}}{{\leadsto}}(e,u)\implies(s,v)\stackrel{{\scriptstyle\ell}}{{\leadsto}}(e,u^{\prime}), and

    2. (b)

      (s,v)(e,u)(s,v+P)shift()(e,u~)(s,v)\stackrel{{\scriptstyle\ell}}{{\leadsto}}(e,u)\implies(s,v+\texttt{P})\stackrel{{\scriptstyle\textsf{shift}(\ell)}}{{\leadsto}}(e,\tilde{u})

    for some counter values uu^{\prime} and u~\tilde{u}, such that ucTprev,PprevucTprev,Pprevu~u\equiv_{{\texttt{cT}_{prev}},{\texttt{P}_{prev}}}u^{\prime}\equiv_{{\texttt{cT}_{prev}},{\texttt{P}_{prev}}}\tilde{u}.

Throughout the proof, we will abbreviate ucTprev,Pprevuu\equiv_{{\texttt{cT}_{prev}},{\texttt{P}_{prev}}}u^{\prime} by uuu\equiv u^{\prime}. We split the proof into four parts, each devoted to one of the four stated implications. In each of them, we assume the existence of a path τ\tau that witnesses the left side of the implication, say (s,v)(e,u)(s,v)\stackrel{{\scriptstyle\ell}}{{\leadsto}}(e,u), and show that there exists a path τ\tau^{\prime} that witnesses the right side of the implication, say (s,v)P(e,u)(s,v)\stackrel{{\scriptstyle\ell-\texttt{P}}}{{\leadsto}}(e,u^{\prime}), where uuu\equiv u^{\prime}. By Lemma 3.4, we assume that τ\tau is a basic path. We present some of the cases; the remaining parts are in the appendix.

Proof of Lemma 5.9.1a

Let τ\tau be a basic path of length core(v)\ell\notin\texttt{core}(v) such that (s,v)(e,u)(s,v)\stackrel{{\scriptstyle\ell}}{{\leadsto}}(e,u) via τ\tau. We construct from τ\tau a path τ\tau^{\prime} for (s,v)P(e,u)(s,v)\stackrel{{\scriptstyle\ell-\texttt{P}}}{{\leadsto}}(e,u^{\prime}), such that uuu\equiv u^{\prime}. The proof is divided to two cases.

Case 1a.1: The counter values in τ\tau stay above cTprev{\texttt{cT}_{prev}}

If there is no position in τ\tau with counter value cTprev{\texttt{cT}_{prev}}, then in particular τ\tau has no zero-transitions. Since core(v)\ell\notin\texttt{core}(v), then in particular sT>3b5P\ell\geq\texttt{sT}>3b^{5}\texttt{P}. Thus, there are at least 3b4P3b^{4}\texttt{P} cycle repetitions in τ\tau.

If there is a non-positive cycle cc that is repeated at least P times, we can obtain τ\tau^{\prime} by removing P|c|\frac{\texttt{P}}{|c|} copies of cc, as the counter values along τ\tau^{\prime} are at least as high as the corresponding ones in τ\tau. Observe that τ\tau^{\prime} is of length P\ell-\texttt{P} from (s,v)(s,v) to (e,u)(e,u^{\prime}) with u=ueffect(c)P|c|u^{\prime}=u-\emph{effect}(c)\frac{\texttt{P}}{|c|}. Since we have uucTprevu^{\prime}\geq u\geq{\texttt{cT}_{prev}}, then uuu\equiv u^{\prime}.

Otherwise, each non-positive cycle in τ\tau is taken at most P times. Thus, the positive cycles are repeated at least 3b4PbP3b3P3b^{4}\texttt{P}-b\texttt{P}\geq 3b^{3}\texttt{P} times. In particular, there exists a positive cycle cc that repeats at least 3b2P3b^{2}\texttt{P} times. By removing P|c|\frac{\texttt{P}}{|c|} occurrences of it, we obtain a path τ\tau^{\prime} of length P\ell-\texttt{P}. Notice first that this path is valid. Indeed, up until the cycle cc is taken, the path τ\tau^{\prime} coincides with τ\tau, so the counter remains above cTprev{\texttt{cT}_{prev}}. Since cc is a positive cycle, after completing its iterations, the counter value becomes at least 3b2PP+cTprev3b^{2}\texttt{P}-\texttt{P}+{\texttt{cT}_{prev}}. Then, even if all remaining transitions in the negative cycles have effect 1-1, the counter value is reduced by at most b2Pb^{2}\texttt{P} (as there are at most (b1)P(b-1)\texttt{P} remaining cycles, each of effect at least b-b, and the simple paths in τ\tau can reduce by another bb at most). Thus, the value of the counter remains at least 3b2PP+cTprevb2P>cTprev3b^{2}\texttt{P}-\texttt{P}+{\texttt{cT}_{prev}}-b^{2}\texttt{P}>{\texttt{cT}_{prev}}. Finally, let (e,u)(e,u^{\prime}) be the configuration reached at the end of τ\tau^{\prime}, then uu=effect(c)P|c|u-u^{\prime}=\emph{effect}(c)\frac{\texttt{P}}{|c|}, so uuu\equiv u^{\prime}.

Case 1a.2: τ\tau reaches counter value cTprev{\texttt{cT}_{prev}}.

Let 0zfzu0\leq z_{f}\leq z_{u}\leq\ell be the first and ultimate positions in τ\tau where the counter value is exactly cTprev{\texttt{cT}_{prev}}. We split τ\tau into three parts: τ1=τ[0..zf),τ2=τ[zf..zu),τ3=τ[zu..]\tau_{1}=\tau[0\leavevmode\nobreak\ ..\leavevmode\nobreak\ z_{f}),\tau_{2}=\tau[z_{f}\leavevmode\nobreak\ ..\leavevmode\nobreak\ z_{u}),\tau_{3}=\tau[z_{u}\leavevmode\nobreak\ ..\leavevmode\nobreak\ \ell] (it could be that zf=zuz_{f}=z_{u}, in which case the middle part is empty). Since τ\tau is of length sTb9P\ell\geq\texttt{sT}\geq b^{9}\cdot\texttt{P}, then at least one of the parts above is of length at least b8Pb^{8}\cdot\texttt{P} (recall b3b\geq 3). We split according to which part that is. For simplicity, we start with the cases that τ2\tau_{2} or τ3\tau_{3} are long, and only then handle the case of a long τ1\tau_{1}.

  1. 1.

    The middle part τ2=τ[zf..zu]\tau_{2}=\tau[z_{f}\leavevmode\nobreak\ ..\leavevmode\nobreak\ z_{u}] is of length at least b8\cPb^{8}\cP.

    As τ2\tau_{2} is of length at least b8Pb^{8}\cdot\texttt{P}, some cycle cc in it must repeat at least b6Pb^{6}\cdot\texttt{P} times.

    If cc is balanced, we can obtain τ\tau^{\prime} by removing P|c|\frac{\texttt{P}}{|c|} of its repetitions.

    If cc is positive, starting at position xx with counter value vxv_{x}, then the counter value at position yy where cc’s repetitions end is at least vx+b6Pv_{x}+b^{6}\cdot\texttt{P}. As τ2\tau_{2} eventually gets down to cTprev<P{\texttt{cT}_{prev}}<\texttt{P}, there must be a negative cycle cc_{-} that repeats at least bPb\cdot\texttt{P} times between position yy and the first position after yy that has the counter value vx+b6P2v_{x}+\frac{b^{6}\cdot\texttt{P}}{2}. Hence, we can obtain τ\tau^{\prime} by removing repetitions of cc and cc_{-}, as per Proposition 5.6, ensuring that the only affected values are above vxv_{x}.

    If cc is negative, starting at position xx with counter value vxv_{x}, then vxb6Pv_{x}\geq b^{6}\cdot\texttt{P}. As τ2\tau_{2} starts with counter value cTprev{\texttt{cT}_{prev}}, and cTprev<P{\texttt{cT}_{prev}}<P (Proposition 5.7), there must be a positive cycle c+c_{+} that repeats at least bPb\cdot\texttt{P} times between the last position with counter value b6P2\frac{b^{6}\cdot\texttt{P}}{2} and xx. Hence, we can obtain τ\tau^{\prime} by removing repetitions of cc and c+c_{+}, as per Proposition 5.6, ensuring that the only affected values are above b5Pb^{5}\cdot\texttt{P}.

  2. 2.

    The last part τ3=τ[zu..]\tau_{3}=\tau[z_{u}\leavevmode\nobreak\ ..\leavevmode\nobreak\ \ell] is of length at least b8\cPb^{8}\cP.

    As in the previous case, a cycle cc must repeat in τ3\tau_{3} at least b6Pb^{6}\cdot\texttt{P} times. If cc is balanced, we can remove P|c|\frac{\texttt{P}}{|c|} of its repetitions, getting the desired path τ\tau^{\prime}.

    Otherwise, it must be that τ3\tau_{3} stays above cTprev{\texttt{cT}_{prev}}, and reaches a value at least b6Pb^{6}\cdot\texttt{P}. Indeed, if cc is positive then its repetitions end at some position xx with a counter value at least that high, and if it is negative it starts at some position xx with a counter value at least that high.

    If the counter value also drops to b6P2\frac{b^{6}\cdot\texttt{P}}{2} after position xx, then we can remove positive and negative cycles exactly as in the previous case. Otherwise, we can just remove P|c|\frac{\texttt{P}}{|c|} repetitions of cc, guaranteed that the counter value at the end of τ3\tau_{3} is above cTprev{\texttt{cT}_{prev}}.

  3. 3.

    Only the first part τ1=τ[0..zf)\tau_{1}=\tau[0\leavevmode\nobreak\ ..\leavevmode\nobreak\ z_{f}) is of length at least b8\cPb^{8}\cP.

    If any of the other parts is long, we shorten them. Otherwise, their combined length is less than 2b8P<sT22b^{8}\cdot\texttt{P}<\frac{\texttt{sT}}{2}, implying that the first part τ1\tau_{1} is longer than §i(v)+sT2\mathsection_{i}(v)+\frac{\texttt{sT}}{2}.

    Hence, by Lemma 5.8, there are ‘fast’ and ‘slow’ cycles cfc_{f} and csc_{s}, respectively, of slopes sf<ss\texttt{s}_{f}<\texttt{s}_{s}, such that each of them repeats at least b4Pb^{4}\cdot\texttt{P} times in τ1\tau_{1}.

    Thus, by Proposition 5.6, we can add and/or remove some repetitions of cfc_{f} and csc_{s}, such that τ1\tau_{1} is shorten by exactly P. Yet, we should ensure that the resulting path τ\tau^{\prime} is valid, in the sense that its corresponding first part τ1\tau^{\prime}_{1} cannot get the counter value to 0. We show it by cases:

    • If cfc_{f} or csc_{s} are balanced cycles, then we can remove the balanced cycle only, without changing the remaining counter values.

    • If there is a positive cycle c+c_{+} that repeats at least 2b2P2b^{2}\cdot\texttt{P} times, then the counter value climbs by at least 2b2P2b^{2}\cdot\texttt{P} from its value vxv_{x} at position xx where c+c_{+} starts and the position yy where its repetitions end. As the counter gets down to cTprev{\texttt{cT}_{prev}} at the end of τ1\tau_{1}, and cTprev<P{\texttt{cT}_{prev}}<P (Proposition 5.7), there must be a negative cycle cc_{-} that repeats at least bPb\cdot\texttt{P} times between position yy and the first position after yy that has the counter value vx+b2Pv_{x}+b^{2}\cdot\texttt{P}. Hence, we can remove repetitions of c+c_{+} and cc_{-}, as per Proposition 5.6, ensuring that the only affected values are above vxv_{x}.

    • Otherwise, both cfc_{f} and csc_{s} are negative, implying that we add some repetitions of cfc_{f} and remove some repetitions of csc_{s}. We further split into two subcases:

      • If csc_{s} appears before cfc_{f} then there is no problem, as the only change of values will be their increase, and all the values were nonzero to begin with (as we are before zfz_{f}).

      • If cfc_{f} appears first, ending at some position xx, while csc_{s} starts at some later position yy, then a-priori it might be that repeating cfc_{f} up to bPb\cdot\texttt{P} more times, as per Proposition 5.6, will take the counter value to 0.

        However, observe that since there are at most b2b-2 positive cycles, and each of them can repeat at most 2b2P12b^{2}\cdot\texttt{P}-1 times, the counter value vxv_{x} at position xx, and along the way until position yy, is at least vy(b2)2b2Pv_{y}-(b-2)2b^{2}\cdot\texttt{P}, where vyv_{y} is the counter value at position yy. As csc_{s} repeats at least b4Pb^{4}\cdot\texttt{P} times, we have vyb4Pv_{y}\geq b^{4}\cdot\texttt{P}. Thus vxb4P2(b2)b2P>b2Pv_{x}\geq b^{4}\cdot\texttt{P}-2(b-2)b^{2}\cdot\texttt{P}>b^{2}\texttt{P}. Hence, repeating cfc_{f} up to bPb\cdot\texttt{P} more times at position xx cannot take the counter value to 0, until position yy, as required.

Proof of Lemma 5.9.2a

The case of Segment §0\mathsection_{0}.

For a path of length \ell, we have in Segment 0 that shift()=\textsf{shift}(\ell)=\ell, and indeed a path from vv is valid from v+Pv+\texttt{P} and vise versa, as they do not hit cTprev{\texttt{cT}_{prev}}: Their maximal drop is sT, while vcT>P+sT>cTprev+sTv\geq\texttt{cT}>\texttt{P}+\texttt{sT}>{\texttt{cT}_{prev}}+\texttt{sT}.

We turn to the iith segment, for i1i\geq 1. Consider a basic path τ\tau for (s,v+P)shift()(e,u)(s,v+\texttt{P})\stackrel{{\scriptstyle\textsf{shift}(\ell)}}{{\leadsto}}(e,u). Recall that shift()=+Psi[§i(v+P)..§i(v+P)+sT)]\textsf{shift}(\ell)=\ell+\frac{\texttt{P}}{-\texttt{s}_{i}}\in[\mathsection_{i}(v+\texttt{P})\leavevmode\nobreak\ ..\leavevmode\nobreak\ \mathsection_{i}(v+\texttt{P})+\texttt{sT})]. We construct from τ\tau a path τ\tau^{\prime} for (s,v)(e,u)(s,v)\stackrel{{\scriptstyle\ell}}{{\leadsto}}(e,u^{\prime}), such that uuu\equiv u^{\prime}, along the following cases.

Case 2a.1: The counter values in τ\tau stay above cTprev{\texttt{cT}_{prev}}

As there is no position in τ\tau with counter value cTprev{\texttt{cT}_{prev}}, then in particular τ\tau has no zero-transitions. We further split into two subcases:

  1. 1.

    If τ\tau does not have bPb\cdot\texttt{P} repetitions of a ‘relatively fast’ cycle with slope sj\texttt{s}_{j} for jij\leq i, then the drop of τ\tau, and of every prefix of it, is at most X+YX+Y, where XX stands for the drop outside ‘slow’ cycles of slope sh\texttt{s}_{h} for h>ih>i, and YY for the rest of the drop. We have X<b3PX<b^{3}\cdot\texttt{P} and Y<(+Psi)(si+1)Y<(\ell+\frac{\texttt{P}}{\texttt{s}_{i}})(-\texttt{s}_{i+1}).

    We claim that we can obtain τ\tau^{\prime} by removing Psi|c|\frac{\texttt{P}}{-\texttt{s}_{i}\cdot|c|} repetitions of any cycle cc, which repeats enough in τ\tau, having that the drop DD of τ\tau^{\prime} is less than vcTprevv-{\texttt{cT}_{prev}}.

    Indeed, the maximal such drop DD might be the result of removing only cycles of slope (+1)(+1), whose total effect is Psi\frac{\texttt{P}}{-\texttt{s}_{i}}, having DPsi+X+Y=Psi+b3P+(+Psi)(si+1)bP+b3P+(+Psi)(si+1).D\leq\frac{\texttt{P}}{-\texttt{s}_{i}}+X+Y=\frac{\texttt{P}}{-\texttt{s}_{i}}+b^{3}\cdot\texttt{P}+(\ell+\frac{\texttt{P}}{-\texttt{s}_{i}})(-\texttt{s}_{i+1})\leq b\cdot\texttt{P}+b^{3}\cdot\texttt{P}+(\ell+\frac{\texttt{P}}{-\texttt{s}_{i}})(-\texttt{s}_{i+1}). Since <§i+1(v+P)=1si+1(v+PcTprev)b8P\ell<\mathsection_{i+1}(v+\texttt{P})=\frac{1}{-\texttt{s}_{i+1}}(v+\texttt{P}-{\texttt{cT}_{prev}})-b^{8}\cdot\texttt{P}, we have D(b3+b)P+(1si+1(v+PcTprev)b8P)+Psi)(si+1)=D\leq(b^{3}+b)\cdot\texttt{P}+(\frac{1}{-\texttt{s}_{i+1}}(v+\texttt{P}-{\texttt{cT}_{prev}})-b^{8}\cdot\texttt{P})+\frac{\texttt{P}}{-\texttt{s}_{i}})(-\texttt{s}_{i+1})=
    (b3+b)P+v+PcTprev(si+1)b8P+(si+1)siP)=(b3+b+1+(si+1)si)P+vcTprev(si+1)b8P)<b4Pb7P+vcTprev.(b^{3}+b)\cdot\texttt{P}+v+\texttt{P}-{\texttt{cT}_{prev}}-(-\texttt{s}_{i+1})\cdot b^{8}\cdot\texttt{P}+\frac{(-\texttt{s}_{i+1})}{-\texttt{s}_{i}}\cdot\texttt{P})=(b^{3}+b+1+\frac{(-\texttt{s}_{i+1})}{-\texttt{s}_{i}})\cdot\texttt{P}+v-{\texttt{cT}_{prev}}-(-\texttt{s}_{i+1})\cdot b^{8}\cdot\texttt{P})<b^{4}\cdot\texttt{P}-b^{7}\cdot\texttt{P}+v-{\texttt{cT}_{prev}}. It is thus left to show that b4P<b7Pb^{4}\cdot\texttt{P}<b^{7}\cdot\texttt{P}, which obviously holds.

  2. 2.

    Otherwise, namely when τ\tau does have bPb\cdot\texttt{P} repetitions of a ‘relatively fast’ cycle with slope sj\texttt{s}_{j} for jij\leq i, let cc be the first such cycle in τ\tau. We can obtain τ\tau^{\prime} by removing Psi|c|\frac{\texttt{P}}{-\texttt{s}_{i}\cdot|c|} repetitions of cc: The counter value in τ\tau^{\prime}, which starts with counter value vv, at the position after the repetitions of cc will be at least as high as the counter value in τ\tau, which starts with counter value v+Pv+\texttt{P}, after the repetitions of cc. Notice that the counter value cannot hit cTprev{\texttt{cT}_{prev}} before arriving to the repetitions of cc by the argument of the previous subcase.

Case 2a.2: τ\tau reaches counter value cTprev{\texttt{cT}_{prev}}

Again let τ1=τ[0..zf),τ2=τ[zf..zu),τ3=τ[zu..shift()]\tau_{1}=\tau[0\leavevmode\nobreak\ ..\leavevmode\nobreak\ z_{f}),\tau_{2}=\tau[z_{f}\leavevmode\nobreak\ ..\leavevmode\nobreak\ z_{u}),\tau_{3}=\tau[z_{u}\leavevmode\nobreak\ ..\leavevmode\nobreak\ \textsf{shift}(\ell)] as in 1a.

In order to handle possible zero transitions, we shorten τ1\tau_{1}, such that the resulting first part τ1\tau^{\prime}_{1} of τ\tau^{\prime}, which starts with counter value vv, also ends with counter value exactly cTprev{\texttt{cT}_{prev}}. Since τ1\tau_{1} reaches cTprev{\texttt{cT}_{prev}} and is shorter than §i+1(v+P)\mathsection_{i+1}(v+\texttt{P}), it has by Lemma 5.8.2 at least b4Pb^{4}\cdot\texttt{P} repetitions of a ‘fast’ cycle of slope sfsi\texttt{s}_{f}\leq\texttt{s}_{i}. Let cfc_{f} be the first such cycle. We split to cases.

  1. 1.

    If sf=si\texttt{s}_{f}=\texttt{s}_{i} or τ2\tau_{2} or τ3\tau_{3} are of length at least b5Pb^{5}\cdot\texttt{P}, we can remove Psf|cf|\frac{\texttt{P}}{-\texttt{s}_{f}\cdot|c_{f}|} repetitions of cfc_{f} in τ1\tau_{1}. Note that the resulting first part τ1\tau^{\prime}_{1} of τ\tau^{\prime} indeed ends with counter value cTprev{\texttt{cT}_{prev}}. However, while when sf=si\texttt{s}_{f}=\texttt{s}_{i} the resulting length of τ\tau^{\prime} will be \ell, as required, in the case that sf<si\texttt{s}_{f}<\texttt{s}_{i}, we have that τ\tau^{\prime} will be longer than \ell. Nevertheless, in this case, as τ2\tau_{2} or τ3\tau_{3} are of length at least b5Pb^{5}\cdot\texttt{P}, we can further shorten τ2\tau_{2} or τ3\tau_{3} without changing their effect, as per Proposition 5.6, analogously to 1 or 2, respectively, in the proof of Lemma 5.9.1a.2.

  2. 2.

    Otherwise, we are in the case that τ1\tau_{1} has a ‘really fast’ cycle of slope sf<si\texttt{s}_{f}<\texttt{s}_{i} that repeats at least b4Pb^{4}\cdot\texttt{P} times, and both τ2\tau_{2} or τ3\tau_{3} are of length less than b5Pb^{5}\cdot\texttt{P}. We claim that in this case τ1\tau_{1} must also have b4Pb^{4}\cdot\texttt{P} repetitions of a ‘relatively slow’ cycle csc_{s} of slope sssi\texttt{s}_{s}\geq\texttt{s}_{i}.

    Indeed, assume toward contradiction that τ1\tau_{1} has less than b4Pb^{4}\cdot\texttt{P} repetitions of a cycle with slope ss\texttt{s}_{s} for sis\geq i. Then the longest such path has less than bb transitions of (+1)(+1) out of cycles, b6Pb^{6}\cdot\texttt{P} such transitions in cycles, and the rest of it consists of ‘fast’ cycles with slope indexed lower than ii.

    Thus its length is at most X+LX+L, where X=b6PX=b^{6}\cdot\texttt{P} is the (+1)(+1) transitions, and LL is the longest length to drop from counter value v+P+Xv+\texttt{P}+X to cTprev{\texttt{cT}_{prev}} with ‘fast’ cycles. Thus, L1si1(v+P+XcTprev)L\leq\frac{1}{-\texttt{s}_{i-1}}(v+\texttt{P}+X-{\texttt{cT}_{prev}}).

    Now, we have that the length of τ\tau is at least §i(v+P)=1si(vcTprev)b8P\mathsection_{i}(v+\texttt{P})=\frac{1}{-\texttt{s}_{i}}(v-{\texttt{cT}_{prev}})-b^{8}\cdot\texttt{P}. Thus, parts τ2\tau_{2} and τ3\tau_{3} of τ\tau are of length at least Z=1si(vcTprev)b8P1si1(v+P+XcTprev)X=(1si1si+1)(vcTprev)b8P(1+1si+1)b6PZ=\frac{1}{-\texttt{s}_{i}}(v-{\texttt{cT}_{prev}})-b^{8}\cdot\texttt{P}-\frac{1}{-\texttt{s}_{i-1}}(v+\texttt{P}+X-{\texttt{cT}_{prev}})-X=(\frac{1}{-\texttt{s}_{i}}-\frac{1}{-\texttt{s}_{i+1}})(v-{\texttt{cT}_{prev}})-b^{8}\cdot\texttt{P}-(1+\frac{1}{-\texttt{s}_{i+1}})b^{6}\cdot\texttt{P}.

    Since (1si1si+1)1b2(\frac{1}{-\texttt{s}_{i}}-\frac{1}{-\texttt{s}_{i+1}})\geq\frac{1}{b^{2}}, (1+1si+1b+1)(1+\frac{1}{-\texttt{s}_{i+1}}\leq b+1), and vcTprevcTcTprev>cTP>3b10Pv-{\texttt{cT}_{prev}}\geq\texttt{cT}-{\texttt{cT}_{prev}}>\texttt{cT}-\texttt{P}>3b^{10}\texttt{P}, we have Z1b2(3b10P)b8P(b+1)b6P=2b8P(b+1)b6PZ\geq\frac{1}{b^{2}}(3b^{10}\cdot\texttt{P})-b^{8}\cdot\texttt{P}-(b+1)b^{6}\cdot\texttt{P}=2b^{8}\cdot\texttt{P}-(b+1)b^{6}\cdot\texttt{P}. Therefore, at least one of τ2\tau_{2} and τ3\tau_{3} is of length at least b7Pb^{7}\cdot\texttt{P}, leading to a contradiction.

    So, we are in the case that τ1\tau_{1} has at least b4Pb^{4}\cdot\texttt{P} repetitions of a ‘really fast’ cycle cfc_{f} of slope sf<si\texttt{s}_{f}<\texttt{s}_{i} as well as b4Pb^{4}\cdot\texttt{P} repetitions of a ‘relatively slow’ cycle csc_{s} of slope sssi\texttt{s}_{s}\geq\texttt{s}_{i}.

    By analyzing the different possible orders of csc_{s} and cfc_{f}, we can cut and repeat the cycles far enough from 0 so as to construct valid paths. See the Appendix for details.∎

5.1 Proof of Theorem 5.1

The proof is by induction over the structure of φ\varphi, where Theorem 3.3 already provides the periodicity for all CTL operators.

It remains to plug UAUA into the induction by showing (1) the (cT,P)(\texttt{cT},\texttt{P})-periodicity of a formula φ=ψ1UAψ2\varphi=\psi_{1}UA\psi_{2} with respect to an OCA 𝒜{\mathcal{A}}, provided that its subformulas are (cTprev,Pprev)({\texttt{cT}_{prev}},{\texttt{P}_{prev}})-periodic; and (2) by showing that the period P and threshold cT are single-exponential in n=|𝒜|n=|{\mathcal{A}}| and in the nesting depth of φ\varphi.

  1. 1.

    We show that for every state sSs\in S and counters v,v>cTv,v^{\prime}>\texttt{cT}, if vvmodPv\equiv v^{\prime}\mod\texttt{P} then (s,v)φ(s,v)φ(s,v)\models\varphi\iff(s,v^{\prime})\models\varphi. Withot loss of generality, write v=v+zPv^{\prime}=v+z\cdot\texttt{P}, for some zz\in\mathbb{N}.

    • If (s,v)φ(s,v)\models\varphi then by the definition of the AUAU operator and the completeness of 𝒜{\mathcal{A}} we have i) there is a level \ell, such that for every state ee and counter value uu, if (s,v)(e,u)(s,v)\stackrel{{\scriptstyle\ell}}{{\leadsto}}(e,u) then (e,u)ψ2(e,u)\models\psi_{2}, and ii) for every level m<m<\ell, state hh and counter value xx, if (s,v)m(h,x)(s,v)\stackrel{{\scriptstyle m}}{{\leadsto}}(h,x) then (h,x)ψ1(h,x)\models\psi_{1}.

    Observe first that if core(v)\ell\not\in\texttt{core}(v), then there also exists a level ^<\hat{\ell}<\ell witnessing (s,v)φ(s,v)\models\varphi, such that ^core(v)\hat{\ell}\in\texttt{core}(v). Indeed, we obtain ^\hat{\ell}, by choosing the largest level ^\hat{\ell} in the core of \ell’s segment, such that ^modP\ell\equiv\hat{\ell}\mod\texttt{P}. As ^<\hat{\ell}<\ell, it directly follows that for every level m^<^\hat{m}<\hat{\ell}, state h^\hat{h} and counter value x^\hat{x}, if (s,v)m^(h^,x^)(s,v)\stackrel{{\scriptstyle\hat{m}}}{{\leadsto}}(\hat{h},\hat{x}) then (h^,x^)ψ1(\hat{h},\hat{x})\models\psi_{1}. Now, assume toward contradiction that there is a state e^\hat{e} and a counter value u^\hat{u}, such that (s,v)^(e^,u^)(s,v)\stackrel{{\scriptstyle\hat{\ell}}}{{\leadsto}}(\hat{e},\hat{u}) and (e^,u^)⊧̸ψ2(\hat{e},\hat{u})\not\models\psi_{2}. Then by (possibly several applications of) Lemma 5.9.1b, there is also a counter value u^^cTprev,Pprevu^\hat{\hat{u}}\equiv_{{\texttt{cT}_{prev}},{\texttt{P}_{prev}}}\hat{u}, such that (s,v)(e^,u^^)(s,v)\stackrel{{\scriptstyle\ell}}{{\leadsto}}(\hat{e},\hat{\hat{u}}). As ψ2\psi_{2} is (cTprev,Pprev)({\texttt{cT}_{prev}},{\texttt{P}_{prev}})-periodic, we have (e^,u^^)⊧̸ψ2(\hat{e},\hat{\hat{u}})\not\models\psi_{2}, leading to a contradiction.

    Next, we claim that the level =shiftz(^){\ell^{\prime}}=\textsf{shift}^{z}(\hat{\ell}), obtained by zz (recall that z=vvPz=\frac{v^{\prime}-v}{\texttt{P}}) applications of the shift function on ^\hat{\ell}, witnesses (s,v)φ(s,v^{\prime})\models\varphi, namely that i) for every state ee^{\prime} and counter value uu^{\prime}, if (s,v)(e,u)(s,v^{\prime})\stackrel{{\scriptstyle\ell^{\prime}}}{{\leadsto}}(e^{\prime},u^{\prime}) then (e,u)ψ2(e^{\prime},u^{\prime})\models\psi_{2}, and ii) for every level m<m^{\prime}<\ell^{\prime}, state hh^{\prime} and counter value xx^{\prime}, if (s,v)m(h,x)(s,v^{\prime})\stackrel{{\scriptstyle m^{\prime}}}{{\leadsto}}(h^{\prime},x^{\prime}) then (h,x)ψ1(h^{\prime},x^{\prime})\models\psi_{1}.

    Indeed, i) were it the case that (e,u)⊧̸ψ2(e^{\prime},u^{\prime})\not\models\psi_{2} then by (zz applications of) Lemma 5.9.2a, there was also a counter value u′′cTprev,Pprevuu^{\prime\prime}\equiv_{{\texttt{cT}_{prev}},{\texttt{P}_{prev}}}u^{\prime}, such that (s,v)^(e,u′′)(s,v)\stackrel{{\scriptstyle\hat{\ell}}}{{\leadsto}}(e^{\prime},u^{\prime\prime}) and therefore (e,u′′)⊧̸ψ2(e^{\prime},u^{\prime\prime})\not\models\psi_{2}, leading to a contradiction; and ii) were it the case that (s,v)m(h,x)(s,v^{\prime})\stackrel{{\scriptstyle m^{\prime}}}{{\leadsto}}(h^{\prime},x^{\prime}) and (h,x)⊧̸ψ1(h^{\prime},x^{\prime})\not\models\psi_{1} then a) by Lemma 5.9.1a, as in the argument above, there is also a level m~m\tilde{m}\leq m^{\prime}, such that m~\tilde{m} is in the core of mm^{\prime}’s segment and (s,v)m~(h,x~)(s,v^{\prime})\stackrel{{\scriptstyle\tilde{m}}}{{\leadsto}}(h^{\prime},\tilde{x}) where x~cTprev,Pprevx\tilde{x}\equiv_{{\texttt{cT}_{prev}},{\texttt{P}_{prev}}}x, and b) by Lemma 5.9.2a there is a level m^<^\hat{m}<\hat{\ell}, such that (s,v)m^(h,x^)(s,v)\stackrel{{\scriptstyle\hat{m}}}{{\leadsto}}(h^{\prime},\hat{x}) where x^cTprev,Pprevx\hat{x}\equiv_{{\texttt{cT}_{prev}},{\texttt{P}_{prev}}}x and therefore (h,x^)⊧̸ψ1(h^{\prime},\hat{x})\not\models\psi_{1}, leading to a contradiction.

    • If (s,v)φ(s,v^{\prime})\models\varphi then we have (s,v)φ(s,v)\models\varphi by an argument analogous to the above, while using Lemma 5.9.2b instead of Lemma 5.9.2a.

  2. 2.

    The threshold cT and period P are calculated along the induction on the structure of the formula φ\varphi. They start with threshold 0 and period 11, and their increase in each step of the induction depends on the outermost operator.

    Observe first that we can take as the worst case the same increase in every step, that of the UA case, since it guarantees the others. Namely, its required threshold, based on the threshold and period of the subformulas, is bigger than the threshold required in the other cases, and its required period is divisible by the periods required for the other cases.

    Next, notice that both the threshold and period in the UA case only depend on the periods of the subformulas (i.e., not on their thresholds), so it is enough to show that the period is singly exponential in nn and the nesting depth of φ\varphi.

    The period in the UA case is defined to be P(φ)=Blcm(P(ψ1),P(ψ2))\texttt{P}(\varphi)=B\cdot\mathrm{lcm}(\texttt{P}(\psi_{1}),\texttt{P}(\psi_{2})), where B=lcm[1..2b3]B=\mathrm{lcm}[1..2b^{3}], and bb is the bound on the length of a linear path scheme for 𝒜{\mathcal{A}}. By [17], bb is polynomial in nn, and as lcm[1..2b3]<42b3\mathrm{lcm}[1..2b^{3}]<4^{2b^{3}}, we get that BB is singly exponential in nn.

    Considering lcm(P(ψ1),P(ψ2)\mathrm{lcm}(\texttt{P}(\psi_{1}),\texttt{P}(\psi_{2}), while in general lcm(x,y)\mathrm{lcm}(x,y) of two numbers xx and yy might be equal to their multiplication, in our case, as both ψ1\psi_{1} and ψ2\psi_{2} are calculated along the induction via the same scheme above, they are both an exponent of BB. Hence, lcm(P(ψ1),P(ψ2)=max(P(ψ1),P(ψ2)\mathrm{lcm}(\texttt{P}(\psi_{1}),\texttt{P}(\psi_{2})=\max(\texttt{P}(\psi_{1}),\texttt{P}(\psi_{2}). Thus, we get that P(φ)Bx\texttt{P}(\varphi)\leq B^{x}, where xx is bounded by the nesting depth of φ\varphi. ∎

References

  • [1] Shaull Almagor, Udi Boker, and Orna Kupferman. Formalizing and reasoning about quality. Journal of the ACM, 63(3):24:1–24:56, 2016.
  • [2] Roland Axelsson, Matthew Hague, Stephan Kreutzer, Martin Lange, and Markus Latte. Extended computation tree logic. In Logic for Programming, Artificial Intelligence, and Reasoning: 17th International Conference, LPAR-17, Yogyakarta, Indonesia, October 10-15, 2010. Proceedings 17, pages 67–81. Springer, 2010.
  • [3] Udi Boker, Krishnendu Chatterjee, Thomas A. Henzinger, and Orana Kupferman. Temporal specifications with accumulative values. ACM Trans. Comput. Log., 15(4):27:1–27:25, 2014.
  • [4] Krishnendu Chatterjee and Laurent Doyen. Computation tree logic for synchronization properties. In Ioannis Chatzigiannakis, Michael Mitzenmacher, Yuval Rabani, and Davide Sangiorgi, editors, 43rd International Colloquium on Automata, Languages, and Programming, ICALP 2016, July 11-15, 2016, Rome, Italy, volume 55 of LIPIcs, pages 98:1–98:14. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2016.
  • [5] Michael R Clarkson, Bernd Finkbeiner, Masoud Koleini, Kristopher K Micinski, Markus N Rabe, and César Sánchez. Temporal logics for hyperproperties. In Principles of Security and Trust: Third International Conference, POST 2014, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2014, Grenoble, France, April 5-13, 2014, Proceedings 3, pages 265–284. Springer, 2014.
  • [6] Michael R Clarkson and Fred B Schneider. Hyperproperties. Journal of Computer Security, 18(6):1157–1210, 2010.
  • [7] Byron Cook, Heidy Khlaaf, and Nir Piterman. Verifying increasingly expressive temporal logics for infinite-state systems. Journal of the ACM (JACM), 64(2):1–39, 2017.
  • [8] David C Cooper. Theorem proving in arithmetic without multiplication. Machine intelligence, 7(91-99):300, 1972.
  • [9] Stéphane Demri, Alain Finkel, Valentin Goranko, and Govert van Drimmelen. Model-checking CTL* over flat Presburger counter systems. Journal of Applied Non-Classical Logics, 20(4):313–344, 2010.
  • [10] Alain Finkel, Jérôme Leroux, and Grégoire Sutre. Reachability for two-counter machines with one test and one reset. In FSTTCS 2018-38th IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science, volume 122, pages 31–1. Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik, 2018.
  • [11] Michael J Fischer and Michael O Rabin. Super-exponential complexity of Presburger arithmetic. In Quantifier Elimination and Cylindrical Algebraic Decomposition, pages 122–135. Springer, 1998.
  • [12] Seymour Ginsburg and Edwin H Spanier. Bounded ALGOL-like languages. Transactions of the American Mathematical Society, 113(2):333–368, 1964.
  • [13] Stefan Göller and Markus Lohrey. Branching-time model checking of one-counter processes and timed automata. SIAM J. Comput., 42(3):884–923, 2013.
  • [14] Christoph Haase. A survival guide to Presburger arithmetic. ACM SIGLOG News, 5(3):67–82, 2018.
  • [15] Christoph Haase, Stephan Kreutzer, Joël Ouaknine, and James Worrell. Reachability in succinct and parametric one-counter automata. In CONCUR 2009-Concurrency Theory: 20th International Conference, CONCUR 2009, Bologna, Italy, September 1-4, 2009. Proceedings 20, pages 369–383. Springer, 2009.
  • [16] Jérôme Leroux and Grégoire Sutre. Flat counter automata almost everywhere! In International Symposium on Automated Technology for Verification and Analysis, pages 489–503. Springer, 2005.
  • [17] Jérôme Leroux and Grégoire Sutre. Reachability in two-dimensional vector addition systems with states: One test is for free. In 31st International Conference on Concurrency Theory (CONCUR 2020). Schloss Dagstuhl-Leibniz-Zentrum für Informatik, 2020.
  • [18] Marvin L. Minsky. Computation: Finite and Infinite Machines. Prentice-Hall, Englewood Cliffs, N.J., 1967.
  • [19] Mohan Nair. On chebyshev-type inequalities for primes. The American Mathematical Monthly, 89(2):126–129, 1982.
  • [20] Mojzesz Presburger. Über die Vollständigkeit eines gewissen Systems der Arithmetik ganzer Zahlen, in welchem die Addition als einzige Operation hervortritt. Comptes Rendus du I Congrès de Mathématiciens des Pays Slaves, pages 92–101, 1929.
  • [21] Leslie G Valiant and Michael S Paterson. Deterministic one-counter automata. Journal of Computer and System Sciences, 10(3):340–350, 1975.
  • [22] Igor Walukiewicz. Model checking CTL properties of pushdown systems. In International Conference on Foundations of Software Technology and Theoretical Computer Science, pages 127–138. Springer, 2000.

Appendix A Appendix – Omitted Proofs

A.1 Proofs for Sections 3 and 4

Proof A.1 (Proof of Proposition 3.1).

By definition, if φ\varphi is totally (𝚝(φ),𝚙(φ))(\mathtt{t}(\varphi),\mathtt{p}(\varphi))-periodic then so is every subformula. We show the converse.

Denote by 𝗌𝗎𝖻𝗌\mathsf{subs} the set of subformulas of φ\varphi. Assume that every ψ𝗌𝗎𝖻𝗌\psi\in\mathsf{subs} is (𝚝(ψ),𝚙(ψ))(\mathtt{t}(\psi),\mathtt{p}(\psi))-periodic for some constants 𝚝(ψ),𝚙(ψ)\mathtt{t}^{\prime}(\psi),\mathtt{p}^{\prime}(\psi). Let 𝚝(φ)=max{𝚝(ψ)ψ𝗌𝗎𝖻𝗌}\mathtt{t}(\varphi)=\max\{\mathtt{t}^{\prime}(\psi)\mid\psi\in\mathsf{subs}\} and 𝚙(φ)=lcm({𝚙(ψ)ψ𝗌𝗎𝖻𝗌})\mathtt{p}(\varphi^{\prime})=\mathrm{lcm}(\{\mathtt{p}(\psi)\mid\psi\in\mathsf{subs}\}). We claim that φ\varphi is totally (𝚝(φ),𝚙(φ))(\mathtt{t}(\varphi),\mathtt{p}(\varphi))-periodic. Indeed, this follows from the simple observation that if ψ\psi is (𝚝(ψ),𝚙(ψ))(\mathtt{t}^{\prime}(\psi),\mathtt{p}^{\prime}(\psi))-periodic, then it is also (𝚝′′(ψ),𝚙′′(ψ))(\mathtt{t}^{\prime\prime}(\psi),\mathtt{p}^{\prime\prime}(\psi))-periodic for every 𝚝′′(ψ)>𝚝(ψ)\mathtt{t}^{\prime\prime}(\psi)>\mathtt{t}^{\prime}(\psi) and 𝚙′′(ψ)\mathtt{p}^{\prime\prime}(\psi) that is a multiple of 𝚙(ψ)\mathtt{p}^{\prime}(\psi).

Proof A.2 (Proof of Proposition 3.2).

Formally, let 𝒜=S,Δ,L{\mathcal{A}}=\langle S,\Delta,L\rangle. We define 𝒦=S×[0..𝚝(φ)+𝚙(φ)1],R,L{\mathcal{K}}=\langle S\times[0..\mathtt{t}(\varphi)+\mathtt{p}(\varphi)-1],R,L^{\prime}\rangle where the transitions in RR are induced by the configuration reachability relation of 𝒜{\mathcal{A}} as defined in Section 2 where we identify (s,v)(s,v) for v𝚝(φ)+𝚙(φ)v\geq\mathtt{t}(\varphi)+\mathtt{p}(\varphi) with 𝚝(φ)+(vmod𝚙(φ))\mathtt{t}(\varphi)+(v\mod\mathtt{p}(\varphi)).

We claim that 𝒜φ{\mathcal{A}}\models\varphi if and only if 𝒦φ{\mathcal{K}}\models\varphi if and only if 𝒦φ{\mathcal{K}}\models\varphi. Indeed, consider an infinite computation π\pi of 𝒜{\mathcal{A}} and its corresponding computation π\pi^{\prime} in 𝒦{\mathcal{K}} obtained by taking modulo 𝚙(φ)\mathtt{p}(\varphi) as defined above, then the set of subformulas of φ\varphi that are satisfied in each step of π\pi and of π\pi^{\prime} is identical, by total (𝚝(φ),𝚙(φ))(\mathtt{t}(\varphi),\mathtt{p}(\varphi))-periodicity. In particular, πφ\pi\models\varphi if and only if πφ\pi^{\prime}\models\varphi.

Since every computation of 𝒜{\mathcal{A}} induces a computation of 𝒦{\mathcal{K}} (by taking modulo 𝚙(φ)\mathtt{p}(\varphi) where relevant), and every computation of 𝒦{\mathcal{K}} induces a computation of 𝒜{\mathcal{A}} (by following the counter updates, relying on total (𝚝(φ),𝚙(φ))(\mathtt{t}(\varphi),\mathtt{p}(\varphi))-periodicity to make sure 0-transitions in 𝒦{\mathcal{K}} are consistent with ones in 𝒜{\mathcal{A}}), the equivalence follows.

Proof A.3 (Proof of Lemma 3.4).

In [17], the authors consider a model called 2-TVASS, comprising a 2-dimensional vector addition system where the first counter can also be tested for zero. In our setting, this corresponds to an OCA equipped with an additional counter that cannot be tested for zero. A configuration of a 2-TVASS is (s,x1,x2)(s,x_{1},x_{2}) describing the state and the values of the two counters.

We transform the OCA 𝒜{\mathcal{A}} to a 2-TVASS 𝒜{\mathcal{A}}^{\prime} by introducing a length-counting component. That is, in every transition of 𝒜{\mathcal{A}}^{\prime} as a 2-TVASS, the second component increments by 1. We thus have the following: there is a path of length \ell from (s,v)(s,v) to (s,v)(s^{\prime},v^{\prime}) in 𝒜{\mathcal{A}} if and only if there is a path from (s,v,0)(s,v,0) to (s,v,)(s^{\prime},v^{\prime},\ell) in 𝒜{\mathcal{A}}^{\prime}.

From [17, Corollary 16], using the fact that 𝒜{\mathcal{A}}^{\prime} has only weights in {1,0,1}\{-1,0,1\}, we have that if there is a path from (s,x1,x2)(s,x_{1},x_{2}) to (s,y1,y2)(s^{\prime},y_{1},y_{2}) in 𝒜{\mathcal{A}}^{\prime}, then there is also such a π\pi-shaped path where π\pi is of flat length poly(|S|)\text{poly}(|S|) and size O(|S|3)O(|S|^{3}), which concludes the proof.

Proof A.4 (Proof of Lemma 4.1).

Consider the set Vinit={vv𝚝(φ) and (s,v)φ}V_{\text{init}}=\{v\mid v\leq\mathtt{t}(\varphi)\text{ and }(s,v)\models\varphi\}. We define

Pφ,s(x):=uVinitm.x=u+m𝚙(φ)P_{\varphi,s}(x):=\bigvee_{u\in V_{\text{init}}}\exists m.\ x=u+m\cdot\mathtt{p}(\varphi)

The correctness of this formula is immediate from the definition of Vinit,𝚝(φ)V_{\text{init}},\mathtt{t}(\varphi), and 𝚙(φ)\mathtt{p}(\varphi). In order to compute Pφ,s(x)P_{\varphi,s}(x), we need to compute VinitV_{\text{init}}. This is done using Proposition 3.2, by evaluating φ\varphi from every state of the Kripke structure.

Proof A.5 (Proof of Lemma 4.2).

Recall from Section 2 that the set of satisfying assignments for a PA formula in dimension 1 is effectively semilinear and can be written as Lin(B,{r})C={b+λrbB,λ}C\mathrm{Lin}(B,\{r\})\cup C=\{b+\lambda r\mid b\in B,\ \lambda\in\mathbb{N}\}\cup C for effectively computable B,CB,C\subseteq\mathbb{N} and rr\in\mathbb{N}.

For every state sSs\in S, consider therefore the set Lin(Bs,{rs})Cs\mathrm{Lin}(B_{s},\{r_{s}\})\cup C_{s} corresponding to Pφ,sP_{\varphi,s}. Define 𝚝(φ)=max({bbBs,sS}Cs)\mathtt{t}(\varphi)=\max(\{b\mid b\in B_{s},\ s\in S\}\cup C_{s}) and 𝚙(φ)=lcm({rs}sS)𝚝(φ)\mathtt{p}(\varphi)=\mathrm{lcm}(\{r_{s}\}_{s\in S})\cdot\mathtt{t}(\varphi).

We claim that φ\varphi is (𝚝(φ),𝚙(φ))(\mathtt{t}(\varphi),\mathtt{p}(\varphi))-periodic. Indeed, consider v,v>𝚝(φ)v,v^{\prime}>\mathtt{t}(\varphi) such that vvmod𝚙(φ)v\equiv v^{\prime}\mod\mathtt{p}(\varphi), and let sSs\in S. Note that v,vCsv,v^{\prime}\notin C_{s} for any ss. Without loss of generality assume v>vv>v^{\prime}, so we can write vv=K𝚙(φ)v-v^{\prime}=K\cdot\mathtt{p}(\varphi) for some KK\in\mathbb{N}.

Now, if (s,v)φ(s,v^{\prime})\models\varphi, then v=bs+λrsv^{\prime}=b^{\prime}_{s}+\lambda^{\prime}r_{s} for some bsBsb^{\prime}_{s}\in B_{s} and λ\lambda^{\prime}\in\mathbb{N}. Then, v=bs+λrs+K𝚙(φ)=bs+(λ+K𝚙(φ)rs)rsv=b^{\prime}_{s}+\lambda^{\prime}r_{s}+K\cdot\mathtt{p}(\varphi)=b^{\prime}_{s}+(\lambda^{\prime}+K\frac{\mathtt{p}(\varphi)}{r_{s}})r_{s}, and note that rsr_{s} divides 𝚙(φ)\mathtt{p}(\varphi), so we have vLin(Bs,{rs})v\in\mathrm{Lin}(B_{s},\{r_{s}\}) and therefore (s,v)φ(s,v)\models\varphi.

Conversely, if (s,v)φ(s,v)\models\varphi then v=bs+λrsv=b_{s}+\lambda r_{s} for some bsBsb_{s}\in B_{s} and λ\lambda\in\mathbb{N}. Then, v=bs+λrsK𝚙(φ)=bs+(λK𝚙(φ)rs)rsv^{\prime}=b_{s}+\lambda r_{s}-K\cdot\mathtt{p}(\varphi)=b_{s}+(\lambda-K\frac{\mathtt{p}(\varphi)}{r_{s}})r_{s}. Since v>𝚝(φ)bsv^{\prime}>\mathtt{t}(\varphi)\geq b_{s}, then λK𝚙(φ)rS1\lambda-K\frac{\mathtt{p}(\varphi)}{r_{S}}\geq 1. Thus, vLin(Bs,{rs})v^{\prime}\in\mathrm{Lin}(B_{s},\{r_{s}\}) so (v,s)φ(v^{\prime},s)\models\varphi. Hence, φ\varphi is (𝚝(φ),𝚙(φ))(\mathtt{t}(\varphi),\mathtt{p}(\varphi))-periodic.

Proof A.6 (Proof of Proposition 5.5).

If e11=e22\frac{e_{1}}{\ell_{1}}=\frac{e_{2}}{\ell_{2}} or e13=e22\frac{e_{1}}{\ell_{3}}=\frac{e_{2}}{\ell_{2}}, we can just have k1=1k_{1}=1 and k3=0k_{3}=0 or k3=1k_{3}=1 and k1=0k_{1}=0, respectively.

Otherwise, we can have k1=(2e33e2)k_{1}=(\ell_{2}\cdot e_{3}-\ell_{3}\cdot e_{2}) and k3=(1e22e1)k_{3}=(\ell_{1}\cdot e_{2}-\ell_{2}\cdot e_{1}). Indeed, notice that k1k_{1} and k3k_{3} are positive and the overall ratio of effect divided by length is:

(2e33e2)e1+(1e22e1)e3(2e33e2)1+(1e22e1)3\displaystyle\frac{(\ell_{2}\cdot e_{3}-\ell_{3}\cdot e_{2})e_{1}+(\ell_{1}\cdot e_{2}-\ell_{2}\cdot e_{1})e_{3}}{(\ell_{2}\cdot e_{3}-\ell_{3}\cdot e_{2})\ell_{1}+(\ell_{1}\cdot e_{2}-\ell_{2}\cdot e_{1})\ell_{3}} =e12e3e13e2+e31e2e32e112e313e2+31e232e1\displaystyle=\frac{e_{1}\cdot\ell_{2}\cdot e_{3}-e_{1}\cdot\ell_{3}\cdot e_{2}+e_{3}\cdot\ell_{1}\cdot e_{2}-e_{3}\cdot\ell_{2}\cdot e_{1}}{\ell_{1}\cdot\ell_{2}\cdot e_{3}-\ell_{1}\cdot\ell_{3}\cdot e_{2}+\ell_{3}\cdot\ell_{1}\cdot e_{2}-\ell_{3}\cdot\ell_{2}\cdot e_{1}}
=e31e2e13e212e332e1\displaystyle=\frac{e_{3}\cdot\ell_{1}\cdot e_{2}-e_{1}\cdot\ell_{3}\cdot e_{2}}{\ell_{1}\cdot\ell_{2}\cdot e_{3}-\ell_{3}\cdot\ell_{2}\cdot e_{1}} =e2(e31e13)2(1e33e1)=e22\displaystyle=\leavevmode\nobreak\ \frac{e_{2}(e_{3}\cdot\ell_{1}-e_{1}\cdot\ell_{3})}{\ell_{2}(\ell_{1}\cdot e_{3}-\ell_{3}\cdot e_{1})}\leavevmode\nobreak\ =\leavevmode\nobreak\ \frac{e_{2}}{\ell_{2}}
Proof A.7 (Proof of Proposition 5.6).

We provide the proof for lengthening the path. The proof for shortening it is analogous. We split to cases.

  1. 1.

    e1=0e_{1}=0 or e2=0e_{2}=0: We add k1=x1k_{1}=\frac{x}{\ell_{1}} repetitions of c1c_{1} or k2=x2k_{2}=\frac{x}{\ell_{2}} repetitions of c2c_{2}, respectively.

  2. 2.

    e1<0e_{1}<0 and e2>0e_{2}>0: We add k1=e2xe21e12k_{1}=e_{2}\frac{x}{e_{2}\cdot\ell_{1}-e_{1}\cdot\ell_{2}} repetitions of c1c_{1} and k2=e1xe21e12k_{2}=-e_{1}\frac{x}{e_{2}\cdot\ell_{1}-e_{1}\cdot\ell_{2}} repetitions of c2c_{2}.

  3. 3.

    e1>0e_{1}>0 and e2>0e_{2}>0: We add k1=e2xe21e12k_{1}=e_{2}\frac{x}{e_{2}\cdot\ell_{1}-e_{1}\cdot\ell_{2}} repetitions of c1c_{1} and remove k2=e1xe21e12k_{2}=e_{1}\frac{x}{e_{2}\cdot\ell_{1}-e_{1}\cdot\ell_{2}} repetitions of c2c_{2}.

  4. 4.

    e1<0e_{1}<0 and e2<0e_{2}<0: We remove k1=e2xe12e21k_{1}=e_{2}\frac{x}{e_{1}\cdot\ell_{2}-e_{2}\cdot\ell_{1}} repetitions of c1c_{1} and add k2=e1xe12e21k_{2}=e_{1}\frac{x}{e_{1}\cdot\ell_{2}-e_{2}\cdot\ell_{1}} repetitions of c2c_{2}.

Proof A.8 (Proof of Proposition 5.7).

When φ\varphi is an atomic proposition, there is no cTprev(φ){\texttt{cT}_{prev}}(\varphi).

Consider a formula φ=ψ1UAψ2\varphi=\psi_{1}UA\psi_{2}. We have cTprev(φ)=max(cT(ψ1),cT(ψ2))=max(b11P(ψ1),b11P(ψ2))=b11max(P(ψ1),P(ψ2)){\texttt{cT}_{prev}}(\varphi)=\max(\texttt{cT}(\psi_{1}),\texttt{cT}(\psi_{2}))=\max(b^{11}\cdot\texttt{P}(\psi_{1}),b^{11}\cdot\texttt{P}(\psi_{2}))=b^{11}\cdot\max(\texttt{P}(\psi_{1}),\texttt{P}(\psi_{2})) and P(φ)=BPprev=Blcm(P(ψ1),P(ψ2))>Bmax(P(ψ1),P(ψ2))\texttt{P}(\varphi)=B\cdot{\texttt{P}_{prev}}=B\cdot\mathrm{lcm}(\texttt{P}(\psi_{1}),\texttt{P}(\psi_{2}))>B\cdot\max(\texttt{P}(\psi_{1}),\texttt{P}(\psi_{2})). It remains to show that B=lcm[1..2b3]>b11B=\mathrm{lcm}[1..2b^{3}]>b^{11} for b2b\geq 2. To this end, it is proved in [19] that lcm[1..n]2n\mathrm{lcm}[1..n]\geq 2^{n} for all n7n\geq 7.

Then, for b2b\geq 2 we have 2b316>72b^{3}\geq 16>7, so B22b3B\geq 2^{2b^{3}}. We now prove by induction that 22b3b112^{2b^{3}}\geq b^{11} for all b2b\geq 2. For b=1b=1 we have 2223=216>2112^{2\cdot 2^{3}}=2^{16}>2^{11}. Assume correctness for bb, we prove for b+1b+1: We have 22(b+1)3=22(b3+3b2+3b+1)=22b322(3b2+3b+1)22b32234=22422b32^{2(b+1)^{3}}=2^{2(b^{3}+3b^{2}+3b+1)}=2^{2b^{3}}\cdot 2^{2(3b^{2}+3b+1)}\geq 2^{2b^{3}}\cdot 2^{2\cdot 3\cdot 4}=2^{24}\cdot 2^{2b^{3}}, whereas (b+1)11(2b)11=211b11<22422b3(b+1)^{11}\leq(2b)^{1}1=2^{11}\cdot b^{11}<2^{24}\cdot 2^{2b^{3}}, where the last inequality follows from the induction hypothesis.

Proof A.9 (Proof of Lemma 5.8).

For i=0i=0, the first claim trivially holds, as it claims for a cycle with a slope at least s1\texttt{s}_{1}, which holds for any cycle, and since sT2>2b5P\frac{\texttt{sT}}{2}>2b^{5}\cdot\texttt{P}, it must repeat at least b4Pb^{4}\cdot\texttt{P} times. The second claim vacuously holds, as no path can reach cTprev{\texttt{cT}_{prev}} at Segment 0.

Consider i[1..m]i\in[1..m]. We prove each of the claims separately.

We show that there are at least b5Pb^{5}\cdot\texttt{P} total cycle repetitions of the required slope, and since there are at most bb different cycles, one of them should repeat at least b4Pb^{4}\cdot\texttt{P} times.

  1. 1.

    Consider a basic path τ\tau of length §i(v)+sT2\ell\geq\mathsection_{i}(v)+\frac{\texttt{sT}}{2}, such that the counter values of τ\tau stay above cTprev{\texttt{cT}_{prev}}. Assume by way of contradiction that τ\tau has less than b5Pb^{5}\cdot\texttt{P} cycles with sj\texttt{s}_{j} for j>ij>i. We will show that \ell must fall short of §i(v)+sT2\mathsection_{i}(v)+\frac{\texttt{sT}}{2}.

    Since there are at most b5P1b^{5}\cdot\texttt{P}-1 cycles with sj\texttt{s}_{j} with j>ij>i, each of length at most bb, then the total length of τ\tau spent in such cycles and in the simple paths of τ\tau (of total length at most bb) is Xb(b5P1)+b=b6PX\leq b(b^{5}\cdot\texttt{P}-1)+b=b^{6}\cdot\texttt{P}. The effect accumulated by the transitions in XX is at most XX, if all the relevant transitions are +1+1.

    The remaining part of the path, whose length is denoted by Y=XY=\ell-X, is spent in cycles with sj\texttt{s}_{j} for jij\leq i. Note that its effect is at most (v+XcTprev)(v+X-{\texttt{cT}_{prev}}), and therefore its length Y1si(v+XcTprev)Y\leq\frac{-1}{\texttt{s}_{i}}(v+X-{\texttt{cT}_{prev}}).

    Observe that any actual path τ\tau that satisfies the required constraints cannot be shorter than the above theoretical path in which there are XX transitions of effect (+1)(+1).

    Therefore, we have X+Yb6P+1si(v+b6PcTprev)=1si(vcTprev)+(1si+1)b3P1si(vcTprev)+(b7+b6)P\ell\leq X+Y\leq b^{6}\cdot\texttt{P}+\frac{-1}{\texttt{s}_{i}}(v+b^{6}\cdot\texttt{P}-{\texttt{cT}_{prev}})=\frac{-1}{\texttt{s}_{i}}(v-{\texttt{cT}_{prev}})+(\frac{-1}{\texttt{s}_{i}}+1)b^{3}\cdot\texttt{P}\leq\frac{-1}{\texttt{s}_{i}}(v-{\texttt{cT}_{prev}})+(b^{7}+b^{6})\cdot\texttt{P}.

    Recall, however, that §i(v)+sT2=(1si(vcTprev)b8P)+(12b9P)\ell\geq\mathsection_{i}(v)+\frac{\texttt{sT}}{2}=(\frac{-1}{\texttt{s}_{i}}(v-{\texttt{cT}_{prev}})-b^{8}\cdot\texttt{P})+(\frac{1}{2}b^{9}\cdot\texttt{P}), leading to a contradiction, as b92>b6+b7+b8\frac{b^{9}}{2}>b^{6}+b^{7}+b^{8}, for b>2b>2.

  2. 2.

    Consider a basic path τ\tau of length <§i+1(v)\ell<\mathsection_{i+1}(v), such that the counter values of τ\tau reach cTprev{\texttt{cT}_{prev}}. Without loss of generality, we can assume that \ell is the first time when τ\tau reaches cTprev{\texttt{cT}_{prev}} (otherwise we will look at the prefix of τ\tau that satisfies this). Assume by way of contradiction that τ\tau has less than b5Pb^{5}\cdot\texttt{P} cycles with sj\texttt{s}_{j} for j<ij<i, we show that \ell must fall after §i+1(v)\mathsection_{i+1}(v).

    Since there are at most b5P1b^{5}\cdot\texttt{P}-1 cycles with sj\texttt{s}_{j} for jij\leq i, each of length at most bb, then the total length of τ\tau spent in such cycles and in the simple paths of τ\tau (of total length at most bb) is Xb(b5P1)+b=b6PX\leq b(b^{5}\cdot\texttt{P}-1)+b=b^{6}\cdot\texttt{P}. The effect accumulated by the transitions in XX is at least X-X, if all the relevant transitions are 1-1.

    The remaining part of the path, whose length is denoted by Y=XY=\ell-X, is spent in cycles with sj\texttt{s}_{j} for j>ij>i. Note that its effect is at least (vXcTprev)(v-X-{\texttt{cT}_{prev}}), and therefore its length Y1si+1(vXcTprev)Y\geq\frac{-1}{\texttt{s}_{i+1}}(v-X-{\texttt{cT}_{prev}}).

    Observe that any actual path τ\tau that satisfies the required constraints cannot be shorter than the above theoretical path in which there are XX transitions of effect (1)(-1).

    Therefore, we have X+Yb6P+1si+1(vb6PcTprev)=1si+1(vcTprev)+(1si+11)b6P1si+1(vcTprev)b7P\ell\geq X+Y\geq b^{6}\cdot\texttt{P}+\frac{-1}{\texttt{s}_{i+1}}(v-b^{6}\cdot\texttt{P}-{\texttt{cT}_{prev}})=\frac{-1}{\texttt{s}_{i+1}}(v-{\texttt{cT}_{prev}})+(\frac{-1}{\texttt{s}_{i+1}}-1)b^{6}\cdot\texttt{P}\geq\frac{-1}{\texttt{s}_{i+1}}(v-{\texttt{cT}_{prev}})-b^{7}\cdot\texttt{P}.

    Recall, however, that <§i+1(v)=1si+1(vcTprev)b8P\ell<\mathsection_{i+1}(v)=\frac{-1}{\texttt{s}_{i+1}}(v-{\texttt{cT}_{prev}})-b^{8}\cdot\texttt{P}, leading to a contradiction.

A.2 Remaining Cases in the Proof of Lemma 5.9

We present remaining arguments for the proof.

A.2.1 Proof of Lemma 5.9.1b

Consider a length core(v)\ell\notin\texttt{core}(v), and let τ\tau be a basic path of length P\ell-\texttt{P} such that (s,v)P(e,u)(s,v)\stackrel{{\scriptstyle\ell-\texttt{P}}}{{\leadsto}}(e,u). We construct from τ\tau a path τ\tau^{\prime} for (s,v)(e,u)(s,v)\stackrel{{\scriptstyle\ell}}{{\leadsto}}(e,u^{\prime}), such that uuu\equiv u^{\prime}.

This part of the proof, showing that a path can be properly lengthened by P, is partially analogous to part 1a of the proof, which shows that a path can be shortened by P. We split the proof to the same cases as in part 1a, and whenever the proofs are similar enough, we refer to the corresponding case in part 1a.

Case 1b.1: The counter values in τ\tau stay above cTprev{\texttt{cT}_{prev}}

Since there is no position in τ\tau with counter value cTprev{\texttt{cT}_{prev}}, then in particular τ\tau has no zero-transitions. We split to subcases.

  • If there is a non-negative cycle cc in τ\tau, we can obtain τ\tau^{\prime} by adding P|c|\frac{\texttt{P}}{|c|} copies of cc, having that the counter values in τ\tau^{\prime} are at least as high as the corresponding ones in τ\tau. Observe that τ\tau^{\prime} is of length +P\ell+\texttt{P} from (s,v)(s,v) to (e,u)(e,u^{\prime}) with u=u+effect(c)P|c|u^{\prime}=u+\emph{effect}(c)\frac{\texttt{P}}{|c|}. Since we have uucTprevu^{\prime}\geq u\geq{\texttt{cT}_{prev}}, then uuu\equiv u^{\prime}.

  • If there are in τ\tau two cycles of different slopes, such that each of them repeats at least bPb\cdot\texttt{P} times, we can use Proposition 5.5 to properly lengthen τ\tau into τ\tau^{\prime}.

  • Otherwise, we are in the case that only a single cycle cc with some negative slope s repeats at least bPb\cdot\texttt{P} times. Since P>§i(v)+sT2\ell-\texttt{P}>\mathsection_{i}(v)+\frac{\texttt{sT}}{2}, by Lemma 5.8.1, we have s>si\texttt{s}>\texttt{s}_{i}. We can thus add P|c|\frac{\texttt{P}}{|c|} copies of cc, guaranteed that the counter values in τ\tau^{\prime} remain above cTprev{\texttt{cT}_{prev}}. Indeed, the maximal drop (i.e., the negation of the minimum cumulative counter effect in the path) DD of τ\tau is X+YX+Y, where XX stands for the repetitions of cc, and YY for the rest. We have Xs(P)X\leq-\texttt{s}\cdot(\ell-\texttt{P}) (notice that s is negative) and Yb+(b1)b2PY\leq b+(b-1)b^{2}\texttt{P}, considering the worst case in which all transitions out of cycles, as well as in the cycles that are not cc are of effect (1)(-1). Thus, Ds(P)+b3PD\leq-\texttt{s}\cdot(\ell-\texttt{P})+b^{3}\texttt{P}.

    As P<<§i+1(v)=(vcTprev)si+1b8P\ell-\texttt{P}<\ell<\mathsection_{i+1}(v)=\frac{(v-{\texttt{cT}_{prev}})}{-\texttt{s}_{i+1}}-b^{8}\cdot\texttt{P}, we have Dssi+1(vcTprev)+b3P(s)b8PD\leq\frac{\texttt{s}}{\texttt{s}_{i+1}}(v-{\texttt{cT}_{prev}})+b^{3}\cdot\texttt{P}-(-\texttt{s})b^{8}\cdot\texttt{P}. Since s>si\texttt{s}>\texttt{s}_{i}, it follows that ssi+1\texttt{s}\geq\texttt{s}_{i+1}, thus (as both s and si+1\texttt{s}_{i+1} are negative), we have D(vcTprev)+b3P(s)b8PD\leq(v-{\texttt{cT}_{prev}})+b^{3}\cdot\texttt{P}-(-\texttt{s})b^{8}\cdot\texttt{P}.

    Recall that we aim to show that vDv-D can “survive” a drop of up to P additional copies of cc (i.e., at most bPb\cdot\texttt{P}), while keeping the counter value above cTprev{\texttt{cT}_{prev}}. Thus, we need to show that v((vcTprev)+b3P(s)b8P)bP>cTprevv-((v-{\texttt{cT}_{prev}})+b^{3}\cdot\texttt{P}-(-\texttt{s})b^{8}\texttt{P})-b\cdot\texttt{P}>{\texttt{cT}_{prev}}. It is left to show that (s)b8P>(b3+b)P(-\texttt{s})b^{8}\cdot\texttt{P}>(b^{3}+b)\cdot\texttt{P}, which obviously holds, as s1b-\texttt{s}\geq\frac{1}{b}.

Case 1b.2: τ\tau reaches counter value cTprev{\texttt{cT}_{prev}}

Let 0zfzuP0\leq z_{f}\leq z_{u}\leq\ell-\texttt{P} be the first and ultimate positions in τ\tau where the counter value is exactly cTprev{\texttt{cT}_{prev}}. We split τ\tau into three parts: τ1=τ[0..zf),τ2=τ[zf..zu),τ3=τ[zu..P]\tau_{1}=\tau[0\leavevmode\nobreak\ ..\leavevmode\nobreak\ z_{f}),\tau_{2}=\tau[z_{f}\leavevmode\nobreak\ ..\leavevmode\nobreak\ z_{u}),\tau_{3}=\tau[z_{u}\leavevmode\nobreak\ ..\leavevmode\nobreak\ \ell-\texttt{P}] as in the analogous case in 1a.

  1. 1.

    The middle part τ2=τ[zf..zu]\tau_{2}=\tau[z_{f}\leavevmode\nobreak\ ..\leavevmode\nobreak\ z_{u}] or last part τ3=τ[zu..P]\tau_{3}=\tau[z_{u}\leavevmode\nobreak\ ..\leavevmode\nobreak\ \ell-\texttt{P}] are of length at least b8\cPb^{8}\cP. These cases are analogous to their counterparts 1 and 2 of 1a.2, by adding cycle repetitions instead of removing them.

  2. 2.

    Only the first part τ1=τ[0..zf)\tau_{1}=\tau[0\leavevmode\nobreak\ ..\leavevmode\nobreak\ z_{f}) of length at least b8\cPb^{8}\cP

    If any of the other parts is long, we lengthen them. Otherwise, their combined length is less than 2b8P<sT22b^{8}\cdot\texttt{P}<\frac{\texttt{sT}}{2}, implying that the first part τ1\tau_{1} is longer than §i(v)+sT2\mathsection_{i}(v)+\frac{\texttt{sT}}{2}.

    Hence, by Lemma 5.8, there are ‘fast’ and ‘slow’ cycles cfc_{f} and csc_{s}, respectively, of slopes sf<ss\texttt{s}_{f}<\texttt{s}_{s}, such that each of them repeats at least b4Pb^{4}\cdot\texttt{P} times in τ1\tau_{1}.

    Thus, by Proposition 5.6, we can add and/or remove some repetitions of cfc_{f} and csc_{s}, such that τ1\tau_{1} is longer by exactly P. Yet, we should ensure that τ\tau^{\prime} is valid, in the sense that its corresponding first part τ1\tau^{\prime}_{1} cannot get the counter value to 0. We show it by cases:

    • If cfc_{f} or csc_{s} are balanced, we can lengthen without changing the remaining counters.

    • If there is a positive cycle c+c_{+} that repeats at least 2b2P2b^{2}\cdot\texttt{P} times, then the counter value climbs by at least 2b2P2b^{2}\cdot\texttt{P} from its value vxv_{x} at position xx where c+c_{+} starts and the position yy where its repetitions end. As the counter gets down to cTprev<P{\texttt{cT}_{prev}}<\texttt{P} at the end of τ1\tau_{1}, and cTprev<P{\texttt{cT}_{prev}}<P (Proposition 5.7), there must be a negative cycle cc_{-} that repeats at least bPb\cdot\texttt{P} times between position yy and the first position after yy that has the counter value vx+b2Pv_{x}+b^{2}\cdot\texttt{P}. Hence, we can add repetitions of c+c_{+} and cc_{-}, as per Proposition 5.6, ensuring that the only affected values are above vxv_{x}.

    • Otherwise, both cfc_{f} and csc_{s} are negative, implying that we add some repetitions of csc_{s} and remove some repetitions of cfc_{f}. We further split into two subcases:

      • If cfc_{f} appears before csc_{s} then there is no problem, as the only change of values will be their increase.

      • If csc_{s} appears first, ending at some position xx, while cfc_{f} starts at some position yy, then a-priori it might be that repeating csc_{s} up to bPb\cdot\texttt{P} more times, as per Proposition 5.6, will take the counter value to 0.

        Yet, observe that since there are at most b2b-2 positive cycles, and each of them can repeat at most 2b2P12b^{2}\cdot\texttt{P}-1 times, the counter value vxv_{x} at position xx, and along the way until position yy, is at least vy(b2)2b2Pv_{y}-(b-2)2b^{2}\cdot\texttt{P}, where vyv_{y} is the counter value at position yy. As cfc_{f} repeats at least b4Pb^{4}\cdot\texttt{P} times, we have vyb4Pv_{y}\geq b^{4}\cdot\texttt{P}. Thus vxb4P2(b2)b2P>b2Pv_{x}\geq b^{4}\cdot\texttt{P}-2(b-2)b^{2}\cdot\texttt{P}>b^{2}\texttt{P}. Hence, repeating csc_{s} up to bPb\cdot\texttt{P} more times at position xx cannot take the counter value to 0, until position yy, as required.

Continuation of the Proof of Lemma 5.9.2a

We detail the subcases of Case 2a.2.2 that were not detailed in the main text:

  • If there is such a relatively slow cycle csc_{s} that ends in a position xx before a position yy in which the first really fast cycle cfc_{f} starts, then: If ss=si\texttt{s}_{s}=s_{i}, we can simply remove Pss|cs|\frac{\texttt{P}}{-\texttt{s}_{s}\cdot|c_{s}|} repetitions of csc_{s}, getting the desired counter and lengths changes.

    Otherwise, namely when ss>si\texttt{s}_{s}>s_{i}, we claim that the counter value between positions xx and yy is high enough, allowing to remove some repetitions of csc_{s} and cfc_{f}, as per Proposition 5.5. As csc_{s} might be positive, removal of its repetitions might decrease the counter; the worst case is when all its transitions are of effect (+1)(+1), and we shorten the path the most, which is bounded by bPb\cdot\texttt{P}. To ensure that the counter remains above the value PP after the removal and until position yy, we thus need it to be at least bP+Pb\cdot\texttt{P}+\texttt{P} at all positions until yy.

    Indeed, the path has only cycles of slope at least si+1\texttt{s}_{i+1} until position y<§i+sTy<\mathsection_{i}+\texttt{sT}. Therefore, its drop DD is at most bb, for the non-cyclic part, plus (si+1)(§i(v+P)+sT)(-\texttt{s}_{i+1})(\mathsection_{i}(v+\texttt{P})+\texttt{sT}) for the cyclic part. (Notice that si+1\texttt{s}_{i+1} is negative.) Therefore, Db+(si+1)(§i(v+P)+sT)D\leq b+(-\texttt{s}_{i+1})(\mathsection_{i}(v+\texttt{P})+\texttt{sT}). Taking the value of §i(v+P)\mathsection_{i}(v+\texttt{P}), we have Db+(si+1)(1si(v+PcTprev)b8P+sT)=b+si+1si(v+PcTprev)+(si+1)(b8P+sT)D\leq b+(-\texttt{s}_{i+1})(\frac{-1}{\texttt{s}_{i}}(v+\texttt{P}-{\texttt{cT}_{prev}})-b^{8}\cdot\texttt{P}+\texttt{sT})=b+\frac{\texttt{s}_{i+1}}{\texttt{s}_{i}}(v+\texttt{P}-{\texttt{cT}_{prev}})+(\texttt{s}_{i+1})(b^{8}\cdot\texttt{P}+\texttt{sT}). Since si+11b\texttt{s}_{i+1}\leq\frac{1}{b} and sjsi11b2\frac{\texttt{s}_{j}}{\texttt{s}_{i}}\leq 1-\frac{1}{b^{2}}, we have Db+(11b2)(v+PcTprev)+1b(b8P+sT)b+(11b2)(v+PcTprev)+(b7P+b8P)D\leq b+(1-\frac{1}{b^{2}})(v+\texttt{P}-{\texttt{cT}_{prev}})+\frac{1}{b}(b^{8}\cdot\texttt{P}+\texttt{sT})\leq b+(1-\frac{1}{b^{2}})(v+\texttt{P}-{\texttt{cT}_{prev}})+(b^{7}\cdot\texttt{P}+b^{8}\cdot\texttt{P}).

    Now, as the counter starts with value v+Pv+\texttt{P}, we need to show that E=v+PD(b2+1)P0E=v+\texttt{P}-D-(b^{2}+1)\texttt{P}\geq 0. Indeed, E1b2(v+P)b7Pb8P(b2+1)PE\geq\frac{1}{b^{2}}(v+\texttt{P})-b^{7}\cdot\texttt{P}-b^{8}\cdot\texttt{P}-(b^{2}+1)\texttt{P}. As vcT=b11Pv\geq\texttt{cT}=b^{11}\cdot\texttt{P}, we have E(b9b7b8b21)P>0E\geq(b^{9}-b^{7}-b^{8}-b^{2}-1)\texttt{P}>0, as required.

  • Otherwise, namely when there is no relatively slow cycle csc_{s} that repeats at least b4Pb^{4}\cdot\texttt{P} times before the position yy in which the first really fast cycle cfc_{f} starts:

    Let zz be the position after yy, in which the path has the smallest counter value vzv_{z} before a relatively slow cycle that repeats b4Pb^{4}\cdot\texttt{P} times.

    If vz>Pv_{z}>\texttt{P}, we can remove some repetitions of the really fast and relatively slow cycles, as per Proposition 5.5; We only remove repetitions of the fast decreasing cycle, so as a result the counter will only grow, and if it is guaranteed to be above P when starting the path from counter value v+Pv+\texttt{P}, it will not reach 0 when starting from counter value vv.

    Otherwise, namely when vzPv_{z}\leq\texttt{P}, we can remove Psf|cf|\frac{\texttt{P}}{-\texttt{s}_{f}\cdot|c_{f}|} repetitions of the really fast cycle cfc_{f}, guaranteeing that τ1\tau^{\prime}_{1} remains above 0 until position yy.

    Observe, however, that the resulting path τ\tau^{\prime} will be longer than \ell. Nevertheless, we claim that in this case, the portion of τ1\tau_{1} from position zz until its last position with counter value vzv_{z} can be further shorten without changing the path’s effect. Indeed, there is a cycle that repeats at least b4Pb^{4}\cdot\texttt{P} times in this part, having an absolute effect of at least b3Pb^{3}\cdot\texttt{P}, implying that this part of τ1\tau_{1} climbs up to a value of at least b3Pb^{3}\cdot\texttt{P}, and down again, allowing for the removal of positive and negative cycles, as per Proposition 5.6, analogously to 1 in the proof of Lemma 5.9.1a.2.

A.2.2 Proof of Lemma 5.9.2b

We remark that Segment 0 is identical in the shortening and lengthening argument, and this is a repetition of the main text. For a path of length \ell, we have in Segment 0 that shift()=\textsf{shift}(\ell)=\ell, and indeed a path from vv is valid from v+Pv+\texttt{P} and vise versa, as they do not hit cTprev{\texttt{cT}_{prev}}: Their maximal drop is sT, while vcT>P+sT>cTprev+sTv\geq\texttt{cT}>\texttt{P}+\texttt{sT}>{\texttt{cT}_{prev}}+\texttt{sT}.

We turn to the iith segment, for i1i\geq 1. Consider a basic path τ\tau for (s,v)(e,u)(s,v)\stackrel{{\scriptstyle\ell}}{{\leadsto}}(e,u). Recall that shift()=+Psi[§i(v+P)..§i(v+P)+sT)]\textsf{shift}(\ell)=\ell+\frac{\texttt{P}}{-\texttt{s}_{i}}\in[\mathsection_{i}(v+\texttt{P})\leavevmode\nobreak\ ..\leavevmode\nobreak\ \mathsection_{i}(v+\texttt{P})+\texttt{sT})]. We construct from τ\tau a path τ\tau^{\prime} for (s,v+P)shift()(e,u)(s,v+\texttt{P})\stackrel{{\scriptstyle\textsf{shift}(\ell)}}{{\leadsto}}(e,u^{\prime}), such that uuu\equiv u^{\prime}, along the following cases.

Case 2b.1: The counter values in τ\tau stay above cTprev{\texttt{cT}_{prev}}

Since there is no position in τ\tau with counter value cTprev{\texttt{cT}_{prev}}, then in particular τ\tau has no zero-transitions. Since >§i1(v)+sT2\ell>\mathsection_{i-1}(v)+\frac{\texttt{sT}}{2}, by Lemma 5.8.1, there is a cycle cc in τ\tau of slope s>si1\texttt{s}>\texttt{s}_{i-1}, namely of slope ssi\texttt{s}\geq\texttt{s}_{i}. We can thus get the required path τ\tau^{\prime}, by adding Ps|c|\frac{\texttt{P}}{-\texttt{s}\cdot|c|} repetitions of cc. Indeed, the counter value of τ\tau^{\prime} at the position that cc starts will be bigger by P than the counter value of τ\tau at that position, while the counter of τ\tau^{\prime} after the repetitions of cc will be at least as high as the counter value of τ\tau at the corresponding position.

Case 2b.2: τ\tau reaches counter value cTprev{\texttt{cT}_{prev}}

Let 0zfzu0\leq z_{f}\leq z_{u}\leq\ell be the first and ultimate positions in τ\tau where the counter value is exactly cTprev{\texttt{cT}_{prev}}. We split τ\tau into three parts: τ1=τ[0..zf),τ2=τ[zf..zu),τ3=τ[zu..]\tau_{1}=\tau[0\leavevmode\nobreak\ ..\leavevmode\nobreak\ z_{f}),\tau_{2}=\tau[z_{f}\leavevmode\nobreak\ ..\leavevmode\nobreak\ z_{u}),\tau_{3}=\tau[z_{u}\leavevmode\nobreak\ ..\leavevmode\nobreak\ \ell] (it could be that zf=zuz_{f}=z_{u}, in which case the middle part is empty).

In order to accommodate with possible zero transitions, we should lengthen τ1\tau_{1}, such that the resulting first part τ1\tau^{\prime}_{1} of the new path τ\tau^{\prime}, which starts with counter value v+Pv+\texttt{P}, will also end with counter value exactly cTprev{\texttt{cT}_{prev}}. Since τ1\tau_{1} reaches cTprev{\texttt{cT}_{prev}} and it is shorter than §i+1(v)\mathsection_{i+1}(v), it has by Lemma 5.8.2 at least b4Pb^{4}\cdot\texttt{P} repetitions of a ‘fast’ cycle cfc_{f} of slope sfsi\texttt{s}_{f}\leq\texttt{s}_{i}.

  1. 1.

    If sf=si\texttt{s}_{f}=\texttt{s}_{i} or τ2\tau_{2} or τ3\tau_{3} are of length at least b5Pb^{5}\cdot\texttt{P}, we can add Psf|cf|\frac{\texttt{P}}{-\texttt{s}_{f}\cdot|c_{f}|} repetitions of cfc_{f} in τ1\tau_{1}. Note that the resulting first part τ1\tau^{\prime}_{1} of the new path τ\tau^{\prime} indeed ends with counter value cTprev{\texttt{cT}_{prev}}. However, while when sf=si\texttt{s}_{f}=\texttt{s}_{i} the resulting length of τ\tau^{\prime} will be shift()\textsf{shift}(\ell), as required, in the case that sf<si\texttt{s}_{f}<\texttt{s}_{i}, we have that the resulting path τ\tau^{\prime} will be shorter than shift()\textsf{shift}(\ell). Nevertheless, in this case, as τ2\tau_{2} or τ3\tau_{3} are of length at least b5Pb^{5}\cdot\texttt{P}, we can further lengthen τ2\tau_{2} or τ3\tau_{3} without changing their effect, as per Proposition 5.6, analogously to 1 or 2, respectively, in the proof of Lemma 5.9.1a.2.

  2. 2.

    Otherwise, we are in the case that τ1\tau_{1} has a ‘really fast’ cycle of slope sf<si\texttt{s}_{f}<\texttt{s}_{i} that repeats at least b4Pb^{4}\cdot\texttt{P} times, and both τ2\tau_{2} or τ3\tau_{3} are of length less than b5Pb^{5}\cdot\texttt{P}. We claim that in this case τ1\tau_{1} must also have b4Pb^{4}\cdot\texttt{P} repetitions of a ‘relatively slow’ cycle csc_{s} of slope sssi\texttt{s}_{s}\geq\texttt{s}_{i}. The argument for that is the same as in 2 of part 2a of the proof. As the case of ss=si\texttt{s}_{s}=\texttt{s}_{i} is handled in the previous subcase, we may further assume that ss>si\texttt{s}_{s}>\texttt{s}_{i}. We may thus add repetitions of cfc_{f} and csc_{s}, as per Proposition 5.5, lengthening τ1\tau_{1} by exactly shift()\textsf{shift}(\ell)-\ell, while also ensuring that it ends with counter value exactly cTprev{\texttt{cT}_{prev}}.