Automata Languages Programming
Automata Languages Programming
Fomin
Rūsiņš Freivalds
Marta Kwiatkowska
David Peleg (Eds.)
ARCoSS
LNCS 7966
Automata, Languages,
and Programming
40th International Colloquium, ICALP 2013
Riga, Latvia, July 2013
Proceedings, Part II
123
Lecture Notes in Computer Science 7966
Commenced Publication in 1973
Founding and Former Series Editors:
Gerhard Goos, Juris Hartmanis, and Jan van Leeuwen
Editorial Board
David Hutchison, UK Takeo Kanade, USA
Josef Kittler, UK Jon M. Kleinberg, USA
Alfred Kobsa, USA Friedemann Mattern, Switzerland
John C. Mitchell, USA Moni Naor, Israel
Oscar Nierstrasz, Switzerland C. Pandu Rangan, India
Bernhard Steffen, Germany Madhu Sudan, USA
Demetri Terzopoulos, USA Doug Tygar, USA
Gerhard Weikum, Germany
Automata, Languages,
and Programming
40th International Colloquium, ICALP 2013
Riga, Latvia, July 8-12, 2013
Proceedings, Part II
13
Volume Editors
Fedor V. Fomin
University of Bergen, Department of Informatics
Postboks 7803, 5020 Bergen, Norway
E-mail: [email protected]
Rūsiņš Freivalds
University of Latvia, Faculty of Computing
Raina bulv. 19, 1586 Riga, Latvia
E-mail: [email protected]
Marta Kwiatkowska
University of Oxford, Department of Computer Science
Wolfson Building, Parks Road, Oxford OX1 3QD, UK
E-mail: [email protected]
David Peleg
Weizmann Institute of Science, Faculty of Mathematics and Computer Science
POB 26, 76100 Rehovot, Israel
E-mail: [email protected]
CR Subject Classification (1998): F.2, F.1, C.2, H.3-4, G.2, I.2, I.3.5, E.1
Program Committee
Track A
Andris Ambainis University of Latvia, Latvia
Edith Elkind Nanyang Technological University, Singapore
Leah Epstein University of Haifa, Israel
Rolf Fagerberg University of Southern Denmark, Denmark
Fedor Fomin University of Bergen, Norway (Chair)
Pierre Fraigniaud CNRS and University Paris Diderot, France
Fabrizio Grandoni Dalle Molle Institute, Switzerland
Joachim Gudmundsson University of Sydney, Australia
Kazuo Iwama Kyoto University, Japan
Valentine Kabanets Simon Fraser University, Canada
Stavros Kolliopoulos National and Kapodistrian University
of Athens, Greece
Daniel Král’ University of Warwick, UK
Daniel Lokshtanov University of California, San Diego, USA
Konstantin Makarychev Microsoft Research, Redmond, USA
Peter Bro Miltersen Aarhus University, Denmark
Ilan Newman University of Haifa, Israel
Konstantinos Panagiotou Ludwig Maximilians University, Munich,
Germany
Alexander Razborov University of Chicago, USA
Saket Saurabh The Institute of Mathematical Sciences, India
David Steurer Microsoft Research, New England, USA
Kunal Talwar Microsoft Research, Silicon Valley, USA
Dimitrios Thilikos National and Kapodistrian University
of Athens, Greece
Virginia Vassilevska Williams University of California, Berkeley,
and Stanford, USA
Gerhard Woeginger Eindhoven University of Technology,
The Netherlands
Track B
Christel Baier TU Dresden, Germany
Chiara Bodei University of Pisa, Italy
Mikolaj Bojańczyk University of Warsaw, Poland
Patricia Bouyer-Decitre CNRS/ENS Cachan, France
Vassilis Christophides University of Crete, Greece
Yuxin Deng Shanghai Jiao-Tong University, China
Marcelo Fiore University of Cambridge, UK
VIII Organization
Track C
James Aspnes Yale Univerity, USA
Ioannis Caragiannis University of Patras, Greece
Xavier Defago JAIST, Japan
Josep Diaz UPC, Barcelona, Spain
Stefan Dobrev Slovak Academy of Sciences, Bratislava,
Slovak Republic
Michele Flammini University of L’Aquila, Italy
Leszek Gasieniec
University of Liverpool, UK
Cyril Gavoille Univerity of Bordeaux, France
David Kempe University of Southern California, USA
Valerie King University of Victoria, Canada
Amos Korman CNRS, Paris, France
Miroslaw Kutylowski Wroclaw University of Technology, Poland
Dahlia Malkhi Microsoft Research, Silicon Valley, USA
Luca Moscardelli University of Chieti, Pescara, Italy
Thomas Moscibroda Microsoft Research Asia and Tsinghua
University, China
Marina Papatriantafilou Chalmers University of Technology, Goteborg,
Sweden
Organization IX
Organizing Committee
(all from University of Latvia, Latvia)
Andris Ambainis
Kaspars Balodis
Juris Borzovs (Organizing Chair)
Rūsiņš Freivalds (Conference Chair)
Marats Golovkins
Nikolay Nahimov
Jeļena Poļakova
Alexander Rivosh
Agnis Škuškovniks (Organizing Deputy Chair)
Juris Smotrovs
Abuzer Yakaryılmaz
Sponsoring Institutions
QuBalt
University of Latvia
Additional Reviewers
Aaronson, Scott Arvind, V. Barman, Siddharth
Aceto, Luca Askalidis, Georgios Barto, Libor
Adamaszek, Anna Atserias, Albert Belovs, Aleksandrs
Afshani, Peyman Aumüller, Martin Bendlin, Rikke
Agrawal, Manindra Avigdor-Elgrabli, Noa Benoit, Anne
Ahn, Kook Jin Avis, David Benzaken, Veronique
Aichholzer, Oswin Badanidiyuru, Berman, Itay
Albers, Susanne Ashwinkumar Bertrand, Nathalie
Allouche, Jean-Paul Bae, Sang Won Berwanger, Dietmar
Alur, Rajeev Balmau, Oana Bianchi, Giuseppe
Alvarez, Carme Bampis, Evripidis Biedl, Therese
Amano, Kazuyuki Bansal, Nikhil Bilò, Davide
Andoni, Alexandr Barcelo, Pablo Bilò, Vittorio
X Organization
EATCS Lecture
Algorithms, Networks, and Social Phenomena . . . . . . . . . . . . . . . . . . . . . . . 1
Jon Kleinberg
Invited Talks
Recent Advances for a Classical Scheduling Problem . . . . . . . . . . . . . . . . . . 4
Susanne Albers
Jon Kleinberg
Cornell University
Ithaca NY USA
http://www.cs.cornell.edu/home/kleinber/
Overview
A major development over the past two decades has been the way in which net-
worked computation has brought together people and information at a global
scale. In addition to its societal consequences, this move toward massive connec-
tivity has led to a range of new challenges for the field of computing; many of
these challenges are based directly on the need for new models of computation.
We focus here on some of the modeling issues that arise in the design of
computing systems involving large human audiences — these include social net-
working and social media sites such as Facebook, Google Plus, Twitter, and
YouTube, sites supporting commerce and economic exchange such as Amazon
and eBay, and sites for organizing the collective creation of knowledge such as
Wikipedia. The interactions on these sites are extensively mediated by algo-
rithms, and in thinking about the design issues that come into play, we need to
think in particular about the feedback loops created by interactions among the
large groups of people that populate these systems — in the ways they respond
to incentives [21,23,27], form social networks [9,12,20] and share information [25].
Within this broad space of questions, we consider models for the spread of
information and behavior through large social and economic networks — it has
become clear that this type of person-to-person transmission is a basic “transport
mechanism” for such networks [14]. Among the issues informing this investiga-
tion are recent theoretical models of such processes [4,6,8,11,13,19,26,30], as well
as incentive mechanisms for propagating information [1,2,5,15,24], techniques for
reconstructing the trajectory of information spreading through a network given
incomplete observations [7,10,18], and empirical results indicating the impor-
tance of network structure [3,16,17,22] — and in particular network neighbor-
hood structure [28,29] — for understanding the ways in which information will
propagate at a local level.
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 1–3, 2013.
c Springer-Verlag Berlin Heidelberg 2013
2 J. Kleinberg
References
1. Arcaute, E., Kirsch, A., Kumar, R., Liben-Nowell, D., Vassilvitskii, S.: On thresh-
old behavior in query incentive networks. In: Proc. 8th ACM Conference on Elec-
tronic Commerce, pp. 66–74 (2007)
2. Babaioff, M., Dobzinski, S., Oren, S., Zohar, A.: On bitcoin and red balloons. In:
Proc. ACM Conference on Electronic Commerce, pp. 56–73 (2012)
3. Backstrom, L., Huttenlocher, D., Kleinberg, J., Lan, X.: Group formation in large
social networks: Membership, growth, and evolution. In: Proc. 12th ACM SIGKDD
International Conference on Knowledge Discovery and Data Mining (2006)
4. Blume, L., Easley, D., Kleinberg, J., Kleinberg, R., Tardos, É.: Which networks
are least susceptible to cascading failures? In: Proc. 52nd IEEE Symposium on
Foundations of Computer Science (2011)
5. Cebrián, M., Coviello, L., Vattani, A., Voulgaris, P.: Finding red balloons with split
contracts: robustness to individuals’ selfishness. In: Proc. 44th ACM Symposium
on Theory of Computing. pp. 775–788 (2012)
6. Centola, D., Macy, M.: Complex contagions and the weakness of long ties. American
Journal of Sociology 113, 702–734 (2007)
7. Chierichetti, F., Kleinberg, J.M., Liben-Nowell, D.: Reconstructing patterns of in-
formation diffusion from incomplete observations. In: Proc. 24th Advances in Neu-
ral Information Processing Systems. pp. 792–800 (2011)
8. Dodds, P., Watts, D.: Universal behavior in a generalized model of contagion.
Physical Review Letters 92, 218701 (2004)
9. Easley, D., Kleinberg, J.: Networks, Crowds, and Markets: Reasoning about a
Highly Connected World. Cambridge University Press (2010)
10. Golub, B., Jackson, M.O.: Using selection bias to explain the observed structure
of internet diffusions. Proc. Natl. Acad. Sci. USA 107(24), 10833–10836 (2010)
11. Granovetter, M.: Threshold models of collective behavior. American Journal of
Sociology 83, 1420–1443 (1978)
12. Jackson, M.O.: Social and Economic Networks. Princeton University Press (2008)
13. Kempe, D., Kleinberg, J., Tardos, É.: Maximizing the spread of influence in a social
network. In: Proc. 9th ACM SIGKDD International Conference on Knowledge
Discovery and Data Mining, pp. 137–146 (2003)
14. Kleinberg, J.: Cascading behavior in networks: Algorithmic and economic issues.
In: Nisan, N., Roughgarden, T., Tardos, É., Vazirani, V. (eds.) Algorithmic Game
Theory, pp. 613–632. Cambridge University Press (2007)
15. Kleinberg, J., Raghavan, P.: Query incentive networks. In: Proc. 46th IEEE Sym-
posium on Foundations of Computer Science, pp. 132–141 (2005)
16. Kossinets, G., Watts, D.: Empirical analysis of an evolving social network. Science
311, 88–90 (2006)
17. Leskovec, J., Adamic, L., Huberman, B.: The dynamics of viral marketing. ACM
Transactions on the Web 1(1) (May 2007)
18. Liben-Nowell, D., Kleinberg, J.: Tracing information flow on a global scale using
Internet chain-letter data. Proc. Natl. Acad. Sci. USA 105(12), 4633–4638 (2008)
19. Mossel, E., Roch, S.: On the submodularity of influence in social networks. In:
Proc. 39th ACM Symposium on Theory of Computing (2007)
20. Newman, M.E.J.: Networks: An Introduction. Oxford University Press (2010)
21. Nisan, N., Roughgarden, T., Tardos, É., Vazirani, V.: Algorithmic Game Theory.
Cambridge University Press (2007)
Algorithms, Networks, and Social Phenomena 3
22. Onnela, J.P., Saramaki, J., Hyvonen, J., Szabo, G., Lazer, D., Kaski, K., Kertesz,
J., Barabasi, A.L.: Structure and tie strengths in mobile communication networks.
Proc. Natl. Acad. Sci. USA 104, 7332–7336 (2007)
23. Papadimitriou, C.H.: Algorithms, games, and the internet. In: Proc. 33rd ACM
Symposium on Theory of Computing, pp. 749–753 (2001)
24. Pickard, G., Pan, W., Rahwan, I., Cebrian, M., Crane, R., Madan, A., Pentland,
A.: Time-critical social mobilization. Science 334(6055), 509–512 (2011)
25. Rogers, E.: Diffusion of Innovations, 4th edn. Free Press (1995)
26. Schelling, T.: Micromotives and Macrobehavior. Norton (1978)
27. Shoham, Y., Leyton-Brown, K.: Multiagent Systems: Algorithmic, Game-
Theoretic, and Logical Foundations. Cambridge University Press (2009)
28. Ugander, J., Backstrom, L., Kleinberg, J.: Subgraph frequencies: Mapping the em-
pirical and extremal geography of large graph collections. In: Proc. 22nd Interna-
tional World Wide Web Conference (2013)
29. Ugander, J., Backstrom, L., Marlow, C., Kleinberg, J.: Structural diversity in social
contagion. Proc. Natl. Acad. Sci. USA 109(16), 5962–5966 (2012)
30. Watts, D.J.: A simple model of global cascades on random networks. Proc. Natl.
Acad. Sci. USA 99(9), 5766–5771 (2002)
Recent Advances for a Classical Scheduling
Problem
Susanne Albers
1 Introduction
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 4–14, 2013.
c Springer-Verlag Berlin Heidelberg 2013
Recent Advances for a Classical Scheduling Problem 5
competitive ratio smaller than 1.88 [31]. Hence the remaining gap between the
known upper and lower bounds is quite small.
Very few results have been developed for randomized online algorithms. For
m = 2 machines, Bartal et al. [12] presented an algorithm that attains an optimal
competitive ratio of 4/3. Currently, no randomized algorithm is known whose
competitiveness is provably below the deterministic lower bound of 1.88, for all
values of m. A lower bound of e/(e − 1) ≈ 1.581 on the competitive ratio of
any randomized online strategy, for general m, was given in [14,34]. The ratio
of e/(e − 1) is also the best performance guarantee that can be achieved by
deterministic online algorithms if job preemption is allowed [15].
Recent research on makespan minimization has investigated scenarios where
the online constraint is relaxed. More precisely, an online algorithm is given ad-
ditional information or extra power in processing a job sequence σ. The study
of such settings is motivated by the fact that the competitiveness of determin-
istic online strategies is relatively high, compared to List’s initial performance
guarantee of 2 − 1/m. Furthermore, with respect to the foundations of online
algorithms, it is interesting to gain insight into the value of various forms of
resource augmentation. Generally, in the area of scheduling the standard type
of resource augmentation is extra speed , i.e. an online algorithm is given faster
machines than an offline algorithm that constructs optimal schedules. We re-
fer the reader to [6,27,30] and references therein for a selection of work in this
direction. However, for online makespan minimization, faster processors do not
give particularly interesting results. Obviously, the decrease in the algorithms’
competitive ratios is inversely proportional to the increase in speed.
For online makespan minimization the following scientifically more challenging
types of resource augmentation have been explored. The problem scenarios are
generally well motivated from a practical point of view.
– Known total processing
n time: Consider a setting in which an online algorithm
knows the sum t=1 pt of the job processing times of σ. The access to such
a piece of information can be justified as follows. In a parallel server system
there usually exist fairly accurate estimates on the workload that arrives
over a given time horizon. Furthermore, in a shop floor a scheduler typically
accepts orders (tasks) of a targeted volume for a given time period, say a
day or a week.
– Availability of a reordering buffer: In this setting an online algorithm has a
buffer of limited size that may be used to partially reorder the job sequence.
Whenever a job arrives, it is inserted into the buffer; then one job of the
buffer is removed and assigned in the current schedule.
– Job migration: Assume that at any time an online algorithm may perform
reassignments, i.e. jobs already scheduled on machines may be removed and
transferred to other machines. Job migration is a well-known and widely
used technique to balance load in parallel and distributed systems.
In this paper we survey the results known for these relaxed online scenarios. It
turns out that usually significantly improved competitive ratios can be achieved.
Unless otherwise stated, all algorithms considered in this paper are deterministic.
6 S. Albers
In this
section we consider the scenario that an online algorithm knows the sum
S = nt=1 pt of the job processing times, for the incoming sequence σ. The prob-
lem was first studied by Kellerer et al. [29] who concentrated on m = 2 machines
and gave an algorithm that achieves an optimal competitive ratio of 4/3. The set-
ting with a general number m of machines was investigated in [5,10,16].
√ Angelelli
et al. [10] gave a strategy that attains a competitiveness of (1 + 6)/2 ≈ 1.725.
The best algorithm currently known was developed by Cheng et al. [16] and is
1.6-competitive. Both the algorithms by Angelelli et al. and Cheng et al. work
with job classes, i.e. jobs are classified according to their processing times. For
each class, specific scheduling rules apply. The algorithm by Cheng et al. [16] is
quite involved, as we shall see below. A simple algorithm not resorting to job
classes was presented by Albers and Hellwig [5]. However, the algorithm is only
1.75-competitive and hence does not achieve the best possible competitive ratio.
We proceed to describe the 1.6-competitive algorithm by Cheng et al. [16], which
we call ALG(P).
Description of ALG(P): The job assignment rules essentially work with
small, medium and large jobs. In order to keep track of the machines containing
these
n jobs, a slightly more refined classification is needed. W.l.o.g. assume that
t=1 pt = m so that 1 is a lower bound on the optimum makespan. A job Jt ,
1 ≤ t ≤ n, is
• tiny if pt ∈ (0, 0.3] • little if pt ∈ (0.3, 0.6] • medium if pt ∈ (0.6, 0.8],
• big if pt ∈ (0.8, 0.9] • very big if pt > 0.9.
Tiny and little jobs are also called small. Big and very big jobs are large. At any
given time let j denote the load of Mj , 1 ≤ j ≤ m. Machine Mj is
• empty if j = 0 • little if j ∈ (0.3, 0.6] • small if j ∈ (0, 0.6].
A machine Mj is called medium if it only contains one medium job. Finally, Mj
is said to be nearly full if contains a large as well as small jobs and j ≤ 1.1.
ALG(P) works in two phases.
Phase 1: The first phase proceeds as long as (1) there are empty machines and
(2) twice the total number of empty and medium machines is greater than the
number of little machines. Throughout the phase ALG(P) maintains a lower
bound L on the optimum makespan. Initially, L := 1. During the phase, for each
new job Jt , the algorithm sets L := max{L, pt }. Then the job is scheduled as
follows.
Recent Advances for a Classical Scheduling Problem 7
Phase 2: If at the end of Phase 1 there are no empty machines, then in Phase 2
jobs are generally scheduled according to a Best Fit strategy. More specifically, a
job Jt is assigned to a machine Mj having the largest load j such that j + pt ≤
1.6L. Here L is updated as L := max{L, pt , 2p∗ }, where p∗ is the processing
time of the (m + 1)-st largest job seen so far. If at the end of Phase 1 there exist
empty machines, then the job assignment is more involved. First ALG(P) creates
batches of three machines. Each batch consists of two little machines as well as
one medium or one empty machine. Each batch either receives only small jobs
or only medium and large jobs. At any time there exists only one open batch to
receive small jobs. Similarly, there exists one open batch to receive medium and
large jobs. While batches are open or can be opened, jobs are either scheduled on
an empty machines or using the Best Fit policy. Once the batches are exhausted,
jobs are assigned using Best Fit to the remaining machines. We refer the reader
to [16] for an exact definition of the scheduling rules.
Theorem 1. [16] ALG(P) is 1.6-competitive, for general m.
Lower bounds on the best possible competitive ratio of deterministic strategies
were given in [5,10,16]. Cheng et al. [16] showed a lower bound of 1.5. Angelelli
et al. [10] gave an improved bound of 1.565, as m → ∞. The best lower bound
currently known was presented in [5].
Theorem 2. [5] Let A be a deterministic online algorithm that knows the total
processing time of σ. If A is c-competitive, then c ≥ 1.585, as m → ∞.
Hence the gap between the best known upper and lower bounds is very small.
Nonetheless, an interesting open problem is to determine the exact competitive-
ness that can be achieved in the setting where the sum of the job processing
times is known.
Further results have been developed for the special case of m = 2 machines.
Two papers by Angelelli et al. [7,8] assume that an online algorithm additionally
knows an upper bound on the maximum job processing time. A setting with
m = 2 uniform machines is addressed in [9].
Azar and Regev [11] studied a related problem. Here an online algorithm even
knows the value of the optimum makespan, for the incoming job sequence. In a
scheduling environment it is probably unrealistic that the value of an optimal
8 S. Albers
An open problem is to tighten the gap between the upper and the lower bounds.
Bin stretching with m = 2 bins was addressed by Epstein [19].
3 Reordering Buffer
Consider any step during the iteration phase. As mentioned above, the algorithm
removes a job with the smallest processing time from the buffer. Let p denote
the respective processing time. Furthermore, let L be the total load on the m
machines prior to the assignment. The job is scheduled on a machine Mj with a
load of at most
β(j)(L/m + p) − p.
Englert et al. [18] prove that such a machine always exists. In the final phase
ALG(B) first constructs a virtual schedule on M1 , . . . , Mm
empty machines.
More specifically, the k − 1 jobs from the buffer are considered in non-increasing
order of processing time. Each job is assigned to a machine of M1 , . . . , Mm
with
the smallest current load. The process stops when the makespan of the virtual
schedule is at least three times the processing time of the last job assigned.
This last job is removed again from the virtual schedule. Then the machines
M1 , . . . , Mm
are renumbered in order of non-increasing load. The jobs residing
on Mj are assigned to Mj in the real schedule, 1 ≤ j ≤ m. In a last step each of
the remaining jobs is placed on a least loaded machine in the current schedule.
Theorem 4. [18] ALG(B) is αm -competitive, for any m ≥ 2.
Englert et al. [18] prove that the competitiveness of αm is best possible using a
buffer whose size does not depend on the job sequence σ.
Theorem 5. [18] No deterministic online algorithm can achieve a competitive
ratio smaller than αm , for any m ≥ 2, with a buffer whose size does not depend
on σ.
Englert et al. [18] also present algorithms that use a smaller buffer. In particular
they give a (1 + αm /2)-competitive algorithm that works with a buffer of size
m + 1. Moreover, they analyze an extended List algorithm that always assigns
jobs to a least loaded machine. The strategy attains a competitiveness of 2 −
1/(m − k + 1) with a buffer of size k ∈ [1, (m + 1)/2].
The paper by Englert et al. [18] also considers online makespan minimization
on related machines and gives a (2 + )-competitive algorithm, for any > 0,
that uses a buffer of size m. Dósa and Epstein [17] studied online makespan
minimization on identical machines assuming that job preemption is allowed
and showed that the competitiveness is 4/3.
10 S. Albers
4 Job Migration
To the best of our knowledge makespan minimization with job migration was
first addressed by Aggarwal et al. [1]. However the authors consider an offline
setting. An algorithm is given a schedule, in which all jobs are already assigned,
and a budget. The algorithm may perform job migrations up to the given budget.
Aggarwal et al. [1]. design strategies that perform well with respect to the best
possible solution that can be constructed with the budget. In this article we are
interested in online makespan minimization with job migration. Two models of
migration have been investigated. (1) An online algorithm may migrate a certain
volume of jobs. (2) An online algorithm may migrate a limited number of jobs.
In the next sections we address these two settings.
Sanders et al. [33] show that a migration factor of 4/3 is essentially best pos-
sible for 3/2-competitive algorithms. More specifically, they consider schedules
S whose makespan is at most 3/2 times the optimum makespan for the set of
scheduled jobs and that additionally satisfy the following property: A removal
of the largest job from each machine yields a schedule S whose makespan is
upper bounded by the optimum makespan for the set of jobs sequenced in S.
Recent Advances for a Classical Scheduling Problem 11
Sanders et al. [33] show that there exists a schedule S such that, for any 0 < <
4/21, upon the arrival of a new job, a migration factor of 4/3 − is necessary to
achieve a competitiveness of 3/2.
Sanders et al. [33] also present a more involved algorithm that is 4/3-competi-
tive using a migration factor of 5/2. Moreover, they construct a sophisticated
online approximation scheme, where the migration factor depends exponentially
on 1/.
Theorem 7. [18] There exists a (1 + )-competitive algorithm with a migration
2
factor of β() ∈ 2O(1/·log (1/)) . The running time needed to update the schedule
in response to the arrival of a new job is constant.
Finally, Sanders et al. [33] show that no constant migration factor is sufficient
to maintain truly optimal schedules.
Theorem 8. [33] Any online algorithm that maintains optimal solutions uses a
migration factor of Ω(m).
5 Conclusion
References
1. Aggarwal, G., Motwani, R., Zhu, A.: The load rebalancing problem. Journal of
Algorithms 60(1), 42–59 (2006)
2. Albers, S.: Better bounds for online scheduling. SIAM Journal on Computing 29,
459–473 (1999)
3. Albers, S., Hellwig, M.: On the value of job migration in online makespan minimiza-
tion. In: Epstein, L., Ferragina, P. (eds.) ESA 2012. LNCS, vol. 7501, pp. 84–95.
Springer, Heidelberg (2012)
4. Albers, S., Hellwig, M.: Online makespan minimization with parallel schedules,
arXiv:1304.5625 (2013)
5. Albers, S., Hellwig, M.: Semi-online scheduling revisited. Theoretical Computer
Science 443, 1–9 (2012)
6. Anand, S., Garg, N., Kumar, A.: Resource augmentation for weighted flow-time ex-
plained by dual fitting. In: Proc. 23rd Annual ACM-SIAM Symposium on Discrete
Algorithms, pp. 1228–1241 (2012)
7. Angelelli, E., Speranza, M.G., Tuza, Z.: Semi-on-line scheduling on two parallel
processors with an upper bound on the items. Algorithmica 37, 243–262 (2003)
8. Angelelli, E., Speranza, M.G., Tuza, Z.: New bounds and algorithms for on-line
scheduling: two identical processors, known sum and upper bound on the tasks.
Discrete Mathematics & Theoretical Computer Science 8, 1–16 (2006)
9. Angelelli, E., Speranza, M.G., Tuza, Z.: Semi-online scheduling on two uniform
processors. Theoretical Computer Science 393, 211–219 (2008)
10. Angelelli, E., Nagy, A.B., Speranza, M.G., Tuza, Z.: The on-line multiprocessor
scheduling problem with known sum of the tasks. Journal of Scheduling 7, 421–428
(2004)
11. Azar, Y., Regev, O.: On-line bin-stretching. Theoretical Computer Science 268,
17–41 (2001)
12. Bartal, Y., Fiat, A., Karloff, H., Vohra, R.: New algorithms for an ancient schedul-
ing problem. Journal of Computer and System Sciences 51, 359–366 (1995)
13. Bartal, Y., Karloff, H., Rabani, Y.: A better lower bound for on-line scheduling.
Infomation Processing Letters 50, 113–116 (1994)
14. Chen, B., van Vliet, A., Woeginger, G.J.: A lower bound for randomized on-line
scheduling algorithms. Information Processing Letters 51, 219–222 (1994)
15. Chen, B., van Vliet, A., Woeginger, G.J.: A optimal algorithm for preemptive
online scheduling. Operations Research Letters 18, 127–131 (1995)
14 S. Albers
16. Cheng, T.C.E., Kellerer, H., Kotov, V.: Semi-on-line multiprocessor scheduling
with given total processing time. Theoretical Computer Science 337, 134–146
(2005)
17. Dósa, G., Epstein, L.: Preemptive online scheduling with reordering. In: Fiat, A.,
Sanders, P. (eds.) ESA 2009. LNCS, vol. 5757, pp. 456–467. Springer, Heidelberg
(2009)
18. Englert, M., Özmen, D., Westermann, M.: The power of reordering for online min-
imum makespan scheduling. In: Proc. 49th Annual IEEE Symposium on Founda-
tions of Computer Science, pp. 603–612 (2008)
19. Epstein, L.: Bin stretching revisited. Acta Informatica 39(2), 7–117 (2003)
20. Faigle, U., Kern, W., Turan, G.: On the performance of on-line algorithms for
partition problems. Acta Cybernetica 9, 107–119 (1989)
21. Fleischer, R., Wahl, M.: Online scheduling revisited. Journal of Scheduling 3, 343–
353 (2000)
22. Galambos, G., Woeginger, G.: An on-line scheduling heuristic with better worst
case ratio than Graham’s list scheduling. SIAM Journal on Computing 22, 349–355
(1993)
23. Garay, M.R., Johnson, D.S.: Computers and Intractability: A Guide to the Theory
of NP-Completeness. W.H. Freeman and Company, New York (1979)
24. Gormley, T., Reingold, N., Torng, E., Westbrook, J.: Generating adversaries for
request-answer games. In: Proc. 11th ACM-SIAM Symposium on Discrete Algo-
rithms, pp. 564–565 (2000)
25. Graham, R.L.: Bounds for certain multi-processing anomalies. Bell System Tech-
nical Journal 45, 1563–1581 (1966)
26. Hochbaum, D.S., Shmoys, D.B.: Using dual approximation algorithms for schedul-
ing problems theoretical and practical results. Journal of the ACM 34, 144–162
(1987)
27. Kalyanasundaram, B., Pruhs, K.: Speed is as powerful as clairvoyance. Journal of
the ACM 47, 617–643 (2000)
28. Karger, D.R., Phillips, S.J., Torng, E.: A better algorithm for an ancient scheduling
problem. Journal of Algorithms 20, 400–430 (1996)
29. Kellerer, H., Kotov, V., Speranza, M.G., Tuza, Z.: Semi on-line algorithms for the
partition problem. Operations Research Letters 21, 235–242 (1997)
30. Pruhs, K., Sgall, J., Torng, E.: Online scheduling. In: Leung, J. (ed.) Handbook
of Scheduling: Algorithms, Models, and Performance Analysis, ch. 15. CRC Press
(2004)
31. Rudin III, J.F.: Improved bounds for the on-line scheduling problem. Ph.D. Thesis.
The University of Texas at Dallas (May 2001)
32. Rudin III, J.F., Chandrasekaran, R.: Improved bounds for the online scheduling
problem. SIAM Journal on Computing 32, 717–735 (2003)
33. Sanders, P., Sivadasan, N., Skutella, M.: Online scheduling with bounded migra-
tion. Mathematics of Operations Reseach 34(2), 481–498 (2009)
34. Sgall, J.: A lower bound for randomized on-line multiprocessor scheduling. Infor-
mation Processing Letters 63, 51–55 (1997)
35. Sleator, D.D., Tarjan, R.E.: Amortized efficiency of list update and paging rules.
Communications of the ACM 28, 202–208 (1985)
36. Zhang, G.: A simple semi on-line algorithm for P 2//Cmax with a buffer. Informa-
tion Processing Letters 61, 145–148 (1997)
Formalizing and Reasoning about Quality
1 Introduction
One of the main obstacles to the development of complex computerized systems lies in
ensuring their correctness. Efforts in this direction include temporal-logic model check-
ing – given a mathematical model of the system and a temporal-logic formula that
specifies a desired behavior of the system, decide whether the model satisfies the for-
mula, and synthesis – given a temporal-logic formula that specifies a desired behavior,
generate a system that satisfies the specification with respect to all environments [6].
Correctness is Boolean: a system can either satisfy its specification or not satisfy
it. The richness of today’s systems, however, justifies specification formalisms that are
multi-valued. The multi-valued setting arises directly in systems in which components
are multi-valued (c.f., probabilistic and weighted systems) and arises indirectly in ap-
plications where multi values are used in order to model missing, hidden, or varying
information (c.f., abstraction, query checking, and inconsistent viewpoints). As we elab-
orate below, the multi-valued setting has been an active area of research in recent years.
This work was supported in part by the Austrian Science Fund NFN RiSE (Rigorous Systems
Engineering), by the ERC Advanced Grant QUAREM (Quantitative Reactive Modeling), and
the ERC Grant QUALITY. The full version is available at the authors’ URLs.
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 15–27, 2013.
c Springer-Verlag Berlin Heidelberg 2013
16 S. Almagor, U. Boker, and O. Kupferman
No attempts, however, have been made to augment temporal logics with a quantitative
layer that would enable the specification of the relative merits of different aspects of
the specification and would enable to formalize the quality of a reactive system. Given
the growing role that temporal logic plays in planning and robotics, and the criticality
of quality in these applications [16], such an augmentation is of great importance also
beyond the use of temporal logic in system design and verification.
In this paper we suggest a framework for formalizing and reasoning about quality.
Our working assumption is that satisfying a specification is not a yes/no matter. Differ-
ent ways of satisfying a specification should induce different levels of quality, which
should be reflected in the output of the verification procedure. Consider for example the
specification G(req → Fgrant ). There should be a difference between a computation
that satisfies it with grants generated soon after requests, one that satisfies it with long
waits, one that satisfies it with several grants given to a single request, one that satisfies
it vacuously (with no requests), and so on. Moreover, we may want to associate dif-
ferent levels of importance to different components of a specification, to express their
mutual influence on the quality, and to formalize the fact that we have different levels
of confidence about some of them.
Quality is a rather subjective issue. Technically, we can talk about the quality of sat-
isfaction of specifications since there are different ways to satisfy specifications. We
introduce and study the linear temporal logic LTL[F ], which extends LTL with an ar-
bitrary set F of functions over [0, 1]. Using the functions in F , a specifier can formally
and easily prioritize the different ways of satisfaction. The logic LTL[F ] is really a fam-
ily of logics, each parameterized by a set F ⊆ {f : [0, 1]k → [0, 1]|k ∈ } of functions
(of arbitrary arity) over [0, 1]. For example, F may contain the min {x, y}, max {x, y},
and 1 − x functions, which are the standard quantitative analogues of the ∧, ∨, and ¬
operators. As we discuss below, such extensions to LTL have already been studied in
the context of quantitative verification [15]. The novelty of LTL[F ], beyond its use in
the specification of quality, is the ability to manipulate values by arbitrary functions. For
example, F may contain the quantitative operator λ , for λ ∈ [0, 1], that tunes down
the quality of a sub-specification. Formally, the quality of the satisfaction of the speci-
fication λ ϕ is the multiplication of the quality of the satisfaction of ϕ by λ. Another
useful operator is the weighted-average function ⊕λ . There, the quality described by
the formula ϕ ⊕λ ψ is the weighted (according to λ) average between the quality of ϕ
and that of ψ. This enables the quality of the system to be an interpolation of different
aspects of it. As an example, consider the formula G(req → (grant ⊕ 34 Xgrant )). The
formula specifies the fact that we want requests to be granted immediately and the grant
to hold for two transactions. When this always holds, the satisfaction value is 1. We are
quite okay with grants that are given immediately and last for only one transaction, in
which case the satisfaction value is 34 , and less content when grants arrive with a delay,
in which case the satisfaction value is 14 .
An LTL[F ] formula maps computations to a value in [0, 1]. We accordingly gen-
eralize classical decision problems, such as model checking, satisfiability, synthesis,
and equivalence, to their quantitative analogues, which are search or optimization
Formalizing and Reasoning about Quality 17
problems. For example, the equivalence problem between two LTL[F ] formulas ϕ1 and
ϕ2 seeks the supremum of the difference in the satisfaction values of ϕ1 and ϕ2 over all
computations. Of special interest is the extension of the synthesis problem. In conven-
tional synthesis algorithms we are given a specification to a reactive system, typically
by means of an LTL formula, and we transform it into a system that is guaranteed to
satisfy the specification with respect to all environments [23]. Little attention has been
paid to the quality of the systems that are automatically synthesized1. Current efforts
to address the quality challenge are based on enriching the game that corresponds to
synthesis to a weighted one [2,5]. Using LTL[F ], we are able to embody quality within
the specification, which is very convenient.
In the Boolean setting, the automata-theoretic approach has proven to be very use-
ful in reasoning about LTL specifications. The approach is based on translating LTL
formulas to nondeterministic Büchi automata on infinite words [25]. In the quantitative
approach, it seems natural to translate formulas to weighted automata [21]. However,
these extensively-studied models are complicated and many problems become undecid-
able for them [1,17]. We show that we can use the approach taken in [15], bound the
number of possible satisfaction values of LTL[F ] formulas, and use this bound in or-
der to translate LTL[F ] formulas to Boolean automata. From a technical point of view,
the big challenge in our setting is to maintain the simplicity and the complexity of the
algorithms for LTL, even though the number of possible values is exponential. We do
so by restricting attention to feasible combinations of values assigned to the different
subformulas of the specification. Essentially, our translation extends the construction of
[25] by associating states of the automaton with functions that map each subformula
to a satisfaction value. Using the automata-theoretic approach, we solve the basic prob-
lems for LTL[F ] within the same complexity classes as the corresponding problems in
the Boolean setting (as long as the functions in F are computable within these com-
plexity classes; otherwise, they become the computational bottleneck). Our approach
thus enjoys the fact that traditional automata-based algorithms are susceptible to well-
known optimizations and symbolic implementations. It can also be easily implemented
in existing tools.
Recall that our main contribution is the ability to address the issue of quality within
the specification formalism. While we describe it with respect to Boolean systems, we
show in Section 5 that our contribution can be generalized to reason about weighted
systems, where the values of atomic propositions are taken from [0, 1]. We also extend
LTL[F ] to the branching temporal logic CTL [F ], which is the analogous extension of
CTL , and show that we can still solve decision and search problems. Finally, we define
a fragment, LTL , of LTL[F ] for which the number of different satisfaction values is
linear in the length of the formula, leading to even simpler algorithms.
Related Work. In recent years, the quantitative setting has been an active area of re-
search, providing many works on quantitative logics and automata [9,10,12,18].
Conceptually, our work aims at formalizing quality, having a different focus from
each of the other works. Technically, the main difference between our setting and most
1
Note that we do not refer here to the challenge of generating optimal (say, in terms of state
space) systems, but rather to quality measures that refer to how the specification is satisfied.
18 S. Almagor, U. Boker, and O. Kupferman
of the other approaches is the source of quantitativeness: There, it stems from the nature
of the system, whereas in our setting it stems from the richness of the new functional
operators. For example, in multi-valued systems, the values of atomic propositions are
taken from a finite domain [4,18]. In fuzzy temporal logic [22], the atomic propositions
take values in [0, 1]. Probabilistic temporal logic is interpreted over Markov decision
processes [8,20], and in the context of real-valued signals [11], quantitativeness stems
from both time intervals and predicates over the value of atomic propositions.
Closer to our approach is [7], where CTL is augmented with discounting and
weighted-average operators. Thus, a formula has a rich satisfaction value, even on
Boolean systems. The motivation in [7] is to suggest a logic whose semantics is not
too sensitive to small perturbations in the model. Accordingly, formulas are evaluated
on weighted-system (as we do in Section 5) or on Markov-chains. We, on the other
hand, aim at specifying quality of on-going behaviors. Hence, we work with the much
stronger LTL and CTL∗ logics, and we augment them by arbitrary functions over [0, 1].
A different approach, orthogonal to ours, is to stay with Boolean satisfaction values,
while handling quantitative properties of the system, in particular ones that are based
on unbounded accumulation [3]. The main challenge in these works is the border of
decidability, whereas our technical challenge is to keep the simplicity of the algorithms
known for LTL in spite of the exponential number of satisfaction values. Nonetheless,
an interesting future research direction is to combine the two approaches.
2 Formalizing Quality
The linear temporal logic LTL[F ] generalizes LTL by replacing the Boolean operators
of LTL with arbitrary functions over [0, 1]. The logic is actually a family of logics, each
parameterized by a set F of functions.
Syntax. Let AP be a set of Boolean atomic propositions, and let F ⊆ {f : [0, 1]k →
[0, 1] | k ∈ } be a set of functions over [0, 1]. Note that the functions in F may have
different arities. An LTL[F ] formula is one of the following:
Semantics. The semantics of LTL[F ] formulas is defined with respect to (finite or infi-
nite) computations over AP . We use (2AP )∞ to denote (2AP )∗ ∪ (2AP )ω . A computa-
tion is a word π = π0 , π1 , . . . ∈ (2AP )∞ . We use π i to denote the suffix πi , πi+1 , . . ..
The semantics maps a computation π and an LTL[F ] formula ϕ to the satisfaction value
of ϕ in π, denoted [[π, ϕ]]. The satisfaction value is defined inductively as described in
Table 1 below.2
2
The observant reader may be concerned by our use of max and min where sup and inf are in
order. In Lemma 1 we prove that there are only finitely many satisfaction values for a formula
ϕ, thus the semantics is well defined.
Formalizing and Reasoning about Quality 19
It is not hard to prove, by induction on the structure of the formula, that for every
computation π and formula ϕ, it holds that [[π, ϕ]] ∈ [0, 1]. We use the usual Fϕ1 =
TrueUϕ1 and Gϕ1 = ¬(TrueU(¬ϕ1 )) abbreviations.
The logic LTL coincides with the logic LTL[F ] for F that corresponds to the usual
Boolean operators. For simplicity, we use the common such functions as abbreviation,
as described below. In addition, we introduce notations for some useful functions. Let
x, y ∈ [0, 1]. Then,
• ¬x = 1 − x • x ∨ y = max {x, y} • x ∧ y = min {x, y}
• λ x = λ · x • x ⊕λ y = λ · x + (1 − λ) · y
To see that LTL indeed coincides with LTL[F ] for F = {¬, ∨, ∧}, note that for this F ,
all formulas are mapped to {0, 1} in a way that agrees with the semantics of LTL.
Kripke Structures and Transducers. For a Kripke structure K and an LTL[F ] formula
ϕ, we have that [[K, ϕ]] = min {[[π, ϕ]] : π is a computation of K}. That is, the value is
induced by the path that admits the lowest satisfaction value. 3
In the setting of open systems, the set of atomic propositions is partitioned into sets I
and O of input and output signals. An (I, O)-transducer then models the computations
generated (deterministically) by the system when it interacts with an environment that
generates finite or infinite sequences of input signals.
Example 1. Consider a scheduler that receives requests and generates grants. Consider
the LTL[F ] formula G(req → F(grant ⊕ 21 Xgrant )) ∧ ¬( 34 G¬req). The satisfaction
value of the formula is 1 if every request is eventually granted, and the grant lasts for
two consecutive steps. If a grant holds only for a single step, then the satisfaction value
is reduced to 12 . In addition, if there are no requests, then the satisfaction value is at
most 14 . This shows how we can embed vacuity tests in the formula.
definition here focuses on LTL[F ], the questions can be asked with respect to arbitrary
quantitative specification formalism, with the expected adjustments.
Decision Problems. The above questions are search and optimization problems. It is
sometimes interesting to consider the decision problems they induce, when referring
to a threshold. For example, the model-checking decision-problem is to decide, given
a system K, a formula ϕ, and a threshold t, whether [[K, ϕ]] ≥ t. For some problems,
there are natural thresholds to consider. For example, in the implication problem, asking
whether max {[[π, ϕ1 ]] − [[π, ϕ2 ]] : π is a computation} ≥ 0 amounts to asking whether
for all computations π, we have that [[π, ϕ1 ]] ≥ [[π, ϕ2 ]], which indeed captures implica-
tion.
Bounding the Number of Satisfaction Values. For an LTL[F ] formula ϕ, let V (ϕ) =
{[[π, ϕ]] : π ∈ (2AP )∞ }. That is, V (ϕ) is the set of possible satisfaction values of ϕ in
arbitrary computations. We first show that this set is finite for all LTL[F ] formulas.
Lemma 1. For every LTL[F ] formula ϕ, we have that |V (ϕ)| ≤ 2|ϕ| .
The good news that follows from Lemma 1 is that every LTL[F ] formula has only
finitely many possible satisfaction values. This enabled us to replace the sup and inf op-
erators in the semantics by max and min. It also implies that we can point to witnesses
that exhibit the satisfaction values. However, Lemma 1 only gives an exponential bound
to the number of satisfaction values. We now show that this exponential bound is tight.
Example 2. Consider the logic LTL[{⊕}], augmenting LTL with the average function,
where for every x, y ∈ [0, 1] we have that x ⊕ y = 12 x + 12 y. Let n ∈ and consider
the formula ϕn = p1 ⊕ (p2 ⊕ (p3 ⊕ (p4 ⊕ ...pn ))...). The length of ϕn is in O(n) and
the nesting depth of ⊕ operators in it is n. For every computation π it holds that
1 1 1 1
[[π, ϕn ]] = [[π0 , p1 ]] + [[π0 , p2 ]] + ... + n−1 [[π0 , pn−1 ]] + n−1 [[π0 , pn ]].
2 4 2 2
4
Lemma 1 guarantees that max and min (rather than sup and inf) are defined.
Formalizing and Reasoning about Quality 21
Hence, every assignment π0 ⊆ {p1 , ..., pn−1 } to the first position in π induces a dif-
ferent satisfaction value for [[π, ϕn ]], implying that there are 2n−1 different satisfaction
values for ϕn .
is an infinite sequence of states such that r0 ∈ Q0 , and for every i ≥ 0, we have that
ri+1 ∈ δ(ri , wi+1 ). We denote by inf(r) the set of states that r visits infinitely often,
that is inf(r) = {q : ri = q for infinitely many i ∈ }. The run r is accepting if
it visits all the sets in α infinitely often. Formally, for every set F ∈ α we have that
inf(r) ∩ F = ∅. An automaton accepts a word if it has an accepting run on it. The
language of an automaton A, denoted L(A), is the set of words that A accepts.
In the Vardi-Wolper translation of LTL formulas to NGBWs [25], each state of the
automaton is associated with a set of formulas, and the NGBW accepts a computation
from a state q iff the computation satisfies exactly all the formulas associated with q. The
state space of the NGBW contains only states associated with maximal and consistent
sets of formulas, the transitions are defined so that requirements imposed by temporal
formulas are satisfied, and the acceptance condition is used in order to guarantee that
requirements that involve the satisfaction of eventualities are not delayed forever.
In our construction here, each state of the NGBW assigns a satisfaction value to
every subformula. Consistency then assures that the satisfaction values agree with the
functions in F . Similar adjustments are made to the transitions and the acceptance con-
dition. The construction translates an LTL[F ] formula ϕ to an NGBW, while setting its
initial states according to a required predicate P ⊆ [0, 1]. We then have that for every
computation π ∈ (2AP )ω , the resulting NGBW accepts π iff [[π, ϕ]] ∈ P .
We note that a similar approach is taken in [15], where LTL formulas are interpreted
over quantitative systems. The important difference is that the values in our construction
arise from the formula and the functions it involves, whereas in [15] they are induced
by the values of the atomic propositions.
Theorem 2. Let ϕ be an LTL[F ] formula and P ⊆ [0, 1] be a predicate. There exists
an NGBW Aϕ,P such that for every computation π ∈ (2AP )ω , it holds that [[π, ϕ]] ∈ P
2
iff Aϕ,P accepts π. Furthermore, Aϕ,P has at most 2(|ϕ| ) states and index at most |ϕ|.
Proof. We define Aϕ,P = 2AP , Q, δ, Q0 , α as follows. Let cl(ϕ) be the set of ϕ’s
subformulas. Let Cϕ be the collection of functions g : cl(ϕ) → [0, 1] such that for
all ψ ∈ cl(ϕ), we have that g(ψ) ∈ V (ψ). For a function g ∈ Cϕ , we say that g is
consistent if for every ψ ∈ cl(ϕ), the following holds.
– If ψ = True, then g(ψ) = 1, and if ψ = False then g(ψ) = 0.
– If ψ = p ∈ AP , then g(ψ) ∈ {0, 1}.
– If ψ = f (ψ1 , . . . , ψk ), then g(ψ) = f (g(ψ1 ), . . . , g(ψk )).
The state space Q of Aϕ,P is the set of all consistent functions in Cϕ . Then, Q0 =
{g ∈ Q : g(ϕ) ∈ P } contains all states in which the value assigned to ϕ is in P .
We now define the transition function δ. For functions g, g and a letter σ ∈ Σ, we
have that g ∈ δ(g, σ) iff the following hold.
– σ = {p ∈ AP : g(p) = 1}.
– For all Xψ1 ∈ cl(ϕ) we have g(Xψ1 ) = g (ψ1 ).
– For all ψ1 Uψ2 ∈ cl(ϕ) we have g(ψ1 Uψ2 ) =
max {g(ψ2 ), min {g(ψ1 ), g (ψ1 Uψ2 )}}.
Finally, every formula ψ1 Uψ2 contributes to α the set Fψ1 Uψ2 =
{g : g(ψ2 ) = g(ψ1 Uψ2 )}.
Formalizing and Reasoning about Quality 23
Remark 1. The construction described in the proof of Theorem 2 is such that select-
ing the set of initial states allows us to specify any (propositional) condition regarding
the sub-formulas of ϕ. A simple extension of this idea allows us to consider a set of
formulas {ϕ1 , ..., ϕm } = Φ and a predicate P ⊆ [0, 1]m , and to construct an NGBW
that accepts a computation π iff [[π, ϕ1 ]], ..., [[π, ϕn ]] ∈ P . Indeed, the state space
of the product consists of functions that map all the formulas in Φ to their satisfac-
tion values, and we only have to choose as the initial states these functions g for which
g(ϕ1 ), ..., g(ϕn ) ∈ P . As we shall see in Section 4, this allows us to use the automata-
theoretic approach also in order to examine relations between the satisfaction values of
different formulas.
In this section we solve the basic questions defined in Section 2.2. We show that they
all can be solved for LTL[F ] with roughly the same complexity as for LTL. When
we analyze complexity, we assume that the functions in F can be computed in a com-
plexity that is subsumed by the complexity of the problem for LTL (PSPACE, except
for 2EXPTIME for realizability), which is very reasonable. Otherwise, computing the
functions becomes the computational bottleneck. A related technical observation is that,
assuming the functions in F can be calculated in PSPACE, we can also enumerate in
PSPACE the set V (ϕ) of the possible satisfaction values of an LTL[F ] formula ϕ.
The questions in the quantitative setting are basically search problems, asking for the
best or worst value. Since every LTL[F ] formula may only have exponentially many
satisfaction values, one can reduce a search problem to a set of decision problems with
respect to specific thresholds, remaining in PSPACE. Combining this with the construc-
tion of NGBWs described in Theorem 2 is the key to our algorithms.
We can now describe the algorithms in detail.
Satisfiability and Validity. We start with satisfiability and solve the decision version
of the problem: given ϕ and a threshold v, decide whether there exists a computation
π such that [[π, ϕ]] ≥ v. The latter can be solved by checking the nonemptiness of the
NGBW Aϕ,P with P = [v, 1]. Since the NGBW can be constructed on-the-fly, this can
be done in PSPACE in the size of |ϕ|. The search version can be solved in PSPACE by
iterating over the set of relevant thresholds.
We proceed to validity. It is not hard to see that for all ϕ and v, we have that
∀π, [[π, ϕ]] ≥ v iff ¬(∃π, [[π, ϕ]] < v). The latter can be solved by checking, in PSPACE,
the nonemptiness of the NGBW Aϕ,P with P = [0, v). Since PSPACE is closed under
complementation, we are done. In both cases, the nonemptiness algorithm can return
the witness to the nonemptiness.
Implication and Equivalence. In the Boolean setting, implication can be reduced
to validity, which is in turn reduced to satisfiability. Doing the same here is more
sophisticated, but possible: we add to F the average and negation operators. It is
not hard to verify that for every computation π, it holds that [[π, ϕ1 ⊕ 21 ¬ϕ2 ]] =
1 1
2 ([[π, ϕ1 ]]− [[π, ϕ2 ]])+ 2 . In particular, max{[[π, ϕ1 ]]− [[π, ϕ2 ]] : π is a computation} =
2 · max {[[π, ϕ1 ⊕ 21 ¬ϕ2 ]] : π is a computation} − 1. Thus, the problem reduces to the
24 S. Almagor, U. Boker, and O. Kupferman
5 Beyond LTL[F]
The logic LTL[F ] that we introduce and study here is a first step in our effort to in-
troduce reasoning about quality to formal methods. Future work includes stronger for-
malisms and algorithms. We distinguish between extensions that stay in the area of
LTL[F ] and ones that jump to the (possibly undecidable) world of infinitely many satis-
faction values. In the latter, we include efforts to extend LTL[F ] by temporal operators
in which the future is discounted, and efforts to combine LTL[F ] with other qualitative
aspects of systems [3]. In this section we describe two extensions of the first class: an
extension of LTL[F ] to weighted systems and to a branching-time temporal logic. We
also describe a computationally simple fragment of LTL[F ].
Formalizing Quality with Branching Temporal Logics. Formulas of LTL[F ] specify on-
going behaviors of linear computations. A Kripke structure is not linear, and the way
we interpret LTL[F ] formulas with respect to it is universal. In branching temporal
logic one can add universal and existential quantifiers to the syntax of the logic, and
specifications can refer to the branching nature of the system [13].
The branching temporal logic CTL [F ] extends LTL[F ] by the path quantifiers E
and A. Formulas of the form Eϕ and Aϕ are referred to as state formulas and they are
interpreted over states s in the structure with the semantics [[s, Eϕ]] = max{[[π, ϕ]] :
π starts in s} and [[s, Aϕ]] = min{[[π, ϕ]] : π starts in s}.
In [14], the authors describe a general technique for extending the scope of LTL
model-checking algorithms to CTL . The idea is to repeatedly consider an innermost
state subformula, view it as an (existentially or universally quantified) LTL formula,
apply LTL model checking in order to evaluate it in all states, and add a fresh atomic
proposition that replaces this subformula and holds in exactly these states that satisfy
it. This idea, together with our ability to model check systems with weighted atomic
propositions, can be used also for model checking CTL [F ].
More challenging is the handling of the other basic problems. There, the solution in-
volves a translation of CTL [F ] formulas to tree automata. Since the automata-theoretic
approach for CTL has the Vardi-Wolper construction at its heart, this is possible.
The Fragment LTL of LTL[F ]. In the proof of Lemma 1, we have seen that a formula
may take exponentially many satisfaction values. The proof crucially relies on the fact
that the value of a function is a function of all its inputs. However, in the case of unary
functions, or indeed functions that do not take many possible values, this bound can be
lowered. Such an interesting fragment is the logic LTL = LTL[{λ , λ }λ∈[0,1] ∪
{∨, ¬}], with the functions λ (x) = λ · x and λ (x) = λ · x + (1 − λ)/2.
This fragment is interesting in two aspects. First, computationally, an LTL formula
has only polynomially many satisfaction values. Moreover, for a predicate of the form
P = [v, 1] (resp. P = (v, 1]), the LTL formula Bool (ϕ, P ) can be shown to be of
linear length in |ϕ|. This implies that solving threshold-problems for LTL formulas
can be done with tools that work with LTL with no additional complexity. Second,
philosophically, an interesting question that arises when formalizing quality regards
26 S. Almagor, U. Boker, and O. Kupferman
how the lack of quality in a component should be viewed. With quality between 0 and 1,
we have that 1 stands for “good”, 0 for “bad”, and 12 for “not good and not bad”. While
the λ operator enables us to reduce the quality towards “badness”, the λ operator
enables us to do so towards “ambivalence”.
References
1. Almagor, S., Boker, U., Kupferman, O.: What’s decidable about weighted automata? In: Bul-
tan, T., Hsiung, P.-A. (eds.) ATVA 2011. LNCS, vol. 6996, pp. 482–491. Springer, Heidelberg
(2011)
2. Bloem, R., Chatterjee, K., Henzinger, T.A., Jobstmann, B.: Better Quality in Synthesis
through Quantitative Objectives. In: Bouajjani, A., Maler, O. (eds.) CAV 2009. LNCS,
vol. 5643, pp. 140–156. Springer, Heidelberg (2009)
3. Boker, U., Chatterjee, K., Henzinger, T.A., Kupferman, O.: Temporal specifications with
accumulative values. In: 26th LICS, pp. 43–52 (2011)
4. Bruns, G., Godefroid, P.: Model checking with multi-valued logics. In: Dı́az, J., Karhumäki,
J., Lepistö, A., Sannella, D. (eds.) ICALP 2004. LNCS, vol. 3142, pp. 281–293. Springer,
Heidelberg (2004)
5. Černý, P., Chatterjee, K., Henzinger, T.A., Radhakrishna, A., Singh, R.: Quantitative Synthe-
sis for Concurrent Programs. In: Gopalakrishnan, G., Qadeer, S. (eds.) CAV 2011. LNCS,
vol. 6806, pp. 243–259. Springer, Heidelberg (2011)
6. Clarke, E., Henzinger, T.A., Veith, H.: Handbook of Model Checking. Elsvier (2013)
7. de Alfaro, L., Faella, M., Henzinger, T.A., Majumdar, R., Stoelinga, M.: Model checking
discounted temporal properties. TCS 345(1), 139–170 (2005)
8. Desharnais, J., Gupta, V., Jagadeesan, R., Panangaden, P.: Metrics for labelled markov pro-
cesses. TCS 318(3), 323–354 (2004)
9. Droste, M., Kuich, W., Rahonis, G.: Multi-valued MSO logics over words and trees. Funda-
menta Informaticae 84(3-4), 305–327 (2008)
10. Droste, M., Rahonis, G.: Weighted automata and weighted logics with discounting.
TCS 410(37), 3481–3494 (2009)
11. Donzé, A., Maler, O., Bartocci, E., Nickovic, D., Grosu, R., Smolka, S.: On Temporal Logic
and Signal Processing. In: Chakraborty, S., Mukund, M. (eds.) ATVA 2012. LNCS, vol. 7561,
pp. 92–106. Springer, Heidelberg (2012)
12. Droste, M., Werner, K., Heiko, V.: Handbook of Weighted Automata. Springer (2009)
13. Emerson, E.A., Halpern, J.Y.: Sometimes and not never revisited: On branching versus linear
time. Journal of the ACM 33(1), 151–178 (1986)
14. Emerson, E.A., Lei, C.L.: Modalities for model checking: Branching time logic strikes back.
In: Proc. 12th POPL, pp. 84–96 (1985)
15. Faella, M., Legay, A., Stoelinga, M.: Model Checking Quantitative Linear Time Logic.
TCS 220(3), 61–77 (2008)
16. Kress-Gazit, H., Fainekos, G.E., Pappas, G.J.: Temporal-Logic-Based Reactive Mission and
Motion Planning. IEEE Trans. on Robotics 25(6), 1370–1381 (2009)
17. Krob, D.: The equality problem for rational series with multiplicities in the tropical semiring
is undecidable. International Journal of Algebra and Computation 4(3), 405–425 (1994)
18. Kupferman, O., Lustig, Y.: Lattice automata. In: Cook, B., Podelski, A. (eds.) VMCAI 2007.
LNCS, vol. 4349, pp. 199–213. Springer, Heidelberg (2007)
19. Kupferman, O., Vardi, M.Y.: Safraless decision procedures. In: Proc. 46th FOCS, pp. 531–540
(2005)
Formalizing and Reasoning about Quality 27
20. Kwiatkowska, M.Z.: Quantitative verification: models techniques and tools. In: FSE,
pp. 449–458 (2007)
21. Mohri, M.: Finite-state transducers in language and speech processing. Computational Lin-
guistics 23(2), 269–311 (1997)
22. Moon, S., Lee, K.H., Lee, D.: Fuzzy branching temporal logic. IEEE Transactions on Sys-
tems, Man, and Cybernetics, Part B 34(2), 1045–1055 (2004)
23. Pnueli, A., Rosner, R.: On the synthesis of a reactive module. In: Proc.16th POPL, pp. 179–190
(1989)
24. Thomas, W.: Automata on infinite objects. In: Handbook of Theoretical Computer Science,
pp. 133–191 (1990)
25. Vardi, M.Y., Wolper, P.: An automata-theoretic approach to automatic program verification.
In: Proc. 1st LICS, pp. 332–344 (1986)
26. Vardi, M.Y., Wolper, P.: Reasoning about infinite computations. I&C 115(1), 1–37 (1994)
The Square Root Phenomenon in Planar Graphs
Dániel Marx
Research supported by the European Research Council (ERC) grant 280152.
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, p. 28, 2013.
c Springer-Verlag Berlin Heidelberg 2013
A Guided Tour in Random Intersection Graphs
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 29–35, 2013.
c Springer-Verlag Berlin Heidelberg 2013
30 P.G. Spirakis, S. Nikoletseas, and C. Raptopoulos
In this model we also denote by Li the set of vertices that have chosen label
i ∈ M . Given Gn,m,p , we will refer to {Li , i ∈ M} as its label representation.
It is often convenient to view the label representation as a bipartite graph with
vertex set V ∪ M and edge set {(v, i) : i ∈ Sv } = {(v, i) : v ∈ Li }. We refer to
this graph as the bipartite random graph Bn,m,p associated to Gn,m,p . Notice that
the associated bipartite graph is uniquely defined by the label representation.
It follows from the definition of the model the (unconditioned) probability
that a specific edge exists is 1 − (1 − p2 )m . Therefore, if mp2 goes to infinity
with n, then this probability goes to 1. We can thus restrict the range of the
parameters to the “interesting” range where mp2 = O(1) (i.e. the range of values
for which the unconditioned probability that an edge exists does not go to 1).
Furthermore, as is usual in the literature, we assume that the number of labels
is some power of the number of vertices, i.e. m = nα , for some α > 0.
It is worth mentioning that the edges in Gn,m,p are not independent. In par-
ticular, there is a strictly positive dependence between the existence of two edges
that share an endpoint (i.e. Pr(∃{u, v}|∃{u, w}) > Pr(∃{u, v})). This dependence
is stronger the smaller the number of labels M includes, while it seems to fade
away as the number of labels increases. In fact, by using a coupling technique,
the authors in [4] prove the equivalence (measured in terms of total variation dis-
tance) of uniform random intersection graphs and Erdős-Rényi random graphs,
when m = nα , α > 6. This bound on the number of labels was improved in [16],
by showing equivalence of sharp threshold functions among the two models for
α ≥ 3. These results show that random intersection graphs are quite general and
that known techniques for random graphs can be used in the analysis of uniform
random intersection graphs with a large number of labels.
The similarity between uniform random intersection graphs and Erdős-Rényi
random graphs vanishes as the number of labels m decreases below the number
of vertices n (i.e. m = nα , for α ≤ 1). This dichotomy was initially pointed
out in [18], through the investigation of connectivity of Gn,m,p
. In particular,
it was proved that the connectivity threshold for α > 1 is ln n ln n
nm , but it is m
(i.e. quite larger) for α ≤ 1. Therefore, the mean number of edges just above
connectivity is approximately 12 n ln n in the first case (which is equal to the mean
number of edges just above the connectivity threshold for Erdős-Rényi random
A Guided Tour in Random Intersection Graphs 31
Below we provide a brief presentation of the main results on the topic obtained
by our team. We also give a general description of the techniques used; some
of these techniques highlight and take advantage of the intricacies and special
structure of random intersection graphs, while others are adapted from the field
of Erdős-Rényi random graphs.
The problem of the existence and efficient construction of large independent sets
in general random intersection graphs is considered in [11]. Concerning existence,
exact formulae are derived for the expectation and variance of the number of
independent sets of any size, by using a vertex contraction technique. This tech-
nique involves the characterization of the statistical behavior of an independent
set of any size and highlights an asymmetry in the edge appearance rule of ran-
dom intersection graphs. In particular, it is shown that the probability that any
fixed label i is chosen by some vertex in a k-size S with no edges is exactly
kpi
1+(k−1)pi . On the other hand, there is no closed formula for the respective prob-
ability when there is at least one edge between the k vertices (or even when the
set S is complete)! The special structure of random intersection graphs is also
used in the design of efficient algorithms for constructing quite large independent
sets in uniform random intersection graphs. By analysis, it is proved that the
approximation guarantees of algorithms using the label representation of ran-
dom intersection graphs are superior to that of well known greedy algorithms
for independent sets when applied to instances of Gn,m,p .
32 P.G. Spirakis, S. Nikoletseas, and C. Raptopoulos
2.3 Coloring
In [9], the problem of coloring the vertices of Gn,m,p is investigated (see also [1]).
For the case where the number of labels is less than the number of vertices
and mp ≥ ln2 n (i.e. a factor ln n above the connectivity threshold of uniform
random intersection graphs), a polynomial time algorithm is proposed for finding
a propercoloring Gn,m,p . The algorithm is greedy-like and it is proved that it
2 2 2
takes O n lnmp n time, while using Θ nmp
ln n different colors. Furthermore, by
using a one sided coupling to the regular random intersection graphs model
Gn,m,λ with λ ∼ mp, and using an upper bound on its independence number
from [13], it is shown that the number of colors used by the proposed algorithm
is optimal up to constant factors.
To complement this result, the authors in [9] prove that when mp < β ln n,
for some small constant β, only np colors are needed in order to color n − o(n)
vertices of Gn,m,p whp. This means that even for quite dense instances, using
the same number of colors as those needed to properly color the clique induced
by any label suffices to color almost all of the vertices of Gn,m,p . For the proof,
the authors explore a combination of ideas from [5] and [8]. In particular, a
martingale {Xt }t≥0 is defined, so that Xn is equal to the maximum subset of
vertices that can be properly colored using a predefined number of colors k.
Then, by providing an appropriate lower bound on the probability that there is
a sufficiently large subset of vertices that can be split in k independent sets of
roughly the same size, and then using Azuma’s Inequality for martingales, the
authors provide a lower bound on E[Xn ] and also show that the actual value
Xn is highly concentrated around its mean value.
Finally, due to the similarities that the Gn,m,p model has to the process of
generating random hypergraphs, [9] includes a comparison of the problem of
finding a proper coloring for Gn,m,p to that of coloring hypergraphs so that no
edge is monochromatic. In contrast to the first problem, it is proved that only
A Guided Tour in Random Intersection Graphs 33
two colors suffice for the second problem. Furthermore, by using the method of
conditional expectations (see [14]) an algorithm can be derived that finds the
desired coloring in polynomial time.
first prove that Gn,m,p is an expander whp when the number of labels is less than
the number of vertices, even when p is just above the connectivity threshold (i.e.
p = (1 + o(1))τc , where τc is the connectivity threshold). Second, the authors
show that random walks on the vertices of random intersection graphs are whp
rapidly mixing (in particular, the mixing time is logarithmic on n). The proof is
based on upper bounding the second eigenvalue of the random walk on Gn,m,p
through coupling of the original Markov Chain describing the random walk to
another Markov Chain on an associated random bipartite graph whose conduc-
tance properties are appropriate. Finally, the authors prove that the cover time
of the random walk on Gn,m,p , when m = nα , α < 1 and p is at least 5 times
the connectivity threshold is Θ(n log n), which is optimal up to a constant. The
proof is based on a general theorem of Cooper and Frieze [2]; the authors prove
that the degree and spectrum requirements of the theorem hold whp in the case
of uniform random intersection graphs. The authors also claim that their proof
also carries over to the case of smaller values for p, but the technical difficulty
for proving the degree requirements of the theorem of [2] increases.
3 Epilogue
We discussed here recent progress on the Random Intersection Graphs (RIGs)
Model. The topic is still new and many more properties await to be discovered
especially for the General (non-Uniform) version of RIGs. Such graphs (and
other new graph classes) are motivated by modern technology, and thus, some
combinatorial results and algorithmic properties may become useful in order to
understand and exploit emerging networks nowadays.
References
1. Behrisch, M., Taraz, A., Ueckerdt, M.: Coloring random intersection graphs and
complex networks. SIAM J. Discrete Math. 23, 288–299 (2008)
2. Cooper, C., Frieze, A.: The Cover Time of Sparse Random Graphs. In: Random
Structures and Algorithms, vol. 30, pp. 1–16. John Wiley & Sons, Inc. (2007)
3. Efthymiou, C., Spirakis, P.G.: Sharp thresholds for Hamiltonicity in random inter-
section graphs. Theor. Comput. Sci. 411(40-42), 3714–3730 (2010)
4. Fill, J.A., Sheinerman, E.R., Singer-Cohen, K.B.: Random intersection graphs
when m = ω(n): an equivalence theorem relating the evolution of the G(n, m, p)
and G(n, p) models. Random Struct. Algorithms 16(2), 156–176 (2000)
5. Frieze, A.: On the Independence Number of Random Graphs. Disc. Math. 81,
171–175 (1990)
6. Godehardt, E., Jaworski, J.: Two models of Random Intersection Graphs for Classi-
fication. In: Opitz, O., Schwaiger, M. (eds.). Studies in Classification, Data Analysis
and Knowledge Organisation, pp. 67–82. Springer, Heidelberg (2002)
7. Karoński, M., Sheinerman, E.R., Singer-Cohen, K.B.: On Random Intersection
Graphs: The Subgraph Problem. Combinatorics, Probability and Computing Jour-
nal 8, 131–159 (1999)
8. L
uczak, T.: The chromatic number of random graphs. Combinatorica 11(1), 45–54
(2005)
A Guided Tour in Random Intersection Graphs 35
Peter Widmayer
Chinese proverb, sometimes also attributed to Goethe.
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, p. 36, 2013.
c Springer-Verlag Berlin Heidelberg 2013
Decision Problems for Additive Regular Functions
University of Pennsylvania
{alur,rmukund}@cis.upenn.edu
1 Introduction
Consider the following scenario: a customer frequents a coffee shop, and each time
purchases a cup of coffee costing $2. At any time, he may fill a survey, for which
the store offers to give him a discount of $1 for each of his purchases that month
(including for purchases already made). We model this by the machine M1 shown
in figure 1. There are two states qS and q¬S , indicating whether the customer has
filled out the survey during the current month. There are three events to which
the machine responds: C indicates the purchase of a cup of coffee, S indicates the
completion of a survey, and # indicates the end of a month. The registers x and y
track how much money the customer owes the establishment: in the state q¬S , the
amount in x assumes that he will not fill out a survey that month, and the amount in
y assumes that he will fill out a survey before the end of the month. At any time the
customer wishes to settle his account, the machine outputs the amount of money
owed, which is always the value in the register x.
The full version of this paper is available on the arXiv (arXiv:1304.7029). This
research was partially supported by the NSF Expeditions in Computing award
1138996.
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 37–48, 2013.
c Springer-Verlag Berlin Heidelberg 2013
38 R. Alur and M. Raghothaman
x := x + 2
C
y := y + 1 C/x := x + 1
S/x := y
q¬S qS
start x x
#/y := x
#/y := x S
The automaton M1 has a finite state space, and a finite set of integer-valued
registers. On each transition, each register u is updated by an expression of the
form “u := v + c”, for some register v and constant c ∈ Z. Which register will
eventually contribute to the output is determined by the state after reading the
entire input, and so the cost of an event depends not only on the past, but also on
the future. Indeed, it can be shown that these machines are closed under regular
lookahead, i.e. the register updates can be conditioned on regular properties of
an as-yet-unseen suffix, for no gain in expressivity. The important limitation is
that the register updates are test-free, and cannot examine the register contents.
The motivation behind the model is generalizing the idea of regular languages
to quantitative properties of strings. A language L ⊆ Σ ∗ is regular when it
is accepted by a DFA. Regular languages are a robust class, permitting mul-
tiple equivalent representations such as regular expressions and as formulas in
monadic second-order logic. Recently in [2], we proposed the model of regular
functions: they are the MSO-definable transductions from strings to expression
trees over some pre-defined grammar. The class of functions thus defined de-
pends on the grammar allowed; the simplest is when the underlying domain is
the set of integers Z, and expressions involve constants and binary addition, and
we call the resulting class additive regular functions. Additive regular functions
have appealing closure properties, such as closure under linear combination, in-
put reversal, and regular lookahead, and several analysis problems are efficiently
decidable – such as containment, shortest paths and equivalence checking. The
machine M1 is an example of an Additive Cost Register Automaton (ACRA),
and this class defines exactly the additive regular functions
Observe that the machine M1 has two registers, and it is not immediately clear
how (if it is even possible) to reduce this number. This is the first question that
this paper settles: Given an ACRA M , how do we determine the minimum num-
ber of registers needed by any ACRA to compute the function it defines, M ?
We describe a property called register separation, and show that any equivalent
ACRA needs at least k registers iff the registers of M are k-separable. It turns
Decision Problems for Additive Regular Functions 39
out that the registers of M1 are 2-separable, and hence two registers are neces-
sary. We then go on to show that determining k-separability is pspace-complete.
Determining the register complexity is the natural analogue of the state mini-
mization problem for DFAs [6].
The techniques used to analyse the register complexity allow us to state a re-
sult similar to the pumping lemma for regular languages: The register complexity
of f is at least k iff for some m, we have strings σ0 , . . . , σm , τ1 , . . . , τm , suffixes w1 ,
. . . , wk , k distinct coefficient vectors c1 , . . . , ck ∈ Zm , and values
d1 , . . . , dk ∈ Z
so that for all vectors x ∈ Nm , f (σ0 τ1x1 σ1 τ2x2 . . . σm wi ) = j cij xj + di . Thus,
depending on the suffix wi , at least one of the cycles τ1 , . . . , τk contributes
differently to the final cost.
Finally, we consider ACRAs with turn-based alternation. These are games
where several objective functions are simultaneously computed, but only one of
these objectives will eventually contribute to the output, based on the actions
of both the system and its environment. Alternating ACRAs are thus related
to multi-objective games and Pareto optimization [12], but are a distinct model
because each run evaluates to a single value. We study the reachability prob-
lem in ACRA games: Given a budget k, is there a strategy for the system to
reach an accepting state with cost at most k? We show that this problem is
exptime-complete when the incremental costs assume values from N, and unde-
cidable when the incremental costs are integer-valued.
x := y + 1
a y := y + 1
z := z
x := x + 1 x := x
a x := x b
y := y b y := y + 1
y := y + 1
q0
start x
q0 q1
start x y
x := z + 1
x := x + 1 b y := y
a
y := y z := z + 1
(a) M2 . (b) M3 .
Fig. 2. ACRAs M2 and M3 operate over the input alphabet Σ = {a, b}. Both
implement the function defined as f2 () = 0, and for all σ, f2 (σa) = |σa|a , and
f2 (σb) = |σb|b . Here |σ|a is the number of occurrences of the symbol a in the string σ.
1. For all c ∈ Z, if f1 and f2 are regular functions, then so are f1 + f2 and cf1 .
2. If f is a regular function, then frev defined as frev (σ) = f (σ rev ) is also
regular.
3. If f1 and f2 are regular functions, and L is a regular language, then the func-
tion f defined as f (σ) = if σ ∈ L, then f1 (σ) , else f2 (σ) is also regular.
4. ACRAs are closed under regular lookahead, i.e. even if the machine were al-
lowed to make decisions based on a regular property of the suffix rather than
simply the next input symbol, there would be no increase in expressiveness.
Informally, the registers of M are separable in some state q if their values can
be pushed far apart. For example, consider the registers x and y of M1 in the
state q0 . For any constant c, there is a string σ = C c leading to q0 so that
|val (x, σ) − val (y, σ)| ≥ c. In formalizing this idea, we need to distinguish regis-
ters that are live in a given state, i.e. those that can potentially contribute to the
output. For example, M1 could be augmented with a third register z tracking
the length of the string processed. However, the value of z would be irrelevant
to the computation of f1 . Informally, a register v is live3 in a state q if for some
suffix σ ∈ Σ ∗ , on processing σ starting from q, the initial value of v is what
influences the final output.
Definition 3. Let M = (Q, Σ, V, δ, μ, q0, ν) be an ACRA. The registers of M
are k-separable if there is some state q, and a subset U ⊆ V so that
1. |U | = k, all registers v ∈ U are live in q, and
2. for all c ∈ Z, there is a string σ, such that δ (q0 , σ) = q and for all distinct
u, v ∈ U , |val (u, σ) − val (v, σ)| ≥ c.
The registers of a machine M are not k-separable if at every state q, and sub-
set U of k live registers, there is a constant c such that for all strings σ to q,
|val (u, σ) − val (v, σ)| < c, for some distinct u, v ∈ U . Note that the specific
registers which are close may depend on σ. For example, in the machine M3
from figure 2b, if a string σ ends with an a, then x and y will have the same
value, while if the last symbol was a b, then x and z are guaranteed to be equal.
1. For every register u in the domain or range of , μ (q, τ, u) = (u, cu ), for some
cu ∈ Z, and
2. for some pair of registers x, y, μ (q, τ, x) = (x, c) and μ (q, τ, y) = (y, c ) for
distinct c, c .
Thus, every pair of registers that is already separated is preserved during the
cycle, and some new pair of registers is incremented differently. We call such
strings τ “separation cycles” at q. They allow us to make conclusions of the form:
If separates q, then ∪ {(x, y)} also separates q.
Now consider a string σ ∈ Σ ∗ , such that for some q, q , δ (q, σ) = q . Pick
arbitrary relations , , and assume that whenever u v , and μ (q, σ, u ) =
(u, cu ), μ (q, σ, v ) = (v, cv ), we have u v. We can then conclude that if
separates q, then separates q We call such strings σ “renaming edges” from
(q, ) to (q , ).
We then show that if separates q and is non-empty, then there is a separa-
tion cycle-renaming edge sequence to (q, ) from some strictly smaller separation
(q , ). Thus, separation at each node can be demonstrated by a sequence of sep-
aration cycles with renaming edges in between, and thus we reduce the problem
to that of determining reachability in an exponentially large register separation
graph. Finally, we show that each type of edge can be determined in pspace.
The following theorem is the interpretation of a path through the register sep-
aration graph. Given a regular function f of register complexity at least k, it
Decision Problems for Additive Regular Functions 45
Theorem 5. The optimal strategy θ for an ACRA (N) reachability game G can
be computed in time O |Q| |Σ| 2|V | log c0 |Q| , where c0 is the largest constant ap-
pearing in the description of G.
Note that the optimal strategy in ACRA (N) games need not be memoryless: the
strategy may visit a state again with a different register valuation. However, the
strategy θ constructed in the proof of the above theorem is memoryless given
the pair (q, val) of the current state and register valuation.
We reduce the halting problem for two-counter machines to the problem of solv-
ing an ACRA (Z) reachability game. Informally, we construct a game GM given a
two-counter machine M so that the player has a 0-winning strategy through GM
iff M halts. This strategy encodes the execution of M , and the adversary verifies
that the run is valid. A similar idea is used to show that deciding ACRA (N)
reachability games is exptime-hard. The reduction in that case proceeds from
the halting problem for linearly bounded alternating Turing machines [4]. Given
such a machine M , we construct in polynomial time a game gadget GM where
the only strategy is to encode the runs of the Turing machine.
6 Conclusion
In this paper, we studied two decision problems for additive regular functions:
determining the register complexity, and alternating reachability in ACRAs. The
register complexity of an additive regular function f is the smallest number k
so there is some ACRA implementing f with only k registers. We developed an
abstract characterization of the register complexity as separability and showed
that computing it is pspace-complete. We then studied the reachability prob-
lem in alternating ACRAs, and showed that it is undecidable for ACRA (Z) and
exptime-complete for ACRA (N) games. Future work includes proving similar
characterizations and providing algorithms for register minimization in more
48 R. Alur and M. Raghothaman
References
1. Alur, R., D’Antoni, L.: Streaming tree transducers. In: Czumaj, A., Mehlhorn, K.,
Pitts, A., Wattenhofer, R. (eds.) ICALP 2012, Part II. LNCS, vol. 7392, pp. 42–53.
Springer, Heidelberg (2012)
2. Alur, R., D’Antoni, L., Deshmukh, J.V., Raghothaman, M., Yuan, Y.: Regular
functions and cost register automata. To Appear in the 28th Annual Symposium
on Logic in Computer Science (2013), Full version available at
http://www.cis.upenn.edu/~alur/rca12.pdf
3. Bojanczyk, M., Klin, B., Lasota, S.: Automata with group actions. In: 26th Annual
Symposium on Logic in Computer Science, pp. 355–364 (2011)
4. Chandra, A., Kozen, D., Stockmeyer, L.: Alternation. Journal of the ACM 28(1),
114–133 (1981)
5. Chatterjee, K., Doyen, L., Henzinger, T.A.: Quantitative Languages. In: Kaminski,
M., Martini, S. (eds.) CSL 2008. LNCS, vol. 5213, pp. 385–400. Springer, Heidelberg
(2008)
6. Hopcroft, J., Motwani, R., Ullman, J.: Introduction to Automata Theory, Lan-
guages, and Computation, 3rd edn. Prentice Hall (2006)
7. Kaminski, M., Francez, N.: Finite-memory automata. Theoretical Computer Sci-
ence 134(2), 329–363 (1994)
8. Kozen, D.: Lower bounds for natural proof systems. In: 18th Annual Symposium
on Foundations of Computer Science, pp. 254–266 (October 31-November 2, 1977)
9. Markey, N.: Weighted automata: Model checking and games. Lecture Notes (2008),
http://www.lsv.ens-cachan.fr/ markey/Teaching/MPRI/2008-2009/
MPRI-2.8b-4.pdf
10. Mohri, M.: Minimization algorithms for sequential transducers. Theoretical Com-
puter Science 234, 177–201 (2000)
11. Mohri, M.: Weighted automata algorithms. In: Droste, M., Kuich, W., Vogler, H.
(eds.) Handbook of Weighted Automata. Monographs in Theoretical Computer
Science, pp. 213–254. Springer (2009)
12. Papadimitriou, C., Yannakakis, M.: Multiobjective query optimization. In: Pro-
ceedings of the 20th Symposium on Principles of Database Systems, PODS 2001,
pp. 52–59. ACM (2001)
Beyond Differential Privacy: Composition Theorems
and Relational Logic for f -divergences
between Probabilistic Programs
1 Introduction
Differential privacy [12] is a policy that provides strong privacy guarantees in private
data analysis: informally, a randomized computation over a database D is differentially
private if the private data of individuals contributing to D is protected against arbitrary
adversaries with query access to D. Formally, let ≥ 0 and 0 ≤ δ ≤ 1: a randomized
algorithm c is (, δ)-differentially private if its output distributions for any two neigh-
bouring inputs x and y are (e , δ)-close, i.e. for every event E:
Pr c(x)E ≤ e Pr c(y)E + δ
where Pr c(x)E denotes the probability of event E in the distribution obtained by run-
ning c on input x. One key property of differential privacy is the existence of sequential
and parallel composition theorems, which allows building differentially private compu-
tations from smaller blocks. In this paper, we focus on the first theorem, which states
that the sequential composition of an (1 , δ1 )-differentially private algorithm with an
(2 , δ2 )-differentially private one yields an (1 + 2 , δ1 + δ2 )-differentially private al-
gorithm.
f -divergences [2,10] are convex functions that can be used to measure the distance be-
tween two distributions. The class of f -divergences includes many well-known notions
of distance, such as statistical distance, Kullback-Leibler divergence (relative entropy),
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 49–60, 2013.
c Springer-Verlag Berlin Heidelberg 2013
50 G. Barthe and F. Olmedo
or Hellinger distance. Over the years, f -divergences have found multiple applications
in information theory, signal processing, pattern recognition, machine learning, and se-
curity. The practical motivation for this work is a recent application of f -divergences
to cryptography: in [24], Steinberger uses Hellinger distance to improve the security
analysis of key-alternating ciphers, a family of encryption schemes that encompasses
the Advanced Encryption Standard AES.
c1 ∼α,δ c2 : Ψ ⇒ Φ
Problem Statement and Contributions. The goal of this paper is to lay the theoreti-
cal foundations for tool-supported reasoning about f -divergences between probabilistic
computations. To achieve this goal, we start from [6] and take the following steps:
1. as a preliminary observation, we prove that the notion of α-distance used to char-
acterize differential privacy is in fact an f -divergence;
2. we define a notion of composability of f -divergences and generalize the sequential
composition theorem of differential privacy to composable divergences;
3. we generalize the notion of lifting used in apRHL to composable f -divergences;
4. we define f pRHL, a probabilistic relational Hoare logic for f -divergences, and
prove its soundness.
Related Work. The problem of computing the distance between two probabilistic com-
putations has been addressed in different areas of computer science, including machine
learning, stochastic systems, and security. We briefly point to some recent develop-
ments.
Methods for computing the distance between probabilistic automata have been stud-
ied by Cortes and co-authors [8,9]; their work, which is motivated by machine-learning
applications, considers the Kullback-Leibler divergence as well as the Lp distance.
Approximate bisimulation for probabilistic automata has been studied, among oth-
ers, by Segala and Turrini [23] and by Tracol, Desharnais and Zhioua [25]. The sur-
vey [1] provides a more extensive account of the field.
Composition Theorems and Relational Logic for f -divergences 51
2 Mathematical Preliminaries
2.2 f -divergences
uous at 0 and f (1) = 0. Then each function in F induces a notion of distance between
probability distributions as follows:
Definition 1 (f -divergence). Given f ∈ F , the f -divergence Δf (μ1 , μ2 ) between two
distributions μ1 and μ2 in D(A) is defined as:
def μ1 (a)
Δf (μ1 , μ2 ) = μ2 (a)f
μ2 (a)
a∈A
The definition adopts the following conventions, which are used consistently throughout
the paper:
When defining f -divergences one usually allows f to take positive as well as negative
values in R. For technical reasons, however, we consider only non-negative functions.
We now show that we can adopt this restriction without loss of generality.
Proposition 1. Let F be defined as F , except that we allow f ∈ F to take negative
values. Then for every f ∈ F there exists g ∈ F given by g(t) = f (t) − f−
(1)(t − 1),
such that Δf = Δg . (Here f− denotes the left derivative of f , whose existence can be
guaranteed from the convexity of f .).
The class of f -divergences includes several popular instances; these include statistical
distance, relative entropy (also known as Kullback-Leibler divergence), and Hellinger
distance. In Figure 1 we summarize the convex function used to define each of them
and we also include a simplified form, useful to compute the divergence. (In case of
negative functions, we previously apply the transformation mentioned in Proposition 1,
so that we are consistent with our definition of f -divergences.)
In general, Δf does not define a metric. The symmetry axiom might be violated and
the triangle inequality holds only if f equals a non-negative multiple of the statistical
distance. The identity of indiscernibles does not hold in general, either.
1
Rigorously speaking, the function used for defining the Kullback-Leibler divergence should
be given by f (t) = t ln(t) + t − 1 if t > 0 and f (t) = 1 if t = 0 to guarantee its continuity
at 0.
Composition Theorems and Relational Logic for f -divergences 53
3.2 Composition
One key property of f -divergences is a monotonicity result referred to as the data pro-
cessing inequality [18]. In our setting, it is captured by the following proposition:
Proposition 3. Let μ1 ,μ2 ∈ D(A), M : A → D(B) and f ∈ F . Then
Δf (bind μ1 M, bind μ2 M ) ≤ Δf (μ1 , μ2 )
In comparison, the sequential composition theorem for differential privacy [16] is cap-
tured by the following theorem.
Theorem 1. Let μ1 ,μ2 ∈ D(A), M1 , M2 : A → D(B) and α, α ≥ 1. Then
Δαα (bind μ1 M1 , bind μ2 M2 ) ≤ Δα (μ1 , μ2 ) + max Δα (M1 (a), M2 (a))
a
Note that the data processing inequality for α-distance corresponds to the composition
theorem for the degenerate case where M1 and M2 are equal. The goal of this paragraph
is to generalize the sequential composition theorem to f -divergences. To this end, we
first define a notion of composability between f -divergences.
Definition 2 (f -divergence composability). Let f1 , f2 , f3 ∈ F . We say that (f1 , f2 )
is f3 -composable iff for all μ1 , μ2 ∈ D(A) and M1 , M2 : A → D(B), there exists
μ3 ∈ D(A) such that
The f -divergences from Figure 1 present good behaviour under composition. The statis-
tical distance, Hellinger distance and the Kullback-Leibler divergence are composable
w.r.t. themselves. Moreover, α-divergences are composable.
Proposition 5
• (SD, SD) is SD-composable;
• (KL, KL) is KL-composable;
• (HD, HD) is HD-composable;
• (ADα1 , ADα2 ) is ADα1 α2 -composable for every α1 , α2 ≥ 1.
The sequential composition theorem of differential privacy extends naturally to the class
of composable divergences.
Theorem 2. Let f1 , f2 , f3 ∈ F . If (f1 , f2 ) is f3 -composable, then for all μ1, μ2 ∈ D(A)
and all M1 , M2 : A → D(B),
Δf3 (bind μ1 M1 , bind μ2 M2 ) ≤ Δf1 (μ1 , μ2 ) + max Δf2 (M1 (a), M2 (a))
a
Theorem 2 will be the cornerstone for deriving the sequential composition rule of
f pRHL. (As an intermediate step, we first show that the composition result extends
to relation liftings.)
4 Lifting
The definition of valid apRHL judgment rests on the notion of lifting. As a last step
before defining our relational logic, we extend the notion of lifting to f -divergences.
One key difference between our definition and that of [6] is that the former uses two
witnesses, rather than one. In the remainder, we let supp (μ) denote the set of elements
a ∈ A such that μ(a) > 0. Moreover,
given μ ∈ D(A × B),we define π1 (μ) and π2 (μ)
by the clauses π1 (μ)(a) = b∈B μ(a, b) and π2 (μ)(b) = a∈A μ(a, b).
f,δ
Definition 4 (Lifting). Let f ∈ F and δ ∈ R+ 0 . Then (f, δ)-lifting ∼R of a relation
R ⊆ A × B is defined as follows: given μ1 ∈ D(A) and μ2 ∈ D(B), μ1 ∼f,δ R μ2
iff there exist μL , μR ∈ D(A × B) such that: i) supp (μL ) ⊆ R; ii) supp (μR ) ⊆ R;
iii) π1 (μL ) = μ1 ; iv) π2 (μR ) = μ2 and v) Δf (μL , μR ) ≤ δ. The distributions μL and
μR are called the left and right witnesses for the lifting, respectively.
A pleasing consequence of our definition is that the witnesses for relating two distribu-
tions are themselves distributions, rather than sub-distributions; this is in contrast with
our earlier definition from [6], where witnesses for the equality relation are necessarily
sub-distributions. Moreover, our definition is logically equivalent to the original one
from [15], provided δ = 0, and f satisfies the identity of indiscernibles. In the case
of statistical distance and α-distance, our definition also has a precise mathematical
relationship with (an asymmetric variant of) the lifting used in [6].
Composition Theorems and Relational Logic for f -divergences 55
μ1 ∼f,δ
R μ2 ⇐⇒ Δf (μ1 /R, μ2 /R) ≤ δ,
def
where μ/R is a distribution over the quotient set A/R, defined as (μ/R)([a]) = μ([a]).
In particular, if R is the equality relation ≡, we have
μ1 ∼f,δ
≡ μ2 ⇐⇒ Δf (μ1 , μ2 ) ≤ δ
Our next result allows deriving probability claims from lifting judgments. Given
R ⊆ A × B we say that the subsets A0 ⊆ A and B0 ⊆ B are R-equivalent, and
write A0 =R B0 , iff for every a ∈ A and b ∈ B, a R b implies a ∈ A0 ⇐⇒ b ∈ B0 .
Proposition 8 (Fundamental property of lifting). Let μ1 ∈ D(A), μ2 ∈ D(B), and
R ⊆ A × B. Then, for any two events A0 ⊆ A and B0 ⊆ B,
f,δ μ1 (A0 )
μ1 ∼R μ2 ∧ A0 =R B0 =⇒ μ2 (B0 ) f ≤δ
μ2 (B0 )
Our final result generalizes the sequential composition theorem from the previous sec-
tion to arbitrary liftings.
Proposition 9 (Lifting composition). Let f1 , f2 , f3 ∈ F such that (f1 , f2 ) is f3 -
composable. Moreover let μ1 ∈ D(A), μ2 ∈ D(B), M1 : A → D(A ) and
M2 : B → D(B ). If μ1 ∼fR11,δ1 μ2 and M1 (a) ∼fR22,δ2 M2 (b) for all a and b such
that a R b, then
(bind μ1 M1 ) ∼fR32,δ1 +δ2 (bind μ2 M2 )
skip m = unit m
c; c m = bind (c m) c
x ← e m = unit (m {eE m/x})
x ← μ m
$ = bind (μDE m) (λv. unit (m {v/x}))
if e then c1 else c2 m = if (eE m = true) then (c1 m) else (c2 m)
while e do c m = λf. supn∈N ([while e do c]n m f )
[while e do c]0 = if (eE m = true) then (unit m) else μ0
where
[while e do c]n+1 = if e then c; [while e do c]n
5.2 Judgments
f pRHL judgments are of the form c1 ∼f,δ c2 : Ψ ⇒ Φ, where c1 and c2 are programs,
Ψ and Φ are relational assertions, f ∈ F and δ ∈ R+ 0 . Relational assertions are first-
order formulae over generalized expressions, i.e. expressions in which variables are
tagged with a 1 or 2. Relational expressions are interpreted as formulae over pairs
of memories, and the tag on a variable is used to indicate whether its interpretation
Composition Theorems and Relational Logic for f -divergences 57
should be taken in the first or second memory. For instance, the relational assertion
x1 = x2 states that the values of x coincide in the first and second memories. More
generally, we use ≡ to denote the relational assertion that states that the values of all
variables coincide in the first and second memories.
An f pRHL judgment is valid iff for every pair of memories related by the pre-
condition Ψ , the corresponding pair of output distributions is related by the (f, δ)-lifting
of the post-condition Φ.
Definition 5 (Validity in f pRHL). A judgment c1 ∼f,δ c2 : Ψ ⇒ Φ is valid, written
|= c1 ∼f,δ c2 : Ψ ⇒ Φ, iff
m1 Ψ m2 =⇒ Δf (c1 m1 , c2 m2 ) ≤ δ
Finally, we can use judgments with arbitrary post-condictions to relate the probabili-
ties of single events in two programs. This is used, e.g. in the context of game-based
cryptographic proofs.
Proposition 12. If |= c1 ∼f,δ c2 : Ψ ⇒ Φ, then for all memories m1 , m2 and events
E1 , E2 ,
(c1 m1 )(E1 )
m1 Ψ m2 ∧ E1 =Φ E2 =⇒ (c2 m2 )(E2 ) f ≤δ
(c2 m2 )(E2 )
Ψ =⇒ b1 ≡ b 2
c1 ∼f,δ c1 : Ψ ∧ b1 ⇒ Φ c2 ∼f,δ c2 : Ψ ∧ ¬b1 ⇒ Φ
[cond]
if b then c1 else c2 ∼f,δ if b then c1 else c2 : Ψ ⇒ Φ
(f1 , f2 ) is f3 -composable
c1 ∼f1 ,δ1 c2 : Ψ ⇒ Φ c1 ∼f2 ,δ2 c2 : Φ ⇒ Φ
[skip] [seq]
skip ∼f,0 skip : Ψ ⇒ Ψ c1 ; c1 ∼f3 ,δ1 +δ2 c2 ; c2 : Ψ ⇒ Φ
c1 ∼f,δ c2 : Ψ ∧ Θ ⇒ Φ c1 ∼f ,δ c2 : Ψ ⇒ Φ
c1 ∼f,δ c2 : Ψ ∧ ¬Θ ⇒ Φ Ψ ⇒ Ψ Φ ⇒ Φ f ≤ f δ ≤ δ
[case] [weak]
c1 ∼f,δ c2 : Ψ ⇒ Φ c1 ∼f,δ c2 : Ψ ⇒ Φ
We briefly describe some main rules, and refer the reader to [6] for a longer descrip-
tion about each of them. Rule [seq] relates two sequential compositions and is a direct
consequence from the lifting composition (see Proposition 9). Rule [while] relates two
loops that terminate in lockstep. The bound depends on the maximal number of itera-
tions of the loops, and we assume given a loop variant e that decreases at each iteration,
and is initially upper bounded by some constant n. We briefly explain the side condi-
tions: (f1 , . . . , fn ) is composable iff (fi , f1 ) is fi+1 -composable for every 1 ≤ i < n.
Moreover, (f1 , . . . , fn ) is monotonic iff fi ≤ fi+1 for 1 ≤ i < n. Note that the rule is
given for n ≥ 2; specialized rules exist for n = 0 and n = 1. This rule readily special-
izes to reason about (, δ)-differential privacy by taking fi = ADαi , where α = e .
If an f pRHL judgment is derivable using the rules of Figure 3, then it is valid. For-
mally,
Proposition 13 (Soundness). If c1 ∼f,δ c2 : Ψ ⇒ Φ then |= c1 ∼f,δ c2 : Ψ ⇒ Φ.
One can also define a symmetric version of the logic by adding as an additional clause
in the definition of the lift relation that Δf (μR , μL ) ≤ δ. An instance of this logic is the
symmetric apRHL logic from [6]. All rules remain unchanged, except for the random
Composition Theorems and Relational Logic for f -divergences 59
sampling rule that now requires the additional inequality to be checked in the premise of
the rule.
6 Conclusion
This paper makes two contributions: first, it unveils a connection between differen-
tial privacy and f -divergences. Second, it lays the foundations for reasoning about
f -divergences between randomized computations. As future work, we intend to im-
plement support for f pRHL in EasyCrypt [4], and formalize the results from [24].
We also intend to investigate the connection between our notion of lifting and flow
networks.
Acknowledgments. This work was partially funded by the European Projects FP7-
256980 NESSoS and FP7-229599 AMAROUT, Spanish project TIN2009-14599
DESAFIOS 10 and Madrid Regional project S2009TIC-1465 PROMETIDOS.
References
1. Abate, A.: Approximation metrics based on probabilistic bisimulations for general state-
space markov processes: a survey. Electronic Notes in Theoretical Computer Sciences (2012)
(in print)
2. Ali, S.M., Silvey, S.D.: A general class of coefficients of divergence of one distribution from
another. Journal of the Royal Statistical Society. Series B (Methodological) 28(1), 131–142
(1966)
3. Alvim, M.S., Andrés, M.E., Chatzikokolakis, K., Palamidessi, C.: On the relation between
differential privacy and Quantitative Information Flow. In: Aceto, L., Henzinger, M., Sgall,
J. (eds.) ICALP 2011, Part II. LNCS, vol. 6756, pp. 60–76. Springer, Heidelberg (2011)
4. Barthe, G., Grégoire, B., Heraud, S., Béguelin, S.Z.: Computer-aided security proofs for the
working cryptographer. In: Rogaway, P. (ed.) CRYPTO 2011. LNCS, vol. 6841, pp. 71–90.
Springer, Heidelberg (2011)
5. Barthe, G., Grégoire, B., Zanella-Béguelin, S.: Formal certification of code-based crypto-
graphic proofs. In: 36th ACM SIGPLAN-SIGACT Symposium on Principles of Program-
ming Languages, POPL 2009, pp. 90–101. ACM, New York (2009)
6. Barthe, G., Köpf, B., Olmedo, F., Zanella-Béguelin, S.: Probabilistic relational reasoning for
differential privacy. In: 39th ACM SIGPLAN-SIGACT Symposium on Principles of Pro-
gramming Languages, POPL 2012, pp. 97–110. ACM, New York (2012)
7. Chaudhuri, S., Gulwani, S., Lublinerman, R., Navidpour, S.: Proving programs robust. In:
19th ACM SIGSOFT Symposium on the Foundations of Software Engineering and 13rd
European Software Engineering Conference, ESEC/FSE 2011, pp. 102–112. ACM, New
York (2011)
8. Cortes, C., Mohri, M., Rastogi, A.: Lp distance and equivalence of probabilistic automata.
Int. J. Found. Comput. Sci. 18(4), 761–779 (2007)
9. Cortes, C., Mohri, M., Rastogi, A., Riley, M.: On the computation of the relative entropy of
probabilistic automata. Int. J. Found. Comput. Sci. 19(1), 219–242 (2008)
10. Csiszár, I.: Eine informationstheoretische ungleichung und ihre anwendung auf den beweis
der ergodizitat von markoffschen ketten. Publications of the Mathematical Institute of the
Hungarian Academy of Science 8, 85–108 (1963)
60 G. Barthe and F. Olmedo
11. Deng, Y., Du, W.: Logical, metric, and algorithmic characterisations of probabilistic bisimu-
lation. Tech. Rep. CMU-CS-11-110, Carnegie Mellon University (March 2011)
12. Dwork, C.: Differential privacy. In: Bugliesi, M., Preneel, B., Sassone, V., Wegener, I. (eds.)
ICALP 2006. LNCS, vol. 4052, pp. 1–12. Springer, Heidelberg (2006)
13. Ebanks, B., Sahoo, P., Sander, W.: Characterizations of Information Measures. World Scien-
tific (1998)
14. Gaboardi, M., Haeberlen, A., Hsu, J., Narayan, A., Pierce, B.C.: Linear dependent types for
differential privacy. In: 40th ACM SIGPLAN–SIGACT Symposium on Principles of Pro-
gramming Languages, POPL 2013, pp. 357–370. ACM, New York (2013)
15. Jonsson, B., Yi, W., Larsen, K.G.: Probabilistic extensions of process algebras. In: Bergstra,
J., Ponse, A., Smolka, S. (eds.) Handbook of Process Algebra, pp. 685–710. Elsevier, Ams-
terdam (2001)
16. McSherry, F.: Privacy integrated queries: an extensible platform for privacy-preserving data
analysis. Commun. ACM 53(9), 89–97 (2010)
17. McSherry, F.D.: Privacy integrated queries: an extensible platform for privacy-preserving
data analysis. In: 35th SIGMOD International Conference on Management of Data, SIG-
MOD 2009, pp. 19–30. ACM, New York (2009)
18. Pardo, M., Vajda, I.: About distances of discrete distributions satisfying the data processing
theorem of information theory. IEEE Transactions on Information Theory 43(4), 1288–1293
(1997)
19. Pierce, B.C.: Differential privacy in the programming languages community. Invited Tutorial
at DIMACS Workshop on Recent Work on Differential Privacy Across Computer Science
(2012)
20. Di Pierro, A., Hankin, C., Wiklicky, H.: Measuring the confinement of probabilistic systems.
Theor. Comput. Sci. 340(1), 3–56 (2005)
21. Reed, J., Pierce, B.C.: Distance makes the types grow stronger: a calculus for differential pri-
vacy. In: 15th ACM SIGPLAN International Conference on Functional programming, ICFP
2010, pp. 157–168. ACM, New York (2010)
22. Roy, I., Setty, S.T.V., Kilzer, A., Shmatikov, V., Witchel, E.: Airavat: security and privacy for
MapReduce. In: 7th USENIX Conference on Networked Systems Design and Implementa-
tion, NSDI 2010, pp. 297–312. USENIX Association, Berkeley (2010)
23. Segala, R., Turrini, A.: Approximated computationally bounded simulation relations for
probabilistic automata. In: 20th IEEE Computer Security Foundations Symposium, CSF
2007, pp. 140–156. IEEE Computer Society (2007)
24. Steinberger, J.: Improved security bounds for key-alternating ciphers via hellinger distance.
Cryptology ePrint Archive, Report 2012/481 (2012), http://eprint.iacr.org/
25. Tracol, M., Desharnais, J., Zhioua, A.: Computing distances between probabilistic automata.
In: Proceedings of QAPL. EPTCS, vol. 57, pp. 148–162 (2011)
A Maximal Entropy Stochastic Process
for a Timed Automaton,
Nicolas Basset1,2
1
LIGM, University Paris-Est Marne-la-Vallée and CNRS, France
2
LIAFA, University Paris Diderot and CNRS, France
[email protected]
1 Introduction
Timed automata (TA) were introduced in the early 90’s by Alur and Dill [4] and
then extensively studied, to model and verify the behaviours of real-time systems.
In this context of verification, several probability settings have been added to
TA (see references below). There are several reasons to add probabilities: this
permits (i) to reflect in a better way physical systems which behave randomly,
(ii) to reduce the size of the model by pruning the behaviors of null probability
[8], (iii) to resolve undeterminism when dealing with parallel composition [15,16].
In most of previous works on the subject (see e.g. [10,2,11,15]), probability
distributions on continuous and discrete transitions are given at the same time as
the timed settings. In these works, the choice of the probability functions is left
to the designer of the model. Whereas, she or he may want to provide only the
TA and ask the following question: what is the “best” choice of the probability
functions according to the TA given? Such a “best” choice must transform the
An extended version of the present paper containing detailed proofs and examples
is available on-line http://hal.archives-ouvertes.fr/hal-00808909.
The support of Agence Nationale de la Recherche under the project EQINOCS
(ANR-11-BS02-004) is gratefully acknowledged.
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 61–73, 2013.
c Springer-Verlag Berlin Heidelberg 2013
62 N. Basset
TA into a random generator of runs the least biased as possible, i.e it should
generate the runs as uniformly as possible to cover with high probability the
maximum of behaviours of the modeled system. More precisely the probability
for a generated run to fall in a set should be proportional to the size (volume) of
this set (see [16] for a same requirement in the context of job-shop scheduling).
We formalize this question and propose an answer based on the notion of entropy
of TA introduced in [6].
The theory developed by Shannon [21] and his followers permits to solve
the analogous problem of quasi-uniform path generation in a finite graph. This
problem can be formulated as follows: given a finite graph G, how can one find
a stationary Markov chain on G which allows one to generate the paths in the
most uniform manner? The answer is in two steps (see Chapter 1.8 of [19] and
also section 13.3 of [18]): (i) There exists a stationary Markov chain on G with
maximal entropy, the so called Shannon-Parry Markov chain; (ii) This stationary
Markov chain allows to generate paths quasi uniformly.
In this article we lift this theory to the timed automata setting. We work with
timed region graphs which are to timed automata what finite directed graphs
are to finite state automata i.e. automata without labeling on edges and without
initial and final states. We define stochastic processes over runs of timed region
graphs (SPOR) and their (continuous) entropy. This generalization of Markov
chains for TA has its own interest, it is up to our knowledge the first one which
provides a continuous probability distribution on starting states. Such a SPOR
permits to generate step by step random runs. As a main result we describe a
maximal entropy SPOR which is stationary and ergodic and which generalizes
the Shannon-Parry Markov chain to TA (Theorem 1). Concepts of maximal
entropy, stationarity and ergodicity can be interesting by themselves, here we
use them as the key hypotheses to ensure a quasi uniform sampling (Theorem
2). More precisely the result we prove is a variant of the so called Shannon-
McMillan-Breiman theorem also known as asymptotic equipartition property
(AEP).
Potential Applications. There are two kind of probabilistic model checking:
(i) the almost sure model checking aiming to decide if a model satisfies a for-
mula with probability one (e.g. [13,3]); (ii) the quantitative (probabilistic) model
checking (e.g. [11,15]) aiming to compare the probability of a formula to be sat-
isfied with some given threshold or to estimate directly this probability.
A first expected application of our results would be a “proportional” model
checking. The inputs of the problem are: a timed region graph G, a formula
ϕ, a threshold θ ∈ [0, 1]. The question is whether the proportion of runs of G
which satisfy ϕ is greater than θ or not. A recipe to address this problem would
be as follows: (i) take as a probabilistic model M the timed region graph G
together with the maximum entropy SPOR Y ∗ defined in our main theorem;
(ii) run a quantitative (probabilistic) model checking algorithm on the inputs
M, ϕ, θ (the output of the algorithm is yes or no whether M satisfies ϕ with a
probability greater than θ or not) (iii) use the same output for the proportional
model checking problem.
A Maximal Entropy Stochastic Process for a Timed Automaton 63
In this section we define a timed region graph which is the underlying structure
of a timed automaton [4]. For technical reasons we consider only timed region
graphs with bounded clocks. We will justify this assumption in section 3.1.
64 N. Basset
Timed Region Graphs. Let X be a finite set of variables called clocks. Clocks
have non-negative values bounded by a constant M . A rectangular constraint
has the form x ∼ c where ∼∈ {≤, <, =, >, ≥}, x ∈ X, c ∈ N. A diagonal
constraint has the form x − y ∼ c where x, y ∈ X. A guard is a finite conjunction
of rectangular constraints. A zone is a set of clock vectors x ∈ [0, M ]X satisfying
a finite conjunction of rectangular and diagonal constraints. A region is a zone
which is minimal for inclusion (e.g. the set of points (x1 , x2 , x3 , x4 ) which satisfy
the constraints 0 = x2 < x3 − 4 = x4 − 3 < x1 − 2 < 1). Regions of [0, 1]2 are
depicted in Fig 1.
As we work by analogy with finite graphs, we introduce timed region graphs
which are roughly timed automata without labels on transitions and without
initial and final states. Moreover we consider a state space decomposed in regions.
Such a decomposition in regions are quite standard for timed automata and does
not affect their behaviours (see e.g. [11,6]).
A timed region graph is a tuple (X, Q, S, Δ) such that
– X is a finite set of clocks.
– Q is a finite set of locations.
– S is the set of states which are couples of a location and a clock vector
(S ⊆ Q × [0, M ]X ). It admits a region decomposition S = ∪q∈Q {q} × rq
where for each q ∈ Q, rq is a region.
– Δ is a finite set of transitions. Any transition δ ∈ Δ goes from a starting
location δ − ∈ Q to an ending location δ + ∈ Q; it has a set r(δ) of clocks to
reset when firing δ and a fleshy guard g(δ) to satisfy to fire it. Moreover, the
set of clock vectors that satisfy g(δ) is projected on the region rδ+ when the
clocks in r(δ) are resets.
y
δ 1 , 0 < x < 1, {y} δ 4 , 0 < y < 1, {x}
1
Fig. 1. The running example. Right: G ex1 ; left: Its state space (in gray).
respectively. Successor action is defined by [p, (x, 0)] (t, δ 1 ) = [p, (x + t, 0)] and
[p, (x, 0)] (t, δ 2 ) = [q, (0, t)] if x + t < 1; [q, (0, y)] (t, δ 3 ) = [p, (t, 0)] and
[q, (0, y)] (t, δ 4 ) = [q, (0, y + t)] if y + t < 1. An example of run of G ex1 is
(p, (0.5, 0))(0.4, δ 1 )(p, (0.9, 0))(0.8, δ 2 )(q, (0, 0.8))(0.1, δ 3 )(p, (0.1, 0)).
Integrating over States and Runs; Volume of Runs. It is well known (see
[4]) that a region is uniquely described by the integer parts of clocks and by an
order on their fractional parts, e.g. in the region rex given by the constraints
0 = x2 < x3 − 4 = x4 − 3 < x1 − 2 < 1, the integer parts are x1 = 2, x2 =
0, x3 = 4, x4 = 3 and fractional parts are ordered as follows 0 = {x2 } <
{x3 } = {x4 } < {x1 } < 1. We denote by γ1 < γ2 < · · · < γd the fractional
parts different from 0 of clocks of a region rq (d is called the dimension of the
region). In our example the dimension of rex is 2 and (γ1 , γ2 ) = (x3 − 4, x1 − 2).
We denote by Γq the simplex Γq = {γ ∈ Rd | 0 < γ1 < γ2 < · · · < γd < 1}.
The mapping φr : x !→ γ is a natural bijection from the d dimensional region
r ⊂ R|X| to Γq ⊂ Rd . In the example the pre-image of a vector (γ1 , γ2 ) is
(γ2 + 2, 0, γ1 + 4, γ1 + 3).
Example 2 (Continuing example 1). The region rp = {(x, y) | 0 = y < x < 1} is
1-dimensional, φrp (x, y) = x and φ−1
rp (γ) = (γ, 0).
Now, we introduce simplified notation for sums of integrals over states, transi-
tions and runs. We define the integral of an integrable1 function f : S → R (over
states):
f (s)ds = f (q, φ−1
rq (γ))dγ.
S q∈Q Γq
where .dγ is the usual integral (w.r.t. the Lebesgue measure). We define the
integral of an integrable function f : A → R (over timed transitions):
f (α)dα = f (t, δ)dt
A δ∈Δ [0,M]
1
A function f : S → R is integrable if for each q ∈ Q the function γ → f (q, φ−1
rq (γ))
is Lebesgue integrable. A function f : A → R is integrable if for each δ ∈ Δ the
function t → f (t, δ) is Lebesgue integrable.
66 N. Basset
To summarize, we take finite sums over finite discrete sets Q, Δ and take integrals
over dense sets Γq , [0, M ]. More precisely, all the integrals we define have their
corresponding measures2 which are products of counting measures on discrete
sets Σ, Q and Lebesgue measure over subsets of Rm for some m ≥ 0 (e.g. Γq ,
[0, M ]). We denote by B(S) (resp. B(A)) the set of measurable subsets of S
(resp. A).
The volume of the set of n-length runs is defined by:
Vol(Rn ) = 1d[s, α] = 1sα=⊥ dαds
Rn S An
Remark 1. The use of reduced version of runs is crucial when dealing with in-
tegrals (and densities in the following). Indeed the following integral on the
extended version of runs is
always
null since variables are linked (si+1 = si αi
for i = 0..n − 2): A S . . . A S 1s0 α0 ···sn−1 αn−1 ∈Rn ds0 dα0 . . . dsn−1 dαn−1 = 0.
C.1) For all n ∈ N, Sn : (Ω, F , P ) → (S, B(S)) and An : (Ω, F , P ) → (A, B(A)).
C.2) The initial state S0 has a probability density
function (PDF) p0 : S → R+
i.e. for every S ∈ B(S), P (S0 ∈ S) = s∈S p0 (s)ds (in particular P (S0 ∈
S) = s∈S p0 (s)ds = 1).
C.3) Probability on every timed transition only depends on the current state:
for every n ∈ N, A ∈ B(A), for almost every3 s ∈ S, y0 · · · yn ∈ (S × A)n ,
where for each j = 1..n − 1 the state updates are defined by sj = sj−1 αj−1 .
The SPOR (Yn )n∈N is called stationary whenever for all i, n ∈ N, Yi · · · Yi+n−1
has the same PDF as Y0 · · · Yn−1 which is pn .
2.3 Entropy
In this sub-section, we define entropy for timed region graphs and SPOR. The
first one is inspired by [6] and the second one by [21].
Entropy of a SPOR
Proposition-Definition 2. If Y is a stationary SPOR, then
1
− pn [s, α] log2 pn [s, α]d[s, α] →n→∞ − p0 (s) p(α|s) log2 p(α|s)dαds.
n Rn S A
v(s α)
p∗0 (s) = w(s)v(s); p∗ (α|s) = . (1)
ρv(s)
This theorem applied to the maximal entropy SPOR Y ∗ means that long runs
have a high probability to have a quasi uniform density:
∗
p∗n [s0 , α0 · · · αn ] ≈ 2−nH(Y )
≈ 1/Vol(Rn ) (since H(Y ∗ ) = H(G)).
The maximal entropy SPOR is a lifting to the timed setting of the Shannon-
Parry Markov chain of a finite strongly connected graph. The definition of this
chain is based on the Perron-Frobenius theory applied to the adjacency matrix
M of the graph. This theory ensures that there exists both a positive eigenvector
v of M for the spectral radius4 ρ (i.e. M v = ρv) and a positive eigenvector w
of the transposed matrix M for ρ (i.e. M w = ρw). The initial probability
distribution on the states Q of the Markov chain is given by pi = vi wi for
i ∈ Q and the transition probability matrix P is given by Pij = vj Mij /(ρvi )
for i, j ∈ Q. The timed analogue of M is the operator Ψ introduced in [6]. To
4
Recall from linear algebra (resp. spectral theory) that the spectrum of a matrix (resp.
of an operator) Ψ is the set {λ ∈ C s.t. Ψ −λId is not invertible.}. The spectral radius
ρ of Ψ is the radius of the smallest disc centered in 0 which contains all the spectrum.
70 N. Basset
define ρ,v and w, we will use the theory of positive linear operators (see e.g. [17])
instead of the Perron-Frobenius theory used in the discrete case.
The operator Ψ of a timed region graph is defined by:
∀f ∈ L2 (S), ∀s ∈ S, Ψ f (s) = f (s α)dα (with f (⊥) = 0), (2)
A
After some calculus we obtain that ρ = 1/ ln(2); vp (γ) = vq (γ) = C2−γ ; wp (γ) =
wq (γ) = C 2γ with C and C two positive constants.
Finally the maximal entropy SPOR for G ex1 is given by:
1
p∗0 (p, (γ, 0)) = p∗0 (q, (0, γ)) = for γ ∈ (0, 1);
2
2−t
p∗ (t, δ 1 |p, (γ, 0)) = p∗ (t, δ 4 |q, (0, γ)) = for γ ∈ (0, 1), t ∈ (0, 1);
ρ
2γ−t
p∗ (t, δ 2 |p, (γ, 0)) = p∗ (t, δ 3 |q, (0, γ)) = for γ ∈ (0, 1), t ∈ (0, 1).
ρ
References
1. Algoet, P.H., Cover, T.M.: A sandwich proof of the Shannon-McMillan-Breiman
theorem. The Annals of Probability 16(2), 899–909 (1988)
2. Alur, R., Bernadsky, M.: Bounded model checking for GSMP models of stochas-
tic real-time systems. In: Hespanha, J.P., Tiwari, A. (eds.) HSCC 2006. LNCS,
vol. 3927, pp. 19–33. Springer, Heidelberg (2006)
3. Alur, R., Courcoubetis, C., Dill, D.L.: Model-checking for probabilistic real-time
systems. In: Leach Albert, J., Monien, B., Rodrı́guez-Artalejo, M. (eds.) ICALP
1991. LNCS, vol. 510, Springer, Heidelberg (1991)
4. Alur, R., Dill, D.L.: A theory of timed automata. Theoretical Computer Sci-
ence 126, 183–235 (1994)
5. Asarin, E., Basset, N., Béal, M.-P., Degorre, A., Perrin, D.: Toward a timed theory
of channel coding. In: Jurdziński, M., Ničković, D. (eds.) FORMATS 2012. LNCS,
vol. 7595, pp. 27–42. Springer, Heidelberg (2012)
6. Asarin, E., Degorre, A.: Volume and entropy of regular timed languages: Ana-
lytic approach. In: Ouaknine, J., Vaandrager, F.W. (eds.) FORMATS 2009. LNCS,
vol. 5813, pp. 13–27. Springer, Heidelberg (2009)
7. Asarin, E., Degorre, A.: Volume and entropy of regular timed languages: Dis-
cretization approach. In: Bravetti, M., Zavattaro, G. (eds.) CONCUR 2009. LNCS,
vol. 5710, pp. 69–83. Springer, Heidelberg (2009)
8. Baier, C., Bertrand, N., Bouyer, P., Brihaye, T., Größer, M.: Probabilistic and topo-
logical semantics for timed automata. In: Arvind, V., Prasad, S. (eds.) FSTTCS
2007. LNCS, vol. 4855, pp. 179–191. Springer, Heidelberg (2007)
9. Basset, N., Asarin, E.: Thin and thick timed regular languages. In: Fahrenberg,
U., Tripakis, S. (eds.) FORMATS 2011. LNCS, vol. 6919, pp. 113–128. Springer,
Heidelberg (2011)
10. Bernadsky, M., Alur, R.: Symbolic analysis for GSMP models with one state-
ful clock. In: Bemporad, A., Bicchi, A., Buttazzo, G. (eds.) HSCC 2007. LNCS,
vol. 4416, pp. 90–103. Springer, Heidelberg (2007)
11. Bertrand, N., Bouyer, P., Brihaye, T., Markey, N.: Quantitative model-checking
of one-clock timed automata under probabilistic semantics. In: QEST, pp. 55–64.
IEEE Computer Society (2008)
12. Billingsley, P.: Probability and measure, vol. 939. Wiley (2012)
13. Bouyer, P., Brihaye, T., Jurdziński, M., Menet, Q.: Almost-sure model-checking of
reactive timed automata. QEST 2012, 138–147 (2012)
14. Cover, T.M., Thomas, J.A.: Elements of information theory, 2nd edn. Wiley (2006)
15. David, A., Larsen, K.G., Legay, A., Mikučionis, M., Poulsen, D.B., van Vliet, J.,
Wang, Z.: Statistical model checking for networks of priced timed automata. In:
Fahrenberg, U., Tripakis, S. (eds.) FORMATS 2011. LNCS, vol. 6919, pp. 80–96.
Springer, Heidelberg (2011)
16. Kempf, J.-F., Bozga, M., Maler, O.: As soon as probable: Optimal scheduling under
stochastic uncertainty. In: Piterman, N., Smolka, S.A. (eds.) TACAS 2013 (ETAPS
2013). LNCS, vol. 7795, pp. 385–400. Springer, Heidelberg (2013)
A Maximal Entropy Stochastic Process for a Timed Automaton 73
17. Krasnosel’skij, M.A., Lifshits, E.A., Sobolev, A.V.: Positive Linear Systems: the
Method of Positive Operators. Heldermann Verlag, Berlin (1989)
18. Lind, D., Marcus, B.: An Introduction to Symbolic Dynamics and Coding. Cam-
bridge University Press (1995)
19. Lothaire, M.: Applied Combinatorics on Words (Encyclopedia of Mathematics and
its Applications). Cambridge University Press, New York (2005)
20. Parry, W.: Intrinsic Markov chains. Transactions of the American Mathematical
Society, 55–66 (1964)
21. Shannon, C.E.: A mathematical theory of communication. Bell Sys. Tech. J. 27,
379–423, 623–656 (1948)
Complexity of Two-Variable Logic
on Finite Trees
1 Introduction
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 74–88, 2013.
c Springer-Verlag Berlin Heidelberg 2013
Complexity of Two-Variable Logic on Finite Trees 75
successor relations derived from a tree order. Figueira’s results were generalized
in a recent work [CW13] where two-variable logic over structures that contain
two forests of finite trees, even in presence of additional binary predicates and
counting quantifiers, is proved to be decidable in NEXPTIME. However, these
results are not comparable with ours because the logic in [CW13] is restricted
to ranked trees, it cannot express the sibling relation and does not allow us-
ing the transitive descendant relation. The two-variable logic over two transitive
relations is shown undecidable in [Kie05]. On the other hand the two-variable
fragment with one transitive relation has been recently shown by Szwast and
Tendera to be decidable [ST13]. The complexity of two-variable logic over ordi-
nary trees is explicitly studied in [BK08]. Our results here show that the proof
of the satisfiability result there (claiming NEXPTIME for full two-variable logic)
is incorrect.
Organization. Section 2 gives preliminaries. Section 3 gives precise bounds
for the satisfiability of full FO2 on trees. Section 4 considers the case where the
child predicate is absent, while Section 5 considers the case where the descendant
predicate is absent. Section 6 considers restricting the logic to its guarded version.
Section 7 gives conclusions.
always assume the navigational relations are given their natural interpretation:
↓ as the child relation, ↓+ the descendant relation, and so forth.
We consider also satisfiability for FO2 over k-ranked trees, that is, trees where
nodes have at most k children. Note that for k-ranked trees it is natural to
consider signatures that include the relation ↓i , connecting a node to its ith
child for each i ≤ k, either in place of or in addition to the predicates above.
However we will not consider a separate signature for ranked trees, since it is
easy to derive tight bounds for ranked trees for such signatures based on the
techniques introduced here.
A ranked tree schema consists of a bottom-up tree automaton on trees of some
rank k [Tho97]. A tree automaton takes trees labeled from a finite set Σ. We will
thus identify the symbols in Σ with predicates Pi , and thus all trees satisfying
the schema will satisfy the UAR.
We consider the following problems:
– Given an FO2 sentence ϕ, determine if there is some tree (resp. k-ranked,
UAR tree) that satisfies it.
– Given an FO2 sentence ϕ and a schema S, determine whether ϕ is satisfied by
some tree satisfying S. We consider the combined complexity in the formula
and schema.
Some of our results will go through XPath, a common language used for querying
XML documents viewed as trees. The navigational core of XPath is a modal
language, analogous to unary temporal logic on trees, denoted NavXP. NavXP
is built on binary modalities, referred to as axis relations. We will focus on the
following axes: self, parent, child, descendant, descendant-or-self, ancestor-or-self,
next-sibling, following-sibling, preceding-sibling, previous-sibling. In a tree t, we
associate each axis a with a set Rat of pairs of nodes. Rchild t
denotes the set of
pairs of nodes (x, y) in t where y is a child of x, and similarly for the other axes
(see [Mar04]).
NavXP consists of path expressions, which denote binary relations between
nodes in a tree, and filters, denoting unary relations. Below we give the syn-
tax (from [BK08]), using p to range over path expressions and q over filters.
L ranges over symbols for each labelling of a node (i.e. for general trees, boolean
combinations of predicates P1 , P2 , . . ., for UAR trees a single predicate).
We sketch the argument for the depth bound, leaving the similar proof for the
branching bound to the full version. Given a tree t and nodes n0 and n1 in t with
n1 not an ancestor of n0 , the overwrite of n0 by n1 in t is the tree t(n1 → n0 )
formed by replacing the subtree of n0 with the subtree of n1 in t. Let F be
the binary relation relating a node m in t to its copies in t(n1 → n0 ): n1 and
its descendants have a single copy if n1 is a descendant of n0 , and two copies
otherwise; nodes in SubTree(t, n0 ) that are not in SubTree(t, n1 ) have no copies,
and other nodes have a single copy. In the case that n1 is a descendant of n0 , F is
a partial function. We say an equivalence relation ≡ on nodes of a tree t is globally
ϕ-preserving if for any equivalent nodes n0 , n1 in t with n0 ∈ SubTree(t, n1 ), the
ϕ-type of a node n in t is the same as the ϕ-type of nodes in F (n) within
t(n1 → n0 ). We say it is pathwise ϕ-preserving if this holds for any node n0 , n1
in t with n1 a descendant of n0 . The path-index of an equivalence relation on t
is the maximum of the number of equivalence classes represented on any path,
while the index is the total number of classes.
We can not always overwrite a node with another having the same ϕ-type, but
by adding additional information, we can get a pathwise ϕ-preserving relation
with small path-index. For a node n, let DescTypes(n) be the set of ϕ-types
of descendants of n, and AncTypes(n) the set of ϕ-types of ancestors of n. Let
IncompTypes(n) be the ϕ-types of nodes n that are neither descendants nor
ancestors of n. Say n0 ≡Full n1 if they agree on their ϕ-type, the set DescTypes,
and the set IncompTypes.
Lemma 2. The relation ≡Full is pathwise ϕ-preserving, and its path index is
bounded by 2poly(|ϕ|) . Thus, there is a polynomial P such that for any tree t
satisfying ϕ and root-to-leaf path p of length at least 2P (|ϕ|), there are two nodes
n0 , n1 on p such that t(n1 → n0 ) still satisfies ϕ.
Given Lemma 2, Lemma 1 follows by contracting all paths exceeding a given
length until the depth of the tree is exponential in |ϕ|. In fact (e.g., for ranked
trees) the equivalence classes of ≡Full can be used as the state set of a tree
automaton A and then it can be arranged that A reaches the same state on n0
as on n1 . The path index property implies that the automaton goes through only
exponentially many states on any path of a tree. By taking the product of this
automaton with a ranked schema, the corresponding depth bound relative to a
schema follows.
We give a simple argument for the path index bound in Lemma 2. First, note
that the total number of ϕ-types is exponential in |ϕ|. Now the sets DescTypes(n)
either become smaller or stay the same as n varies down a path, and hence can
only change exponentially often. Similarly the sets IncompTypes(n) grow bigger
or stay the same, and thus can change only exponentially often. In intervals
along a path where both of these sets are stable, the number of possibilities for
the ϕ-type of a node is exponential. This gives the path index bound.
Theorem 1 follows from combining Lemma 1 with the following result on
satisfiability of NavXP:
Theorem 2. The satisfiability of a NavXP filter ϕ over trees of bounded depth b
is in PSPACE (in b and |ϕ|).
80 S. Benaim et al.
This result is a variant of a result from [BFG08] that finite satisfiability for
the fragment of NavXP which contains only axis relations child, parent, next-
sibling, preceding-sibling, previous-sibling and following-sibling is in PSPACE.
Given Theorem 2 we complete the proof of Theorem 1 by translating an FO2 sen-
tence ϕ into an NavXP filter ϕ with an exponential blow-up, using Proposition
1. By Lemma 1, the depth of a witness structure is bounded by an exponential
in |ϕ|, and the EXPSPACE result follows.
Lower Bound. We now show a matching lower bound for the satisfiability
problem.
Theorem 3. The satisfiability problem for FO2 on trees is EXPSPACE-hard,
with hardness holding even when formulas are restricted to be in GF2 [↓+ ].
This is proved by coding the acceptance problem for an alternating exponential
time machine. A tree node can be associated with an n-bit address, a path
corresponds to one thread of the alternating computation, and the tree structure
is used to code alternation. The equality and successor relations between the
addresses associated to nodes x and y can be coded in GF2 [↓+ ] using a standard
argument—see [Kie02] for details, where it was shown that a restricted variant
of the two-variable guarded fragment with some unary predicates and a single
binary predicate that is interpreted as a transitive relation is EXPSPACE-hard.
It is not hard to see that the proof presented there works fine (actually, it is even
more natural) if we restrict the class of admissible structures to (finite) trees.
introduced in the thesis of Weis [Wei11], working in the context of FO2 [<] on
UAR words: polynomial bounds on the number of times a formula changes its
truth value while keeping the same symbol along a given path.
The following is a generalization of Lemma 2.1.10 of Weis [Wei11]. Consider
an FO2 [↓+ ] formula ψ(x), a tree t satisfying the UAR, and fix a root-to-leaf path
p = p1 . . . pmax(p) in t. Given a label a, define an a-interval in p to be a set of
the form {i : m1 ≤ i < m2 ; t, pi |= a(x)} for some m1 , m2 .
Lemma 3. For every FO2 [↓+ ] formula ψ(x), UAR tree t, and root-to-leaf path
p = p1 . . . pmax(p) in t, the set {i| t, pi |= ψ ∧ a(x)} can be partitioned into a set
of at most |ψ|2 a-intervals.
From Lemma 3, we will show that FO2 [↓+ ] sentences that are satisfiable over
UAR trees always have polynomial-depth witnesses:
Lemma 4. If an FO2 [↓+ ] formula ϕ is satisfied over a UAR tree, then it is
satisfied by a model of depth bounded by a polynomial in |ϕ|.
Let us prove this fact. Suppose that ϕ is satisfied over a UAR tree t. On each path
p, for each letter b, let a b, ϕ-interval be a maximal b-interval on which every one-
variable subformula of ϕ has constant truth value. By the lemma above, the total
number of such intervals is polynomially bounded. We let W contain the endpoints
of each b, ϕ-interval for all symbols b. We note the following crucial property of W :
for every node m in p which is not in W , there is a node in W with the same ϕ-type
as m that is strictly above m, and also one strictly below m.
path p path p
w0 w0
r0
w1
=⇒
T0
r1
T1
w1
T1 T2 T0 T2
The idea is now to remove all those points on path p that are not in W . This
must be done in a slightly unusual way, by “promoting” subtrees that are off the
path. For every child c of a removed node r that does not lie on path p we attach
SubTree(t, c) to the closest node of W above r (see Figure 1). Let t denote the
tree obtained as a result of this surgery.
Let f be the partial function taking a node in t that is not removed to its image
in t . We claim that t still satisfies ϕ, and more generally that for any subformula
ρ(x) of ϕ and node m of t, we have t, m |= ρ iff t , f (m) |= ρ. This is proved by
induction on ρ, with the base cases and the cases for boolean operators being
82 S. Benaim et al.
straightforward. For an existential formula ∃yβ(x, y), we give just the “only if”
direction, which is via case analysis on the position of a witness node w such
that t, m, w |= β.
If w is in t then t , m, w |= β by the induction hypothesis and the fact that
w is an ancestor (or descendant) of m in t if and only if it is an ancestor (or
descendant) of m in t.
If w is not in t , then it must be that w lies on the path p and is not one the
protected witnesses in W . But then w has both an ancestor w and descendant
w in W that satisfy all the same one-variable subformulas as w does in t,
with both w and w preserved in the tree t . If m and w are distinct then
t , m, w |= β by the induction hypothesis and the fact that m and w have
the same ancestor/descendant relationship in t as do m and w in t. If m is
identical to w then t , m, w |= β by similar reasoning. In any case we deduce
that t , m |= ∃yβ.
Since this process reduces both the length of the chosen path p and does not
increase the length of any other path, it is clear that iterating it yields a tree of
polynomial depth.
Note that we can guess a tree as above in NEXPTIME, and hence we have the
following bound:
Theorem 5. Satisfiability for FO2 [↓+ ] formulas over UAR unranked trees is in
NEXPTIME, and hence is NEXPTIME-complete.
information” about the tree, in the form of a set of “protected witnesses”, which
we denote W .
By Lemma 1 we know that a satisfiable FO2 [↓+ ] formula ϕ has a model t of
depth at most exponential in ϕ. Fix such a t. For each ϕ-type τ , let wτ be a node
of t with maximal depth satisfying τ . We include all wτ and all of their ancestors
in a set W , and call these basic global witnesses. For any m that is an ancestor
or equal to a basic global witness wτ , and any subformula ρ(x) = ∃yβ(x, y)
of ϕ, if there is w incomparable (by the descendant relation) to m such that
t, m, w |= β we add one such w to W , along with all its ancestors – these are
the incomparable global witnesses.
We need one more definition. Given a node m in a tree, for every ϕ-type
τ realized by some ancestor m of m, for every subformula ∃yβ(x, y) of τ , if
there is a descendant w of m such that t, m , w |= β(x, y), choose one such
witness w and let SelectedDescTypes(m) include the ϕ-type of that witness. Note
that the same witness will suffice for every ancestor m realizing τ , and since
there are only polynomially many ϕ-types realized on the path, the collection
SelectedDescTypes(m) will be of polynomial size.
Now we transform t to t such that t |= ϕ and t has only exponentially
many different subtrees. We make use of a well-founded linear order ≺ on trees
with a given rank and label alphabet, such that: 1. SubTree(t, n ) ≺ SubTree(t, n)
implies n is not an ancestor of n; 2. for every tree C with a distinguished leaf, for
trees t1 , t2 with t1 ≺ t2 , we have C[t1 ] ≺ C[t2 ], where C[ti ] is the tree obtained
by replacing the distinguished leaf of C with ti . There are many such orderings,
e.g. using standard string encodings of a tree.
For any model t if there are two nodes n, n in t such that 1. n, n ∈ W ,
2. Tpϕ (n) = Tpϕ (n ), 3. AncTypes(n) = AncTypes(n ), 4. SelectedDescTypes(n)
= SelectedDescTypes(n ), 5. SubTree(t, n ) ≺ SubTree(t, n) (which implies that
n cannot be an ancestor of n), then let t = Update(t) be obtained by choosing
such n and n and replacing the subtree rooted at n by the subtree rooted at n .
Let T1 be the nodes in t that were not in SubTree(t, n), and for any node
m ∈ T1 let f (m) denote the same node considered within t . Let T2 denote the
nodes in t that are images of a node in SubTree(t, n ). For each m ∈ T2 , let
f −1 (m) denote the node in SubTree(t, n ) from which it derives.
We claim the following:
Lemma 5. For all m ∈ T1 the ϕ-type of n in t is the same as the ϕ-type of
f (m) in t . Moreover, for every node m in T2 , the ϕ-type of m in t is the same
as that of f −1 (m) in t.
Applying the lemma above to the root of t, which is necessarily in T1 , it follows
that the truth of the sentence ϕ is preserved by this operation.
We now iterate the procedure ti+1 := Update(ti ), until no more updates are
possible. This procedure terminates, because the tree decreases in the order ≺
every step. We can thus represent the tree as an exponential-sized DAG, with
one node for each subtree.
Thus we have shown that any satisfiable formula has an exponential-size DAG
that unfolds into a model of the formula. Given such a DAG, we can check
84 S. Benaim et al.
whether an FO2 formula holds in polynomial time in the size of the DAG. This
gives a NEXPTIME algorithm for checking satisfiability.
less spectacular than in the case of words, where an analogous restriction de-
creases the complexity from NEXPTIME to NP. However, to obtain NEXPTIME-
lower bound, we need to speak about pairs x, y of elements in free position, i.e.,
such elements that y is neither an ascendant nor descendant of x. Thus it is
natural to look at the situation where quantification is restricted to only pairs of
elements that are connected by binary relations. To capture the former kind of
scenario we consider the restriction of FO2 to the two-variable guarded fragment,
GF2 , in which all quantifiers have to be relativised by binary predicates. It is
easy to see that GF2 on trees still embeds NavXP, while still being exponentially
more succinct. We are able to show a PSPACE bound on satisfiability of GF2 [↓+ ]
for UAR trees. The following observation is crucial.
Lemma 6. Let ϕ be a GF2 [↓+ ] formula and let t be a UAR tree satisfying ϕ.
Then, there exists a tree t , obtained by removing some subtrees from t, still
satisfying ϕ, such that the degree of nodes in t is bounded polynomially in |ϕ|
and the depth of t.
For the proof assume w.l.o.g. that ϕ is written in negation normal form, i.e,
negations occur only in front of atomic formulas. For every subformula of ϕ of
the form ∃xψ(x) which is satisfied in t choose a single node satisfying ψ and
mark it together with all its ancestors. Analogously for formulas ∃yψ(y). For
every formula ∃y(x↓+ y ∧ ψ(x, y)) belonging to the ϕ-type of the root of t choose
a witness and mark it, together with all its ancestors. Then remove all subtrees
rooted at unmarked successors of the root. Note that the obtained structure still
satisfies ϕ. Analogously as with the root proceed with all marked elements, e.g.,
in a depth-first manner. Let t be the tree obtained after the final step of the
above process. Note that the number of descendants of a node in t at depth l
is bounded by (l + 1) · |ϕ|. This justifies the bound from the statement of the
lemma.
Theorem 10. The satisfiability problem for GF2 [↓+ ] over finite UAR trees is
PSPACE-complete.
We propose an alternating procedure solving the problem. Note that by combin-
ing Lemma 4 and Lemma 6 we may restrict our attention to trees whose depth
and degree are polynomially bounded in the size of the input formula ϕ. First,
our procedure guesses labels and ϕ-types of the root and its children, and checks
if the guessed information is consistent. Then it universally chooses one of the
children, guesses labels and ϕ-types of its children, and proceeds analogously.
In this way, the procedure builds a single path of the tree, together with the
immediate successors of all its nodes. This is sufficient to determine if a model
satisfies ϕ, as ϕ is guarded and cannot speak about pairs of elements not belong-
ing to a common path. Note that our procedure works in alternating polynomial
time, and thus can be also implemented in PSPACE. The matching lower bound
can be shown by reduction from the QBF problem. The crux is enforcing a full
binary tree of depth n with internal nodes at depth i coding truth values of the
i-th propositional variable from the QBF formula. In GF2 [↓+ ] we can measure
the depth of a node in a tree, and thus we can determine the identity of the
86 S. Benaim et al.
Theorem 12. The satisfiability problem for GF2 [↓, →] over finite trees is in
EXPTIME. The satisfiability problem for GF2 [↓] is EXPTIME-hard, even under
UAR assumption.
Theorem 13. The satisfiability problem for GF2 [↓, →+ ] over finite UAR trees
is NEXPTIME-hard.
The proof of this theorem relies on the fact that without the UAR assumption
FO2 is NEXPTIME-hard even if only unary relations are allowed in the signature
[EVW02]. This can be simulated in our scenario: we use the children of the root
to encode the elements in a model of such a unary formula. Then the relation →+
may be used as a guard, allowing to refer to any pair of these. The combination
of unary predicates holding at a given position can be simulated by means of
the ↓-successors.
Recall that an upper bound matching the lower bound from Theorem 13 holds
for FO2 [↓, →, →+ ] even without the UAR assumption (Theorem 9).
Upper Bounds:
– PSPACE: GF2 [↓+ ] with UAR (Thm. 10)
– EXPTIME: GF2 [↓, →] (Thm. 12)
– NEXPTIME: FO2 [↓+ ] with UAR (Thm. 5), FO2 [↓, →, →+ ] (Thm. 9)
– EXPSPACE: FO2 [↓, ↓+ , →, →+ ](Thm. 1)
We also obtain some results concerning satisfiability over ranked trees and satis-
fiability in the presence of schemas.
One direction of future research is to extend the analysis to infinite trees. It
seems that the complexity results we have obtained here can be transferred to
this case without major difficulties.
88 S. Benaim et al.
References
[AvBN98] Andréka, H., van Benthem, J., Németi, I.: Modal languages and bounded
fragments of predicate logic. J. Phil. Logic 27, 217–274 (1998)
[BBLW13] Benaim, S., Benedikt, M., Lenhardt, R., Worrell, J.: Controlling the depth,
size, and number of subtrees in two variable logic over trees. CoRR
abs/1304.6925 (2013)
[BFG08] Benedikt, M., Fan, W., Geerts, F.: XPath satisfiability in the presence of
DTDs. J. ACM 55(2), 8:1–8:79 (2008)
[BK08] Benedikt, M., Koch, C.: XPath Leashed. ACM Comput. Surv. 41(1), 3:1–
3:54 (2008)
[BLW12] Benedikt, M., Lenhardt, R., Worrell, J.: Verification of two-variable logic
revisited. In: QEST, pp. 114–123. IEEE (2012)
[BMSS09] Bojańczyk, M., Muscholl, A., Schwentick, T., Segoufin, L.: Two-variable
logic on data trees and XML reasoning. J. ACM 56(3) (2009)
[CKM13] Charatonik, W., Kieroński, E., Mazowiecki, F.: Satisfiability of the two-
variable fragment of first-order logic over trees. CoRR abs/1304.7204 (2013)
[CW13] Charatonik, W., Witkowski, P.: Two-variable logic with counting and trees.
In: LICS. IEEE (to appear, 2013)
[EVW02] Etessami, K., Vardi, M.Y., Wilke, T.: First-order logic with two variables
and unary temporal logic. Inf. Comput. 179(2), 279–295 (2002)
[Fig12] Figueira, D.: Satisfiability for two-variable logic with two successor relations
on finite linear orders. CoRR abs/1204.2495 (2012)
[GKV97] Grädel, E., Kolaitis, P.G., Vardi, M.Y.: On the decision problem for two-
variable first-order logic. Bull. Symb. Logic 3(1), 53–69 (1997)
[Kie02] Kieroński, E.: EXPSPACE-complete variant of guarded fragment with tran-
sitivity. In: Alt, H., Ferreira, A. (eds.) STACS 2002. LNCS, vol. 2285,
pp. 608–619. Springer, Heidelberg (2002)
[Kie05] Kieroński, E.: Results on the guarded fragment with equivalence or transi-
tive relations. In: Ong, L. (ed.) CSL 2005. LNCS, vol. 3634, pp. 309–324.
Springer, Heidelberg (2005)
[Mar04] Marx, M.: XPath with conditional axis relations. In: Bertino, E.,
Christodoulakis, S., Plexousakis, D., Christophides, V., Koubarakis, M.,
Böhm, K. (eds.) EDBT 2004. LNCS, vol. 2992, pp. 477–494. Springer,
Heidelberg (2004)
[MdR04] Marxand, M., de Rijke, M.: Semantic characterization of navigational
XPath. In: TDM. CTIT Workshop Proceedings Series, pp. 73–79 (2004)
[ST13] Szwast, W., Tendera, L.: FO2 with one transitive relation is decidable. In:
STACS. LIPIcs, vol. 20, pp. 317–328, Schloss Dagstuhl - Leibniz-Zentrum
fuer Informatik (2013)
[Sto74] Stockmeyer, L.J.: The Complexity of Decision Problems in Automata The-
ory and Logic. PhD thesis, Massachusetts Institute of Technology (1974)
[Tho97] Thomas, W.: Languages, automata, and logic. In: Rozenberg, G., Salomaa,
A. (eds.) Handbook of Formal Languages. Springer (1997)
[Wei11] Weis, P.: Expressiveness and Succinctness of First-Order Logic on Finite
Words. PhD thesis, University of Massachusetts (2011)
Nondeterminism in the Presence
of a Diverse or Unknown Future
1 Introduction
Nondeterminism is very significant in word automata: it allows for exponential suc-
cinctness [14] and in some cases, such as Büchi automata, it also increases the expres-
sive power [9]. In the automata-theoretic approach to formal verification, temporal logic
formulas are translated to nondeterministic word automata [16]. In some applications,
such as model checking, algorithms can proceed on the nondeterministic automaton,
whereas in other applications, such as synthesis and control, they cannot. There, the
advantages of nondeterminism are lost, and the algorithms involve a complicated deter-
minization construction [15] or acrobatics for circumventing determinization [8].
To see the inherent difficulty of using nondeterminism in synthesis, let us review the
current approach for solving the synthesis problem, going through games [4].
This work was supported in part by the Polish Ministry of Science grant no. N206 567840,
Poland’s NCN grant no. DEC-2012/05/N/ST6/03254, Austrian Science Fund NFN RiSE (Rig-
orous Systems Engineering), ERC Advanced Grant QUAREM (Quantitative Reactive Model-
ing), and ERC Grant QUALITY. The full version is available at the authors’ URLs.
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 89–100, 2013.
c Springer-Verlag Berlin Heidelberg 2013
90 U. Boker et al.
Let L be a language of infinite words over an alphabet 2I∪O , where I and O are sets of
input and output signals, respectively. The synthesis problem for L is to build a reactive
system that outputs signals from 2O upon receiving input signals from 2I , such that the
generated sequence (an infinite word over the alphabet 2I∪O ) is in L [12]. The prob-
lem is solved by taking a deterministic automaton D for L and conducting a two-player
game on top of it. The players, “system” and “environment”, generate words over 2I∪O ,
where in each turn the environment first chooses the 2I component of the next letter,
the system responds with the 2O component, and D moves to the successor state. The
goal of the system is to generate an accepting run of D no matter which sequence of
input assignments is generated by the environment. The system has a winning strategy
iff the language L can be synthesized.
Now, if one tries to replace D with a nondeterministic automaton A for L, the system
should also choose a transition to proceed with. Then, it might be that L is synthesizable
and still the system has no winning strategy, as each choice of Σ may “cover” a strict
subset of the possible futures.
Some nondeterministic automata are, however, good for games: in these automata
it is possible to resolve the nondeterminism in a way that only depends on the past
and still accepts all the words in the language. This notion, of good for games (GFG)
automata was first introduced in [5].1 Formally, a nondeterministic automaton over the
alphabet Σ is GFG if there is a strategy that maps each word x ∈ Σ ∗ to the transition
to be taken after x is read. Note that a state q of the automaton may be reachable via
different words, and the strategy may suggest different transitions from q after different
words are read. Still, the strategy depends only on the past, meaning on the word read
so far. Obviously, there exist GFG automata: deterministic ones, or nondeterministic
ones that are determinizable by pruning (DBP); that is, ones that just add transitions on
top of a deterministic automaton. In fact, these are the only examples known so far of
GFG automata. 2 A natural question is whether all GFG automata are DBP.
More generally, a central question is what role nondeterminism can play in automata
used for games, or abstractly put, in cases that the future is unknown. Specifically, can
such nondeterminism add expressive power? Can it contribute to succinctness? Is it
“real” or must it embody a deterministic choice?
Before addressing these questions, one should consider their tight connection to non-
determinism in tree automata for derived languages [7]: A nondeterministic word au-
tomaton A with language L is good for trees (GFT) if, when expanding its transition
function to get a symmetric tree automaton, it recognizes the derived language, denoted
der(L), of L; that is, all trees all of whose branches are in L [7]. Tree automata for de-
rived languages were used for solving the synthesis problem [12] and are used when
translating branching temporal logics such as CTL to tree automata [3]. Analogously
to GFG automata, the problem in using nondeterminism in GFT automata stems from
the need to satisfy different futures (the different branches in the tree). For example,
1
GFGness is also used in [2] in the framework of cost functions under the name “history-
determinism”.
2
As explained in [5], the fact the GFG automata constructed there are DBP does not contradict
their usefulness in practice, as their transition relation is simpler than the one of the embodied
deterministic automaton and it can be defined symbolically.
Nondeterminism in the Presence of a Diverse or Unknown Future 91
solving the synthesis problem, the branches of the tree correspond to the possible input
sequences, and when the automaton makes a guess, the guess has to be successful for
all input sequences. The main difference between GFG and GFT is that the former can
only use the past, whereas the latter can possibly take advantage of the future, except
that the future is diverse.
A principal question is whether GFG and GFT automata are the same, meaning
whether nondeterminism can take some advantage of a diverse future, or is it the same
as only considering the past.
It is not difficult to answer all the above questions for safety languages; that is, when
the language L = L(A) ⊆ Σ ω is such that all the words in L can be arranged in one
tree. Then, a memoryless accepting run of A (that is, its expansion to a symmetric tree
automaton for der(L)) on this tree induces a deterministic automaton embodied in A,
meaning that A is DBP. Moving to general ω-regular languages, the first question, con-
cerning expressiveness of deterministic versus GFT automata, was answered in [7] with
respect to Büchi automata, and in [11] with respect to all levels of the Mostowski hier-
archy. It is shown in these works that if der(L) can be recognized by a nondeterministic
Büchi tree automaton, then L can be recognized by a deterministic Büchi word automa-
ton, and similarly for parity conditions of a particular index. Thus, nondeterminism in
the presence of unknown or diverse future does not add expressive power. The other
questions, however, are open since the 90s.
In this paper we examine these questions further for automata with all common ac-
ceptance conditions. We first show that a Muller automaton is GFG iff it is GFT. As the
Muller condition can describe all the common acceptance conditions (Büchi, co-Büchi,
parity, Streett, and Rabin), the result follows to all of them. Intuitively, a GFT automa-
ton A (or, equivalently, a nondeterministic tree automaton for a derived language) is
limited in using information about the future, as different branches of the tree challenge
it with different futures. Formally, we prove that A is GFG by using determinacy of a
well-chosen game. The same game allows us to show that there is a deterministic au-
tomaton for L(A) with the same acceptance condition as A. This also simplifies the
result of [11] and generalizes it to Muller conditions. Indeed, the proof in [11] is based
on intricate arguments that heavily rely on the structure of parity condition.
Can GFG automata take some advantage of nondeterminism or do they simply hide
determinism? We show the existence of GFG Büchi and co-Büchi automata that use
the past in order to make decisions, and thus cannot have a memoryless strategy. Note
that we use the basic acceptance conditions for these counter examples, thus the result
follows to all common acceptance conditions. This is different from known results on
GFG automata over finite words or weak GFG automata, where GFG automata are DBP
[7,10]. This result is quite surprising, as strategies in parity games are memoryless. We
further build a GFG automaton that cannot be pruned into a deterministic automaton
even with a finite unbounded look-ahead, meaning that even an unbounded yet finite
view of the future cannot compensate on memorylessness.
Regarding succinctness, the currently known upper bound for the state blowup in-
volved in determinizing a GFG parity automaton is exponential [7], with no nontrivial
lower bound. We provide some insights on GFG automata, showing that in some cases
its determinization is efficient. We show that if A and B are GFG Rabin automata that
92 U. Boker et al.
recognize a language L and its complement, then there is a deterministic Rabin au-
tomaton for L of size |A × B|. Thus, in the context of GFG automata, determinization
is essentially the same problem as complementation. Moreover, our construction shows
that determinization cannot induce an exponential blowup both for an automaton and its
complement. This is in contrast with standard nondeterminism, even over finite words.
For example, both the language Lk = (a + b)∗ a(a + b)k and its complement admit non-
deterministic automata that are linear in k, while the deterministic ones are exponential
in k.
Due to lack of space, some proofs are omitted, or shortened, and can be found in the
full version.
2 Preliminaries
2.1 Trees and Labeled Trees
We consider trees over a set D of directions. A tree T is a prefix-closed subset of T =
D∗ . We refer to T as the complete D-tree. The elements in T are called nodes, and ε is
the root of T . For a node u ∈ D∗ and d ∈ D, the node ud is the child of u with direction
d. A path of T is a set π ⊆ T , such that ε ∈ π and for all u ∈ π, there is a unique d ∈ D
with ud ∈ π. Note that each path π corresponds to an infinite word in Dω .
For an alphabet Σ, a Σ-labeled D-tree is a D-tree in which each edge is labeled by a
letter from Σ. We choose to label edges instead of nodes in order to be able to compose
a set of words into a single tree, even when the set contains words that do not agree on
their first letter. Formally, a Σ-labeled D-tree is a pair T, t where T ⊆ T is a D-tree
and t : T \ {ε} → Σ labels each edge (or equivalently its target node) by a letter in Σ.
Let TD,Σ be the set of Σ-labeled D-trees (not necessarily complete). We say that a word
w ∈ Σ ω is a branch of a tree T, t ∈ TD,Σ if there is a path π = {ε, u1 , u2 , . . .} ⊆ T
such that w = t(π) = t(u1 )t(u2 ) . . . We use branches(T, t) to denote the set of
branches of T, t. Note that branches(T, t) is a subset of Σ ω .
2.2 Automata
Automata on words An automaton on infinite words is a tuple A = Σ, Q, q0 , Δ, α,
where Σ is the input alphabet, Q is a finite set of states, q0 ∈ Q is an (for simplicity,
single) initial state, Δ ⊆ Q × Σ × Q is a transition relation such that q, a, q ∈ Δ if
the automaton in state q, reading a, can move to state q . The state q0 ∈ Q is the initial
state, and α is an acceptance condition. Here we will use Büchi, co-Büchi, parity, Rabin,
Streett and Muller automata. In a Büchi (resp. co-Büchi) conditions, α ⊆ Q is a set of
accepting (resp. rejecting) states. In a parity condition of index [i, j], the acceptance
condition α : Q → [i, j] is a function mapping each state to its priority (we use [i, j] to
denote the set {i, i + 1, . . . , j}). In a Rabin (resp. Streett) condition, α ⊆ 22 ×2 is a
Q Q
Q
set of pairs of sets of states, and in a Muller condition, α ⊆ 22 is a set of sets of states.
Since the transition relation may specify many possible transitions for each state and
letter, the automaton A may be nondeterministic. If Δ is such that for every q ∈ Q and
a ∈ Σ, there is a single state q ∈ Q such that q, a, q ∈ Δ, then A is a deterministic
automaton.
Nondeterminism in the Presence of a Diverse or Unknown Future 93
transition q, (ad , qd )d∈Σ ∈ Δ with (ad , qq ) = (a, q ) for some d ∈ Σ. It is easy to see
that Aw accepts exactly all infinite words that appear as a branch of some tree accepted
by A. Note that if L(A) = der(L), then L(Aw ) = L, and L((Aw )t ) = der(L), so Aw
is GFT.
In this section we prove that if an NMW is GFT then it is also GFG. In addition,
we show that GFG automata admit finite memory strategies and we study connections
with [11].
The crucial tool in the proof is the following infinite-duration perfect-information
game between two players ∃ and ∀. Let A = D, QA , qIA , ΔA , αA be an arbitrary
NMW. Let D = D, QD , qID , ΔD , αD be a DSW recognizing L(A). The arena of
the game G(A) is QA × QD and its initial position q0 , p0 is the pair of initial states
(qIA , qID ). In the i-th round of a play, ∀ chooses a letter di ∈ D and ∃ chooses a state
qi+1 such that qi , di , qi+1 ∈ ΔA . The successive position is (qi+1 , pi+1 ), where pi+1
is the unique state of D such that pi , di , pi+1 ∈ ΔD .
An infinite play Π = (q0 , p0 , d0 ), (q1 , p1 , d1 ), . . . is won by ∃ if either the run
ΠA := (qi )i∈N is accepting or the run ΠD := (pi )i∈N is rejecting. Note that since D
recognizes L(A), it follows that ΠD is rejecting iff ΠD := (di )i∈N does not belong to
L(A).
Since the game is ω-regular, it admits finite-memory winning strategies. The winning
condition for ∃ in G(A) is the disjunction of αA with the Rabin condition that is dual to
αD . In particular, when A is an NRW, then the winning condition is a Rabin condition,
thus if ∃ has a winning strategy in G(A), she also has a memoryless one.
Obviously, a strategy for ∃ is a strategy for resolving the nondeterminism in A.
Hence, we have the following.
Lemma 1. If ∃ has a winning strategy in G(A) then A is GFG. Additionally, there
exists a finite-memory strategy σ witnessing its GFGness. If A is an NRW (NMW), then
σ is at most exponential (resp. doubly exponential) in the size of A.
Observe that the arena of the game G(A) is finite and the winning condition for ∃ is ω-
regular. Thus, the game is determined (see [1,4]) and one of the conditions in Lemma 1
or 2 holds. Hence A is either GFG or not GFT, and we can conclude with the following:
The following observation can be seen as an extension of [11] from parity condition to
general Muller acceptance conditions. The only difference here is that we work with Σ-
labelled D-trees with |D| ≥ |Σ|, while [11] was working on binary trees with arbitrary
alphabets. Again, we believe that these differences in the formalisms do not reflect
essential behaviors of automata on infinite trees, since a simple encoding always allows
to go from one formalism to another. Notice that the proof in [11] relies crucially on
the structure of parity conditions and does not seem to generalize to arbitrary Muller
conditions. In the following statement we use γ to denote an acceptance condition, e.g.
a parity [i, j] condition, a Rabin condition with k pairs, a Muller condition with k sets,
etc.
to consider the Q-components of the states (the M component does not play a role for
acceptance), and is thus of type γ. Since an accepting run of D induces an accepting
run of Aw , we have L(D) ⊆ L. Conversely, if π is a word in L, the unique run of D
on π corresponds to the execution of the GFG strategy σ in Aw , and it thus accepting.
Hence, L(D) = L, for the deterministic γ automaton D. &
%
Observe that since deterministic automata are clearly GFT, the other direction of Corol-
lary 1 is trivial.
A Meta Example. The meta-NBW M, described in Figure 1, accepts exactly all words
that contain infinitely many ‘xx’s or ‘yy’s. That is, L(M) = [(x + y)∗ (xx + yy)]ω .
It is not hard to see that M is GFG by using the following strategy in its single non-
deterministic state q0 : “if the last token was x then go to q1 else go to q2 ”. On the other
hand, determinizing q0 to always choose q1 loses y ω and always choosing q2 loses xω .
Hence, M is not DBP.
A Concrete Example. Using the above meta-NBW with x = aaa and y = aba provides
the NBW A, described in Figure 2, whose language is L = [(aaa + aba)∗ (aaa aaa +
aba aba)]ω . Essentially, it follows from the simple observations that A has an infinite
run on a word w iff w ∈ (aaa + aba)ω . Also, after a prefix whose length divides by 3,
a run of A can only be in either q0 , p or g.
98 U. Boker et al.
M: q1 p A: q1 a a p
y a a
x a
x b
a
b
q0 x y q0 a
b a
y a
y a
x a a
q2 g a
q2 b g
Fig. 1. A meta GFG NBW that is not Fig. 2. A GFG NBW that is not DBP
DBP
A Co-Büchi Example. In order to show that these counter examples are not specific
to the Büchi condition, we give another example of GFG which is not DBP, using the
co-Büchi condition. For simplicity, the acceptance is now specified via the transitions
instead of the states. Dashed transitions are co-Büchi, i.e. accepting runs must take them
only finitely often. (It is not hard to build a counter-example with co-Büchi condition
on states from this automaton.)
a
a a
a
b b
a
a
a b a
Fig. 3. A co-Büchi automaton that recognizes the language (aa + ab)∗ [aω + (ab)ω ]. It is GFG
but not DBP. Note that unlike the Büchi counter-example, one good choice is enough for getting
an accepting run.
Theorem 2. GFG NPWs are not DBP, even for Büchi and co-Büchi conditions.
Proof. We prove that the NBW A from Figure 2 is GFG and is not DBP. First, the only
nondeterminism of A is in q0 . The following strategy, applied in q0 , witnesses that A is
GFG: “if the last three letters were ‘aaa’ then go to q1 else go to q2 ”. Now, to see that A
is not DBP, recall that the only nondeterminism of A is in q0 . Therefore, there are two
possible prunings to consider: the DBW A in which δ(q0 , a) = q1 and the DBW A
in which δ(q0 , a) = q2 . With the former, (aba)ω ∈ L(A) \ L(A ) and with the latter
(aaa)ω ∈ L(A) \ L(A ). &
%
Nondeterminism in the Presence of a Diverse or Unknown Future 99
While the GFG NBW A used in the proof of Theorem 2 is not DBP, it can be deter-
minized by merging the states q1 and q2 , to which q0 goes nondeterministically, and
then pruning. Furthermore, A is “almost deterministic”, in the sense that a look-ahead
of one letter into the future is sufficient for resolving its nondeterminism. One may won-
der whether GFG NBWs are determinizable with more flexible definitions of pruning.
We answer this to the negative, describing (in the full version) a GFG NBW in which
merging the target states of the nondeterminism cannot help, and no finite look-ahead
suffices for resolving the nondeterminism.
Theorem 3. There are GFG NBWs that cannot be pruned into deterministic automata
with unbounded yet finite look-ahead, or by merging concurrent target states.
References
1. Büchi, J.R., Landweber, L.H.: Solving Sequential Conditions by Finite State Strategies. CSD
TR (1967)
2. Colcombet, T.: The theory of stabilisation monoids and regular cost functions. In: Albers, S.,
Marchetti-Spaccamela, A., Matias, Y., Nikoletseas, S., Thomas, W. (eds.) ICALP 2009, Part
II. LNCS, vol. 5556, pp. 139–150. Springer, Heidelberg (2009)
3. Emerson, E.A., Sistla, A.P.: Deciding branching time logic. In: Proc. 16th ACM Symp. on
Theory of Computing, pp. 14–24 (1984)
4. Grädel, E., Thomas, W., Wilke, T. (eds.): Automata, Logics, and Infinite Games. LNCS,
vol. 2500. Springer, Heidelberg (2002)
5. Henzinger, T.A., Piterman, N.: Solving games without determinization. In: Ésik, Z. (ed.) CSL
2006. LNCS, vol. 4207, pp. 395–410. Springer, Heidelberg (2006)
6. Klarlund, N.: Progress measures, immediate determinacy, and a subset construction for tree
automata. Ann. Pure Appl. Logic 69(2-3), 243–268 (1994)
7. Kupferman, O., Safra, S., Vardi, M.Y.: Relating word and tree automata. Ann. Pure Appl.
Logic 138(1-3), 126–146 (2006)
8. Kupferman, O., Vardi, M.Y.: Safraless decision procedures. In: Proc. 46th IEEE Symp. on
Foundations of Computer Science, pp. 531–540 (2005)
9. Landweber, L.H.: Decision problems for ω–automata. Mathematical Systems Theory 3,
376–384 (1969)
10. Morgenstern, G.: Expressiveness results at the bottom of the ω-regular hierarchy. M.Sc. The-
sis, The Hebrew University (2003)
11. Niwinski, D., Walukiewicz, I.: Relating hierarchies of word and tree automata. In: Meinel,
C., Morvan, M. (eds.) STACS 1998. LNCS, vol. 1373, Springer, Heidelberg (1998)
12. Pnueli, A., Rosner, R.: On the synthesis of a reactive module. In: Proc. 16th ACM Symp. on
Principles of Programming Languages, pp. 179–190 (1989)
13. Rabin, M.O.: Weakly definable relations and special automata. In: Proc. Symp. Math. Logic
and Foundations of Set Theory, pp. 1–23. North-Holland (1970)
14. Rabin, M.O., Scott, D.: Finite automata and their decision problems. IBM Journal of Re-
search and Development 3, 115–125 (1959)
15. Safra, S.: On the complexity of ω-automata. In: Proc. 29th IEEE Symp. on Foundations of
Computer Science, pp. 319–327 (1988)
16. Vardi, M.Y., Wolper, P.: Reasoning about infinite computations. Information and Computa-
tion 115(1), 1–37 (1994)
Coalgebraic Announcement Logics
1 Introduction
Dynamic epistemic logics [5] are tools for reasoning about knowledge and belief
of agents in a setting where interaction is of crucial interest. These logics extend
epistemic logic (EL) [11] with dynamic operators, used to denote knowledge-
changing actions. The most common of these is public announcement, first in-
troduced in [17], which supports formulas of the form φψ stating that after
publicly (and faithfully) announcing that a certain fact φ holds (such as ‘agent
b does not know that agent a knows p’), ψ will hold (e.g. ‘agent b knows p’).
EL and its extension with public announcements (PAL) are typically inter-
preted on epistemic models, i.e. Kripke models where each accessibility relation
is an equivalence; the points of the model represent epistemic alternatives. Eval-
uating a formula φψ at a point c of an epistemic model I (notation c I φψ)
amounts to verifying that the announcement is faithful (i.e., c I φ) and that
ψ holds at c after removing from I all epistemic alternatives where φ does not
hold (notation c Iφ ψ). The term ‘dynamic’ refers precisely to the fact that
models are changed during evaluation in this way.
Dynamic operators are of independent interest outside an epistemic setting.
E.g., they occur as soon as one tries to express resiliency-related properties in
verification (cf. van Benthem’s sabotage logic [3] for an example); and they can
turn a logic-based database query language into one supporting hypothetical
queries (as in “return the aggregated sales we would have if we assumed that
December sales corresponded to March”).
Moreover, dynamic effects need not be restricted to a relational setting as
found in Kripke models. E.g., the notion of announcing that a formula ψ holds
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 101–112, 2013.
c Springer-Verlag Berlin Heidelberg 2013
102 F. Carreiro, D. Gorı́n, and L. Schröder
2 Preliminaries
The framework of coalgebraic modal logics uniformly deals with a broad range
of modal operators and a variety of different structures. This is achieved by
recognizing the latter as instances of the concept of coalgebra. Given a functor
T : Set → Set, a T -coalgebra is a pair X, γ consisting of a non-empty set of
Coalgebraic Announcement Logics 103
(ii) The diamond and box for K are obtained analogously. Propositions corre-
spond to nullary liftings pX := {(s, C) ∈ KX | p ∈ C} for every p ∈ P.
(iii) For N and M, we have 2X (A) := {s ∈ N X | A ∈ s}.
(iv) For Dω (and Sω ), the modalities Lp of probabilistic modal logic correspond
to the liftings Lp X (A) := {μ ∈ Dω X | μ(A) ≥ p} for p ∈ Q ∩ [0, 1].
(v) The counting modalities 3k of graded modal logic are given as predicate
liftings for Bω with 3k X (A) := {μ ∈ Bω X | μ(A) ≥ k} for k ∈ N.
It is well-known that CML(Λ) is invariant under behavioural equivalence; i.e., if
(x, γ) ∼ (y, σ) then x ∈ φγ iff y ∈ φσ , for all φ ∈ CML(Λ).
An operator ♥ ∈ Λ is monotone if A ⊆ B ⊆ X implies ♥X A ⊆ ♥X B. For
example, all operators of Example 2 are monotone except the one for N . We
say that Λ is separating [16] if t ∈ T X is uniquely determined by {(♥, A) ∈
Λ × P̆X | t ∈ ♥X (A)}.
Intuitively, every component τX takes as input the extension of a formula and the
T -description of an element and returns an updated T -description. Naturality
says that T f (τX (t, P̆f A)) = τY (T f (t), A), for f : X → Y , t ∈ T X and A ⊆
Y . We interpret Δ ∈ Π as an update Δ, and extend the semantics with
the clause Δψ φγ = φΔX (ψγ )◦γ — i.e., Δψ applies local changes to the
entire coalgebra γ. We often identify Δ and Δ. The basic example is public
announcement logic over unrestricted frames (as considered in [14]; which we call
standard PAL although it is not interpreted over epistemic models), for which
we take Δ(S)(A) = A ∩ S and then rewrite an announcement ψφ to ψ ∧ Δψ φ
— this induces essentially the standard semantics, since restricting all successors
to satisfy ψ is modally indistinguishable from restricting the whole model to ψ.
of [23]. That is, the announcement need not be truthful. If we think of A as the
extension of a formula φ then this transformation removes the successors not
satisfying φ. If an impossible formula is announced, it is ignored.
Example 5. For the functor Dω we can define an update τ : Dω → ˙ (P̆ Dω )
that has the effect of conditioning all probabilities to a given formula as
τX (μ)(A) := λx.if μ(A) > 0 then μ(x | A) else μ(x). Again, this update
simply ignores the announcement of impossible events (i.e. those with probabil-
ity 0). We also write this update as μA := τ (μ)(A).
It is clear that there is a resemblance between Examples 4 and 5: both updates
give rise to dynamic operators that restrict the successors of a node to the points
that satisfy certain formula. This connection can be made more precise, which
will allow us to discuss this type of announcements in a uniform way.
Definition 6. An update τ is called a strong announcement on Λ if
(a) the partial application τX (−, A) : T X → T X factors through the inclusion
iA : T A → T X, for every A ⊆ X (intuitively, τX (−, A) : T X → T A); and
(b) τX (s, A) ∈ ♥X (C) iff s ∈ ♥X (C), for all s ∈ T X, C ⊆ A ⊆ X, ♥ ∈ Λ.
Condition (a) intuitively says that when ψ is announced, the resulting model
should be based on the states satisfying ψ, while (b) ensures that all states
satisfying ψ are retained. (Note that (b) is purely local and hence does not imply
that whenever φ → ψ is valid, then Δψ ♥φ ↔ ♥φ is valid; this fails already in
standard PAL.) In most cases, condition (b) is sufficient for naturality (so, for
instance, we are exempt from proving it in the examples below).
Proposition 7. A set-indexed family of maps τX : T X → (2X → T X) satisfy-
ing condition (b) of Definition 6 for a separating set Λ of predicate liftings is a
natural transformation T →˙ (P̆ T ); i.e. it is an update.
Example 8. (i) In slight modification of Example 4, putting !(S)(A) :=
A ∩ S defines a strong announcement on {3} (but not on {2}); it induces
standard PAL. For the differences between ! and !! see [14,23].
(ii) Putting τ (μ)(A) := λx. if x ∈ A then μ(x) else 0 for μ ∈ Bω X defines
a strong announcement on Λ = {30 , 31 , . . . }. The case for the subdistri-
bution functor Sω is similar.
(iii) For the neighbourhood functor N , putting τ (t)(A) := t ∩ PA defines a
strong announcement on Λ = {2}. The same definition (sic!) works for the
monotone neighbourhood functor M and Λ = {3}.
(iv) Probabilistic conditioning (cf. Example 5) is not a strong announcement.
These examples show that strong announcements occur in varying settings. For
monotone logics, they are actually uniquely determined.
Theorem 9. Let Λ consist of monotone operators. If τ is a strong announce-
ment on Λ, then we have an adjunction T iA * τX (−, A) where the ordering on
T X is given by s ≤ t ⇐⇒ ∀♥ ∈ Λ, A ⊆ X. s ∈ ♥(A) ⇒ t ∈ ♥(A). In
particular, τ is uniquely determined.
106 F. Carreiro, D. Gorı́n, and L. Schröder
This applies to all the updates of Example 8 except the one for N (since the
predicate lifting involved is not monotone). In PAL, the announcement operator
can be removed by means of well-known reduction laws [5,14], and hence does
not add expressive power. This generalizes to strong announcements:
predicate on T X as seen from the original γ. We can now define the coalgebraic
logic of announcements with effects CAL◦ (Π, Λ), which syntactically coincides
with CAL(Π, Λ). In CAL◦ (Π, Λ), each Δ ∈ Π is interpreted by a regenerator
Δ◦ . The semantics of formulas requires not only a T -coalgebra X, γ but also
a map ρ : 2T X → 2T X (the global regenerator ) that keeps track of the updates
applied so far. The extension ·◦ρ,γ of formulas of CAL◦ (Π, Λ) is defined as usual
for Boolean connectives and by
Δψ φ◦ρ,γ = φ◦Δ◦ (ψ◦ρ,γ ,−)◦ρ,γ ♥φ◦ρ,γ = (P̆γ ◦ ρ ◦ ♥X )φ◦ρ,γ .
X
When no ambiguity arises, we may write · instead of ·◦ . We will also use φγ
instead of φιX ,γ where ι : P̆T X →
˙ P̆T is the identity.
The connection between regenerators and “updates with effects” as in the
non-deterministic update discussed above can now be made precise. The crucial
observation is that any natural transformation τ : T → ˙ (P̆ F T ) equipped
with a predicate lifting (for F ) λ : P̆ →˙ P̆F induces the regenerator (for T )
˙ P̆T defined by ρτ,λ
ρτ,λ : P̆ × P̆T → X (A, S) := P̆(τX (−)(A))[λT X (S)]. In fact,
CAL(Λ, Π) is just CAL◦ (Λ, Π) with F = Id and λ = id .
Example 14. The non-deterministic announcements discussed above corre-
spond to taking F = P; the angelic interpretation is induced by λaX (t) := {s |
t ∩ s = ∅} and the demonic one by λdX (t) := {s | t ⊆ s} (i.e. 3 and 2 from
Example 2.i). Examples of other updates for various choices of T and τ are:
(i) Lossy announcements: take T = P and τX (S, A) := {S ∩ A, S}; this models
an announcement that can fail (leaving the set of successors unchanged).
If Δ◦ is based on λd , then Δψ φ means that φ has to hold regardless of
whether the announcement of ψ succeeds or not. The angelic case is dual.
(ii) Controlled sabotage: again for T = P, but define τX (S, A) := {S \ A, S}. If
we think of A as a delicate area of a network, this transformation models
links that may fail every time we want to go through them.
(iii) Unstable (pseudo-)Markov chains: let T = Sω and, for each ε ∈ Q ∩ [0, 1],
define a non-deterministic update τX ε
(μ, A) = {μ̃p | 0 ≤ p ≤ ε, μ̃p ∈ Sω X}
where μ̃p (x) := if x ∈ A then μ(x) + p else μ(x). This update non-
deterministically augments the probability of each a ∈ A by at most ε.
Example 15. Taking F = Dω we get a probability distribution over the out-
comes of an update. For p ∈ Q ∩ [0, 1] we can define λpX (A) := {μ | μ(A) ≥ p},
obtaining dynamic operators Δp such that Δpψ φ is true if the probability of the
effect of announcing ψ (in some unspecified way) making φ true is greater than
p. Note that the underlying coalgebra need not be probabilistic: in this example
the coalgebra type T is arbitrary and F only plays a role in the liftings.
Remark 16. One is tempted to think of non-deterministic or probabilistic up-
dates as changing the coalgebra γ, non-deterministically or randomly, to a fixed
γ . Although this is not accurate in that the choice is made again every time the
evaluation encounters a static modality, it becomes formally correct by restrict-
ing to tree-shaped coalgebras, i.e. those where the underlying Kripke frame is a
108 F. Carreiro, D. Gorı́n, and L. Schröder
tree, which, in the light of Theorem 17 below, is without loss of generality since
every coalgebra is behaviourally equivalent to a tree-shaped one [20]. One still
needs to keep in mind, however, that the choice is made per state, e.g. a lossy
announcement may succeed in some states and fail in others.
We now show that even in the presence of effects, dynamic modalities can be
rewritten in terms of static modalities (albeit not necessarily of the base logic),
and hence coalgebraic announcement logic in the more general sense remains in-
variant under behavioural equivalence. The crucial observation is that composing
a predicate lifting and a regenerator yields a predicate lifting of a higher arity.
That is, given λ : P̆ n → ˙ P̆T and ρ : P̆ × P̆T → ˙ P̆T , we have that the composite
λX (A, B1 . . . Bn ) := ρX (A, λX (B1 . . . Bn )) is a predicate lifting λ : P̆ n+1 →
˙ P̆T .
Given a static modality ♥ and a dynamic modality Δ, we introduce a static
modality (Δ·♥) interpreted by the composite of Δ and ♥ in this sense; one
easily shows that
Theorem 17. For all φ ∈ CAL◦ (Π, Λ) there is φ∗ ∈ CML(CLΠ (Λ)) s.t. φ ≡ φ∗ .
Hence, CAL◦ (Π, Λ) is invariant under behavioural equivalence.
to the base logic, which allows inheriting the complexity of CSAT for the latter,
typically EXPTIME. For a polynomial reduction of SAT to the base logic, we
need to assume that Λ contains a master modality, which then again allows
inheriting the complexity, typically PSPACE. We illustrate these methods for
the logic of probabilistic conditioning.
larger. This implies that the complexity of the decision problems for CAL◦ (Λ, Π)
is at most one exponential higher than for CML(Λ). But one can do better. The
main observation is that, although the translated formula φ∗ may be of size
exponential in |φ|, it contains only polynomially many different subformulas.
Using essentially the same argument as in [14, Lemma 9], one can prove:
Theorem 20. Let Λ be closed for Π. Then CSAT for CAL◦ (Λ, Π) has the same
complexity as for CML(Λ).
The proof is by introducing propositional variables as abbreviations for sub-
formulas, using the constraint. To deal with satisfiability in the absence of a
constraint, we need a master modality to make abbreviations work up to the
modal depth of the target formula. Coalgebraically, a master modality for Λ is
a static modality such that + and φ → (♥ψ ↔ ♥(φ ∧ ψ)), for all ♥ ∈ Λ
and φ, ψ ∈ CML(Λ), are valid. In the presence of a master modality one can give
better bounds for SAT than those from Theorem 20.
Theorem 21. Let Λ be closed for Π, and contain a master modality. Then the
complexity of SAT for CAL◦ (Λ, Π) is the same as for CML(Λ).
Interestingly, master modalities abound: if T preserves inverse images then the
predicate lifting X (A) := T A induces a master modality. Preserving inverse
images is weaker than the frequent assumption of preservation of weak pullbacks.
E.g., in graded modal logic 21 := ¬31 ¬ is a master modality, and in probabilistic
modal logic L1 is a master modality. Having observed that Λ is closed for strong
announcements on Λ, we note explicitly
Theorem 22. If Π consists of strong announcements on Λ, then CSAT for
CAL(Λ, Π) has the same complexity as for CML(Λ); the same holds for SAT if
Λ contains a master modality.
In particular, we regain the known complexity of standard PAL, and we obtain,
as new results, PSPACE and EXPTIME as the complexity of SAT and CSAT,
respectively, for graded modal logic with the strong announcement operator
(Example 8), as well as, e.g., NP as the complexity of neighbourhood logic and
monotone modal logic with strong announcement.
where the first conjunct takes care of the exceptional case of impossible an-
nouncements. It seems unlikely that one could express the right-hand-side of (2)
with a finite formula using only the operators Lp . However, we can extend Λ to
a closed similarity type. A very conservative solution is to let Lp (φ | ψ) be a
binary modal operator abbreviating (φ ∧ ψ) ≥ p · (ψ); then
i.e. the Lp (−, −) are closed for {Δ}. More generally, one may verify that the
n
full language of linear inequalities (with n-ary modal operators i=1 ai ( i ) ≥
b for all n ≥ 0 and a1 , . . . , an , b ∈ Q) is closed. SAT for the modal logic of
linear inequalities over probabilities is known to be in PSPACE [7], hence the
complexity of SAT for the above logics of probabilistic conditioning is PSPACE.
6 Conclusions
References
1. Baltag, A.: A coalgebraic semantics for epistemic programs. In: Coalgebraic Meth-
ods in Computer Science. ENTCS, vol. 82, pp. 17–38. Elsevier (2003)
2. Barr, M.: Terminal coalgebras in well-founded set theory. Theoret. Comput.
Sci. 114, 299–315 (1993)
3. van Benthem, J.: An essay on sabotage and obstruction. In: Hutter, D., Stephan,
W. (eds.) Mechanizing Mathematical Reasoning. LNCS (LNAI), vol. 2605,
pp. 268–276. Springer, Heidelberg (2005)
4. Cı̂rstea, C., Sadrzadeh, M.: Coalgebraic epistemic update without change of model.
In: Mossakowski, T., Montanari, U., Haveraaen, M. (eds.) CALCO 2007. LNCS,
vol. 4624, pp. 158–172. Springer, Heidelberg (2007)
5. van Ditmarsch, H., van der Hoek, W., Kooi, B.: Dynamic epistemic logics. Springer
(2007)
6. Duque, D.F., van Benthem, J., Pacuit, E.: Evidence logic: a new look at neighbor-
hood structures. In: Advances in Modal Logics. College Publications (2012)
7. Fagin, R., Halpern, J.Y.: Reasoning about knowledge and probability. J. ACM 41,
340–367 (1994)
8. French, T., van der Hoek, W., Iliev, P., Kooi, B.: Succinctness of epistemic lan-
guages. In: Int. Joint Conf. on Artif. Int., pp. 881–886 (2011)
9. French, T., van Ditmarsch, H.: Undecidability for arbitrary public announcement
logic. In: Advances in Modal Logics, pp. 23–42. College Publications (2008)
10. Heifetz, A., Mongin, P.: Probabilistic logic for type spaces. Games and Economic
Behavior 35, 31–53 (2001)
11. Hintikka, J.: Knowledge and belief. Cornell University Press (1962)
12. Larsen, K., Skou, A.: Bisimulation through probabilistic testing. Inf. Comput. 94,
1–28 (1991)
13. Löding, C., Rohde, P.: Model checking and satisfiability for sabotage modal logic.
In: Pandya, P.K., Radhakrishnan, J. (eds.) FSTTCS 2003. LNCS, vol. 2914, pp.
302–313. Springer, Heidelberg (2003)
14. Lutz, C.: Complexity and succinctness of public announcement logic. In: Joint
Conference on Autonomous Agents and Multi-Agent Systems, pp. 137–143 (2006)
15. Pattinson, D.: Coalgebraic modal logic: Soundness, completeness and decidability
of local consequence. Theoret. Comput. Sci. 309, 177–193 (2003)
16. Pattinson, D.: Expressive logics for coalgebras via terminal sequence induction.
Notre Dame J. Formal Logic 45, 2004 (2002)
17. Plaza, J.A.: Logics of public communications. In: International Symposium on
Methodologies for Intelligent Systems, pp. 201–216 (1989)
18. Rohde, P.: Moving in a crumbling network: The balanced case. In: Marcinkowski,
J., Tarlecki, A. (eds.) CSL 2004. LNCS, vol. 3210, pp. 310–324. Springer, Heidelberg
(2004)
19. Schröder, L.: A finite model construction for coalgebraic modal logic. J. Log. Al-
gebr. Prog. 73, 97–110 (2007)
20. Schröder, L., Pattinson, D.: Coalgebraic correspondence theory. In: Ong, L. (ed.)
FOSSACS 2010. LNCS, vol. 6014, pp. 328–342. Springer, Heidelberg (2010)
21. Schröder, L., Pattinson, D.: Modular algorithms for heterogeneous modal logics
via multi-sorted coalgebra. Math. Struct. Comput. Sci. 21(2), 235–266 (2011)
22. Segerberg, K.: An essay in classical modal logic. No. 1 in Filosofiska studier utgivna
av Filosofiska föreningen och Filosofiska institutionen vid Uppsala univ. (1971)
23. Steiner, D., Studer, T.: Total public announcements. In: Artemov, S., Nerode, A.
(eds.) LFCS 2007. LNCS, vol. 4514, pp. 498–511. Springer, Heidelberg (2007)
Self-shuffling Words
1 Introduction
Let A be a finite non-empty set. We denote by A∗ the set of all finite words
u = x1 x2 . . . xn with xi ∈ A. The quantity n is called the length of u and is
denoted |u|. For a letter a ∈ A, by |u|a we denote the number of occurrences of
The first and fourth authors are supported in part by FiDiPro grant of the
Academy of Finland. The third author is supported in part by the Academy
of Finland under grant 251371, by Russian Foundation of Basic Research (grant
12-01-00448), and by RF President grant MK-4075.2012.1. Preliminary version:
http://arxiv.org/abs/1302.3844.
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 113–124, 2013.
c Springer-Verlag Berlin Heidelberg 2013
114 É. Charlier et al.
∞
∈ A∗ and with x(j) =
(j) (j)
with each Ui i=0 Ui for 1 ≤ j ≤ k. Intu-
itively, z may be obtained as a shuffle of the words x(1) , x(2) , . . . , x(k) . In case
x(1) , x(2) , . . . , x(k) ∈ A∗ , each of the above products can be taken to be finite.
Finite word shuffles were extensively studied in [5]. Given x ∈ A∗ , it is gen-
erally a difficult problem to determine whether there exists y ∈ A∗ such that
x ∈ S (y, y) (see Open Problem 4 in [5]). However, in the context of infinite
words, this question is essentially trivial: In fact, it is readily verified that if
x ∈ AN is such that each a ∈ A occurring in x occurs an infinite number of times
in x, then there exist infinitely many y ∈ AN with x ∈ S (y, y). Instead, in the
framework of infinite words, a far more delicate question is the following:
with Ui , Vi ∈ A+ .
The property of being self-shuffling is an intrinsic property of the word (and
not of the associated language) and seems largely independent of its complexity
Self-shuffling Words 115
(examples exist from the lowest to the highest possible complexity). The simplest
class of self-shuffling words consists of all (purely) periodic words x = uω . It is
clear that if x is self-shuffling, then every letter a ∈ A occurring in x must occur
an infinite number of times. Thus for instance, the ultimately periodic word 01ω
is not self-shuffling. As we shall see, many well-known words which are of interest
in both combinatorics on words and symbolic dynamics, are self-shuffling. This
includes for instance the famous Thue-Morse word
T = 0110100110010110100101100110100110010110 . . .
whose origins go back to the beginning of the last century with the works of the
Norwegian mathematician Axel Thue [9]. The nth entry tn of T is defined as the
sum modulo 2 of the digits in the binary expansion of n. While the Thue-Morse
word appears naturally in many different areas of mathematics (from discrete
mathematics to number theory to differential geometry-see [1] or [2]), proving
that Thue-Morse is self-shuffling is somewhat more involved than expected.
Sturmian words constitute another important class of aperiodic self-shuffling
words. Sturmian words are infinite words over a binary alphabet having exactly
n+ 1 factors of length n for each n ≥ 0 [7]. Their origin can be traced back to the
astronomer J. Bernoulli III in 1772. They arise naturally in many different areas
of mathematics including combinatorics, algebra, number theory, ergodic theory,
dynamical systems and differential equations. Sturmian words are also of great
importance in theoretical physics and in theoretical computer science and are
used in computer graphics as digital approximation of straight lines. We show
that all Sturmian words are self-shuffling except those of the form aC where
a ∈ {0, 1} and C is a characteristic Sturmian word. Thus for every irrational
number α, all (uncountably many) Sturmian words of slope α are self-shuffling
except for two. Our proof relies on a geometric characterization of Sturmian
words via irrational rotations on the circle.
So while there are many natural examples of aperiodic self-shuffling words,
the property of being self-shuffling is nevertheless quite restrictive. We obtain
a number of necessary (and in some cases sufficient) conditions for a word to
be self-shuffling. For instance, if a word x is self-shuffling, then x begins in only
finitely many Abelian border-free words. As an application of this we show that
the well-known paper folding word is not self-shuffling. Infinite Lyndon words
(i.e., infinite words which are lexicographically smaller than each of its suffixes)
are also shown not to be self-shuffling.
One important feature of self-shuffling words stems from its invariance under
the action of a morphism: The morphic image of a self-shuffling word is again self-
shuffling. In some instances this provides a useful tool for showing that one word
is not the morphic image of another. So for instance, the paper folding word is not
the morphic image of any self-shuffling word. However this application requires
knowing a priori whether a given word is or is not self-shuffling. In general,
to show that a word is self-shuffling, one must actually exhibit a shuffle. Self-
shuffling words have other unexpected applications particularly in the study of
fixed points of substitutions. For instance, as an almost immediate consequence
116 É. Charlier et al.
x = 0100101001001010010100 . . .
x = 00100110001101100010 . . .
is a Toeplitz word generated by the pattern u = 0?1? (see, e.g., [4]). It is readily
verified that x begins in arbitrarily long Abelian border-free words and hence by
Proposition 3 is not self-shuffling. More precisely, the prefixes uj of x of length
nj = 2j − 1 are Abelian border-free. Indeed, it is verified that for each k < nj , we
have |pref k (uj )|0 > k/2 while |suff k (uj )|0 ≤ k/2. Here pref k (u) (resp., suff k (u))
denotes the prefix (resp., suffix) of length k of a word u.
and define
∞
x= Xi = 01010011030113 04 0102 12 0114 . . . ,
i=0
3 General Properties
∞
Proof. If x ∈ S
(x, x), then we can
∞write x = i=1 Ui Vi = ∞ i=1 U = ∞
i ∞ i=1 Vi .
∞ ∞
Whence τ (x) = i=1 τ (Ui Vi ) = i=1 τ (Ui )τ (Vi ) = i=1 τ (Ui ) = i=1 τ (Vi ) as
required.
Proposition 2. Let τ : A → A∗ be a morphism, and x ∈ AN be a fixed point
of τ.
1. Let u be a prefix of x and k be a positive integer such that τ k (a) begins in u
for each a ∈ A. Then if x is self-shuffling, then so is u−1 x.
2. Let u ∈ A∗ , and let k be a positive integer such that τ k (a) ends in u for each
a ∈ A. Then if x is self-shuffling, then so is ux.
Proof. We prove
∞only item (1) since the
∞proof of (2) is essentially identical.
∞
Suppose x = i=1 Ui Vi = i=1 Ui = i=1 Vi . Then by assumption, for each
i ≥ 1 we can write τ k (Ui ) = uUi and τ k (Vi ) = uVi for some Ui , Vi ∈ A∗ . Put
Xi = Ui u and Yi = Vi u. Then since
∞
∞
∞
∞
x = τ k (x) = τ k (Ui Vi ) = τ k (Ui )τ k (Vi ) = τ k (Ui ) = τ k (Vi ),
i=1 i=1 i=1 i=1
we deduce that
∞
∞
∞
u−1 x = Xi Yi = Xi = Yi .
i=1 i=1 i=1
The theorem gives a constructive necessary and sufficient condition for self-
shuffling since a path to infinity defines a self-shuffle.
As we shall now see, lexicographically extremal words are never self-shuffling.
Let (A, ≤) be a finite linearly ordered set. Then ≤ induces the lexicographic
ordering ≤lex on A+ and AN defined as follows: If u, v ∈ A+ (or AN ) we write
u ≤lex v if either u = v or if u is lexicographically smaller than v. In the latter
case we write u <lex v.
Let x ∈ AN . A factor u of x is called minimal (in x) if u ≤lex v for all factors v
of x with |v| = |u|. An infinite word y in the shift orbit closure Sx of x is called
Lyndon (in Sx ) if every prefix of y is minimal in x. The proof of the following
result is omitted for space considerations:
Theorem 2. Let (A, ≤) be a linearly ordered finite set and let x ∈ AN . Let
y, z ∈ Sx with y Lyndon and aperiodic. Then for each w ∈ S (y, z), we have
w <lex z. In particular, taking z = y we deduce that y is not self-shuffling.
Proof. For u ∈ {0, 1}∗ we denote by ū the word obtained from u by exchanging
0s and 1s. Let σ : {1, 2, 3, 4} → {1, 2, 3, 4}∗ be the morphism defined by
Set u = 01101 and v = 001; note that uv is a prefix of T. Also define morphisms
g, h : {1, 2, 3, 4} → {0, 1}∗ by
and
h(1) = uv, h(2) = ūv̄, h(3) = ūv̄, h(4) = uv
We will make use of the following lemmas:
and
g(σ(4)) = g(13) = vūv̄u ∈ S (vu, uv) = S (g(4), h(4)).
Lemma 3. T = h(w).
Proof. In fact τ (h(w)) = h(σ(w)) = h(w) from which it follows that h(w) is one
of the two fixed points of τ. Since h(w) begins in h(1) which in turn begins in
0, it follows that T = h(w).
Lemma 4. T = ug(w).
ug(1) = h(1)ū
ūg(2) = h(2)ū
ūg(3) = h(3)u
ug(4) = h(4)u.
Moreover, each occurrence of g(1) and g(4) in ug(w) is preceded by u while
each occurrence of g(2) and g(3) in ug(w) is preceded by ū. It follows that
ug(w) = h(w) which by the preceding lemma equals T.
Set
A0 = ug(σ(w0 )) and Ai = g(σ(wi )), for i ≥ 1
B0 = ug(w0 )) and Bi = g(wi )), for i ≥ 1
and
Ci = h(wi ) for i ≥ 0.
It follows from Lemma 3 and Lemma 4 that
∞
∞
∞
T= Ai = Bi = Ci
i=0 i=0 i=0
and the point ρ(x) is called the intercept of the Sturmian word x. A Sturmian
word x of slope α with ρ(x) = α is called a characteristic Sturmian word. It is
well known that every prefix u of a characteristic Sturmian word is left special,
i.e., both 0u and 1u are factors of x [7]. Thus if x is a characteristic Sturmian
word of slope α, then both 0x and 1x are Sturmian words of slope α and ρ(0x) =
ρ(1x) = 0. The fact that ρ is not one-to-one stems from the ambiguity of the
coding of the boundary points 0 and 1 − α.
0
1
0 X
1−α
r
ρ(x)
Theorem 4. Let S, M and L be Sturmian words of the same slope α, 0 < α < 1,
satisfying S ≤lex M ≤lex L. Then M ∈ S (S, L) if and only if the following
conditions hold: If ρ(M ) = ρ(S) (respectively, ρ(M ) = ρ(L)), then ρ(L) = 0
(respectively ρ(S) = 0).
3.2 2.2
4 5
Proof. We begin with some preliminary observations. Let Ω(x) denote the set of
all left and right infinite words y such that F (x) = F (y) where F (x) and F (y)
denote the set of all factors of x and y respectively. If y ∈ Ω(x) is a right infinite
word, and 0y, 1y ∈ Ω(x), then y = x. This is because every prefix of y is a left
special factor and hence also a prefix of the characteristic word x. Similarly if y
is a left infinite word and y0, y1 ∈ Ω(x), then y is equal to the reversal of x. If
τ is a morphism fixing some point y ∈ Ω(x), then τ (z) ∈ Ω(x) for all z ∈ Ω(x).
Suppose to the contrary that τ = id is a morphism fixing a proper tail y of x.
Then y is self-shuffling by Corollary 3. Put x = uy with u ∈ {0, 1}+. Using the
characterization of Sturmian morphisms (see Theorem 2.3.7 & Lemma 2.3.13
in [7]) we deduce that τ must be primitive. Thus we can assume that |τ (a)| >
1 for each a ∈ {0, 1}. If τ (0) and τ (1) end in distinct letters, then as both
0τ (x), 1τ (x) ∈ Ω(x), it follows that τ (x) = x. Since also τ (y) = y and |τ (u)| >
|u|, it follows that y is a proper tail of itself, a contradiction since x is aperiodic.
Thus τ (0) and τ (1) must end in the same letter. Whence by Corollary 1 it follows
124 É. Charlier et al.
References
1. Allouche, J.-P., Shallit, J.: The ubiquitous Prouhet-Thue-Morse sequence.
In: Ding, C., Helleseth, T., Niederreiter, H. (eds.) Proceedings of Sequences and
Their Applications, SETA 1998, pp. 1–16. Springer (1999)
2. Allouche, J.-P., Shallit, J.: Automatic sequences. In: Theory, Applications, Gener-
alizations. Cambridge University Press (2003)
3. Berthé, V., Ei, H., Ito, S., Rao, H.: On substitution invariant Sturmian words: an
application of Rauzy fractals. Theor. Inform. Appl. 41, 329–349 (2007)
4. Cassaigne, J., Karhumäki, J.: Toeplitz Words, Generalized Periodicity and Period-
ically Iterated Morphisms. European J. Combin. 18, 497–510 (1997)
5. Henshall, D., Rampersad, N., Shallit, J.: Shuffling and unshuffling. Bull.
EATCS 107, 131–142 (2012)
6. Fagnot, I.: A little more about morphic Sturmian words. Theor. Inform. Appl. 40,
511–518 (2006)
7. Lothaire, M.: Algebraic Combinatorics on Words. Encyclopedia of Mathematics
and its Applications, vol. 90. Cambridge University Press, U.K (2002)
8. Morse, M., Hedlund, G.A.: Symbolic dynamics II: Sturmian sequences. Amer. J.
Math. 62, 1–42 (1940)
9. Thue, A.: Über unendliche Zeichenreihen. Norske Vid. Selsk. Skr. I Math-Nat.
Kl. 7, 1–22 (1906)
10. Yasutomi, S.-I.: On sturmian sequences which are invariant under some substitu-
tions. In: Kanemitsu, S., et al. (eds.) Number Theory and Its Applications, Pro-
ceedings of the Conference held at the RIMS, Kyoto, Japan, November 10-14, 1997,
pp. 347–373. Kluwer Acad. Publ., Dordrecht (1999)
Block-Sorted Quantified Conjunctive Queries
1 Introduction
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 125–136, 2013.
c Springer-Verlag Berlin Heidelberg 2013
126 H. Chen and D. Marx
the desired evaluation can be performed in polynomial time following this pre-
processing. Relaxing polynomial-time computation so that an arbitrary depen-
dence in a parameter is tolerated yields, in essence, the notion of fixed-parameter
tractability. This notion of tractability is the base of parameterized complexity
theory, which provides a taxonomy for reasoning about and classifying problems
where each instance has an associated parameter. We follow this paradigm, and
focus the discussion on this form of tractability.
First-order model checking is intractable even if one restricts the connectives
and quantifiers permitted; for instance, model checking of existential conjunctive
queries, by which we mean sentences formed using atoms, conjunction (∧), and
existential quantification (∃), is well-known to be intractable (it is NP-complete).
Thus, a typical way to gain insight into which sentences exhibit tractable behav-
ior is to consider model checking relative to a set Φ of sentences. In the context
of existential conjunctive logic, there is a mature understanding of sentence sets.
It was proved by Grohe [6] that when Φ is a set of existential conjunctive queries
having bounded arity, model checking on Φ is fixed-parameter tractable if there is
a constant k ≥ 1 such that each sentence in Φ is logically equivalent to one whose
treewidth is bounded above by k, and is intractable otherwise (under a standard
assumption from parameterized complexity). The treewidth of a conjunctive sen-
tence (in prenex form) is measured here via the graph on the sentence’s variables
wherein two variables are adjacent if they co-occur in an atom.
An important precursor to Grohe’s theorem was the complexity classification
of graph sets for existential conjunctive logic. Grohe, Schwentick, and Segoufin [7]
defined model checking relative to a graph set G as the problem of deciding, given
a structure and an existential conjunctive query whose graph is in G, whether
or not the query is true on the structure; they showed that the problem is fixed-
parameter tractable when G has bounded treewidth, and intractable otherwise.
In this paper, we restrict our attention to queries of bounded arity (the case of
unbounded arity leads to a different theory, where complexity may depend on
the choice of representation of relations [3,8]). For bounded-arity structures, this
result is coarser than Grohe’s theorem, as it can be taken as a classification of
sentence sets Φ that obey the closure property that if a sentence is in Φ, then
all sentences having the same graph are also in Φ; in contrast, Grohe’s theorem
classifies arbitrary sentence sets.
This graph classification was recently generalized to quantified conjunctive
logic, wherein both quantifiers (∀, ∃) are permitted in addition to conjunction
(∧). Define a prefixed graph to be a quantifier prefix Q1 v1 . . . Qn vn paired with a
graph on the variables {v1 , . . . , vn }; each quantified conjunctive query in prenex
form can naturally be mapped to a prefixed graph, by simply taking the quan-
tifier prefix of the query along with the graph of the quantifier-free, conjunctive
portion of the query. Chen and Dalmau [2] defined a width measure for prefixed
graphs, which generalizes treewidth, and proved that model checking on a set of
prefixed graphs is fixed-parameter tractable if the set has bounded width, and
intractable otherwise. This result generalizes the graph classification by Grohe,
Schwentick, and Segoufin, and provides a unified view of this classification as
Block-Sorted Quantified Conjunctive Queries 127
well as earlier complexity results [5] on quantified conjunctive logic. Note, how-
ever, that the present result is incomparable to Grohe’s result: Grohe’s result is
on arbitrary sentence sets in a less expressive logic, while the result of Chen and
Dalmau considers sentences in more expressive logic, but considers them from
the coarser graph-based viewpoint, that is, it classifies sentence sets obeying the
(analog of the) described closure property.
In this article, we present a veritable generalization of Grohe’s theorem in
quantified conjunctive logic. In the bounded-arity case, our theorem naturally
unifies together both Grohe’s theorem and the classification of prefixed graphs
in quantified conjunctive logic. The sentences studied by our theorem are of
the following type. Define a block-sorted query to be a quantified conjunctive
sentence in multi-sorted, relational first-order logic where two variables having
the same sort must occur in the same quantifier block. This class of sentences
includes each sentence having a sort for each quantifier block. As an example,
consider the sentence
where the variables xi have the same sort e, the variables yi have the same sort
u, and the variables zi have the same sort e ; the arities of the relation symbols
R, S, and T are eu, euue , and eeu, respectively. The definitions impose that a
structure B on which such a sentence can be evaluated needs to provide a domain
Bs (which is a set) for each sort; quantifying a variable of sort s is performed
over the domain Bs . (See the next section for the precise formalization that is
studied.)
Our main theorem is the classification of block-sorted queries. We show how
to computably derive from each query a second logically equivalent query, and
demonstrate that, for a bounded-arity set of block-sorted queries, model checking
is fixed-parameter tractable if the width of the derived queries is bounded (with
respect to the mentioned width measure [2]), and is intractable otherwise. This
studied class of queries encompasses existential conjunctive queries, which can
be viewed as block-sorted queries in which there is one existential quantifier
block, and all variables have the same sort. Observe that, given any sentence in
quantified conjunctive logic (either one-sorted or multi-sorted) and any structure
on which the sentence is to be evaluated, one can view the sentence as a block-
sorted query. (This is done as follows: for each sort s that appears in more than
one quantifier block, introduce a new sort sb for each block b where it appears;
correspondingly, introduce new relation symbols.) Our theorem can thus be read
as providing a general tractability result which is applicable to all of quantified
conjunctive logic, and a matching intractability result that proves optimality of
this tractability result for the class of block-sorted queries.
Our theorem is the first generalization of Grohe’s theorem to a logic where both
quantifiers are present. The previous work suggests that we should proceed the fol-
lowing way: take the width measure of Chen and Dalmau [2], and apply it to some
analog of the logically equivalent core of Grohe [6]. However, the execution of these
128 H. Chen and D. Marx
ideas are not at all obvious and we have to overcome a number of technical barri-
ers. For instance, Grohe’s theorem statement (in the formulation given here) makes
reference to logical equivalence. While there is a classical and simple characteriza-
tion of logical equivalence in existential conjunctive logic [1], logical equivalence
for first-order logic is of course well-known to be an undecidable property; logical
equivalence for quantified conjunctive logic is now known (in the one-sorted case)
to be decidable [4], but is perhaps still not well-understood (for instance, its ex-
act complexity is quite open). Despite this situation, we succeed in identifying, for
each block-sorted sentence, a logically equivalent sentence whose width character-
izes the original sentence’s complexity, obtaining a statement parallel to that of
Grohe’s theorem; the definition of this equivalent sentence is a primary contribu-
tion of this article. In carrying out this identification, we present a notion of core
for block-sorted sentences and develop its basic theory; the core of an existential
conjunctive sentence (an established notion) is, intuitively, a minimal equivalent
sentence, and Grohe’s theorem can be stated in terms of the treewidth of the cores
of a sentence set. Another technical contribution of the article is to develop a graph-
theoretic understanding of variable interactions (see Section 4), which understand-
ing is sufficiently strong so as to allow for the delicate embedding of hard sentences
from the previous work [2] into the sentences under consideration, to obtain the in-
tractability result. Overall, we believe that the notions, concepts, and techniques
that we introduce in this article will play a basic role in the investigation of model
checking in logics that are more expressive than the one considered here.
2 Preliminaries
2.1 Terminology and Setup
We will work with the following formalization of multi-sorted relational first-
order logic. A signature is a pair (σ, S) where S is a set of sorts and σ is a set of
relation symbols; each relation symbol R ∈ σ has associated with it an element
of S ∗ , called the arity of R and denoted ar(R). In formulas over signature (σ, S),
each variable v has associated with it a sort s(v) from S; we use atom to refer
to an atomic formula R(v1 , . . . , vk ) where R ∈ σ and s(v1 ) . . . s(vk ) = ar(R). A
structure B on signature (σ, S) consists of an S-sorted family {Bs | s ∈ S} of
sets called the universe of B, and, for each symbol R ∈ σ, an interpretation
RB ⊆ Bar(R) . Here, for a word w = w1 . . . wk ∈ S ∗ , we use Bw to denote the
product Bw1 × · · · × Bwk . We say that two structures are similar if they are
defined on the same signature. Let B and C be two similar structures defined
on the same signature (σ, S). We say that B is a substructure of C if for each
s ∈ S, it holds that Bs ⊆ Cs , and for each R ∈ σ, it holds that RB ⊆ RC . We
say that B is an induced substructure of C if, in addition, for each R ∈ σ one
has that RB = RC ∩ Bar(R) .
A quantified conjunctive query is a sentence built from atoms, conjunction,
existential quantification, and universal quantification. It is well-known that such
sentences can be efficiently translated into prenex normal form, that is, of the
form Q1 v1 . . . Qn vn φ where each Qi is a quantifier and where φ is a conjunction
Block-Sorted Quantified Conjunctive Queries 129
of atoms. For such a sentence, it is well-known that the conjunction φ can be en-
coded as a structure A where As contains the variables of sort s that appear in φ
and, for each relation symbol R, the relation RA consists of all tuples (v1 , . . . , vk )
such that R(v1 , . . . , vk ) appears in φ. In the other direction, any structure A can
be viewed as encoding the conjunction (v1 ,...,vk )∈RB R(v1 , . . . , vk ). We will typ-
ically denote a quantified conjunctive query Q1 v1 . . . Qn vn φ as a pair (P, A)
consisting of the quantifier prefix P = Q1 v1 . . . Qn vn and a structure A that
encodes the quantifier-free part φ. Note that when discussing the evaluation of
a sentence (P, A) on a structure, we can and often will assume that all variables
appearing in P are elements of A.
We define a block-sorted query to be a quantified conjunctive query in prenex
normal form where for all variables v, v , if s(v) = s(v ) then v, v occur in the
same quantifier block. By a quantifier block, we mean a subsequence Qi vi . . . Qj vj
of the quantifier prefix (with i ≤ j) having maximal length such that Qi = · · · =
Qj . We number the quantifier blocks from left to right (that is, the outermost
quantifier block is considered the first). For each sort s having a variable that
appears in such a query, either all variables of sort s are universal, in which case
we call s a universal sort or a ∀-sort, or all variables or sort s are existential, in
which case we call s a existential sort or a ∃-sort.
2.2 Conventions
aim of existential is to ensure that the resulting assignment satisfies the formula,
that is, gives a homomorphism from A to B, while universal tries to prevent this.
The query (P, A) is true on B if existential has a winning strategy. We formalize
this intuition by the following definition:
Definition 1. Let (P, A) be a quantified conjunctive query, and let B be a
structure similar to A. An existential strategy for (P, A) on B is a set of
mappings (fx : (A∀,<x → B) → Bs(x) )x∈A∃ such that the following holds:
for any h : A∀ → B, a homomorphism from A to B is given by the map
(f, h) : A → B defined by (f, h)(x) = fx (h A∀,<x ) for each existential variable
x, and (f, h)(y) = h(y) for each universal variable y.
Proposition 2. Let (P, A) be a quantified conjunctive query, and let B be a
structure similar to A. Then B |= (P, A) if and only if there is an existential
strategy.
The transitivity of homomorphisms allows us to quickly deduce consequences of
the existence of a homomorphism A → B. For example, we know that there is
also a homomorphism A → B whenever there is a homomorphism A → A;
and there is a also homomorphism A → B whenever there is a homomorphism
B → B . These quick observations are very useful in the study of the homomor-
phism problem, where they allow us to restrict our attention to specific type of
structures. In our setting, however, the quantified nature of the problem makes
such consequences less obvious. In the following, we find analogs of these ob-
servations in our setting, that is, assuming that B |= (PA , A) holds, we explore
under what conditions the structure B or the query (PA , A) can be replaced to
obtain another true statement.
First we give a sufficient condition under which the query can be replaced.
Let us say that two similar block-sorted queries (PA , A) and (PC , C) having the
same number of quantifier blocks are mutually respecting if for each sort s and
for each i ≥ 1, it holds that s is used in the ith quantifier block of PA if and
only if it is used only in the ith quantifier block of PC .
Proposition 3. Let (PA , A) and (PC , C) be similar block-sorted queries that
are mutually respecting. Suppose that i : A → C is a universal-injective homo-
morphism. Then it holds that (PC , C) entails (PA , A).
The following proposition gives a sufficient condition for replacing the structure
B on which the query is evaluated:
Proposition 4. Let σ be a signature, let (P, A) be a block-sorted query over
σ, and let B, B be structures over σ. Suppose that B |= (P, A) and that there
exists a homomorphism g : B → B that is universal-surjective in the sense that
f (B∀ ) = B∀ . Then, it holds that B |= (P, A).
Note that this proposition can be viewed as a variant of the known fact that, in
standard (one-sorted) first-order logic, if a quantified conjunctive query Φ holds
on a structure B and B admits a surjective homomorhpism to B , then Φ also
holds on B (see for example [4, Lemma 1]).
Block-Sorted Quantified Conjunctive Queries 131
∀y1 , y2 , y3 ∃x1 x2 , x3 , x4 , x5
R1 (x1 , y1 ) ∧ R2 (x2 , y2 ) ∧ R3 (x1 , x2 ) ∧ R1 (x3 , y3 ) ∧ R1 (x5 , y3 )
∧ R2 (x4 , y3 ) ∧ R3 (x3 , x4 ) ∧ R3 (x5 , x4 ).
If g is the mapping with g(y1 ) = g(y2 ) = g(y3 ) = y3 , then there is a homomor-
phism ψ from A to A∗ that is identity on y1 , y2 , y3 , x1 , x2 and ψ(x3 ) = ψ(x5 ) =
xg1 and ψ(x4 ) = xg2 . Hence x3 , x4 , x5 are weak elements.
Block-Sorted Quantified Conjunctive Queries 133
The main result of the section is showing that removing the weak elements does
not change the sentence. In the proof of the classification theorem, this will allow
us to consider the width of the strong substructure as the classification criteria.
Theorem 15. Let S be the strong substructure of A. The queries (P, S) and
(P, A) are logically equivalent.
We conclude this section with a simple lemma that will be of help in estab-
lishing the complexity hardness result.
Proof. Assume for contradiction that φ(x) is not strong: there is a universal-
injective homomorphism ψ : A → A∗ where ψ(φ(x)) is a degenerate element.
Now ψ(φ) is a universal-injective homomorphism A → A∗ that maps x to a
degenerate element of A∗ , contradicting the assumption that x is strong. &
%
5 Classification Theorem
since the computation of M (φ) depends only on the parameter of the instance
(φ, B), the whole computation is in FPT.
We now give the hardness result. For a block-sorted query (P, S) over signature
(σ, S), we define the relativization (P, S)rel of (P, S) in the following way. Denote
P by Q1 v1 . . . Qn vn , and let θ be the conjunction of atoms corresponding to S.
Define (P, S)rel to be the one-sorted sentence Q1 v1 ∈ Wv1 . . . Qn vn ∈ Wvn θ over
signature σ ∪ {Wv1 , . . . , Wvn } where each Wvi is a fresh unary relation symbol
and the arity of a symbol R ∈ σ is the length of ar(σ,S) (R). Here, ∃v ∈ W ψ is
syntactic shorthand for ∃v(W (v) ∧ ψ); and, ∀v ∈ W ψ is syntactic shorthand for
∀v(W (v) → ψ). Assuming that the set of prefixed graphs given in the theorem
statement has unbounded width, the hardness result of [2, Section 6] implies that
Φrel = {(M (φ))rel | φ ∈ Φ} is W[1]-hard or coW[1]-hard under nuFPT reductions.
It thus suffices to give an nuFPT reduction from Φrel -MC to Φ-MC, which we
now do. Let ((P, S)rel , B) be an instance of Φrel -MC, and let φ ∈ Φ be such that
(P, S) = M (φ); let (P, A) denote the selfish core of φ computed by M (φ) (note
that S is a substructure of A).
We will work with the structure A∗ . Let Aid denote the subuniverse of A∗
containing all universal variables of A∗ and each existential variable of A∗ of
the form aid , where id is the identity mapping. (We use id generically to denote
the identity mapping, but note that this is defined on A∀,<a for an existential
variable a.) Observe that Aid induces in A∗ a copy of the structure A. With
this correspondence, let S id denote the union of A∀ and the strong elements of
Aid , and let Sid denote the induced substructure of A∗ on S id . Let D denote the
subuniverse of A∗ containing all degenerate elements of A∗ . We will sometimes
drop the id superscript when it is clear from context.
Define a structure B over signature (σ, S) as follows. The universe is denoted
by {Bs | s ∈ S} and is defined by Bs = {(a, b) ∈ (Aid s ∪ Ds ) × (B ∪ {⊥}) | (a ∈
Ssid → b ∈ UaB ) and (a ∈ / Ssid → b = ⊥)}. Here, B denotes the universe of the
one-sorted structure B. Now, for each R ∈ σ, define RB to be the relation
∗
id
{((a1 , b1 ), . . . , (ak , bk )) ∈ Bar(R) | (a1 , . . . , ak ) ∈ RA and ((a1 , . . . , ak ) ∈ RS →
(b1 , . . . , bk ) ∈ RB )}. We will use πi to denote the mapping that projects a tuple
onto the ith coordinate.
We claim that B |= (P, S)rel if and only if B |= (P, A).
We first prove the backwards direction. We will use the following lemma.
Observe that if c1 is not degenerate, then by the just-given lemma, the mapping
π1 (H[x]) is injective on U (x); it follows that π1 (H[x]) is injective on A∀,<x
by the definition of H[x] and the second condition in the definition of e. This
implies that (H[x])(A∀,<x ) is the graph of a mapping defined on A∀,<x , and c2
as described above is well-defined.
By the definition of c1 , we have that (Fx ) has the property that for any
H : A∀ → B , it holds that π1 (F, H) is a homomorphism from A to A∗ . It
remains to verify that if (a1 , . . . , ak ) ∈ RA , then the image ((t1 , b1 ), . . . , (tk , bk ))
of (a1 , . . . , ak ) under (F, H) has the property that (t1 , . . . , tk ) ∈ RS implies
(b1 , . . . , bk ) ∈ RB . For each existential variable x occurring in (a1 , . . . , ak ), ob-
serve that for any universal variable y coming before it in the quantifier prefix,
one has y ∈ U (x) and thus H(y) = (H[x])(y). It thus suffices to show that if x and
x are existential variables in this tuple where x occurs before x , H : A∀,<x → B
and H : A∀,<x → B are mappings where H extends H, then (H [x ])(A∀,<x )
extends (H[x])(A∀,<x ). It suffices to show that H [x ] and H[x] agree on A∀,<x .
It follows by definition of U that U (x)|A∀,<x = U (x )|A∀,<x . Thus, for an ∀-
sort s occurring before x, we have (H |U (x ))|As = (H|U (x))|As . So thus by
the first condition in the definition of e, it holds that e(H |U (x ), A∀,<x )|As =
e(H|U (x), A∀,<x )|As from which we obtain the desired agreement.
References
1. Chandra, A.K., Merlin, P.M.: Optimal implementation of conjunctive queries in
relational data bases. In: Proceddings of STOC 1977, pp. 77–90 (1977)
2. Chen, H., Dalmau, V.: Decomposing quantified conjunctive (or disjunctive) formu-
las. In: LICS (2012)
3. Chen, H., Grohe, M.: Constraint satisfaction with succinctly specified relations.
Journal of Computer and System Sciences 76(8), 847–860 (2010)
4. Chen, H., Madelaine, F., Martin, B.: Quantified constraints and containment prob-
lems. In: Twenty-Third Annual IEEE Symposium on Logic in Computer Science,
LICS (2008)
5. Gottlob, G., Greco, G., Scarcello, F.: The complexity of quantified constraint satis-
faction problems under structural restrictions. In: IJCAI 2005 (2005)
6. Grohe, M.: The complexity of homomorphism and constraint satisfaction problems
seen from the other side. Journal of the ACM 54(1) (2007)
7. Grohe, M., Schwentick, T., Segoufin, L.: When is the evaluation of conjunctive
queries tractable? In: STOC 2001 (2001)
8. Marx, D.: Tractable hypergraph properties for constraint satisfaction and conjunc-
tive queries. In: Proceedings of the 42nd ACM Symposium on Theory of Computing,
pp. 735–744 (2010)
From Security Protocols to Pushdown Automata
Abstract. Formal methods have been very successful in analyzing security pro-
tocols for reachability properties such as secrecy or authentication. In contrast,
there are very few results for equivalence-based properties, crucial for studying
e.g. privacy-like properties such as anonymity or vote secrecy.
We study the problem of checking equivalence of security protocols for an
unbounded number of sessions. Since replication leads very quickly to unde-
cidability (even in the simple case of secrecy), we focus on a limited fragment
of protocols (standard primitives but pairs, one variable per protocol’s rules)
for which the secrecy preservation problem is known to be decidable. Surpris-
ingly, this fragment turns out to be undecidable for equivalence. Then, restrict-
ing our attention to deterministic protocols, we propose the first decidability
result for checking equivalence of protocols for an unbounded number of ses-
sions. This result is obtained through a characterization of equivalence of pro-
tocols in terms of equality of languages of (generalized, real-time) deterministic
pushdown automata.
1 Introduction
Formal methods have been successfully applied for rigorously analyzing security pro-
tocols. In particular, many algorithms and tools (see [13,4,9,2,11] to cite a few) have
been designed to automatically find flaws in protocols or prove security. Most of these
results focus on reachability properties such as authentication or secrecy: for any execu-
tion of the protocol, an attacker should never learn a secret (secrecy property) or make
Alice think she’s talking to Bob while Bob did not engage a conversation with her (au-
thentication property). However, privacy properties such as vote secrecy, anonymity, or
untraceability cannot be expressed as such. They are instead defined as indistinguisha-
bility properties in [1,6]. For example, Alice’s identity remains private if an attacker
cannot distinguish a session where Alice is talking from a session where Bob is talking.
Studying indistinguishability properties for security protocols amounts into check-
ing a behavioral equivalence between processes. Processes represent protocols and are
specified in some process algebras such as CSP or the pi-calculus, except that mes-
sages are no longer atomic actions but terms, in order to faithfully represent crypto-
graphic messages. Of course, considering terms instead of atomic actions considerably
Full version available at http://hal.inria.fr/hal-00817230. The research lead-
ing to these results has received funding from the European Research Council under the Eu-
ropean Union’s Seventh Framework Programme (FP7/2007-2013) / ERC grant agreement n◦
258865, project ProSecure, and the ANR project JCJC VIP no 11 JS02 006 01.
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 137–149, 2013.
c Springer-Verlag Berlin Heidelberg 2013
138 R. Chrétien, V. Cortier, and S. Delaune
increases the difficulty of checking equivalence. As a matter of fact, there are just a few
results for checking equivalence of processes that manipulate terms.
– Based on a procedure developed by M. Baudet [3], it has been shown that trace
equivalence is decidable for deterministic processes with no else branches, and
for a family of equational theories that captures most standard primitives [10]. A
simplified proof of [3] has been proposed by Y. Chevalier and M. Rusinowitch [8].
– A. Tiu and J. Dawson [17] have designed and implemented a procedure for open
bisimulation, a notion of equivalence stronger than the standard notion of trace
equivalence. This procedure only works for a limited class of processes.
– V. Cheval et al. [7] have proposed and implemented a procedure for trace equiva-
lence, and for a quite general class of processes. They consider non deterministic
processes that use standard primitives, and that may involve else branches.
However, these decidability results analyse equivalence for a bounded number of ses-
sions only, that is assuming that protocols are executed a limited number of times. This
is of course a strong limitation. Even if no flaw is found when a protocol is executed n
times, there is absolutely no guarantee that the protocol remains secure when it is exe-
cuted n+ 1 times. And actually, the existing tools for a bounded number of sessions can
only analyse protocols for a very limited number of sessions, typically 2 or 3. Another
approach consists in implementing a procedure that is not guaranteed to terminate. This
is in particular the case of ProVerif [4], a well-established tool for checking security of
protocols. ProVerif is able to check equivalence although it does not always succeed [5].
Of course, Proverif does not correspond to any decidability result.
2.1 Syntax
Term algebra. As usual, messages are represented by terms. More specifically, we con-
sider a sorted signature with six sorts rand, key, msg, SimKey, PrivKey and PubKey
that represent respectively random numbers, keys, messages, symmetric keys, private
keys and public keys. We assume that msg subsumes the five other sorts, key subsumes
SimKey, PrivKey and PubKey. We consider six function symbols senc and sdec, aenc
and adec, sign and check that represent symmetric, asymmetric encryption and decryp-
tion as well as signatures. Since we are interested in the analysis of indistinguishability
properties, we consider randomized primitives:
senc : msg × SimKey × rand → msg sdec : msg × SimKey → msg
aenc : msg × PubKey × rand → msg adec : msg × PrivKey → msg
sign : msg × PrivKey × rand → msg check : msg × PubKey → msg
We further assume an infinite set Σ0 of constant symbols of sort key or msg, an infinite
set Ch of constant symbols of sort channel, two infinite sets of variables X , W, and
an infinite set N = Npub - Nprv of names of sort rand: Npub represents the random
numbers drawn by the attacker while Nprv represents the random numbers drawn by the
protocol’s participants. As usual, terms are defined as names, variables, and function
symbols applied to other terms. We denote by T (F , N , X ) the set of terms built on
function symbols in F , names in N , and variables in X . We simply write T (F , N )
when X = ∅. We consider three particular signatures:
Σpub = {senc, sdec, aenc, adec, sign, check, start}
Σ + = Σpub ∪ Σ0 Σ = {senc, aenc, sign, start} ∪ Σ0
where start ∈/ Σ0 is a constant symbol of sort msg. Σpub represents the functions/data
available to the attacker, Σ + is the most general signature, while Σ models actual
messages (with no failed computation). We add a bijection between elements of sort
PrivKey and PubKey. If k is a constant of sort PrivKey, k−1 will denotes its image
by this function, called inverse. We will write the inverse function the same, so that
(k−1 )−1 = k. To keep homogeneous notations, we will extend this function to sym-
metric keys: if k is of sort SimKey, then k−1 = k. The relation between encryption and
decryption is represented through the following rewriting rules, yielding a convergent
rewrite system:
sdec(senc(x, y, z), y) → x adec(aenc(x, y, z), y −1 ) → x
check(sign(x, y, z), y −1 ) → x
This rule models the fact that the decryption of a ciphertext will return the associated
plaintext when the right key is used to perform decryption. We denote by t↓ the normal
form of a term t ∈ T (Σ + , N , X ).
140 R. Chrétien, V. Cortier, and S. Delaune
where PA (v) and PS evolve in parallel and additionally, the secret key kCS is sent in
clear, to model the fact that the attacker may learn keys of some corrupted agents:
def
P (v) = PA (v) | PS | ! in(c, start).out(c, kCS )
2.2 Semantics
Example 3. Going back to the protocol introduced in Example 2, consider the following
scenario: (i) the corrupted agent C discloses his secret key kCS ; (ii) the agent A initiates
a session with B, and for this she sends a request to the server S; (iii) the attacker
intercepts this message and sends it to S as a request coming from A to establish a key
with C. Instead of answering to this request with senc(kAB , kBS , rS ), the server sends
senc(kAB , kCS , rS ), and the attacker will learn kAB . More formally, we have that:
def in(c,start).out(c,w1 ).in(cA ,start).out(cA ,w2 ).in(c ,w2 ).out(c ,w3 ).
K0 = (P (v); ∅) ==============================
S S
==========⇒ (P (v); σ)
where σ = {w1 kCS , w2 senc(kAB , kAS , rA ), w3 senc(kAB , kCS , rS )}, and rA , rS
are (fresh) names in Nprv . In this execution trace, first the key kCS is sent after having
called the corresponding process. Then, branches (1) and (4) of P (v) are triggered.
142 R. Chrétien, V. Cortier, and S. Delaune
We have that (tr , σ0 ) ∈ trace(K0 ) with K0 = (P (v0 ) | Q; ∅) and σ0 as defined in
Example 4. Because of the existence of only one branch using each channel, there is
only one possible execution of P (v1 ) | Q (up to a bijective renaming of the private
names of sort rand) matching the labels in tr , and the corresponding execution will
allow us to reach the frame σ1 as described in Example 4. We have already seen that
static equivalence does not hold, i.e. σ0 ∼ σ1 .
3 Ping-Pong Protocols
We aim at providing a decidability result for the problem of trace equivalence between
protocols in presence of replication. However, it is well-known that replication leads to
undecidability even for the simple case of reachability properties. Thus, we consider a
class of protocols, called Cpp , for which (in a slightly different setting), reachability has
already been proved decidable [9].
1. for all i ∈ {1, . . . , n}, and j ∈ {1, . . . , pi }, kji ∈ N, uij is an input term, and vji is
an output term where names occurring in vji are included in {r1 , . . . , rkji };
2. for all i ∈ {1, . . . , n}, and j1 , j2 ∈ {1, . . . , pi }, if j1 = j2 then for any renaming
of variables, uij1 and uij2 are not unifiable1.
Note that the purpose of item 2 is to restrict the class of protocols to those that have
a deterministic behavior (a particular input action can only be accepted by one branch
of the protocol). This is a natural restriction since most of the protocols are indeed
deterministic: an agent should usually know exactly what to do once he has received a
message. Actually, the main limitations of the class Cpp are stated in item 1: we consider
a restricted signature (e.g. no pair, no hash function), and names can only be used to
produce randomized ciphertexts/signatures.
1
i.e. there does not exist θ such that uij1 θ = uij2 θ.
144 R. Chrétien, V. Cortier, and S. Delaune
Example 6. The protocols described in Example 5 are in Cpp . For instance, we can
check that senc(x, kAS , z) is an input term whereas senc(x, kBS , rS ) is an output term.
Moreover, the determinism condition (item 2) is clearly satisfied: each branch of the
protocol P (v0 ) | Q (resp. P (v0 ) | Q) uses a different channel.
Our main contribution is a decision procedure for trace equivalence of processes in Cpp .
Details of the procedure are provided in Section 4.
Theorem 1. Let P and Q be two protocols in Cpp . The problem whether P and Q are
trace equivalent, i.e. P ≈ Q, is decidable.
The class Cpp is somewhat limited but surprisingly, extending Cpp to non deterministic
processes immediately yields undecidability of trace equivalence. More precisely, trace
inclusion of processes in Cpp is already undecidable.
Theorem 2. Let P and Q be two protocols in Cpp . The problem whether P is trace
included in Q, i.e. P . Q, is undecidable.
This result is shown by encoding the Post Correspondence Problem (PCP). Alterna-
tively, it results from the reduction result established in Section 5 and the undecidability
result established in [12]. Undecidability of trace inclusion actually implies undecid-
ability of trace equivalence as soon as processes are non deterministic. Indeed consider
the choice operator + whose (standard) semantics is given by the following rules:
τ τ
({P + Q} ∪ P; σ) −
→ (P ∪ P; σ) ({P + Q} ∪ P; σ) −
→ (Q ∪ P; σ)
Indeed, consider P and Q1 , for which trace inclusion encodes PCP, and let Q2 = P .
Trivially, P . Q1 + Q2 . Thus P ≈ Q1 + Q2 if, and only if, Q1 + Q2 . P , i.e. if, and
only if, Q1 . P , hence the undecidability result.
a;γ/w
from the stack and pushing w will be denoted by q −−−−→ q .
Let A be a GPDA. The language recognized by A is defined by:
m
L(A) = {m ∈ Π ∗ | q0 ω −→A qf w for some qf ∈ Qf and w ∈ Γ ∗ }.
A real-time GPDA can easily be converted into a DPA by adding new states and -
transitions. Thus, the problem of language equivalence for two real-time GPDA A1
and A2 , i.e. deciding whether L(A1 ) = L(A2 ) is decidable [15].
Example 7. The trace exhibited in Example 3 is still a valid one according to the for-
warder semantics, and the frames σ0 and σ1 described in Example 4 are in equivalence
according to ∼fwd . Actually, we have that P (v0 ) | Q ≈fwd P (v1 ) | Q. Indeed, the fact
that a forwarder simply acts as a relay prevents him to mount the aforementioned attack.
As shown above, the forwarder semantics is very restrictive: a forwarder can not rely
on his deduction capabilities to mount an attack. To counterbalance the effects of this
semantics, the key idea consists in modifying the protocols under study by adding new
rules that encrypt/sign and decrypt/check messages on demand for the forwarder.
Formally, we define a transformation Tfwd that associates to a pair of protocols in Cpp
a finite set of pairs of protocols (still in Cpp ), and we show the following result:
Roughly the transformation Tfwd consists in first guessing among the keys of the
protocols P and the keys of the protocols Q those that are deducible by the attacker,
as well as a bijection α between these two sets. We can show that such a bijection
necessarily exists when P ≈ Q. Then, to compensate the fact that the attacker is a
simple forwarder, we give him access to oracles for any deducible key k, adding the
corresponding branches in the processes, i.e. in case k is of sort SimKey, we add
k , x).new r.out(ck , senc(x, k, r)) | ! in(ck , senc(x, k, z)).out(ck , x)
! in(csenc senc sdec sdec
For any process P ∈ Cpp , we can show that it is possible to define a polynomial-sized
real-time GPDA AP such that trace equivalence against forwarder of two processes
coincides with language equivalence of the two corresponding automata.
The idea is that the automaton AP associated to a protocol P recognizes the words (a
sequence of channels) that correspond to a possible execution in P . The stack of AP
is used to store a (partial) representation of the last outputted term. This requires to
convert a term into a word, and we use the following representation:
s = s for any constant s ∈ Σ0 ∪ {start}; and f(v, k, r) = v̄.k otherwise.
Note that, even if our signature is infinite, we show that only a finite number of constants
of sort msg and a finite number of constants of sort channel need to be considered
(namely those that occur in the protocols under study). Thus, the stack-alphabet and the
input-alphabet of the automaton are both finite.
To construct the automaton associated to a process P ∈ Cpp , we need to construct
an automaton that recognizes any execution of P and the corresponding valid tests. For
the sake of illustration, we present only the automaton (depicted below) that recognizes
tests of the form w = w such that the corresponding term is actually a constant.
Intuitively, the basic building blocks (e.g. q0 with the transitions from q0 to itself)
mimic an execution of P where each input is fed with the last outputted term. Then, to
recognize the tests of the form w = w that are true in such an execution, it is sufficient
to memorize the constant si that is associated to w (adding a new state qi ), and to see
whether it is possible to reach a state where the stack contains si again.
Capturing tests that lead to non-constant symbols (i.e. terms of the form senc(u, k, r))
is more tricky for several reasons. First, it is not possible anymore to memorize the re-
sulting term in a state of the automaton. Second, names of sort rand play a role in such
a test, while they are forgotten in our encoding. We therefore have to, first, characterize
more precisely trace equivalence and secondly, construct more complex automata that
use some special track symbols to encode when randomized ciphertexts may be reused.
From Security Protocols to Pushdown Automata 147
ci ; uij /vji
q1
ω con
ci ; uij /vji 1/ .. st;
; ωs . ωs
const 1 /ω
ci ; uij /vji
const; ωsk /ω const; ωsk /ω
q0 qf
qk
con .. /ω
st; ω . ωs
s /ω s t;
q c on
ci ; uij /vji
6 Conclusion
We have shown a first decidability result for equivalence of security protocols for an un-
bounded number of sessions by reducing it to the equality of languages of deterministic
pushdown automata. We further show that deciding equivalence of security protocols is
actually at least as hard as deciding equality of languages of deterministic, generalized,
real-time pushdown automata.
Our class of security protocols handles only randomized primitives, namely symmet-
ric/asymmetric encryptions and signatures. Our decidability result could be extended to
handle deterministic primitives instead of the randomized one (the reverse encoding
- from real-time GPDAs to processes with deterministic encryption - may not hold
anymore). Due to the use of pushdown automata, extending our decidability result to
protocols with pair is not straightforward. A direction is to use pushdown automata for
which stacks are terms.
G. Sénizergues is currently implementing his procedure for pushdown automata [14].
As soon as the tool will be available, we plan to implement our translation, yielding a
tool for automatically checking equivalence of security protocols, for an unbounded
number of sessions.
References
1. Arapinis, M., Chothia, T., Ritter, E., Ryan, M.: Analysing unlinkability and anonymity using
the applied pi calculus. In: 23rd Computer Security Foundations Symposium (CSF 2010),
pp. 107–121. IEEE Computer Society Press (2010)
2. Basin, D., Mödersheim, S., Viganò, L.: A symbolic model checker for security protocols.
Journal of Information Security 4(3), 181–208 (2005)
3. Baudet, M.: Deciding security of protocols against off-line guessing attacks. In: 12th ACM
Conference on Computer and Communications Security (CCS 2005). ACM Press (2005)
4. Blanchet, B.: An efficient cryptographic protocol verifier based on prolog rules. In: 14th
Computer Security Foundations Workshop (CSFW 2001). IEEE Computer Society Press
(2001)
5. Blanchet, B., Abadi, M., Fournet, C.: Automated Verification of Selected Equivalences for
Security Protocols. In: 20th Symposium on Logic in Computer Science (2005)
6. Bruso, M., Chatzikokolakis, K., den Hartog, J.: Formal verification of privacy for RFID sys-
tems. In: 23rd Computer Security Foundations Symposium, CSF 2010 (2010)
7. Cheval, V., Comon-Lundh, H., Delaune, S.: Trace equivalence decision: Negative tests and
non-determinism. In: 18th ACM Conference on Computer and Communications Security
(CCS 2011). ACM Press (2011)
8. Chevalier, Y., Rusinowitch, M.: Decidability of equivalence of symbolic derivations. J. Au-
tom. Reasoning 48(2), 263–292 (2012)
9. Comon-Lundh, H., Cortier, V.: New decidability results for fragments of first-order logic
and application to cryptographic protocols. In: Nieuwenhuis, R. (ed.) RTA 2003. LNCS,
vol. 2706, pp. 148–164. Springer, Heidelberg (2003)
10. Cortier, V., Delaune, S.: A method for proving observational equivalence. In: 22nd IEEE
Computer Security Foundations Symposium (CSF 2009). IEEE Computer Society Press
(2009)
11. Cremers, C.: Unbounded verification, falsification, and characterization of security protocols
by pattern refinement. In: 15th ACM Conference on Computer and Communications Security
(CCS 2008). ACM (2008)
From Security Protocols to Pushdown Automata 149
12. Friedman, E.P.: The inclusion problem for simple languages. Theor. Comput. Sci. 1(4),
297–316 (1976)
13. Rusinowitch, M., Turuani, M.: Protocol Insecurity with Finite Number of Sessions and Com-
posed Keys is NP-complete. Theoretical Computer Science 299, 451–475 (2003)
14. Sénizergues, G.: The equivalence problem for deterministic pushdown automata is decidable.
In: Degano, P., Gorrieri, R., Marchetti-Spaccamela, A. (eds.) ICALP 1997. LNCS, vol. 1256,
pp. 671–681. Springer, Heidelberg (1997)
15. Sénizergues, G.: L(A)=L(B)? Decidability results from complete formal systems. Theor.
Comput. Sci. 251(1-2), 1–166 (2001)
16. Stirling, C.: Deciding DPDA equivalence is primitive recursive. In: Widmayer, P., Triguero,
F., Morales, R., Hennessy, M., Eidenbenz, S., Conejo, R. (eds.) ICALP 2002. LNCS,
vol. 2380, pp. 821–832. Springer, Heidelberg (2002)
17. Tiu, A., Dawson, J.E.: Automating open bisimulation checking for the SPI calculus. In: 23rd
IEEE Computer Security Foundations Symposium (CSF 2010), pp. 307–321 (2010)
Efficient Separability of Regular Languages
by Subsequences and Suffixes
1 Introduction
In this paper we are motivated by scenarios in which we want to describe some-
thing complex by means of a simple language. The technical core of our scenarios
consists of separation problems, which are usually of the following form:
Given are two languages K and L. Does there exist a language S, coming
from a family F of simple languages, such that S contains everything
from K and nothing from L?
The family F of simple languages could be, for example, languages definable in
FO, piecewise testable languages, or languages definable with small automata.
Our work is specifically motivated by two seemingly orthogonal problems
coming from practice: (a) increasing the user-friendliness of XML Schema and
(b) efficient approximate query answering. We explain these next.
Our first motivation comes from simplifying XML Schema. XML Schema is
currently the only industrially accepted and widely supported schema language
for XML. Historically, it is designed to alleviate the limited expressiveness of
Document Type Definition (DTD) [6], thereby making DTDs obsolete. Unfor-
tunately, XML Schema’s extra expressiveness comes at the cost of simplicity.
Its code is designed to be machine-readable rather than human-readable and
its logical core, based on complex types, does not seem well-understood by users
[16]. One reason may be that the specification of XML Schema’s core [8] consists
of over 100 pages of intricate text. The BonXai schema language [16,17] is an
attempt to overcome these issues and to combine the simplicity of DTDs with
the expressiveness of XML Schema. It has exactly the same expressive power as
XML Schema, is designed to be human-readable, and avoids the use of complex
types. Therefore, it aims at simplifying the development or analysis of XSDs.
In its core, a BonXai schema is a set of rules L1 → R1 , . . . , Ln → Rn in which
all Li and Ri are regular expressions. An unranked tree t (basically, an XML
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 150–161, 2013.
c Springer-Verlag Berlin Heidelberg 2013
Efficient Separability of Regular Languages by Subsequences and Suffixes 151
document) is in the language of the schema if, for every node u, the word formed
by the labels of u’s children is in the language Rk , where k is the largest num-
ber such that the word of ancestors of u is in Lk . This semantical definition is
designed to ensure full back-and-forth compatibility with XML Schema [16].
When translating an XML Schema Definition (XSD) into an equivalent BonXai
schema, the regular expressions Li are obtained from a finite automaton that is
embedded in the XSD. Since the current state-of-the-art in translating automata
to expressions does not yet generate human-readable results, we are investigating
simpler classes of expressions which we expect to suffice in practice. Practical and
theoretical studies show evidence that regular expressions of the form Σ ∗ w (with
w ∈ Σ + ) and Σ ∗ a1 Σ ∗ · · · Σ ∗ an (with a1 , . . . , an ∈ Σ) and variations thereof seem
to be quite well-suited [9,13,18]. We study these kinds of expressions in this paper.
Our second motivation comes from efficient approximate query answering.
Efficiently evaluating regular expressions is relevant in a very wide array of fields.
We choose one: in graph databases and in the context of the SPARQL language
[5,10,14,19] for querying RDF data. Typically, regular expressions are used in
this context to match paths between nodes in a huge graph. In fact, the data can
be so huge that exact evaluation of a regular expression r over the graph (which
can lead to a product construction between an automaton for the expression and
the graph [14,19]) may not be feasible within reasonable time. Therefore, as a
compromise to exact evaluation, one could imagine that we try to rewrite the
regular expression r as an expression that we can evaluate much more efficiently
and is close enough to r. Concretely, we could specify two expressions rpos (resp.,
rneg ) that define the language we want to (resp., do not want to) match in our
answer and ask whether there exists a simple query (e.g., defining a piecewise
testable language) that satisfies these constraints. Notice that the scenario of
approximating an expression r in this way is very general and not even limited
to databases. (Also, we can take rneg to be the complement of rpos .)
At first sight, these two motivating scenarios may seem to be fundamentally
different. In the first, we want to compute an exact simple description of a
complex object and in the second one we want to compute an approximate simple
query that can be evaluated more efficiently. However, both scenarios boil down
to the same underlying question of language separation. Our contributions are:
(1) We formally define separation problems that closely correspond to the mo-
tivating scenarios. Query approximation will be abstracted as separation and
schema simplification as layer-separation (Section 2.1).
(2) We prove the equivalece of separability of languages K and L by boolean com-
binations of simple languages, layer-separability, and the existence of an infinite
sequence of words that goes back and forth between K and L. This characteri-
zation shows how the exact and approximate scenario are related and does not
require K and L to be regular (Sec. 3). Our characterization generalizes a result
by Stern [23] that says that a regular language L is piecewise testable iff every
increasing infinite sequence of words (w.r.t. subsequence ordering) alternates
finitely many times between L and its complement.
152 W. Czerwiński, W. Martens, and T. Masopust
of the form Σ ∗ a1 Σ ∗ . . . Σ ∗ an Σ ∗ which means that it is also regular, see also [7].
A language is piecewise testable if it is a finite boolean combination of /-closed
languages (or, finite boolean combination of languages Σ ∗ a1 Σ ∗ · · · Σ ∗ an Σ ∗ ). In
this paper, all boolean combinations are finite.
We now define a tool (similar to and slightly more general than the alternat-
ing towers of Stern [23]) that allows us to determine when languages are not
separable. For languages K and L and a quasi-order , we say that a sequence
(wi )ki=1 of words is a -zigzag between K and L if w1 ∈ K ∪ L and, for all
i = 1, . . . , k − 1:
(1) wi wi+1 ; (2) wi ∈ K implies wi+1 ∈ L; and (3) wi ∈ L implies wi+1 ∈ K.
We say that k is the length of the -zigzag. We similarly define an infinite
sequence of words to be an infinite -zigzag between K and L. If the languages
K and L are clear from the context then we sometimes omit them and refer
to the sequence as a (infinite) -zigzag. If we consider the subsequence order
/, then we simply write a zigzag instead of a /-zigzag. Notice that we do not
require K and L to be disjoint. If there is a w ∈ K ∩ L then there clearly exists
an infinite zigzag: w, w, w, . . .
Example 2. In order to illustrate infinite zigzags consider the languages K =
{a(ab)2k c(ac)2 | k, ≥ 0} and L = {b(ab)2k+1 c(ac)2+1 | k, ≥ 0}. Then the
following infinite sequence is an infinite zigzag between K and L:
b(ab)i c(ac)i if i is odd
wi =
a(ab)i c(ac)i if i is even
Indeed w1 ∈ L, words from the sequence alternately belong to K and L, and for
all i ≥ 1 we have wi / wi+1 . %
&
3 A Characterization of Separability
The aim of this section is to prove the following theorem. It extends a result by
Stern that characterizes piecewise testable languages [23]. In particular, it also
applies to non-regular languages and does not require K to be the complement
of L.
Theorem 3. For languages K and L and a WQO on words, the following
are equivalent.
(1) K and L are separable by a boolean combination of -closed languages.
(2) K and L are layer-separable by -closed languages.
(3) There does not exist an infinite -zigzag between K and L.
Some of the equivalences in the theorem still hold when the assumptions are
weakened. For example the equivalence between (1) and (2) does not require
to be a WQO.
Since the subsequence order / is a WQO on words, we know from The-
orem 3 that languages are separable by piecewise testable languages if and
only if they are layer-separable by /-closed languages. Actually, since / is a
WQO (and therefore only has finitely many minimal elements within a lan-
guage), the latter is equivalent to being layer-separable by languages of the form
Σ ∗ a1 Σ ∗ · · · Σ ∗ an Σ ∗ .
156 W. Czerwiński, W. Martens, and T. Masopust
section, we always mean /-zigzag. We show here how to decide the existence
of an infinite zigzag between two regular word languages, given by their regular
expressions or NFAs, in polynomial time. According to Theorem 3, this is equiv-
alent to deciding if the two languages can be separated by a piecewise testable
language.
To this end, we first prove a decomposition result that is reminiscent of a
result of Almeida ([1], Theorem 4.1 in [3]). We show that, if there is an infinite
zigzag between regular languages, then there is an infinite zigzag of a special
form in which every word can be decomposed in some synchronized manner. We
can find these special forms of zigzags in polynomial time in the NFAs for the
languages. The main features are that our algorithm runs exponentially faster
in the alphabet size than the current state-of-the-art [4] and that our algorithm
and its proof of correctness do not require knowledge of the algebraic perspective
on regular languages.
A regular language is a cycle language if it is of the form u(v)∗ w, where u, v, w
are words and (Alph(u) ∪ Alph(w)) ⊆ Alph(v). We say that v is a cycle of the
language and that Alph(v) is its cycle alphabet. Regular languages LA and LB
are synchronized in one step if they are of one of the following forms:
– LA = LB = {w}, that is, they are the same singleton word, or
– LA and LB are cycle languages with equal cycle alphabets.
We say that regular languages LA and LB are synchronized if they are of the form
LA = D1A D2A . . . DkA and LB = D1B D2B . . . DkB where, for all 1 ≤ i ≤ k, languages
DiA and DiB are synchronized in one step. So, languages are synchronized if they
can be decomposed into (equally many) components that can be synchronized
in one step. Notice that synchronized languages are always non-empty.
Example 8. Languages LA = a(ba)∗ aab ca bb(bc)∗ and LB =
b(aab) ba ca cc(cbc) b are synchronized. Indeed, LA = D1A D2A D3A and
∗ ∗
LB = D1B D2B D3B for D1A = a(ba)∗ aab, D2A = ca, D3A = bb(cb)∗ and
D1B = b(aab)∗ ba, D2B = ca, and D3B = cc(cbc)∗ b.
The next lemma shows that, in order to search for infinite zigzags, it suffices
to search for synchronized sublanguages. The proof goes through a sequence of
lemmas that gradually shows how the sublanguages of LA and LB can be made
more and more specific.
Lemma 9 (Synchronization / Decomposition). There is an infinite zigzag
between regular languages LA and LB if and only if there exist synchronized
languages K A ⊆ LA and K B ⊆ LB .
We now use this result to obtain a polynomial-time algorithm solving our prob-
lem. The first step is to define what it means for NFAs to contain synchronized
sublanguages.
For an NFA A over an alphabet Σ, two states p, q, and a word w ∈ Σ ∗ , we
w
write p −→ q if q ∈ δ ∗ (p, w) or, in other words, the automaton can go from state
p to state q by reading w. For Σ0 ⊆ Σ, states p and q are Σ0 -connected in A if
there exists a word uvw ∈ Σ0∗ such that:
158 W. Czerwiński, W. Martens, and T. Masopust
A qkB
qjA qj+1 q1B
A = q0A B = q0B
B
q1A qkA qj+1
qjB
1. Alph(v) = Σ0 and
u v w
2. there is a state m such that p −
→ m, m −
→ m, and m −
→ q.
Consider two NFAs A = (QA , Σ, δ A , q0A , F A ) and B = (QB , Σ, δ B , q0B , F B ). Let
(q A , q B ) and (q̄ A , q̄ B ) be in QA × QB . We say that (q A , q B ) and (q̄ A , q̄ B ) are
synchronizable in one step if one of the following situations occurs:
a a
– there exists a symbol a in Σ such that q A −
→ q̄ A and q B −
→ q̄ B ,
A A
– there exists an alphabet Σ0 ⊆ Σ such that q and q̄ are Σ0 -connected in
A and q B and q̄ B are Σ0 -connected in B.
We say that automata A and B are synchronizable if there exists a sequence of
pairs (q0A , q0B ), . . . , (qkA , qkB ) ∈ QA × QB such that:
1. for all 0 ≤ i < k, (qiA , qiB ) and (qi+1
A B
, qi+1 ) are synchronizable in one step;
2. states q0A and q0B are initial states of A and B, respectively; and
3. states qkA and qkB are accepting states of A and B, respectively.
Notice that if the automata A and B are synchronizable, then the languages
L(A) and L(B) are not necessarily synchronized, only some of its sublanguages
are necessarily synchronized.
Lemma 10 (Synchronizability of automata). For two NFAs A and B, the
following conditions are equivalent.
1. Automata A and B are synchronizable.
2. There exist synchronized languages K A ⊆ L(A) and K B ⊆ L(B).
The intuition behind Lemma 10 is depicted in Figure 2. The idea is that there is
a sequence (q0A , q0B ), . . . , (qkA , qkB ) that witnesses that A and B are synchronizable.
The pairs of paths that have the same style of lines depict parts of the automaton
that are synchronizable in one step. In particular, the dotted path from q1A to
qjA has the same word as the one from q1B to qjB . The other two paths contain at
least one loop.
The following theorem states that synchronizability in automata captures
exactly the existence of infinite zigzags between their languages. The theorem
statement uses Theorem 3 for the connection between infinite zigzags and sepa-
rability.
Efficient Separability of Regular Languages by Subsequences and Suffixes 159
Theorem 11. Let A and B be two NFAs. Then the languages L(A) and L(B)
are separable by a piecewise testable language if and only if the automata A and
B are not synchronizable.
We can now show how the algorithm from [4] can be improved to test in poly-
nomial time whether two given NFAs are synchronizable or not. Our algorithm
computes quadruples of states that are synchronizable in one step and links such
quadruples together so that they form a pair of paths as illustrated in Figure 2.
Theorem 12. Given two NFAs A and B, it is possible to test in polynomial
time whether L(A) and L(B) can be separated by a piecewise testable language.
Theorem 13. For O ∈ {/, /s } and C being one of single, unions, or boolean
combinations, we have that the complexity of the separation problem by F (O, C)
is as indicated in Table 1.
Since the separation problem for prefix order is basically the same as the sepa-
ration for suffix order and has the same complexity we didn’t list it separately
in the table.
160 W. Czerwiński, W. Martens, and T. Masopust
References
6. Bray, T., Paoli, J., Sperberg-McQueen, C.M., Maler, E., Yergeau, F.: Extensi-
ble Markup Language XML 1.0, 5th edn. Tech. report, W3C Recommendation
(November 2008), http://www.w3.org/TR/2008/REC-xml-20081126/
7. Ehrenfeucht, A., Haussler, D., Rozenberg, G.: On regularity of context-free lan-
guages. Theoretical Computer Science 27(3), 311–332 (1983)
8. Gao, S., Sperberg-McQueen, C.M., Thompson, H.S., Mendelsohn, N., Beech, D.,
Maloney, M.: W3C XML Schema Definition Language (XSD) 1.1 part 1. Tech.
report, W3C (2009), http://www.w3.org/TR/2009/CR-xmlschema11-1-20090430/
9. Gelade, W., Neven, F.: Succinctness of pattern-based schema languages for XML.
Journal of Computer and System Sciences 77(3), 505–519 (2011)
10. Harris, S., Seaborne, A.: SPARQL 1.1 query language. Tech. report, W3C (2010)
11. Henckell, K., Rhodes, J., Steinberg, B.: Aperiodic pointlikes and beyond. Interna-
tional Journal of Algebra and Computation 20(2), 287–305 (2010)
12. Higman, G.: Ordering by divisibility in abstract algebras. Proceedings of the Lon-
don Mathematical Society s3-2(1), 326–336 (1952)
13. Kasneci, G., Schwentick, T.: The complexity of reasoning about pattern-based
XML schemas. In: Principles of Database Systems, pp. 155–164 (2007)
14. Losemann, K., Martens, W.: The complexity of evaluating path expressions in
SPARQL. In: Principles of Database Systems, pp. 101–112 (2012)
15. Maier, D.: The complexity of some problems on subsequences and supersequences.
Journal of the ACM 25(2), 322–336 (1978)
16. Martens, W., Neven, F., Niewerth, M., Schwentick, T.: Developing and analyzing
XSDs through BonXai. Proc. of the VLDB Endowment 5(12), 1994–1997 (2012)
17. Martens, W., Neven, F., Niewerth, M., Schwentick, T.: BonXai: Combining the
simplicity of DTD with the expressiveness of XML Schema (manuscript 2013)
18. Martens, W., Neven, F., Schwentick, T., Bex, G.J.: Expressiveness and complexity
of XML Schema. ACM Trans. on Database Systems 31(3), 770–813 (2006)
19. Pérez, J., Arenas, M., Gutierrez, C.: nSPARQL: A navigational language for RDF.
Journal of Web Semantics 8(4), 255–270 (2010)
20. Simon, I.: Hierarchies of Events with Dot-Depth One. PhD thesis, Dep. of Applied
Analysis and Computer Science, University of Waterloo, Canada (1972)
21. Simon, I.: Piecewise testable events. In: Brakhage, H. (ed.) GI Conference on Au-
tomata Theory and Formal Languages. LNCS, vol. 33, pp. 214–222. Springer, Hei-
delberg (1975)
22. Steinberg, B.: A delay theorem for pointlikes. Semigroup Forum 63, 281–304 (2001)
23. Stern, J.: Characterizations of some classes of regular events. Theoretical Computer
Science 35(1985), 17–42 (1985)
24. Stern, J.: Complexity of some problems from the theory of automata. Information
and Control 66(3), 163–176 (1985)
25. Trahtman, A.N.: Piecewise and local threshold testability of DFA. In: Freivalds,
R. (ed.) FCT 2001. LNCS, vol. 2138, pp. 347–358. Springer, Heidelberg (2001)
26. van Rooijen, L., Zeitoun, M.: The separation problem for regular languages by
piecewise testable languages (March 8, 2013), http://arxiv.org/abs/1303.2143
On the Complexity of Verifying Regular
Properties on Flat Counter Systems,
1 Introduction
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 162–173, 2013.
c Springer-Verlag Berlin Heidelberg 2013
On the Complexity of Verifying Regular Properties on Flat Counter Systems 163
some finite union of path schemas L. Similarly, a flat counter system, a system
in which each control state belongs to at most one simple loop, verifies that the
set of runs from c0 is equal to Runs(c0 , L) for some finite union of path schemas
L. Obviously, flat counter systems are flattable. Moreover, reachability sets of
flattable counter systems are known to be Presburger-definable, see e.g. [1,3,7].
That is why, verification of flat counter systems belongs to the core of methods
for model-checking arbitrary counter systems and it is desirable to character-
ize the computational complexity of model checking problems on this kind of
systems (see e.g. results about loops in [2]). Decidability results for verifying
safety and reachability properties on flat counter systems have been obtained
in [3,7,2]. For the verification of temporal properties, it is much more difficult to
get sharp complexity characterization. For instance, it is known that verifying
flat counter systems with CTL enriched with arithmetical constraints is decid-
able [6] whereas it is only NP-complete with Past LTL [4] (NP-completeness
already holds with flat Kripke structures [10]).
2 Preliminaries
2.1 Counter Systems
Counter constraints are defined below as a subclass of Presburger formulae whose
free variables are understood as counters. Such constraints are used to define
guards in counter systems but also to define arithmetical constraints in temporal
formulae. Let C = {x1 , x2 , . . .} be a countably infinite set of counters (variables
interpreted over non-negative integers) and AT = {p1 , p2 , . . .} be a countable
infinite set of propositional variables (abstract properties about program points).
We write Cn to denote the restriction of C to {x1 , x2 , . . . , xn }. The set of guards
g using the counters from Cn , written G(Cn ), is made of Boolean combinations
n
of atomic guards of the form i=0 ai · xi ∼ b where the ai ’s are in Z, b ∈ N
and ∼∈ {=, ≤, ≥, <, >}. For g ∈ G(Cn ) and a vector v ∈ Nn , we say that v
satisfies g, written v |= g, if the formula obtained by replacing each xi by v[i]
holds. For n ≥ 1, a counter system of dimension n (shortly a counter system)
S is a tuple Q, Cn , Δ, l where: Q is a finite set of control states, l : Q → 2AT
is a labeling function, Δ ⊆ Q × G(Cn ) × Zn × Q is a finite set of transitions
labeled by guards and updates. As usual, to a counter system S = Q, Cn , Δ, l,
we associate a labeled transition system T S(S) = C, → where C = Q × Nn is
the set of configurations and →⊆ C × Δ × C is the transition relation defined
δ
by: q, v, δ, q , v ∈→ (also written q, v −
→ q , v ) iff δ = q, g, u, q ∈ Δ,
v |= g and v = v + u. Note that in such a transition system, the counter values
are non-negative since C = Q × Nn .
Given an initial configuration c0 ∈ Q × Nn , a run ρ starting from c0 in S
is an infinite path in the associated transition system T S(S) denoted as: ρ :=
δ δm−1 δ
c0 −→0
· · · −−−→ cm −−
→ · · · where ci ∈ Q × Nn and δi ∈ Δ for all i ∈ N. We
m
say that a counter system is flat if every node in the underlying graph belongs
to at most one simple cycle (a cycle being simple if no edge is repeated twice
in it) [3,14,4]. We denote by CF S the class of flat counter systems. A Kripke
structure S can be seen as a counter system without counter and is denoted
by Q, Δ, l where Δ ⊆ Q × Q and l : Q → 2AT . Standard notions on counter
systems, as configuration, run or flatness, naturally apply to Kripke structures.
that A is over the constrained alphabet at, agn , Σ, whenever, for all edges
q, ψ, ψ ∈ E, ψ holds at most for letters from Σ (i.e. the transition relation
of BA belongs to Q × Σ → B+ (Q) ). We have then L(A) = L(BA ) with the usual
acceptance criterion for alternating Büchi automata. The specification language
BA is defined in a similar way using Büchi automata. Hence the transition re-
lation E of A = Q, E, q0 , F in BA is included in Q × B(at ∪ agn ) × Q and the
transition relation of the Büchi automaton BA is then included in Q×2at∪agn ×Q.
of Past LTL for counter systems in [4]). However, we may recall a few definitions
on-the-fly if needed. Herein the size of formulae is understood as the number of
subformulae.
Example. In adjoining figure, we present a flat counter system with two counters
and with labeling function l such that l(q3 ) = {p, q} and l(q5 ) = {p}. We would
like to characterize the set of configurations c with control state q1 such that
there is some infinite run from c for which after some position i, all future even
positions j (i.e. i ≡2 j) satisfy that p holds and the first counter is equal to the
second counter.
start q1
{p1 (l1 )n1 · · · pk−1 (lk−1 )nk−1 pk (lk )ω : φ(n1 , . . . , nk−1 ) holds true}. The size of
cps, written size(cps), is equal to 2k + len(p1 l1 · · · pk−1 lk−1 pk lk ) + size(φ(x1 , . . . ,
xk−1 )). Observe that in general constrained path schemas are defined under con-
strained alphabet and so will the associated specifications unless stated
otherwise.
Let us consider below the three decision problems on constrained path schemas
that are useful in the rest of the paper. Consistency problem checks whether
On the Complexity of Verifying Regular Properties on Flat Counter Systems 167
over at, agn , Σ in X; (2) Build A such that L(A) ∩ (Σ )ω = L(A ); (3) Return
L(cps) ∩ L(A ) = ∅. Thanks to Theorem 2, the first guess can be performed
in polynomial time and with the nice subalphabet property, we can build A in
polynomial time too. This allows us to conclude the following lemma which is a
consequence of the correctness of the above algorithm (see [5]).
Lemma 4. If L has the nice subalphabet property and its intersection non-
emptiness problem is in NP[resp. PSpace], then MC(L, CF S) is in NP[resp.
PSpace]
We know that the membership problem for Past LTL is in PTime and the inter-
section non-emptiness problem is in NP (as a consequence of [4, Theorem 3]). By
Lemma 4, we are able to conclude the main result from [4]: MC(PastLTL, CF S)
is in NP. This is not surprising at all since in this paper we present a general
method for different specification languages that rests on Theorem 2 (a conse-
quence of technical developments from [4]).
path schemas with two loops (in UP∩co-UP [9]) and model-checking uncon-
strained path schemas (Kripke structures) made of a single loop, which is in
contrast to Past LTL for which model-checking unconstrained path schemas
with a bounded number of loops is in PTime [4, Theorem 9].
As an additional corollary, we can solve the global model-checking problem
with existential Presburger formulae. The global model-checking consists in char-
acterizing the set of initial configurations from which there exists a run satisfying
a given specification. We knew that Presburger formulae exist for global model-
checking [6] for Past LTL (and therefore for FO) but we can conclude that they
are structurally simple and we provide an alternative proof. Moreover, the ques-
tion has been open for μTL since the decidability status of MC(μTL, CF S) has
been only resolved in the present work.
Corollary 16. Let L be a specification language among FO, BA, ABA, ETL or
μTL. Given a flat counter system S, a control state q and a specification A in
L, one can effectively build an existential Presburger formula φ(z1 , . . . , zn ) such
that for all v ∈ Nn . v |= φ iff there is a run ρ starting at q, v verifying ρ |= A.
6 Conclusion
Flat counter systems Kripke struct. Flat Kripke struct. Ult. periodic KS
μTL PSpace-C (Thm. 14) PSpace-C [23] PSpace-C (Thm. 14) in UP∩co-UP [16]
ABA PSpace-C (Thm. 14) PSpace-C PSpace-C (Thm. 14) in PTime (see e.g. [11, p. 3])
ETL in PSpace (Thm. 14) PSpace-C [21] in PSpace [21] in PTime (see e.g. [19,11])
BA NP-C (Thm.12) in PTime in PTime in PTime
FO PSpace-C (Thm. 9) Non-el. [22] PSpace-C (Thm. 9) PSpace-C [15]
Past LTL NP-C [4] PSpace-C [21] NP-C [10,4] PTime [13]
On the Complexity of Verifying Regular Properties on Flat Counter Systems 173
References
1. Boigelot, B.: Symbolic methods for exploring infinite state spaces. PhD thesis,
Université de Liège (1998)
2. Bozga, M., Iosif, R., Konečný, F.: Fast acceleration of ultimately periodic relations.
In: Touili, T., Cook, B., Jackson, P. (eds.) CAV 2010. LNCS, vol. 6174, pp. 227–242.
Springer, Heidelberg (2010)
3. Comon, H., Jurski, Y.: Multiple counter automata, safety analysis and PA. In: Vardi,
M.Y. (ed.) CAV 1998. LNCS, vol. 1427, pp. 268–279. Springer, Heidelberg (1998)
4. Demri, S., Dhar, A.K., Sangnier, A.: Taming Past LTL and Flat Counter Sys-
tems. In: Gramlich, B., Miller, D., Sattler, U. (eds.) IJCAR 2012. LNCS (LNAI),
vol. 7364, pp. 179–193. Springer, Heidelberg (2012)
5. Demri, S., Dhar, A.K., Sangnier, A.: On the complexity of verifying regular prop-
erties on flat counter systems (2013), http://arxiv.org/abs/1304.6301
6. Demri, S., Finkel, A., Goranko, V., van Drimmelen, G.: Model-checking CTL∗ over
flat Presburger counter systems. JANCL 20(4), 313–344 (2010)
7. Finkel, A., Leroux, J.: How to compose presburger-accelerations: Applications to
broadcast protocols. In: Agrawal, M., Seth, A.K. (eds.) FSTTCS 2002. LNCS,
vol. 2556, pp. 145–156. Springer, Heidelberg (2002)
8. Jančar, P., Sawa, Z.: A note on emptiness for alternating finite automata with a
one-letter alphabet. IPL 104(5), 164–167 (2007)
9. Jurdziński, M.: Deciding the winner in parity games is in UP ∩ co-UP. IPL 68(3),
119–124 (1998)
10. Kuhtz, L., Finkbeiner, B.: Weak kripke structures and LTL. In: Katoen, J.-P.,
König, B. (eds.) CONCUR 2011. LNCS, vol. 6901, pp. 419–433. Springer, Heidel-
berg (2011)
11. Kupferman, O., Vardi, M.: Weak alternating automata are not that weak. ACM
Transactions on Computational Logic 2(3), 408–429 (2001)
12. Kučera, A., Strejček, J.: The stuttering principle revisited. Acta Informatica 41(7-
8), 415–434 (2005)
13. Laroussinie, F., Markey, N., Schnoebelen, P.: Temporal logic with forgettable past.
In: LICS 2002, pp. 383–392. IEEE (2002)
14. Leroux, J., Sutre, G.: Flat counter systems are everywhere! In: Peled, D.A., Tsay,
Y.-K. (eds.) ATVA 2005. LNCS, vol. 3707, pp. 489–503. Springer, Heidelberg (2005)
15. Markey, N., Schnoebelen, P.: Model checking a path. In: Amadio, R.M., Lugiez, D.
(eds.) CONCUR 2003. LNCS, vol. 2761, pp. 251–265. Springer, Heidelberg (2003)
16. Markey, N., Schnoebelen, P.: Mu-calculus path checking. IPL 97(6) (2006)
17. Minsky, M.: Computation, Finite and Infinite Machines. Prentice Hall (1967)
18. Miyano, S., Hayashi, T.: Alternating finite automata on ω-words. Theor. Comput.
Sci. 32, 321–330 (1984)
19. Piterman, N.: Extending temporal logic with ω-automata. Master’s thesis, The
Weizmann Institute of Science (2000)
20. Pottier, L.: Minimal Solutions of Linear Diophantine Systems: Bounds and Algo-
rithms. In: Book, R.V. (ed.) RTA 1991. LNCS, vol. 488, pp. 162–173. Springer,
Heidelberg (1991)
21. Sistla, A., Clarke, E.: The complexity of propositional linear temporal logic.
JACM 32(3), 733–749 (1985)
22. Stockmeyer, L.J.: The complexity of decision problems in automata and logic. PhD
thesis, MIT (1974)
23. Vardi, M.: A temporal fixpoint calculus. In: POPL 1988, pp. 250–259. ACM (1988)
24. Vardi, M., Wolper, P.: Reasoning about infinite computations. I&C 115 (1994)
25. Wolper, P.: Temporal logic can be more expressive. I&C 56, 72–99 (1983)
Multiparty Compatibility in Communicating Automata:
Characterisation and Synthesis of Global Session Types
Abstract. Multiparty session types are a type system that can ensure the safety
and liveness of distributed peers via the global specification of their interac-
tions. To construct a global specification from a set of distributed uncontrolled
behaviours, this paper explores the problem of fully characterising multiparty
session types in terms of communicating automata. We equip global and local
session types with labelled transition systems (LTSs) that faithfully represent
asynchronous communications through unbounded buffered channels. Using the
equivalence between the two LTSs, we identify a class of communicating au-
tomata that exactly correspond to the projected local types. We exhibit an algo-
rithm to synthesise a global type from a collection of communicating automata.
The key property of our findings is the notion of multiparty compatibility which
non-trivially extends the duality condition for binary session types.
1 Introduction
Over the last decade, session types [12,18] have been studied as data types or functional
types for communications and distributed systems. A recent discovery by [4,20], which
establishes a Curry-Howard isomorphism between binary session types and linear log-
ics, confirms that session types and the notion of duality between type constructs have
canonical meanings. Multiparty session types [2,13] were proposed as a major general-
isation of binary session types. They can enforce communication safety and deadlock-
freedom for more than two peers thanks to a choreographic specification (called global
type) of the interaction. Global types are projected to end-point types (local types),
against which processes can be statically type-checked and verified to behave correctly.
The motivation of this paper comes from our practical experiences that, in many
situations, even where we start from the end-point projections of a choreography, we
need to reconstruct a global type from distributed specifications. End-point specifica-
tions are usually available, either through inference from the control flow, or through
existing service interfaces, and always in forms akin to individual communicating finite
state machines. If one knows the precise conditions under which a global type can be
constructed (i.e. the conditions of synthesis), not only the global safety property which
multiparty session types ensure is guaranteed, but also the generated global type can
be used as a refinement and be integrated within the distributed system development
life-cycle (see [17]). This paper attempts to give the synthesis condition as a sound
and complete characterisation of multiparty session types with respect to Communi-
cating Finite State Machines (CFSMs) [3]. CFSMs have been a well-studied formal-
ism for analysing distributed safety properties and are widely present in industry tools.
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 174–186, 2013.
© Springer-Verlag Berlin Heidelberg 2013
Multiparty Compatibility in Communicating Automata 175
They can been seen as generalised end-point specifications, therefore an excellent target
for a common comparison ground and for synthesis. As explained below, to identify a
complete set of CFSMs for synthesis, we first need to answer a question – what is the
canonical duality notion in multiparty session types?
Characterisation of Binary Session Types as Communicating Automata. The sub-
class which fully characterises binary session types was actually proposed by Gouda,
Manning and Yu in 1984 [11] in a pure communicating automata context. Consider a
simple business protocol between a Buyer and a Seller from the Buyer’s viewpoint:
Buyer sends the title of a book, Seller answers with a quote. If Buyer is satisfied by the
quote, then he sends his address and Seller sends back the delivery date; otherwise it
retries the same conversation. This can be described by the following session type:
μ t.! title; ?quote; !{ ok :! addrs; ?date; end, retry : t } (1.1)
where the operator ! title denotes an output of the title, whereas ?quote denotes an in-
put of a quote. The output choice features the two options ok and retry and ; denotes
sequencing. end represents the termination of the session, and μ t is recursion.
The simplicity and tractability of binary sessions come from the notion of duality in
interactions [10]. The interaction pattern of the Seller is fully given as the dual of the
type in (1.1) (exchanging input ! and output ? in the original type). When composing
two parties, we only have to check they have mutually dual types, and the resulting
communication is guaranteed to be deadlock-free. Essentially the same characterisation
is given in communicating automata. Buyer and Seller’s session types are represented
by the following two machines.
?retry !retry
/.-,w
→ ()*+ //.-,
()*+ //.-,
()*+ //.-,
()*+ //.-,
()*+ //.-,
()*+
/.-,w
→ ()*+ //.-,
()*+ //.-,
()*+ //.-,
()*+ //.-,
()*+ //.-,
()*+
!title ?quote ?ok !addrs ?date ?title !quote !ok ?addrs !date
We can observe that these CFSMs satisfy three conditions. First, the communications
are deterministic: messages that are part of the same choice, ok and retry here, are dis-
tinct. Secondly, there is no mixed state (each state has either only sending actions or
only receiving actions). Third, these two machines have compatible traces (i.e. dual):
the Seller machine can be defined by exchanging sending to receiving actions and
vice versa. Breaking one of these conditions allows deadlock situations and breaking
one of the first two conditions makes the compatibility checking undecidable [11, 19].
AB!quit
Multiparty Compatibility. This notion of duality is A → ()*+
/.-,
]
/ AC!finish ()*+
()*+
/.-, //.-,
no longer effective in multiparty communications, AB!act
where the whole conversation cannot be reconstructed AC!commit
()*+
/.-,
from only a single behaviour. To bypass the gap be- AB?quit
B → ()*+
/.-, / ()*+
/.-, //.-,
()*+
BC!save
tween binary and multiparty, we take the synthesis ]
approach, that is to find conditions which allow a AB?act
BC!sig
global choreography to be built from the local ma- ()*+
/.-,
chine behaviour. Instead of directly trying to decide
C → ()*+
/.-, //.-, AC?finish ()*+
()*+ //.-,
BC?save
whether the communications of a system will satisfy ]
BC?sig
safety (which is undecidable in the general case), in- AC?commit
()*+
/.-,
ferring a global type guarantees the safety as a direct Commit
consequence.
176 P.-M. Deniélou and N. Yoshida
We give a simple example above to illustrate the problem. The Commit protocol in-
volves three machines: Alice A, Bob B and Carol C. A orders B to act or quit. If act is
sent, B sends a signal to C, and A sends a commitment to C and continues. Otherwise B
informs C to save the data and A gives the final notification to C to terminate the protocol.
This paper presents a decidable notion of multiparty compatibility as a generalisa-
tion of duality of binary sessions, which in turns characterises a synthesis condition.
The idea is to check the duality between each automaton and the rest, up to the inter-
nal communications (1-bounded executions in the terminology of CFSMs, see § 2) that
the other machines will independently perform. For example, in the Commit example,
to check the compatibility of trace AB!quit AC!finish in A, we observe the dual trace
AB?quit · AC?finish from B and C executing the internal communications between B and
C such that BC!save· BC?save. If this extended duality is valid for all the machines from
any 1-bounded reachable state, then they satisfy multiparty compatibility and can build
a well-formed global choreography.
Contributions and Outline. Section 3 defines new labelled transition systems for
global and local types that represent the abstract observable behaviour of typed pro-
cesses. We prove that a global type behaves exactly as its projected local types, and
the same result between a single local type and its CFSMs interpretation. These corre-
spondences are the key to prove the main theorems. Section 4 defines multiparty com-
patibility, studies its safety and liveness properties, gives an algorithm for the synthesis
of global types from CFSMs, and proves the soundness and completeness results be-
tween global types and CFSMs. Section 5 discusses related work and concludes. The
full proofs and applications of this work can be found in [17].
This section starts from some preliminary notations (following [6]). ε is the empty
word. A is a finite alphabet and A∗ is the set of all finite words over A. |x| is the length
of a word x and x.y or xy the concatenation of two words x and y. Let P be a set of
participants fixed throughout the paper: P ⊆ {A, B, C, . . ., p, q, . . . }.
In transitions, pq!a denotes the sending action of a from process p to process q, and
pq?a denotes the receiving action of a from p by q. , 1 range over actions and we define
the subject of an action as the principal in charge of it: subj(pq!a) = subj(qp?a) = p.
A state q ∈ Q whose outgoing transitions are all labelled with sending (resp. receiv-
ing) actions is called a sending (resp. receiving) state. A state q ∈ Q which does not
have any outgoing transition is called final. If q has both sending and receiving outgo-
ing transitions, q is called mixed. We say q is directed if it contains only sending (resp.
receiving) actions to (resp. from) the same (identical) participant. A path in M is a finite
sequence of q0 , . . . , qn (n ≥ 1) such that (qi , , qi+1 ) ∈ δ (0 ≤ i ≤ n − 1), and we write
Multiparty Compatibility in Communicating Automata 177
1
q−
→ q if (q, , q1 ) ∈ δ . M is connected if for every state q = q0 , there is a path from q0
to q. Hereafter we assume each CFSM is connected.
A CFSM M = (Q,C, q0 , A, δ ) is deterministic if for all states q ∈ Q and all actions ,
(q, , q1 ), (q, , q11 ) ∈ δ imply q1 = q11 .1
for all p1 q1 = pq; or (2) t = (qq , pq?a, q1q) ∈ δq and (a) q1p1 = qp1 for all p1 = q; and (b)
wpq = a.w1pq and w1p1 q1 = wp1 q1 for all p1 q1 = pq.
The condition (1-b) puts the content a to a channel pq, while (2-b) gets the content
a from a channel pq. The reflexive and transitive closure of → is →∗ . For a transition
t1 · · · tm
t = (s, , s1 ), we refer to by act(t). We write s1 −−−→sm+1 for s1 −→t1
s2 · · · −
→s
tm
m+1 and use
ϕ to denote t1 · · ·tm . We extend act to these sequences: act(t1 · · ·tn ) = act(t1 ) · · · act(tn ).
The initial configuration of a system is s0 = ("q0 ;"ε ) with "q0 = (q0p )p∈P. A final con-
figuration of the system is s f = ("q;"ε ) with all qp ∈"q final. A configuration s is reachable
if s0 →∗ s and we define the reachable set of S as RS(S) = {s | s0 →∗ s}. We define the
ϕ
traces of a system S to be Tr(S) = {act(ϕ ) | ∃s ∈ RS(S), s0 − → s}.
We now define several properties about communicating systems and their configura-
tions. These properties will be used in § 4 to characterise the systems that correspond to
multiparty session types. Let S be a communicating system, t one of its transitions and
s = ("q;"w) one of its configurations. The following definitions of configuration proper-
ties follow [6, Definition 12].
1. s is stable if all its buffers are empty, i.e., "w = "ε .
2. s is a deadlock configuration if s is not final, and "w = "ε and each qp is a receiving
state, i.e. all machines are blocked, waiting for messages.
3. s is an orphan message configuration if all qp ∈ "q are final but "w = 0,
/ i.e. there is at
least an orphan message in a buffer.
4. s is an unspecified reception configuration if there exists q ∈ P such that qq is a
receiving state and (qq , pq?a, q1q ) ∈ δ implies that |wpq | > 0 and wpq ∈ aA∗ , i.e qq
is prevented from receiving any message from buffer pq.
A sequence of transitions is said to be k-bounded if no channel of any intermediate
configuration si contains more than k messages. We define the k-reachability set of
S to be the largest subset RSk (S) of RS(S) within which each configuration s can be
1 “Deterministic” often means the same channel should carry a unique value, i.e. if (q, c!a, q1 ) ∈
δ and (q, c!a1 , q11 ) ∈ δ then a = a1 and q1 = q11 . Here we follow a different definition [6] in
order to represent branching type constructs.
178 P.-M. Deniélou and N. Yoshida
The mergeability relation # is the smallest congruence relation over local types such
that:
∀i ∈ (K ∩ J).Ti # Ti1 ∀k ∈ (K \ J), ∀ j ∈ (J \ K).ak = a j
p?{ak .Tk }k∈K # p?{a j .T j1 } j∈J
When T1 # T2 holds, we define the operation & as a partial commutative operator over
two types such that T & T = T for all types and that:
p?{ak .Tk }k∈K & p?{a j .T j1 } j∈J = p?({ak .(Tk & Tk1 )}k∈K∩J ∪ {ak .Tk }k∈K\J ∪ {a j .T j1 } j∈J\K )
and homomorphic for other types (i.e. C [T1 ] & C [T2 ] = C [T1 & T2 ] where C is a context
for local types). We say that G is well-formed if for all p ∈ P, G p is defined.
Example 3.1 (Commit). The global type for the commit protocol in § 1 is:
μ t.A → B : {act. B → C : {sig. A → C : commit.t }, quit.B → C : {save.A → C : finish.end}}
Then C’s local type is: μ t.B?{sig.A?{commit.t}, save.A?{finish.end}}.
We now present labelled transition relations (LTS) for global and local types and their
sound and complete correspondence.
LTS over Global Types. We first designate the observables (, 1, ...). We choose here
to follow the definition of actions for CFSMs where a label denotes the sending or the
reception of a message of label a from p to p1 : ::= pp1 !a | pp1 ?a
In order to define an LTS for global types, we need to represent intermediate states
in the execution. For this reason, we introduce in the grammar of G the construct p
p1 : j {ai .Gi }i∈I to represent the fact that a j has been sent but not yet received.
− G1 is defined as (subj() is
Definition 3.1 (LTS over global types.). The relation G →
defined in § 2):
pp1 !a j
[GR1] p → p1 : {ai .Gi }i∈I −−−→ p p1 : j {ai .Gi }i∈I ( j ∈ I)
→ G1
pp1 ?a j G[ μ t.G/t] −
[GR2] p p1 : j {ai .Gi }i∈I −−−−→ G j [GR3]
→ G1
μ t.G −
→ G1j p, q ∈ subj() → G1j q ∈ subj() ∀i ∈ I \ j, G1i = Gi
∀j ∈ I Gj − Gj −
[GR4] [GR5]
→ p → q : {ai .G1i }i∈I → p q : j {ai .G1i }i∈I
p → q : {ai .Gi }i∈I − p q : j {ai .Gi }i∈I −
[GR1] represents the emission of a message while [GR2] describes the reception of
a message. [GR3] governs recursive types. [GR4,5] define the asynchronous seman-
tics of global types, where the syntactic order of messages is enforced only for the
participants that are involved. For example, when the participants of two consecutive
communications are disjoint, as in: G1 = A → B : a.C → D : b.end, we can observe the
emission (and possibly the reception) of b before the interactions of a (by [GR4]).
A more interesting example is: G2 = A → B : a.A → C : b.end. We write 1 = AB!a,
2 = AB?a, 3 = AC!b and 4 = AC?b. The LTS allows the following three sequences:
G2 −
→1
A B : a.A → C : b.end −
→2
A → C : b.end −
→3
A C : b.end −
→4
end
G2 −
→1
A B : a.A → C : b.end −
→3
A B : a.A C : b.end −
→2
A C : b.end −
→4
end
G2 −
→1
A B : a.A → C : b.end −
→3
A B : a.A C : b.end −
→4
A B : a.end −
→2
end
180 P.-M. Deniélou and N. Yoshida
The last sequence is the most interesting: the sender A has to follow the syntactic order
but the receiver C can get the message b before B receives a. The respect of these con-
straints is enforced by the conditions p, q ∈ subj() and q ∈ subj() in rules [GR4,5].
LTS over Local Types. We define the LTS over local types. This is done in two steps,
following the model of CFSMs, where the semantics is given first for individual au-
tomata and then extended to communicating systems. We use the same labels (, 1 , ...)
as the ones for CFSMs.
→ T 1 , for the local type of role
Definition 3.2 (LTS over local types). The relation T −
p, is defined as:
− T1
pq!ai qp?a j T [ μ t.T /t] →
[LR1] q!{ai .Ti }i∈I −−−→ Ti [LR2] q?{ai .Ti }i∈I −−−→ T j [LR3]
→ T1
μ t.T −
The semantics of a local type follows the intuition that every action of the local type
should obey the syntactic order. We define the LTS for collections of local types.
Definition 3.3 (LTS over collections of local types). A configuration s = ("T ;"w) of
a system of local types {Tp }p∈P is a pair with "T = (Tp )p∈P and "w = (wpq )p=q∈P with
wpq ∈ A∗ . We then define the transition system for configurations. For a configuration
pq!a
sT = ("T ;"w), the visible transitions of sT −→ s1T = ("T 1 ; "w1 ) are defined as: (1) Tp −−→ Tp1
and (a) Tp11 = Tp1 for all p1 = p; and (b) w1pq = wpq · a and w1p1 q1 = wp1 q1 for all p1 q1 = pq;
pq?a
or (2) Tq −−→ Tq1 and (a) Tp11 = Tp1 for all p1 = q; and (b) wpq = a · w1pq and w1p1 q1 = wp1 q1
for all p1 q1 = pq.
The semantics of local types is therefore defined over configurations, following the
definition of the semantics of CFSMs. wpq represents the FIFO queue at channel pq.
We write Tr(G) to denote the set of the visible traces that can be obtained by reducing
G. Similarly for Tr(T ) and Tr(S). We extend the trace equivalences ≈ and ≈n in § 2 to
global types and configurations of local types.
We now state the soundness and completeness of projection w.r.t. the LTSs.
Theorem 3.1 (soundness and completeness). 2 Let G be a global type with partici-
pants P and let "T = {G p}p∈P be the local types projected from G. Then G ≈ ("T ;"ε ).
Local types and CFSMs Next we show how to algorithmically go from local types
to CFSMs and back while preserving the trace semantics. We start by translating local
types into CFSMs.
Definition 3.4 (translation from local types to CFSMs). Write T 1 ∈ T if T 1 occurs in
T . Let T0 be the local type of participant p projected from G. The automaton correspond-
ing to T0 is A(T0 ) = (Q,C, q0 , A, δ ) where: (1) Q = {T 1 | T 1 ∈ T0 , T 1 = t, T 1 = μ t.T };
(2) q0 = T01 with T0 = μ"t.T01 and T01 ∈ Q; (3) C = {pq | p, q ∈ G}; (4) A is the set of
{a ∈ G}; and (5) δ is defined as:
2 The local type abstracts the behaviour of multiparty typed processes as proved in the subject
reduction theorem in [13]. Hence this theorem implies that processes typed by global type G
by the typing system in [2, 13] follow the LTS of G.
Multiparty Compatibility in Communicating Automata 181
(T, (pp1 !a j ), T j ) ∈ δ T j = t
If T = p1 !{a j .T j } j∈J ∈ Q, then
(T, (pp1 !a j ), T 1 ) ∈ δ T j = t, μ t"t.T 1 ∈ T0 , T 1 ∈ Q
(T, (p1 p?a j ), T j ) ∈ δ T j = t
If T = p1 ?{a j .T j } j∈J ∈ Q, then
(T, (p1 p?a j ), T 1 ) ∈ δ T j = t, μ t"t.T 1 ∈ T0 , T 1 ∈ Q
The definition says that the set of states Q are the suboccurrences of branching or se-
lection or end in the local type; the initial state q0 is the occurrence of (the recursion
body of) T0 ; the channels and alphabets correspond to those in T0 ; and the transition is
defined from the state T to its body T j with the action pp1 !a j for the output and pp1 ?a j
for the input. If T j is a recursive type variable t, it points the state of the body of the
corresponding recursive type. As an example, see C’s local type in Example 3.1 and its
corresponding automaton in § 1.
Proposition 3.1 (local types to CFSMs). Assume Tp is a local type. Then A(Tp ) is
deterministic, directed and has no mixed states.
We say that a CFSM is basic if it is deterministic, directed and has no mixed states. Any
basic CFSM can be translated into a local type.
Definition 3.5 (translation from a basic CFSM to a local type). From a basic Mp =
(Q,C, q0 , A, δ ), we define the translation T(Mp ) such that T(Mp ) = Tε (q0 ) where Tq̃ (q)
is defined as:
(1) Tq̃ (q) = μ tq .p1 !{a j .Tq̃·q
◦ (q )} 1
j j∈J if (q, pp !a j , q j ) ∈ δ ;
1 ◦ 1
(2) Tq̃ (q) = μ tq .p ?{a j .Tq̃·q (q j )} j∈J if (q, p p?a j , q j ) ∈ δ ;
(3) Tq̃◦ (q) = Tε (q) = end if q is final; (4) Tq̃◦ (q) = tqk if (q, , qk ) ∈ δ and qk ∈ q̃; and
(5) Tq̃◦ (q) = Tq̃ (q) otherwise.
In Tq̃ , q̃ records visited states; (1,2) translate the receiving and sending states to branch-
ing and selection types, respectively; (3) translates the final state to end; and (4) is the
case of a recursion: since qk was visited, is dropped and replaced by the type variable.
The following proposition states that these translations preserve the semantics.
This section studies the synthesis and sound and complete characterisation of multi-
party session types as communicating automata. A first idea would be to restrict basic
CFSMs to the natural generalisation of half-duplex systems [6, § 4.1.1], in which each
pair of machines linked by two channels, one in each direction, communicates in a
half-duplex way. In this class, the safety properties of Definition 2.4 are however unde-
cidable [6, Theorem 36]. We therefore need a stronger (and decidable) property to force
basic CFSMs to behave as if they were the result of a projection from global types.
182 P.-M. Deniélou and N. Yoshida
Multiparty compatibility In the two machines case, there exists a sound and com-
plete condition called compatible [11]. Let us define the isomorphism Φ : (C × {!, ?} ×
A)∗ −→ (C × {!, ?} × A)∗ such that Φ ( j?a) = j!a, Φ ( j!a) = j?a, Φ (ε ) = ε , Φ (t1 · · ·tn )
= Φ (t1 ) · · · Φ (tn ). Φ exchanges a sending action with the corresponding receiving one
and vice versa. The compatibility of two machines can be immediately defined as
Tr(M1 ) = Φ (Tr(M2 )) (i.e. the traces of M1 are exactly the set of dual traces of M2 ).
The idea of the extension to the multiparty case comes from the observation that from
the viewpoint of the participant p, the rest of all the machines (Mq )q∈P\p should behave
as if they were one CFSM which offers compatible traces Φ (Tr(Mp )), up to internal
synchronisations (i.e. 1-bounded executions). Below we define a way to group CFSMs.
Definition 4.1 (Definition 37, [6]). Let Mi = (Qi ,Ci , q0i , Ai , δi ). The associated CFSM
of a system S = (M1 , .., Mn ) is M = (Q,C, q0 , Σ , δ ) such that: Q = Q1 × Q2 × · · · × Qn ,
q0 = (q01 , . . . , q0n ) and δ is the smallest relation for which: if (qi , , q1i ) ∈ δi (1 ≤ i ≤ n),
then ((q1 , ..., qi , ..., qn ), , (q1 , ..., q1i , ..., qn )) ∈ δ .
We now define a notion of compatibility extended to more than two CFSMs. We say that
ϕ is an alternation if ϕ is an alternation of sending and corresponding receive actions
(i.e. the action pq!a is immediately followed by pq?a).
The above definition states that for each Mi , the rest of machines S−i can produce the
compatible (dual) actions by executing alternations in S−i . From Mi , these intermediate
alternations can be seen as non-observable internal actions.
Remark 4.1. In Definition 4.2, we check the compatibility from any 1-bounded reach-
able stable state in the case one branch is selected by different senders. Consider the
following machines:
BA?a
(/.-,
A →/.-,
()*+ / ()*+
/.-, CA?c ()*+
//.-,
B →/.-,
()*+ /
()*+
/.-,
C →/.-,
()*+ /
()*+
/.-,
A1 →/.-,
()*+ 7 JJJ /.-,
()*+
BA?a BA!a CA!c CA?c ()*+
/
BA?b BA!b CA!d JJJ
()*+ CA?d ()*+
/.-, //.-,
()*+
/.-,
()*+
/.-,
BA?b
CA?d /.-, %
()*+
Multiparty Compatibility in Communicating Automata 183
In A, B and C, each action in each machine has its dual but they do not satisfy multiparty
compatibility. For example, if BA!a · BA?a is executed, CA!d does not have a dual action
(hence they do not satisfy the safety properties). On the other hand, the machines A1 , B
and C satisfy the multiparty compatibility.
Theorem 4.1. Assume S = (Mp )p∈P is basic and multiparty compatible. Then S satisfies
the three safety properties in Definition 2.4. Further, if there exists at least one Mq which
includes a final state, then S satisfies the liveness property.
Proposition 4.1. If all the CFSMs Mp (p ∈ P) are basic, there is an algorithm to check
whether (Mp )p∈P is multiparty compatible.
The proof of Theorem 4.1 is non-trivial, using a detailed analysis of causal relations.
The proof of Proposition 4.1 comes from the finiteness of RS1 (S). See [17] for details.
Synthesis. Below we state the lemma which will be crucial for the proof of synthesis
and completeness. The lemma comes from the intuition that the transitions of multiparty
compatible systems are always permutations of one-bounded executions as it is the case
in multiparty session types. See [17] for the proof.
Lemma 4.1 (1-buffer equivalence). Suppose S1 and S2 are two basic and multiparty
compatible communicating systems such that S1 ≈1 S2 , then S1 ≈ S2 .
Theorem 4.2 (synthesis). Suppose S is a basic system and multiparty compatible. Then
there is an algorithm which successfully builds well-formed G such that S ≈ G if such
G exists, and otherwise terminates.
Proof. We assume S = (Mp )p∈P. The algorithm starts from the initial states of all ma-
chines (qp1 0 , ..., qpn 0 ). We take a pair of the initial states which is a sending state qp0 and
q
a receiving state q0 from p to q. We note that by directness, if there are more than two
pairs, the participants in two pairs are disjoint, and by [G4] in Definition 3.1, the order
does not matter. We apply the algorithm with the invariant that all buffers are empty and
that we repeatedly pick up one pair such that qp (sending state) and qq (receiving state).
We define G(q1 , ..., qn ) where (qp , qq ∈ {q1 , ..., qn }) as follows:
– if (q1 , ..., qn ) has already been examined and if all participants have been involved
since then (or the ones that have not are in their final state), we set G(q1 , ..., qn ) to
be tq1 ,...,qn . Otherwise, we select a pair sender/receiver from two participants that
have not been involved (and are not final) and go to the next step;
– otherwise, in qp , from machine p, we know that all the transitions are sending ac-
tions towards p1 (by directedness), i.e. of the form (qp , pq!ai , qi ) ∈ δp for i ∈ I.
• we check that machine q is in a receiving state qq such that (qq , pq?a j , q1j ) ∈ δp1
with j ∈ J and I ⊆ J.
• we set μ tq1 ,...,qn .p → q : {ai .G(q1 , ..., qp ← qi , ..., qq ← q1i , ..., qn )}i∈I (we re-
place qp and qq by qi and q1i , respectively) and continue by recursive calls.
• if all sending states in q1 , ..., qn become final, then we set G(q1 , ..., qn ) = end.
– we erase unnecessary μ t if t ∈ G.
184 P.-M. Deniélou and N. Yoshida
Since the algorithm only explores 1-bounded executions, the reconstructed G satisfies
G ≈1 S. By Theorem 3.1, we know that G ≈ ({G p}p∈P;"ε ). Hence, by Proposition 3.2,
we have G ≈ S1 where S1 is the communicating system translated from the projected
local types {G p}p∈P of G. By Lemma 4.1, S ≈ S1 and therefore S ≈ G.
The algorithm can generate the global type in Example 3.1 from CFSMs in § 1and the
global type B → A{a : C → A : {c : end, d : end}, b : C → A : {c : end, d : end}} from A1 ,
B and C in Remark 4.1. Note that B → A{a : C → A : {c : end}, b : C → A : {d : end}}
generated by A, B and C in Remark 4.1 is not projectable, hence not well-formed.
By Theorems 3.1 and 4.1, and Proposition 3.2, we can now conclude:
Theorem 4.3 (soundness and completeness). Suppose S is basic and multiparty com-
patible. Then there exists G such that S ≈ G. Conversely, if G is well-formed, then there
exists a basic and multiparty compatible system S such that S ≈ G.
Within the context of multiparty session types, [15] first studied the reconstruction of
a global type from its projected local types up to asynchronous subtyping and [14] re-
cently offers a typing system to synthesise global types from local types. Our synthesis
based on CFSMs is more general since CFSMs do not depend on the syntax. For exam-
ple, [14, 15] cannot treat the synthesis for A1 , B and C in Remark 4.1. These works also
do not study the completeness (i.e. they build a global type from a set of projected lo-
cal types (up to subtyping), and do not investigate necessary and sufficient conditions to
build a well-formed global type). A difficulty of the completeness result is that it is gen-
erally unknown if the global type constructed by the synthesis can simulate executions
with arbitrary buffer bounds since the synthesis only directly looks at 1-bounded exe-
cutions. In this paper, we proved Lemma 4.1 and bridged this gap towards the complete
characterisation. Recent work by [1, 5] focus on proving the semantic correspondence
between global and local descriptions (see [8] for more detailed comparison), but no
synthesis algorithm is studied.
Acknowledgement. The work has been partially sponsored by the Ocean Observato-
ries Initiative and EPSRC EP/K011715/1, EP/K034413/1 and EP/G015635/1.
References
1. Basu, S., Bultan, T., Ouederni, M.: Deciding choreography realizability. In: POPL 2012, pp.
191–202. ACM (2012)
2. Bettini, L., Coppo, M., D’Antoni, L., De Luca, M., Dezani-Ciancaglini, M., Yoshida, N.:
Global progress in dynamically interleaved multiparty sessions. In: van Breugel, F., Chechik,
M. (eds.) CONCUR 2008. LNCS, vol. 5201, pp. 418–433. Springer, Heidelberg (2008)
3. Brand, D., Zafiropulo, P.: On communicating finite-state machines. J. ACM 30, 323–342
(1983)
4. Caires, L., Pfenning, F.: Session types as intuitionistic linear propositions. In: Gastin, P.,
Laroussinie, F. (eds.) CONCUR 2010. LNCS, vol. 6269, pp. 222–236. Springer, Heidelberg
(2010)
5. Castagna, G., Dezani-Ciancaglini, M., Padovani, L.: On global types and multi-party session.
LMCS 8(1) (2012)
6. Cécé, G., Finkel, A.: Verification of programs with half-duplex communication. Inf. Com-
put. 202(2), 166–190 (2005)
7. Deniélou, P.-M., Yoshida, N.: Dynamic multirole session types. In: POPL, pp. 435–446.
ACM, Full version, Prototype at http://www.doc.ic.ac.uk/˜ pmalo/dynamic
8. Deniélou, P.-M., Yoshida, N.: Multiparty session types meet communicating automata. In:
Seidl, H. (ed.) ESOP 2012. LNCS, vol. 7211, pp. 194–213. Springer, Heidelberg (2012)
9. http://arxiv.org/abs/1304.1902
10. Girard, J.-Y.: Linear logic. TCS 50 (1987)
11. Gouda, M., Manning, E., Yu, Y.: On the progress of communication between two finite state
machines. Information and Control 63, 200–216 (1984)
12. Honda, K., Vasconcelos, V.T., Kubo, M.: Language primitives and type discipline for
structured communication-based programming. In: Hankin, C. (ed.) ESOP 1998. LNCS,
vol. 1381, pp. 122–138. Springer, Heidelberg (1998)
13. Honda, K., Yoshida, N., Carbone, M.: Multiparty Asynchronous Session Types. In: POPL
2008, pp. 273–284. ACM (2008)
186 P.-M. Deniélou and N. Yoshida
14. Lange, J., Tuosto, E.: Synthesising choreographies from local session types. In: Koutny, M.,
Ulidowski, I. (eds.) CONCUR 2012. LNCS, vol. 7454, pp. 225–239. Springer, Heidelberg
(2012)
15. Mostrous, D., Yoshida, N., Honda, K.: Global principal typing in partially commutative
asynchronous sessions. In: Castagna, G. (ed.) ESOP 2009. LNCS, vol. 5502, pp. 316–332.
Springer, Heidelberg (2009)
16. Muscholl, A.: Analysis of communicating automata. In: Dediu, A.-H., Fernau, H., Martı́n-
Vide, C. (eds.) LATA 2010. LNCS, vol. 6031, pp. 50–57. Springer, Heidelberg (2010)
17. DoC Technical Report, Imperial College London, Computing, DTR13-5 (2013)
18. Takeuchi, K., Honda, K., Kubo, M.: An interaction-based language and its typing system.
In: Halatsis, C., Philokyprou, G., Maritsas, D., Theodoridis, S. (eds.) PARLE 1994. LNCS,
vol. 817, pp. 398–413. Springer, Heidelberg (1994)
19. Villard, J.: Heaps and Hops. PhD thesis, ENS Cachan (2011)
20. Wadler, P.: Proposition as Sessions. In: ICFP 2012, pp. 273–286 (2012)
Component Reconfiguration in the Presence
of Conflicts$
{jmauro,zavattar}@cs.unibo.it
1 Introduction
Modern software systems are more and more based on interconnected software compo-
nents (e.g. packages or services) deployed on clusters of heterogeneous machines that
can be created, connected and reconfigured on-the-fly. Traditional component models
represent components as black-boxes with interfaces indicating their provide and re-
quire ports. In many cases also conflicts are considered in order to deal with frequent
situations in which components cannot be co-installed.
In software systems where components are frequently reconfigured (e.g. “cloud”
based applications that elastically reacts to client demands) more expressive compo-
nent models are considered: a component becomes a grey-box showing relevant internal
states and the actions that can be acted on the component to change state during deploy-
ment and reconfiguration. For instance, in the popular system configuration tool Pup-
pet [10] or the novel deployment management system Engage [8], components can be
in the absent, present, running or stopped states, and the actions install, uninstall, start,
stop and restart can be executed upon them. Rather expressive dependencies among
components can be declared. The aim of these tools is to allow the system administrator
to declaratively express the desired component configuration and automatically execute
a correct sequence of low-level actions that bring the current configuration to a new one
satisfying the administrator requests respecting dependencies. We call reconfigurability
the problem of checking the existence of such sequence of low-level actions.
$ Work partially supported by Aeolus project, ANR-2010-SEGI-013-01, and performed at IR-
ILL, center for Free Software Research and Innovation in Paris, France, www.irill.org
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 187–198, 2013.
c Springer-Verlag Berlin Heidelberg 2013
188 R. Di Cosmo et al.
Despite the importance of conflicts in many component models, see e.g. package-
based software distributions used for Free and Open Source Software (FOSS) [5], the
Eclipse plugin model [3], or the OSGi component framework [12], state-of-the-arts
management systems like the above do not take conflicts into account. This is likely
ascribable to the increased complexity of the reconfigurability problem in the presence
of conflicts. In this paper we precisely characterize this increment of complexity.
In a related paper [6] we have proposed the Aeolus component model that, despite
its simplicity, is expressive enough to capture the main features of tools like Puppet
and Engage. We have proved that the reconfigurability problem is Polynomial-Time
for Aeolus− , the fragment without numerical constraints. In this paper we consider
Aeolus core, the extension of this fragment with conflicts, and we prove that even if
the reconfigurability problem remains decidable, it turns out to be Exponential-Space
hard. We consider this result a fundamental step towards the realization of tools that
manage conflicts systematically. In fact, we shed some light on the specific sources of
the increment of complexity of the reconfigurability problem.
The technical contribution of the paper and its structure is as follows. In Section 2
we formalize the reconfigurability problem in the presence of conflicts. In Section 3
we prove its decidability by resorting to the theory of Well-Structured Transition Sys-
tems [2,7]. We consider this decidability result interesting also from a foundational
viewpoint: despite our component model has many commonalities with concurrent
models like Petri nets, in our case the addition of conflicts (corresponding to inhibitor
arcs in Petri nets) does not make the analysis of reachability problems undecidable.
The closed relationship between our model and Petri nets is used in Section 4 where
we prove the Exponential-Space hardness of the reconfigurability problem by reduction
from the coverability problem in Petri nets. In Section 5 we discuss related work and
report concluding remarks. Missing proofs are available in [4].
We now define configurations that describe systems composed by components and their
bindings. Each component has a unique identifier taken from the set Z . A configura-
tion, ranged over by C1 , C2 , . . ., is given by a set of component types, a set of compo-
nents in some state, and a set of bindings.
Definition 2 (Configuration). A configuration C is a 4-ple U, Z, S, B where:
– U ⊆ Γ is the finite universe of the available component types;
– Z ⊆ Z is the set of the currently deployed components;
– S is the component state description, i.e. a function that associates to components
in Z a pair T , q where T ∈ U is a component type Q, q0 , T, D, and q ∈ Q is the
current component state;
– B ⊆ I × Z × Z is the set of bindings, namely 3-ple composed by an interface,
the component that requires that interface, and the component that provides it; we
assume that the two components are different.
Configuration are equivalent if they have the same instances up to instance renaming.
Definition 3 (Configuration equivalence). Two configurations U, Z, S, B and
U, Z 1 , S1 , B1 are equivalent (U, Z, S, B ≡ U, Z 1 , S1 , B1 ) iff there exists a bijective func-
tion ρ from Z to Z 1 s.t.
– S(z) = S1 (ρ (z)) for every z ∈ Z;
– r, z1 , z2 ∈ B iff r, ρ (z1 ), ρ (z2 ) ∈ B1 .
Notation. We write C [z] as a lookup operation that retrieves the pair T , q = S(z), where
C = U, Z, S, B. On such a pair we then use the postfix projection operators .type and .state
to retrieve T and q, respectively. Similarly, given a component type Q, q0 , T, D, we use projec-
tions to decompose it: .states, .init, and .trans return the first three elements; .P(q), .R(q),
and .C(q) return the three elements of the D(q) tuple. Moreover, we use .prov (resp. .req) to
denote the union of all the provide ports (resp. require ports) of the states in Q. When there is no
190 R. Di Cosmo et al.
ambiguity we take the liberty to apply the component type projections to T , q pairs. Example:
C [z].R(q) stands for the require ports of component z in configuration C when it is in state q.
We can now formalize the notion of configuration correctness.
Notice that we consider a set of state changes in order to deal with simultaneous instal-
lations like the one needed for Apache2 and Apache2-bin in Fig. 1. The execution of
actions is formalized as configuration transitions.
α
Definition 6 (Reconfigurations). Reconfigurations are denoted by transitions C − →C1
meaning that the execution of α ∈ A on the configuration C produces a new configu-
ration C 1 . The transitions from a configuration C = U, Z, S, B are defined as follows:
unbind(r,z1 ,z2 )
C −−−−−−−−→ U, Z, S, B \ r, z1 , z2 if r, z1 , z2 ∈ B
newRsrc(z:T ) delRsrc(z)
C −−−−−−−−→ U, Z ∪ {z}, S1 , B C −−−−−−→ U, 1 1
Z \ {z}, S1 , B
if z ∈ Z, T ∈U ⊥ if z =z
if S1 (z1 ) =
T , T .init if z1 = z C [z1 ] otherwise
and S1 (z1 ) =
C [z1 ] otherwise and B1 = {r, z1 , z2 ∈ B | z ∈ {z1 , z2 }}
We can now define a reconfiguration run as the effect of the execution of a sequence of
actions (atomic or multiple state changes).
Component Reconfiguration in the Presence of Conflicts 191
The restriction to only one component in a given state is not limiting: we can encode
any given combination of component types and states by adding dummy provide ports
enabled only by the final states of interest, and a target dummy component with require-
ments on all such provide ports.
The following lemma is rather technical and it will be used to prove that (Conf , −
→, ≤)
has effective pred-basis. Intuitively it will allow us to consider, in the computation of
the predecessors, only finitely many different state change actions.
Proof. If |B2 | ≤ 3k + 2k2 the thesis trivially holds. Consider now |B2 | > 3k + 2k2 and
α
a transition C1 −→ C2 such that C1 ∈ γ (B1 ) and C2 ∈ γ (B2 ). Since |B2 | > 3k there are
three components z1 , z2 and z3 having the same component type and internal state. We
consider two subcases.
Case 1. z1 , z2 and z3 do not perform a state change in the action α . W.l.o.g we can as-
sume that z3 does not appear in α (this is not restrictive because at most two components
that do not perform a state change can occur in an action). We can now consider the con-
figuration C11 obtained by C1 after removing z3 (if there are bindings connected to pro-
α
vide ports of z3 , these can be rebound to ports of z1 or z2 ). Consider now C11 −
→ C21 and
the corresponding abstract configurations B1 and B2 . It is easy to see that B11 −
1 1
→ B21 ,
194 R. Di Cosmo et al.
B11 ≤ B1 , B21 ≤ B2 and |B21 | < |B2 |. If |B21 | ≤ 3k + 2k2 the thesis is proved, otherwise
we repeat this deletion of components.
Case 2. There are no three components of the same type-state that do not perform a
state change. Since |B2 | > 2k2 + 2 we have that α is a state change involving strictly
more than 2k2 components. This ensures the existence of three components z11 , z12 and
z13 of the same type that perform the same state change from q to q1 . As in the previous
case we consider the configuration C11 obtained by C1 after removing z13 and α 1 the state
α1
change similar to α but without the state change of z13 . Consider now C11 −→ C21 and the
corresponding abstract configurations B11 and B21 . As above, B11 ≤ B1 , B21 ≤ B2 and
|B21 | < |B2 |. If |B21 | ≤ 3k + 2k2 the thesis is proved, otherwise we repeat the deletion
of components. &
%
We are now in place to prove that (Conf , −
→, ≤) has effective pred-basis.
Lemma 4. The transition system (Conf , −
→, ≤) has effective pred-basis.
Proof. We first observe that given an abstract configuration the set of its concretizations
up to configuration equivalence is finite, and that given a configuration C the set of pre-
α
ceding configurations C 1 such that C 1 −→ C is also finite (and effectively computable).
Consider now an abstract configuration B. We now show how to compute a finite ba-
sis for ↑ Pred(↑ B). First of all we consider the configuration B if |B| > 3k + 2k2 ,
the (finite) set of configurations B 1 such that B ≤ B 1 and |B 1 | ≤ 3k + 2k2 otherwise.
Then we consider the (finite) set of concretizations of all such abstract configurations.
And finally we compute the (finite) set of the preceding configurations of all such con-
cretizations. The set of abstract configuration corresponding to the latter is a finite basis
for ↑ Pred(↑ B) as a consequence of Lemma 3. &
%
We are finally ready to prove our decidability result.
Theorem 1. The reconfigurability problem in Aeolus core is decidable.
Proof. Let k be the number of distinct component type-state pairs according to the
considered universe of component types. We first observe that if there exists a correct
configuration containing a component of type T in state q then it is possible to obtain
via some binding, unbinding, and delete actions another correct configuration with k or
less components. Hence, given a component type T and a state q, the number of target
configurations that need to be considered is finite. Moreover, given a configuration C 1 ∈
γ (B 1 ) there exists a reconfiguration run from C ∈ γ (B) to C 1 iff B ∈ Pred ∗ (↑ B 1 ).
To solve the reconfigurability problem it is therefore possible to consider only the
(finite set of) abstractions of the target configurations. For each of them, say B 1 , by
Proposition 1, Lemma 2 and Lemma 4 we know that a finite basis for Pred ∗ (↑ B 1 ) can
be computed. It is sufficient to check whether at least one of the abstract configurations
in such basis is ≤ w.r.t. the abstraction of the initial configuration. &
%
q0 q
η q0 f
q'0
f
e e q0
r raux
e q
A Petri net is a tuple N = (P, T, m0 ), where P and T are finite sets of places and
transitions, respectively. A finite multiset over the set P of places is called a marking,
and m0 is the initial marking. Given a marking m and a place p, we say that the place
p contains a number of tokens equal to the number of instances of p in m. A transition
t ∈ T is a pair of markings denoted with •t and t • . A transition t can fire in the marking m
if •t ⊆ m (where ⊆ is multiset inclusion); upon transition firing the new marking of the
net becomes n = (m\ m1 )-m11 (where \ and - are the difference and union operators for
multisets, respectively). This is written as m ⇒ n. We use ⇒∗ to denote the reflexive and
transitive closure of ⇒. We say that m1 is reachable from m if m ⇒∗ m1 . The coverability
problem for marking m consists of checking whether m0 ⇒∗ m1 for some m ⊆ m1 .
We now discuss how to encode Petri nets in Aeolus core component types. Before
entering into the details we observe that given a component type T it is always possible
to modify it in such a way that its instances are persistent and unique. The uniqueness
constraint can be enforced by allowing all the states of the component type to provide
a new port with which they are in conflict. To avoid the component deletion it is suf-
ficient to impose its reciprocal dependence with a new type of component. When this
dependence is established the components be deleted without violating it. In Fig. 2 we
show an example of how a component type having two states can be modified in order
to reach our goal. A new auxiliary initial state q10 is created. The new port e ensures
that the instances of type T in a state different from q10 are unique. The require port f
provided by a new component type Taux forbids the deletion of the instances of type T ,
if they are not in state q10 . We assume that the ports e and f are fresh. We can therefore
consider w.l.o.g. components that, when deployed, are unique and persistent. Given a
component type T we denote this component type transformation with η (T ).
We now describe how to encode a Petri net in the Aeolus core model. We will use
three types of components: one modeling the tokens, one for transitions and one for
defining a counter. The components for transitions and the counter are unique and per-
sistent, while those for the tokens cannot be unique because the number of tokens in
a Petri net can be unbounded. The simplest component is the one used to model a to-
ken in a given place. Intuitively one token in a place is encoded as one instance of a
corresponding component type in an on state. There could be more than one of these
components deployed simultaneously representing multiple tokens in a place. In Fig. 3a
we represent the component type for the tokens in the place p of the Petri net. The ini-
tial state is the off state. The token could be created following a protocol consisting
of requiring the port a p and then providing the port b p to signal the change of status.
Similarly a token can be deleted requiring the port c p and then providing the port d p .
196 R. Di Cosmo et al.
1 counteri(1)
Even if multiple instances of the token component can be deployed simultaneously, the
conflict ports a p and c p guarantee that only one at a time can initiate the protocol to
change its state. We denote with token(p) the component type representing the tokens
in the place p.
In order to model the transitions with component types without having an exponen-
tial blow up of the size of the encoding we need a mechanism to count up to a fixed
number. Indeed a transition can consume and produce up to a given number of tokens.
To count a number up to n we will use C1 , . . . ,C log(n) components; every Ci will rep-
resent the i-th less significant bit of the binary representation of the counter that, for
our purposes, needs just to support the increment and reset operations. In Fig. 3b we
represent one of the bits implementing the counter. The initial state is 0. To reset the
bit it is possible to provide the reset counteri port while to increment it the up counteri
should be provided. If the bit is in state 1 the increment will trigger the increment of the
next bit except for the component representing the most significant bit that will never
need to do that. We transform all the component types representing the counter using
the η transformation to ensure uniqueness and persistence of its instances. The instance
of η (Ci ) can be used to count how many tokens are consumed or produced checking if
the right number is reached via the ports counteri (1) and counteri (0).
A transition can be represented with a single component interacting with token and
counter components. The state changes of the transition component can be intuitively
divided in phases. In each of those phases a fixed number of tokens from a given place
is consumed or produced. The counter is first reset providing the reset counteri and re-
quiring the reset1 counteri ports for all the counter bits. Then a cycle starts incrementing
the counter providing and requiring the ports up counter1 and up1 counter1 and consum-
ing or producing a token. The production of a token in place p is obtained providing
and requiring ports a p and b p while the consumption providing and requiring the ports
c p and d p . The phase ends when all the bits of the counter represent in binary the right
number of tokens that need to be consumed or produced. If instead at least one bit is
wrong the cycle restarts. In Fig. 4 we depict the phase of a consumption of n tokens.
Starting from the initial state of the component representing the transition, the con-
sumption phases need to be performed first. When the final token has been produced
Component Reconfiguration in the Presence of Conflicts 197
counteri(¬hi)
counterk(¬hk) counter1(¬h1)
transition(t)
... ...
... ...
Fig. 4. Consumption phase of n tokens from place p for a transition t (k = log(n) and hi is the
i-th least significative bit of the binary representation of n)
the transition component can restart from the initial state. Given a transition t we will
denote with transition(t) the component type explained above.
Definition 14 (Petri net encoding in Aeolus core). Given a Petri net N = (P, T, m0 ) if
n is the largest number of tokens that can be consumed or produced by a transition in
T , the encoding of N in Aeolus core is the set of component types ΓN = {token(p) | p ∈
P} ∪ {η (Ci ) | i ∈ [1.. log(n) ]} ∪ {η (transition(t)) | t ∈ T }.
An important property of the previous encoding is that it is polynomial w.r.t. the size
of the Petri net. This is due to the fact that the counter and place components have a
constant amount of states and ports while the transition components have a number of
states that grows linearly w.r.t. the number of places involved in a transition.
The proof that the reconfiguration problem for Aeolus core is ExpSpace-hard thus
follows from the following correspondence between a Petri net N and its set of compo-
nent types ΓN : every computation in N can be faithfully reproduced by a correspond-
ing reconfiguration run on the components types ΓN ; every reconfiguration run on ΓN
corresponds to a computation in N excluding the possibility for components of kind
token(p) to be deleted (because η is not applied to those components) and of compo-
nents transition(t) to execute only partially the consumption of the tokens (because e.g.
some token needed by the transition is absent). In both cases, the effect is to reach a
configuration in which some of the token was lost during the reconfiguration run, but
this is not problematic as we deal with coverability. In fact, if a configuration is reached
with at least some tokens, then also the corresponding Petri nets will be able to reach a
marking with at least those tokens (possibly more).
Theorem 2. The reconfiguration problem for Aeolus core is ExpSpace-hard.
References
1. Abate, P., Di Cosmo, R., Treinen, R., Zacchiroli, S.: Dependency solving: a separate concern
in component evolution management. J. Syst. Software 85, 2228–2240 (2012)
2. Abdulla, P.A., Cerans, K., Jonsson, B., Tsay, Y.K.: General decidability theorems for infinite-
state systems. In: LICS, pp. 313–321. IEEE (1996)
3. Clayberg, E., Rubel, D.: Eclipse Plug-ins, 3rd edn. Addison-Wesley (2008)
4. Di Cosmo, R., Mauro, J., Zacchiroli, S., Zavattaro, G.: Component reconfiguration in the
presence of conflicts. Tech. rep. Aeolus Project (2013),
http://hal.archives-ouvertes.fr/hal-00816468
5. Di Cosmo, R., Trezentos, P., Zacchiroli, S.: Package upgrades in FOSS distributions: Details
and challenges. In: HotSWup 2008 (2008)
6. Di Cosmo, R., Zacchiroli, S., Zavattaro, G.: Towards a formal component model for the
cloud. In: Eleftherakis, G., Hinchey, M., Holcombe, M. (eds.) SEFM 2012. LNCS, vol. 7504,
pp. 156–171. Springer, Heidelberg (2012)
7. Finkel, A., Schnoebelen, P.: Well-structured transition systems everywhere! Theoretical
Computer Science 256, 63–92 (2001)
8. Fischer, J., Majumdar, R., Esmaeilsabzali, S.: Engage: a deployment management system. In:
PLDI 2012: Programming Language Design and Implementation, pp. 263–274. ACM (2012)
9. Hewson, J.A., Anderson, P., Gordon, A.D.: A declarative approach to automated configura-
tion. In: LISA 2012: Large Installation System Administration Conference, pp. 51–66 (2012)
10. Kanies, L.: Puppet: Next-generation configuration management. The USENIX Maga-
zine 31(1), 19–25 (2006)
11. Lipton, R.J.: The Reachability Problem Requires Exponential Space. Research report 62,
Department of Computer Science, Yale University (1976)
12. OSGi Alliance: OSGi Service Platform, Release 3. IOS Press, Inc. (2003)
13. Rackoff, C.: The covering and boundedness problems for vector addition systems. Theoret.
Comp. Sci. 6, 223–231 (1978)
Stochastic Context-Free Grammars, Regular
Languages, and Newton’s Method
1 Introduction
Stochastic (or Probabilistic) Context-Free Grammars (SCFG) are context-free
grammars where the rules (productions) have associated probabilities. They are
a central stochastic model, widely used in natural language processing [14], with
applications also in biology (e.g. [2, 13]). A SCFG G generates a language L(G)
(like an ordinary CFG) and assigns a probability to every string in the language.
SCFGs have been extensively studied since the 1970’s. A number of important
problems on SCFGs can be viewed as instances of the following regular pattern
matching problem for different regular languages:
Given a SCFG G and a regular language L, given e.g., by a deterministic
finite automaton (DFA) D, compute the probability PG (L) that G generates a
string in L, i.e. compute the sum of the probabilities of all the strings in L.
A simple example is when L = Σ ∗ , the set of all strings over the terminal
alphabet Σ of the SCFG G. Then this problem simply asks to compute the
The full version of this paper is available at arxiv.org/abs/1302.6411. Research
partially supported by the Royal Society and by NSF Grant CCF-1017955.
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 199–211, 2013.
c Springer-Verlag Berlin Heidelberg 2013
200 K. Etessami, A. Stewart, and M. Yannakakis
Previous Work. As mentioned above, there has been, on the one hand, sub-
stantial work in the NLP literature on different cases of the problem for various
regular languages L, and on the other hand, there has been work in the verifi-
cation and algorithms literature on the analysis and model checking of recursive
Markov chains and probabilistic pushdown automata. Nevertheless, even the
simple special case of L = Σ ∗ , the question of whether it is possible to compute
(approximately) in polynomial time the desired probability for a given SCFG
G (i.e. the probability PG (L(G)) of L(G)) was open until very recently. In [7]
we showed that PG (L(G)) can be computed to arbitrary precision in polynomial
time in the size of the input SCFG G and the number of bits of precision. From
a SCFG G, one can construct a multivariate system of equations x = PG (x),
where x is a vector of variables and PG is a vector of polynomials with positive
coefficients which sum to (at most) 1. Such a system is called a probabilistic poly-
nomial system (PPS), and it always has a non-negative solution that is smallest
in every coordinate, called the least fixed point (LFP). A particular coordinate
of the LFP of the system x = PG (x) is the desired probability PG (L(G)). To
compute PG (L(G)), we used a variant of Newton’s method on x = PG (x), with
suitable rounding after each step to control the bit-size of numbers, and showed
that it converges in P-time to the LFP [7]. Building on this, we also showed that
SCFG, Regular Languages, and Newton’s Method 201
using the decomposed Newton method from [9] and Broyden’s (quasi-Newton)
method, and present experimental results for infix probability computations.
Most recently, in [20], we have obtained worst-case upper bounds on (rounded
and exact) Newton’s method applied to arbitrary MPSs, x = P (x), as a function
of the input encoding size |P | and log(1/), to converge to within additive error
> 0 of the LFP solution q ∗ . However, our bounds in [20], even when 0 < q ∗ ≤
1, are exponential in the depth of (not necessarily critical) strongly connected
components of x = P (x), and furthermore they also depend linearly on log( q∗1 ),
min
∗
where qmin = mini qi∗ , which can be ≈ 21|P | . As we describe next, we do far better
2
in this paper for the MPSs that arise from the “product” of a SCFG and a DFA.
G
SCFG, G, we can decide whether qA = 1 in P-time ([9]). The same decision
problem is PosSLP-hard for convergent WCFGs ([9]).
For any WCFG, G = (V, Σ, R, p), with n = |V |, assume the nonterminals
in V are indexed as A1 , . . . , An . We define the following monotone polyno-
mial system of equations (MPS) associated with G, denoted x = PG (x).
Here x = (x1 , . . . , xn ) denotes an n-vector of variables. Likewise PG (x) =
(PG (x)1 , . . . , PG (x)n ) denotes an n-vector of multivariate polynomials over the
variables x = (x1 , . . . , xn ). For a vector κ = (κ1 , κ2 , . . . , κn ) ∈ Nn , we use the
notation xκ to denote the monomial xκ1 1 xκ2 2 . . . xκnn . For a non-terminal Ai ∈ V ,
and a string α ∈ (V ∪ Σ)∗ , let κi (α) ∈ N denote the number of occurrences of
Ai in the string α. We define κ(α) ∈ Nn to be κ(α) = (κ1 (α), κ2 (α), . . . , κn (α)).
In the MPS x = PG (x), corresponding to each nonterminal Ai ∈ V , there
be one variable xκ(α)
will i and one equation, namely xi = PG (x)i , where: PG (x)i ≡
r=(A→α)∈RAi p(r)x . If there are no rules associated with Ai , i.e., if RAi = ∅,
then by default we define PG (x)i ≡ 0. Note that if r ∈ RAi is a terminal rule,
i.e., κ(r) = (0, . . . , 0), then p(r) is one of the constant terms of PG (x)i .
Note: Throughout this paper, for any n-vector z, whose i’th coordinate zi “cor-
responds” to nonterminal Ai , we often find it convenient to use zAi to refer to
zi . So, e.g., we alternatively use xAi and PG (x)Ai , instead of xi and PG (x)i .
Note that if G is a SCFG, then in x = PG (x), by definition, the sum of the
monomial coefficients
and constant terms of each polynomial PG (x)i is at most
1, because r∈RA p(r) ≤ 1 for every Ai ∈ V . An MPS that satisfies this extra
i
condition is called a probabilistic polynomial system of equations (PPS).
Consider any MPS, x = P (x), with n variables, x = (x1 , . . . , xn ). Let R≥0
denote the non-negative real numbers. Then P (x) defines a monotone operator
on the non-negative orthant Rn≥0 . In general, an MPS need not have any real-
valued solution: consider x = x + 1. However, by monotonicity of P (x), if there
exists a ∈ Rn≥0 such that a = P (a), then there is a least fixed point (LFP) solution
q ∗ ∈ Rn≥0 such that q ∗ = P (q ∗ ), and such that q ∗ ≤ a for all solutions a ∈ Rn≥0 .
Proposition 1. (cf. [9] or see [17]) For any SCFG (or convergent WCFG), G,
with n nonterminals A1 , . . . , An , the LFP solution of x = PG (x) is the n-vector
q G = (qA
G
1
G
, . . . , qA n
) of termination probabilities (termination weights) of G.
For computation purposes, we assume that the input probabilities (weights)
associated with rules of input SCFGs or WCFGs are positive rationals encoded
by giving their numerator and denominator in binary. We use |G| to denote the
encoding size (i.e., number of bits) of an input WCFG G.
Given any WCFG (SCFG) G = (V, Σ, R, p) we can compute in linear time
an SNF form WCFG (resp. SCFG) G = (V Σ, R , p ) of size |G | = O(|G|) with
G ,w
V ⊇ V such that qA G,w
= qA for all A ∈ V , w ∈ Σ ∗ (cf. [9] and Proposition
2.1 of [7]). Thus, for the problems studied in this paper, we may assume wlog
that a given input WCFG or SCFG is in SNF form.
A DFA, D = (Q, Σ, Δ, s0 , F ), has states Q, alphabet Σ, transition function
Δ : Q × Σ → Q, start state s0 ∈ Q and final states F ⊆ Q. We extend Δ to
strings: Δ∗ : Q × Σ ∗ → Q is defined by induction on the length |w| ≥ 0 of
SCFG, Regular Languages, and Newton’s Method 205
For every MPS, we can detect in P-time all the variables xj such that qj∗ = 0
[9]. We can then remove these variables and their corresponding equation xj =
P (x)j , and substitute their values on the right hand sides of remaining equations.
This yields a new MPS, with LFP q > 0, which corresponds to the non-zero
coordinates of q ∗ . It was shown in [9] that one can always apply a decomposed
Newton’s method to this MPS, to converge monotonically to the LFP solution.
Proposition 3. (cf. Theorem 6.1 of [9] and Theorem 4.1 of [4]) Let x = P (x)
be a MPS, with LFP q ∗ > 0. Then starting at x(0) := 0, the Newton itera-
tions x(k+1) := N (x(k) ) are well defined and monotonically converge to q ∗ , i.e.
limk→∞ x(k) = q ∗ , and x(k+1) ≥ x(k) ≥ 0 for all k ≥ 0.
Unfortunately, it was shown in [9] that obtaining any non-trivial additive ap-
proximation to the LFP solution of a general MPS, even one whose LFP is
0 < q ∗ ≤ 1, is PosSLP-hard, so we can not compute the termination weights of
general WCFGs in P-time (nor even in NP), without a major breakthrough in
the complexity of numerical computation. (See [9] for more information.)
Fortunately, for the class of PPSs, we can do a lot better. First we can identify
in P-time also all the variables xj such that qj∗ = 1 [9] and remove them from
the system. We showed recently in [7] that by then applying a suitably rounded
down variant of Newton’s method to the resulting PPS, we can approximate q ∗
within additive error 2−j in time polynomial in the size of the PPS and j.
balanced if the value of the sum t∈Q y(sAt) is independent of the state s. As
d2 n 2
already observed, q G⊗D
∈ R≥0 is balanced. Let B ⊆ Rd n denote the set of
Let us define the collapse mapping C : B → Rn . For any
balanced vectors.
A ∈ V , C(y)A := t y(sAt) . Note: C(y) is well-defined, because for y ∈ B, and
any A ∈ V , the sum t y(sAt) is by definition independent of the state s.
2 2
We next extend the definition of balance to matrices. A matrix M ∈ Rd n×d n
is called balanced if, for any non-terminals
B, C ∈ V and states s, u ∈ Q,
and for any pair of states v, v ∈ Q, t M(sBt),(uCv) = t M(sBt),(uCv ) , and
for any s, v ∈ Q and s , v ∈ Q, t,u M(sBt),(uCv) = t,u M(s Bt),(uCv ) . Let
B× ⊆ Rd n×d n denote the set of balanced matrices. We extend the collapse
2 2
with G ⊗ D by NG⊗D (y ). For a real square matrix M , let ρ(M ) denote the
spectral radius of M . The main result of this section is the following:
Theorem 1. Let x = PG (x) be any PPS (or MPS), with n variables, associated
with a SCFG (or WCFG) G, and let y = PG⊗D (y) be the corresponding product
2
MPS, for any DFA D, with d states. For any balanced vector y ∈ B ⊆ Rd n ,
with y ≥ 0, ρ(BG⊗D (y)) = ρ(BG (C(y))). Furthermore, if ρ(BG⊗D (y)) < 1,
then NG⊗D (y) is defined and balanced, NG (C(y)) is defined, and C(NG⊗D (y)) =
NG (C(y)). Thus, NG⊗D preserves balance, and the collapse map C “commutes”
with N over non-negative balanced vectors, irrespective of what the DFA D is.
We prove this in [8] via a series of lemmas that reveal many algebraic/analytic
properties of balance, collapse, and Newton’s method. Key is:
and B×
2 2 2
Lemma 1. Let B≥0 = B ∩ R≥0 d n
≥0 = B ∩ R≥0
d n×d n
.
We have q G⊗D
∈ B≥0 and C(q G⊗D G
) = q , and:
then BG⊗D (y) ∈ B×
2
(i) If y ∈ B≥0 ⊆ R≥0d n
≥0 , and C(BG⊗D (y)) = BG (C(y)).
(ii) If y ∈ B≥0 , then PG⊗D (y) ∈ B≥0 , and C(PG⊗D (y)) = PG (C(y)).
(iii) If y ∈ B≥0 and ρ(BG (C(y))) < 1, then I − BG⊗D (y) is non-singular,
(I − BG⊗D (y))−1 ∈ B× ≥0 , and C((I − BG⊗D (y))
−1
) = (I − BG (C(y)))−1 .
(iv) If y ∈ B≥0 and ρ(BG (C(y))) < 1, then NG⊗D (y) ∈ B×
and C(NG⊗D (y)) = NG (C(y)).
An easy consequence of Thm. 1 (and Prop. 3) is that if we use NM with exact
arithmetic on the PPS or MPS, x = PG (x), and on the product MPS, y =
PG⊗D (y), they converge at the same rate:
Corollary 1. For any PPS or MPS, x = PG (x), with LFP q G > 0, and cor-
responding product MPS, y = PG⊗D (y), if we use Newton’s method with exact
arithmetic, starting at x(0) := 0, and y (0) := 0, then all the Newton iterates x(k)
and y (k) are well-defined, and for all k: x(k) = C(y (k) ).
208 K. Etessami, A. Stewart, and M. Yannakakis
To work in the Turing model of computation (as opposed to the unit-cost RAM
model) we have to consider rounding between iterations of NM, as in [7].
Rounding can cause iterates x[k] to become unbalanced, but we can handle this.
For any PPS, x = P (x), with Jacobian matrix B(x), and LFP q ∗ , ρ(B(q ∗ )) ≤ 1
([9, 7]). If ρ(B(q ∗ )) < 1, we call the PPS non-critical. Otherwise, if ρ(B(q ∗ )) =
1, we call the PPS critical. For SCFGs whose PPS x = PG (x) is non-critical,
we get good bounds, even though R-NM iterates can become unbalanced:
Theorem 2. For any > 0, and for an SCFG, G, if the PPS x = PG (x) has
LFP 0 < q G ≤ 1 and ρ(BG (q G )) < 1, then if we use R-NM with parameter
h + 2 to approximate the LFP solution of the MPS y = PG⊗D (y), then q G⊗D −
y [h+1] ∞ ≤ where h := 14|G| + 3 + log(1/) + log d .
G,D
Thus we can compute the probability qA = t∈F qsG⊗D0 At
within additive error
δ > 0 in time polynomial in the input size: |G|, |D| and log(1/δ), in the standard
Turing model of computation.
We in fact obtain a much more general result. For any SCFG, G, and correspond-
ing PPS, x = PG (x), with LFP q ∗ > 0, the dependency graph, HG = (V, E), has
the variables (or the nonterminals of G) as nodes and has the following edges:
(xi , xj ) ∈ E iff xj appears in some monomial in PG (x)i with a positive coeffi-
cient. We can decompose the dependency graph HG into its SCCs, and form the
DAG of SCCs, HG . For each SCC, S, suppose its corresponding equations are
xS = PG (xS , xD(S) )S , where D(S) is the set of variables xj ∈ S such that there
is a path in HG from some variable xi ∈ S to xj . We call a SCC, S, of HG , a
G
critical SCC if the PPS xS = PG (xS , qD(S) )S is critical. In other words, the
SCC S is critical if we plug in the LFP values q G into variables that are in lower
SCCs, D(S), then the resulting PPS is critical. We note that an arbitrary PPS,
x = PG (x) is non-critical if and only if it has no critical SCC. We define the
critical depth, c(G), of x = PG (x) as follows: it is the maximum length, k, of
any sequence S1 , S2 , . . . , Sk , of SCCs of HG , such that for all i ∈ {1, . . . , k − 1},
Si+1 ⊆ D(Si ), and furthermore, such that for all j ∈ {1, . . . , k}, Sj is critical.
Let us call a critical SCC, S, of HG a bottom-critical SCC, if D(S) does not
contain any critical SCCs. By using earlier results ([9, 3]) we can compute in
P-time the critical SCCs of a PPS, and its critical depth (see [8]).
SCFG, Regular Languages, and Newton’s Method 209
PPSs with nested critical SCCs are hard to analyze directly. It turns out we
can circumvent this by “tweaking” the probabilities in the SCFG G to obtain an
SCFG G with no critical SCCs, and showing that the “tweaks” are small enough
so that they do not change the probabilities of interest by much. Concretely:
Theorem 3. For any > 0, and for any SCFG, G, in SNF form, with q G > 0,
with critical depth c(G), consider the new SCFG, G , obtained from G by the
following process: for each bottom-critical SCC, S, of x = PG (x), find any rule
p
r=A− → B of G, such that A and B are both in S (since G is in SNF, such a
rule must exist in every critical SCC). Reduce the probability p, by setting it to
c(G) c(G)
p = p(1 − 2−(14|G|+3)2 2 ). Do this for all bottom-critical SCCs. This
defines G , which is non-critical. Using G instead of G, if we apply R-NM, with
parameter h + 2 to approximate the LFP q G ⊗D of MPS y = PG ⊗D (y), then
q G⊗D − y [h+1] ∞ ≤ where h := log d + (3 · 2c(G) + 1)(log(1/) + 14|G| + 3) .
G,D
Thus we can compute qA = t∈F qsG⊗D0 At
within additive error δ > 0 in time
c(G)
polynomial in: |G|, |D|, log(1/δ), and 2 , in the Turing model of computation.
The proof is very involved, and is in [8]. There, we also give a family of SCFGs,
and a 3-state DFA that checks the infix probability of string aa, and we explain
why these examples indicate it will likely be difficult to overcome the exponential
dependence on the critical-depth c(G) in the above bounds.
It follows from Prop. 4 and Thm. 2, that for SCFGs obtained by parameter
G,D
estimation and EM, we can compute the probability qA of generating a string
in L(D) to within any desired precision in P-time, for any DFA D.
References
[1] Corazza, A., De Mori, R., Gretter, D., Satta, G.: Computation of probabilities for
an island-driven parser. IEEE Trans. PAMI 13(9), 936–950 (1991)
[2] Durbin, R., Eddy, S.R., Krogh, A., Mitchison, G.: Biological Sequence Analysis:
Probabilistic models of Proteins and Nucleic Acids. Cambridge U. Press (1999)
[3] Esparza, J., Gaiser, A., Kiefer, S.: Computing least fixed points of probabilistic
systems of polynomials. In: Proc. 27th STACS, pp. 359–370 (2010)
[4] Esparza, J., Kiefer, S., Luttenberger, M.: Computing the least fixed point of pos-
itive polynomial systems. SIAM J. on Computing 39(6), 2282–2355 (2010)
[5] Esparza, J., Kučera, A., Mayr, R.: Model checking probabilistic pushdown au-
tomata. Logical Methods in Computer Science 2(1), 1–31 (2006)
[6] Etessami, K., Stewart, A., Yannakakis, M.: Polynomial time algorithms for branch-
ing Markov decision processes and probabilistic min(max) polynomial Bellman
equations. In: Czumaj, A., Mehlhorn, K., Pitts, A., Wattenhofer, R. (eds.) ICALP
2012, Part I. LNCS, vol. 7391, pp. 314–326. Springer, Heidelberg (2012); See full
version at ArXiv:1202.4798
[7] Etessami, K., Stewart, A., Yannakakis, M.: Polynomial-time algorithms for multi-
type branching processes and stochastic context-free grammars. In: Proc. 44th
ACM STOC, Full version is available at ArXiv:1201.2374 (2012)
[8] Etessami, K., Stewart, A., Yannakakis, M.: Stochastic Context-Free Gram-
mars, Regular Languages, and Newton’s method, Full preprint of this paper:
ArXiv:1302.6411 (2013)
[9] Etessami, K., Yannakakis, M.: Recursive Markov chains, stochastic grammars, and
monotone systems of nonlinear equations. Journal of the ACM 56(1) (2009)
[10] Etessami, K., Yannakakis, M.: Model checking of recursive probabilistic systems.
ACM Trans. Comput. Log. 13(2), 12 (2012)
[11] Horn, R.A., Johnson, C.R.: Matrix Analysis. Cambridge U. Press (1985)
[12] Jelinek, F., Lafferty, J.D.: Computation of the probability of initial substring gen-
eration by stochastic context-free grammars. Computational Linguistics 17(3),
315–323 (1991)
[13] Knudsen, B., Hein, J.: Pfold: RNA secondary structure prediction using stochastic
context-free grammars. Nucleic Acids Res 31, 3423–3428 (2003)
[14] Manning, C., Schütze, H.: Foundations of Statistical Natural Language Processing.
MIT Press (1999)
[15] Nederhof, M.-J., Satta, G.: Estimation of consistent probabilistic context-free
grammars. In: HLT-NAACL (2006)
[16] Nederhof, M.-J., Satta, G.: Computing partition functions of PCFGs. Research
on Language and Computation 6(2), 139–162 (2008)
[17] Nederhof, M.-J., Satta, G.: Probabilistic parsing. New Developments in Formal
Languages and Applications 113, 229–258 (2008)
[18] Nederhof, M.-J., Satta, G.: Computation of infix probabilities for probabilistic
context-free grammars. In: EMNLP, pp. 1213–1221 (2011)
SCFG, Regular Languages, and Newton’s Method 211
[19] Sánchez, J., Benedí, J.-M.: Consistency of stochastic context-free grammars from
probabilistic estimation based on growth transformations. IEEE Trans. Pattern
Anal. Mach. Intell. 19(9), 1052–1055 (1997)
[20] Stewart, A., Etessami, K., Yannakakis, M.: Upper bounds for Newton’s method
on monotone polynomial systems, and P-time model checking of probabilistic one-
counter automata, Arxiv:1302.3741 (2013) (conference version to appear in CAV
2013)
[21] Stolcke, A.: An efficient probabilistic context-free parsing algorithm that computes
prefix probabilities. Computational Linguistics 21(2), 167–201 (1995)
[22] Wojtczak, D., Etessami, K.: Premo: an analyzer for probabilistic recursive models.
In: Grumberg, O., Huth, M. (eds.) TACAS 2007. LNCS, vol. 4424, pp. 66–71.
Springer, Heidelberg (2007)
Reachability in Two-Clock Timed Automata
Is PSPACE-Complete
1 Introduction
Timed automata [1] are a successful and widely used formalism, which are used in
the analysis and verification of real time systems. A timed automaton is a non-
deterministic finite automaton that is equipped with a number of real-valued
clocks, which allow the automaton to measure the passage of time.
Perhaps the most fundamental problem for timed automata is the reachability
problem: given an initial state, can we perform a sequence of transitions in
order to reach a specified target state? In their foundational paper on timed
automata [1], Alur and Dill showed that this problem is PSPACE-complete. To
show hardness for PSPACE, their proof starts with a linear bounded automaton
(LBA), which is a non-deterministic Turing machine with a fixed tape length n.
They produced a timed automaton with 2n + 1 clocks, and showed that the
timed automaton can reach a specified state if and only if the LBA halts.
However, the work of Alur and Dill did not address the case where the num-
ber of clocks is small. This was rectified by Courcoubetis and Yannakakis [3],
who showed that reachability in timed automata with only three clocks is still
PSPACE-complete. Their proof cleverly encodes the tape of an LBA in a single
clock, and then uses the two additional clocks to perform all necessary oper-
ations on the encoded tape. In contrast to this, Laroussinie et al. have shown
that reachability in one-clock timed automata is complete for NLOGSPACE, and
therefore no more difficult than computing reachability in directed graphs [6].
The complexity of reachability in two-clock timed automata has been left
open. So far, the best lower bound was given by Laroussinie et al., who gave
a proof that the problem is NP-hard via a very natural reduction from subset-
sum [6]. Moreover, the problem lies in PSPACE, because reachability in two-clock
A full version of this paper is available at http://arxiv.org/abs/1302.3109. This
work was supported by EPSRC grants EP/H046623/1 Synthesis and Verification in
Markov Game Structures and EP/D063191/1 The Centre for Discrete Mathematics
and its Applications (DIMAP).
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 212–223, 2013.
c Springer-Verlag Berlin Heidelberg 2013
Reachability in Two-Clock Timed Automata Is PSPACE-Complete 213
2 Subset-Sum Games
A subset-sum game is played between an existential player and a universal
player. The game is specified by a pair (ψ, T ), where T ∈ N, and ψ is a list:
∀ {A1 , B1 } ∃ {E1 , F1 } . . . ∀ {An , Bn } ∃ {En , Fn },
where Ai , Bi , Ei , and Fi , are all natural numbers.
The game is played in rounds. In the first round, the universal player chooses
an element from {A1 , B1 }, and the existential player responds by choosing an
element from {E1 , F1 }. In the second round, the universal player chooses an ele-
ment from {A2 , B2 }, and the existential player responds by choosing an element
from {E2 , F2 }. This pattern repeats for rounds 3 through n. Thus, at the end
of the game, the players will have constructed a sequence of numbers, and the
existential player wins if and only if the sum of these numbers is T .
Formally, the set of plays of the game is the set:
P= {Aj , Bj } × {Ej , Fj }.
1≤j≤n
A play P ∈ P is winning for the existential player if and only if P = T.
A strategy for the existential player is a list of functions s = (s1 , s2 , . . . , sn ),
where each function si dictates how the existential player should play in the ith
round of the game. Thus, each function si is of the form:
si : {Aj , Bj } → {Ei , Fi }.
1≤j≤i
This means that the function si maps the first i moves of the universal player
to a decision for the existential player in the ith round.
A play P conforms to a strategy s if the decisions made by the existential
player in P always agree with s. More formally, if P = p1 p2 . . . p2n is a play,
and s = (s1 , s2 , . . . , sn ) is a strategy, then P conforms to s if and only if we
have si (p1 , p3 , . . . , p2i−1 ) = p2i for all i. A strategy s is winning if every play
P ∈ Plays(s) is winning for the existential player. The subset-sum game problem
is to decide, for a given SSG instance (ψ, T ), whether the existential player has
a winning strategy for (ψ, T ).
The SSG problem clearly lies in PSPACE, because it can be solved on a
polynomial time alternating Turing machine. A quantified version of subset-sum
has been shown to be PSPACE-hard, via a reduction from quantified boolean
formulas [8]. Since SSGs are essentially a quantified version of subset-sum, the
proof of PSPACE-hardness easily carries over.
Lemma 1. The subset-sum game problem is PSPACE-complete.
Reachability in Two-Clock Timed Automata Is PSPACE-Complete 215
4 Counter-Stack Automata
Outline. In this section we ask: can we use a bounded one-counter automaton to
store multiple counters? The answer is yes, but doing so forces some interesting
restrictions on the way in which the counters are accessed. By the end of this
section, we will have formalised these restrictions as counter-stack automata.
Suppose that we have a bounded one-counter automaton with counter c and
bound b = 15. Hence, the width of the counter is 4 bits. Now suppose that we
wish to store two 2-bit counters c1 and c2 in c. We can do this as follows:
c = 1 0 0 1
c2 c1
216 J. Fearnley and M. Jurdziński
We allocate the top two bits of c to store c2 , and the bottom two bits to store c1 .
We can easily write to both counters: if we want to increment c2 then we add 4
to c, and if we want to increment c1 then we add 1 to c.
However, if we want to test equality, then things become more interesting.
It is easy to test equality against c2 : if we want to test whether c2 = 2, then
we test whether 8 ≤ c ≤ 11 holds. But, we cannot easily test whether c1 = 2
because we would have to test whether c is 2, 6, 10, or 14, and this list grows
exponentially as the counters get wider. However, if we know that c2 = 1, then
we only need to test whether c = 6. Thus, we arrive at the following guiding
principle: if you want to test equality against ci , then you must know the values
of cj for all j > i. Counter-stack automata are a formalisation of this principle.
For brevity, we will refer to this instance as (ψ, T ) for the rest of this section.
The construction is split into two parts: the play gadget and the reset gadget.
The Play Gadget. The play gadget is shown in Figure 1. The construction
uses nine counters. The locations are represented by circles and the transitions
are represented by edges. The annotations on the transitions describe the incre-
ments, resets, and equality tests: the notation ci + n indicates that n is added
to counter i, the notation R(ci ) indicates that counter i is reset to 0, and the
notation ci = n indicates that the transition may only be taken when ci = n is
satisfied.
218 J. Fearnley and M. Jurdziński
c1 + 1, c9 + A1 c3 + 1, c9 + E1 c5 + 1, c9 + A2 c7 + 1, c9 + E2
c9 = T
u1 e1 u2 e2 w1 w2
R(c9 )
c2 + 1, c9 + B1 c4 + 1, c9 + F1 c6 + 1, c9 + B2 c8 + 1, c9 + F2
This gadget allows the automaton to implement a play of the SSG. The loca-
tions u1 and u2 allow the automaton to choose the first and second moves of the
universal player, while the locations e1 and e2 allow the automaton to choose
the first and second moves for the existential player. As the play is constructed,
a running total is stored in c9 , which is the top counter on the stack. The final
transition between w1 and w2 checks whether the existential player wins the
play, and then resets c9 . Thus, the set of runs between u1 and w2 corresponds
precisely to the set of plays won by the existential player in the SSG.
In addition to this, each outgoing transition from ui or ei comes equipped with
its own counter. This counter is incremented if and only if the corresponding
edge is used during the play, and this allows us to check precisely which play
was chosen. These counters will be used by the reset gadget. The idea behind our
construction is to force the automaton to pass through the play gadget multiple
times. Each time we pass through the play gadget, we will check a different play,
and our goal is to check a set of plays that verify whether the existential player
has a winning strategy for the SSG.
Play u1 e1 u2 e2
1 A1 E1 or F1 A2 E2 or F2
2 A1 Unchanged B2 E2 or F2
3 B1 E1 or F1 A2 E2 or F2
4 B1 Unchanged B2 E2 or F2
The table shows four different plays, which cover every possible strategy choice
of the universal player. Clearly, if the existential player does have a winning
strategy, then that strategy should be able to win against all strategy choices of
the universal player. The plays are given in a very particular order: the first two
plays contain A1 , while the second two plays contain B1 . Moreover, we always
check A2 , before moving on to B2 .
We want to force the decisions made at e1 and e2 to form a coherent strategy
for the existential player. In this game, a strategy for the existential player is
a pair s = (s1 , s2 ), where si describes the move that should be made at ei . It
is critical to note that s1 only knows whether A1 or B1 was chosen at u1 . This
Reachability in Two-Clock Timed Automata Is PSPACE-Complete 219
c7 = 1, c8 = 0
R(c7 , c8 ) c5 = 1, c6 = 0
w2 r2 r2 u1
R(c7 , c8 )
0
c5
=
=
c7 = 0, c8 = 1
2
1,
c
R
2,
c
(c
=
c3 = 2, c4 = 0
=
,c
c1
1
6
)
R(c3 , c4 )
r1 r1
R(c3 , c4 )
c1
=
c3 = 0, c4 = 2
2,
R
c
(c
2
1
=
,c
2
2
)
t
restriction is shown in the table: the automaton may choose freely between E1
and F1 in the first play. However, in the second play, the automaton must make
the same choice as it did in the first play. The same relationship holds between
the third and fourth plays. These restrictions ensure that the plays shown in
Table 1 are a description of a strategy for the existential player.
The Reset Gadget. The reset gadget, shown in Figure 2, enforces the con-
straints shown in Table 1. The locations w2 and u1 represent the same locations
as they did in Figure 1. To simplify the diagram, we have only included non-
trivial equality tests. Whenever we omit a required equality test, it should be
assumed that the counter is 0. For example, the outgoing transitions from r2
implicitly include the requirement that c7 , c8 , and c9 are all 0.
We consider the following reachability problem: can (t, 0, 0, . . . , 0) be reached
from (u1 , 0, 0, . . . , 0)? The structure of the reset gadget places restrictions on the
runs that reach t. All such runs pass through the reset gadget exactly four times,
and the following table describes each pass:
Pass Path
1 w2 → r2 → r2 → u1
2 w2 → r2 → r2 → r1 → r1 → u1
3 w2 → r2 → r2 → u1
4 w2 → r2 → r2 → r1 → r1 → t
To see why these paths must be taken, observe that, for every i ∈ {1, 3, 5, 7},
each pass through the play gadget increments either ci or ci+1 , but not both.
So, the first time that we arrive at r2 , we must take the transition directly to u1 ,
because the guard on the transition to r1 cannot possibly be satisfied after a
single pass through the play gadget. When we arrive at r2 on the second pass,
we are forced to take the transition to r1 , because we cannot have c5 = 1 and
c6 = 0 after two passes through the play gadget. This transition resets both c5
220 J. Fearnley and M. Jurdziński
and c6 , so the pattern can repeat again on the third and fourth visits to r2 . The
location r1 behaves in the same way as r2 , but the equality tests are scaled up,
because r1 is only visited on every second pass through the reset gadget.
We can now see that all strategies of the universal player must be considered.
The transition between r2 and u1 forces the play gadget to increment c5 , and
therefore the first and third plays must include A2 . Similarly, the transition be-
tween r2 and r1 forces the second and fourth plays to include B2 . Meanwhile, the
transition between r1 and u1 forces the first and second plays to include A1 , and
the transition between r1 and t forces the third and fourth plays to include B1 .
Thus, we select the universal player strategies exactly as Table 1 prescribes.
The transitions between r1 and r1 check that the existential player is playing
a coherent strategy. When the automaton arrives at r1 during the second pass, it
verifies that either E1 was included in the first and second plays, or that F1 was
included in the first and second plays. If this is not the case, then the automaton
gets stuck. The counters c3 and c4 are reset when moving to r1 , which allows
the same check to occur during the fourth pass. For the sake of completeness, we
have included the transitions between r2 and r2 , which perform the same check
for E2 and F2 . However, since the existential player is allowed to change this
decision on every pass, the automaton can never get stuck at r2 .
The end result is that location t can be reached if and only if the existential
player has a winning strategy for (ψ, T ). As we will show in the next section,
the construction extends to arbitrarily large SSGs, which then leads to a proof
that reachability in counter-stack automata is PSPACE-hard. Note that this
construction is safe: c9 is clearly bounded by the maximum value that can be
achieved by a play of the SSG, and reset gadget ensures that no other counter
may exceed 4. Thus, we will have completed our proof of PSPACE-hardness for
bounded one-counter automata and two-clock timed automata.
in odd 2-blocks. Similarly, A1 only appears in the even 1-block, while B1 only
appears in the odd 1-block. The restrictions on the existential player can also be
described using blocks: the existential player’s strategy may not change between
Ei and Fi during an i-block. We generalise this idea in the following definition.
Lemma 5. The existential player has a winning strategy if and only if the ex-
istential player has a sequential winning strategy.
Runs in the Base Automaton. We now describe the set of runs that are
possible in the base automaton. We decompose every run of the automaton into
segments, such that each segment contains a single pass through the play gadget.
More formally, we decompose R into segments R1 , R2 , . . . , where each segment
Ri starts at u1 , and ends at the next visit to u1 . We say that a run gets stuck
if the run does not end at (t, 0, 0, . . . , 0), and if the final state of the run has
no outgoing transitions. We say that a run R gets stuck during an i-block L
if there exists a j ∈ L such that Rj gets stuck. The following lemma gives a
characterisation of the runs in An .
Lemma 6. A run R in An does not get stuck if and only if, for every i-block
L, all of the following hold.
– If L is an even i-block, then Rj must increment ai for every j ∈ L.
– If L is an odd i-block, then Rj must increment bi for every j ∈ L.
– Either Rj increments ei for every j ∈ L, or Rj increments fi for every
j ∈ L.
We say that a run is successful if it eventually reaches (t, 0, 0, . . . , 0). By defi-
nition, a run is successful if and only if it never gets stuck. Also, the transition
from r1 to t ensures that every successful run must have exactly 2n segments.
With these facts in mind, if we compare Lemma 6 with Definition 4, then we
can see that the set of successful runs in An corresponds exactly to the set of
sequential strategies for the existential player in the SSG.
Since we eventually want to implement An as a safe one-counter automaton,
it is important to prove that An is safe. We do this in the following Lemma.
Lemma 7. Along every run of An we have that counters ai and bi never exceed
2n−i+1 , and counters ei and fi never exceed 2n−i .
References
1. Alur, R., Dill, D.L.: A theory of timed automata. Theoretical Computer Sci-
ence 126(2), 183–235 (1994)
2. Bouyer, P., Fahrenberg, U., Larsen, K.G., Markey, N., Srba, J.: Infinite runs in
weighted timed automata with energy constraints. In: Cassez, F., Jard, C. (eds.)
FORMATS 2008. LNCS, vol. 5215, pp. 33–47. Springer, Heidelberg (2008)
3. Courcoubetis, C., Yannakakis, M.: Minimum and maximum delay problems in real-
time systems. Formal Methods in System Design 1(4), 385–415 (1992)
4. Haase, C., Kreutzer, S., Ouaknine, J., Worrell, J.: Reachability in succinct and
parametric one-counter automata. In: Bravetti, M., Zavattaro, G. (eds.) CONCUR
2009. LNCS, vol. 5710, pp. 369–383. Springer, Heidelberg (2009)
5. Haase, C., Ouaknine, J., Worrell, J.: On the relationship between reachability prob-
lems in timed and counter automata. In: Finkel, A., Leroux, J., Potapov, I. (eds.)
RP 2012. LNCS, vol. 7550, pp. 54–65. Springer, Heidelberg (2012)
6. Laroussinie, F., Markey, N., Schnoebelen, P.: Model checking timed automata with
one or two clocks. In: Gardner, P., Yoshida, N. (eds.) CONCUR 2004. LNCS,
vol. 3170, pp. 387–401. Springer, Heidelberg (2004)
7. Naves, G.: Accessibilité dans les automates temporisé à deux horloges. Rapport de
Master, MPRI, Paris, France (2006)
8. Travers, S.: The complexity of membership problems for circuits over sets of integers.
Theoretical Computer Science 369(13), 211–229 (2006)
Ramsey Goes Visibly Pushdown
1 Introduction
Various verification tasks can be stated more or less directly as inclusion problems
of formal languages or comprise inclusion problems as subtasks. For example, the
model-checking problem of non-terminating finite-state systems with respect to
trace properties boils down to the question whether the inclusion L(A) ⊆ L(B)
for two Büchi automata A and B holds, where A describes the traces of the sys-
tem and B the property [22]. Another application of checking language inclusion
for Büchi automata appears in size-change termination analysis [13,19]. Inclusion
problems are in general difficult. For Büchi automata it is PSPACE-complete.
From the closure properties of the class of ω-regular languages, i.e., those lan-
guages that are recognizable by Büchi automata it is obvious that questions like
the one above for model checking non-terminating finite-state systems can be ef-
fectively reduced to an emptiness question, namely, L(A) ∩ L(C) = ∅, where C is
a Büchi automaton that accepts the complement of B. Building a Büchi automa-
ton for the intersection of the languages and checking its emptiness is fairly easy:
the automaton accepting the intersection can be quadratically bigger, the empti-
ness problem is NLOGSPACE-complete, and it admits efficient implementations,
e.g., by a nested depth-first search. However, complementing Büchi automata is
Extended abstract. Omitted details can be found in the full version [15], which is
available from the authors’ web pages.
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 224–237, 2013.
c Springer-Verlag Berlin Heidelberg 2013
Ramsey Goes Visibly Pushdown 225
challenging. One intuitive reason for this is that not every Büchi automaton has
an equivalent deterministic counterpart. Switching to a richer acceptance condi-
tion like the parity condition so that determinization would be possible is currently
not an option in practice. The known determinization constructions for richer ac-
ceptance conditions are intricate, although complementation would then be easy
by dualizing the acceptance condition. A lower bound on the complementation
problem with respect to the automaton size is 2Ω(n log n) . Known constructions for
complementing Büchi automata that match this lower bound are also intricate. As
a matter of fact, all attempts so far that explicitly construct the automaton C from
B scale poorly. Often, the implementations produce automata for the complement
language that are huge, or they even fail to produce an output at all in reasonable
time and space if the input automaton has more than 20 states, see, e.g., [5, 21].
Other approaches for checking the inclusion of the languages given by Büchi
automata or solving the closely related but simpler universality problem for
Büchi automata have recently gained considerable attention [1,2,8–10,13,14,19].
In the worst case, these algorithms have exponential running times, which are
often worse than the 2Ω(n log n) lower bound on complementing Büchi automata.
However, experimental results, in particular, the ones for the so-called Ramsey-
based algorithms show that the performance of these algorithms is superior. The
name Ramsey-based stems from the fact that their correctness is established by
relying on Ramsey’s theorem [20].1
The Ramsey-based algorithms for checking universality L(B) = Σ ω iteratively
build a set of finite graphs starting from a finite base set and closing it off under
a composition operation. These graphs capture B’s essential behavior on finite
words. The language of B is not universal iff this set contains graphs with certain
properties that witness the existence of an infinite word that is not accepted by B.
First, there must be a graph that is idempotent with respect to the composition
operation. This corresponds to the fact that all the runs of B on the finite
words described by the graph loop. We must also require that no accepting
state occurs on these loops. Second, there must be another graph for the runs
on a finite word that reach that loop. To check the inclusion L(A) ⊆ L(B)
the graphs are annotated with additional information about runs of A on finite
words. Here, in case of L(A) ⊆ L(B), the constructed set of graphs contains
graphs that witness the existence of at least one infinite word that is accepted
by A but all runs of B on that word are rejecting. The Ramsey-based approach
generalizes to parity automata [16]. The parity condition is useful in modeling
reactive systems in which certain modules are supposed to terminate and others
are not supposed to terminate. Also, certain Boolean combinations of Büchi
(non-termination) and co-Büchi (termination) conditions can easily be expressed
as a parity condition. Although parity automata can be translated into Büchi
automata, it algorithmically pays off to handle parity automata directly [16].
1
Büchi’s original complementation construction, which also relies on Ramsey’s the-
orem, shares similarities with these algorithms. However, there is significantly less
overhead when checking universality and inclusion directly and additional heuristics
and optimizations are applicable [1, 5].
226 O. Friedmann, F. Klaedtke, and M. Lange
a d b a c d d c
Fig. 1. Nested word w = adbacddbc with Σint = {a}, Σcall = {b, c}, and Σret = {d}. Its
pending positions are 1 and 7 with w1 = d and w7 = c. The call position 2 with w2 = b
matches with the return position 6 with w6 = d. The positions 4 and 5 also match.
2 Preliminaries
Words. The set of finite words over the alphabet Σ is Σ ∗ and the set of infinite
words over Σ is Σ ω . Let Σ + := Σ ∗ \ {ε}, where ε is the empty word. The length
of a word w is written as |w|, where |w| = ω when w is an infinite word. For a
word w, wi denotes the letter at position i < |w| in w. That is, w = w0 w1 . . . if
w is infinite and w = w0 w1 . . . wn−1 if w is finite and |w| = n. With inf(w) we
denote the set of letters of Σ that occur infinitely often in w ∈ Σ ω .
Nested words [4] are linear sequences equipped with a hierarchical structure,
which is imposed by partitioning an alphabet Σ into the pairwise disjoint sets
Σint , Σcall , and Σret . For a finite or infinite word w over Σ, we say that the
position i ∈ N with i < |w| is an internal position if wi ∈ Σint . It is a call
position if wi ∈ Σcall and it is a return position if wi ∈ Σret . When attaching
an opening bracket to every call position and closing brackets to the return
positions in a word w, we group the word w into subwords. This grouping can
be nested. However, not every bracket at a position in w needs to have a match-
ing bracket. The call and return positions in a nested word without matching
brackets are called pending. To emphasize this hierarchical structure imposed by
the brackets and , we also refer to the words in Σ ∗ ∪ Σ ω as nested words. See
Fig. 1 for illustration.
To ease the exposition, we restrict ourselves in the following to nested words
without pending positions. Our results extend to nested words with pending
positions; see [15]. For & ∈ {∗, ω}, NW (Σ) denotes the set of words in Σ with
no pending positions. These words are also called well-matched.
Priority and Reward Ordering. For an arbitrary set S, we always assume that †
is a distinct element not occurring in S. We write S† for S ∪ {†}. We use † to
explicitly speak about partial functions into S, i.e., † denotes undefinedness.
We define the following two orders on N† . The priority ordering is denoted .
and is the standard order of type ω + 1. Thus, we have 0 1 2 · · · †. The
reward ordering / is defined by † ≺ · · · ≺ 5 ≺ 3 ≺ 1 ≺ 0 ≺ 2 ≺ 4 ≺ · · · . Note
that † is maximal for . but minimal for /. For a finite nonempty set S ⊆ N† ,
S and S denote the maxima with respect to the priority ordering . and the
reward ordering /, respectively. Furthermore, we write c & c for {c, c }.
The reward ordering reflects the intuition of how valuable a priority of a VPA’s
state is for acceptance: even priorities are better than odd ones, and the bigger
an even one is the better, while small odd priorities are better than bigger ones
because it is easier to subsume them in a run with an even priority elsewhere.
The element † stands for the non-existence of a run.
3 Universality Checking
Throughout this section, we fix a VPA A = (Q, Γ, Σ, δ, qI , Ω). We describe an
algorithm that determines whether Lω (A) = NW ω (Σ), i.e., whether A accepts
all well-matched infinite nested words over Σ. An extension of the algorithm to
account for non-well-matched nested words and a universality check for VPAs
over finite nested words is given in [15]. Moreover, in [15], we present a comple-
mentation construction for VPAs based on determinization and compare it to
the presented algorithm.
Central to the algorithm are so-called transition profiles. They capture A’s
essential behavior on finite words.
Definition 1. There are three kinds of transition profiles, TP for short. The
first one is an int-TP, which is a function of type Q × Q → Ω(Q)† . We associate
with a symbol a ∈ Σint the int-TP fa . It is defined as
Ω(q ) if q ∈ δint (q, a) and
fa (q, q ) :=
† otherwise.
Ramsey Goes Visibly Pushdown 229
A TP of the form fa for an a ∈ Σ is also called atomic. For τ ∈ {int, call, ret},
we define the set of atomic TPs as Tτ := {fa | a ∈ Στ }.
The above TPs describe A’s behavior when A reads a single letter. In the fol-
lowing, we define how TPs can be composed to describe A’s behavior on words
of finite length. The composition, written f ◦ g, can only be applied to TPs of
certain kinds. This ensures that the resulting TP describes the behavior on a
word w such that, after reading w, A’s stack height has changed by at most one.
Definition 2. Let f and g be TPs. There are six different kinds of compositions,
depending on the TPs’ kind of f and g, which we define in the following. If f
and g are both int-TPs, we define
(f ◦ g)(q, q ) := f (q, q ) & g(q , q ) q ∈ Q .
fa fb fab
q0 q0 q0 q0 q0 X q0
0 1
q1 1 X 0 X
q1 q1 q1 q1 q1 q1
◦
2 2 2
a
a b /X
a q2 2 q2 q2
X
3
Y
q2 = q2
3
Y
Y
q2
b /X 3 3
q3 3 q3 q3 Y q3 q3 Y q3
q0 c /X q3
fb fc fbc
c /X
a q0 q0 q0 q0 q0 q0
b /Y X 0
◦
q1 2 q1 q1 q1 q1 2 q1
q2 b /Y
q2
X
3
Y
q2 q2
X 1
2 Y q2 = q2
3
q2
a 3 2
q3 q3 q3 q3 q3 q3
c /Y Y X
Lemma 3. Let f , g, h, and k be TPs. If (h ◦ f ) ◦ (g ◦
k) and h ◦ (f ◦ g) ◦ k
are both defined then (h ◦ f ) ◦ (g ◦ k) = h ◦ (f ◦ g) ◦ k .
Example 4. Consider the VPA on the left in Fig. 2 with the states q0 , q1 , q2 ,
and q3 . The states’ priorities are the same as their indices. We assume that
Σint = {a}, Σcall = {b}, and Σret = {c}. The stack alphabet is Γ = {X, Y }.
Fig. 2 also depicts the TPs fa , fb , fc and their compositions fa ◦ fb = fab and
fb ◦fc = fbc . The VPA’s states are in-ports and out-ports of a TP. Assume that f
is a call-TP. An in-port q is connected with an out-port q if f (q, B, q ) = †, for
some B ∈ Γ . Moreover, this connection of the two ports is labeled with the stack
symbol B and the priority. The number of a connection between an in-port and
an out-port specifies its priority. For example, the connection in the TP fa from
the in-port q0 to the out-port q0 has priority 0 since fa (q0 , q0 ) = 0. Since fa is
an int-TP, connections are not labeled with stack symbols.
In a composition f ◦ g, we plug f ’s out-ports with g’s in-ports together. The
priority from an in-port of f ◦ g to an out-port of f ◦ g is the maximum with
respect to the priority ordering . of the priorities of the two connections in f
and g. However, if f is a call-TP and g a ret-TP, we are only allowed to connect
the ports in f ◦ g, if the stack symbols of the connections in f and g match.
Finally, since there can be more than one connection between ports in f ◦ g, we
take the maximum with respect to reward ordering /.
We extend the composition operation ◦ to sets of TPs in the natural way, i.e.,
we define F ◦ G := {f ◦ g | f ∈ F and g ∈ G for which f ◦ g is defined}.
Note that the operations ◦ and ∪ are monotonic, and the underlying lattice of
the powerset of all int-TPs is finite. Thus, the least solution always exists and
can be found using fixpoint iteration in a finite number of steps.
The following lemma is helpful in proving that the elements of T can be used
to characterize (non-)universality of A.
Lemma 6. For every TP f , we have f ∈ T only if there is a well-matched
w ∈ Σ + with f = fw .
We need the following notions to characterize universality in terms of the exis-
tence of TPs with certain properties.
Definition 7. Let f be an int-TP.
(i) f is idempotent if f ◦ f = f . Note that only an int-TP can be idempotent.
(ii) For q ∈ Q, we write f (q) for the set of all q ∈ Q that are connected to
f (q) := {q ∈ Q | f (q, q ) = †}. Moreover, for Q ⊆ Q, we
q in this TP, i.e.,
define f (Q ) := q∈Q f (q).
(iii) f is bad for the set Q ⊆ Q if f (q, q) is either † or odd, for every q ∈ f (Q ).
A good TP is a TP that is not bad. Note that any TP is bad for ∅. In the
following, we consider bad TPs only in the context of idempotent TPs.
Example 8. Reconsider the VPA from Example 4 and its TPs. It is easy to
see that TP g := fa ◦ fa is idempotent. Since g(q2 , q2 ) = 2, g is good for any
Q ⊆ {q0 , q1 , q2 , q3 } with q2 ∈ Q . The intuition is that there is at least one run
on (aa)ω that starts in q2 and loops infinitely often through q2 . Moreover, on this
run 2 is the highest priority that occurs infinitely often. So, if there is a prefix
v ∈ Σ + with a run that starts in the initial state and ends in q2 , we have that
v(aa)ω is accepted by the VPA. The TP g is bad for {q1 , q3 }, since g(q1 , q1 ) = †
and g(q3 , q3 ) = 3. So, if there is prefix v ∈ Σ + for which all runs that start in
the initial state and end in q1 or q3 then v(aa)ω is not accepted by the VPA.
Another TP that is idempodent is the TP g := fb ◦ (fb ◦ fc ) ◦ fc . Here, we
have that g (q1 , q1 ) = 2 and g (q, q ) = †, for all q, q ∈ {q0 , q1 , q2 , q3 } with not
q = q = q1 . Thus, g is bad for every Q ⊆ Q with q1 ∈ Q .
The following theorem characterizes universality of the VPA A in terms of the
TPs that are contained in the least solution of the equation from Def. 5.
Theorem 9. Lω (A) = NW ω (Σ) iff there are TPs f, g ∈ T such that g is idem-
potent and bad for f (qI ).
Thm. 9 can be used to decide universality for VPAs with respect to the set of
well-matched infinite words. The resulting algorithm, which we name UNIV, is
depicted in Fig. 3. It computes T by least-fixpoint iteration and checks at each
stage whether two TPs exist that witness non-universality according to Thm. 9.
The variable T stores the generated TPs and the variable N stores the newly
generated TPs in an iteration. UNIV terminates if no new TPs are generated in
an iteration. Termination is guaranteed since there are only finitely many TPs.
For returning a witness of the VPA’s non-universality, we assume that we have
a word associated with a TP at hand. UNIV’s asymptotic time complexity is as
follows, where we assume that we use hash tables to represent T and N .
232 O. Friedmann, F. Klaedtke, and M. Lange
7 N ← N ◦ T ∪ T ◦ N ∪ Tcall ◦ N ◦ Tret \ T
8 T ←T ∪N
9 return universality holds
Fig. 3. Universality check UNIV for VPAs with respect to well-matched words
Theorem 10. Assume that the given VPA A has n ≥ 1 states, index k ≥ 2,
and m = max{1, |Σ|, |Γ |}, where Σ is the VPA’s input alphabet and Γ its stack
alphabet. The running time of the algorithm UNIV is in m3 · 2O(n ·log k) .
2
There are various ways to tune UNIV. For instance, we can store the TPs in a
single hash table and store pointers to the newly generated TPs. Furthermore,
we can store pointers to idempotent TPs. Another optimization also concerns
the badness check in the line 4 to 6. Observe that it is sufficient to know the sets
fu (qI ), for fu ∈ T , i.e, the sets Q ⊆ Q for which all runs for some well-matched
word end in a state in Q . We can maintain
a set R to store this information. We
initialize R with the singleton set ε, {qI } . We update it after line 8 in
each
iteration by assigning the set R ∪ uv, fv (Q ) (u, Q ) ∈ R and fv ∈ T to it.
After this update, we can optimize R by removing an element (u, Q ) from it if
there is another element (u , Q ) in R with Q ⊆ Q . These optimizations do
not improve UNIV’s worst-case complexity but they are of great practical value.
4 Inclusion Checking
In this section, we describe how to check language inclusion for VPAs. For the
sake of simplicity, we assume a single VPA and check for inclusion of the lan-
guages that are defined by two states qI1 and qI2 . It should be clear that it is
always possible to reduce the case for two VPAs to this one by forming the dis-
joint union of the two VPAs. Thus, for i ∈ {1, 2}, let Ai = (Q, Γ, Σ, δ, qIi , Ω) be
the respective VPA. We describe how to check whether Lω (A1 ) ⊆ Lω (A2 ) holds.
Transition profiles for inclusion checking extend those for universality checking.
A tagged transition profile (TTP) of the int-type is an element of
Q × Ω(Q) × Q × Q × Q → Ω(Q)† .
We write it as f p,c,p instead of (p, c, p , f ) in order to emphasize the fact that
the TP f is extended with a tuple of states and priorities. A call-TTP is of type
Q × Γ × Ω(Q) × Q × Q × Γ × Q → Ω(Q)†
Ramsey Goes Visibly Pushdown 233
Note that the stack symbol B is the same in both annotations. As for sets of
TPs, we extend the composition of TTPs to sets.
Similar to Def. 5, we define a set T̂ to be the least solution to the equation
where T̂τ := {Fa | a ∈ Στ }, for τ ∈ {int, call, ret}. This allows us to characterize
language inclusion between two VPAs in terms of the existence of certain TTPs.
Theorem 11. Lω (A1 ) ⊆ Lω (A2 ) iff there are TTPs f qI ,c,p and g p,d,p in T̂
1
5 Evaluation
Our prototype tool FADecider implements the presented algorithms in the pro-
gramming language OCaml.2 To evaluate the tool’s performance we carried out
the following experiments for which we used a 64-bit Linux machine with 4 GB
of main memory and two dual-core Xeon 5110 CPUs, each with 1.6 GHz. Our
benchmark suite consists of VPAs from [11], which are extracted from real-world
recursive imperative programs. Tab. 1 describes the instances, each consisting
of two VPAs A and B, in more detail. Tab. 2 shows FADecider’s running times
for the inclusion checks L∗ (A) ⊆ L∗ (B) and Lω (A) ⊆ Lω (B). For comparison,
we used the OpenNWA library [12]. The inclusion check there is implemented
by a reduction to an emptiness check via a complementation construction. Note
that OpenNWA does not support infinite nested words at all and has no direct
support for only considering well-matched nested words. We used therefore Open-
NWA to perform the language-inclusion checks with respect to all finite nested
words.
FADecider outperforms OpenNWA on these examples. Profiling the inclu-
sion check based on the OpenNWA library yields that complementation requires
about 90% of the overall running time. FADecider spends about 90% of its time
2
The tool (version 0.4) is publicly available at www2.tcs.ifi.lmu.de/fadecider.
Ramsey Goes Visibly Pushdown 235
Table 1. Statistics on the input instances. The first row lists the number of states of the
VPAs from an input instance and their alphabet sizes. The number of stack symbols of
a VPA and its index are not listed, since in these examples the VPA’s stack symbol set
equals its state set and states are either accepting or non-accepting. The second row lists
whether the inclusions L∗ (A) ⊆ L∗(B) and Lω (A) ⊆ Lω (B) of the respective VPAs hold.
Table 2. Experimental results for the language-inclusion checks. The row “FADecider”
lists the running times for the tool FADecider for checking L∗ (A) ⊆ L∗ (B) and
Lω (A) ⊆ Lω (B). The row “#TTPs” lists the number of encountered TTPs. The sym-
bol ‡ indicates that FADecider ran out of time (2 hours). The row “OpenNWA” lists
the running times for the implementation based on the OpenNWA library for checking
inclusion on finite words and the VPA’s size obtained by complementing B.
6 Conclusion
Checking universality and language inclusion for automata by avoiding deter-
minization and complementation has recently attracted a lot of attention, see,
e.g., [1, 9, 10, 13, 16]. We have shown that Ramsey-based methods for Büchi au-
tomata generalize to the richer automaton model of VPAs with a parity accep-
tance condition. Another competitive approach based on antichains has recently
also been extended to VPAs, however, only to VPAs over finite words [6]. It
remains to be seen if optimizations for the Ramsey-based algorithms for Büchi
automata [1] extend, with similar speed-ups, to this richer setting. Another di-
rection of future work is to investigate Ramsey-based approaches for automaton
models that extend VPAs like multi-stack VPAs [18].
References
1. Abdulla, P.A., Chen, Y.-F., Clemente, L., Holı́k, L., Hong, C.-D., Mayr, R., Vo-
jnar, T.: Advanced Ramsey-based Büchi automata inclusion testing. In: Katoen,
J.-P., König, B. (eds.) CONCUR 2011. LNCS, vol. 6901, pp. 187–202. Springer,
Heidelberg (2011)
2. Abdulla, P.A., Chen, Y.-F., Holı́k, L., Mayr, R., Vojnar, T.: When simulation meets
antichains. In: Esparza, J., Majumdar, R. (eds.) TACAS 2010. LNCS, vol. 6015,
pp. 158–174. Springer, Heidelberg (2010)
3. Alur, R., Benedikt, M., Etessami, K., Godefroid, P., Reps, T.W., Yannakakis, M.:
Analysis of recursive state machines. ACM Trans. Progr. Lang. Syst. 27(4), 786–818
(2005)
4. Alur, R., Madhusudan, P.: Adding nesting structure to words. J. ACM 56(3), 1–43
(2009)
5. Breuers, S., Löding, C., Olschewski, J.: Improved Ramsey-based Büchi comple-
mentation. In: Birkedal, L. (ed.) FOSSACS 2012. LNCS, vol. 7213, pp. 150–164.
Springer, Heidelberg (2012)
6. Bruyère, V., Ducobu, M., Gauwin, O.: Visibly pushdown automata: Universality
and inclusion via antichains. In: Dediu, A.-H., Martı́n-Vide, C., Truthe, B. (eds.)
LATA 2013. LNCS, vol. 7810, pp. 190–201. Springer, Heidelberg (2013)
7. Büchi, J.R.: On a decision method in restricted second order arithmetic. In: Proc.
of the 1960 Internat. Congr. on Logic, Method, and Philosophy of Science, pp. 1–11
(1960)
8. Dax, C., Hofmann, M., Lange, M.: A proof system for the linear time μ-calculus.
In: Arun-Kumar, S., Garg, N. (eds.) FSTTCS 2006. LNCS, vol. 4337, pp. 273–284.
Springer, Heidelberg (2006)
9. De Wulf, M., Doyen, L., Henzinger, T.A., Raskin, J.-F.: Antichains: A new algo-
rithm for checking universality of finite automata. In: Ball, T., Jones, R.B. (eds.)
CAV 2006. LNCS, vol. 4144, pp. 17–30. Springer, Heidelberg (2006)
10. Doyen, L., Raskin, J.-F.: Antichains for the automata-based approach to model-
checking. Log. Methods Comput. Sci. 5(1) (2009)
11. Driscoll, E., Burton, A., Reps, T.: Checking conformance of a producer and a
consumer. In: ESEC/FSE 2011, pp. 113–123.
12. Driscoll, E., Thakur, A., Reps, T.: OpenNWA: A nested-word automaton library.
In: Madhusudan, P., Seshia, S.A. (eds.) CAV 2012. LNCS, vol. 7358, pp. 665–671.
Springer, Heidelberg (2012)
13. Fogarty, S., Vardi, M.Y.: Büchi complementation and size-change termination. In:
Kowalewski, S., Philippou, A. (eds.) TACAS 2009. LNCS, vol. 5505, pp. 16–30.
Springer, Heidelberg (2009)
14. Fogarty, S., Vardi, M.Y.: Efficient Büchi universality checking. In: Esparza, J., Ma-
jumdar, R. (eds.) TACAS 2010. LNCS, vol. 6015, pp. 205–220. Springer, Heidelberg
(2010)
15. Friedmann, O., Klaedtke, F., Lange, M.: Ramsey goes visibly pushdown (2012)
(Manuscript); Available at authors’ web pages
16. Friedmann, O., Lange, M.: Ramsey-based analysis of parity automata. In: Flana-
gan, C., König, B. (eds.) TACAS 2012. LNCS, vol. 7214, pp. 64–78. Springer,
Heidelberg (2012)
17. Heizmann, M., Hoenicke, J., Podelski, A.: Nested interpolants. In: POPL 2010, pp.
471–482 (2010)
Ramsey Goes Visibly Pushdown 237
18. La Torre, S., Madhusudan, P., Parlato, G.: A robust class of context-sensitive
languages. In: LICS 2007, pp. 161–170 (2007)
19. Lee, C.S., Jones, N.D., Ben-Amram, A.M.: The size-change principle for program
termination. In: POPL 2001, pp. 81–92 (2001)
20. Ramsey, F.P.: On a problem of formal logic. Proc. London Math. Soc. 30, 264–286
(1928)
21. Tsai, M.-H., Fogarty, S., Vardi, M.Y., Tsay, Y.-K.: State of büchi complementation.
In: Domaratzki, M., Salomaa, K. (eds.) CIAA 2010. LNCS, vol. 6482, pp. 261–271.
Springer, Heidelberg (2011)
22. Vardi, M.Y., Wolper, P.: An automata-theoretic approach to automatic program
verification (preliminary report). In: LICS 1986, pp. 332–344 (1986)
Checking Equality and Regularity
for Normed BPA with Silent Moves
Yuxi Fu
1 Introduction
In [BBK87] Baeten, Bergstra and Klop proved a surprising result that strong
bisimilarity between context free grammars without empty production is decid-
able. The decidability is in sharp contrast to the well known fact that language
equivalence between these grammars is undecidable. After [BBK87] decidability
and complexity issues of equivalence checking of infinite systems à la process
algebra have been intensively investigated. As regards BPA, Hüttel and Stir-
ling [HS91] improved Baeten, Bergstra and Klop’s proof by a more straight-
forward one using tableau system. Hüttel [Hüt92] then repeated the tableau
construction for branching bisimilarity on totally normed BPA processes. Later
Hirshfeld [Hir96] applied the tableau method to the weak bisimilarity on the
totally normed BPA. An affirmative answer to the decidability of the strong
bisimilarity on general BPA is given by Christensen, Hüttel and Stirling by ap-
plying the technique of bisimulation base [CHS92].
The complexity aspect of BPA has also been investigated over the years. Bal-
cazar, Gabarro and Santha [BGS92] pointed out that strong bisimilarity is P-
hard. Huynh and Tian [HT94] showed that the problem is in Σ2p , the second level
of the polynomial hierarchy. Hirshfeld, Jerrum and Moller [HJM96] completed
the picture by offering a remarkable polynomial algorithm for the strong bisimi-
larity of normed BPA. For the general BPA, Burkart, Caucal and Steffen [BCS95]
showed that the strong bisimilarity problem is elementary. They claimed that
their algorithm can be optimized to get a 2-EXPTIME upper bound. A further
elaboration of the 2-EXPTIME upper bound is given in [Jan12] with the intro-
duction of infinite regular words. The current known best lower bound of the
problem, EXPTIME, is obtained by Kiefer [Kie13], improving both the PSPACE
lower bound result and its proof of Srba [Srb02]. Much less is known about the
weak bisimilarity on BPA. Střı́brná’s PSPACE lower bound [Stř98] is subsumed
The full paper can be found at http://basics.sjtu.edu.cn/~ yuxi/.
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 238–249, 2013.
c Springer-Verlag Berlin Heidelberg 2013
Checking Equality and Regularity for Normed BPA with Silent Moves 239
by both the result of Srba [Srb02] and that of Mayr [May03], all of which are
subsumed by Kiefer’s recent result. A slight modification of Mayr’s proof shows
that the EXPTIME lower bound holds for the branching bisimilarity as well.
It is generally believed that weak bisimilarity, as well as branching bisimilarity,
on BPA is decidable. There has been however a lack of technique to resolve
the difficulties caused by silent transitions. This paper aims to advance our
understanding of the decidability problems of BPA in the presence of silent
transitions. The main contributions of the paper are as follows:
– We introduce branching norm, which is the least number of nontrivial actions
a process has to do to become an empty process. With the help of this concept
one can carry out a much finer analysis on silent actions than one would have
using weak norm. Branching norm turns out to be crucial in our approach.
– We reveal that in normed BPA the length of a state preserving silent tran-
sition sequence can be effectively bounded. As a consequence we show that
branching bisimilarity on normed BPA processes can be approximated by a
sequence of finite branching bisimulations.
– We establish the decidability of branching bisimilarity on normed BPA by
constructing a sound and complete tableau system for the equivalence.
– We demonstrate how to derive the decidability of the associated regularity
problem from the decidability of the branching bisimilarity of normed BPA.
The result of this paper is significantly stronger than previous decidability results
on the branching bisimilarity of totally normed BPA [Hüt92, CHT95]. It is easy
to derive effective size bound for totally normed BPA since a totally normed
BPA process with k variable occurrences has a norm at least k. For the same
reason right cancellation property holds. Hence the decidability. The totality
condition makes the branching bisimilarity a lot more like strong bisimilarity.
Proof. If αb = δαb then every silent action sequence from δα to α must
contain only state preserving silent transitions according to Lemma 1. Moreover
there must exist such a silent action path for otherwise αb < δαb . &
%
Definition 4. The relative norm ασb of α with respect to σ is the least k such
j1 jk
that ασ →∗ −→ α1 σ . . . αk−1 σ →∗ −→ αk σ →∗ σ for some j1 , . . . , jk , α1 , . . . , αk .
Proof. Suppose αγb = βδb . Now αγb + γb = αγb = βδb = βδb +
j1
δb . Therefore γb = δb . A norm consistent action sequence αγ →∗ −→
jk j1 jk
. . . →∗ −→→∗ γ must be matched up by βδ →∗ −→ . . . →∗ −→ β δ for some β .
Clearly β δb = γb = δb . It follows from Lemma 3 that δ 5 β δ 5 γ.
&
%
Lemma 4 describes a weak form of left cancelation property. The general left
cancelation property fails. Fortunately there is a nice property of nBPA that
allows us to control the size of common suffix of a pair of bisimilar processes.
4 Equality Checking
SubstL and SubstR allow one to create common suffix for the two processes in
an equality. ContrL and ContrR are used to remove a redundant variable inside
a process. In the side conditions of these two rules, α0 , β0 are the processes
appearing in the root of the global tableau. ContrC deletes redundant variables
from the common suffix of a node label whenever the size of the common suffix
Checking Equality and Regularity for Normed BPA with Silent Moves 245
is over limit. Notice that all the side conditions on the rules are semi-decidable
due to the semi-decidability of 5. So we can effectively enumerate tableaux.
In what follows a node Zη = W κ to which Match rule is applied with the
condition Zη 5 η ∧ W κ 5 κ is called an M-node. A node of the form Zσ = σ
with σ being head irredundant is called a V-node. We now describe how a global
tableau for α0 = β0 is constructed. Assuming α0 = γXα1 and β0 = λY β1 such
that Xα1 5 α1 and Y β1 5 β1 , we apply the following instance of SDecmp rule:
γXα1 = λY β1
.
Xα1 = Y β1 {U Xα1 = Xα1 }U∈V(γ) {V Y β1 = Y β1 }V ∈V(λ)
SubstL rule. Now we can recursively apply the global tableau construction to
γ1 δ1 β1 = λ1 β1 to produce a new subtableau. The treatment of a V-node child,
say U Xα1 = Xα1 , is similar. We keep applying Match rule over α1 as long as
the side condition is met. At certain stage we apply Decmp rule to all the leaves.
The application should meet the following conditions: (i) No occurrence of α1 is
affected; (ii) There is an application of Decmp that takes the following shape
γ1 α1 = λ1 α1
.
α1 = α1 {V α1 = α1 }V ∈V(γ1 ) {V α1 = α1 }V ∈V(λ1 )
α σ σ0 σ1 = β σ σ0 σ1
.
{Xi σ1 = σ1 }i∈I α σ σ1 = β σ σ1 {Xi σ0 σ1 = σ0 σ1 }i∈I
5 Regularity Checking
Regularity problem asks if a process is bisimilar to a finite state process. For
strong regularity problem of nBPA, Kučera [Kuč96] showed that it is decidable
in polynomial time. Srba [Srb02] observed that it is actually NL-complete. The
decidability of strong regularity problem for the general BPA was proved by
Burkart, Caucal and Steffen [BCS95, BCS96]. It was shown to be PSPACE-
hard by Srba [Srb02]. The decidability of almost all weak regularity problems of
process rewriting systems [May00] are unknown. The only exception is Jancar
and Esparza’s undecidability result of weak regularity problem of Petri Net and
its extension [JE96]. Srba [Srb03] proved that weak regularity is both NP-hard
and co-NP-hard for nBPA. Using a result by Srba [Srb03], Mayr proved that
weak regularity problem of nBPA is EXPTIME-hard [May03].
The present paper improves our understanding of the issue by the following.
Theorem 2. The regularity problem of 5 on nBPA is decidable.
Proof. One proves by a combinatorial argument that, in the transition tree of
∗ ∗ ∗
an infinite state BPA process, (i) a path V0 σ0 −→ 1
V1 σ1 −→ 2
V2 σ2 . . . −→
m
Vm σm
exists such that (ii) |σ0 | < |σ1 | < |σ2 | < . . . < |σm | and (iii) V0 σ0 b < V1 σ1 b <
V2 σ2 b < . . . < Vm σm b . We can choose m large enough such that 0 ≤ i <
j ≤ m for some i, j satisfying Vi = Vj and Rσi = Rσj . Let σj = σσi for some
σ. Clearly σi b < σj b . Using Corollary 2 one can prove by induction that
σ i σi 5 σ j σi whenever i = j. It is semi-decidable to find (i) with properties (ii,iii).
The converse implication is proved by a tree construction using Theorem 1. % &
6 Remark
For parallel processes (BPP/PN) with silent actions, the only known decidability
result on equivalence checking is due to Czerwiński, Hofman and Lasota [CHL11].
This paper provides the analogous decidability result for the sequential processes
(BPA/PDA) with silent actions. For further research one could try to apply the
technique developed in this paper to general BPA and normed PDA.
References
[BBK87] Baeten, J., Bergstra, J., Klop, J.: Decidability of bisimulation equivalence
for processes generating context-free languages. In: de Bakker, J.W., Nij-
man, A.J., Treleaven, P.C. (eds.) PARLE 1987. LNCS, vol. 259, pp. 94–113.
Springer, Heidelberg (1987)
[BCS95] Burkart, O., Caucal, D., Steffen, B.: An elementary bisimulation decision
procedure for arbitrary context free processes. In: Hájek, P., Wiedermann, J.
(eds.) MFCS 1995. LNCS, vol. 969, pp. 423–433. Springer, Heidelberg (1995)
Checking Equality and Regularity for Normed BPA with Silent Moves 249
[BCS96] Burkart, O., Caucal, D., Steffen, B.: Bisimulation collapse and the process
taxonomy. In: Sassone, V., Montanari, U. (eds.) CONCUR 1996. LNCS,
vol. 1119, pp. 247–262. Springer, Heidelberg (1996)
[BGS92] Balcazar, J., Gabarro, J., Santha, M.: Deciding bisimilarity is p-complete.
Formal Aspects of Computing 4, 638–648 (1992)
[CHL11] Czerwiński, W., Hofman, P., Lasota, S.: Decidability of branching bisimula-
tion on normed commutative context-free processes. In: Katoen, J.-P., König,
B. (eds.) CONCUR 2011. LNCS, vol. 6901, pp. 528–542. Springer, Heidelberg
(2011)
[CHS92] Christensen, S., Hüttel, H., Stirling, C.: Bisimulation equivalence is decidable
for all context-free processes. In: Cleaveland, W.R. (ed.) CONCUR 1992.
LNCS, vol. 630, pp. 138–147. Springer, Heidelberg (1992)
[CHT95] Caucal, D., Huynh, D., Tian, L.: Deciding branching bisimilarity of normed
context-free processes is in σ2p . Information and Computation 118, 306–315
(1995)
[Hir96] Hirshfeld, Y.: Bisimulation trees and the decidability of weak bisimulations.
Electronic Notes in Theoretical Computer Science 5, 2–13 (1996)
[HJM96] Hirshfeld, Y., Jerrum, M., Moller, F.: A polynomial algorithm for decid-
ing bisimilarity of normed context free processes. Theoretical Computer Sci-
ence 158(1-2), 143–159 (1996)
[HS91] Hüttel, H., Stirling, C.: Actions speak louder than words: Proving bisimilarity
for context-free processes. In: LICS 1991, pp. 376–386 (1991)
[HT94] Huynh, T., Tian, L.: Deciding bisimilarity of normed context free processes
is in σ2p . Theoretical Computer Science 123, 83–197 (1994)
[Hüt92] Hüttel, H.: Silence is golden: Branching bisimilarity is decidable for context
free processes. In: Larsen, K.G., Skou, A. (eds.) CAV 1991. LNCS, vol. 575,
pp. 2–12. Springer, Heidelberg (1992)
[Jan12] Jančar, P.: Bisimilarity on basic process algebra is in 2-exptime (2012)
[JE96] Jančar, P., Esparza, J.: Deciding finiteness of petri nets up to bisimulation.
In: Meyer auf der Heide, F., Monien, B. (eds.) ICALP 1996. LNCS, vol. 1099,
pp. 478–489. Springer, Heidelberg (1996)
[Kie13] Kiefer, S.: BPA bisimilarity is exptime-hard. Information Processing Let-
ters 113, 101–106 (2013)
[Kuč96] Kučera, A.: Regularity is decidable for normed BPA and normed BPP pro-
cesses in polynomial time. In: Král, J., Bartosek, M., Jeffery, K. (eds.) SOF-
SEM 1996. LNCS, vol. 1175, pp. 377–384. Springer, Heidelberg (1996)
[May00] Mayr, R.: Process rewrite systems. Information and Computation 156, 264–
286 (2000)
[May03] Mayr, R.: Weak bisimilarity and regularity of BPA is exptime-hard. In: EX-
PRESS 2003 (2003)
[Srb02] Srba, J.: Strong bisimilarity and regularity of basic process algebra is pspace-
hard. In: Widmayer, P., Triguero, F., Morales, R., Hennessy, M., Eidenbenz,
S., Conejo, R. (eds.) ICALP 2002. LNCS, vol. 2380, pp. 716–727. Springer,
Heidelberg (2002)
[Srb03] Srba, J.: Complexity of weak bisimilarity and regularity for BPA and BPP.
Mathematical Structures in Computer Science 13, 567–587 (2003)
[Stř98] Střı́brná, J.: Hardness results for weak bisimilarity of simple process algebras.
Electronic Notes in Theoretical Computer Science 18, 179–190 (1998)
[vGW89] van Glabbeek, R., Weijland, W.: Branching time and abstraction in bisimula-
tion semantics. In: Information Processing 1989, pp. 613–618. North-Holland
(1989)
FO Model Checking of Interval Graphs
1 Introduction
Results on the existence of an efficient algorithm for a class of problems have re-
cently attracted a significant amount of attention. Such results are now referred
to as algorithmic meta-theorems, see a recent survey [15]. The most prominent
example is a theorem of Courcelle [1] asserting that every MSO property can be
model checked in linear time on the class of graphs with bounded tree-width.
Another example is a theorem of Courcelle, Makowski and Rotics [2] assert-
ing that the same conclusion holds for graphs with bounded clique-width when
quantification is restricted to vertices and their subsets.
A full version of this contribution, which contains all proofs, can be downloaded
from http://arxiv.org/abs/1302.6043. All the authors except for Jarett Schwartz
acknowledge support of the Czech Science Foundation under grant P202/11/0196.
Robert Ganian also acknowledges support by the ERC grant (COMPLEX REA-
SON 239962) held by Stefan Szeider. Jarett Schwartz acknowledges support of the
Fulbright and NSF Fellowships.
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 250–262, 2013.
c Springer-Verlag Berlin Heidelberg 2013
FO Model Checking 251
L-interval graph that has bounded maximum degree and that satisfies the same
properties expressible by FO sentences with bounded quantifier rank. We remark
that encoding a game associated with a model checking problem by a tree, which
describes the course of the game, was also applied in designing fast algorithms
for MSO model checking [14,16].
On the negative side, we show that if L is an infinite set that is dense in
some open set, then L-interval graphs can be used to model arbitrary graphs.
Specifically, we show that L-interval graphs for such sets L allow polynomially
bounded FO interpretations of all graphs. Consequently, testing FO properties
for L-intervals graphs for such sets L is W[2]-hard (see Corollary 2). In addition,
we show that unit interval graphs allow polynomially bounded MSO interpreta-
tions of all graphs.
The property of being W[2]-hard comes from the theory of parameterized
complexity [6], and it is equivalent to saying that the considered problem is
at least as hard as the d-dominating set problem, asking for an existence of a
dominating set of fixed parameter size d in a graph. It is known that, unless the
Exponential time hypothesis fails, W[2]-hard problems cannot have polynomial
algorithms with the degree a constant independent of the parameter (of the
considered FO property in our case).
In Section 2, we introduce the notation and the computational model used
in the paper. In the following section, we present an O(n log n) algorithm for
deciding FO properties of L-interval graphs for finite sets L. In Section 4, we
present proofs of the facts mentioned above on the clique-width of L-interval
graphs with bounded radius. Finally, we establish FO interpretability of graphs
in L-interval graphs for sets L which are dense in an open set in Section 5.
2 Notation
of reals, then L(k) is the set of all integer linear combinations of numbers from
L with the sum of the absolute values of their coefficients bounded by k. For
instance, L(0) = {0} and L(1) = L ∪ {0}. An L-distance of two intervals [a, b)
and [c, d) is the smallest k such that c − a ∈ L(k) . If no such k exists, then the
L-distance of two intervals is defined to be ∞.
Since we do not restrict our attention to L-interval graphs where L is a set
of rationals, we should specify the computational model considered. We use
the standard RAM model with infinite arithmetic precision and unit cost of all
arithmetic operation, but we refrain from trying to exploit the power of this com-
putational model by encoding any data in the numbers we store. In particular,
we only store the end points of the intervals in the considered representations of
graphs in numerical variables with infinite precision.
2.1 Clique-Width
We now briefly present the notion of clique-width introduced in [3]. Our results
on interval graphs related to this notion are given in Section 4. A k-labeled
graph is a graph with vertices that are assigned integers (called labels) from 1
to k. The clique-width of a graph G equals the minimum k such that G can
be obtained from single vertex graphs with label 1 using the following four
operations: relabeling all vertices with label i to j, adding all edges between the
vertices with label i and the vertices with label j (i and j can be the same),
creating a vertex labeled with 1, and taking a disjoint union of graphs obtained
using these operations.
Theorem 2. Let d be an integer. If the d-EF-trees for the game played on two
relational structure R and R are EF-equivalent, then the duplicator wins the
d-round Ehrenfeucht-Fraı̈ssé game for R and R .
FO Model Checking 255
The converse implication, i.e., that if the duplicator can win the d-round
Ehrenfeucht-Fraı̈ssé game for R and R , then the d-EF-trees for the game played
on relational structures R and R are EF-equivalent, is also true, but we omit
further details as we only need the implication given in Theorem 2 in our con-
siderations.
We finish this section with some observations on minimal d-EF-trees in EF-
equivalence classes. Let T be a d-EF-tree. Suppose that an internal node at
level d − 1 has two children, which are leaves, associated with the same labeled
structure. Observe that deleting one of them yields an EF-equivalent d-EF-tree.
Suppose that we have deleted all such leaves and an internal node at level d − 2
has two children with their subtrees isomorphic (in the usual sense). Again,
deleting one of them (together with its subtree) yields an EF-equivalent d-EF-
tree. So, if T is a minimal subtree of T that is EF-equivalent to T and K is
the number of non-isomorphic d-labeled structures, then the degree of nodes at
depth d − 1 does not exceed K, those at depth d − 2 does not exceed 2K , those
K
at depth d − 3 does not exceed 22 , etc. We conclude that the size of a minimal
subtree of T that is EF-equivalent to T is bounded by a function of d and the
type of relational structures considered only.
3 FO Model Checking
Using Theorems 1 and 2, we prove the following kernelization result for L-interval
graphs.
Theorem 3. For every finite subset L of reals and every d, there exists an
integer K0 and an algorithm A with the following properties. The input of A is
an L-representation of an n-vertex L-interval graph G and A outputs in time
O(n log n) an L-representation of an induced subgraph G of G such that
– every unit interval contains at most K0 left end points of the intervals cor-
responding to vertices of G , and
– G and G satisfy the same FO sentences with quantifier rank at most d.
Proof. We first focus on proving the existence of the number K0 and the sub-
graph G and we postpone the algorithmic considerations to the end of the proof.
As the first step, we show that we can assume that all the left end points
are distinct. Choose δ to be the minimum distance between distinct end points
of intervals in the representation. Suppose that the intervals are sorted by their
left end points (resolving ties arbitrarily). Shifting the i-th interval by iδ/2n, for
i = 1, . . . , n, to the right does not change the graph represented by the intervals
and all the end points become distinct.
d+1
Choose ε to be the minimum positive element of L(2 ) . Fix any real a and
d+1
let I be the set of all intervals [x, x + ε) such that x − a ∈ L(2 ) . By the choice
of ε, the intervals of I are disjoint. In addition, the set I is finite (since L is
finite). Let W be the set of vertices w of G such that (w) lies in an interval
from I, and for such a vertex w, let i(w) be the left end point of that interval
256 R. Ganian et al.
Claim. There exists a number K depending on only |I| and d such that if W
contains more than K elements associated with the interval [a, a + ε), then there
exists an element w ∈ W associated with [a, a + ε) such that the d-EF-trees for
the game played on W and W \ {w} are EF-equivalent.
Indeed, let T be the d-EF-tree for the game played on W and let T a minimal
subtree of T that is EF-equivalent to T . Recall that the size of T does not
exceed a number K depending on only |I| and d. If W contains more than K
elements associated with [a, a + ε), then one of them is not associated with edges
that are present in T . We set w to be this element. This finishes the proof of
the claim.
Since the d-EF-trees for the game played on W and W \{w} are EF-equivalent,
the duplicator wins the d-round Ehrenfeucht-Fraı̈ssé game for W and W \ {w}
by Theorems 1 and 2.
We describe a strategy for the duplicator to win the d-round Ehrenfeucht-
Fraı̈ssé game for the graphs G and G \ w. During the game, some intervals from
I will be marked as altered. At the beginning, the only altered interval is the
interval [a, a + ε).
The duplicator strategy in the i-th round of the game is the following.
altered and these chosen vertices are altered. Since we have followed a winning
strategy for the duplicator for W and W \ {w} when choosing altered vertices,
the subgraphs of G and G \ w induced by the altered vertices are isomorphic. We
conclude that the subgraphs of G and G \ w induced by the vertices w1 , . . . , wd
and w1 , . . . , wd , respectively, are isomorphic. So, the duplicator wins the game.
Let us summarize our findings. If an interval of length ε contains more than
K left end points of intervals in the given L-representation of G, then one of
the vertices corresponding to these intervals can be removed from G without
changing the set of FO sentences with rank at most d that are satisfied by G.
So, the statement of the theorem is true with K0 set to K ε−1 .
It remains to consider the algorithmic aspects of the theorem. The values of
ε and K0 are determined by L and d. The algorithm sorts the left end points
of all the intervals (this requires O(n log n) time) and for each of these points
computes the distance to the left end of the interval that is K positions later
in the obtained order. If all these distances are at least ε, then every interval of
length at most ε contains at most K0 left end points of the intervals and the
representation is of the desired form.
Otherwise, we choose the smallest of these distances and consider the corre-
sponding interval [a, b), b − a < ε, containing at least K0 left end points of the
intervals from the representation. By the choice of this interval, any interval of
length b − a at L-distance at most 2d+1 from [a, b] contains at most K0 + 1 left
end points of the intervals from the representation. So, the size of the d-EF-tree
for the game played on the vertices v with (v) in such intervals is bounded by a
function of K0 , d and |L|. Since this quantity is independent of the input graph,
we can identify in constant time a vertex w with (w) ∈ [a, b) whose removal
from G does not change the set of FO sentences with quantifier rank d satisfied
by G.
We then update the order of the left end points and the at most K0 computed
distances affected by removing w, and iterate the whole process. Since at each
step we alter at most K0 distances, using a heap to store the computed distances
and choose the smallest of them requires O(log n) time per vertex removal. So,
the running time of the algorithm is bounded by O(n log n). &
%
Theorem 4. For every finite subset L of reals and every FO sentence Φ, there
exists an algorithm running in time O(n log n) that decides whether an input
n-vertex L-interval graph G given by its L-representation satisfies Φ.
258 R. Ganian et al.
Unit interval graphs can have unbounded clique-width [12], but Lozin [17] noted
that every proper hereditary subclass of unit interval graphs has bounded clique-
width. In particular, the class of ({1}, d)-interval graphs has bounded clique-
width for every d > 0. Using Gaifman’s theorem, it follows that testing FO
properties of unit interval graphs can be performed in linear time if the input
graph is given by its {1}-representation with the left end points of the intervals
sorted. We provide an easy extension of this, and outline how it can be used to
prove the special case of our main result for FO model checking when L is a
finite set of rational numbers (the proof of the lemma is omitted due to space
constraints).
Lemma 1. Let L be a finite set of positive rational numbers. For any d > 0,
the class of (L, d)-interval graphs has bounded clique-width.
From Lemma 1 and Gaifman’s theorem, one can approach the FO model checking
problem on L-interval graphs with L containing rational numbers only as fol-
lows. L-interval graphs with radius d are (L, (2d + 1) max L)-interval graphs. By
Gaifman’s theorem, every FO model checking instance can be reduced to model
checking of basic local FO sentences, i.e., to FO model checking on L-interval
graphs with bounded radius. Since such graphs have bounded clique-width, the
latter can be solved in linear time by [2]. Combining this with the covering
technique from [11], which can be adapted to run in linear time in the case of
L-interval graphs, we obtain the following.
Informally, we are “folding” a long sequence with differences from L(n) into a
bounded length interval, avoiding as much collisions of points as possible.
Let δ > 0 be such that nδ is smaller than the smallest number in L(n) ∩ (0, d −
q). Let us introduce the following shorthand notation: if J is an interval and r
a real, then J + r is the interval J shifted by r to the right. Similarly, if I is
a set of intervals, then I + r is the set of the intervals from I shifted by r to
the right. We define sets of intervals U1 := {[iδ, 1 + iδ) : i = 0, . . . , n − 1} and
Uq := {[iδ, q + iδ) : i = 0, . . . , n − 1}. For further reference we say that intervals
[iδ, 1 + iδ) or [iδ, q + iδ) are at level i.
For i = 1, . . . , n, we set Wi = Uq +ai if ai is a q-element of P , and Wi = U1 +ai
otherwise. Then every interval of Wi is a subinterval of [0, d). Let G be a graph
on n2 vertices represented by the union of the interval sets W1 ∪ W2 ∪ · · · ∪ Wn .
Let Wi , i = 1, . . . , n, be the vertices represented by Wi . We claim that the
clique-width of G exceeds any fixed number k ∈ N when n sufficiently large.
Assume, for a contradiction, that the clique-width of G is at most k. We can
view the construction of G as a binary tree and conclude a k-labelled subgraph
G1 of G with 13 n2 ≤ |V (G1 )| ≤ 23 n2 appeared during the construction of G.
However, this implies that vertices of G1 have at most k different neighborhoods
in G \ V (G1 ). We will show that this is not possible (assuming that n is large).
For 2 ≤ i ≤ n, vertices x ∈ Wi−1 and y ∈ Wi are mates if they are represented
by copies of the same-level intervals from U1 or Uq above. Our first observation is
that, up to symmetry between i−1 and i, 0 ≤ |Wi−1 ∩V (G1 )|−|Wi ∩V (G1 )| ≤ k.
Suppose not. Then there exist k + 1 vertices in Wi−1 ∩ V (G1 ) whose mates are
in Wi \ V (G1 ), and thus certify pairwise distinct neighborhoods of the former
ones in G \ V (G1 ).
A set Wi is crossing G1 if ∅ = Wi ∩ V (G1 ) = Wi . The arguments given in
the previous paragraph and 13 n2 ≤ |V (G1 )| ≤ 23 n2 imply that for any m, if n is
large, there exist sets Wi0 , Wi0 +1 , . . . , Wi0 +m in G all crossing G1 . So, we can
select an arbitrarily large index set I ⊆ {i0 , . . . , i0 + m − 1}, |I| = , such that
each i ∈ I the element ai+1 is to the right of ai , and that all intervals in
for
i∈I Wi share a common point. In particular, ai is not a q-element and so both
Wi and Wi+1 are shifted copies of U1 . Let i1 , . . . , i be the elements of I ordered
according to the (strictly) increasing values of ai , i.e., ai1 < · · · < ai .
Finally, for any j, j ∈ {1, . . . , } such that j > j +1, we see that each vertex of
Wij ∩ V (G1 ) cannot have the same neighborhood as any vertex of Wij ∩ V (G1 ):
this is witnessed by the non-empty set Wij+1 +1 \ V (G1 ) (represented to the right
of the intervals from Wij while intersecting every interval from Wij ). Therefore,
the vertices of G1 have at least /2 > k distinct neighborhoods in G \ V (G1 ),
which contradicts the fact that the clique-width of G is at most k. &
%
260 R. Ganian et al.
Since many FO properties are W[2]-hard for general graphs, we can immediately
conclude the following.
We now turn our attention to interpretation in unit interval graphs. The price
we pay for restricting to a smaller class of interval graphs is the strength of
the interpretation language used, namely that of MSO logic. At this point we
remark that there exist two commonly used MSO frameworks for graphs; the
MSO1 language which is allowed to quantify over vertices and vertex sets only,
and MSO2 which is in addition allowed to quantify over edges and edge sets. We
stay with the former weaker one in this paper.
An MSO1 graph interpretation is defined in the analogous way to former FO
interpretation with the formulas μ and ν being MSO1 formulas (we omit a proof
due to space limitations).
This corollary is rather tight since the aforementioned result of Lozin [17] claims
that every proper hereditary subclass of unit interval graphs has bounded clique-
width, and hence MSO1 model checking on this class is in linear time [2].
Lastly, we remark that Fellows et al [9] have shown that testing FO properties
on unit two-interval graphs (i.e., such that each vertex corresponds to a pair of
intervals, each on a distinct line) is W[1]-hard.
References
1. Courcelle, B.: The monadic second order logic of graphs I: Recognizable sets of
finite graphs. Inform. and Comput. 85, 12–75 (1990)
2. Courcelle, B., Makowsky, J.A., Rotics, U.: Linear time solvable optimization prob-
lems on graphs of bounded clique-width. Theory Comput. Syst. 33, 125–150 (2000)
3. Courcelle, B., Olariu, S.: Upper bounds to the clique width of graphs. Discrete
Appl. Math. 101, 77–114 (2000)
4. Dawar, A., Grohe, M., Kreutzer, S.: Locally excluding a minor. In: LICS 2007,
pp. 270–279. IEEE Computer Society (2007)
5. Dawar, A., Kreutzer, S.: Parameterized complexity of first-order logic. ECCC
TR09-131 (2009)
6. Downey, R., Fellows, M.: Parameterized complexity. Monographs in Computer Sci-
ence. Springer (1999)
7. Dvořák, Z., Král’, D., Thomas, R.: Deciding first-order properties for sparse graphs.
In: FOCS 2010, pp. 133–142. IEEE Computer Society (2010)
8. Ehrenfeucht, A.: An application of games to the completeness problem for formal-
ized theories. Fund. Math. 49, 129–141 (1961)
9. Fellows, M., Hermelin, D., Rosamond, F., Vialette, S.: On the parameterized com-
plexity of multiple-interval graph problems. Theoret. Comput. Sci. 410, 53–61
(2009)
10. Fraı̈ssé, R.: Sur quelques classifications des systèmes de relations. Université
d’Alger, Publications Scientifiques, Série A 1, 35–182 (1954)
11. Frick, M., Grohe, M.: Deciding first-order properties of locally tree-decomposable
structures. J. ACM 48, 1184–1206 (2001)
12. Golumbic, M., Rotics, U.: On the clique-width of some perfect graph classes. Int.
J. Found. Comput. Sci. 11, 423–443 (2000)
13. Grohe, M., Kreutzer, S.: Methods for algorithmic meta theorems. In: Model Theo-
retic Methods in Finite Combinatorics Contemporary Mathematics, pp. 181–206.
AMS (2011)
14. Kneis, J., Langer, A., Rossmanith, P.: Courcelle’s theorem — a game-theoretic
approach. Discrete Optimization 8(4), 568–594 (2011)
15. Kreutzer, S.: Algorithmic meta-theorems. ECCC TR09-147 (2009)
16. Langer, A., Reidl, F., Rossmanith, P., Sikdar, S.: Evaluation of an mso-solver. In:
ALENEX 2012, pp. 55–63. SIAM / Omnipress (2012)
17. Lozin, V.: From tree-width to clique-width: Excluding a unit interval graph. In:
Hong, S.-H., Nagamochi, H., Fukunaga, T. (eds.) ISAAC 2008. LNCS, vol. 5369,
pp. 871–882. Springer, Heidelberg (2008)
18. Nešetřil, J., Ossona de Mendez, P.: Grad and classes with bounded expansion I.
Decompositions. European J. Combin. 29, 760–776 (2008)
262 R. Ganian et al.
19. Nešetřil, J., Ossona de Mendez, P.: Grad and classes with bounded expansion II.
Algorithmic aspects. European J. Combin. 29, 777–791 (2008)
20. Nešetřil, J., Ossona de Mendez, P.: Grad and classes with bounded expansion III.
Restricted graph homomorphism dualities. European J. Combin. 29, 1012–1024
(2008)
21. Rabin, M.O.: A simple method for undecidability proofs and some applications. In:
Logic, Methodology and Philosophy of Sciences, vol. 1, pp. 58–68. North-Holland
(1964)
22. Seese, D.: Linear time computable problems and first-order descriptions. Math.
Structures Comput. Sci. 6, 505–526 (1996)
Strategy Composition in Compositional Games
Marcus Gelderie
1 Introduction
Infinite games with ω-regular winning conditions have been studied extensively
over the past decades [1–5]. This research has been most successful in establishing
results about solving ω-regular games on an “abstract” arena. A fundamental
open problem, which is of intrinsic interest in the area of automated synthesis,
is to exploit the compositional structure of an arena to derive a compositional
representation of a winning strategy. For instance, if an arena is viewed as a
product of several smaller transition systems, is it possible to lift this structure
to strategies in games on this arena?
The classical results on ω-regular games depend on the representation of a
winning strategy by an automaton. None of these results allows to transfer a
given composition of an arena into a composition of automata in such a way
that a winning strategy is implemented. Since there is no lack of methods for
composing automata (for example, the cascade product), it rather seems that
automata are too “coarse” a tool to capture this compositional structure.
We study the compositional nature of winning strategies in games played
on products of arenas. Products of arenas can be defined in a variety of ways
(see e.g. [6]). As a first step towards a compositional approach to synthesis, we
restrict ourselves to two notions, parallel and synchronized product. Our notion
of strategy composition relies on a Turing machine based model for strategy
Supported by DFG research training group 1298, “Algorithmic Synthesis of Reactive
and Discrete-Continuous Systems” (AlgoSyn).
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 263–274, 2013.
c Springer-Verlag Berlin Heidelberg 2013
264 M. Gelderie
representation, called a strategy machine. Using this model, we show how winning
strategies in reachability games can be composed from winning strategies in
games over the constituent factors of the overall product arena. We study the
complexity of such a composition: its size, its runtime and the computational
complexity of finding it. This entails a study of the complexity of deciding who
wins the game.
Compositionality in an arena is closely linked to a succinct representation of
that arena. Likewise, composing a winning strategy from smaller winning strate-
gies may yield a much smaller representation for that strategy. Finding succinct
transition systems from specifications was studied in [7]. The authors consider
the problem of finding a succinct representation of a model for a given CTL
formula. They show that such succinct models are unlikely to exist in general.
Transition systems which are obtained by “multiplying” smaller transition
systems have also been studied in [8]. The authors consider the problem of model
checking such systems. They show the model checking problem for such systems
to be of high complexity for various notions of behavioral specification and model
checking problem.
Strategy machines were introduced in [9] (the model has been studied in a
different setting in [10]). They allow for a broader range of criteria by which to
compare strategies. Being based on Turing machines, strategy machines allow, for
instance, to investigate the “runtime” of a strategy and to quantify and compare
“dynamic” memory (the tape content) and “static memory” (the control states).
The complexity of deciding the winner of a game has been subject to extensive
research in the case of games on an abstract arena [11–13]. These complexity
results depend on the size of the abstract arena. We investigate the complexity
of deciding the winner based on a composite representation of the arena.
Our paper is structured as follows: We first define two notions of product of
arenas, the parallel product and the synchronized product. The games we study
are played on arenas that are composed from smaller arenas using these two
operators. Having defined the notion of arena composition, we define strategy
machines and use them to introduce our notion of strategy composition. Sub-
sequently, we study reachability games. We do this separately for the parallel
product and the synchronized product. To this end, we first introduce two nat-
ural ways of defining a reachability condition on a composite arena, local and
synchronized reachability. For the parallel product we obtain a compositionality
theorem for both local and synchronized reachability. For the synchronized prod-
uct we show that deciding the game is Exptime complete. From this we deduce
that finding a general composition theorem is equivalent to showing Exptime
= Pspace.
– V (σ) = {(b, v) ∈ V | b = σ}
Note that the parallel product again gives a bipartite arena. Note furthermore
(0)
that, given a vertex (σ, v) ∈ × i Vi , the number of vertices vi ∈ Vi alter-
natingly increases and decreases by one along all paths starting in (σ, v). The
number of components player 0 controls in each of his moves is given by:
(0)
rank0 (σ, v) = |{i | vi ∈ Vi }| + σ
Player 1 controls rank1 (σ, v) = k − rank0 (σ, v) + 1 components during his moves.
For every p ∈ we have rankp (σ , v ) = rankp (σ, v) for all (σ , v ) reachable
from (σ, v). If (σ, v) is clear from context, we thus simply write rankp .
A1 A2 Ak A1 A2 Ak
y2 x1 y2 yk
··· b a ··· b
v v1 v2 vk
v v1 v2 vk b b a
u1 x2 a w1 x 2 w2 xk
(a) Parallel Product: Edges are taken lo- (b) Synchronized Product: Where transi-
cally. The square player may move in, e.g., tions permit it, edges are taken globally.
A1 but not in A2 . The circle player may choose transitions
in A1 and A2 . Ak is not affected.
Remark 1. Neither the parallel product nor the synchronized product are asso-
ciative in general. This is due to the fact that we absorb the information about
whose turn it is into the arena. We do so for technical reasons. It is nonessential
for the results.
In this paper we study ω-regular games. We assume the reader is familiar with
the elementary theory of ω-regular games. For an introduction see [4, 5]. In the
following, we recall some terminology. A game is a tuple G = (A, W, v0 ) =
(A, W ) consisting of an arena A = (V, E) and a winning condition W ⊆ V ω and
an initial vertex v0 . We always assume that there is a designated initial vertex,
even if we do not always list it explicitly. G is ω-regular if W is ω-regular.
We denote the players by player 0 and player 1. A play in G is an infinite path
π = v0 v1 v2 · · · through A, starting from v0 . On nodes in V (0) player 0 chooses the
next vertex. Otherwise, player 1 chooses. The play is won by player 0 if π ∈ W .
We denote the winning set of player σ by W (σ) = W (σ) (G). The attractor for
player p on a set F is denoted by AttrA p (F ) and defined as usual. It is the set of
vertices from which p can enforce a visit to F .
To study games on composite arenas, we require some additional notation.
Consider a game G = (A, W ) on a composite arena A = A1 ∗ · · · ∗ Ak , with ∗ ∈
{, ⊗}. We call A1 , . . . , Ak the constituent arenas of A. A game Gi = (Ai , Wi )
for some Wi ⊆ Viω is called a component game.
The winning condition W is necessarily given by means of some finite repre-
sentation. In this paper we consider mainly reachability conditions, which are
determined by a set F ⊆ V . A play π satisfies the reachability condition F if
π(i) ∈ F for some i ∈ = {0, 1, 2, . . .}.
It is sometimes convenient to specify properties on a path in some logic. In
this paper we use LTL to express temporal properties on paths. We again assume
the reader is familiar with LTL (see [4, 5] for an introduction). We write ψ U φ
for the strict until (φ is true eventually, and, until then, ψ holds).
1. local reachability, where F = Floc (F1 , . . . , Fk ) is the set of all v ∈ i Vi with
vi ∈ Fi for some i
2. synchronized
reachability, where F = Fsync (F1 , . . . , Fk ) is the set of all v ∈
i Vi with vi ∈ Fi for every i
We omit the full proof due to space constraints. However, the idea is to show that
deciding the winning set can be done by deciding conditions on the components:
Player 0 wins from (σ0 , v0 ) iff one of the following two applies
(0)
1. There exists i with vi,0 ∈ Vi and vi,0 Ei ∩ Fi = ∅.
2. |{i | vi,0 ∈ AttrA
0 (Fi )}| ≥ rank1
i
The proof of this characterization gives component strategies for both players,
which can be composed to a winning strategy for the respective player in G.
Next, we consider synchronized reachability. We have:
Lemma 1. In thm. 2, let (σ0 , v0 ) be such that rank1 = 1. Then player 0 wins
from (σ0 , v0 ) iff all of the following hold:
for all j ∈ {1, . . . , k}, all γ̂ ∈ Γ , γj , γj ∈ Γj and all σ ∈ . We also define
In particular, player 0 can never play vetoi on his components. The partition of
(σ)
Ai into player 0 and player 1 states is given by Ai = {(s, σ) | s ∈ Γ ∪{⊥0 , ⊥1 }}.
272 M. Gelderie
Next, we define AH with states AH = (Q × {1, . . . , n}) - {C, (+, 0), (⊥, 0)},
(0) (1)
where AH = {(q, h) | q ∈ Q∃ } ∪ {(+, 0), (⊥, 0)} and AH = {(q, h) | q ∈
Q∀ } ∪ {C}. The alphabet of this automaton is again Σ (as defined above). Its
transition relation ΔH is defined by
(q, h), (γj , γj ), (q , h ) ∈ ΔH ⇐⇒ h = j ∧ (q, γ, q , γ , d) ∈ ΔM ∧ h = h + d
Note that “illegal” transitions are impossible. The players can only cheat with
respect to the content of the h-th tape cell. Also, no transition labeled with vetoi
for any i is possible from a state (q, h). In addition, we now have the following
transitions:
(qF , h), (γi , γi ), C ∈ ΔH for all i, h ∈ {1, . . . , k}, γ, γ ∈ Γ
(C, vetoi , (⊥, 0)) ∈ ΔH for all i ∈ {1, . . . , k}
C, (γi , γi ), (+, 0) ∈ ΔH for all i ∈ {1, . . . , k}, γ, γ ∈ Γ
Suppose q0 ∈ Q∃ . The play begins in position (q0 , 1, 0), (#1 , 0), . . . , (#n , 0) ,
where #i ∈ Γi is the blank symbol of M. Player 0 moves (i.e. picks a letter) at
all states in which AH is in a state from Q∃ , player 1 if it is in a state from Q∀ .
This is ensured by the definition of the transition function δi , which guarantees
that each component changes from a σ-state to a (1 − σ)-state in every round.
The states (⊥, 0) and (+, 0) in AH are 0-states without outgoing transitions.
The set player 0 tries to reach is Floc ({(+, 0)}, {(⊥1 , 0)}, . . . , {(⊥1 , 0)}).
We now show the correctness of the above construction. If M accepts w, then
player 0 has a winning strategy in the reachability game on the configuration
graph of M on w. If player 1 does not cheat and player 0 plays according to his
strategy, the play will finally reach a state ((qF , h), x1 , . . . , xn ) with xi = (⊥p , 0)
for all p ∈ and i ∈ {1, . . . , n}. Recall that qF ∈ Q∃ . Now player 0 must
move to C. Unless player 0 cheats (which is clearly a suboptimal choice at this
point), this implies that every component i moves from xi = (γi , 0) to (γi , 1)
by the definition of δi . Player 1 can play vetoi for some i. However, since the
i-th component is in state (γi , 1) for some γi ∈ Γi , we have that this results in
the i-th component making a transition to state (⊥1 , 0). Thus player 0 wins. If
player 1 plays (γi , γi ) for some i, the play reaches (+, 0) and thus player 0 wins.
If player 1 made an illegal transition at some point in the play, then for some i,
the state of Ai loops between (⊥1 , 0) and (⊥1 , 1) from that point onwards and,
again, player 0 wins.
Conversely, if M rejects w, then player 1 has a winning strategy in the safety
game on the configuration graph of M on w. This implies that, unless player 0
uses an illegal transition, the play never reaches state qF . On the other hand, if
player 0 does make an illegal transition, one component, say i, changes to state
(⊥0 , 1) and remains in {(⊥0 , σ) | σ ∈ } from this point onwards. If the play
ever reaches qF after that, and thereafter reaches C, player 1 can play vetoi
moving AH into state (⊥, 0). Component i is in state (⊥0 , 1) when AH is in
C whereby Ai never reaches state (⊥1 , 0). Since player 1 never has to make an
illegal transition, no component j is in a state (⊥1 , 0). Hence player 0 loses. % &
Strategy Composition in Compositional Games 273
6 Conclusion
We studied the relation between the compositional nature of an arena and the
structure of a winning strategy. To this end we introduced two kinds of prod-
ucts on arenas, the parallel and the synchronized product. We defined a notion
274 M. Gelderie
References
1. Büchi, J.R., Landweber, L.H.: Solving Sequential Conditions by Finite-State
Strategies. Trans. of the AMS 138, 295–311 (1969)
2. McNaughton, R.: Infinite games played on finite graphs. Annals of Pure and Ap-
plied Logic 65(2), 149–184 (1993)
3. Zielonka, W.: Infinite games on finitely coloured graphs with applications to au-
tomata on infinite trees. Theor. Comput. Sci. 200, 135–183 (1998)
4. Grädel, E., Thomas, W., Wilke, T. (eds.): Automata logics, and infinite games: a
guide to current research. Springer, New York (2002)
5. Löding, C.: Infinite games and automata theory. In: Apt, K.R., Grädel, E. (eds.)
Lectures in Game Theory for Computer Scientists. Cambridge U. P. (2011)
6. Baier, C., Katoen, J.: Principles of Model Checking. MIT Press (2008)
7. Fearnley, J., Peled, D., Schewe, S.: Synthesis of succinct systems. In: Chakraborty,
S., Mukund, M. (eds.) ATVA 2012. LNCS, vol. 7561, pp. 208–222. Springer,
Heidelberg (2012)
8. Harel, D., Kupferman, O., Vardi, M.Y.: On the complexity of verifying concurrent
transition systems. Inf. Comput. 173(2), 143–161 (2002)
9. Gelderie, M.: Strategy machines and their complexity. In: Rovan, B., Sassone,
V., Widmayer, P. (eds.) MFCS 2012. LNCS, vol. 7464, pp. 431–442. Springer,
Heidelberg (2012)
10. Goldin, D.Q., Smolka, S.A., Wegner, P.: Turing machines, transition systems, and
interaction. Electr. Notes Theor. Comput. Sci. 52(1), 120–136 (2001)
11. Hunter, P., Dawar, A.: Complexity bounds for regular games (extended ab-
stract). In: Jedrzejowicz, J., Szepietowski, A. (eds.) MFCS 2005. LNCS, vol. 3618,
pp. 495–506. Springer, Heidelberg (2005)
12. Dawar, A., Horn, F., Hunter, P.: Complexity Bounds for Muller Games. Theoretical
Computer Science (2011) (submitted)
13. Horn, F.: Explicit Muller Games are PTIME. In: FSTTCS, pp. 235–243 (2008)
Asynchronous Games over Tree Architectures
1 Introduction
Synthesis is by now well understood in the case of sequential systems. It is useful
for constructing small, yet safe, critical modules. Initially, the synthesis problem
was stated by Church, who asked for an algorithm to construct devices trans-
forming sequences of input bits into sequences of output bits in a way required
by a specification [2]. Later Ramadge and Wonham proposed the supervisory
control formulation, where a plant and a specification are given, and a controller
should be designed such that its product with the plant satisfies the specifica-
tion [18]. So control means restricting the behavior of the plant. Synthesis is the
particular case of control where the plant allows for every possible behavior.
For synthesis of distributed systems, a common belief is that the problem
is in general undecidable, referring to work by Pnueli and Rosner [17]. They
extended Church’s formulation to an architecture of synchronously communicat-
ing processes, that exchange messages through one slot communication channels.
Undecidability in this setting comes mainly from partial information: specifica-
tions permit to control the flow of information about the global state of the
system. The only decidable type of architectures is that of pipelines.
The setting we consider here is based on a by now well-established model
of distributed computation using shared actions: Zielonka’s asynchronous au-
tomata [20]. Such a device is an asynchronous product of finite-state processes
synchronizing on common actions. Asynchronicity means that processes can
progress at different speed. Similarly to [6,12] we consider the control problem
for such automata. Given a Zielonka automaton (plant), find another Zielonka
automaton (controller) such that the product of the two satisfies a given spec-
ification. In particular, the controller does not restrict the parallelism of the
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 275–286, 2013.
c Springer-Verlag Berlin Heidelberg 2013
276 B. Genest et al.
Synthesis for asynchronous systems has been strongly advocated by Pnueli and
Rosner in [16]. Their notion of asynchronicity is not exactly the same as ours:
it means roughly that system/environment interaction is not turn-based, and
processes observe the system only when scheduled. This notion of asynchronicity
appears in several subsequent works, such as [19,9] for distributed synthesis.
As mentioned above, we do not know whether the control problem in our
setting is decidable in general. Two related decidability results are known, both
of different flavor than ours. The first one [6] restricts the alphabet of actions:
control with reachability condition is decidable for co-graph alphabets. This re-
striction excludes among others client-server architectures. The second result [12]
shows decidability by restricting the plant: roughly speaking, the restriction says
that every process can have only bounded missing knowledge about the other
processes (unless they diverge). The proof of [12] goes beyond the controller
synthesis problem, by coding it into monadic second-order theory of event struc-
tures and showing that this theory is decidable when the criterion on the plant
holds. Unfortunately, very simple plants have a decidable control problem but
undecidable MSO-theory of the associated event structure. Melliès [14] relates
game semantics and asynchronous games, played on event structures. More re-
cent work [3] considers finite games on event structures and shows a determinacy
result for such games under some restrictions.
Organization of the Paper. The next section presents basic definitions. The two
consecutive sections present the algorithm and the matching lower bound. The
full version of the paper is available at http://hal.archives-ouvertes.fr/
hal-00684223.
We start by introducing Zielonka automata and state the control problem for
such automata. We also give a game-based formulation of the problem.
·
– for every action a ∈ Σ a partial transition function δa : Sp →
p∈dom(a)
p∈dom(a) Sp on tuples of states of processes in dom(a).
to block environment actions, which in technical terms means that from every
state of the controller there should be a transition on every action from Σ env .
The definition of our problem is the same with the difference that we take
Zielonka automata instead of finite automata. Given a distributed alphabet
(Σ, dom) as above, and a Zielonka automaton P , find a Zielonka automaton
C over the same distributed alphabet such that P × C satisfies a given specifica-
tion. Additionally it is required that from every state of C there is a transition
for every action from Σ env . The important point here is that the controller has
the same distributed structure as the plant. Hence concurrency in the controlled
system is the same as in the plant. Observe that in the controlled system P × C
the states carry the additional information computed by the controller.
Example: Reconsider the automaton on page 278, and assume that ui , uk ∈
Σ env are the uncontrollable actions (i, k ∈ {0, 1}). So the controller needs to
propose controllable actions cj and ck , resp., in such a way that both P and P
reach their final states f, f by executing the shared action $. At first sight this
may seem impossible to guarantee, as it looks like process P needs to know what
uk process P has received, or vice-versa. Nevertheless, such a controller exists.
It consists of P allowing after ui only action ci , and P allowing after uk only
action c1−k . Regardless if the environment chooses i = j or i = j, the action $
is enabled in state ((i, i), (j, 1 − j)), so both P, P can reach their final states.
It will be more convenient to work with a game formulation of this problem,
as in [6,12]. Instead of talking about controllers we will talk about distributed
strategies in a game between system and environment. A plant defines a game
arena, with plays corresponding to initial runs of A. Since A is deterministic,
we can view a play as a word from L(A) – or a trace, since L(A) is trace-closed.
Let Plays(A) denote the set of traces associated with words from L(A).
A strategy for the system will be a collection of individual strategies for each
process. The important notion here is the view each process has about the global
state of the system. Intuitively this is the part of the current play that the process
could see or learn about from other processes during a communication with them.
Formally, the p-view of a play u, denoted view p (u), is the smallest trace [v] such
that u ∼ vy and y contains no action from Σp . We write Plays p (A) for the set
of plays that are p-views: Plays p (A) = {view p (u) | u ∈ Plays(A)}.
sys
A strategy for a process p is a function σp : Plays p (A) → 2Σp , where Σpsys =
{a ∈ Σ sys | p ∈ dom(a)}. We require in addition, for every u ∈ Plays p (A), that
σp (u) is a subset of the actions that are possible in the p-state reached on u. A
strategy is a family of strategies {σp }p∈P , one for each process.
The set of plays respecting a strategy σ = {σp }p∈P , denoted Plays(A, σ), is the
smallest set containing the empty play ε, and such that for every u ∈ Plays (A, σ):
Plays from Plays(A, σ) are called σ-plays and we write Plays p (A, σ) for the
set Plays(A, σ) ∩ Plays p (A). The above definition says that actions of the
280 B. Genest et al.
environment are always possible, whereas actions of the system are possible
only if they are allowed by the strategies of all involved processes.
Our winning conditions in this paper are local reachability conditions: ev-
ery process has a set of target states Fp ⊆ Sp . We also assume that states in
Fp are blocking, that is, they have no outgoing transitions. This means that if
(sdom(a) , sdom(a) ) ∈ δa then sp ∈
/ Fp for all p ∈ dom(a). For defining winning
strategies, we need to consider also infinite σ-plays. By Plays ∞ (A, σ) we denote
the set of finite or infinite σ-plays in A. Such plays are defined as finite ones,
replacing u in the definition of Plays(A, σ) by a possibly infinite, initial run of A.
A play u ∈ Plays ∞ (A, σ) is maximal, if there is no action c such that the trace
uc is a σ-play (note that uc is defined only if no process in dom(c) is scheduled
infinitely often in u).
Definition 1. The control problem for a plant A and a local reachability con-
dition (Fp )p∈P is to determine if there is a strategy σ =
(σp )p∈P such that every
maximal trace u ∈ Plays ∞ (A, σ) is finite and ends in p∈P Fp . Such traces and
strategies are called winning.
Since our winning conditions are local reachability conditions, we can show that
it suffices to consider memoryless local strategies for process until the next
synchronization with r (or until termination). Moreover, since final states are
blocking, either all possible local plays from a given -state ultimately require
synchronization with r, or they all terminate in a final state of (mixing the two
situations would result in a process blocked on communication).
Lemma 2. If there exists a winning strategy for controlling A, then there is
one, say σ = (σp )p∈P , such that for all plays u ∈ Plays (A, σ) the following hold:
1. Either Sync σ (u) ⊆ (S \ F ) × (2Σr, \ {∅}) or Sync σ (u) ⊆ F × {∅}.
2. If uy is a σ-play with y ∈ (Σ \ Σ )∗ , σr (view r (uy)) = B ⊆ Σr, and B = ∅,
then for every (t , A) ∈ Sync σ (u) some action from A ∩ B is enabled in
(state r (uy), t ).
3. There is a memoryless local strategy τ : S → (Σsys ∩ Σloc ) to reach from
state (u) the set of local states {t | (t , A) ∈ Sync σ (u) for some A}.
The second item of the lemma says that every evolution of r should be compatible
with every evolution of . The memoryless strategy from the third item proposes
local actions of based only on the current state of and not on the history
of the play. This strategy is used in a game on the transition graph of process
. The third item of the lemma follows from the fact that 2-player games with
reachability objectives admit memoryless winning strategies.
282 B. Genest et al.
Theorem 3. The control problem for distributed plants with acyclic communi-
cation graph is decidable. There is an algorithm for solving the problem (and
computing a finite-state controller, if it exists) whose running time is bounded
by a tower of exponentials of height equal to half of the diameter of the graph.
x1 . . . xn y1 · · · yn z1 · · · zn
C
$ $ $
V ...
$ $ $
C
x1 · · · xn y1 · · · y n z 1 · · · zn
Fig. 2. Shape of a trace with 3 processes. Dashed lines show two types of tests.
Let us first explain the mechanism we will use. Consider a trace of the shape
presented in Figure 2. There are three processes C, C and V. Process C repeatedly
generates a sequence of n local actions and then synchronizes on action $ with
the verifier process V. Process C does the same. The alphabets of C and C are of
course disjoint. The verifier process V always synchronizes first with C and then
with C. Observe that the actions y 1 · · · y n are concurrent to both x1 · · · xn and
y1 · · · yn , but they are before z1 . Suppose that we allow the environment to stop
this generation process at any moment. Say it stops C at some xi , and C at xi .
We can then set the processes in such a way that they are forced to communicate
xi and xi to V; who can verify if they are correct. The other possibility is that
the environment stops C at xi and C at yi forcing the comparison of xi with
y i . This way we obtain a mechanism allowing to compare position by position
the sequence x1 · · · xn both with x1 · · · xn and with y 1 · · · yn . Observe that V
knows which of the two cases he deals with, since the comparison with the
latter sequence happens after some $ and before the next $. Now, we can use
sequences of n letters to encode numbers from 0 to 2n − 1. Then this mechanism
permits us to verify if x1 · · · xn represents the same number as x1 · · · xn and the
predecessor of y 1 · · · y n . Applying the same reasoning to y1 · · · yn we can test
that it represents the same number as y1 · · · y n and the predecessor of z 1 · · · z n .
If some test fails, the environment wins. If the environment does not stop C and C
at the same position, or stops only one of them, the system wins. So this way we
force the processes C and C to cycle through representations of numbers from 0 to
284 B. Genest et al.
action $l shared by rl+1 and Vl+1 . Process Vl+1 switches between state eq and
state succ when receiving $l , and back when receiving $l so it knows whether
rl+1 is generating the same l-counter as rl+1 , or the next one. As rl+1 does not
synchronize (unless there is a challenge) with Vl+1 between two $l , it does not
know whether rl+1 has already started producing the same l-counter or whether
it is still producing the previous one. Another important point about the flow
of knowledge is that while rl is informed when rl+1 is being challenged (as it
synchronizes frequently with rl+1 , and could thus be willing to cheat to produce
a different l-counter), rl does not know that rl+1 is being challenged, and thus
cheating on rl would be caught by verifier Vl .
Proposition 1. For every l, the system has a winning strategy in C l . For every
such winning strategy
σ, if we consider the unique σ-play without challenges then
its projection on i=1,...,l Σi# is an iterated l-counter.
Proposition 1 is the basis for encoding Turing machines, with C l ensuring that
the space bound is equal to Tower (n, l).
Theorem 4. Let l > 0. There is an acyclic architecture of diameter (4l − 2) and
with 3(2l − 1) processes such that the space complexity of the control problem for
it is Ω(Tower (n, l))-complete.
5 Conclusions
Distributed synthesis is a difficult and at the same time promising problem, since
distributed systems are intrinsically complex to construct. We have considered
here an asynchronous, shared-memory model. Already Pnueli and Rosner in [16]
strongly argue in favour of asynchronous distributed synthesis. The choice of
transmitting additional information while synchronizing is a consequence of the
model we have adopted. We think that it is interesting from a practical point of
view, since it is already used in multithreaded computing (e.g., CAS primitive)
and it offers more decidable settings (e.g., client-server architecture).
Under some restrictions we have shown that the resulting control problem is
decidable. The assumption about uncontrollable actions being local represents
the most common situation where each process comes with its own environment
(e.g., a client). The assumption on binary synchronizations simplifies the defini-
tion of architecture graph and is common in distributed algorithms. The most
important restriction is that on architectures being a tree. Tree architectures are
quite rich and allow to model hierarchical situations, like server/clients (recall
that such cases are undecidable in the setting of Pnueli and Rosner). Neverthe-
less, it would be very interesting to know whether the problem is still decidable
e.g. for ring architectures. Such an extension would require new proof ideas.
A more immediate task is to consider more general winning conditions. A fur-
ther interesting research direction is the synthesis of open, concurrent recursive
programs, as considered e.g. in [1].
Our non-elementary lower bound result is somehow surprising. Since we have
full information sharing, all the complexity is hidden in the uncertainty about
actions performed in parallel by other processes.
286 B. Genest et al.
References
1. Bollig, B., Grindei, M.-L., Habermehl, P.: Realizability of concurrent recursive
programs. In: de Alfaro, L. (ed.) FOSSACS 2009. LNCS, vol. 5504, pp. 410–424.
Springer, Heidelberg (2009)
2. Church, A.: Logic, arithmetics, and automata. In: Proceedings of the International
Congress of Mathematicians, pp. 23–35 (1962)
3. Clairambault, P., Gutierrez, J., Winskel, G.: The winning ways of concurrent
games. In: LICS, pp. 235–244. IEEE (2012)
4. Diekert, V., Rozenberg, G. (eds.): The Book of Traces. World Scientific (1995)
5. Finkbeiner, B., Schewe, S.: Uniform distributed synthesis. In: LICS, pp. 321–330.
IEEE (2005)
6. Gastin, P., Lerman, B., Zeitoun, M.: Distributed games with causal memory are
decidable for series-parallel systems. In: Lodaya, K., Mahajan, M. (eds.) FSTTCS
2004. LNCS, vol. 3328, pp. 275–286. Springer, Heidelberg (2004)
7. Gastin, P., Sznajder, N., Zeitoun, M.: Distributed synthesis for well-connected
architectures. Formal Methods in System Design 34(3), 215–237 (2009)
8. Genest, B., Gimbert, H., Muscholl, A., Walukiewicz, I.: Optimal Zielonka-type
construction of deterministic asynchronous automata. In: Abramsky, S., Gavoille,
C., Kirchner, C., Meyer auf der Heide, F., Spirakis, P.G. (eds.) ICALP 2010. LNCS,
vol. 6199, pp. 52–63. Springer, Heidelberg (2010)
9. Katz, G., Peled, D., Schewe, S.: Synthesis of distributed control through knowl-
edge accumulation. In: Gopalakrishnan, G., Qadeer, S. (eds.) CAV 2011. LNCS,
vol. 6806, pp. 510–525. Springer, Heidelberg (2011)
10. Kupferman, O., Vardi, M.: Synthesizing distributed systems. In: LICS (2001)
11. Madhusudan, P., Thiagarajan, P.S.: Distributed controller synthesis for local speci-
fications. In: Orejas, F., Spirakis, P.G., van Leeuwen, J. (eds.) ICALP 2001. LNCS,
vol. 2076, p. 396. Springer, Heidelberg (2001)
12. Madhusudan, P., Thiagarajan, P.S., Yang, S.: The MSO theory of connectedly
communicating processes. In: Sarukkai, S., Sen, S. (eds.) FSTTCS 2005. LNCS,
vol. 3821, pp. 201–212. Springer, Heidelberg (2005)
13. Mazurkiewicz, A.: Concurrent program schemes and their interpretations. DAIMI
Rep. PB 78, Aarhus University, Aarhus (1977)
14. Melliès, P.-A.: Asynchronous games 2: The true concurrency of innocence.
TCS 358(2-3), 200–228 (2006)
15. van der Meyden, R., Wilke, T.: Synthesis of distributed systems from knowledge-
based specifications. In: Abadi, M., de Alfaro, L. (eds.) CONCUR 2005. LNCS,
vol. 3653, pp. 562–576. Springer, Heidelberg (2005)
16. Pnueli, A., Rosner, R.: On the synthesis of an asynchronous reactive module. In:
Ronchi Della Rocca, S., Ausiello, G., Dezani-Ciancaglini, M. (eds.) ICALP 1989.
LNCS, vol. 372, pp. 652–671. Springer, Heidelberg (1989)
17. Pnueli, A., Rosner, R.: Distributed reactive systems are hard to synthesize. In:
FOCS, pp. 746–757 (1990)
18. Ramadge, P.J.G., Wonham, W.M.: The control of discrete event systems. Proceed-
ings of the IEEE 77(2), 81–98 (1989)
19. Schewe, S., Finkbeiner, B.: Synthesis of asynchronous systems. In: Puebla, G. (ed.)
LOPSTR 2006. LNCS, vol. 4407, pp. 127–142. Springer, Heidelberg (2007)
20. Zielonka, W.: Notes on finite asynchronous automata. RAIRO–Theoretical Infor-
matics and Applications 21, 99–135 (1987)
Querying the Guarded Fragment with Transitivity
1 Introduction
The Guarded Fragment. The guarded fragment of first-order logic (GF) was intro-
duced by Andréka et al. [1] with the aim of explaining and generalizing the good prop-
erties of modal logic. Guarded formulas are constructed as usual first-order formulas
with the exception that all quantification must be bounded, i.e., of the form ∀x̄(α → ϕ)
or ∃x̄(α ∧ ϕ), where α is an atomic formula which guards ϕ in the sense that it contains
all the free variables of ϕ. Andréka et al. showed that modal logic can be embedded in
GF, and they argued in a convincing way that GF inherits the good properties of modal
logic. In [2], Grädel has established that GF enjoys several nice model-theoretic proper-
ties, and he also proved that satisfiability of GF-sentences is 2 EXPTIME-complete, and
EXPTIME -complete for sentences with relations of bounded arity.
The guarded fragment has since been intensively studied and extended in various
ways. An interesting extension is the guarded fragment with transitivity, a natural
representative language for multi-modal logics that are used to formalize epistemic
logics. The obvious formalization of the transitivity of a binary relation R, namely
∀x∀y∀z(R(x, y) ∧ R(y, z) → R(x, z)), is not guarded and there is no way to ex-
press it in GF [2]. As shown by Ganzinger et al. [3], the two-variable guarded fragment
(GF2 ) with transitivity is already undecidable, improving an analogous result for the
three-variable guarded fragment proved by Grädel [2]. In [3], a logic which restricts
the guarded fragment with transitivity by allowing transitive relations to appear only in
guards has been proposed. This formalism, which was dubbed the guarded fragment
with transitive guards (GF+TG) [4,5], is indeed expressive enough to be able to cap-
ture multi-modal logics of type K4, S4 or S5. The decidability of the monadic fragment
of GF2 +TG (MGF2 +TG), where all non-unary relations may appear in guards only,
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 287–298, 2013.
c Springer-Verlag Berlin Heidelberg 2013
288 G. Gottlob, A. Pieris, and L. Tendera
was established in [3]; its exact complexity, as well as the decidability of GF+TG, was
left as an open problem. Satisfiability of GF+TG-sentences is 2 EXPTIME-complete [5],
while the 2EXPTIME-hardness holds also for MGF2 +TG [6].
Querying Guarded-Based Fragments. It is evident that a large corpus of works on
GF (and extensions of it) has focused on satisfiability. More recently, the attention
has shifted on the problem of query answering, a central reasoning task in database
theory [7] and description logics [8]. An extensional database Δ, which is actually a
conjunction of ground atoms, is combined with a first-order sentence ϕ describing con-
straints which derive new knowledge. The database does not necessarily satisfy ϕ, and
may thus be incomplete. A query is not just answered against Δ, as in the classical
setting, but against the logical theory (Δ ∧ ϕ). Here we focus on union of Boolean
conjunctive queries (UCQ). A Boolean conjunctive query (BCQ) q consists of an exis-
tentially closed conjunction of atoms, while a UCQ is a disjunction of a finite number
of BCQ. Thus, given a UCQ q, one checks whether (Δ ∧ ϕ) |= q, written (Δ, ϕ) |= q.
Several fragments of GF have been considered for query answering in the context
of database theory. A notable example is the class of guarded tuple-generating depen-
dencies (or guarded TGDs) [7], that is, sentences of the form ∀x̄(ϕ(x̄) → ∃ȳ ψ(x̄, ȳ)),
where ϕ and ψ are conjunctions of atoms, and in ϕ an atom exists which contains all the
variables of x̄. Although guarded TGDs are, strictly speaking, not GF-sentences, since
their heads may be unguarded, they can be rewritten as guarded sentences [9]. Several
extensions of guarded TGDs have been investigated, see, e.g., [10,7,11]. Fragments of
GF have been also considered in the context of description logics. A prominent lan-
guage is DL-LiteR [8], which forms the OWL 2 QL profile of W3Cs standard ontology
language for modeling Semantic Web ontologies. In fact, each DL-LiteR axiom can
be written as a GF-sentence of the form ∀x̄(α(x̄) → ∃ȳ β(x̄, ȳ)). Following a more
general approach, Bárány et al. studied the problem of query answering for the whole
guarded fragment [9]. Query answering under GF is coNP-complete in data complexity,
i.e., when only the database is part of the input, and 2EXPTIME-complete in combined
complexity, i.e., when also the theory and the query are part of the input. Notice that
the data complexity is widely regarded as more meaningful in practice, since the theory
and the query are typically of a size that can be productively assumed to be fixed.
Research Challenges. While the decidability and complexity landscape of query an-
swering under GF (and fragments of it) is clearing up, the picture for extensions of GF
is still foggy. Notable exceptions are the two-variable guarded fragment with counting
quantifiers, under which query answering is co NP-complete in data complexity [12],
and the guarded negation fragment, where query answering is 2 EXPTIME-complete in
combined complexity [13]. In this paper we focus on GF+TG. Our goal is to better un-
derstand the problem of query answering, and give answers to the following questions:
– Is query answering under GF+TG decidable, and if so, what is the exact data and
combined complexity?
– In case the previous question is answered negatively: (i) What is the frontier be-
tween decidability and undecidability, and what is the exact data and combined
complexity of query answering under the decidable fragment of GF+TG? (ii) Can
we gain decidability for GF+TG by restricting the syntax of the query?
Querying the Guarded Fragment with Transitivity 289
We provide answers to all these questions. Notice that query answering under GF+TG
is at least as hard as (un)satisfiability of GF+TG-sentences; in fact, (Δ, ϕ) |= q iff
(Δ ∧ ϕ ∧ ¬q) is unsatisfiable. However, previous results on GF+TG are not imme-
diately applicable for the following two reasons: Δ contains constants which are for-
bidden in the original definition of GF+TG, and ¬q may not be a GF+TG-sentence.
Therefore, we had either to come up with novel techniques beyond the state of the art,
or significantly extend existing procedures.
Contribution. Our contributions can be summarized as follows:
1. We show that query answering under GF+TG is undecidable even without equality.
This is done by forcing an infinite grid to appear in every model of a GF2 +TG-
sentence, and then, by a further conjunction of formulas, we simulate a deterministic
Turing machine. The same proof shows undecidability of guarded disjunctive TGDs
(i.e., guarded TGDs extended with disjunction in rule-heads) with transitive guards.
Although the question whether the same undecidability result holds also for non-
disjunctive guarded TGDs remains open, we establish that transitivity without the
restriction to guards cannot be safely combined with guarded TGDs.
2. We trace the frontier between decidability and undecidability of query answering
by establishing that for the monadic fragment of GF2 +TG (MGF2 +TG) it is decid-
able; in fact, it is 2 EXPTIME-complete in combined complexity and coNP-complete
in data complexity. The proof of this result is constituted by two steps. First, we
show that satisfiability of an MGF2 +TG-sentence combined with a database Δ, is
2EXPTIME-complete, and NP-complete if we consider only the database as part of
the input. Then, given q ∈ UCQ, we construct a sentence ΦΔ,q such that for every
MGF2 +TG-sentence ϕ, (Δ, ϕ) |= q iff (Δ ∧ ϕ ∧ ¬ΦΔ,q ) is unsatisfiable, where
Δ is obtained from Δ by adding some auxiliary atoms, and (ϕ ∧ ¬ΦΔ,q ) is an
MGF2 +TG-sentence.
3. We show decidability of query answering under GF+TG if we consider unions of
single-transitive-acyclic BCQs, that is, a restricted class of queries; it is 2 EXPTIME-
complete in combined complexity, and coNP-complete in data complexity.
2 Preliminaries
We work with finite relational signatures. Let us fix such a signature τ , and let width(τ )
be the maximal arity of any of the predicate symbols in τ . The guarded fragment of first-
order logic (GF), introduced by Andréka et al. [1], is the collection of first-order for-
mulas with some syntactic restrictions in the quantification pattern, which is analogous
to the relativised nature of modal logic. The set GF of formulas over τ is the smallest
set (i) containing all atomic τ -formulas and equalities, (ii) closed under logical connec-
tives ¬, ∧, ∨, →, and (iii) if x̄ and ȳ are tuples of variables, α is a τ -atom or an equality
atom containing all the variables of {x̄, ȳ}, and ϕ ∈ GF with free variables contained
in {x̄, ȳ}, then ∀x̄(α → ϕ) and ∃x̄(α ∧ ϕ) belong to GF as well. Equality atoms are
allowed to occur anywhere including as guards. To define the guarded fragment with
transitive guards (GF+TG), we additionally fix a subset τ0 ⊆ τ of transitive predicates,
and consider only those constant-free GF-formulas where the transitive predicates do
290 G. Gottlob, A. Pieris, and L. Tendera
x x x
~ x ~ ~ x ~ ~ x~ x x~ x x~
x x x
x
x
x
x
x
I I I I I I I I
x x x
~ x ~ ~ x ~ ~ x~ x x~ x x~
x x x x x x x x
I I I I I I I I
x x x
~ x ~ ~ x ~ ~ x~ x x~ x x~
x x x x x x x x
I I I I I I I I
D E
Fig. 1. Grid structure for (a) GF2 +TG and (b) GTGD2 + transitivity
We need to guarantee that H is complete over V . Denote γi,j := ci,j (x) ∧ ci+1,j (y) ∧
ci,j+1 (x ) ∧ ci+1,j+1 (y ), ψ0 = ψ2 := T (x , x) ∧ T (x, y) ∧ T (y, y ) ∧ T (x , y ), and
ψ1 = ψ3 := T (x, x ) ∧ T (y, x) ∧ T (y , y) ∧ T (y , x ). The completeness of H over V
is achieved by the conjunction of formulas ϕ2 :
& &
∀x∀y∀x ∀y γi,j ∧ ψi ∧ H(x, y) ∧ V (x, x ) ∧ V (y, y ) → H(x , y ) .
i=0,1,2,3 j=0,1
Let ϕgrid = ϕ0 ∧ ϕ1 ∧ ϕ2 . It can be shown that a grid structure as the one in Fig-
ure 1(a), where dashed arrows represent induced edges due to transitivity, appears in
every infinite model of ϕgrid . By using the infinite grid, where its i-th horizontal line
represents the i-th configuration of a deterministic Turing machine M over an empty
input tape, we can now simulate M by constructing a GF2 -sentence ϕM such that M
halts iff ϕgrid ∧ ϕM ∧ ¬∃x halt (x) is unsatisfiable; thus, the latter is an undecidable
problem. We now show that this undecidable problem can be reduced to UCQ answer-
ing for GF2 +TG. The non-guarded sentence ϕ2 is equivalent to ¬ϕ̂2 , where ϕ̂2 is:
' '
∃x∃y∃x ∃y γi,j ∧ ψi ∧ H(x, y) ∧ V (x, x ) ∧ V (y, y ) ∧ H̄(x , y ) .
i=0,1,2,3 j=0,1
Thus, by letting ϕ̂grid = ϕ0 ∧ ϕ1 , we get that ϕgrid ∧ ϕM ∧ ¬∃x halt (x) is equivalent
to ϕ̂grid ∧ ϕM ∧ ¬(ϕ̂2 ∨ ∃x halt (x)). Hence, ϕgrid ∧ ϕM ∧ ¬∃x halt (x) is unsatisfiable
iff ϕ̂grid ∧ ϕM |= ϕ̂2 ∨ ∃x halt (x). The claim follows by observing that ϕ̂grid ∧ ϕM is
a GF2 +TG-sentence, while (ϕ̂2 ∨ ∃x halt (x)) ∈ UCQ.
Interestingly, the above proof shows that query answering for two-variable guarded
disjunctive TGDs (i.e., guarded TGDs extended with disjunction in rule-heads [14])
with transitive guards (GDTGD2 + TG) is undecidable. In fact, the sentence ϕ1 of the
form ∀x̄(ϕ → (α ↔ ¬β)), which is the only part of the above construction that is not
constituted by guarded TGDs, is equivalent to the following conjunction of formulas:
¬∃x̄(ϕ ∧ α ∧ β) ∧ ∀x̄(ϕ → α ∨ β). Notice that the first conjunct forms a negated query,
while the second one is a guarded disjunctive TGD. The next result follows.
Corollary 1. UCQ answering for GDTGD2 + TG is undecidable, even if we consider
only one transitive relation, and an empty database.
292 G. Gottlob, A. Pieris, and L. Tendera
We show that UCQ answering under MGF2 +TG is decidable. If a definition or a result
is related to a two-variable logic, since there is little to be gained by allowing predicates
of arity bigger than two, we concentrate on unary and binary predicates only.
Ramified Models and Δ-satisfiability. Query answering is at least as hard as
(un)satisfiability: if P is a predicate not occurring in Δ or ϕ, then (Δ, ϕ) |= ∃x P (x)
iff (Δ∧ϕ) is unsatisfiable. Hence, we first study the related problem of Δ-satisfiability:
given a conjunction of ground atoms Δ and a formula ϕ, decide whether (Δ ∧ ϕ) is sat-
isfiable. We establish decidability of the problem and exact complexity bounds. Notice
that in the presence of Δ, existing algorithms deciding satisfiability of fragments of GF
with transitivity cannot be applied directly since constants are not allowed there.
Recall that one of the main properties of GF is the tree-model property saying that
every satisfiable guarded formula has a model A whose treewidth is bounded by the
number of variables in the formula [2]. Also, it is known that there exists a tree de-
composition of A such that each of its bags is guarded in A [9]. It is easy to see that
these properties are not preserved if we consider GF+TG-formulas. However, it was
shown that any satisfiable GF+TG-formula has a special ramified model [5]. We show
that models with similar properties can be also found in the presence of Δ. Ramified
models will be useful for both Δ-satisfiability and UCQ answering. Grädel’s analysis
for GF [2] uses the so-called Scott normal form corresponding to a relational Skolemi-
sation. For GF+TG the following variant of the normal form turned out to be useful.
Lemma 1 ([5]). With every GF+TG-sentence ϕ of length n over τ one can associate
a set Φ of GF+TG-sentences in normal form over an extended signature σ such that:
Querying the Guarded Fragment with Transitivity 293
(1) ϕ is satisfiable iff ψ∈Φ ψ is satisfiable, (2) |Φ| ≤ O(2n ), |σ| ≤ n, width(σ) =
width(τ ), and for every ψ ∈ Φ, |ψ| = O(n log n), and (3) Φ can be computed in
2EXPTIME, and every sentence ψ ∈ Φ can be computed in PTIME w.r.t. n.
Intuitively, the key property of the ramified models for GF+TG-sentences can be de-
scribed as follows: if we eliminate the atoms induced due to transitivity during the
construction of a ramified model, then the obtained structure A has bounded treewidth,
and there exists a tree decomposition of A such that each of its bags is guarded and
single-transitive. For the monadic case, the graph of a ramified model after removing
atoms induced due to transitivity can be seen as a forest with roots arbitrarily connected
through Δ, and where every edge is labeled with only one binary relation.
for conjuncts of ϕ of the form (2). In a single step of this stage, we have a ∈ Ri ,
γ = ∀x(α(x) → ∃yβ(x, y) ∧ ϑ(x, y)) and h(a) ∈ A. As A |= γ we can find a witness
b of γ for h(a) in A. We add a new element b to Ri+1 , define h(b) = b and define
tpRi+1 (a, b) using the relevant part (identified by the guard β) of tpA (h(a), b ). After
adding b as a witness of a conjunct γ with β, where β is a T -atom, we ensure that b is
connected by the transitive relation T to all elements c connected to a via a T -path in
Ri , defining tpRi+1 (b, c) from the corresponding 2-type tpA (h(b), h(c)). Other pairs
of distinct elements in Ri+1 are connected using only negative 2-types, i.e., they are not
in the interpretation of any binary relation. One can show that R is a ramified model as
defined in Definition 2, and that h is a homomorphism from R to A.
Proof (sketch). We compute (in exponential space w.r.t. |ϕ|) the set Φ of Lemma 1.
Then we guess a sentence ϕ ∈ Φ and check whether ϕ has a Δ-ramified model. To
check the latter we first guess a structure D of size at most |dom(Δ)| + |ϕ| interpreting
Δ and containing witnesses for conjuncts of ϕ of the form (1). Then we universally
choose an element d ∈ D and check whether D can be extended to a Δ-ramified model
with D being the set of root choices. Observe that in the next steps of the procedure,
it suffices to keep for each element a in the model a description of 1-types occurring
on transitive paths from and to a. This information can be stored using exponential
size with respect to |ϕ|. An alternating procedure working in exponential space can be
naturally derived from the construction. If only Δ is considered as part of the input, then
the above procedure works in nondeterministic polynomial time. For the lower bounds,
it is known that satisfiability of MGF2 +TG is already 2 EXPTIME-hard [6]. For data
complexity the corresponding NP-hard lower bound follows from Theorem 2 in [18].
It is important to say that by adapting the notion of ramified models introduced in [5]
for GF+TG, one can show that Δ-satisfiability for GF+TG-sentences is decidable, and
of the same complexity. Details are omitted due to space limits.
Query Answering via Unsatisfiability. We now investigate query answering under
MGF2 +TG. Given a database Δ and a query q ∈ UCQ, our goal is to construct a
sentence ΦΔ,q which enjoys the following properties: (i) for each ϕ ∈ MGF2 +TG,
(Δ, ϕ) |= q iff (Δ , ϕ) |= ΦΔ,q , where Δ ⊇ Δ, and (ii) ΦΔ,q is equivalent to an
MGF2 +TG-sentence. Since (Δ , ϕ) |= ΦΔ,q iff (Δ ∧ ϕ ∧ ¬ΦΔ,q ) is unsatisfiable, we
can then rely on the results regarding Δ-satisfiability of MGF2 +TG-sentences. Let us
first introduce the class of single-acyclic queries.
As shown in [19], a query q ∈ BCQ is acyclic iff there exists a query p ∈ BCQ
equivalent to q which is also in GF. By exploiting this result, one can easily show that a
single-acyclic query is equivalent to a sentence of MGF2 +TG.
Lemma 3. For each single-acyclic query q ∈ BCQ over τ , there is an MGF2 +TG-
sentence χq of size linear in |q| such that, for every τ -structure A, A |= q iff A |= χq .
Fix a database Δ and a query q ∈ UCQ. Having the notion of single-acyclic queries
in place, we are now ready to construct the sentence ΦΔ,q = p∈q φΔ,p , where each
disjunct φΔ,p is a union of single-acyclic BCQs constructed as described below. Clearly,
if (Δ, ϕ) |= p, then there exists a homomorphism h that maps p to each model of
(Δ ∧ ϕ), and thus to each Δ-ramified model of (Δ ∧ ϕ). The key idea underlying our
construction is, for each such mapping h, to describe the image h(p) of p in each Δ-
ramified model of (Δ ∧ ϕ) by a union of single-acyclic BCQs. As we shall see below,
for query answering purposes, it suffices to focus on the Δ-ramified models. The formal
construction of φΔ,p is as follows. If p is single-acyclic, then φΔ,p coincides with p;
otherwise, we apply the following steps:
Before showing soundness and completeness of our construction, let us first estab-
lish two auxiliary results. The first one states that, if we focus our attention on Δ-
ramified models, then our construction is complete. In the sequel, let Δ = Δ ∧
c∈dom(Δ) Rc (c).
Proof (sketch). By hypothesis, there exists p ∈ BCQ in q such that (Δ, ϕ) |= p. Fix a
Δ-ramified model R for (Δ∧ϕ), which exists by Theorem 3, and extend it to a ramified
model R∗ interpreting the auxiliary symbols from Δ∗ . As R∗ |= (Δ∗ ∧ ϕ), we have
R∗ |= p. Let h be the homomorphism that maps p into R∗ . Obviously, h ∈ H. Let S
be the set of root choices in R∗ . Using S we define a partition of var(p) into subsets
mapped into the same subtree Ts of R∗ . By construction, φh is nonempty and one can
show that there exists at least one disjunct γ in φΔ,p such that R |= γ.
For query answering we can consider only the Δ-ramified models of a theory.
Proof. (⇒) By hypothesis, each model of (Δ ∧ ϕ) entails q, and the claim follows. (⇐)
Towards a contradiction, assume that each Δ-ramified model entails q, but (Δ, ϕ) |= q.
The latter implies that there exists a model A of (Δ∧ϕ) such that A |= q. By Theorem 3,
there exists a ramified model R of (Δ ∧ ϕ), and a homomorphism h that maps R into
A. Since R |= q, there exists a homomorphism μ that maps q into R. Therefore, h ◦ μ
maps q into A, and thus A |= q which is a contradiction. The claim follows.
Proof. (⇒) If (Δ ∧ ϕ) is not consistent, then also (Δ ∧ ϕ) is not consistent and the
claim follows. In case that (Δ ∧ ϕ) is consistent, the claim follows immediately from
Lemmas 4 and 5. (⇐) By hypothesis, there exists a BCQ p ∈ ΦΔ,q such that (Δ , ϕ) |=
p. By construction, p entails q, and thus (Δ , ϕ) |= q. The auxiliary predicates of the
form Rc , where c ∈ dom(Δ), being introduced only during the construction of ΦΔ,q ,
do not match any predicate in q, and hence (Δ, ϕ) |= q.
Let us now investigate the complexity of the obtained formula. For brevity, let r = |τ |.
Also, given a query q ∈ UCQ, let Hq = maxp∈q |p| and Vq = maxp∈q |var (p)|.
5 Future Work
We state three open problems for query answering. The first one concerns the decidabil-
ity of guarded TGDs with transitive guards. The second one is whether MGF2 +TG can
be safely combined with counting quantifiers, an important feature for many computa-
tional logics. Finally, the third one is to pinpoint the complexity of MGF2 +TG under
finite models; recall that in this work we considered arbitrary (finite or infinite) models.
For the latter, since MGF2 +TG does not enjoy the finite model property, completely
new techniques are needed.
298 G. Gottlob, A. Pieris, and L. Tendera
Acknowledgements. Georg Gottlob and Lidia Tendera acknowledge the EPSRC Grant
EP/H051511/1 “ExODA”. Lidia Tendera also gratefully acknowledges her association
with St. John’s College during her visit to Oxford in 2012, and the support of Polish
Ministry of Science and Higher Education Grant N N206 37133. Andreas Pieris ac-
knowledges the ERC Grant 246858 “DIADEM” and the EPSRC Grant EP/G055114/1
“Constraint Satisfaction for Configuration: Logical Fundamentals, Algorithms and
Complexity”.
References
1. Andréka, H., van Benthem, J., Németi, I.: Modal languages and bounded fragments of pred-
icate logic. J. Philosophical Logic 27, 217–274 (1998)
2. Grädel, E.: On the restraining power of guards. J. Symb. Log. 64(4), 1719–1742 (1999)
3. Ganzinger, H., Meyer, C., Veanes, M.: The two-variable guarded fragment with transitive
relations. In: Proc. of LICS, pp. 24–34 (1999)
4. Szwast, W., Tendera, L.: On the decision problem for the guarded fragment with transitivity.
In: Proc. of LICS, pp. 147–156 (2001)
5. Szwast, W., Tendera, L.: The guarded fragment with transitive guards. Ann. Pure Appl.
Logic 128(1-3), 227–276 (2004)
6. Kieroński, E.: The two-variable guarded fragment with transitive guards is 2EXPTIME-hard.
In: Gordon, A.D. (ed.) FOSSACS 2003. LNCS, vol. 2620, pp. 299–312. Springer, Heidelberg
(2003)
7. Calı̀, A., Gottlob, G., Kifer, M.: Taming the infinite chase: Query answering under expressive
relational constraints. In: Proc. of KR, pp. 70–80 (2008)
8. Calvanese, D., De Giacomo, G., Lembo, D., Lenzerini, M., Rosati, R.: Tractable reasoning
and efficient query answering in description logics: The DL-Lite family. J. Autom. Reason-
ing 39(3), 385–429 (2007)
9. Bárány, V., Gottlob, G., Otto, M.: Querying the guarded fragment. In: Proc. of LICS,
pp. 1–10 (2010)
10. Baget, J.F., Mugnier, M.L., Rudolph, S., Thomazo, M.: Walking the complexity lines for
generalized guarded existential rules. In: Proc. of IJCAI, pp. 712–717 (2011)
11. Krötzsch, M., Rudolph, S.: Extending decidable existential rules by joining acyclicity and
guardedness. In: Proc. of IJCAI, pp. 963–968 (2011)
12. Pratt-Hartmann, I.: Data-complexity of the two-variable fragment with counting quantifiers.
Inf. Comput. 207(8), 867–888 (2009)
13. Bárány, V., ten Cate, B., Segoufin, L.: Guarded negation. In: Aceto, L., Henzinger, M., Sgall,
J. (eds.) ICALP 2011, Part II. LNCS, vol. 6756, pp. 356–367. Springer, Heidelberg (2011)
14. Gottlob, G., Manna, M., Morak, M., Pieris, A.: On the complexity of ontological reasoning
under disjunctive existential rules. In: Rovan, B., Sassone, V., Widmayer, P. (eds.) MFCS
2012. LNCS, vol. 7464, pp. 1–18. Springer, Heidelberg (2012)
15. Kazakov, Y.: Saturation-based decision procedures for extensions of the guarded fragment.
PhD thesis, Universität des Saarlandes (2005)
16. Kieroński, E.: Results on the guarded fragment with equivalence or transitive relations. In:
Ong, L. (ed.) CSL 2005. LNCS, vol. 3634, pp. 309–324. Springer, Heidelberg (2005)
17. Beeri, C., Vardi, M.Y.: A proof procedure for data dependencies. J. ACM 31(4), 718–741
(1984)
18. Pratt-Hartmann, I.: Complexity of the two-variable fragment with counting quantifiers. Jour-
nal of Logic, Language and Information 14(3), 369–395 (2005)
19. Gottlob, G., Leone, N., Scarcello, F.: Robbers, marshals, and guards: Game theoretic and
logical characterizations of hypertree width. J. Comput. Syst. Sci. 66(4), 775–808 (2003)
20. Calvanese, D., Giacomo, G.D., Lembo, D., Lenzerini, M., Rosati, R.: Data complexity of
query answering in description logics. Artif. Intell. 195, 335–360 (2013)
Contractive Signatures with Recursive Types,
Type Parameters, and Abstract Types
1 Introduction
Recursive types are widely used features in most programming languages and
the key constructs to exploit recursively defined data structures such as lists and
trees. In type theory, there are two ways to exploit recursive types, namely by
using the iso-recursive or equi-recursive formulation.
In the iso-recursive formulation, a recursive type μX.τ is considered isomor-
phic but not equal to its one-step unfolding {X !→ μX.τ }τ . Correspondingly
the term language provides built-in coercion functions called fold and unfold,
witnessing this isomorphism.
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 299–311, 2013.
c Springer-Verlag Berlin Heidelberg 2013
300 H. Im, K. Nakata, and S. Park
considered contractive in OCaml since the type cycles are guarded by the param-
eterized abstract type t in T; hence the signature T is well-formed. Furthermore
the types s and u in T are structurally equivalent, and thus the values h and
y are well-formed with types int -> bool and bool, respectively. At run-time,
however, the evaluation of y, i.e., h 3, leads to an unknown constructor 3 of
type bool, breaking type soundness.1
In this paper, we investigate a type system for equi-recursive types, type pa-
rameters, and abstract types. In our system, recursive types may be declared by
using type definitions of the form type α t = τ where both the type parameter α
and the recursive type t may appear in the type τ .2 Abstract types may be de-
clared by using the usual ML-style signature sealing operations (Section 2.1). For
this system, we develop a new notion of semantic contractiveness for types and
signatures using mixed induction and coinduction (Section 2.3). Our semantic
contractiveness determines the types s and u in the signature T above to be non-
contractive, and our type system rejects T. We then show that our type system
with semantic contractiveness is sound with respect to the standard call-by-value
operational semantics, which eliminates signature sealings (Section 2.4).
Another notable result is that even in the presence of non-contractive types
in modules, we can develop a sound type system where well-typed programs
cannot go wrong. This is particularly important since our type soundness result
may give a strong hint about the soundness of OCaml, which allows us to define
non-contractive types using recursive modules and signature sealings.
Our contributions are summarized as follows.
– To our knowledge, we are the first to consider a type system for equi-recursive
types, type parameters, and abstract types, and define a type sound semantic
notion of contractiveness.
– Since the OCaml type system allows both recursive types and abstract types,
and non-contractive types in modules, our type soundness result gives a
strong hint about how to establish the soundness of OCaml.
– We have formalized the whole system and its type soundness proof in Coq
version 8.4. Our formalization extensively uses mixed induction and coin-
duction, so it may act as a good reference for using mixed induction and
coinduction in Coq.
The remainder of the paper is organized as follows. Section 2 presents a type
system for recursive types, type parameters, and abstract types. In particular, we
consider a simple module system with a signature sealing operation and define a
structural type equivalence and semantic contractiveness using mixed induction
and coinduction. Section 3 discusses Coq mechanization and an algorithmic type
equivalence and contractiveness. Section 4 discusses related work and Section 5
concludes.
1
We discovered the above bug together with Jacques Garrigue and it has been fixed
in the development version of OCaml (available in the OCaml svn repository).
2
We do not use the usual μ-notation because encoding mutually recursive type defini-
tions into μ-types requires type-level pairs and projection, complicating the theory.
Moreover the use of type definitions better reflects the OCaml implementation.
302 H. Im, K. Nakata, and S. Park
Syntax
BN(S) distinct ∀D ∈ S, S D ok
wf-sig
S ok
by a program of the form (M, S, e), called a signature sealing, which hides the
implementation details of the module M behind the signature S.
Recursive types are introduced by type definitions of the form type α t = τ
where τ may refer to the name t with no restriction. For example, we may define
recursive types such as type α t = α t → α t and type α t = α t → (α ∗ α) t.
We also permit a non-contractive type definition such as type α t = α t in a
module but reject a non-contractive type specification in a signature, since the
latter breaks type soundness. Any sequence dτ of type definitions (or type spec-
ifications) in modules (or signatures) may be mutually recursive, whereas no
sequence de of value definitions are mutually recursive. The main reason for this
design choice is that our focus in this paper is to investigate the interaction be-
tween non-contractive recursive types and abstract types. Moreover, to simplify
the discussion, we consider only those type constructors with a single parameter.
We can easily add into the system nullary or multi-parameter type constructors.
As for well-formedness of types, we use a judgment S; Σ τ type to mean that
type τ is well-formed under context (S, Σ). Here we use a type variable set Σ to
denote either an empty set or a singleton set. We also use judgments S D ok
and S ok to mean that specification D and signature S are well-formed, respec-
tively. Most of the rules are standard, and we only remark that a signature S is
well-formed only if all bound type names in S are distinct from each other and
each type definition is well-formed under S (rule wf-sig). These well-formedness
conditions for signatures allow us to define arbitrarily mutually recursive type
definitions. In the remainder of the paper, we assume that every type and sig-
nature that we mention is well-formed, without explicitly saying so.
≡
S; Σ τ =σ S τ τ S σ σ S; Σ τ ≡ σ
eq-ind eq-coind
S; Σ τ ≡σ S; Σ τ ≡σ
R
Inductive type equivalence S; Σ τ1 = τ2
S; Σ τ i R σi (i = 1, 2)
eq-unit eq-var eq-fun
R R R
S; Σ unit = unit S; {α} α=α S; Σ τ 1 → τ 2 = σ1 → σ2
S; Σ τ i R σi (i = 1, 2) S type α t S; Σ τRσ
eq-prod eq-abs
R R
S; Σ τ 1 ∗ τ 2 = σ1 ∗ σ2 S; Σ τ t=σ t
τ τ τ = σ σ σ τ = σ
R R
S S; Σ S S; Σ
eq-lunfold eq-runfold
R R
S; Σ τ =σ S; Σ τ =σ
check equivalence for vacuous types. Figure 2 shows inference rules for type
equivalence, defined using the rule unfold. We use a judgment S; Σ τ1 ≡ τ2
to mean that τ1 and τ2 are coinductively equivalent under context (S, Σ) and
R
a judgment S; Σ τ1 = τ2 to mean that τ1 and τ2 are inductively equivalent.
R
Note that the inductive equivalence relation = is parameterized over a relation
R, which is instantiated with the coinductive equivalence relation ≡ in the rule
eq-ind. This way, we nest the inductive equivalence relation into the coinductive
equivalence relation3 . We use a double horizontal line for a coinductive rule and
a single horizontal line for an inductive rule.
The rule eq-coind is a coinductive rule for checking equivalence between vac-
uous types. To show that two vacuous types τ and σ are equivalent, that is,
S; Σ τ ≡ σ, we repeatedly apply the rule eq-coind. When we get the very same
proposition to be proved in the premise, the proof is completed by coinduction.
Notably vacuous types are only equivalent to vacuous types. As for equivalence
for types other than vacuous types, we use the rule eq-ind, which nests induction
into coinduction, to compare their structures.
The inductive type equivalence compares structures of types. Given a pair
of types, we apply the rule eq-lunfold or eq-runfold a finite number of times,
unfolding type definitions, until we get a pair of the unit type, type variables,
function types, or product types. Then we structurally compare them. Note that
the rules eq-lunfold and eq-runfold are the only rules where induction plays a role.
It is crucial that these rules are defined inductively; if we allow them to be used
coinductively, a vacuous type becomes equivalent to any type. The rules eq-unit
for the unit type and eq-var for type variables are standard. The rules eq-fun
3
A definition of the form νX.F (X, μY.G(X, Y )).
Contractive Signatures with Recursive Types 305
S ↓⇓ τ (S, τi ) ∈ C (i = 1, 2)
c-coind c-unit c-var c-fun
S⇓τ S ↓C unit S ↓C α S ↓C τ1 → τ2
(S, τi ) ∈ C (i = 1, 2) S type α t S ↓C τ S τ σ S ↓C σ
c-prod c-abs c-type
S ↓C τ1 ∗ τ2 S ↓C τ t S ↓C τ
∀(type α t = τ ) ∈ S, S ⇓ τ
c-sig
S⇓
for function types, eq-prod for product types, and eq-abs for abstract types are
where the inductive equivalence goes back to the coinductive equivalence.
With this definition of type equivalence, for example, now we prove that the
types s and u in the signature T in the introduction are equivalent as follows:
coinduction hypothesis
T 6 type ’a t T; · s≡u
≡
eq-abs
T; · s t = u t
eq-ind, eq-lunfold, eq-runfold
T; · s ≡ u
Our type equivalence is indeed an equivalence relation, i.e., reflexive, sym-
metric, and transitive (see the expanded version for the proof).
an infinite derivation
T 6 type ’a t T ↓⇓ s
c-abs
T s+st T ↓⇓ s t
c-type
T 6 type ’a t T ↓⇓ s
c-coind, c-abs
T⇓st
S; · e:τ S, val l : τ d e : Se
typ-emp typ-val
S ·:· S (let l = e, de ) : (val l : τ, Se )
dτ ok dτ d e : Se BN(de ) distinct
typ-mod
(dτ , de ) : (dτ , Se )
Well-typed programs P : (S, τ )
M : S S ⇓ S ≤ S S; · e:τ M : S S; · e : τ
typ-prog-seal typ-prog
(M, S, e) : (S, τ ) (M, e) : (S, τ )
Reduction rules
values v ::= () | λx : τ. e | (v1 , v2 )
definition values dv ::= let l = v
module values V ::= (dτ , dv )
program values Pv ::= (V, v)
red-p-seal
(M, S, e) −→ (M, e)
M −→ M dv e −→ e
red-p-mod red-p-exp
(M, e) −→ (M , e) (dτ , dv , e) −→ (dτ , dv , e )
dv e −→ e dv let l = v
red-mod red-name
(dτ , dv , let l = e, de ) −→ (dτ , dv , let l = e , de ) dv l −→ v
Theorem 1 (Progress).
(1) If (dτ , dv ) : S and S; · e : τ , then either e is a value or ∃e , dv e !−→ e .
(2) If M : S, then either M is a module value or ∃M , M !−→ M .
(3) If P : (S, τ ), then either P is a program value or ∃P , P !−→ P .
The key lemma for the preservation theorem is that type equivalence is pre-
served by subtyping. In the lemma below, the signature S2 being contractive is
crucial. For example, assuming S is the inferred signature of the module M in the
introduction, although S ≤ T and T; · s ≡ t, we have S; · s ≡ t.
Lemma 2. If S1 ≤ S2 , S2 ⇓, and S2 ; Σ τ ≡ σ, then S1 ; Σ τ ≡ σ.
Now using Lemma 2, we show that if a sealed program (M, S, e) is well-typed,
the program (M, e) where the sealed signature S is eliminated is also well-typed
(Lemma 3), which proves the most difficult case (4) of Theorem 4. We then prove
other cases of Theorem 4 as usual using induction and case analysis.
Lemma 3 (Contractive signature elimination). If (M, S, e) : (S, τ ), then
there exists S such that (M, e) : (S , τ ) and S ≤ S.
308 H. Im, K. Nakata, and S. Park
Theorem 4 (Preservation).
3 Discussion
3.1 Coq Mechanization
For the Coq mechanization, we use Mendler-style [10] coinductive rules for type
equivalence and contractiveness in the style of Nakata and Uustalu [14], instead
of the Park-style rules in Figures 2 and 3. The reason is that Coq’s syntactic
guardedness condition for induction nested into coinduction is too weak to work
with the Park-style rules. We cannot construct corecursive functions (coinductive
proofs) that we need. For example, to enable Coq’s guarded corecursion, we use
the following Mendler-style coinductive rule instead of the Park-style rule eq-ind:
R
R ⊆ ≡ S; Σ τ = σ
eq-ind
S; Σ τ ≡ σ
The main difference is that we use in the rule eq-ind a relation R that is stronger
than the coinductive equivalence relation ≡. Hence, to build a coinductive proof,
we need to find such a relation R, and in many cases we cannot just use ≡ for
R. With this definition, the Park-style rules are derivable.
4 Related Work
The literature on subtyping for μ-types (hence without type definitions, type
parameters, and abstract types) is abundant. In this setting, contractiveness
can be checked syntactically: every μ-bound variable occurs under → or ∗. We
mention three landmark papers. Amadio and Cardelli [2] were the first to give
a subtyping algorithm. They define subtyping in three ways, which are proved
equivalent: an inclusion between unfoldings of μ-types into infinite trees, a sub-
typing algorithm, and an inductive axiomatization. Brandt and Henglein [3] give
a new inductive axiomatization in which the underlying coinductive nature of
Amadio and Cardelli’s system is internalized by allowing, informally speaking,
construction of circular proofs. Gapeyev et al. [6] is a good self-contained intro-
duction to subtyping for recursive types, including historical notes on theories of
recursive types. They define a subtyping relation on contractive μ-types as the
greatest fixed point of a suitable generating function.
Danielsson and Altenkirch [5] present an axiomatization of subtyping for μ-
types using induction nested into coinduction. They formalized the development
in Agda, which supports induction nested into coinduction as a basic form.
Komendantsky [8] conducted a similar project in Coq using the Mendler-style
coinduction.
Recursive types are indispensable in theories of recursive modules since recur-
sive modules allow us to indirectly introduce recursion in types that span across
module boundaries. In this setting, one has to deal with a more expressive lan-
guage for recursive types, which may include, for instance, higher-order type
constructors, type definitions, and abstract types. Montagu and Rémy [12,13]
investigate existential types to model modular type abstraction in the context
of a structural type system. They consider its extensions with recursion (i.e.,
equi-recursive types without type parameters) and higher-order type construc-
tors separately but do not investigate a combination of the two extensions. Crary
et al. [4] first propose a type system for recursive modules using an inductive
axiomatization of (coinductive) type equivalence for equi-recursive types with
higher-order type constructors, type definitions, and abstract types. However,
the metatheory of their axiomatization such as type soundness is not investi-
gated. Rossberg and Dreyer [15] use equi-recursive types with inductive type
equivalence (i.e., they do not have a rule equivalent to contract in [2] to enable
coinductive reasoning) to prove soundness of their mixin-style recursive module
system. They do not intend to use equi-recursive types for the surface language.
Our earlier work [7] on recursive modules considers equi-recursive types with
type definitions and abstract types, but without type parameters. There we de-
fine a type equivalence relation using weak bisimilarity.
This paper studies a type system for recursive types, type parameters, and ab-
stract types. In particular, we investigate the interaction between non-contractive
310 H. Im, K. Nakata, and S. Park
types and abstract types, and show that while non-contractive types in signa-
tures lead to unsoundness of the type system, they may be allowed in modules.
Our study is mainly motivated by OCaml, which allows us to define both ab-
stract types and equi-recursive types with type parameters (with the “-rectypes”
option). To obtain a sound type system, we develop a new notion of semantic con-
tractiveness using mixed induction and coinduction and reject non-contractive
types in signatures. We show that our type system is sound with respect to the
standard call-by-value operational semantics, which eliminates signature seal-
ings. We have also formalized the whole system and its soundness proof in Coq.
Future work includes extending our type system to the full-scale module system
including recursive modules, nested modules, and higher-order functors.
References
1. OCaml, http://caml.inria.fr/ocaml/
2. Amadio, R.M., Cardelli, L.: Subtyping recursive types. ACM Transactions on Pro-
gramming Languages and Systems 15(4), 575–631 (1993)
3. Brandt, M., Henglein, F.: Coinductive axiomatization of recursive type equality and
subtyping. In: de Groote, P., Hindley, J.R. (eds.) TLCA 1997. LNCS, vol. 1210,
pp. 63–81. Springer, Heidelberg (1997)
4. Crary, K., Harper, R., Puri, S.: What is a recursive module? In: PLDI 1999 (1999)
5. Danielsson, N.A., Altenkirch, T.: Subtyping, declaratively: an exercise in mixed
induction and coinduction. In: Bolduc, C., Desharnais, J., Ktari, B. (eds.) MPC
2010. LNCS, vol. 6120, pp. 100–118. Springer, Heidelberg (2010)
6. Gapeyev, V., Levin, M.Y., Pierce, B.C.: Recursive subtyping revealed. Journal of
Functional Programming 12(6), 511–548 (2002)
7. Im, H., Nakata, K., Garrigue, J., Park, S.: A syntactic type system for recursive
modules. In: OOPSLA 2011 (2011)
8. Komendantsky, V.: Subtyping by folding an inductive relation into a coinductive
one. In: Peña, R., Page, R. (eds.) TFP 2011. LNCS, vol. 7193, pp. 17–32. Springer,
Heidelberg (2012)
9. MacQueen, D., Plotkin, G., Sethi, R.: An ideal model for recursive polymorphic
types. In: POPL 1984 (1984)
10. Mendler, N.P.: Inductive types and type constraints in the second-order lambda
calculus. Annals of Pure and Applied Logic 51(1-2), 159–172 (1991)
11. Milner, R., Tofte, M., Harper, R., MacQueen, D.: The Definition of Standard ML
(Revised). The MIT Press (1997)
12. Montagu, B.: Programming with first-class modules in a core language with subtyp-
ing, singleton kinds and open existential types. PhD thesis, École Polytechnique,
Palaiseau, France (December 2010)
Contractive Signatures with Recursive Types 311
13. Montagu, B., Rémy, D.: Modeling abstract types in modules with open existential
types. In: POPL 2009 (2009)
14. Nakata, K., Uustalu, T.: Resumptions, weak bisimilarity and big-step semantics
for While with interactive I/O: An exercise in mixed induction-coinduction. In:
SOS 2010, pp. 57–75 (2010)
15. Rossberg, A., Dreyer, D.: Mixin’ up the ML module system. ACM Transactions
on Programming Languages and Systems 35(1), 2:1–2:84 (2013)
16. Sénizergues, G.: The equivalence problem for deterministic pushdown automata
is decidable. In: Degano, P., Gorrieri, R., Marchetti-Spaccamela, A. (eds.) ICALP
1997. LNCS, vol. 1256, pp. 671–681. Springer, Heidelberg (1997)
17. Solomon, M.: Type definitions with parameters (extended abstract). In: POPL
1978 (1978)
18. Stone, C.A., Schoonmaker, A.P.: Equational theories with recursive types (2005),
http://www.cs.hmc.edu/~ stone/publications.html
Algebras, Automata and Logic for Languages
of Labeled Birooted Trees
David Janin
Introduction
Motivations and background. Semigroup theory has amply demonstrated its
considerable efficiency over the years for the study and fine grain analysis of
languages of finite words, that is subsets of the free monoid A∗ . This can be
illustrated most simply by the fact that a language L ⊆ A∗ is regular if and
only if there is a finite monoid S and a monoid morphism θ : A∗ → S such that
L = θ−1 (θ(L)). In this case, we say that the language L is recognized by the
finite monoid S (and the morphism θ).
Even more effectively, for every language L ⊆ A∗ , the notion of recognizability
induces a notion of syntactic congruence 5L for the language L in such a way
that the monoid M (L) = A∗ / 5L is the smallest monoid that recognizes L.
Then, many structural properties of the language L can be decided by analyzing
the properties of its syntactic monoid M (L), e.g. regularity, star freeness, etc
(see [14] for more examples of such properties).
These results triggered the development of entire algebraic theories of lan-
guages of various structures elaborated on the basis of richer algebraic frame-
works such as, among others, ω-semigroups for languages of infinite words [19,12],
Partially funded by project INEDIT, ANR-12-CORD-0009
Complete version available at http://hal.archives-ouvertes.fr/hal-00784898
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 312–323, 2013.
c Springer-Verlag Berlin Heidelberg 2013
Algebras, Automata and Logic for Languages of Labeled Birooted Trees 313
Outline. Birooted labeled trees, called birooted F -trees, are presented in Sec-
tion 1. Equipped with an extension of Scheiblich’s product of (unlabeled) bi-
rooted trees [16], the resulting algebraic structures are inverse monoids that are
quite similar to discrete instances of Kellendonk’s tiling semigroups [10]. Then,
birooted F -trees can be ordered by the (inverse semigroup) natural order rela-
tion that is stable under product: the inverse monoid B 1 (F ) of labeled birooted
F -trees is also a partially ordered monoid.
Birooted tree automata are defined and studied in Section 2. By construction,
languages recognized by these finite automata are upward closed in the natural
order. It follows that they fail to capture all languages definable by means of
Monadic Second Order (MSO) formulae. However, this loss of expressive power
is shown to be limited to the property of upward closure. Indeed, we prove
(Theorem 2) that every upward closed language of birooted trees which is MSO
definable is recognized by a finite state birooted tree automata.
As a case in point, when F is seen as a functional signature, by embedding
the classical F -terms (see [18]) into birooted F -trees, we show (Theorem 3) that
the birooted tree image of every regular language L of F -terms is of the form
314 D. Janin
UL ∩ DL for some MSO definable and upward closed (resp. downward closed)
language UL (resp. language DL ).
The algebraic counterpart of birooted tree automata is presented in Section 3
where the notions of adequately ordered monoids and adequate premorphisms
are defined. The induced notion of quasi-recognizable languages of birooted F -
trees is shown to be effective (Theorem 4).
As for expressive power, it is shown that every birooted tree automaton
simply induces an adequate premorphism that recognizes the same language
(Theorem 5) and that every quasi-recognizable language is MSO definable (The-
orem 6). The picture is made complete by proving (Theorem 7) that quasi-
recognizable languages of birooted trees correspond exactly to finite boolean
combinations of upward closed MSO definable languages.
Together with Theorem 3, this result demonstrates that our proposal can
also be seen as yet another algebraic characterization of regular languages of
trees that complete that previously obtained by means of preclones [5], forest
algebras [3] or ordered monoids and admissible premorphisms [7].
Related Works. We should also mention that the notion of birooted F -tree au-
tomata defined above is an extension of that previously defined [9] for languages
of one-dimensional overlapping tiles: subsets of McAlister monoids [11].
Although closely related, we can observe that an extension of this type is
by no means straightforward. Of course going from the linear structure of over-
lapping tiles to the tree shaped structure of birooted F -trees already induces a
tangibly increased level of complexity. However, the main difference comes from
edge directions. In overlapping tiles, all edges go in the same direction while,
in birooted F -trees, edges can go back and forth (almost) arbitrarily. Proving
Theorem 2 is thus much more complex than proving an analogous result for
overlapping tiles.
Comparing our proposal with other known algebraic characterizations of lan-
guages of (mono-rooted) F -trees [5,3] is not easy. Of course, our proposal induces
a larger class of definable languages since we are dealing with birooted F -trees
and not just F -trees. However, a more relevant comparison would be to compare
the classification of languages through a full series of approaches, by restricting
even further the allowed recognizers: be them preclones as in [5], forest alge-
bras [2] or adequately ordered monoids as proposed here.
With quasi-recognizability, recognizers are monoids (and premorphisms). It
follows that the known restrictions applicable to the study of languages of
words, e.g. aperiodic monoids [14], can simply be extended to adequately ordered
monoids. Yet, the relevance of such restrictions for languages of mono-rooted or
birooted F -trees still needs to be evaluated.
Another source of difficulty comes from the fact that adequate premorphisms
are not morphisms : only disjoint products are preserved. To some extent, the
notion of quasi-recognizability by premorphisms presented here is analogous,
compared with classical recognizability by morphisms, to what unambiguous
non deterministic automata are in comparison with deterministic automata. On
the negative side, this means that the notion of quasi-recognizability has not yet
Algebras, Automata and Logic for Languages of Labeled Birooted Trees 315
been completely understood. On the positive side, this means that it may lead
to radically new outcomes.
The partial product r, u · s, v of two birooted F -tree r, u and s, v is
defined, when it exists, as the birooted F -tree t, w defined by w = u·v, dom(t) =
dom(r) ∪ u · dom(s), t(u ) = r(u ) for every u ∈ dom(r) and tu (v ) = s(v ) for
every v ∈ dom(s).
Observe that such a product exists if and only if the tree ru and the tree
s agree on dom(ru ) ∩ dom(s), i.e. for every v ∈ dom(ru ) ∩ dom(s), we have
ru (v ) = r(uv ) = s(v ). It follows that undefined products may arise when F is
not a singleton.
Two examples of birooted F -trees B1 and B2 are depicted below, with a
dangling input edge marking the input root and a dangling output edge marking
the output root.
in
(B1 ) g a (B2 ) b f
out in
b f a f a b f
f g b g c
out
g g
The (defined) product of the birooted F -trees B1 and B2 is then depicted below.
(B1 · B2 )
in
g a b f
b f a b f
f b g c
out
g g
In that picture, the cercle marks the synchronization vertex that results from
the merging of the output root of B1 and the input root of B2 . The a-labeled
a
edge f → g emanating from that vertex is the common edge resulting from the
fusion of the two (synchronized) birooted F -trees.
The product is completed by adding a zero element for the undefined case
with 0 · t, v = t, v · 0 = 0 · 0 = 0 for every (defined) birooted tree t, v.
One can easily check that the completed product is associative. The resulting
structure is thus a semigroup denoted by B(F ): the semigroup of birooted F -
trees. When F is a singleton, every birooted F -tree can just be seen as a pair
(P, u) with an non empty prefix closed domain P ⊆ F G(A) and an output root
u ∈ P . Then, following Scheiblich presentation [16], the semigroup B(F ) is the
free monoid F IM (A) generated by A with unit 1 = ({1}, 1). When F is not
a singleton, we extend the set B(F ) with a unit denoted by 1. The resulting
structure is a monoid denoted by B 1 (F ) : the monoid of birooted F -trees.
The monoid of birooted F -trees is an inverse monoid, i.e. for every B ∈ B 1 (F )
there is a unique B −1 ∈ B 1 (F ) such that BB −1 B = B and B −1 BB −1 = B −1 .
Indeed, we necessarily have 0−1 = 0, 1−1 = 1 and, for every non trivial birooted
F -tree t, u one can check that t, u−1 = tu , ū.
As an inverse monoid, elements of B 1 (F ) can be ordered by the natural order
defined, for every B and C ∈ B 1 (F ) by B ≤ C when B = BB −1 C (equivalently
Algebras, Automata and Logic for Languages of Labeled Birooted Trees 317
B = CB −1 B). One can check that 0 is the least element and, for every defined
birooted F -trees r, u and s, v we have r, u ≤ s, v if and only if u = v,
dom(r) ⊇ dom(s) and, for every w ∈ dom(s), t(w) = s(w).
Observe that, as far as trees only are concerned, the natural order is the
reverse of the (often called) prefix order on trees. In particular, the bigger is the
size of a birooted tree, the smaller is the birooted tree in the natural order.
One can easily check that the monoid of birooted F -trees is finitely generated.
We prove here a stronger statement that will be extensively used in the remainder
of the text.
A birooted tree is said elementary when it is either 0 or 1, or of the from
Bf = {1 !→ f }, 1 for some f ∈ F or of the form Bf xg = {1 !→ f, x !→ g}, x
for some vertex label f and g ∈ F and some letter x ∈ A + Ā.
in a g out in out in a g out
(Bf ag ) f (Bf ) f (Bf āg ) f
It remains thus to prove that every idempotent sub-birooted tree of the form
Bvp for some v ∈ dom(t) can also be decomposed into an expression of the desired
form. But this is easily done by induction on the size of the birooted trees Bcp .
Indeed, Let v ∈ dom(t). In the case v is a leaf (w.r.t. the prefix order) then
Bvp = Bt(v) and we are done. Otherwise, we have Bvp = r, 1 for some F -tree
p
p R
r and we observe that Bvp = { Bv,w · Bw : w ∈ dom(r), v ≺p w} with only
disjoint products and resets. This concludes the proof. 2
The above decomposition of B as a combination of elementary birooted trees by
disjoint products and right projections is called a strong decomposition of the
birooted F -tree B.
Proof. Let L ⊆ B(F ) be a language of birooted F -trees. We first prove the easiest
direction, from birooted tree automata to MSO. Then, we prove the slightly more
difficult direction from MSO to birooted tree automata.
Algebras, Automata and Logic for Languages of Labeled Birooted Trees 319
b f b (f, 0)
in in
f a b f (f, 0) a b (f, 0)
b g c b̄ (g, 0) c̄
out
g g (g, 1) (g, 0)
Since L is definable in MSO, applying (an adapted version of) the theorem of
Doner, Thatcher and Wright (see for instance [18]), there exists a finite state
tree automaton A that recognizes L. We conclude our proof by defining from
the (finite) tree automaton A a (finite) birooted tree automaton A such that
L(A) = L(A ).
The major difficulty in defining A is that the (one root) tree automaton A
reads a tree from the (input) root to the leaves hence following the prefix relation
order ≤p . Moreover, birooted trees, such a prefix order is not encoded in the
direction of edges. It follows that, when translating the tree automaton A into
an equivalent birooted tree automaton A , we need to encode (and propagate)
that direction information into states.
But this can be achieved by observing that for every vertex v and w such
that v ≺p w, the edge from v to w is uniquely defined by the letter x ∈ (A + Ā)
such that vx = w. It follows that every such a vertex w (distinct from the in-
put root 1) will be marked in automaton A by a state that will encode that letter
320 D. Janin
Proof. This essentially follows from the adequacy assumption and the strong
decomposition property (Lemma 1). 2
Now we want to show that every finite state birooted automaton induces an
adequate premorphism that recognizes the same language.
Proof. Let L ⊆ B(F ) and let A = Q, δ, Δ, T be a finite birooted tree automaton
such that L = L(A).
We define the mapping ϕA : B(F ) → P(Q × Q) by saying that ϕA (B) is, for
every birooted F -tree B = t, u ∈ B(F ), the set of all pairs of state (p, q) ∈ Q×Q
such that there exists a run ρ : dom(t) → Q such that p = ρ(1) and q = ρ(u).
The mapping ϕA is extended to 0 by taking ϕA (0) = ∅ and, to 1 by taking
ϕ(1) = IQ = {(q, q) ∈ Q × Q : q ∈ Q}.
The fact P(Q × Q) is an adequately ordered monoid have already been de-
tailled in the examples above. By definition we have L = ϕ−1 (X ) with X =
{X ⊆ Q × Q : X ∩ T = 0}. Then, we prove that ϕA is indeed an adequate
premorphism.
2
The following theorem tells how quasi-recognizability and MSO definability are
related.
322 D. Janin
Proof. The fact that (1) implies (2) essentially follows from Theorem 6. The fact
(2) implies (3) immediately follows from Theorem 2. Last, we prove, by classical
argument (e.g. cartesian product of monoids) that the class of quasi-recognizable
languages is closed under boolean operations. Then, by applying Theorem 5 this
proves that (3) implies (1).
2
4 Conclusion
Studying languages of birooted F -trees, structures that generalize F -terms, we
have thus defined a notion of automata, a related notion of quasi-recognizability
and we have characterized quite in depth their expressive power in relationship
with language definability in Monadic Second Order Logic.
As a particular case, our results provide a new algebraic characterization of the
regular languages of finite F -trees. Potential links with the preclones approach [5]
or the forest algebra approach [3,2] need to be investigated further.
Algebras, Automata and Logic for Languages of Labeled Birooted Trees 323
References
1. Blumensath, A.: Recognisability for algebras of infinite trees. Theor. Comput.
Sci. 412(29), 3463–3486 (2011)
2. Bojanczyk, M., Straubing, H., Walukiewicz, I.: Wreath products of forest algebras,
with applications to tree logics. Logical Methods in Computer Science 8(3) (2012)
3. Bojańczyk, M., Walukiewicz, I.: Forest algebras. In: Logic and Automata,
pp. 107–132 (2008)
4. Cornock, C., Gould, V.: Proper two-sided restriction semigroups and partial ac-
tions. Journal of Pure and Applied Algebra 216, 935–949 (2012)
5. Ésik, Z., Weil, P.: On logically defined recognizable tree languages. In: Pandya,
P.K., Radhakrishnan, J. (eds.) FSTTCS 2003. LNCS, vol. 2914, pp. 195–207.
Springer, Heidelberg (2003)
6. Janin, D.: Quasi-recognizable vs MSO definable languages of one-dimensional over-
lapping tiles. In: Rovan, B., Sassone, V., Widmayer, P. (eds.) MFCS 2012. LNCS,
vol. 7464, pp. 516–528. Springer, Heidelberg (2012)
7. Janin, D.: Walking automata in the free inverse monoid. Technical Report RR-
1464-12 (revised April 2013), LaBRI, Université de Bordeaux (2012)
8. Janin, D.: On languages of one-dimensional overlapping tiles. In: van Emde Boas,
P., Groen, F.C.A., Italiano, G.F., Nawrocki, J., Sack, H. (eds.) SOFSEM 2013.
LNCS, vol. 7741, pp. 244–256. Springer, Heidelberg (2013)
9. Janin, D.: Overlapping tile automata. In: Bulatov, A. (ed.) CSR 2013. LNCS,
vol. 7913, pp. 431–443. Springer, Heidelberg (2013)
10. Kellendonk, J., Lawson, M.V.: Tiling semigroups. Journal of Algebra 224(1), 140–
150 (2000)
11. Lawson, M.V.: McAlister semigroups. Journal of Algebra 202(1), 276–294 (1998)
12. Perrin, D., Pin, J.-E.: Semigroups and automata on infinite words. In: Fountain,
J. (ed.) Semigroups, Formal Languages and Groups. NATO Advanced Study In-
stitute, pp. 49–72. Kluwer Academic (1995)
13. Pin, J.-E.: Relational morphisms, transductions and operations on languages. In:
Pin, J.E. (ed.) LITP 1988. LNCS, vol. 386, pp. 34–55. Springer, Heidelberg (1989)
14. Pin, J.-E.: Finite semigroups and recognizable languages: an introduction. In: Foun-
tain, J. (ed.) Semigroups, Formal Languages and Groups. NATO Advanced Study
Institute, pp. 1–32. Kluwer Academic (1995)
15. Pin, J.-.E.: Syntactic semigroups. In: Handbook of Formal Languages, ch. 10, vol. I,
pp. 679–746. Springer (1997)
16. Scheiblich, H.E.: Free inverse semigroups. Semigroup Forum 4, 351–359 (1972)
17. Shelah, S.: The monadic theory of order. Annals of Mathematics 102, 379–419
(1975)
18. Thomas, W.: Languages, automata, and logic. In: Handbook of Formal Languages,
ch. 7, vol. III, pp. 389–455. Springer (1997)
19. Wilke, T.: An algebraic theory for regular languages of finite and infinite words.
Int. J. Alg. Comput. 3, 447–489 (1993)
One-Variable Word Equations in Linear Time
Artur Jeż1,2,
1
Max Planck Institute für Informatik,
Campus E1 4, DE-66123 Saarbrücken, Germany
2
Institute of Computer Science, University of Wrocław,
ul. Joliot-Curie 15, PL-50383 Wrocław, Poland
[email protected]
1 Introduction
Word Equations. The problem of satisfiability of word equations was con-
sidered as one of the most intriguing in computer science. The first algorithm
for it was given by Makanin [11] and his algorithm was improved several times,
however, no essentially different approach was proposed for over two decades.
An alternative algorithm was proposed by Plandowski and Rytter [16], who
presented a very simple algorithm with a (nondeterministic) running time poly-
nomial in n and log N , where N is the length of the length-minimal solution.
However, at that time the only bound on such length followed from Makanin’s
work and it was triply exponential in n.
Soon after Plandowski showed, using novel factorisations, that N is at most
doubly exponential [14], proving that satisfiability of word equations is in NEX-
PTIME. Exploiting the interplay between factorisations and compression he im-
proved the algorithm so that it worked in PSPACE [15]. On the other hand, it is
only known that the satisfiability of word equations is NP-hard.
One Variable. Constructing a cubic algorithm for the word equations with
only one variable (and arbitrarily many appearances of it) is trivial. First non-
trivial bound was given by Obono, Goralcik and Maksimenko, who devised an
O(n log n) algorithm [13]. This was improved by Dąbrowski and Plandowski [2]
to O(n + #X log n), where #X is the number of appearances of the variable
The full version of this paper is available at http://arxiv.org/abs/1302.3481
This work was supported by Alexander von Humboldt Foundation.
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 324–335, 2013.
c Springer-Verlag Berlin Heidelberg 2013
One-Variable Word Equations in Linear Time 325
in the equation. The latter work assumed that alphabet Σ is finite or that it
can be identified with numbers. A general solution was presented by Laine and
Plandowski [9], who gave an O(n log #X ) algorithm in a simpler model, in which
the only operation on letters is their comparison.
In one phase, pair compression (block compression) is applied to all pairs (blocks,
respectively) that appeared at the beginning of this phase. Ideally, each letter
is compressed and so the length of t halves, in a worst-case scenario during one
phase t is still shortened by a constant factor.
The surprising property is that such a schema can be efficiently applied even
to grammar-compressed data [5,3] or to text given in an implicit way, i.e. as
a solution of a word equation [6]. In order to do so, local changes of the variables
(or nonterminals) are needed: X is replaced with a X (or Xa ), where a is
a prefix (suffix, respectively) of substitution for X. In this way the solution that
substitutes a w for X is implicitly replaced with one that substitutes w.
combinatorics on words.
Furthermore a more insightful analysis shows that problematic ‘short’ words in
the equation invalidate several candidate solutions. This allows a tighter estima-
tion of the time spent on testing the solutions.
2 Preliminaries
One-Variable Equations. Consider a word equation A = B over one variable
X, by |A| + |B| we denote its length and n is the initial length of the equation.
Without loss of generality one of A and B begins with a variable and the other
with a letter [2]: If they both begin with the same symbol (be it letter or non-
terminal), we can remove this symbol from them, without affecting the set of
solutions; if they begin with different letters, this equation clearly has no solu-
tion. The same applies to the last symbols of A and B. Thus, in the following
we assume that the equation is of the form
A0 XA1 . . . AnA −1 XAnA = XB1 . . . BnB −1 XBnB , (1)
where Ai , Bj ∈ Σ ∗ are called (explicit) words, nA (nB ) denotes the number of
appearances of X in A (B, respectively). A0 (first word) is nonempty and exactly
one of AnA , BnB (last word) is nonempty. If this condition is violated for any
reason, we greedily repair by cutting letters from appropriate strings.
A substitution S assigns a string to X, we extend S to (X ∪ Σ)∗ with an
obvious meaning. A solution is a substitution such that S(A) = S(B). For an
equation A = B we are looking for a description of all its solutions. We disregard
the empty solution S(X) = and always assume that S(X) = . In such a case
by (1) we can determine the first (last) letter of S(X) in O(1) time.
Lemma 1. Let a be the first letter of A0 . If A0 ∈ a+ then S(X) ∈ a∗ for
each solution S of A = B, all such solutions can be calculated and reported in
O(|A| + |B|) time. If A0 ∈/ a∗ then there is at most one solution S(X) ∈ a+ , the
length of such a solution can be returned in O(|A| + |B|) time. For S(X) ∈ / a+
the lengths of the a-prefixes of S(X) and A0 are the same.
A symmetric version of Lemma 1 holds for the suffix of S(X). By
SimpleSolution(a) we denote a procedure that for A0 ∈ / a∗ returns the unique
such that S(X) = a is a solution (or nothing, if there is no such solution).
before and after the application of the subprocedure. However, as they replace
X with a X (or Xbr ), some solutions are lost in the process and so they should
be reported. We formalise these notions.
We say that a subprocedure preserves solutions when given an equation A = B
it returns A = B such that for some strings u and v
The main idea of the recompression method is the way it deals with the crossing
pairs: imagine that ab is a crossing pair, this is because S(X) = bw and aX
appears in A = B or S(X) = wa and Xb appears in it (the remaining case, in
which S(X) = awb and XX appears in the equation is treated in the same way).
The cases are symmetric, so we deal only with the first one. To ‘uncross’ ab in
this case it is enough to ‘left-pop’ b from X: replace each X in the equation with
bX and implicitly change the solution to S(X) = w.
One-Variable Word Equations in Linear Time 329
Algorithm 1. Pop(a, b)
1: if b is the first letter of S(X) then
2: if SimpleSolution(b) returns 1 then S(X) = b is a solution
3: report solution S(X) = b
4: replace each X in A = B by bX Implicitly change S(X) = bw to S(X) = w
5: perform symmetric actions for a
The presented procedures are merged into PairComp(a, b) that turns crossing
pairs into noncrossing ones and then compresses them.
The number of noncrossing pairs can be large, however, applying Pop(a, b), where
b, a are the first and last letters of the S(X) reduces their number to 2.
Lemma 5. After Pop(a, b), where b, a are the first and last letters of the S(X),
the solutions are preserved and there are at most two crossing pairs.
The problems with crossing blocks are solved in a similar fashion: a has a crossing
block, if and only if aa is a crossing pair. So we ‘left-pop’ a from X until the first
letter of S(X) is different than a, we do the same with the ending letter b. This
effectively removes the whole a-prefix (b-suffix, respectively) from X: suppose
that S(X) = a wbr , where w does not start with a nor end with b. Then we
replace each X by a Xbr , implicitly changing the solution to S(X) = w. The
corresponding procedure is called CutPrefSuff.
Lemma 6. CutPrefSuff preserves solutions and after its application there are
no crossing blocks of letters.
3 Main Algorithm
Theorem 1. OneVar runs in time O(|A| + |B| + (nA + nB ) log(|A| + |B|)) and
correctly reports all solutions of a word equation A = B.
The most important property of OneVar is that the explicit strings between the
variables shorten (assuming they are long enough): We say that a word Ai (Bj )
is short if it consists of at most C = 100 letters and long otherwise.
Lemma 8. If Ai (Bj ) is long then its length is reduced by 1/4 in this phase; if
it is short then after the phase it still is.
If the first word is short then its length is shortened by at least 1 in a phase.
The cost of one phase is charged towards the words A0 , . . . , AnA , B1 , . . . , BnB
proportionally to their lengths. Since the lengths of the long words drop by a
constant factor in each phase, in total such cost is O(n). For short words the
cost is O(1) per phase and there are O(log n) phases by Lemma 8.
The main obstacle in the linear running time is the necessity of dealing with
short words, as the time spent on processing them is difficult to charge. The
improvement to linear running time is done by four major modifications:
several equations We store a system of several equations and look for a solu-
tion of such a system. This allows removal of some words from the equations.
One-Variable Word Equations in Linear Time 331
Several Equations. We store several equations and look for substitutions that
simultaneously satisfy all of them. Hence we have a collection Ai = Bi of equa-
tions, for i = 1, . . . , m, each of them is of the form (1). This system is obtained
by replacing one equation Ai Ai = Bi Bi with equivalent two equations Ai = Bi
and Ai = Bi .
Each of the equations Ai = Bi in the system specifies the first and last letter
of the solution, length of the a-prefix and suffix etc., exactly in the same way
as it does for a single equation. However, it is enough to use only one of them,
say A1 = B1 , as if there is any conflict then there is no solution at all. The
consistency is not checked, simply when we find out about inconsistency, we
terminate immediately. We say that Ai (Bj ) is first or last if it is in any of the
stored equations.
All operations on a single equation from previous sections (popping letters,
cutting prefixes/suffixes, pair/block compression, etc.) generalise to a system of
equations and they preserve their properties and running times, with the length
ma single equation |A| + |B| replaced by a sum of lengths of all equations
of
i=1 |Ai | + |Bi |.
Lemma 10. Suppose that S is a small solution. There is a constant c such that
within c phases the corresponding solution is reported by OneVar.
Storing. While the long words are stored exactly as they used to, the short
words are stored more efficiently: we keep a table of short words and equations
point to the table of short words instead of storing them. We say that such
332 A. Jeż
a representation is succinct and its size is the sum of lengths of words stored in
it. Note that we do not include the size of the equation.
The correctness of such an approach is guaranteed by the fact that equality
of two explicit words is not changed by OneVar, which is shown by a simple
induction.
Lemma 11. Consider any words A and B in the input equation. Suppose that
during OneVar they were transformed to A = B , none of which is a first nor
last word. Then A = B if and only if A = B .
Lemma 12. The compression in one phase of OneVar can be performed in time
linear in size of the succinct representation.
Ideally, we want to show that the succinct representation has size proportional
to the length of long words. In this way its size would decrease by a constant
factor in each phase and thus be O(n) in total. In reality, we are quite close
to this: the words stored in the tables are of two types: normal and overdue.
The normal words are substrings of the long words or A20 and consequently the
sum of their sizes is proportional to the size of the long words. A word becomes
overdue if at the beginning of the phase it is not a substring of a long word or
A20 . It might be that it becomes a substring of such a word later, it does not stop
to be an overdue word in such a case. The new overdue words can be identified
in linear time using standard operations on a suffix array for a concatenation of
long and short strings appearing in the equations.
Lemma 13. In time proportional to the sum of sizes of the long words plus the
number of overdue words we can identify the new overdue words.
The overdue words can be removed from the equations in O(1) phases after
becoming overdue. This is shown by a serious of lemmata.
We say that for a substitution S the word A is arranged against itself if each
A in S(A) coming from explicit Ai = A corresponds to Bj = A at the same
positions in S(B) (and symmetrically, for the sides of the equation exchanged).
The proof is rather easy: we consider the Ai = A that is not arranged against
some Bj = A in S(A) = S(B). Since by definition it also cannot be arranged
against a subword of a long word, case inspection gives that one of the S(X)
preceding or succeeding Ai overlaps with some other S(X), yielding that S(X)
is periodical. Furthermore, this period has length at most |Ai | ≤ C, hence S(X)
is small.
One-Variable Word Equations in Linear Time 333
Due to Lemmata 10 and 14 the overdue words can be removed in O(1) phases
after their introduction: suppose that A becomes an overdue word in phase
. Any solution, in which an overdue word A is not arranged against another
copy of A is small and so it is reported after O(1) phases. Then an equation
Ai XAXAi = Bi XAXBi , where Ai and Bi do not have A as a word, is equivalent
to two equations Ai = Bi and Ai = Bi and this procedure can be applied
recursively to Ai = Bi . This removes all copies of A from the system.
Lemma 15. Consider the set of overdue words introduced in phase . Then in
phase + c (for some constant c) we can remove all words A from equations.
The obtained set of equations has the same set of solutions. The time spend on
removal of overdue words, over the whole run of OneVar, is O(n).
Lemma 16. The running time of OneVar, except for time used to test the so-
lutions, is O(n).
It is easy to show by case inspection that each test is of one of those type. We
calculate the cost of each type of tests separately. For failed tests note that there
are constantly many of them in each of the O(log n) phases.
For protected tests, we charge the cost of the protected test to the long word
and only O(|A|) such tests can be charged to one long word A in a phase. On
the other hand, each long word is shortened by a constant factor in a phase and
so this cost can be charged to those removed letters and thus the total cost of
those tests (over the whole run of OneVar) is O(n).
334 A. Jeż
Lemma 18. In one phase the number of protected tests is proportional to the
length of long words. Thus there are O(n) such tests in total.
In case of the misaligned tests, consider the phase in which the last of Ai+1 , Ai ,
Bj+1 , Bj becomes short. We show that the corresponding solution S is small
in this phase and so by Lemma 10 it is reported within O(1) following phases.
The proof is quite technical, it follows a general idea of Lemma 14: we show that
S(X) overlaps with itself and so it has a period. A closer inspection proves that
this period is almost periodical.
The cost of the misaligned test is charged to the last word among Ai , Ai+1 ,
Bj , Bj+1 that became short, say, Bj and only O(1) such tests are charged to
this Bj (over the whole run of OneVar). Hence there are O(n) misaligned tests.
Lemma 19. There are O(n) misaligned tests during the whole run of OneVar.
Consider the maximal set of consecutive aligned tests, they correspond to com-
parison of Ai XAi+1 . . . Ai+k X and Bj XBj+1 . . . Bj+k X, where Ai+ = Bj+ for
= 0, . . . , k. Then the next test is either misaligned, protected or failed, so if the
cost of all those aligned tests can be bounded by O(1), they can be associated
with the succeeding test. Note that instead of performing the aligned tests (by
comparing letters), it is enough to identify the maximal (syntactically) equal
substrings of the equation. From Lemma 11 it follows that this corresponds to
the (syntactical) equality of substrings in the original equation. We identify such
substrings in O(1) per substring using a suffix array constructed for the input
equation.
Lemma 20. The total cost of aligned tests is O(n).
For the periodical tests we apply a similar charging strategy. Suppose that we
are to test the equality of (suffix of) S((Ai X) ) and (prefix of) S(X(Bj X)k ).
Firstly, it is easy to show that the next test is either misaligned, protected or
failed. Secondly, if |Ai | = |Bj | then the test for Ai+ and Bj+ for 0 < ≤ is
the same as for Ai and Bj and so they can be all skipped. If |Ai | > |Bj | then
the common part of S((Ai X) ) and S(X(Bj X)k ) have periods |S(Ai X)| and
|S(Bj X)| and consequently has a period |Ai | − |Bj | ≤ C. So to test the equality
of S((Ai X) ) and (prefix of) S(X(Bj X)k ) it is enough to test first common
|Ai | − |Bj | letters and check whether both S(Ai X) and S(Bj X) have period
|Ai | − |Bj |.
Lemma 21. Performing all periodical tests takes in total O(n) time
This yields that the total time of testing is linear.
Lemma 22. The time spent on testing solutions during OneVar is O(n).
References
1. Berkman, O., Vishkin, U.: Recursive star-tree parallel data structure. SIAM J.
Comput. 22(2), 221–242 (1993)
2. Dąbrowski, R., Plandowski, W.: On word equations in one variable. Algorith-
mica 60(4), 819–828 (2011)
3. Jeż, A.: Faster fully compressed pattern matching by recompression. In: Czumaj,
A., Mehlhorn, K., Pitts, A., Wattenhofer, R. (eds.) ICALP 2012, Part I. LNCS,
vol. 7391, pp. 533–544. Springer, Heidelberg (2012)
4. Jeż, A.: Approximation of grammar-based compression via recompression. In: Fis-
cher, J., Sanders, P. (eds.) CPM 2013. LNCS, vol. 7922, pp. 165–176. Springer,
Heidelberg (2013)
5. Jeż, A.: The complexity of compressed membership problems for finite automata.
Theory of Computing Systems, 1–34 (2013),
http://dx.doi.org/10.1007/s00224-013-9443-6
6. Jeż, A.: Recompression: a simple and powerful technique for word equations. In:
Portier, N., Wilke, T. (eds.) STACS. LIPIcs, vol. 20, pp. 233–244. Schloss Dagstuhl–
Leibniz-Zentrum fuer Informatik, Dagstuhl (2013),
http://drops.dagstuhl.de/opus/volltexte/2013/3937
7. Kärkkäinen, J., Sanders, P., Burkhardt, S.: Linear work suffix array construction.
J. ACM 53(6), 918–936 (2006)
8. Kasai, T., Lee, G., Arimura, H., Arikawa, S., Park, K.: Linear-time longest-
common-prefix computation in suffix arrays and its applications. In: Amir, A.,
Landau, G.M. (eds.) CPM 2001. LNCS, vol. 2089, pp. 181–192. Springer, Heidel-
berg (2001)
9. Laine, M., Plandowski, W.: Word equations with one unknown. Int. J. Found.
Comput. Sci. 22(2), 345–375 (2011)
10. Lohrey, M., Mathissen, C.: Compressed membership in automata with compressed
labels. In: Kulikov, A., Vereshchagin, N. (eds.) CSR 2011. LNCS, vol. 6651,
pp. 275–288. Springer, Heidelberg (2011)
11. Makanin, G.S.: The problem of solvability of equations in a free semigroup. Matem-
aticheskii Sbornik 2(103), 147–236 (1977) (in Russian)
12. Mehlhorn, K., Sundar, R., Uhrig, C.: Maintaining dynamic sequences under equal-
ity tests in polylogarithmic time. Algorithmica 17(2), 183–198 (1997)
13. Obono, S.E., Goralcik, P., Maksimenko, M.N.: Efficient solving of the word equa-
tions in one variable. In: Privara, I., Ružička, P., Rovan, B. (eds.) MFCS 1994.
LNCS, vol. 841, pp. 336–341. Springer, Heidelberg (1994)
14. Plandowski, W.: Satisfiability of word equations with constants is in NEXPTIME.
In: STOC, pp. 721–725 (1999)
15. Plandowski, W.: Satisfiability of word equations with constants is in PSPACE.
J. ACM 51(3), 483–496 (2004)
16. Plandowski, W., Rytter, W.: Application of Lempel-Ziv encodings to the solution
of word equations. In: Larsen, K.G., Skyum, S., Winskel, G. (eds.) ICALP 1998.
LNCS, vol. 1443, pp. 731–742. Springer, Heidelberg (1998)
17. Sakamoto, H.: A fully linear-time approximation algorithm for grammar-based
compression. J. Discrete Algorithms 3(2-4), 416–430 (2005)
The IO and OI Hierarchies Revisited
1 Introduction
In the end of the sixties, similar but independent lines of research were pursued in
formal language theory and in the formal semantics of natural language. Formal
language theory was refining the Chomsky hierarchy so as to find an adequate
syntactic model of programming languages lying in between the context-free and
context-sensitive languages. Among others, this period resulted in the definition
of IO and OI macro languages by Fischer [12] and the notion of indexed languages
(which coincide with OI macro languages) by Aho [2]. At the same time, Richard
Montague [19] was proposing a systematic way of mapping natural language sen-
tences to logical formulae representing their meanings, providing thereby a solid
foundation for the field of formal semantics. The main idea behind these two lines
of research can be summed up in the phrase ‘going higher-order.’ For macro and
indexed grammars, this consisted in parameterizing non-terminals with strings
and indices (stacks) respectively, and in Montague’s work it consisted in us-
ing the simply typed λ-calculus to map syntactic structures to their meanings.
Montague was ahead of the formal language theory community which took an-
other decade to go higher-order with the work of Damm [7]. However, the way
Damm defined higher-order grammars used (implicitly) a restricted version of
the λ-calculus that is now known as the safe λ-calculus. This restriction was
made explicit by Knapik et al. [16] and further studied by Blum and Ong [4].
Long version: http://hal.inria.fr/hal-00818069
The first author was funded by LaBRI while working on this research.
This work has been supported by ANR-12-CORD-0004 POLYMNIE.
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 336–348, 2013.
c Springer-Verlag Berlin Heidelberg 2013
The IO and OI Hierarchies Revisited 337
For formal grammars this restriction has first been lifted by de Groote [8] and
Muskens [21] in the context of computational linguistics and as a way of applying
Montague’s techniques to syntactic modeling.
In the context of higher-order recursive schemes, Ong showed that safety
was not a necessary condition for the decidability of the MSO model checking
problem. Moreover, the safety restriction has been shown to be a real restriction
by Parys [23]. Nevertheless, concerning the IO and OI hierarchies, the question
as to whether safety is a genuine restriction in terms of the definable languages is
still an open problem. Aehlig et al. [1] showed that for second order OI grammars
safety was in fact not a restriction. It is nevertheless generally conjectured that
for higher-order grammars safety is in fact a restriction.
As we wish to extend Montague’s technique with the OI hierarchy so as to
enrich it with fixed-point computation as proposed by Moschovakis [20], or as
in proposals to handle presuppositions in natural languages by Lebedeva and
de Groote [10,9,17], we work with languages of λ-terms rather than with just
languages of strings or trees. In the context of languages of λ-terms, safety clearly
appears to be a restriction since, as shown by Blum and Ong [4], not every λ-
term is safe. Moreover the terms generated by Montague’s technique appear to
be unsafe in general.
This paper is thus studying the formal properties of the unsafe IO and OI lan-
guages of λ-terms. A first property that the use of unsafe grammars brings into
the picture is that the unsafe IO hierarchy is strictly included within the unsafe
OI hierarchy. The inclusion can be easily shown using a standard CPS transform
on the grammars and its strictness is implied by decidability results. Nevertheless,
it is worth noting that such a transform cannot be performed on safe grammars,
so that it is unclear whether safe IO languages are safe OI languages. This paper
focuses primarily on the emptiness and the membership problems for unsafe IO
and OI languages, by using simple techniques related to the denotational seman-
tics of the λ-calculus. For the IO case, we are going to recast some known results
from Salvati [25,24], so as to emphasize that they derive from the fact that for an
IO language and a finite model of the λ-calculus, one can effectively compute the
elements of the model which are the interpretations of terms in the language. This
allows us to show that the emptiness problem is decidable, and also, using Stat-
man’s finite completeness theorem [28], to show that the membership problem is
decidable. In contrast to the case for IO languages, we show that this property does
not hold for OI languages. Indeed, we prove that the set of closed terms of a given
type is an OI language, and thus, since λ-definability is undecidable [18], the set of
elements in a finite model that are the interpretation of terms in an OI language
cannot be effectively computed. To show the decidability of emptiness and of the
membership problems for OI, we prove a theorem that we call the Observability
Theorem; it characterizes some semantic properties of the elements of an OI lan-
guage in monotonic models, and leads directly to the decidability of the emptiness
problem. For the membership problem we prove a generalization of Statman’s fi-
nite completeness theorem which, in combination with the Observability Theorem,
entails the decidability of the membership problem of OI languages.
338 G.M. Kobele and S. Salvati
This work is closely related to the research that is being carried out on higher-
order recursive schemes. It differs from it in one important respect: the main
objects of study in the research on higher-order recursive schemes are the infinite
trees generated by schemes, while our work is related to the study of the Böhm
trees of λY -terms which may contain λ-binders. Such Böhm trees are closer to
the configuration graphs of Higher-order Collapsible Pushdown Automata whose
first-order theory has been shown undecidable [6]. If we were only interested in
grammars generating trees or strings, the decidability of MSO for higher-order
recursion schemes [22] would yield the decidability of both the emptiness and
the membership problems of unsafe OI grammars, but this is no longer the case
when we turn to languages of λ-terms.
2 Preliminaries
In this section, we introduce the various calculi we are going to use in the course
of the article. Then we show how those calculi may be used to define IO and OI
grammars. We give two presentations of those grammars, one using traditional
rewriting systems incorporating non-terminals, and the other as terms in one
of the calculi; these two perspectives are equivalent. In the remainder of the
paper we will switch between these two formats as is most convenient. Finally
we introduce the usual notions of full and monotone models for the calculi we
work with.
2.1 λ-Calculi
We introduce here various extensions of the simply typed λ-calculus. Given an
atomic type 0 (our results extend with no difficulty to arbitrarily many atomic
types), the set type of types is built inductively using the binary right-associative
infix operator →. We write α1 → · · · → αn → α0 for (α1 → (· · · (αn → α0 ))).
As in [14], the order of a type is: order(0) = 1, order(α → β) = max(order(α) +
1, order(β)). Constants are declared in higher-order signatures Σ which are finite
sets of typed constants {Aα 1 , . . . , An }. We use constants to represent non-
1 αn
terminal symbols.
The IO and OI Hierarchies Revisited 339
∗
set of λ-terms N in normal form such that M →βδ+ N (we can also restrict our
attention to head-reduction). An alternative characterization of LOI (M ) is the
following. Given a term M we write ω(M ) for the immediate approximation of M ,
that is the term obtained from M as follows: ω(λxα .M ) = Ω α→β if ω(M ) = Ω β ,
and λxα .ω(M ) otherwise; ω(M N ) = Ω β if ω(M ) = Ω α→β or M = λx.P , and
ω(M N ) = ω(M )ω(N ) otherwise; ω(Y α ) = Ω (α→α)→α , ω(xα ) = xα , ω(Ω α ) =
Ω α , and ω(N1 + N2 ) = ω(N1 ) + ω(N2 ). Note that ω(M ) is a λ+Ω-term that
contains no β-redices. A λ+Ω-term Q is a finite approximation of M if there is
∗
a P such that M →βδ P and Q = ω(P ). The language LOI (M ) is the union of
the languages LOI (Q) so that Q is a finite approximation of M .
In both the IO and OI mode of evaluation, λ+Ω-terms define finite languages,
and λY +Ω-calculus defines exactly the same classes of languages as higher-order
macro grammars.
Theorem 1. Given a higher-order macro grammar G, there is a λY +Ω-term
M so that LOI (G) = LOI (M ) and LIO (G) = LIO (M ).
Given a λY +Ω-term M there is a higher-order macro grammar G so that
LOI (G) = LOI (M ) and LIO (G) = LIO (M ).
The proof of this theorem is based on the correspondence between higher-order
schemes and λY -calculus that is given in [27]. Going from a λY +Ω-term to
a grammar is simply a direct transposition of the procedure described in [27]
with the obvious treatment for +. For the other direction, it suffices to see the
grammar as a non-deterministic scheme, which is done by viewing all the rules
A → M1 , . . . , A → Mn , of a non-terminal A as a unique rule of a scheme
A → M1 + · · · + Mn ; and then to transform the scheme into a λY +-term using
the transformation given in [27]. There is a minor technicality concerning the IO
languages; one needs to start with a grammar where every non-terminal can be
∗
rewritten into a G-normal form using →G only.
for a higher-order grammar G, a finite full model F , and a valuation ν, the set
ν ν
[[LIO (G)]]F is effectively computable. On the other hand, we show that [[L]]F is
not in general effectively computable when L is an OI language.
A simple continuation passing style (CPS) transform witnesses that:
Theorem 6 (OI subsumes IO). Given a higher-order grammar G there is a
higher-order grammar G so that LIO (G) = LOI (G ).
The CPS transform naturally makes the order of G be the order of G plus 2.
We now show that for a full model F , a valuation ν and a given grammar G,
ν
the set [[LIO (G)]]F can be effectively computed. A natural consequence of this is
that the emptiness and the membership problems for higher-order IO languages
are decidable. These results are known in the literature [24,25,26], nevertheless,
we include them here so as to emphasize that they are related to the effectivity
ν
of the set [[LIO (G)]]F , a property that, as we will see later, does not hold in the
case of OI languages.
Theorem 7 (Effective finite interpretation of IO). Given a higher-order
macro grammar G, a full model F and a valuation ν, one can effectively construct
ν
the set [[LIO (G)]]F .
Corollary 1. Given a higher-order macro grammar G, the problem of deciding
whether LIO (G) = ∅ is P-complete.
Corollary 2. Given a higher-order macro grammar G and a term M , it is de-
cidable whether M ∈ LIO (G).
We are now going to see that the set of closed λ-terms of a given type α is
an OI language. Combined with Theorem 4, we obtain that the set [[LOI (G)]]F
cannot be effectively computed. Moreover, Theorems 6 and 7 imply that the IO
hierarchy is strictly included in the OI hierarchy.
Theorem 8. For every type α, there is a closed λY +-term M of type α such
that LOI (M ) is the set of all closed normal λ-terms of type α.
Theorem 9 (Undecidable finite interpretation of OI). Given a higher-
order macro grammar G, a finite full model F , and f an element of F , it is
undecidable whether f ∈ [[LOI (G)]].
Proof. Direct consequence of Theorems 8 and 4. &
%
Theorem 10. The class of higher-order IO language is strictly included in the
class of higher-order OI languages.
Proof. If there were an IO grammar that could define the set of closed terms of
type α, Theorem 7 would contradict Theorem 4. %
&
This last theorem should be contrasted with the result of Haddad [13] which
shows that OI and IO coincide for schemes. The two results do not contradict
each other as IO is not defined in the same way on schemes and on grammars.
344 G.M. Kobele and S. Salvati
prime elements of Mα .
ν
The main interest of primality lies in that, if f is prime and f ≤ [[M + N ]]M ,
ν ν
then either f ≤ [[M ]]M or f ≤ [[N ]]M . The notion of hereditary primality is
simply a way of making primality compatible with all the constructs of λY +Ω-
terms. The proof of the following technical Lemma from which we derive the
Observability Theorem, is mainly based on this idea.
Proof. Since for every α, Mα is finite, according to Theorem 5.2 (and the fact
that the set of finite approximations of M is directed for the partial order .),
ν ν
there is a finite approximation Q of M such that [[Q]]M = [[M ]]M and thus
ν
f ≤ [[Qα ]]M . But then Q is a λ+Ω-term and by the previous Lemma this is
ν
equivalent to there being some N in LOI (Q) such that f ≤ [[N ]]M . The conclusion
follows from the fact that obviously LOI (Q) ⊆ LOI (M ). The other direction
follows from Theorem 5.3. &
%
5 Conclusion
We have seen how to use models of λ-calculus so as to solve algorithmic ques-
tions, namely the emptiness and membership problems, related to the classes
of higher-order IO and OI languages of λ-terms. In so doing, we have revisited
various questions related to finite models of the λ-calculus. In particular, we
have seen that hereditary prime elements, via the Observability Theorem, play
a key role in finding effective solutions for higher-order OI languages. In combi-
nation with Theorem 8, we obtain that it is decidable whether there is a term
M whose interpretation in a monotone model is greater than a given hereditary
prime element of that model, which gives a decidability result for a restricted
notion of λ-definability. This raises at least two questions: (i) what kind of prop-
erties of λ-terms can be captured with hereditary prime elements, (ii) is there
a natural extension of this notion that still defines some decidable variant of
λ-definability.
On the complexity side, we expect that, using similar techniques as in [29],
it might be possible to prove that verifying whether the value of a λY +Ω-term
is greater than a hereditary prime element of a monotone model is of the same
complexity as the emptiness and membership problems for the safe OI hierarchy
which is (n − 2)-Exptime-complete for order n-grammars (see [11], with Huet’s
convention, the order of grammars is one plus the order of their corresponding
higher-order pushdown automaton). Of course, such a high complexity makes
the decidability results we obtained of little interest for practical applications
in natural language processing. It does however underscore the need to identify
linguistically motivated generalizations which point to tractable subclasses of
OI grammars [30]. Some restricted classes of IO grammars are known to have
low complexity [15,5]. A natural move is to see whether in the OI mode of
derivation those grammars still have reasonable complexity for the emptiness
and membership problems.
The IO and OI Hierarchies Revisited 347
References
1. Aehlig, K., de Miranda, J.G., Ong, C.-H.L.: Safety is not a restriction at level
2 for string languages. In: Sassone, V. (ed.) FOSSACS 2005. LNCS, vol. 3441,
pp. 490–504. Springer, Heidelberg (2005)
2. Aho, A.V.: Indexed grammars - an extension of context-free grammars. J.
ACM 15(4), 647–671 (1968)
3. Amadio, R.M., Curien, P.-L.: Domains and Lambda-Calculi. Cambridge Tracts in
Theoretical Computer Science. Cambridge University Press (1998)
4. Blum, W., Ong, C.-H.L.: The safe lambda calculus. Logical Methods in Computer
Science 5(1:3), 1–38 (2009)
5. Bourreau, P., Salvati, S.: A datalog recognizer for almost affine λ-cfgs. In:
Kanazawa, M., Kornai, A., Kracht, M., Seki, H. (eds.) MOL 12. LNCS, vol. 6878,
pp. 21–38. Springer, Heidelberg (2011)
6. Broadbent, C.H.: The limits of decidability for first order logic on cpda graphs. In:
STACS, pp. 589–600 (2012)
7. Damm, W.: The IO- and OI-hierarchies. Theor. Comput. Sci. 20, 95–207 (1982)
8. de Groote, P.: Towards abstract categorial grammars. In: ACL (ed.) Proceedings
39th Annual Meeting of ACL, pp. 148–155 (2001)
9. de Groote, P., Lebedeva, E.: On the dynamics of proper names. Technical report,
INRIA (2010)
10. de Groote, P., Lebedeva, E.: Presupposition accommodation as exception handling.
In: SIGDIAL, pp. 71–74. ACL (2010)
11. Engelfriet, J.: Iterated stack automata and complexity classes. Inf. Comput. 95(1),
21–75 (1991)
12. Fischer, M.J.: Grammars with macro-like productions. PhD thesis, Harvard Uni-
versity (1968)
13. Haddad, A.: IO vs OI in higher-order recursion schemes. In: FICS. EPTCS, vol. 77,
pp. 23–30 (2012)
14. Huet, G.: Résolution d’équations dans des langages d’ordre 1,2,...,ω. Thèse de doc-
torat en sciences mathématiques, Université Paris VII (1976)
15. Kanazawa, M.: Parsing and generation as datalog queries. In: Proceedings of the
45th Annual Meeting of ACL, pp. 176–183. ACL (2007)
16. Knapik, T., Niwiński, D., Urzyczyn, P.: Higher-order pushdown trees are easy. In:
Nielsen, M., Engberg, U. (eds.) FOSSACS 2002. LNCS, vol. 2303, pp. 205–222.
Springer, Heidelberg (2002)
17. Lebedeva, E.: Expressing Discourse Dynamics Through Continuations. PhD thesis,
Université de Lorraine (2012)
18. Loader, R.: The undecidability of λ-definability. In: Logic, Meaning and Compu-
tation: Essays in Memory of Alonzo Church, pp. 331–342. Kluwer (2001)
19. Montague, R.: Formal Philosophy: Selected Papers of Richard Montague. Yale
University Press, New Haven (1974)
20. Moschovakis, Y.: Sense and denotation as algorithm and value. In: Logic Collo-
quium 1990: ASL Summer Meeting in Helsinki, vol. 2, p. 210. Springer (1993)
21. Muskens, R.: Lambda Grammars and the Syntax-Semantics Interface. In: Proceed-
ings of the Thirteenth Amsterdam Colloquium, pp. 150–155 (2001)
22. Ong, C.-H.L.: On model-checking trees generated by higher-order recursion
schemes. In: LICS, pp. 81–90 (2006)
23. Parys, P.: On the significance of the collapse operation. In: LICS, pp. 521–530
(2012)
348 G.M. Kobele and S. Salvati
24. Salvati, S.: Recognizability in the Simply Typed Lambda-Calculus. In: Ono, H.,
Kanazawa, M., de Queiroz, R. (eds.) WoLLIC 2009. LNCS, vol. 5514, pp. 48–60.
Springer, Heidelberg (2009)
25. Salvati, S.: On the membership problem for non-linear acgs. Journal of Logic Lan-
guage and Information 19(2), 163–183 (2010)
26. Salvati, S., Manzonetto, G., Gehrke, M., Barendregt, H.: Loader and Urzyczyn are
logically related. In: Czumaj, A., Mehlhorn, K., Pitts, A., Wattenhofer, R. (eds.)
ICALP 2012, Part II. LNCS, vol. 7392, pp. 364–376. Springer, Heidelberg (2012)
27. Salvati, S., Walukiewicz, I.: Recursive schemes, Krivine machines, and collapsible
pushdown automata. In: Finkel, A., Leroux, J., Potapov, I. (eds.) RP 2012. LNCS,
vol. 7550, pp. 6–20. Springer, Heidelberg (2012)
28. Statman, R.: Completeness, invariance and λ-definability. Journal of Symbolic
Logic 47(1), 17–26 (1982)
29. Terui, K.: Semantic evaluation, intersection types and complexity of simply typed
lambda calculus. In: RTA, pp. 323–338 (2012)
30. van Rooij, I.: The tractable cognition thesis. Cognitive Science 32, 939–984 (2008)
Evolving Graph-Structures and Their Implicit
Computational Complexity
1 Introduction
The interplay of algorithms and data-structures has been central to both the-
oretical and practical facets of programming. A core method of this relation is
the organization of data-structures by underlying directed multi-graphs, such
as trees, DAGs, and objects, where each vertex points to a record. Such data
structures are often thought of as “dynamic”, because they are manipulated
by algorithms that modify the underlying graph, namely by creating, updating
and removing vertices and edges. Our imperative language is inspired by pointer
machines [6,10] and by abstract state machines [2].
In this work we propose a simple and effective static analysis method for
guaranteeing the feasible time-complexity of programs over many dynamic data-
structures. Most static analysis efforts have focused in recent years on program
termination and on safety and security. Our work is thus a contribution to an-
other strand of static analysis, namely computational complexity.
Static analysis of computational complexity is based on several methods,
classified broadly into descriptive ones (i.e. related to Finite Model Theory),
and applicative (i.e. identifying restrictions of programs and proof methods that
guarantee upper bounds on the complexity of computation). One of the most
fruitful applicative methods has been ramification, also referred to as tiering.
Initially this method was used for inductive data, such as words and natural
numbers, but lately the method has been applied to more general forms of data.
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 349–360, 2013.
c Springer-Verlag Berlin Heidelberg 2013
350 D. Leivant and J.-Y. Marion
2 Evolving Graph-Structures
2.1 Sorted Partial Structures
The framework of sorted structures is natural for the graph-structures we wish
to consider, with vertices and data treated as distinct sorts. Data might itself be
sorted, but that does not concern us here. Recall that in a sorted structure, if V
and D are sorts, then a function f is of type V → D if its domain consists of the
structure elements of sort V, and its range of elements of sort D.
The graphs we consider are essentially deterministic transition graphs: edges
are labeled (to which we refer as “actions”), and every vertex has at most one
out-edge with a given label. Such graphs are conveniently represented by partial
functions, corresponding to actions. An edge labeled f from vertex u to vertex v
is represented by the equality f (u) = v. When u has no f-labeled out-edges, we
leave f (u) undefined. To represent function partiality in the context of structures,
we post a special constant nil, assumed to lie outside the sorts (or, equivalently,
in a special singleton sort)2 . We write f : V + D, and say that f is a partial
function from sort V to sort D, if f : V → (D ∪ {nil}). We write V + D for the
type of such partial functions.
these sorts, where we have just five sets of identifiers: V (the vertex constants),
D (the data constants), F (function-identifiers for labeled edges, of type V + V),
G (function-identifiers for data, of type V → D), and R (the relation-identifiers),
each of some type τ × · · · × τ , where each τ is V or D. As syntactic parameters
we use v ∈ V, d ∈ D, f ∈ F, g ∈ G, and R ∈ R.
Given a sorted vocabulary Σ as above, a Σ-structure S consists of a vertex-
universe V S which is finite, a potentially infinite reserve-universe RS , a data-
universe D S , a distinct object ⊥ to interpret nil, and a sort-correct interpretation
AS for each Σ-identifier A: vS ∈ V S ; dS ∈ DS ; gS ∈ [V S → D S ] (a data-
function); fS ∈ [V S + V S ] (a partial function), and for a relation-identifier R, a
relation RS ⊆ τ S × · · · τ S . Note that we do not refer to functions over data, nor
to functions of arity > 1. Also, the fact that our graphs are edge-deterministic
is reflected in our reprensetation of edges by functions.
Our graph structures bear similarity to the struct construct in the pro-
gramming language C, and to objects (without behaviors or methods): a vertex
identifies an object, and the state of that object is given by fields that are spec-
ified by the unary function identifiers. This is why Tarjan, in defining similar
structures [11], talks about records and items rather than vertices and edges. The
restriction of a graph-structure S to the sort V of vertices can be construed as a
labeled directed multi-graph, in which there is an edge labeled by f from vertex
u to vertex v exactly when fS (u) = v. Thus the fan-out of each graph is bounded
by the number of edge-labels in Σ. Examples of graph structures abound, see
examples in Section 5. Linked-lists of data is an obvious one, of which words
(represented as linked lists of alphabet-symbols) form a special case.
2.3 Expressions
Expressions are generated from a set X of vertex-variables, a set Y of data-
variables, and the vocabulary identifiers, as follows. Equality here does not
conform strictly to the sort discipline, in that we allow equations of the form
V = nil3 .
V ∈ VExpr ::= X | nil | v | f (V ) where X ∈ X
D ∈ DExpr ::= Y | d | g(V ) where Y ∈ Y
B ∈ BExpr ::= V = V | D = D | ¬(B) | R(E1 . . . En ) where R : τ n , Ei : τ
s
The phrase S, μ P =⇒ S , μ P conveys that evaluating a program
P starting with configuration (S, μ) is reduced to evaluating P in configuration
(S , μ ); i.e., P reduces to P while updating (S, μ) to (S , μ ).
An initial configuration is a configuration (S, μ) where μ(X) = nil for every
non-input variable X. A program P computes the partial function [[P ]] with
s
initial configurations as input, defined by: [[P ]](S, μ) = (S , ξ) iff S, μ P (=⇒
)∗ T , ξ skip.
4
Here we consider equality as just another relation.
354 D. Leivant and J.-Y. Marion
3.6 Run-Time
We say that a program P runs in time t on input (S, μ), and write TimeP (S, μ) =
s
t, when S, μ P (=⇒)t T , ξ skip for some (T , ξ). We take the size |S, μ| of
a configuration (S, μ) to be the number n of elements in the vertex-universe V .
Since the number of edges is bounded by n2 , we disregard them here. We also
disregard the size of the data-universe, because our programs do not modify the
data present in records. A program P is running in polynomial time if there is
a k > 0 such that TimeP (S, μ) k · |S, μ|k for all configurations (S, μ),
4 Ramifiable Programs
4.1 Tiering
Program tiering, also referred to as ramification, has been introduced in [7] and
used in restricted form already in [1]. It serves to syntactically control the run-
time of programs. Here we adapt tiering to graph-structures. The main challenge
here is the evolution of structures in course of computation. To address it, we
consider a finite lattice T = (T, /, 0, ∨, ∧), and refer to the elements of T as tiers.
However, in order to simplify soundness proofs, and without loss of generality,
we will focus on the boolean lattice T = ({0, 1}, , 0, ∨, ∧). We use lower case
Greek letters α, β as discourse parameters for tiers.
Given T, we consider T-environments (Γ , Δ). Here Γ assigns a tier to each
variable in V, whereas Δ assigns to each function identifier f : V + V one or
several expressions of the form α → β, so that either
1. all types in Δ(f ) are of the form α → α, in which case we say that f is stable
in the environment; or
2. all types in Δ(f ) are of the form α → β, with β ≺ α, and we say that f is
reducing in the environment.
A tiering assertion is a phrase of the form Γ , Δ V : α, where V is a vertex-
expression and (Γ , Δ) a T-environment. The correct tiering assertions are gen-
erated by the tiering system in Figure 1.
Γ (X ) = α α → β ∈ Δ(f) Γ, Δ V :α
Γ, Δ c:α Γ, Δ X :α Γ, Δ f(V ) : β
Γ, Δ Vi : α Γ,Δ Vi : α
Γ, Δ R(V1 , . . . , Vn ) : α Γ,Δ V0 = V1 : α
Γ, Δ X :α Γ, Δ V :α Γ, Δ f(X) : α Γ, Δ V :α
Γ, Δ X :=V : α Γ, Δ f(X ):=V : α
Γ, Δ X :0 Γ, Δ B:α Γ, Δ P :α
0≺α
Γ, Δ New(X) : 0 Γ, Δ while(B){P } : α
Γ, Δ P :α Γ, Δ P : β
Γ, Δ skip : 0 Γ, Δ P ; P : α ∨ β
Γ, Δ B:α Γ, Δ Pi : α Γ, Δ P :β
(β α)
Γ, Δ if (B){P0 }{P1 } : α Γ, Δ P :α
The Theorem follows from the Soundness Lemma 6 and the Completeness Propo-
sition 1 below.
Tree insertion. The program below inserts the tree T into the binary search
tree whose root is pointed-to by x. The input variables are x and T .
i f ( x1 = n i l )
{x 1 :=T : 1 ; } % then c l a u s e
{ % else clause
while ( ( x 1 = n i l ) and ( key (T1 ) = key ( x 1 ) ) )
{ i f ( key (T1 ) < key ( x 1 ) ) {p1 :=x 1 ; x 1 := l e f t ( x 1 ) 1 }
{p1 :=x 1 ; x 1 := ri ght ( x 1 ) 1 } } : 1 ;
i f ( key (T ) < key ( p ) ) { l e f t ( p1 ) := T1 : 1}
1 1
{ ri ght ( p1 ):= T1 : 1}
Note that neither left nor right is modified in the loop, so the loop is stationary.
Copying lists. Here we use New to copy a list, where the copy is in reverse
order. Note that the source list is of tier 1 while the copy is of tier 0.
y0 = n i l : 0 ;
while ( x 1 = n i l )
{ z 0 :=y 0 : 0 ; New( y 0 ) ; suc ( y 0 ):= z 0 : 0 ;
x 1 := suc ( x 1 ) : 1 } : 1
The tiering rules imply that a program P of tier 0 cannot have loops, and
is therefore evaluated in |P | steps. At the same time, the value of a variable
of tier 1 depends only on vertices of tier 1. This implies, as we shall see, that
the number of iterations of a given loop must be bounded by the number of
possible configurations that may be generated by its body. Our restriction to
tightly-modifying ramification guarantees that the number is polynomial.
6.1 Non-interference
Lemma 3 (Confinement). Let (Γ, Δ) be an environment. If Γ, Δ P : 0,
then Γ (X) = 0 for every variable X assigned-to in P .
The proof is a straightforward structural induction. Note also that a program P
of tier 0 cannot have a loop, and is thus evaluated within |P | steps.
We say that a vertex-tiering Γ is compatible with a store μ if Γ (X) = Γ (X )
implies μ(X) = μ(X ) for all X, X ∈ X. We say that Γ is an initial tiering if
Γ (X) is 1 for X initial (i.e. X ∈ X0 ), and 0 otherwise. Thus an initial tiering is
always compatible with an initial store.
S, μ |= P =⇒ S , μ |= P .
s
Lemma 4. Suppose that Γ , Δ P : α and
If μ is compatible with Γ then so is μ .
The proof is straightforward by structural induction on P .
We show next that tiering, when compatible with the initial configuration,
guarantees the non-interference of lower-tiered values in the run-time of higher-
tiered programs. A similar effect of tiering, albeit simpler, was observed already
in [7]. This is also similar to the security-related properties considered in [12].
Non-interference can also be rendered algebraically, as in [8].
The (Γ , Δ)-collapse of a configuration (S, μ) is the configuration (S Δ , μΓ ),
where μΓ (X) = μ(X) if Γ (X) = 1, and μΓ (X) is undefined otherwise; whereas
S Δ is the structure identical to S except that each f for which (1 → 1) ∈ Δ(f )
is interpreted as ∅. Thus (S Δ , μΓ ) disregards vertices that are not not reachable
from some variable of tier 1 using edges of type (1 → 1).
The next lemma states that a program’s output vertices in tier 1 do not
depend on vertices in tier 0, nor on edges that do not have tier 1 → 1.
S , μ |= P . There
s
Lemma 5. Suppose Γ , Δ P : α, and S, μ |= P =⇒
is a configuration (S , μ ) such that S Δ , μΓ |= P S , μ |= P , and
s
=⇒
(S Δ , μΓ ) = (S Δ , μΓ ).
The proof is straightforward by structural induction on programs.
t < k + |S| .k
358 D. Leivant and J.-Y. Marion
9 Adding Recursion
It is not hard to augment our programing language with recursion. Here is a
procedure that recursively searches for a path from vertex v to w.7
Proc s e a r c h ( v 1 ,w1 ) )
{ i f ( v=w) 1 return t r u e : 1 ;
v i s i t e d ( v ) = tru e: 1 ;
f o r a l l t 1 i n A d j L i s t ( v ) % L i s t o f a d j a c e n c y nodes o f t
{ i f ( v i s i t e d ( t ) 1=f a l s e )
i f ( s e a r c h ( t , w) 1=t r u e ) return t r u e : 1 ; }
return f a l s e : 1 ; }
A restricted form of recursion is linear recursion, where at most one recursive
call is allowed in the definition of a recursive procedure. Moreover, we suppose
that each function body is stationary or tightly-modifying.
Theorem 3. On its domain of computation, a tightly-ramifiable program with
linear recursive calls is computable in polynomial time.
References
1. Bellantoni, S., Cook, S.A.: A new recursion-theoretic characterization of the poly-
time functions. Computational Complexity 2, 97–110 (1992)
2. Gurevich, Y.: Sequential abstract state machines capture sequential algorithms.
ACM Transactions on Computational Logic 1(1), 77–111 (2000)
3. Hartmann, L., Jones, N.D., Simonsen, J.G., Vrist, S.B.: Programming in biomolec-
ular computation: Programs, self-interpretation and visualisation. Sci. Ann. Comp.
Sci. 21(1), 73–106 (2011)
4. Hofmann, M., Schöpp, U.: Pure pointer programs with iteration. ACM Trans.
Comput. Log. 11(4) (2010)
5. Jones, N.D.: Logspace and ptime characterized by programming languages. Theor.
Comput. Sci. 228(1-2), 151–174 (1999)
6. Kolmogorov, A.N., Uspensky, V.: On the definition of an algorithm. Uspekhi Mat.
Naut. 13(4) (1958)
7. Leivant, D.: Predicative recurrence and computational complexity I: Word recur-
rence and poly-time. In: Feasible Mathematics II. Birkhauser-Boston (1994)
8. Marion, J.-Y.: A type system for complexity flow analysis. In: LICS (2011)
9. Sabelfeld, A., Sands, D.: Declassification: dimensions and principles. J. Comput.
Secur. 17, 517–548 (2009)
10. Schönhage, A.: Storage modification machines. SIAM J. Comp. 9(3), 490–508
(1980)
11. Tarjan, R.E.: Reference machines require non-linear time to maintain disjoint sets.
In: STOC 1977, pp. 18–29. ACM (1977)
12. Volpano, D., Irvine, C., Smith, G.: A sound type system for secure flow analysis.
Journal of Computer Security 4(2/3), 167–188 (1996)
7
The construct forall X in R(u), which is “blind,” in the sense that it does not
depend on node ordering. As a result, no function identifier is probed except visited.
Rational Subsets and Submonoids of Wreath Products
1 Introduction
The study of algorithmic problems in group theory has a long tradition. Dehn, in his
seminal paper from 1911, introduced the word problem (Does a given word over the
generators represent the identity?), the conjugacy problem (Are two given group el-
ements conjugate?) and the isomorphism problem (Are two given finitely presented
groups isomorphic?), see [25] for general references in combinatorial group theory.
Starting with the work of Novikov and Boone from the 1950’s, all three problems were
shown to be undecidable for finitely presented groups in general. A generalization of
the word problem is the subgroup membership problem (also known as the general-
ized word problem) for finitely generated groups: Given group elements g, g1 , . . . , gn ,
does g belong to the subgroup generated by g1 , . . . , gn ? Explicitly, this problem was
introduced by Mihailova in 1958, although Nielsen had already presented in 1921 an
algorithm for the subgroup membership problem for free groups.
Motivated partly by automata theory, the subgroup membership problem was further
generalized to the rational subset membership problem. Assume that the group G is
finitely generated by the set X (where a ∈ X if and only if a−1 ∈ X). A finite au-
tomaton A with transitions labeled by elements of X defines a subset L(A) ⊆ G in
the natural way; such subsets are the rational subsets of G. The rational subset mem-
bership problem asks whether a given group element belongs to L(A) for a given finite
automaton (in fact, this problem makes sense for any finitely generated monoid). The
notion of a rational subset of a monoid can be traced back to the work of Eilenberg and
Schützenberger from 1969 [8]. Other early references are [1,11]. Rational subsets of
groups also found applications for the solution of word equations (here, quite often the
term rational constraint is used) [6,20]. In automata theory, rational subsets are tightly
related to valence automata (see [9,16,17] for details): For any group G, the empti-
ness problem for valence automata over G (which are also known as G-automata) is
decidable if and only if G has a decidable rational subset membership problem.
This work was supported by the DAAD research project RatGroup. The second author was
partially supported by a grant from the Simons Foundation (#245268 to Benjamin Steinberg).
Omitted proofs can be found in the long version [24] of this paper.
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 361–372, 2013.
c Springer-Verlag Berlin Heidelberg 2013
362 M. Lohrey, B. Steinberg, and G. Zetzsche
For free groups, Benois [2] proved that the rational subset membership problem is
decidable using a classical automaton saturation procedure (which yields a polynomial
time algorithm). For commutative groups, the rational subset membership can be solved
using integer programming. Further (un)decidability results on the rational subset mem-
bership problem can be found in [21] for right-angled Artin groups, in [28] for nilpotent
groups, and in [23] for metabelian groups. In general, groups with a decidable rational
subset membership problem seem to be rare. In [22] it was shown that if the group G
has at least two ends, then the rational subset membership problem for G is decidable
if and only if the submonoid membership problem for G (Does a given element of G
belong to a given finitely generated submonoid of G?) is decidable.
In this paper, we investigate the rational subset membership problem for wreath
products. The wreath product is a fundamental operation in group theory. To define
( product H 8 G of two groups G and H, one first takes the direct sum
the wreath
K = g∈G H of copies of H, one for each element of G. An element g ∈ G acts
on K by permuting the copies of H according to the left action of g on G. The corre-
sponding semidirect product K G is the wreath product H 8 G.
In contrast to the word problem, decidability of the rational subset membership prob-
lem is not preserved under wreath products. For instance, in [23] it was shown that for
every non-trivial group H, the rational subset membership problem for H 8 (Z × Z)
is undecidable. The proof uses an encoding of a tiling problem, which uses the grid
structure of the Cayley graph of Z × Z.
In this paper, we prove the following two new results concerning the rational subset
membership problem and the submonoid membership problem for wreath products:
(i) The submonoid membership problem is undecidable for Z 8 Z. The wreath product
Z 8 Z is one of the simplest examples of a finitely generated group that is not finitely
presented, see [4,5] for further results showing the importance of Z 8 Z.
(ii) For every finite group H and every virtually free group1 V , the group H 8 V has
a decidable rational subset membership problem; this includes for instance the fa-
mous lamplighter group Z2 8 Z.
For the proof of (i) we encode the acceptance problem for a 2-counter machine (Minsky
machine [26]) into the submonoid membership problem for Z 8 Z. One should remark
that Z 8 Z is a finitely generated metabelian group and hence has a decidable subgroup
membership problem [29,30]. For the proof of (ii), an automaton saturation procedure
is used. The termination of the process is guaranteed by a well-quasi-order (wqo) that
refines the classical subsequence wqo considered by Higman [14].
Wqo theory has also been applied successfully for the verification of infinite state
systems. This research led to the notion of well-structured transition systems [10]. Ap-
plications in formal language theory are the decidability of the membership problem
for leftist grammars [27] and Kunc’s proof of the regularity of the solutions of certain
language equations [18]. A disadvantage of using wqo theory is that the algorithms it
yields are not accompanied by complexity bounds. The membership problem for leftist
grammars [15] and, in the context of well-structured transition systems, several natu-
ral reachability problems [3,32] (e.g. for lossy channel systems) have even been shown
1
Recall that a group is virtually free if it has a free subgroup of finite index.
Rational Subsets and Submonoids of Wreath Products 363
not to be primitive recursive. The complexity status for the rational subset membership
problem for wreath products H 8 V (H finite, V virtually free) thus remains open. Ac-
tually, we do not even know whether the rational subset membership problem for the
lamplighter group Z2 8 Z is primitive recursive.
3 Wreath Products
(
Let G and H be groups. Consider the direct sum K = g∈G Hg , where Hg is a copy of
H. We view K as the set H (G) = {f ∈ H G | f −1 (H \ {1H }) is finite} of all mappings
from G to H with finite support together with pointwise multiplication as the group
operation. The group G has a natural left action on H (G) given by gf (a) = f (g −1 a),
where f ∈ H (G) and g, a ∈ G. The corresponding semidirect product H (G) G is the
wreath product H 8 G. In other words:
364 M. Lohrey, B. Steinberg, and G. Zetzsche
4 Decidability
We show that the rational subset membership problem is decidable for groups G =
H 8 V , where H is finite and V is virtually free. First, we will show that the rational
subset membership problem for G = H 8 F2 , where F2 is the free group generated by a
and b, is decidable. For this we make use of a particular well-quasi-order.
automaton for this upward closure can be constructed from X and H). Since for w =
w1 · · · wn , w1 , . . . , wn ∈ X, the upward closure of {w} equals U w1 · · · U wn U , we can
also construct a finite automaton for the upward closure of any given singleton provided
that H is finite. In the latter case, we can also show that /H is a wqo:
Applying Thm. 1 to the sequence w̄1 , w̄2 , . . . yields i < j with w̄i / w̄j . This means
w̄i = u1 · · · ur , w̄j = v0 u1 v1 · · · ur vr for some u1 , . . . , ur ∈ Y , v0 , . . . , vr ∈ Y ∗ .
By definition of w̄i we have us = (us , hs ) for 1 ≤ s ≤ r, where hs = β(u1 · · · us )
and wi = u1 · · · ur . Let π1 : Y ∗ → X ∗ be the morphism extending the projection
onto the first component, and let vs = π1 (vs ) for 0 ≤ s ≤ r. Then clearly wj =
v0 u1 v1 · · · ur vr . We claim that β(vs ) = 1 for 0 ≤ s ≤ r, from which wi /β wj
and hence the lemma follows. Since w̄j is also obtained according to (1), we have
β(u1 · · · us+1 ) = hs+1 = β(v0 u1 v1 · · · us vs us+1 ) for 0 ≤ s ≤ r − 1. By induction
on s, this implies β(vs ) = 1 for 0 ≤ s ≤ r − 1. Finally, β(vr ) = 1 follows from
β(u1 · · · ur ) = β(wi ) = β(wj ) = β(v0 u1 v1 · · · ur vr ) = β(u1 · · · ur vr ). &
%
Loops. Let G = H 8F2 and fix free generators a, b ∈ F2 . Recall that every element of F2
can be represented by a unique word over {a, a−1 , b, b−1 } that does not contain a factor
of the form aa−1 , a−1 a, bb−1 , or b−1 b; such words are called reduced. For f ∈ F2 ,
let |f | be the length of the reduced( word representing f . Also recall that elements of G
are pairs (k, f ), where k ∈ K = g∈F2 H and f ∈ F2 . In the following, we simply
write kf for the pair (k, f ). Fix an automaton A = (Q, G, E, q0 , QF ) with labels from
G for the rest of Sec. 4. We want to check whether 1 ∈ L(A). Since G is generated as a
monoid by H ∪{a, a−1 , b, b−1 }, we can assume that E ⊆ Q × (H ∪{a, a−1 , b, b−1 })×
Q.
A configuration is an element of Q × G. For configurations (p, g1 ), (q, g2 ), we write
(p, g1 ) →A (q, g2 ) if there is a (p, g, q) ∈ E such that g2 = g1 g. For elements f, g ∈
F2 , we write f ≤ g (f < g) if the reduced word representing f is a (proper) prefix
of the reduced word representing g. We say that an element f ∈ F2 \ {1} is of type
x ∈ {a, a−1 , b, b−1 } if the reduced word representing f ends with x. Furthermore,
1 ∈ F2 is of type 1. Hence, the set of types is T = {1, a, a−1 , b, b−1 }. When regarding
2
One can actually show for any group H: (X ∗ , H ) is a wqo if and only if for every n ∈ N,
there is k ∈ N with |g1 , . . . , gn | ≤ k for all g1 , . . . , gn ∈ H. See the full version [24].
366 M. Lohrey, B. Steinberg, and G. Zetzsche
the Cayley graph of F2 as a tree with root 1, the children of a node of type t are of
the types C(t) = {a, a−1 , b, b−1 } \ {t−1 }. Clearly, two nodes have the same type if
and only if their induced subtrees of the Cayley graph are isomorphic. The elements of
D = {a, a−1 , b, b−1 } will also be called directions.
Let p, q ∈ Q and t ∈ T . A sequence of configurations
(recall that ki fi denotes the pair (ki , fi ) ∈ G) is called a well-nested (p, q)-computation
for t if (i) q1 = p and qn = q, (ii) f1 = fn is of type t, and (iii) fi ≥ f1 for 1 < i < n
(this last condition is satisfied automatically if f1 = fn = 1). We define the effect
of the computation to be f1−1 k1−1 kn fn ∈ K. Hence, the effect describes the change
imposed by applying the corresponding sequence of transitions, independently of the
configuration in which it starts. The depth of the computation (2) is the maximum value
of |f1−1 fi | for 1 ≤ i ≤ n. We have 1 ∈ L(A) if and only if for some q ∈ QF , there is a
well-nested (q0 , q)-computation for 1 with effect 1.
For d ∈ C(t), a well-nested (p, q)-computation (2) for t is called a (p, d, q)-loop for
t if in addition f1 d ≤ fi for 1 < i < n. Note that there is a (p, d, q)-loop for t that starts
in (p, kf ) (where f is of type t) with effect e and depth m if and only if there exists a
(p, d, q)-loop for t with effect e and depth m that starts in (p, t).
Given p, q ∈ Q, t ∈ T , d ∈ C(t), it is decidable whether there is a (p, d, q)-
loop for t: This amounts to checking whether a given automaton with input alphabet
{a, a−1 , b, b−1 } accepts a word representing the identity of F2 such that no proper
prefix represents the identity of F2 . Since this can be accomplished using pushdown
automata, we can compute the set
Lemma 1 and 2 already imply that each Pt is a regular language, since the upward
closure of each singleton is regular. This can also be deduced by observing that /H is
a monotone order in the sense of [7]. Therein, Ehrenfeucht et al. show that languages
that are upward closed with respect to monotone well-quasi-orders are regular. Our next
step is a characterization of the Pt that allows us to compute finite automata for them.
In order to state this characterization, we need the following definitions.
∗
Let X, Y be alphabets. A regular substitution is a map σ : X → 2Y such that
σ(x) ⊆ Y ∗ is regular for every x ∈ X. For w ∈ X ∗ , w = w1 · · · wn , wi ∈ X, let
σ(w) = R1 · · · Rn , where σ(wi ) = Ri for 1 ≤ i ≤ n. Given R ⊆ Y ∗ and a regular
∗
substitution σ : X → 2Y , let σ −1 (R) = {w ∈ X ∗ | σ(w) ∩ R = ∅}. If R is regular,
then σ −1 (R) is regular as well [31, Prop. 2.16], and an automaton for σ −1 (R) can be
obtained effectively from automata for R and the σ(x). The alphabet Yt is given by
Yt = Xt ∪ ((Q × H × Q) ∩ E).
We will interpret a word in Yt∗ as that part of a computation that happens in a node of
type t: A symbol in Yt \ Xt stands for a transition that stays in the current node and
only changes the local H-value and the state. A symbol (p, d, q) ∈ Xt represents the
execution of a (p, d, q)-loop in a subtree of the current node. The morphism πt : Yt∗ →
Xt∗ is the projection onto Xt∗ , meaning πt (y) = y for y ∈ Xt and πt (y) = ε for
y ∈ Yt \ Xt . The morphism νt : Yt∗ → H is defined by
Hence, when w ∈ Yt∗ describes part of a computation, νt (w) is the change it imposes
on the current node. For p, q ∈ Q and t ∈ T , define the regular set
t
Rp,q = {(p0 , g1 , p1 )(p1 , g2 , p2 ) · · · (pn−1 , gn , pn ) ∈ Yt∗ | p0 = p, pn = q}.
For tuples (Ut )t∈T and (Vt )t∈T with Ut , Vt ⊆ Xt∗ , we write (Ut )t∈T ≤ (Vt )t∈T if
Ut ⊆ Vt for each t ∈ T . We can now state the following fixpoint characterization:
Lemma 3. (Pt )t∈T is the smallest tuple such that for every t ∈ T we have ε ∈ Pt and
* −1
−1
σt,d πd (Pd ) ∩ νd−1 (1) ⊆ Pt .
d∈C(t)
Theorem 2. The rational subset membership problem is decidable for every group G =
H 8 F , where H is finite and F is a finitely generated free group.
Proof. Since H 8 F is a subgroup of H 8 F2 (since F is a subgroup of F2 ), it suffices to
show decidability for G = H 8 F2 . First, we compute finite automata for the languages
(0)
Pt . We do this by initializing Ut := {ε}↑t for each t ∈ T and then successively
(i)
extending the sets Ut , which are represented by finite automata, until they equal Pt :
If there is a t ∈ T and a word
*
−1
πd−1 (Ud ) ∩ νd−1 (1) \ Ut ,
(i) (i)
w∈ σt,d
d∈C(t)
5 Undecidability
In this section, we will prove the second main result of this paper: The wreath product
Z 8 Z contains a fixed submonoid with an undecidable membership problem. Our proof
is based on the undecidability of the halting problem for 2-counter machines.
In other words, C alternates between the two counters. Hence, a transition (q, ci , x, p)
can be just written as (q, x, p).
Let Σ = Q - {c, #} and let ZΣ be the free abelian group generated by Σ. First, we
prove that there is a fixed finitely generated submonoid M of ZΣ 8Z with an undecidable
membership problem. Let a ∈ Σ be (a generator for the right Z-factor; hence Z 8 Z
Σ
For initial counter values m, n ∈ N let I(m, n) = aq0 a2 cm a4 cn a−6 ; its list notation is
´ ˆ
[0, q0 , 0, m · c, 0, 0, 0, n · c]. (10)
370 M. Lohrey, B. Steinberg, and G. Zetzsche
Here is some intuition: The group element I(m, n) represents the initial configura-
tion (q0 , m, n) of the 2-counter machine C. Lemma 4 below states that (q0 , m, n) →∗C
(qf , 0, 0) is equivalent to the existence of Y ∈ M with I(m, n)Y = 1, i.e., I(m, n)−1 ∈
M . Generators of type (3)–(7) simulate the 2-counter machine C. States of C will be
stored at cursor positions 4k + 1. The values of the first (resp., second) counter will be
stored at cursor positions 8k + 3 (resp., 8k + 7). Note that I(m, n) puts a single copy
of the symbol q0 ∈ Σ at position 1, m copies of symbol c (which represents counter
values) at position 3, and n copies of symbol c at position 7. Hence, indeed, I(m, n) sets
up the initial configuration (q0 , m, n) for C. Even cursor positions will carry the special
symbol #. Note that generator (8) is the only generator which changes the cursor posi-
tion from even to odd or vice versa. It will turn out that if I(m, n)Y = 1 (Y ∈ M ), then
generator (8) has to occur exactly once in Y ; it terminates the simulation of the 2-counter
machine C. Hence, Y can be written as Y = U (qf−1 a−1 )V with U, V ∈ M . Moreover,
it turns out that U ∈ M is a product of generators (3)–(7), which simulate C. Thereby,
even cursor positions will be marked with a single occurrence of the special symbol #.
In a second phase, which corresponds to V ∈ M , these special symbols # will be re-
moved again and the cursor will be moved left to position 0. This is accomplished with
generator (9). In fact, our construction enforces that V is a power of (9).
During the simulation phase (corresponding to U ∈ M ), generators of type (3) im-
plement zero tests, whereas generators of type (4) (resp., (5)) increment (resp., decre-
ment) a counter. Finally, (6) and (7) copy the counter value to the next cursor position
that is reserved for the counter (that is copied). During such a copy phase, (6) is first
applied ≥ 0 many times. Finally, (7) is applied exactly once.
Lemma 4. For all m, n ∈ N we have: (q0 , m, n) →∗C (qf , 0, 0) if and only if there
exists Y ∈ M such that I(m, n)Y = 1.
The following result is an immediate consequence of Thm. 4 and Lemma 4.
Theorem 5. There is a fixed finitely generated submonoid M of the wreath product
ZΣ 8 Z with an undecidable membership problem.
Finally, we can establish the main result of this section.
Theorem 6. There is a fixed finitely generated submonoid M of the wreath product
Z 8 Z with an undecidable membership problem.
Proof. By Thm. 5 it suffices to reduce the submonoid membership problem of ZΣ 8 Z
to the submonoid membership problem of Z 8 Z. If m = |Σ|, then Prop. 1 shows that
ZΣ 8 Z ∼= Zm 8 mZ is isomorphic to a subgroup of index m in Z 8 Z. So if Z 8 Z had a
decidable submonoid membership problem for each finitely generated submonoid, then
the same would be true of ZΣ 8 Z. &
%
Theorem 6 together with the undecidability of the rational subset membership problem
for groups H8(Z×Z) for non-trivial H [23] implies the following: For finitely generated
non-trivial abelian groups G and H, H 8 G has a decidable rational subset membership
problem if and only if (i) G is finite3 or (ii) G has rank 1 and H is finite.
3
If G has size m, then by Prop. 1, H m ∼
= H m !1 is isomorphic to a subgroup of index m in H!G.
Since H m is finitely generated abelian and decidability of the rational subset membership is
preserved by finite extensions [12,17], decidability for H ! G follows.
Rational Subsets and Submonoids of Wreath Products 371
6 Open Problems
As mentioned in the introduction, the rational subset membership problem is undecid-
able for every wreath product H 8 (Z × Z), where H is a non-trivial group [23]. We
conjecture that for every non-trivial group H and every non-virtually free group G, the
rational subset membership problem for H 8 G is undecidable. The reason is that the
undecidability proof for H 8 (Z × Z) [23] only uses the grid-like structure of the Cayley
graph of Z × Z. In [19] it was shown that the Cayley graph of a group G has bounded
tree width if and only if the group is virtually free. Hence, if G is not virtually free,
then the Cayley-graph of G has unbounded tree width, which means that finite grids of
arbitrary size appear as minors in the Cayley-graph of G. One might therefore hope to
again reduce a tiling problem to the rational subset membership problem for H 8 G (for
H non-trivial and G not virtually free).
Another interesting case, which is not resolved by our results, concerns the rational
subset membership problem for wreath products G 8 V with V virtually free and G a
finitely generated infinite torsion group. Finally, all these questions can also be asked
for the submonoid membership problem. We do not know any example of a group with
decidable submonoid membership problem but undecidable rational subset membership
problem. If such a group exists, it must be one-ended [22].
References
1. Anisimov, A.V.: Group languages. Kibernetika 4, 18–24 (1971) (in Russian); English trans-
lation. Cybernetics 4, 594–601 (1973)
2. Benois, M.: Parties rationnelles du groupe libre. C. R. Acad. Sci. Paris, Sér. A 269,
1188–1190 (1969)
3. Chambart, P., Schnoebelen, P.: Post embedding problem is not primitive recursive, with appli-
cations to channel systems. In: Arvind, V., Prasad, S. (eds.) FSTTCS 2007. LNCS, vol. 4855,
pp. 265–276. Springer, Heidelberg (2007)
4. Cleary, S.: Distortion of wreath products in some finitely-presented groups. Pacific Journal
of Mathematics 228(1), 53–61 (2006)
5. Davis, T.C., Olshanskii, A.Y.: Subgroup distortion in wreath products of cyclic groups. Jour-
nal of Pure and Applied Algebra 215(12), 2987–3004 (2011)
6. Diekert, V., Muscholl, A.: Solvability of equations in free partially commutative groups is
decidable. International Journal of Algebra and Computation 16(6), 1047–1069 (2006)
7. Ehrenfeucht, A., Haussler, D., Rozenberg, G.: On regularity of context-free languages. Theor.
Comput. Sci. 27, 311–332 (1983)
8. Eilenberg, S., Schützenberger, M.P.: Rational sets in commutative monoids. Journal of Alge-
bra 13, 173–191 (1969)
9. Fernau, H., Stiebe, R.: Sequential grammars and automata with valences. Theor. Comput.
Sci. 276(1-2), 377–405 (2002)
372 M. Lohrey, B. Steinberg, and G. Zetzsche
10. Finkel, A., Schnoebelen, P.: Well-structured transition systems everywhere! Theor. Comput.
Sci. 256(1-2), 63–92 (2001)
11. Gilman, R.H.: Formal languages and infinite groups. In: Geometric and Computational Per-
spectives on Infinite Groups DIMACS Ser. Discrete Math. Theoret. Comput. Sci, vol. 25,
pp. 27–51. AMS (1996)
12. Grunschlag, Z.: Algorithms in Geometric Group Theory. PhD thesis, University of California
at Berkley (1999)
13. Haines, L.H.: On free monoids partially ordered by embedding. Journal of Combinatorial
Theory 6, 94–98 (1969)
14. Higman, G.: Ordering by divisibility in abstract algebras. Proceedings of the London Math-
ematical Society. Third Series 2, 326–336 (1952)
15. Jurdziński, T.: Leftist grammars are non-primitive recursive. In: Aceto, L., Damgård, I.,
Goldberg, L.A., Halldórsson, M.M., Ingólfsdóttir, A., Walukiewicz, I. (eds.) ICALP 2008,
Part II. LNCS, vol. 5126, pp. 51–62. Springer, Heidelberg (2008)
16. Kambites, M.: Formal languages and groups as memory. Communications in Algebra 37(1),
193–208 (2009)
17. Kambites, M., Silva, P.V., Steinberg, B.: On the rational subset problem for groups. Journal
of Algebra 309(2), 622–639 (2007)
18. Kunc, M.: Regular solutions of language inequalities and well quasi-orders. Theor. Comput.
Sci. 348(2–3), 277–293 (2005)
19. Kuske, D., Lohrey, M.: Logical aspects of Cayley-graphs: the group case. Annals of Pure and
Applied Logic 131(1–3), 263–286 (2005)
20. Lohrey, M., Sénizergues, G.: Theories of HNN-extensions and amalgamated products. In:
Bugliesi, M., Preneel, B., Sassone, V., Wegener, I. (eds.) ICALP 2006. LNCS, vol. 4052,
pp. 504–515. Springer, Heidelberg (2006)
21. Lohrey, M., Steinberg, B.: The submonoid and rational subset membership problems for
graph groups. Journal of Algebra 320(2), 728–755 (2008)
22. Lohrey, M., Steinberg, B.: Submonoids and rational subsets of groups with infinitely many
ends. Journal of Algebra 324(4), 970–983 (2010)
23. Lohrey, M., Steinberg, B.: Tilings and submonoids of metabelian groups. Theory Comput.
Syst. 48(2), 411–427 (2011)
24. Lohrey, M., Steinberg, B., Zetzsche, G.: Rational subsets and submonoids of wreath products.
arXiv.org (2013), http://arxiv.org/abs/1302.2455
25. Lyndon, R.C., Schupp, P.E.: Combinatorial Group Theory. Springer (1977)
26. Minsky, M.L.: Computation: Finite and Infinite Machines. Prentice-Hall International (1967)
27. Motwani, R., Panigrahy, R., Saraswat, V.A., Venkatasubramanian, S.: On the decidability of
accessibility problems (extended abstract). In: Proc. STOC 2000, pp. 306–315. ACM (2000)
28. Roman’kov, V.: On the occurence problem for rational subsets of a group. In: International
Conference on Combinatorial and Computational Methods in Mathematics, pp. 76–81 (1999)
29. Romanovskii, N.S.: Some algorithmic problems for solvable groups. Algebra i Logika 13(1),
26–34 (1974)
30. Romanovskii, N.S.: The occurrence problem for extensions of abelian groups by nilpotent
groups. Sibirsk. Mat. Zh. 21, 170–174 (1980)
31. Sakarovitch, J.: Elements of Automata Theory. Cambridge University Press (2009)
32. Schnoebelen, P.: Verifying lossy channel systems has nonprimitive recursive complexity. Inf.
Process. Lett. 83(5), 251–261 (2002)
Fair Subtyping for Open Session Types$
Luca Padovani
1 Introduction
Session types [7,8] describe the type, order, and direction of messages that can be
sent over channels. In essence, session types are simple CCS -like processes using a
reduced set of operators [3,1]: termination, external and internal choices respectively
guarded by input and output actions, and recursion. For example, the session type T =
μ x.(!buy.x ⊕ !pay) denotes a channel for sending an arbitrary number of buy messages
followed by a single pay message. The session type S = μ x.(?buy.x + ?pay.?vouch)
denotes a channel for receiving an arbitrary number of buy messages, or a single pay
message followed by a vouch message. We can describe a whole session in abstract
terms as the parallel composition of the types of its endpoint channels. For instance,
T | S | !vouch describes a session with a client that buys an arbitrary number of items
and then pays, a shop that serves the client, and a bank that vouches for the client. Ses-
sion type systems check that processes use session channels according to a session type.
As an example, the typing derivation below proves that the process rec X .k!m.X
sending the message m on channel k is well typed in the channel environment k : T
provided that “m is a message of type buy” (the exact interpretation of this property is
irrelevant):
[ VAR ]
m : buy X !→ {k : x}; k : x X
[ OUTPUT ]
X !→ {k : x}; k : !buy.x ⊕ !pay k!m.X
[ REC ]
k : μ x.(!buy.x ⊕ !pay) rec X .k!m.X
Rule [ REC ] opens the recursive session type T in correspondence with recursion in the
process and augments the process environment with the association X !→ {k : x}. In
this way, an occurrence of the process variable X in a channel environment where the
$ Full version http://www.di.unito.it/˜ padovani/Papers/OpenFairSubtyping.pdf.
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 373–384, 2013.
c Springer-Verlag Berlin Heidelberg 2013
374 L. Padovani
channel k has type x can be declared well typed. Rule [ OUTPUT ] checks that the output
performed by the process on channel k is allowed by the type of k. Finally, the residual
process after k!m is checked against the residual type of k after !buy.
It is worth noting that all session type systems admit a derivation like the one above
and that such derivation implicitly and crucially relies on the subtyping relation !buy.x⊕
!pay !buy.x saying that a channel of type !buy.x ⊕ !pay can be safely used where
a channel of type !buy.x is expected. Conventional works on subtyping for session
types [6,3,1] establish that is contravariant for outputs, thereby making the theory of
session types a conservative extension of the theory of channel types [11,4]. Nonethe-
less, it can be argued that this subtyping relation is inadequate. For instance, consider
the session described earlier as T | S | !vouch and observe that all non-terminated par-
ticipants retain the potential to make progress: it is always possible for the client to pay.
If that happens, the bank can send the vouch message to the shop, at which point all
participants terminate. Accepting the typing derivation above means allowing a client
that behaves according to μ x.!buy.x to interact with a shop and a bank that behave as
S | !vouch. In the session μ x.!buy.x | S | !vouch, however, the client never pays and the
liveness of the session with respect to the bank is compromised. This example proves
that the original subtyping relation for session types, for which !buy.x ⊕ !pay !buy.x
holds, is not liveness preserving in general: there exist a context C = μ x.[ ] and two
behaviors S | !vouch such that the session described by C [!buy.x ⊕ !pay] | S | !vouch
does have the liveness property while C [!buy.x] | S | !vouch does not.
The contribution of this work is the definition of a new subtyping relation, which
we dub fair subtyping, as the coarsest liveness-preserving refinement for possibly open
session types (like !buy.x ⊕ !pay and !buy.x above) that is a pre-congruence for all the
operators of the type language. With this definition in place, we can reject a derivation
like the one above because it is based on the law !buy.x⊕ !pay !buy.x which is invalid
for fair subtyping. It may be questioned whether dealing with open session types is
really necessary, given that the above derivation can also be reformulated as follows
[ VAR ]
m : buy X !→ {k : T }; k : T X
[ OUTPUT ]
X !→ {k : T }; k : !buy.T ⊕ !pay k!m.X
[ REC ]
k : T rec X .k!m.X
where T is unfolded (instead of being opened) by rule [ REC ] and associated with the
process variable X (this corresponds to using equi-recursive types, whereby a recur-
sive type and its unfolding are deemed equal). Now, this derivation should be rejected
just as the first one, with the difference that the second derivation relies on the law
!buy.T ⊕ !pay !buy.T . It turns out that this law holds even for fair subtyping, intu-
itively because there are only finitely many differences between (the infinite unfoldings
of) !buy.T and !pay !buy.T . In conclusion, we are not aware of alternative ways of
detecting such invalid derivations other than forbidding subsumption within recursions,
or using a theory of open session types like the one developed in the present paper.
A behavioral refinement called should-testing enjoying all the properties that we seek
for in fair subtyping has been extensively studied in [12]. There, should-testing is shown
to be the coarsest liveness-preserving pre-congruence of a process algebra considerably
richer than session types. Therefore, given the correspondence between session types
Fair Subtyping for Open Session Types 375
and processes, we could just take should-testing as the defining notion for fair subtyp-
ing. We find this shortcut unsatisfactory for several reasons: first, should-testing implies
trace equivalence between related processes. In our context, this would amount to re-
quiring invariance of outputs, essentially collapsing subtyping to type equality. Second,
no complete axiomatization is known for should-testing and its alternative characteri-
zation is based on a complex denotational model. As a consequence, it is difficult to
understand the basic laws that underlie should-testing. Third, the decision algorithm for
should-testing is linear exponential, that is remarkably more expensive compared to the
quadratic algorithm for the original subtyping [6]. Instead, by restricting the language
of processes to that of session types, we are able to show that:
– Fair subtyping is coarser than should-testing and does not imply trace equivalence.
– Fair subtyping admits a complete axiomatization obtained from that of the original
subtyping by plugging in a simple auxiliary relation in just two strategic places.
– Fair subtyping can be decided in O(n4 ) time.
In the rest of the paper we formalize session types as an appropriate subset of CCS
(Section 2) and define fair subtyping as the relation that preserves session liveness in
every context (Definition 2.2). Then, we provide a coinductive characterization of fair
subtyping that unveils its properties (Section 3). The pre-congruence property is subtle
to characterize because fair subtyping is context sensitive (two session types may or may
not be related depending on the context in which they occur). For example, we have seen
that !buy.x ⊕ !pay !buy.x and yet !buy.(!buy.x ⊕ !pay) ⊕ !pay !buy.!buy.x ⊕ !pay
despite the unrelated terms !buy.x ⊕ !pay and !buy.x occur in corresponding positions
in the latter pair of related session types. The coinductive characterization also paves
the way to the complete axiomatization of fair subtyping and to its decision algorithm
(Section 4). In turn, the axiomatization shows how to incrementally patch the original
subtyping for session types to ensure liveness preservation. A more detailed comparison
with related work is given in the conclusions (Section 5). Because of space constraints,
proofs of the results can only be found in the long version of the paper.
where the set I is always finite and non-empty and choices are deterministic, in the
sense that ai = a j implies i = j for every i, j ∈ I.
The term end denotes the type of channels on which no further operations are pos-
sible. We will often omit trailing occurrences of end. A term ∑i∈I ?ai .Ti is the type of
a channel for receiving a message in the set {ai }i∈I . According to the received mes-
(
sage ai , the channel must be used according to Ti afterwards. Terms i∈I !ai .Ti are
analogous, but they denote the type of channels that can be used for sending messages.
Note that output session types represent internal choices (the process using a chan-
nel with output type can choose any message in the set {ai }i∈I ) while input session
376 L. Padovani
[ T- PAR ] [ T- COMM ]
[ T- CHOICE ] [ T- INPUT ]
1 α α
k∈I k∈I M −→ M M −→ M 1 N −→ N 1
+ τ τ
∑ ?ai .Ti −−→ Tk
?ak
!ai .Ti −→ !ak .Tk M | N −→ M 1 | N M | N −→ M 1 | N 1
i∈I i∈I
types are external choices (the process using a channel with input type must be ready to
deal with any message in the set {ai }i∈I ). We will sometimes use an infix notation for
choices
(
writing ?a1 .T1 + · · · + ?an .Tn and !a1 .T1 ⊕ · · · ⊕ !an .Tn instead of ∑1≤i≤n ?ai .Ti
and 1≤i≤n !ai .Ti respectively. Terms μ x.T and x are used for building recursive session
types, as usual. We assume that session types are contractive, namely that they do not
contain subterms of the form μ x1 · · · μ xn .x1 . The notions of free and bound variables are
standard and so are the definitions of open and closed session types. We take an equire-
cursive point of view and identify session types modulo renaming of bound variables
and folding/unfolding of recursions. That is, μ x.T = T {μ x.T /x} where T {S/x} is the
capture-avoiding substitution of every free occurrence of x in T with S. We say that T
and S are strongly equivalent, notation T ≈ S, if their infinite unfoldings are the same
regular tree [5].
Sessions M, N, . . . are abstracted as parallel compositions of session types T , S, . . . ,
their grammar is:
M ::= T | (M | M)
We define the operational semantics of sessions by means of a labeled transition system
mimicking the actions performed by processes that behave according to session types
(in fact, we are abstracting processes into types). The transition system makes use of ac-
tions α of the form ?a and !a describing the input/output of a messages and labels that
are either actions or the invisible move τ . The transition system is defined in Table 1.
Rules [ T- OUTPUT ], [ T- CHOICE ], and [ T- INPUT ] deal with prefixed terms. The first and last
ones are standard. Rule [ T- CHOICE ] states that a process behaving according to the type
(
i∈I !ai .Ti may internally choose, through an invisible move τ , to send any message
from the set {ai }i∈I . Rule [ T- PAR ] (and its symmetric, omitted) propagates labels across
compositions while [ T- COMM ] is the synchronization rule between complementary ac-
tions resulting into an invisible move (we let ?a = !a and !a = ?a).
We use ϕ , ψ , . . . to range over strings of actions, ε to denote the empty string, and
τ
≤ to denote the usual prefix order between strings. We write =⇒ for the reflexive, tran-
τ α τ α τ
sitive closure of −→ and =⇒ for the composition =⇒−→=⇒. We extend this notation
α1 ···αn α1 αn
to strings of actions so that == =⇒ stands for the composition =⇒ · · · =⇒. We write
α ϕ α ϕ
T =⇒ (respectively T =⇒) if there exists S such that T =⇒ S (respectively T =⇒ S).
ϕ ϕ
We write T =⇒ if not T =⇒. We let tr(T ) denote the set of traces of T , namely
ϕ
tr(T ) = {ϕ | T =⇒}.
def
Fair Subtyping for Open Session Types 377
3 Fair Subtyping
We begin our study of fair subtyping by recalling the traditional subtyping relation for
session types, which we dub “unfair subtyping”.
378 L. Padovani
Clauses (1–2) state the reflexivity of U for end and type variables, while clauses (3–
4) respectively state invariance and contravariance of U with respect to external and
internal choices. There is no need for a clause dealing with recursive types, because
type equality already accounts for their unfolding and types are contractive. Unfair sub-
typing is essentially the standard subtyping relation for session types presented in [6].1
The appeal for unfair subtyping comes from its simplicity and intuitive rationale. The
key clause (4) states that the larger session type allows in general for fewer kinds of
messages to be sent: when T U S, a process behaving as S can be safely placed in a
context where a process behaving as T is expected because S expresses a more deter-
ministic behavior compared to T . Reducing non-determinism is generally perceived as
harmless, but sometimes it may compromise liveness.
Example 3.1. Consider the session types T = !a.x ⊕ !b and S = !a.x and the context
C = μ x.[ ]. Then both {(T, S), (x, x)} and {(C [T ], C [S])} are coinductive subtyping
relations, from which we deduce T U S and C [T ] U C [S]. Yet Example 2.2 shows
that neither C [T ] C [S] nor T S do hold.
Unfair subtyping is a necessary but not sufficient condition for fair subtyping.
Theorem 3.1. U .
Note that T U S implies tr(T ) ⊇ tr(S) and that U may compromise session success
by letting S have “too few” traces compared to T (Example 3.1). Therefore, Theo-
rem 3.1 suggests that fair subtyping should be characterized as a restriction of Defini-
tion 3.1 where we impose additional conditions to clause (4). The condition tr(T ) ⊆
tr(S) is clearly sufficient but too strong: it imposes invariance of fair subtyping with
respect to outputs, collapsing fair subtyping to equality. Nonetheless, we will show that,
when T S, there must be an “inevitable” pair of corresponding states at some “finite
distance” from T and S for which trace inclusion holds. We formalize this property say-
ing that T converges into S. The precise definition of convergence is subtle because T
and S may be open: we must be able to reason on the property of trace inclusion be-
tween corresponding states of T and S by considering the possibility that T and S occur
in a context that binds (some of) their free variables.
We begin by introducing a notation for referring to the residual state of a session type
after some sequence of actions.
Definition 3.2 (Continuation). Let α ∈ tr(T ). The continuation of T after α is the ses-
ε α
sion type S such that T =⇒−→ S (note that S is uniquely determined because branches
in session types are guarded by distinct actions). We extend the notion of continuation
to sequences of actions so that T (ε ) = T and T (αϕ ) = T (α )(ϕ ) when αϕ ∈ tr(T ).
1 In practice, subtyping can be relaxed so that it is covariant with respect to external choices [6].
This difference between unfair and standard subtyping does not affect our results.
Fair Subtyping for Open Session Types 379
and it is easy to observe that its base case corresponds to the condition tr(T ) \ tr(S) =
/ that is tr(T ) ⊆ tr(S). Now, suppose T . S and imagine some session M composed
0,
with either T or S whose aim is to tell T and S apart in the sense that M succeeds
(emitting !OK) as soon as it enters some trace of T that is not present in S. In order
to achieve its goal, M will try to drive the interaction with T along some path ϕ ∈
tr(T ) \ tr(S). Rule (2) says that after following some prefix ψ of ϕ that is shared by
both T and S, M encounters an internal choice having a branch (corresponding to some
action !a) that may divert the interaction to a new stage where the residual behaviors
of T and S (respectively T (ψ !a) and S(ψ !a)) have sets of traces that are slightly less
different. We say “slightly less different” because T (ψ !a) and S(ψ !a) are one step
closer to the top of the derivation of T . S, whose leaves imply trace inclusion. Since
convergence is defined inductively, this means that T and S are a finite number of steps
away from the point where trace inclusion holds. In conclusion, when T . S holds, it
is impossible for M to solely rely on the traces in tr(T ) \ tr(S) in order to succeed; M
can always be veered into a stage of the interaction where (some corresponding states
of) T and S are no longer distinguishable as the traces of (such corresponding states of)
T and S are the same.
Example 3.2. Take T = μ x.(!a.x ⊕ !b) and S = μ x.(!a.!a.x ⊕ !b) and observe that
tr(T )\tr(S) is the language of strings generated by the regular expression !a(!a!a)∗ !b.
Given an arbitrary string in tr(T ) \ tr(S) we can take ψ = ε and we have T (!b) =
S(!b) = end where end . end, so we can conclude T . S.
Example 3.3. Consider again the session types T = μ x.(!a.x ⊕ !b) and S = μ x.!a.!a.x
and recall that in Example 3.1 we showed T U S. Let us try to build a derivation
for T . S. Note that tr(T ) \ tr(S) is the language of strings generated by the regular
expression (!a)∗ !b. Taken ϕ ∈ tr(T ) \ tr(S) we have that any prefix ψ of ϕ that is in
tr(T )∩tr(S) has the form !a · · · !a and now T (ψ !a) = T and S(ψ !a) = S. Therefore, in
order to prove T . S, we need a derivation for T . S. Since convergence is an inductive
relation, T . S is not derivable which agrees with the fact that these two session types
are not related by fair subtyping.
380 L. Padovani
We can now turn our attention to the general definition of .X;Y , whose base case
adds the condition Y -tr(S) = 0/ to trace inclusion that we have discussed earlier. First
of all, observe that the naive extension of . with the axiom x . x, whereby every vari-
able x converges into itself, fails to yield a pre-congruence for recursion. For example,
according to this extension we would have !a.x ⊕ !b . !a.x and yet Example 3.3 shows
that μ x.(!a.x ⊕ !b) . μ x.!a.x. It is the context in which a type variable x occurs that
determines whether or not x converges into itself:
– If x only lies along traces that do not distinguish T from S then it is safe, in the
sense that cycles created by contexts binding x do not allow sensing any difference
between T and S.
– If x lies along a path that distinguishes T from S then it is dangerous, because cycles
created by contexts binding x may enable such difference to be sensed.
In the general definition of convergence, the two sets X and Y respectively contain the
variables that are assumed to be safe (but that may be found to be dangerous at some
later stage while proving convergence) and the variables that are known to be dangerous.
Whenever a trace that distinguishes T from S is discovered (ϕ ∈ (tr(T ) \ tr(S))), the
safe variables become dangerous ones. The condition Y -tr(S) = 0/ then restricts the
application of the axiom x . x to safe variables.
Example 3.4. Take T = !a.(!a.x ⊕ !b.end) ⊕ !b.end and S = !a.!a.x ⊕ !b.end which
are obtained from the session types in Example 3.2 by possibly unfolding and then
opening recursions. Note that the variable x is dangerous because it lies along the
trace !a!a which goes through corresponding states of T and S which differ, indeed
tr(T ) \ tr(S) = {!a!b}. However, we can divert from the trace !a!b by taking ψ = ε
and now we have T (!b) = S(!b) = end where end .0;{x}
/ end, so T .{x};0/ S.
Example 3.5. Let T = !a.(!a.x ⊕ !b.end) ⊕ !b.end and S = !a.!a.x and let us try to build
a derivation for T .{x};0/ S. Note that tr(T ) \ tr(S) = {!b, !a!b}. The prefixes of any
ϕ ∈ tr(T ) \ tr(S) that are in tr(T ) ∩ tr(S) are either ε or !a. If we take the prefix
ψ = !a, we have T (!a!a) = S(!a!a) = x and now x .0;{x}/ x. If we take the prefix ψ =
ε , we have T (!a) = !a.x ⊕ !b.end and S(!a) = !a.x and also in this case we deduce
T (!a) .0;{x}
/ S(!a) by iterating a similar argument. Therefore we conclude T .{x};0/ S
which was expected since from Example 3.3 we knew that μ x.T . μ x.S.
From now on, we will often write .X as an abbreviation for .X;0/ . The key property of
the X set of safe variables is formalized thus:
Lemma 3.1. T .X∪{x} S implies μ x.T .X μ x.S.
In words, the variables in X can be safely bound by a recursive context without com-
promising convergence. We now show the characterization of fair subtyping:
[ F - REC ]
[ F - END ] [ F - VAR ] T F S T {x};0/ S
end F end x F x
μ x.T F μ x.S
(3) T = ∑
(i∈I ?ai .Ti and S = ∑i∈I / Ti , Si ) ∈ F for every i ∈ I, or
(?ai .Si and (0,
/ Ti , Si ) ∈ F for every i ∈ I.
(4) T = i∈I∪J !ai .Ti and S = i∈I !ai .Si and (0,
We write T X S if (X, T, S) ∈ F for some coinductive fair subtyping F .
Theorem 3.2. = V
Structurally, Definition 3.4 and Definition 3.1 are very similar. The key difference be-
tween T U S and T X S is that in the latter T .X S must also hold. Note that, when
checking that the continuations Ti and Si are related, the set of safe variables is emp-
tied. This twist is motivated by the fact that applying a context μ x.[ ] around T creates
a cycle that necessarily goes through the initial state of T while no context applied to
T can create loops “within” T . This property makes context sensitive: consider for
example the session types T = !a.x ⊕ !b and S = !a.x and the context C = !a.[ ] ⊕ !b and
note that C does not bind the variable x. Now we have C [T ] .{x} C [S] while T .{x} S.
Therefore C [T ] C [S] even if T S.
T {x};0/ S that verifies whether it is safe to close T and S with the context μ x.[ ] (see
Lemma 3.1). Fair subtyping is defined by [ A - SUBT ], which is basically Theorem 3.2 in
the form of inference rule. The axiomatization of convergence includes a core set of
rules where [ C - END ], [ C - INPUT ], and [ C - OUTPUT 1] enforce trace inclusion (condition
tr(T ) ⊆ tr(S) in (1)) and rule [ C - VAR ] checks that x is not a dangerous variable (con-
dition Y -tr(S) = 0/ in (1)). Rule [ C - OUTPUT 2] deals with the case in which the larger
session type provides strictly fewer choices with respect to the smaller one and corre-
sponds to the “existential part” of the rule (1). In this case, there must be a common
branch (k ∈ I) such that the corresponding continuations are in the convergence rela-
tion where all the safe variables have become dangerous ones (Tk .0;X∪Y / Sk ). Finally,
rule [ C - REC ] deals with recursive contexts μ x.[ ] by recording x as a safe variable.
The presented axiomatization is complete when session types have recursive terms
binding the same variable in corresponding positions. We do not regard this as a lim-
itation, though, because when T S it is always possible to find T 1 and S1 that are
strongly equivalent to T and S for which this property holds. For example, it is not possi-
ble to derive μ x.!a.x A μ x.!a.!a.x using the rules in Table 2, but μ x.!a.x A μ x.!a.x ≈
μ x.!a.!a.x. On the contrary, making this assumption allows us to focus on the interesting
aspects of the axiomatization by leaving out some well-understood
technicalities [2].
We briefly discuss an algorithm for deciding fair subtyping based on its axiomatiza-
tion. The only two rules in Table 2 that are not syntax directed are [ C - OUTPUT 1] and
[ C - OUTPUT 2] when J \ I = 0/ because the sets of variables may or may not change
when going from the conclusion to the premise of these rules. A naive algorithm would
have to backtrack in case the wrong choice is made, leading to exponential complex-
ity. Table 3 presents an alternative set of syntax-directed rules for convergence. Space
constraints prevent us from describing them in detail, but the guiding principle of these
rules is simple: a judgment T #X S Y synthesizes, whenever possible, the smallest
subset Y of X such that T Y ;X\Y S holds. This way, in [ AC - OUTPUT 1] and [ AC - OUTPUT
2] the index set X does not change from the conclusion to the premises, so the algo-
rithm can just recur and then verify whether Tk #X Sk 0/ for some branch k ∈ I: if this
is the case, then [ AC - OUTPUT 2] applies; if not and J \ I = 0,
/ then [ AC - OUTPUT 1] applies;
otherwise, the algorithm fails. This new set of rules is sound and complete:
Regarding the complexity of the proposed algorithm, observe that convergence can be
decided in linear time using the rules in Table 3 and that, in Table 2, only [ F - REC ] and [ A -
SUBT ] duplicate work. Moreover, rule [ A - SUBT ] is needed only once for each derivation.
Therefore, the algorithm for fair subtyping is quadratic in the size of the proof tree for
Fair Subtyping for Open Session Types 383
[ AC - REC ]
[ AC - END ] [ AC - VAR ] T #X ∪{x} S Y
end #X end 0/ x #X x {x} ∩ X
μ x.T #X μ x.S Y \ {x}
T 1 A S1 , which is the same as S1 (the number of distinct subtrees in S1 ). Since S1 in
the (constructive) proof of Theorem 4.2 is bound by T · S, the overall complexity
for deciding T S is O(n4 ) where n = max{T , S}.
refinements to open terms is a challenging task with substantial impact on the proper-
ties of such refinements (this extension was left as an open problem in [9] and it was
discovered to induce trace equivalence in [12]). By contrast, fair subtyping for open
session types does not induce trace equivalence and turns out to be an original liveness-
preserving pre-congruence that is not investigated elsewhere. Moreover, in the present
work we purposefully adopt a notion of “session correctness” (Definition 2.1) that is
weaker (i.e. more general) than the analogous notion in [10]. Since fair subtyping is
defined as the relation that preserves success (Definition 2.2), the net effect is that the
results presented here apply to all session type theories based on stronger notions of ses-
sion correctness. Technically, the consequence is that all session types are inhabited and
therefore the technique described in [10] based on session type difference is no longer
applicable. By contrast, here we are able to give a direct definition of convergence with
no need for auxiliary operators or notions of type emptiness.
References
1. Barbanera, F., de’Liguoro, U.: Two notions of sub-behaviour for session-based client/server
systems. In: Kutsia, T., Schreiner, W., Fernández, M. (eds.) PPDP 2010, pp. 155–164. ACM
(2010)
2. Brandt, M., Henglein, F.: Coinductive axiomatization of recursive type equality and subtyp-
ing. Fundamenta Informaticae 33(4), 309–338 (1998)
3. Castagna, G., Dezani-Ciancaglini, M., Giachino, E., Padovani, L.: Foundations of session
types. In: Porto, A., López-Fraguas, F.J. (eds.) PPDP 2009, pp. 219–230. ACM (2009)
4. Castagna, G., De Nicola, R., Varacca, D.: Semantic subtyping for the pi-calculus. Theoretical
Computer Science 398(1-3), 217–242 (2008)
5. Courcelle, B.: Fundamental properties of infinite trees. Theoretical Computer Science 25,
95–169 (1983)
6. Gay, S., Hole, M.: Subtyping for session types in the π -calculus. Acta Informatica 42(2-3),
191–225 (2005)
7. Honda, K.: Types for dyadic interaction. In: Best, E. (ed.) CONCUR 1993. LNCS, vol. 715,
pp. 509–523. Springer, Heidelberg (1993)
8. Honda, K., Vasconcelos, V.T., Kubo, M.: Language primitives and type disciplines for
structured communication-based programming. In: Hankin, C. (ed.) ESOP 1998. LNCS,
vol. 1381, pp. 122–138. Springer, Heidelberg (1998)
9. Natarajan, V., Cleaveland, R.: Divergence and fair testing. In: Fülöp, Z. (ed.) ICALP 1995.
LNCS, vol. 944, pp. 648–659. Springer, Heidelberg (1995)
10. Padovani, L.: Fair Subtyping for Multi-Party Session Types. In: De Meuter, W., Roman,
G.-C. (eds.) COORDINATION 2011. LNCS, vol. 6721, pp. 127–141. Springer, Heidelberg
(2011)
11. Pierce, B., Sangiorgi, D.: Typing and subtyping for mobile processes. Mathematical Struc-
tures in Computer Science 6(5), 409–453 (1996)
12. Rensink, A., Vogler, W.: Fair testing. Information and Computation 205(2), 125–198 (2007)
Coeffects: Unified Static Analysis
of Context-Dependence
University of Cambridge, UK
{tp322,dao29,am}@cl.cam.ac.uk
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 385–397, 2013.
© Springer-Verlag Berlin Heidelberg 2013
386 T. Petricek, D. Orchard, and A. Mycroft
logic perspective, but can be captured as coeffect systems (§1) – the tracking of
implicit dynamically-scoped parameters (or resources), analysis of variable live-
ness, and tracking the number of required past values in dataflow computations.
Coeffect Calculus. Informed by the examples, we identify a general algebraic
structure for coeffects. From this, we define a general coeffect calculus that unifies
the motivating examples (§2) and discuss its syntactic properties (§4).
Indexed Comonads. Our categorical semantics (§3) extends the work of
Uustalu and Vene [14]. By adding annotations, we generalize comonads to in-
dexed comonads, which capture notions of computation not captured by ordinary
comonads.
1 Motivation
Effect systems, introduced by Gifford and Lucassen [5], track effects of com-
putations, such as memory access or message-based communication [6]. Their
approach augments typing judgments with effect information: Γ e : τ, F . In
Moggi’s semantics, well-typed terms Γ e : τ are mapped to morphisms Γ →
M τ where M encodes effects and has the structure of a monad [8]. Wadler and
Thiemann annotate monads with effect information, written M F [17].
In contrast to the analysis of effects, our analysis of context-dependence dif-
fers in the treatment of lambda abstraction. Wadler and Thiemann explain that
“in the rule for abstraction, the effect is empty because evaluation immediately
returns the function, with no side effects. The effect on the function arrow is
the same as the effect for the function body, because applying the function will
have the same side effects as evaluating the body” [17]. We instead consider sys-
tems where λ-abstraction places requirements on both the call-site (latent re-
quirements) and declaration-site (immediate requirements), resulting in different
program properties. We informally discuss three examples that demonstrate how
contextual requirements propagate. Section 2 unifies these in a single calculus.
We write coeffect judgements C s Γ e : τ where the coeffect annotation s
associates context requirements with the free-variable context Γ . Function types
have the form C s τ1 → τ2 associating latent coeffects s with the parameter. The
C s Γ syntax and C s τ types are a result of the indexed comonadic semantics (§3).
Implicit Parameters and Resources. Implicit parameters [7] are
dynamically-scoped variables. They can be used to parameterize a computation
without propagating arguments explicitly through a chain of calls and are part of
the context in which expressions evaluate. As correctly expected [7], they can be
modelled by comonads. Rebindable resources in distributed computations (e.g.,
a local clock) follow a similar pattern, but we discuss implicit parameters for
simplicity.
The following function prints a number using implicit parameters ?culture
(determining the decimal mark) and ?format (the number of decimal places):
The coeffect system infers multiple, i.e. non-principal, coeffects for functions.
Different judgments are desirable depending on how a function is used. In the
first case, both parameters have to be provided by the caller. In the second,
both are available at declaration-site, but ?format may be rebound (the precise
meaning is provided by the semantics, discussed in §3).
Implicit parameters can be captured by the reader monad, where parameters
are associated with the function codomain M ∅ (int → M {?culture,?format} string),
modelling only the first case. Whilst the reader monad can be extended to model
rebinding, the next example cannot be structured by any monad.
x:τ ∈Γ C mΓ e1 : C p τ1 → τ2 C n Γ e2 : τ1
(var ) (app)
C 0Γ x : τ C max(m,n+p) Γ e1 e2 : τ2
The (app) rule can be understood by discussing its semantics. Consider seman-
tic functions f, g, h annotated by r, s, t respectively. The sequential composition
g ◦ f is live in its parameter only when both f and g are live. In the coeffect
semantics, f is not evaluated if g ignores its parameter (regardless of evaluation
order). Thus, g ◦ f is annotated by conjunction r % s (where L % L = L). A point-
wise composition of g and h, passing the same parameter to both, is live in its
parameter if either g or h is live (i.e., disjunction s & t). Application uses both
compositions, thus Γ is live if it is needed by e1 or by the function and by e2 .
An (abs) rule (not shown) compatible with the structure in Fig. 1 combines
the context annotations using %. Thus, if the body uses some variables, both the
function argument and the context of the declaration-site are marked as live.
The coeffect system thus provides a call-by-name-style semantics, where re-
dundant computations are omitted. Liveness cannot be modelled using monads
with denotations τ1 → M r τ2 . In call-by-value languages, the argument τ1 is al-
ways evaluated. Using indexed comonads (§3), we model liveness as a morphism
C r τ1 → τ2 where C r is the parametric type Maybe τ = τ + 1 (which contains a
value τ when r = L and does not contain value when r = D).
The generalized coeffect calculus captures the three motivating examples (§1),
where some operators of the coeffect algebra may coincide.
The ⊕ operator represents sequential composition; guided by the categorical
model (§3), we require it to form a monoid with e. The operator ∨ corresponds to
merging of context requirements in pointwise composition and the semi-lattice
(S, ∨) defines a partial order: r ≤ s when r ∨ s = s. This ordering implies a
sub-coeffecting rule. The coeffect e is often the top or bottom of the lattice.
The ∧ operator corresponds to splitting requirements of a function body be-
tween the call- and definition-site. This operator is unrestricted in the general
system, though it has additional properties in some coeffects systems, e.g., semi-
lattice structure on ∧. Possibly these laws should hold for all coeffect systems,
but we start with as few laws as possible to avoid limiting possible uses of the
calculus. We consider constrained variants with useful properties later (§4).
Implicit parameters use sets of names S = P(Id) as tags with union ∪ for all
three operators. Variable use is annotated with e = ∅ and ≤ is subset ordering.
Liveness uses a two point lattice S = {D, L} where D . L. Variables are anno-
tated with the top element e = L and constants with bottom D. The ∨ operation
is & (join) and ∧ and ⊕ are both % (meet).
390 T. Petricek, D. Orchard, and A. Mycroft
x:τ ∈Γ CrΓ e1 : C t τ1 → τ2 C s Γ e2 : τ1
(var ) (app)
CeΓ x : τ C r∨(s⊕t)
Γ e1 e2 : τ2
† † † †
εx=x fD,D x = () fD,L x = f () fL,D x = () fL,L x=f x
The indexed family C r here is analogous to the non-indexed Maybe (or option)
data type Maybe A = A + 1. This type does not permit a comonad structure
since ε : Maybe A → A is undefined at (inr ()). For the indexed comonad, ε need
only be defined for C L A = A. Thus, indexed comonads capture a broader range
of contextual notions of computation than comonads.
Moreover, indexed comonads are not restricted by the shape preservation
property of comonads [11]: that a coextended function cannot change the shape
†
of the context. For example, in the second case above fD,L : C D A → C L B where
the shape changes from 1 (empty context) to B (available context).
392 T. Petricek, D. Orchard, and A. Mycroft
Example 4. Uustalu and Vene model causal dataflow computations using the
non-empty list comonad NEList A = A×(1+NEList A) [14]. Whilst this comonad
implies a trivial indexed comonad, we define an indexed comonad with integer
indices for the number of past values demanded of the context.
We define C n A = A × (A × . . . × A) where the first A is the current (always
available) value, followed by a finite product of n past values. The definition of
the operations is a straightforward extension of the work of Uustalu and Vene.
The semantics of variable use and abstraction are the same as in Uustalu and
Vene’s semantics, modulo coeffects. Abstraction uses mr,s to merge the outer
context with the argument context for the context of the function body. The
indices of e for ε and r, s for mr,s match the coeffects of the terms. The semantics
of application is more complex. It first duplicates the free-variable values inside
the context and then splits this context using nr,s⊕t . The two contexts (with
different coeffects) are passed to the two sub-expressions, where the argument
subexpression, passed a context (s ⊕ t), is coextended to produce a context
t which is passed into the parameter of the function subexpression (cf. given
f : A → (B → C), g : A → B, then uncurry f ◦ (id × g) ◦ Δ : A → C).
A semantics for sub-coeffecting is omitted, but may be provided by an op-
eration ιr,s : C r A → C s A natural in A, for all r, s ∈ S where s ≤ r, which
transforms a value C r A to C s A by ignoring some of the encoded context.
CsΓ e1 : τ1 C r (Γ, x : τ1 ) e2 : τ2
(2)
C Γ let x = e1 in e2 : τ2
r∨(r⊕s)
For our examples (but not necessarily all coeffect systems), this defines a more
“precise” coeffect with respect to ≤ where r ∨ (r ⊕ s) ≤ r1 ∨ (r2 ⊕ s).
This rule removes the non-principality of the first rule (i.e., multiple possible
typings). However, using idempotency to split coeffects in abstraction would
remove additional flexibility needed by the implicit parameters example.
394 T. Petricek, D. Orchard, and A. Mycroft
The coeffect r ∨ (r ⊕ s) can also be simplified for all our examples, leading to
more intuitive rules – for implicit parameters r ∪ (r ∪ s) = r ∪ s; for liveness we
get that r & (r % s) = r and for dataflow we obtain max(r, r + s) = r + s.
Our calculus can be extended with let -binding and (2). However, we also
consider the cases when a syntactic substitution e2 [x ← e1 ] has the coeffects
specified by the above rule (2) and prove subject reduction theorem for certain
coeffect calculi. We consider two common special cases when the coeffect of
variables e is the greatest (+) or least (⊥) element of the semi-lattice (S, ∨) and
derive additional properties that hold about the coeffect algebra:
Proof. By induction over , using the laws (§2) and additional assumptions. %
&
The above theorem holds for both the liveness and resources examples, but not
for dataflow. In the case of liveness, e is the greatest element (r ∨ e = e); in
the case of resources, e is the least element (r ∨ e = r) and the proof relies on
the fact that additional context requirements can be placed at the context C r Γ
(without affecting the type of function when substituted under λ-abstraction).
However, the coeffect calculus also captures context-dependence in languages
with more complex evaluation strategies than call-by-name reduction based on
syntactic substitution. In particular, syntactic substitution does not provide a
suitable evaluation for dataflow (because a substituted expression needs to cap-
ture the context of the original scope).
Nevertheless, the above results show that – unlike effects – context-dependent
properties can be integrated with call-by-name languages. Our work also provides
a model of existing work, namely Haskell implicit parameters [7].
This paper follows the approaches of effect systems [5,13,17] and categorical
semantics based on monads and comonads [8,14]. Syntactically, coeffects differ
Coeffects: Unified Static Analysis of Context-Dependence 395
from effects in that they model systems where λ-abstraction may split contextual
requirements between the declaration-site and call-site.
Our indexed (monoidal) comonads (§3) fill the gap between (non-indexed)
(monoidal) comonads of Uustalu and Vene [14] and indexed monads of Atkey [2],
Wadler and Thiemann [17]. Interestingly, indexed comonads are more general
than comonads, capturing more notions of context-dependence (§1).
Comonads and Modal Logics. Bierman and de Paiva [3] model the modal-
ity of an intuitionistic S4 modal logic using monoidal comonads, which links our
calculus to modal logics. This link can be materialized in two ways.
Pfenning et al. and Nanevski et al. derive term languages using the Curry-
Howard correspondence [12,3,9], building a metalanguage (akin to Moggi’s
monadic metalanguage [8]) that includes as a type constructor. For example,
in [12], the modal type τ represents closed terms. In contrast, the semantic
approach uses monads or comonads only in the semantics. This has been em-
ployed by Uustalu and Vene and (again) Moggi [8,14]. We follow the semantic
approach.
Nanevski et al. extend an S4 term language to a contextual modal type theory
(CMTT) [9]. The context is a set of variables required by a computation, which
makes CMTT useful for meta-programming and staged computations. Our con-
textual types are indexed by a coeffect algebra, which is more general and can
capture variable contexts, but also integers, two-point lattices, etc..
The work on CMTT suggests two extensions to coeffects. The first is develop-
ing the logical foundations. We briefly considered special cases of our system that
permits local soundness in §4; local completeness can be treated similarly. The
second is developing a coeffect metalanguage. The use of coeffect algebras pro-
vides an additional flexibility over CMTT, allowing a wider range of applications
via a richer metalanguage.
Relating Effects and Coeffects. The difference between effects and coeffects
is mainly in the (abs) rule. While the semantic models (monads vs. comonads)
are different, they can be extended to obtain equivalent syntactic rules. To allow
splitting of implicit parameters in lambda abstraction, the reader monad needs
an operation that eagerly performs some effects of a function: (τ1 → M r⊕s τ2 ) →
M r (τ1 → M s τ2 ). To obtain a pure lambda abstraction for coeffects, we need to
restrict the mr,s operation of indexed comonads, so that the first parameter is
annotated with e (meaning no effects): C e A × C r B → C r (A × B).
The context requirements associated with function are exactly those linked to the
specific variable of the lambda abstraction. Rules such as contraction manipulate
variables and perform a corresponding operation on the indices.
The structural coeffect system is related to bunched typing [10] (but general-
izes it by adding indices). We are currently investigating how to use structural
coeffects to capture fine-grained context-dependence properties such as secure
information flow [15] or, more generally, those captured by the dependency core
calculus [1].
6 Conclusions
We examined three simple calculi with associated coeffect systems (liveness anal-
ysis, implicit parameters, and dataflow analysis). These were unified in the coef-
fect calculus, providing a general coeffect system parameterised by an algebraic
structure describing propagation of context requirements throughout a program.
We model the semantics of the coeffect calculus using the indexed (monoidal)
comonad structure – a novel structure, which is more powerful than (monoidal)
comonads. Indices of the indexed comonad operations manifest the semantic
propagation of context so that the propagation of information in the general
coeffect type system corresponds exactly to the semantic propagation of context
in our categorical model.
We consider the analysis of context to be essential, not least for the examples
here but also given increasingly rich and diverse distributed systems.
References
1. Abadi, M., Banerjee, A., Heintze, N., Riecke, J.G.: A core calculus of dependency.
In: Proceedings of POPL (1999)
2. Atkey, R.: Parameterised notions of computation. J. Funct. Program. 19 (2009)
3. Bierman, G.M., de Paiva, V.C.V.: On an intuitionistic modal logic. Studia Log-
ica 65, 2000 (2001)
4. Filinski, A.: Monads in action. In: Proceedings of POPL (2010)
5. Gifford, D.K., Lucassen, J.M.: Integrating functional and imperative programming.
In: Proceedings of Conference on LISP and func. prog., LFP 1986 (1986)
6. Jouvelot, P., Gifford, D.K.: Communication Effects for Message-Based Concur-
rency. Technical report, Massachusetts Institute of Technology (1989)
7. Lewis, J.R., Shields, M.B., Meijert, E., Launchbury, J.: Implicit parameters: dy-
namic scoping with static types. In: Proceedings of POPL, POPL 2000 (2000)
8. Moggi, E.: Notions of computation and monads. Inf. Comput. 93, 55–92 (1991)
9. Nanevski, A., Pfenning, F., Pientka, B.: Contextual modal type theory. ACM
Trans. Comput. Logic 9(3), 23:1–23:49 (2008)
Coeffects: Unified Static Analysis of Context-Dependence 397
10. O’Hearn, P.: On bunched typing. J. Funct. Program. 13(4), 747–796 (2003)
11. Orchard, D., Mycroft, A.: A Notation for Comonads. In: Post-Proceedings of IFL
2012. LNCS. Springer, Heidelberg (2012) (to appear)
12. Pfenning, F., Davies, R.: A judgmental reconstruction of modal logic. Mathemati-
cal. Structures in Comp. Sci. 11(4), 511–540 (2001)
13. Talpin, J., Jouvelot, P.: The type and effect discipline. In: Logic in Computer
Science, 1992. LICS, pp. 162–173 (1994)
14. Uustalu, T., Vene, V.: Comonadic Notions of Computation. Electron. Notes Theor.
Comput. Sci. 203, 263–284 (2008)
15. Volpano, D., Irvine, C., Smith, G.: A sound type system for secure flow analysis.
J. Comput. Secur. 4, 167–187 (1996)
16. Wadge, W.W., Ashcroft, E.A.: LUCID, the dataflow programming language. Aca-
demic Press Professional, Inc., San Diego (1985)
17. Wadler, P., Thiemann, P.: The marriage of effects and monads. ACM Trans. Com-
put. Logic 4, 1–32 (2003)
Proof Systems for Retracts in Simply Typed
Lambda Calculus
Colin Stirling
School of Informatics
University of Edinburgh
[email protected]
1 Introduction
Type ρ is a retract of type τ if there are functions C : ρ → τ and D : τ → ρ
with D ◦ C = λx.x. This paper concerns retracts in the case of simply typed
lambda calculus [1]. Various questions can be asked. The decision problem is:
given ρ and τ , is ρ a retract of τ ? Is there an independent characterisation of
when ρ is a retract of τ ? Is there an inductive method, such as a proof system, for
deriving assertions of the form “ρ is a retract of τ ”? If so, can one also construct
(inductively) the witness functions C and D?
Bruce and Longo [2] provide a simple proof system that solves when there are
retracts in the case that D ◦ C =β λx.x. The problem is considerably more diffi-
cult if β-equality is replaced with βη-equality. De Liguoro, Piperno and Statman
[3] show that the retract relation with respect to βη-equality coincides with the
surjection relation: ρ is a retract of τ iff for any model there is a surjection from
τ to ρ. They also provide a proof system for the affine case (when each variable
in C and D occurs at most once) assuming a single ground type. Regnier and
Urzyczyn [9] extend this proof system to cover multiple ground types. The proof
systems yield simple inductive nondeterministic algorithms belonging to NP for
deciding whether ρ is an affine retract of τ . Schubert [10] shows that the problem
of affine retraction is NP-complete and how to derive witnesses C and D from
the proof system in [9]. Under the assumption of a single ground type, decid-
ability of when ρ is a retract of τ is shown by Padovani [8] by explicit witness
construction (rather than by a proof system) of a special form.
More generally, decidability of the retract problem follows from decidability
of higher-order matching in simply typed lambda calculus [13]: ρ is a retract of τ
iff the equation λz ρ .xτ1 →ρ (xρ→τ
2 z) =βη λz ρ .z has a solution (the witnesses D and
C for x1 , x2 ). Since the complexity of matching is non-elementary [15] this de-
cidability result leaves open whether there is a better algorithm, or even a proof
1
For a full version see http://www.homepages.inf.ed.ac.uk/cps/ret.pdf
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 398–409, 2013.
c Springer-Verlag Berlin Heidelberg 2013
Proof Systems for Retracts in Simply Typed Lambda Calculus 399
system, for the problem. In the case of β-equality matching is no guide to solv-
ability: the retract problem is simply solvable whereas β-matching is undecidable
[4].
In this paper we provide an independent solution to the retract problem. We
show it is decidable by exhibiting sound and complete tableau proof systems.
We develop two proof systems for retracts, one for the (slightly easier) case when
there is a single ground type and the other for when there are multiple ground
types. Both proof systems appeal to paths in terms. Their correctness depend
on properties of such paths. We appeal to a dialogue game between witnesses of
a retract to prove such properties: a similar game-theoretic characterisation of
β-reduction underlies decidability of matching.
In Section 2 we introduce retracts in simply typed lambda calculus and fix
some notation for terms as trees and for their paths. The two tableau proof
systems for retracts are presented in Section 3 where we also briefly examine
how they generate a decision procedure for the retract problem. In Section 4 we
sketch the proof of soundness of the tableau proof systems (and completeness
and further details are provided in the full version).
2 Preliminaries
Simple types are generated from ground types using the binary function operator
→. We let a, b, o, . . . range over ground types and ρ, σ, τ, . . . range over simple
types. Assuming → associates to the right, so ρ → σ → τ is ρ → (σ → τ ), if a
type ρ is not a ground type then it has the form ρ1 → . . . → ρn → a. We say
that a is the target type of a and of any type ρ1 → . . . → ρn → a.
Simply typed terms in Church style are generated from a countable set of
typed variables xσ using lambda abstraction and function application [1]. We
write S σ , or sometimes S : σ, to mean term S has type σ. The usual typing
rules hold: if S τ then λxσ .S τ : σ → τ ; if S σ→τ and U σ then (S σ→τ U σ ) : τ . In a
sequence of unparenthesised applications we assume that application associates
to the left, so SU1 . . . Uk is ((. . . (SU1 ) . . .)Uk ). Another abbreviation is λz1 . . . zm
for λz1 . . . λzm . Usual definitions of when a variable occurrence is free or bound
and when a term is closed are assumed.
We also assume the usual dynamics of β and η-reductions and the consequent
βη-equivalence between terms (as well as α-equivalence). Confluence and strong
normalisation ensure that terms reduce to (unique) normal forms. Moreover,
we assume the standard notion of η-long β-normal form (a term in normal form
which is not an η-reduct of some other term) which we abbreviate to lnf. The syn-
tax of such terms reflects their type: a lnf of type a is a variable xa , or x U1 . . . Uk
where xρ1 →...→ρk →a and each Uiρi is a lnf; a lnf of type ρ1 → . . . → ρn → a has
the form λxρ11 . . . xρnn .S, where S a is a lnf.
The following definition introduces retracts between types [2,3].
The witnesses C and D to a retract can always be presented as lnfs. We can think
of C as a “coder” and D as a “decoder” [9]. Assume ρ = ρ1 → . . . → ρl → a
and τ = τ1 → . . . → τn → a: in a retract the types must share target type [9].
We instantiate the bound ρi variables in a decoder D to D(z1ρ1 , . . . , zlρl ), often
abbreviated to D(z), and the bound variable of type ρ in C to C(xρ ): so, |= ρ τ
if D(z1ρ1 , . . . , zlρl )(C(xρ )) =βη xz1 . . . zl . From [9], we can restrict a decoder to
be of the form λf τ .f S1τ1 . . . Snτn with f as head variable and a coder C(x) has
the form λy1τ1 . . . ynτn .H(xT1ρ1 . . . Tlρl ).
Definition 2. We say that the decoder D(z1 , . . . , zl ) = λf τ .f S1τ1 . . . Snτn and the
coder C(x) = λy1τ1 . . . ynτn .H(xT1ρ1 . . . Tlρl ) are canonical witnesses for ρ τ if
D(z)(C(x)) =βη xz1 . . . zl and they obey the following properties:
1. variables f, z1 , . . . , zl occur only once in D(z),
2. x occurs only once in C(x),
3. H is ε if ρ and τ are constructed from a single ground type,
4. if Tiρi contains an occurrence of yj then it is the head variable of Tiρi , zi
τ
occurs in Sj j and Tiρi contains no other occurrences of any yk , 1 ≤ k ≤ n.
So, if there is only a single ground type then C(x) can be restricted to have the
form λy1τ1 . . . ynτn .xT1ρ1 . . . Tlρl with x as head variable [3].
Terms are represented as special kinds of tree (that we call binding trees in
[12,14]) with dummy lambdas and an explicit binding relation. A term of the
form y a is represented as a tree with a single node labelled y a . In the case of
y U1 . . . Uk , when y ρ1 →...→ρk →a , we assume that a dummy lambda with the empty
sequence of variables is placed directly above any subterm Ui in its tree repre-
sentation if ρi is a ground type. With this understanding, the tree for y U1 . . . Uk
consists of a root node labelled y ρ1 →...→ρk →a and k-successor trees represent-
ing U1 , . . . , Uk . We also use the abbreviation λy for λy1 . . . ym for m ≥ 0, so
y is possibly the empty sequence of variables in the case of a dummy lambda.
The tree representation of λy.S : ρ1 → . . . → ρk → a consists of a root node
Proof Systems for Retracts in Simply Typed Lambda Calculus 401
(0) λf (12) λy
(1) f
t
(13) x
JJ
tt JJ
tt JJ
tt JJ
tt J
(2) λuv (14) λw (20) λw
u
(3) v (15) y
JJ (21) y
JJ
uu JJ JJ
uu JJ JJ
uu JJ JJ
uu J J
(4) λ (8) λ (16) λ (18) λst (22) λ (24) λst
(6) λ (10) λ
(7) u (11) u
labelled λy and a single successor tree for S a . The trees for C(x) and D(z1 , z2 )
of Example 1, where we have omitted the types, are in Figure 1.
We say that a node is a lambda (variable) node if it is labelled with a lambda
abstraction (variable). The type (target type) of a variable node is the type (target
type) of the variable at that node and the type (target type) of a lambda node
is the type (target type) of the subterm rooted at that node.
The other elaboration is that we assume an extra binary relation ↓ between
nodes in a tree that represents binding; that is, between a node labelled λy1 . . . yn
and a node below it labelled yj (that it binds). A binder λy is such that either y is
empty and therefore is a dummy lambda and cannot bind a variable occurrence
or y = y1 . . . yk and λy can only then bind variable occurrences of the form yi ,
1 ≤ i ≤ k. Consequently, we also employ the following abbreviation n ↓i m if
n ↓ m and n is labelled λy1 . . . yk and m is labelled yi . In Figure 1 we have not
included the binding relation; however, for instance, (2) ↓1 (7).
We now develop goal directed tableau proof systems for showing retracts. By
inverting the rules one has more classical axiomatic systems: we do it this way
because it thereby provides an immediate nondeterministic decision procedure
for deciding retracts. We present two such proof systems: a slightly simpler
system for the restricted case when there is a single ground type and one for the
general case.
Assertions in our proof system are of two kinds. First is ρ τ with meaning ρ
is a retract of τ . The second has the form [ρ1 , . . . , ρk ] τ which is based on the
“product” as defined in [3]. We follow [9] in allowing reordering of components
of types since ρ → σ → τ is isomorphic to σ → ρ → τ . Instead we could include
explict rules for reordering (as with the axiom in [3]). Moreover, we assume that
[ρ1 , . . . , ρk ] is a multi-set and so elements can be in any order.
404 C. Stirling
I ρρ
ρσ →τ
W
ρτ
δ → ρσ → τ
C
δσ ρτ
ρ1 → . . . → ρk → ρ σ → τ
P1
[ρ1 , . . . , ρk ] σ ρτ
[ρ1 , . . . , ρk ] σ
P2 where
ρ 1 σ w1 ... ρ k σ wk
The proof rules are given in Figure 2. There is a single axiom I, identity,
a weakening rule W , a covariance rule C, and two product rules P1 and P2 .
The rules are goal directed: for instance, C allows one to decompose the goal
δ → ρσ → τ into the two subgoals δσ and ρτ . I, W and C (or their variants)
occur in the proof systems for affine retracts (when variables in witnesses can
only occur at most once) [3,9]. The new rules are the product rules: P2 appeals
to k-minimal realisable paths (presented as words), and the restriction operator
of Definition 8. The proof system does not require the axiom A4 of [3], σ (σ →
a) → a: all instances are provable using W and C.
Definition 11. A successful proof tree for ρ τ is a finite tree whose root is
labelled with the goal ρ τ , the successor nodes of a node are the result of an
application of one of the rules to it, and each leaf is labelled with an axiom. We
write ρ τ if there is a successful proof tree for ρ τ .
(σ → o) → (σ → o) → o (σ → (o → o → o) → o) → o
[σ → o, σ → o] σ → (o → o → o) → o oo
σ → oσ → o σ →oσ →o
[ρ1 , . . . , ρk ] σ
P2 where
ρ1 v1 (σ) w1 ... ρk vk (σ) wk
(b → a) → o → a (b → (a → o → a) → a) → a
[b → a, o] b → (a → o → a) → a aa
b→ab→a oo
for the concatenation vi∧ wi see Definition 10. The specialisation to the case of
the single ground type is when U = ∅ and v = ε.
Let ρ = ρ1 → . . . → ρl → a and τ = τ1 → . . . → τn → a. So, |= ρ τ
iff there are canonical witnesses D(z1ρ1 , . . . , zlρl ) = λf τ .f S1τ1 . . . Snτn and C(x) =
λy1τ1 . . . ynτn .H(xT1ρ1 . . . Tlρl ). Assume z1 , . . . , zk , where k ≥ 1, occur in S1τ1 . There
is a path v in C(x) to the node above x which determines a subtree U of S1τ1 . The
head variable in Tiρi bound in v has the same target type as ρi . There are distinct
paths v1∧ w1 , . . . , vk∧ wk of odd length to the lambda nodes above z1 , . . . , zk in S1τ1 :
vi is decided by the meaning of the head variable in Tiρi ; so, vi (τ1 ) has the same
target type as ρi . The rest of the path is the tail of wi : so we need to consider
whether |= ρi vi (τ1 ) wi .
Figure 5 is the proof tree for the retract in Example 2. There is an application
of P1 followed by P2 . In the application of P2 the subtree U = {(ε, 2)}, v1 = ε,
w1 = (ε, 2, 21) = v1∧ w1 , v2 = (ε, 2, 22) = v2∧ w2 when w2 = (22). So, v1 (b →
(a → o → a) → a) w1 = b → a as the first component is admitted (unlike the
second); and v2 (b → (a → o → a) → a) = o = o w2 .
3.3 Complexity
The proof systems provide nondeterministic decision procedures for checking
retracts. Each subgoal of a proof rule has smaller size than the goal. Hence, by
focussing on one subgoal at a time a proof witness can be presented in PSPACE.
However, this does not take into account checking that a subgoal obeys the
side conditions in the case of the product rules. Given any type σ, there are
boundedly many realisable k-minimal paths (with an upper bound of k n where
n is size of σ). So, this means that overall the decision procedure requires at
most EXPSPACE.
node is associated with C(x) rooted at (12); so, the next position is at node (1)
and therefore jumps to (12); the binder at (12) λy is associated with node (2)
(the successor of (1)). Play proceeds to (13) and ∀ chooses to go left or right;
suppose it is left, so play is then at (14); nodes (13) and (14) are part of the
normal form. Play descends to (15) and, therefore, jumps to (2); so, with the
binder at (2), u is associated with the the subtree at (16) and v with the subtree
at (18). Play proceeds to (3) and so jumps to (18); now, s is associated with (4)
and t with (8). Play proceeds to (19) and so jumps to (4), descends to (5) and
then to (6) and then to (7) and jumps to (16) before finishing at (17). This play
captures the path xλw.z1 w of the normal form.
Some of the key properties, defined in the full version, we appeal to in the
correctness proofs below associate subtrees with realisable paths and vice versa.
For instance, as illustrated in the play above the path rooted at (0) downto (7)
is associated with the subtree rooted at (12) and with leaves (17) and (19). Let
ρ = ρ1 → . . . → ρl → a and τ = τ1 → . . . → τn → a and let τ1 = σ = σ1 →
. . . → σm → b.
Theorem 1. (Soundness) If ρ τ then |= ρ τ .
Proof. By induction on the depth of a proof. For the base case, the result is
clear for a proof that uses the axiom I. So, assume the result for all proofs of
depth < d. Consider now a proof of depth d. We proceed by examining the
first rule that is applied to show ρ τ . If it is W or C the result follows
using the same arguments as in [3]. Assume the rule is W and suppose |= ρ τ .
Therefore there are terms D1 and C1 such that D1τ →ρ (C1ρ→τ x ) =βη x. Now
D(σ→τ )→ρ = λf σ→τ y σ .D1 (f y) and C ρ→(σ→τ ) x = λsσ .C1 (x) are witnesses for
|= ρ σ → τ . Assume that the rule is C, so |= δ σ and |= ρ τ . So there are
terms D1 , C1 , D2 , C2 such that D1σ→δ (C1δ→σ x) =βη x and D2τ →ρ (C2ρ→τ x) =βη x.
Now D(σ→τ )→(δ→ρ) = λxy.C2 (x(D1 y)) and C (δ→ρ)→(σ→τ ) = λuz.D2 (u(C1 z))
are witnesses for |= δ → ρ σ → τ .
Consider next that the first rule is P1 . So after P1 there is either an application
of P2 or P2 : in the former case, there are k-minimal realisable paths w1 . . .
wk of odd length of type σ such that ρi σ wi ; in the latter case, there is
a k -minimal realisable subtree U of type σ where each path has even length;
and there are paths v1∧ w1 . . . vk∧ wk where each element is a k -minimal
realisable path of type σ of odd length and if U = ∅, it extends some path in
U and where each vi is ε, a prefix of a path in U of odd length path or an
extension of a path in U with a single node and ρi vi (σ) wi ; where k is the
maximum of k and the square of the arity of σ. So, by the induction hypothesis
there are terms Di (z i ) and Ci (xi ) such that Di (z i )(Ci (xi )) =βη xi z i , witnesses
for ρi σ wi or ρi vi (σ) wi , and terms D (zk+1 , . . . , zl ) and C (x ) such
that D (zk+1 , . . . , zl )(C (x )) =βη x zk+1 . . . zl , witnesses for ρk+1 → . . . → ρl →
a τ where τ = τ2 → . . . → τn → a. We assume that all these terms are
canonical witnesses. The term D (zk+1 , . . . , zl ) is λf τ .f S2τ2 . . . Snτn and C (x ) is
λy2τ2 . . . ynτn .H (x Tk+1 . . . Tlρl ) where H = ε if the rule applied was P2 .
ρk+1
We need to show that there are terms D(z1 , . . . , zl ) and C(x) that are wit-
nesses for |= ρ τ . D(z) will have the form λf τ .f S1τ1 . . . Snτn and C(x) the form
408 C. Stirling
λy1τ1 . . . ynτn .H(xT1ρ1 . . . Tlρl ) where H = ε in the case of a single ground type. All
that remains is to define S1τ1 so it contains z1 , . . . , zk , T1ρ1 , . . . , Tkρk and H (as
an extension of H ). If U = ∅ then H = H . Otherwise, let u be an odd length
path such that U is associated with (so, its head variable is y1τ1 ). H consists of
the suffix of u followed by the subtree H . The head variable of each Tiρi is y1 in
v (σ)
the case of the single ground type and gi i in the general case (which is either
y1 or bound in u). We assume that Si is the subterm of S1σ that is rooted at
the initial vertex of the path wi : which is S1σ itself in the single ground type.
To complete these terms we require that Tiρi (S1σ (z1 , . . . , zk )) =βη zi . Therefore,
removing lambda abstraction over variables zij and changing zi to xi , we require
that Ti (z i )(Si (x1 , . . . , xk )) =βη xi z i . We construct a term C (xi ) that occurs
after the path wi in Si (and which has root xi when there is a single ground
type). We also complete Ti (z i ) whose initial part is the tree Ui associated with
the path wi .
First, we examine the single ground type case. So, S1σ will have the form
λu1 . . . um .S1 , C (xi ) the form xi Ci1
. . . Cip and Ti (z i ) the form λfiσ .fi V1i . . . Vmi .
Assume Di (z i ) is λgiσwi .gi Wii1 . . . Wiil and Ci (xi ) is λui1 . . . uil .xi C1i . . . Cpi . As-
sume wi admits σij : therefore, for some r : 1 ≤ r ≤ m, ij = r (so, Wri may
contain occurrences of variables in z i ). If ur does not occur in the path wi then
we set Vri = Wri . Otherwise, there is a non-empty subpath wir of wi generated
by ur , and a subtree Uri of Vri associated with wir . Each Cji contains a single uik
(as head variable). Assume Csi contains ur . Assume that the path in Wri to the
lambda node above zis is ws . If we can build the same path in Vri (by copying
nodes of Csi to Cis ) then we are done (letting Vri include this path followed by
i
the subterm of Wr rooted at zis ). Otherwise, we initially include wir in Cis and
i i i
then try to build ws in Vr by copying nodes of Cs to Cis : in Vr and, therefore
in Uri , there is a path whose prefix except for its final variable vertex is the same
as a prefix of ws and then differ. In the game G(Cis
, Vri ), play jumps from that
i
variable in Vr to a lambda node in wir . By definition of admits, there is a binder
n labelled λv in wir such that for some q not(n ↓q ni ) for all nodes ni after n
in wi (and in wir ). Therefore, we add a variable node labelled vq to the end of
wir in Cis ; so play jumps to a lambda node in Vri which is a successor of a leaf
of Ur ; below this node, we build the path ws except for its root node (by adding
i
further nodes to Cis and add the subtree rooted at zis in Wri to Vri ).
For the general case, assume vi (σ) = σ1 → . . . → σm v (σ)
→ b. So, Si i will
have the form λu1 . . . um .S1 , C (xi ) the form Hi (xi Ci1
. . . Cip ) and Ti (z i ) the
v (σ)w
form λfiσ .fi V1i . . . Vmi . Assume Di (z i ) is λgi i i
.gi Wii1 . . . Wiil and Ci (xi ) is
λui1 . . . uil .Hi (xi C1i . . . Cpi ). We set Hi = Hi . Then we proceed in a similar fash-
ion to the single base type case. If some ur does not occur in the path wi then
Vri = Wri ; otherwise we need to build similar paths to zis in Wri in Vri (by copying
vertices from Csi to Cis and using that wi admits (vi (σ))r . &
%
5 Conclusion
We have provided tableau proof systems that characterise when a type is a retract
of another type in simply typed lambda calculus (with respect to βη-equality).
They offer a a nondeterministic decision procedure for the retract problem in
EXPSPACE: it may be possible to improve on the rather crude k-minimality
bounds used on paths within the proof systems. Given the constructive proof of
correctness, we also expect to be able to extract witnesses for a retract from a
successful tableau proof tree (similar in spirit to [10]).
References
1. Barendregt, H.: Lambda calculi with types. In: Abramsky, S., Gabbay, D.,
Maibaum, T. (eds.) Handbook of Logic in Computer Science, vol. 2, pp. 118–309.
Oxford University Press (1992)
2. Bruce, K., Longo, G.: Provable isomorphisms and domain equations in models of
typed languages. In: Proc. 17th Symposium on Theory of Computing, pp. 263–272.
ACM (1985)
3. de ’Liguoro, U., Piperno, A., Statman, R.: Retracts in simply typed λβη-calculus.
In: Procs. LICS 1992, pp. 461–469 (1992)
4. Loader, R.: Higher-order β-matching is undecidable. Logic Journal of the
IGPL 11(1), 51–68 (2003)
5. Ong, C.-H.L.: On model-checking trees generated by higher-order recursion
schemes. In: Procs. LICS 2006, pp. 81–90 (2006)
6. Ong, C.-H.L., Tzevelekos, N.: Functional Reachability. In: Procs. LICS 2009, pp.
286–295 (2009)
7. Padovani, V.: Decidability of fourth-order matching. Mathematical Structures in
Computer Science 10(3), 361–372 (2000)
8. Padovani, V.: Retracts in simple types. In: Abramsky, S. (ed.) TLCA 2001. LNCS,
vol. 2044, pp. 376–384. Springer, Heidelberg (2001)
9. Regnier, L., Urzyczyn, P.: Retractions of types with many atoms, pp. 1–16 (2005),
http://arxiv.org/abs/cs/0212005
10. Schubert, A.: On the building of affine retractions. Math. Struct. in Comp. Sci-
ence 18, 753–793 (2008)
11. Stirling, C.: Higher-order matching, games and automata. In: Procs. LICS 2007,
pp. 326–335 (2007)
12. Stirling, C.: Dependency tree automata. In: de Alfaro, L. (ed.) FOSSACS 2009.
LNCS, vol. 5504, pp. 92–106. Springer, Heidelberg (2009)
13. Stirling, C.: Decidability of higher-order matching. Logical Methods in Computer
Science 5(3:2), 1–52 (2009)
14. Stirling, C.: An introduction to decidability of higher-order matching (2012) (Sub-
mitted for Publication), Availble at author’s website
15. Vorobyov, S.: The “hardest” natural decidable theory. In: Procs. LICS 1997,
pp. 294–305 (1997)
Presburger Arithmetic, Rational Generating
Functions, and Quasi-Polynomials
Kevin Woods
1 Introduction
A broad and interesting class of sets are those that can be defined over N =
{0, 1, 2, . . .} with first order logic and addition.
defines the Presburger set {3, 5, 7, . . .}. Since multiplication by an integer is the
same as repeated addition, we can conceive of a Presburger formula as a Boolean
combination ofintegral linear (in)equalities, appropriately quantified: ∃b u > 1
and 2b + 1 = u .
Full version available at http://www.oberlin.edu/faculty/kwoods/papers.html
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 410–421, 2013.
c Springer-Verlag Berlin Heidelberg 2013
Presburger Arithmetic, Rational Generating Functions 411
Presburger proved [35] that the truth of a Presburger sentence (a formula with
no free variables) is decidable. In contrast, a broader class of sentences, where
multiplication of variables is allowed, is undecidable; this is a consequence of the
negative solution to Hilbert’s 10th problem, given by Davis, Putnam, Robinson,
and Matiyasevich (see, for example, [19]).
We would like to understand more clearly the structure of a given Presburger
set. One way to attempt to do this is to encode the elements of the set into a
generating function.
x3
f (S; x) = x3 + x5 + x7 + · · · = .
1 − x2
We see that, in this instance, the generating function has a nice form; this is not
a coincidence.
Note that c (the counted variables) and p (the parameter variables) are free
variables. We will restrict ourselves to counting functions such that gF (p) is
finite for all p ∈ Nn . One could instead either include ∞ in the codomain of gF
or restrict the domain of gF to where gF (p) is finite (this domain would itself
be a Presburger set).
A classic example is to take F (c, p) to be the conjunction of linear inequalities
of the form a1 c1 + · · ·+ ad cd ≤ a0 p, where ai ∈ Z. Then gF (p) counts the number
of integer points in the pth dilate of a polyhedron.
Example 2. If F (c1 , c2 , p) is 2c1 + 2c2 ≤ p, then the set of solutions (c1 , c2 ) ∈ N2
lies in the triangle with vertices (0, 0), (0, p/2), (p/2, 0), and
1 , p - , p -
gF (p) = +1 +2
2
2 2
1 2
p + 3 p + 1 if p is even,
= 81 2 41 3
8p + 2p + 8 if p is odd.
The nice form of this function is also not a coincidence. For this particular type
of Presburger formula (dilates of a polyhedron), Ehrhart proved [21] that the
counting functions are quasi-polynomials:
In Example 2, we can take the lattice Λ = 2Z and each coset (the evens and the
odds) has its associated polynomial. We need something slightly more general
to account for all Presburger counting functions:
One last thing that is not a coincidence: For the triangle in Example 2, we can
compute
a rational generating function! The following theorem says that these ideas are
– almost – equivalent.
Presburger Arithmetic, Rational Generating Functions 413
g(s, t) = (t − s2 )2
were a Presburger counting function given by a Presburger formula F (c, s, t),
that is,
g(s, t) = #{c ∈ Nd : F (c, s, t)}.
Then the set
(s, t) ∈ N2 : c F (c, s, t) = {(s, t) ∈ N2 : g(s, t) = 0}
= {(s, s2 ) : s ∈ N}
would be a Presburger set. This is not the case, however, as it does not satisfy
Property 2 in Theorem 1. If the parameter is univariate, however, the following
proposition shows that we do have the implication B ⇒ A.
Proposition 1. Given a function g : N → Q, if g is a piecewise quasi-polyno-
mial whose range is in N, then g is a Presburger counting function.
In Section 4, we prove Theorems 1 and 2 (the proof of Proposition 1 appears in
the full version of this paper). In Section 2, we survey related work. In Section
3, we present the primary tools we need for the proofs. In the full version of this
paper, we also turn to computational questions; we survey known results, but
restate them in terms of Presburger arithmetic.
414 K. Woods
2 Related Work
x a0
(1 − xa
1 ) · · · (1
1
− xa
k )
k
Presburger Arithmetic, Rational Generating Functions 415
{u ∈ Nd : F (u)} = {u ∈ Nd : G(u)}.
For instance, the set from Example 1 can be written as (u > 1 and u mod 2 = 1).
Next, we give two theorems that tie in generating functions. The first gives us
a way to convert from a specific type of Presburger set to a generating function.
function.
The first step to proving this is to use Brion’s Theorem [11], which says that the
generating
function can be decomposed into functions of the form f K ∩ (λ +
Λ); x , where K is a cone. Then, one can notice that integer points in cones have
a natural structure that can be encoded as geometric series.
Example 3. Let K ⊆ R2 be the cone with vertex at the origin and extreme rays
u = (1, 0) and v = (1, 2). Using the fact that the lattice (uZ + vZ) has index 2
in Z2 , with coset representatives (0, 0) and (1, 1), every integer point in K can
be written as either (0, 0) + λ1 u + λ2 v or (1, 1) + λ1 u + λ2 v, where λ1 , λ2 ∈ N.
Therefore
g(z) = f (z l1 , z l2 , . . . , z ld ),
g(p) = #{(λ1 , . . . , λd ) ∈ Nd : p = λ1 a1 + · · · + λd ad },
that is, the number of ways to partition the vector p into parts taken from {ai }.
See [6] for a self-contained explanation utilizing the partial fraction expansion
of the generating function
1
g(p)xp = ;
(1 − xa1 ) · · · (1 − xad )
p∈Nn
4 Proofs
A ⇒ C.
Given a Presburger counting function, g(p) = #{c ∈ Nd : F (c, p)}, we
first apply Presburger Elimination (Theorem 3) to F to obtain a quantifier free
formula, G(c, p), in extended Presburger arithmetic such that g(p) = #{c ∈
Nd : G(c, p)}. Integers which satisfy a statement of the form
are exactly sets λ + Λ, where λ ∈ Zn+d and Λ is a lattice in Zn+d . Since G(c, p)
is a Boolean combination of linear inequalities and these linear congruences, we
may write the set, S, of points (c, p) which satisfy G(c, p) as a disjoint union
)
k
S= Pi ∩ (λi + Λi ),
i=1
f (S; y, x) = f (Si ; y, x) = yc xp
i (c,p): G(c,p)
C ⇒ B. p
It suffices to prove this for functions g such that p g(p)x is a rational
generating function of the form
xq
,
(1 − xa1 )(1 − xa2 ) · · · (1 − xak )
g(p) = #{(λ1 , . . . , λk ) ∈ Nk : p = λ1 a1 + · · · + λk ak }.
B ⇒ C.
Any piecewise quasi-polynomial can be written as a linear combination of
functions of the form
pa if p ∈ P ∩ (λ + Λ),
g(p) =
0 otherwise,
2 ⇒ 1.
This is straightforward: the property of being an element of λ + Λ can be
written using linear congruences and existential quantifiers, and the property of
being an element of P can be written as a set of linear inequalities.
2 ⇒ 2.
Since χS is a piecewise quasi-polynomial, it is constituted from associated
polynomials. Let us examine such a polynomial q(p) that agrees with χS on
some P ∩ (λ + Λ), where P ⊆ Rn≥0 is a polyhedron, λ ∈ Zn , and Λ a sublattice
of Zn . It suffices to prove that 2 holds for S ∩ P ∩ (λ + Λ), since S is the disjoint
union of such pieces.
Ideally, we would like to argue that, since q only takes on the values 0 and 1,
the polynomial q must be constant on P ∩ (λ + Λ), at least if P is unbounded.
This is not quite true; for example, if
P = (x, y) ∈ R2 : x ≥ 0 and 0 ≤ y ≤ 1 ,
Presburger Arithmetic, Rational Generating Functions 419
K = {y ∈ Rn : y + P ⊆ P }.
Then K is the largest cone such that the cones x + K are contained in P , for
all x ∈ P ; K is often called the recession cone or characteristic cone of P (see
Section 8.2 of [39]), and the polyhedron P can be decomposed into a Minkowski
sum K + Q, where Q is a bounded polyhedron. We can write P ∩ (λ + Λ) as a
finite union (possibly with overlap) of sets of the form
Qj = (vj + K) ∩ (λ + Λ),
for some vj , and on each of these pieces q must be constant. If q is the constant
1 on Qj , then Qj is contained in S, and if q is the constant 0, then none of Qj
is in S. Since S is a finite union of the appropriate Qj , S has the form needed
for Property 2.
References
1. Barvinok, A.: A polynomial time algorithm for counting integral points in polyhe-
dra when the dimension is fixed. Math. Oper. Res. 19(4), 769–779 (1994)
2. Barvinok, A.: A Course in Convexity. Graduate Studies in Mathematics, vol. 54.
American Mathematical Society, Providence (2002)
3. Barvinok, A.: The complexity of generating functions for integer points in
polyhedra and beyond. In: International Congress of Mathematicians, vol. III,
pp. 763–787. Eur. Math. Soc., Zürich (2006)
4. Barvinok, A., Pommersheim, J.: An algorithmic theory of lattice points in polyhe-
dra. In: New Perspectives in Algebraic Combinatorics (Berkeley, CA, 1996–1997).
Math. Sci. Res. Inst. Publ., vol. 38, pp. 91–147. Cambridge Univ. Press, Cambridge
(1999)
5. Barvinok, A., Woods, K.: Short rational generating functions for lattice point prob-
lems. J. Amer. Math. Soc. 16(4), 957–979 (2003) (electronic)
6. Beck, M.: The partial-fractions method for counting solutions to integral linear
systems. Discrete Comput. Geom. 32(4), 437–446 (2004)
7. Beck, M., Robins, S.: Computing the continuous discretely. Undergraduate Texts in
Mathematics. Springer, New York (2007); Integer-point enumeration in polyhedra
8. Berman, L.: The complexity of logical theories. Theoret. Comput. Sci. 11(1), 57,
71–77 (1980); With an introduction “On space, time and alternation”
420 K. Woods
9. Blanco, V., Garcı́a-Sánchez, P.A., Puerto, J.: Counting numerical semigroups with
short generating functions. Internat. J. Algebra Comput. 21(7), 1217–1235 (2011)
10. Boudet, A., Comon, H.: Diophantine equations, Presburger arithmetic and finite
automata. In: Kirchner, H. (ed.) CAAP 1996. LNCS, vol. 1059, pp. 30–43. Springer,
Heidelberg (1996)
11. Brion, M.: Points entiers dans les polyèdres convexes. Ann. Sci. École Norm. Sup. 4,
653–663 (1988)
12. Büchi, J.R.: Weak second-order arithmetic and finite automata. Z. Math. Logik
Grundlagen Math. 6, 66–92 (1960)
13. Cassels, J.W.S.: An introduction to the geometry of numbers. Classics in Mathe-
matics. Springer, Berlin (1997); Corrected reprint of the 1971 edition
14. Clauss, P., Loechner, V.: Parametric analysis of polyhedral iteration spaces. Journal
of VLSI Signal Processing 19(2), 179–194 (1998)
15. Cobham, A.: On the base-dependence of sets of numbers recognizable by finite
automata. Math. Systems Theory 3, 186–192 (1969)
16. Comon, H., Jurski, Y.: Multiple counters automata, safety analysis and Pres-
burger arithmetic. In: Vardi, M.Y. (ed.) CAV 1998. LNCS, vol. 1427, pp. 268–279.
Springer, Heidelberg (1998)
17. Cooper, D.: Theorem proving in arithmetic without multiplication. Machine Intel-
ligence 7, 91–99 (1972)
18. D’Alessandro, F., Intrigila, B., Varricchio, S.: On some counting problems for semi-
linear sets. CoRR abs/0907.3005 (2009)
19. Davis, M.: Hilbert’s tenth problem is unsolvable. Amer. Math. Monthly 80, 233–269
(1973)
20. De Loera, J., Haws, D., Hemmecke, R., Huggins, P., Sturmfels, B., Yoshida, R.:
Short rational functions for toric algebra. To appear in Journal of Symbolic Com-
putation (2004)
21. Ehrhart, E.: Sur les polyèdres rationnels homothétiques à n dimensions. C. R.
Acad. Sci. Paris 254, 616–618 (1962)
22. Fischer, M., Rabin, M.: Super-exponential complexity of Presburger arithmetic. In:
Complexity of Computation. SIAM–AMS Proc., vol. VII, pp. 27–41. Amer. Math.
Soc., Providence (1974); Proc. SIAM-AMS Sympos., New York (1973)
23. Fulton, W.: Introduction to Toric Varieties. Annals of Mathematics Studies,
vol. 131. Princeton University Press, Princeton (1993)
24. Fürer, M.: The complexity of Presburger arithmetic with bounded quantifier al-
ternation depth. Theoret. Comput. Sci. 18(1), 105–111 (1982)
25. Ginsburg, S., Spanier, E.: Semigroups, Presburger formulas and languages. Pacific
Journal of Mathematics 16(2), 285–296 (1966)
26. Grädel, E.: Subclasses of Presburger arithmetic and the polynomial-time hierarchy.
Theoret. Comput. Sci. 56(3), 289–301 (1988)
27. Guo, A., Miller, E.: Lattice point methods for combinatorial games. Adv. in Appl.
Math. 46(1-4), 363–378 (2011)
28. Hoşten, S., Sturmfels, B.: Computing the integer programming gap. To appear in
Combinatorics (2004)
29. Kannan, R.: Test sets for integer programs, ∀∃ sentences. In: Polyhedral Combi-
natorics. DIMACS Ser. Discrete Math. Theoret. Comput. Sci, vol. 1, pp. 39–47.
Amer. Math. Soc., Providence (1990); Morristown, NJ (1989)
30. Klaedtke, F.: Bounds on the automata size for Presburger arithmetic. ACM Trans.
Comput. Log. 9(2), 34 (2008)
31. Lenstra Jr., H.: Integer programming with a fixed number of variables. Math. Oper.
Res. 8(4), 538–548 (1983)
Presburger Arithmetic, Rational Generating Functions 421
32. Miller, E., Sturmfels, B.: Combinatorial commutative algebra. Graduate Texts in
Mathematics, vol. 227. Springer, New York (2005)
33. Oppen, D.: A superexponential upper bound on the complexity of Presburger arith-
metic. J. Comput. System Sci. 16(3), 323–332 (1978)
34. Parker, E., Chatterjee, S.: An automata-theoretic algorithm for counting solu-
tions to presburger formulas. In: Duesterwald, E. (ed.) CC 2004. LNCS, vol. 2985,
pp. 104–119. Springer, Heidelberg (2004)
35. Presburger, M.: On the completeness of a certain system of arithmetic of whole
numbers in which addition occurs as the only operation. Hist. Philos. Logic 12(2),
225–233 (1991); Translated from the German and with commentaries by Dale
Jacquette
36. Pugh, W.: Counting solutions to presburger formulas: how and why. SIGPLAN
Not. 29(6), 121–134 (1994)
37. Ramı́rez Alfonsı́n, J.L.: The Diophantine Frobenius problem. Oxford Lecture Series
in Mathematics and its Applications, vol. 30. Oxford University Press, Oxford
(2005)
38. Scarf, H.: Test sets for integer programs. Math. Programming Ser. B 79(1-3),
355–368 (1997)
39. Schrijver, A.: Theory of Linear and Integer Programming. Interscience Series in
Discrete Mathematics. John Wiley & Sons Ltd., Chichester (1986)
40. Schrijver, A.: Combinatorial optimization. Polyhedra and efficiency. Algorithms
and Combinatorics, vol. 24. Springer, Berlin (2003)
41. Stanley, R.P.: Decompositions of rational convex polytopes. Ann. Discrete Math. 6,
333–342 (1980); Combinatorial mathematics, optimal designs and their applica-
tions. In: Proc. Sympos. Combin. Math. and Optimal Design, Colorado State Univ.,
Fort Collins, Colo. (1978)
42. Sturmfels, B.: On vector partition functions. J. Combin. Theory Ser. A 72(2),
302–309 (1995)
43. Sturmfels, B.: Gröbner Bases and Convex Polytopes. University Lecture Series,
vol. 8. American Mathematical Society, Providence (1996)
44. Thomas, R.: A geometric Buchberger algorithm for integer programming. Math.
Oper. Res. 20(4), 864–884 (1995)
45. Thomas, R.: The structure of group relaxations. In: Aardal, K., Nemhauser, G.,
Weismantel, R. (eds.) Handbook of Discrete Optimization (2003)
46. Verdoolaege, S., Woods, K.: Counting with rational generating functions. J. Sym-
bolic Comput. 43(2), 75–91 (2008)
47. Wolper, P., Boigelot, B.: An automata-theoretic approach to Presburger arithmetic
constraints. In: Mycroft, A. (ed.) SAS 1995. LNCS, vol. 983, pp. 21–32. Springer,
Heidelberg (1995)
48. Woods, K.: Rational Generating Functions and Lattice Point Sets. PhD thesis,
University of Michigan (2004)
Revisiting the Equivalence Problem
for Finite Multitape Automata
James Worrell
1 Introduction
One-way multitape finite automata were introduced in the seminal 1959 paper
of Rabin and Scott [15]. Such automata (under various restrictions) are also
commonly known as transducers—see Elgot and Mezei [6] for an early reference.
A multitape automaton with k tapes accepts a k-ary relation on words. The
class of relations recognised by deterministic automata coincides with the class
of k-ary rational relations [6].
Two multitape automata are said to be equivalent if they accept the same
relation. Undecidability of equivalence of non-deterministic automata is rela-
tively straightforward [8]. However the deterministic case remained open for
many years, until it was shown decidable by Harju and Karhumäki [9]. Their
solution made crucial use of results about ordered groups—specifically that a
free group can be endowed with a compatible order [13] and that the ring of
formal power series over an ordered group with coefficients in a division ring and
with well-ordered support is itself a division ring (due independently to Mal-
cev [11] and Neumann [14]). Using these results [9] established the decidability
of multiplicity equivalence of non-deterministic multitape automata, i.e., whether
two non-deterministic multitape automata have the same number of accepting
computations on each input. Decidability in the deterministic case (and, more
Supported by EPSRC grant EP/G069727/1.
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 422–433, 2013.
c Springer-Verlag Berlin Heidelberg 2013
Revisiting the Equivalence Problem for Finite Multitape Automata 423
generally, the unambiguous case) follows immediately. We refer the reader to [16]
for a self-contained account of the proof, including the underlying group theory.
Harju and Karhumäki did not address questions of complexity in [9]. However
the existence of a co-NP guess-and-check procedure for deciding equivalence of
deterministic multitape automata follows directly from [9, Theorem 8]. This
theorem states that two inequivalent automata are guaranteed to differ on a
tuple of words whose total length is at most the total number of states of the two
automata. Such a tuple can be guessed, and it can be checked in polynomial time
whether the tuple is accepted by one automaton and rejected by the other. In
the special case of two-tape deterministic automata, a polynomial-time algorithm
was given in [7], before decidability was shown in the general case.
A co-NP upper bound also holds for multiplicity equivalence of k-tape au-
tomata for each fixed k. However, as we observe below, if the number of tapes
is not fixed, computing the number of accepting computations of a given non-
deterministic multitape automata on a tuple of input words is #P-hard. Thus
the guess-and-check method does not yield a co-NP procedure for multiplicity
equivalence in general.
It is well-known that the equivalence problem for single-tape weighted au-
tomata with rational transition weights is solvable in polynomial time [18,19].
Now the decision procedure in [9] reduces multiplicity equivalence of multitape
automata to equivalence of single-tape automata with transition weights in a
division ring of power series over an ordered group. However the complexity of
arithmetic in this ring seems to preclude an application of the polynomial-time
procedures of [18,19]. Leaving aside issues of representing infinite power series,
even the operation of multiplying a family of polynomials in two non-commuting
variables yields a result with exponentially many monomials in the length of its
input.
In this paper we give an alternative proof that multiplicity equivalence of
multitape automata is decidable, which also yields new complexity bounds on
the problem. We use the same basic idea as [9]—reduce to the single-tape case
by enriching the set of transition weights. However we replace their use of power
series on ordered groups with results about matrix algebras and Polynomial
Identity rings (see Remark 1 for a more technical comparison). In particular,
we use the Amitsur-Levitzki theorem concerning polynomial identities in matrix
algebras. Our use of the latter is inspired by the work of [3] on non-commutative
polynomial identity testing, and our starting point is a simple generalisation of
the approach of [3] to what we call partially commutative polynomial identity
testing.
Our construction for establishing decidability immediately yields a simple ran-
domised algorithm for checking multiplicity equivalence of multitape automata
(and hence also equivalence of deterministic automata). The algorithm involves
only matrix exponentiation, and runs in polynomial time for each fixed number
of tapes.
424 J. Worrell
xσ(1) . . . xσ(2n) = 0 ,
σ∈S2n
where the sum is over the (2n)! elements of the symmetric group S2n . Moreover
Mn (F ) satisfies no identity of degree less than 2n.
Given a finite set X of non-commuting variables, the generic n×n matrix algebra
Fn X is defined as follows. For each variable x ∈ X we introduce a family of
(x)
commuting indeterminates {tij : 1 ≤ i, j ≤ n} and define Fn X to be the F -
(x)
algebra of n × n matrices generated by the matrices (tij ) for each x ∈ X. Then
Fn X has the following universal property: any homomorphism from F X to a
matrix algebra Mn (R), with R an F -algebra, factors uniquely through the map
(x)
ΦXn : F X → Fn X given by Φn (x) = (tij ).
X
where αi ∈ F and mi,j ∈ Xj∗ for each i ∈ I and 1 ≤ j ≤ k. Thus we can identify
F X with the free F -algebra over the product monoid X1∗ × . . . × Xk∗ .
Define the degree of a monomial m1 ⊗ . . . ⊗ mk to be the total length |m1 | +
. . . + |mk | of its constituent words. The degree of a polynomial is the maximum
of the degrees of its constituent monomials.
Let A = (A1 , . . . , Ak ) be a k-tuple of F -algebras. A valuation of F X in A
is a tuple of functions v = (v1 , . . . , vk ), where vi : Xi → Ai . Each vi extends
uniquely to an F -algebra homomorphism v4i : F Xi → Ai , and we define the
map v 4 : F X → A1 ⊗ . . . ⊗ Ak by v4 = v41 ⊗ . . . ⊗ v4k . Often we will abuse
terminology slightly and speak of a valuation of F X in A1 ⊗ · · · ⊗ Ak . Given
f ∈ F X, we say that A satisfies the partially commutative identity f = 0 if
4(f ) = 0 for all valuations v.
v
Next we introduce two valuations that will play an important role in the
subsequent development. Recall that given a set of non-commuting variables X,
we have a map ΦX n : F X → Fn X from the free F -algebra to the generic
n-dimensional matrix algebra. We now define a valuation
ΦX
n : F X −→ Fn X1 ⊗ · · · ⊗ Fn Xk (2)
426 J. Worrell
by ΦX
n = Φn ⊗ · · · ⊗ Φn . Likewise we define
X1 Xk
(x)
⊗ Mn (F tij | x ∈ Xk , 1 ≤ i, j ≤ n)
Proof. The implication (ii) ⇒ (i) follows from the fact that any valuation from
F X to Mn (L) ⊗F · · ·F ⊗ Mn (L) factors through Φn . To see that (i) ⇒ (ii),
observe that Φn (f ) is an nk × nk matrix in which each entry is a polynomial in
(x)
the commuting variables tij . Condition (i) implies in particular that each such
polynomial evaluates to 0 for all valuations of its variables in F . Since F is an
infinite field, it must be that each such polynomial is identically zero, i.e., (ii)
holds.
The implications (ii) ⇒ (iii) and (iv) ⇒ (i) are both straightforward, even
without the degree restriction on f .
Finally we show that (iii) ⇒ (iv). Let m1 ⊗ . . . ⊗ mk be a monomial in F X,
where mi = mi,1 . . . mi,li ∈ Xi∗ has length li < n. Then Ψn (m1 ⊗ · · · ⊗ mk )
is an nk × nk matrix whose first row has a single non-zero entry, which is the
monomial
(m ) (m ) (m ) (mk,l )
t12 1,1 . . . tl1 ,l1,l
1 +1
1
. . . t12 k,1 . . . tlk ,lk +1
k
(3)
The hypothesis that f have degree less than n in Proposition 1 can be weakened
somewhat, but is sufficient for our purposes.
ring (also called a skew field ). A domain R is a (right) Ore domain if for all
a, b ∈ R \ {0}, aR ∩ bR = 0. The significance of this notion is that an Ore domain
can be embedded in a division ring of fractions [4, Corollary 7.1.6], something
that need not hold for an arbitrary domain. If the Ore condition fails then it can
easily be shown that the subalgebra of R generated by a and b is free on a and
b. It follows that a domain R that satisfies some polynomial identity is an Ore
domain [4, Corollary 7.5.2].
Proposition 2. The tensor product of generic matrix algebras Fn X1 ⊗ · · · ⊗
Fn Xk is an Ore domain for each n ∈ N.
Proof (sketch). We give a proof sketch here, deferring the details to Appendix A.
By the Amitsur-Levitzki theorem, Fn X1 ⊗· · ·⊗Fn Xn satisfies a polynomial
identity. Thus it suffices to show that Fn X1 ⊗ · · · ⊗ Fn Xn is a domain for
each n. Now it is shown in [4, Proposition 7.7.2] that Fn X is a domain for
each n and set of variables X. While the tensor product of domains need not
be a domain (e.g., C ⊗R C ∼ = C × C), the proof in [4] can be adapted mutatis
mutandis to show that F X1 ⊗ · · · ⊗ F Xk is also a domain.
To prove the latter, it suffices to find central simple F -algebras D1 , . . . , Dk ,
each of degree n, such that the k-fold tensor product D ⊗F · · · ⊗F D is a domain.
Such an example can be found, e.g.,in [17, Proposition 1.1]. Then, using the
fact that D ⊗F L ∼ = Mn (L) for any algebraically closed extension field of F , one
can infer that Fn X1 ⊗ · · · ⊗ Fn Xk is also a domain. &
%
3 Multitape Automata
Let Σ = (Σ1 , . . . , Σk ) be a tuple of finite alphabets. We denote by S the product
monoid Σ1∗ × · · · × Σk∗ . Define the length of s = (w1 , . . . , wk ) ∈ S to be |s| =
|w1 | + . . . + |wk | and write S (l) for the set of elements of S of length l. A
multitape automaton is a tuple A = (Σ, Q, E, Q0 , F ), where Q is a set of states,
E ⊆ Q × S (1) × Q is a set of edges, Q0 ⊆ Q is a set of initial states, and
Qf ⊆ Q is a set of final states. A run of A from state q0 to state qm is a finite
sequence of edges ρ = e1 e2 . . . em such that ei = (qi−1 , si , qi ). The label of ρ is
the product s1 s2 . . . sm ∈ S. Define the multiplicity A(s) of an input s ∈ S to be
the number of runs with label s such that q0 ∈ Q0 and qm ∈ Qf . An automaton
is deterministic if each state reads letters from a single tape and has a single
transition for every input letter. Thus a deterministic automaton has a single
run on each input s ∈ S.
3.2 Decidability
We start by recalling from [9] an equivalence-respecting transformation from
multitape automata to single-tape weighted automata.
Recall that a single-tape automaton on a unary alphabet with transition
weights in a ring R consists of a set of states Q = {q1 , . . . , qn }, initial states
Q0 ⊆ Q, final states Qf ⊆ Q, and transition matrix M ∈ Mn (R). Given such
an automaton, define the initial-state vector α ∈ R1×n and final-state vector
η ∈ Rn×1 respectively by
1 if qi ∈ Q0 1 if qi ∈ Qf
αi = and ηi =
0 otherwise 0 otherwise
Then αM l η is the weight of the (unique) input word of length l.
Consider a k-tape automaton A = (Σ, Q, E, Q0 , Qf ), where Σ = (Σ1 , . . . , Σk ),
and write S = Σ1∗ × · · · × Σk∗ . Recall the ring of polynomials
F Σ = F Σ1 ⊗ · · · ⊗ F Σn ,
Revisiting the Equivalence Problem for Finite Multitape Automata 429
as defined in Section 2. Recall also that we can identify the monoid S with the set of
monomials in F Σ, where (w1 , . . . , wk ) ∈ S corresponds to w1 ⊗· · ·⊗wk —indeed
F Σ is the free F -algebra on S.
We derive from A an F Σ-weighted automaton A 4 (with a single tape and
unary input alphabet) that has the same sets of states, initial states, and final
states as A. We define the transition matrix M of A 4 by combining the different
transitions of A into a single matrix with entries in F Σ. To this end, suppose
of states of A is Q = {q1 , . . . , qn }. Define the matrix M ∈ Mn (F Σ)
that the set
by Mij = (qi ,s,qj )∈E s for 1 ≤ i, j ≤ n.
Let α and η be the respective initial- and final-state vectors of A. 4 Then the
following proposition is straightforward. Intuitively it says that the weight of
the unary word of length l in A 4 represents the language of all length-l tuples
accepted by A.
Proposition 4. For all l ∈ N we have αM l η = s∈S (l) A(s) · s.
Now consider two k-tape automata A and B. Let the weighted single-tape au-
tomata derived from A and B have respective transition matrices MA and MB ,
initial-state vectors αA and αB , and final-state vectors η A and η B . We combine
the latter into a single weighted automaton with transition matrix M , initial-
state vector α, and final-state vector η, respectively defined by:
MA 0 ηA
α = (αA αB ) M= η=
0 MB −η B
Φl (αM l η) = 0 . (4)
α Φl (M )l η = 0 . (5)
Recall from Proposition 2 that the tensor product of generic matrix algebras
Fl Σ1 ⊗ · · · ⊗ Fl Σk is an Ore domain and hence can be embedded in a division
ring. Now a standard result about single-tape weighted automata with transition
weights in a division ring is that such an automaton with n states is equivalent
to the zero automaton if and only if it assigns zero weight to all words of length
n (see [5, pp143–145] and [18]). Applying this result to the unary weighted
automaton defined by α, M , and η, we see that (5) is implied by
α Φl (M )i η = 0 i = 0, 1, . . . , n − 1 . (6)
But, since Φl is a homomorphism, (6) is implied by
αM i η = 0 i = 0, 1, . . . , n − 1 . (7)
This concludes the proof. &
%
Theorem 2 immediately follows from Proposition 5.
Remark 1. The difference between our proof of Theorem 2 and the proof in [9]
is that we consider a family of homomorphisms of F Σ into Ore domains of
matrices—the maps Φl —rather than a single “global” embedding of F Σ into
a division ring of power series over a product of free groups. None of the maps
Φl is an embedding, but it suffices to use the lower bound on the degrees of
polynomial identities in Proposition 1 in lieu of injectivity. On the other hand,
the fact that Fl Σ1 ⊗ · · · ⊗ Fl Σk satisfies a polynomial identity makes it
relatively straightforward to exhibit an embedding of the latter into a division
ring. As we now show, this approach leads directly to a very simple randomised
polynomial-time algorithm for solving the equivalence problem.
4 Conclusion
We have given a simple randomised algorithm for deciding language equivalence
of deterministic multitape automata and multiplicity equivalence of nondeter-
ministic automata. The algorithm arises directly from algebraic constructions
used to establish decidability of the problem, and runs in polynomial time for
each fixed number of tapes. We leave open the question of whether there is a
deterministic polynomial-time algorithm for deciding the equivalence of deter-
ministic and weighted multitape automata with a fixed number of tapes. (Recall
that the 2-tape case is already known to be in polynomial time [7].) We also leave
open whether there is a deterministic or randomised polynomial time algorithm
for solving the problem in case the number of tapes is not fixed.
A Proof of Proposition 2
We first recall a construction of a crossed product division algebra from [17,
Proposition 1.1]. Let z1 , . . . , zk be commuting indeterminates and write F =
432 J. Worrell
Q(z1n , . . . , zkn ) for the field of rational functions obtained by adjoining z1n , . . . , zkn
to Q. Furthermore, let K/F be a field extension whose Galois group is generated
by commuting automorphisms σ1 , . . . , σk , each of order n, which has fixed field F .
(Such an extension can easily be constructed by adjoining extra indeterminates
to F , and having the σi be suitable permutations of the new indeterminates.)
For each i, 1 ≤ i ≤ k, write Ki for the subfield of K that is fixed by each σj
for j = i; then define Di to be the F -algebra generated by Ki and zi such that
azi = zi σi (a) for all a ∈ Ki . Then each Di is a simple algebra of dimension n2
over its centre F . It is shown in [17, Proposition 1.1] that the tensor product
D1 ⊗F · · · ⊗F Dk can be characterised as the localisation of an iterated skew
polynomial ring—and is therefore a domain.
The following two propositions are straightforward adaptations of [4, Propo-
sition 7.5.5.] and [4, Proposition 7.7.2] to partially commutative identities.
Proposition 6. Let f ∈ F X1 ⊗ · · · ⊗ F Xk . If the partially commutative
identity f = 0 holds in D1 ⊗F · · · ⊗F Dk then it also holds in (D1 ⊗F L) ⊗F
· · · ⊗F (Dk ⊗F L) for any extension field L of F .
Proof. Noting that the Di are all isomorphic as F -algebras, let {e1 , . . . , en2 } be
a basis of each Di over its centre F . For each variable x appearing in f , introduce
n2
commuting indeterminates txj , 1 ≤ j ≤ n2 , and write x = j=1 txj ej . Then we
can express f in the form
References
1. Amitsur, S.A., Levitzki, J.: Minimal identities for algebras. Proceedings of the
American Mathematical Society 1, 449–463 (1950)
2. Arvind, V., Mukhopadhyay, P.: Derandomizing the isolation lemma and lower
bounds for circuit size. In: Goel, A., Jansen, K., Rolim, J.D.P., Rubinfeld, R.
(eds.) APPROX and RANDOM 2008. LNCS, vol. 5171, pp. 276–289. Springer,
Heidelberg (2008)
3. Bogdanov, A., Wee, H.: More on noncommutative polynomial identity testing.
In: IEEE Conference on Computational Complexity, pp. 92–99. IEEE Computer
Society (2005)
4. Cohn, P.M.: Further Algebra and Applications. Springer (2003)
5. Eilenberg, S.: Automata, Languages, and Machines, vol. A. Academic Press (1974)
6. Elgot, C.C., Mezei, J.E.: Two-sided finite-state transductions (abbreviated ver-
sion). In: SWCT (FOCS), pp. 17–22. IEEE Computer Society (1963)
7. Friedman, E.P., Greibach, S.A.: A polynomial time algorithm for deciding the
equivalence problem for 2-tape deterministic finite state acceptors. SIAM J. Com-
put. 11(1), 166–183 (1982)
8. Griffiths, T.V.: The unsolvability of the equivalence problem for -free nondeter-
ministic generalized machines. J. ACM 15(3), 409–413 (1968)
9. Harju, T., Karhumäki, J.: The equivalence problem of multitape finite automata.
Theor. Comput. Sci. 78(2), 347–355 (1991)
10. Kiefer, S., Murawski, A., Ouaknine, J., Wachter, B., Worrell, J.: On the complexity
of equivalence and minimisation for Q-weighted automata. Logical Methods in
Computer Science 9 (2013)
11. Malcev, A.I.: On the embedding of group algebras in division algebras. Dokl. Akad.
Nauk 60, 1409–1501 (1948)
12. Mulmuley, K., Vazirani, U.V., Vazirani, V.V.: Matching is as easy as matrix inver-
sion. In: STOC, pp. 345–354 (1987)
13. Neumann, B.H.: On ordered groups. Amer. J. Math. 71, 1–18 (1949)
14. Neumann, B.H.: On ordered division rings. Trans. Amer. Math. Soc. 66, 202–252
(1949)
15. Rabin, M., Scott, D.: Finite automata and their decision problems. IBM Journal
of Research and Development 3(2), 114–125 (1959)
16. Sakarovich, J.: Elements of Automata Theory. Cambridge University Press (2003)
17. Saltman, D.: Lectures on Division Algebras. American Math. Soc. (1999)
18. Schützenberger, M.-P.: On the definition of a family of automata. Inf. and Con-
trol 4, 245–270 (1961)
19. Tzeng, W.: A polynomial-time algorithm for the equivalence of probabilistic au-
tomata. SIAM Journal on Computing 21(2), 216–227 (1992)
Silent Transitions in Automata with Storage
Georg Zetzsche
1 Introduction
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 434–445, 2013.
c Springer-Verlag Berlin Heidelberg 2013
Silent Transitions in Automata with Storage 435
There is a wide variety of machine models that consist of a finite state control
with a one-way input and some mechanism to store data, for example (higher
order) pushdown automata, various kinds of counter automata [8], or off-line
Turing machines that can only move right on the input tape.
For some of these models, it is known whether silent transitions can be elim-
inated. For example, the Greibach normal form allows their removal from push-
down automata. Furthermore, for blind counter automata (i.e., the counters can
go below zero and a zero-test is only performed in the end), Greibach also has
also shown that silent transitions can be avoided [8]. However, for partially blind
counter automata (i.e., the counters cannot go below zero and are only zero-
tested in the end) or, equivalently, Petri nets, there are languages for which
silent transitions are indeed necessary [8, 11].
The aim of this work is to generalize these results and obtain insights into
how the structure of the storage mechanism influences the computational power
of the real-time variant. In order to study the expressive power of real-time
computations in greater generality, we use the model of valence automata. For
our purposes, a storage mechanism consists of a (possibly infinite) set of states
and partial transformations operating on them. Such a mechanism often works
in a way such that a computation is considered valid if the composition of the
applied transformations is the identity. For example, in a pushdown storage, the
operations push and pop (for each participating stack symbol) and compositions
thereof are partial transformations on the set of words over some alphabet. In
this case, a computation is valid if, in the end, the stack is brought back to
the initial state, i.e., the identity transformation has been applied. Furthermore,
in a partially blind counter automaton, a computation is valid if it leaves the
counters with value zero, i.e., the composition of the applied operations increase
and decrease is the identity. Therefore, the set of all compositions of the partial
transformations forms a monoid such that, for many storage mechanisms, a
computation is valid if the composition of the transformations is the identity.
A valence automaton is a finite automaton in which each edge carries, in
addition to an input word, an element of a monoid. A word is then accepted if
there is a computation that spells the word and for which the product of the
monoid elements is the identity. Valence automata have been studied throughout
the last decades [4, 5, 10, 12, 16, 17].
The contribution of this work is threefold. On the one hand, we introduce a
class of monoids that accommodates, among others, all storage mechanisms for
which we mentioned previous results on silent transitions. The monoids in this
class are graph products of copies of the bicyclic monoid and the integers. On the
other hand, we present two generalizations of those established facts. Our first
main result is a characterization of those monoids in a certain subclass for which
silent transitions can be eliminated. This subclass contains, among others, both
the monoids corresponding to pushdown storages as well as those corresponding
to blind multicounter storages. Thus, we obtain a generalization and unification
of two of the three λ-removal results above. For those storage mechanisms in this
subclass for which we can remove silent transitions, there is a simple intuitive
436 G. Zetzsche
2 Basic Notions
A monoid is a set M together with an associative operation and a neutral ele-
ment. Unless defined otherwise, we will denote the neutral element of a monoid
by 1 and its operation by juxtaposition. That is, for a monoid M and a, b ∈ M ,
ab ∈ M is their product. For a, b ∈ M , we write a . b if there is a c ∈ M such
that b = ac. By 1, we denote the trivial monoid that consists of just one element.
We call a monoid commutative if ab = ba for any a, b ∈ M . A subset N ⊆ M
is said to be a submonoid of M if 1 ∈ N and a, b ∈ N implies ab ∈ N . In each
monoid M , we have the submonoids H(M ) = {a ∈ M | ∃b ∈ M : ab = ba = 1},
R(M ) = {a ∈ M | ∃b ∈ M : ab = 1}, and L(M ) = {a ∈ M | ∃b ∈ M : ba = 1}.
When using a monoid M as part of a control mechanism, the subset J(M ) =
{a ∈ M | ∃b, c ∈ M : bac = 1} will play an important role. By M n , we denote
the n-fold direct product of M , i.e. M n = M × · · · × M with n factors.
Let S ⊆ M be a subset. If there is no danger of confusion with the n-fold
direct product, we write S n for the set of all elements of M that can be written
as a product of n factors from S.
Let Σ be a fixed countable set of abstract symbols, the finite subsets of which
are called alphabets. For an alphabet X, we will write X ∗ for the set of words
over X. The empty word is denoted by λ ∈ X ∗ . Together with concatenation as
its operation, X ∗ is a monoid. For a symbol x ∈ X and a word w ∈ X ∗ , let |w|x
be the number of occurrences of x in w. Given an alphabet X and a monoid M ,
subsets of X ∗ and X ∗ × M are called languages and transductions, respectively.
A family is a set of languages that is closed under isomorphism and contains at
least one non-trivial member.
Given an alphabet X, we write X ⊕ for the set of maps α : X → N. Elements
of X ⊕ are called multisets. By way of pointwise addition, written α + β, X ⊕ is a
commutative monoid. We write 0 for the empty multiset, i.e. the one that maps
every x ∈ X to 0 ∈ N. For α ∈ X ⊕ , let |α| = x∈X α(x). The Parikh mapping
is the mapping Ψ : Σ ∗ → Σ ⊕ with Ψ (w)(x) = |w|x for w ∈ Σ ∗ and x ∈ Σ.
Let A be a (not necessarily finite) set of symbols and R ⊆ A∗ × A∗ . The
pair (A, R) is called a (monoid) presentation. The smallest congruence of A∗
Silent Transitions in Automata with Storage 437
containing R is denoted by ≡R and we will write [w]R for the congruence class
of w ∈ A∗ . The monoid presented by (A, R) is defined as A∗ /≡R . Note that
since we did not impose a finiteness restriction on A, every monoid has a pre-
sentation. Furthermore, for monoids M1 , M2 we can find presentations (A1 , R1 )
and (A2 , R2 ) such that A1 ∩ A2 = ∅. We define the free product M1 ∗ M2 to
be presented by (A1 ∪ A2 , R1 ∪ R2 ). Note that M1 ∗ M2 is well-defined up to
isomorphism. By way of the injective morphisms [w]Ri !→ [w]R1 ∪R2 , w ∈ A∗i for
i = 1, 2, we will regard M1 and M2 as subsets of M1 ∗ M2 . In analogy to the
n-fold direct product, we write M (n) for the n-fold free product of M .
Rational Sets. Let M be a monoid. An automaton over M is a tuple A =
(Q, M, E, q0 , F ), in which Q is a finite set of states, E is a finite subset of Q ×
M × Q called the set of edges, q0 ∈ Q is the initial state, and F ⊆ Q is the set of
final states. The step relation ⇒A of A is a binary relation on Q × M , for which
(p, a) ⇒A (q, b) iff there is an edge (p, c, q) such that b = ac. The set generated
by A is then S(A) = {a ∈ M | ∃q ∈ F : (q0 , 1) ⇒∗A (q, a)}.
A set R ⊆ M is called rational if it can be written as R = S(A) for some
automaton A over M . The set of rational subsets of M is denoted by RAT(M ).
Given two subsets S, T ⊆ M , we define ST = {st | s ∈ S, t ∈ T }. Since {1} ∈
RAT(M ) and ST ∈ RAT(M ) whenever S, T ∈ RAT(M ), this operation makes
RAT(M ) a monoid itself.
Let C be a commutative monoid for which we write the composition additively.
For n ∈ N and c ∈ C, we use nc to denote c + · · · + c (n summands). A subset
n
S ⊆ C is linear if there are elements s0 , . . . , sn such that S = {s0 + i=1 ai si |
ai ∈ N, 1 ≤ i ≤ n}. A set S ⊆ C is called semilinear if it is a finite union of
linear sets. By SL(C), we denote the set of semilinear subsets of C. It is well-
known that RAT(C) = SL(C) for commutative C (we will, however, sometimes
still use SL(C) to make explicit that the sets at hand are semilinear). Moreover,
SL(C) is a commutative monoid by way of the product (S, T ) !→ S + T = {s + t |
s ∈ S, t ∈ T }. It is well-known that the class of semilinear subsets of a free
commutative monoid is closed under intersection [6].
In slight abuse of terminology, we will sometimes call a language L semilinear
if the set Ψ (L) is semilinear. If there is no danger of confusion, we will write S ⊕
instead of S if S is a subset of a commutative monoid C. Note that if X is
regarded as a subset of X ⊕ , the two meanings of X ⊕ coincide.
Valence Automata. A valence automaton over M is an automaton A over the
monoid X ∗ × M , where X is an alphabet. An edge (p, w, m, q) in A is called a
λ-transition if w = λ. A is called λ-free if it has no λ-transitions. The language
accepted by A is defined as L(A) = {w ∈ X ∗ | (w, 1) ∈ S(A)}. The class of
languages accepted by valence automata and λ-free valence automata over M is
denoted by VA(M ) and VA+ (M ), respectively.
A finite automaton is a valence automaton over the trivial monoid 1. For a
finite automaton A = (Q, X ∗ × 1, E, q0 , F ), we also write A = (Q, X, E, q0 , F ).
Languages accepted by finite automata are called regular languages. The finite
automaton A is spelling, if E ⊆ Q × X × Q, i.e. every edges carries exactly one
438 G. Zetzsche
RΓ = {(av āv , λ) | v ∈ V } ∪ {(xy, yx) | x ∈ {av , āv }, y ∈ {aw , āw }, {v, w} ∈ E}.
MΓ = XΓ∗ /≡Γ .
3 Overview of Results
Storage Mechanisms as Monoids. First, we will see how pushdown storages
and (partially) blind counters can be regarded as monoids of the form MΓ .
See Table 1 for examples. Clearly, in the bicyclic monoid B, a word over the
generators a and ā is the identity if and only if in every prefix of the word, there
are at least as many a’s as there are ā’s and in the whole word, there are as
many a’s as there are ā’s. Thus, a valence automaton over B is an automaton
with one counter that cannot go below zero and is zero in the end. Here, the
increment operation corresponds to a and the decrement corresponds to ā.
Silent Transitions in Automata with Storage 439
Observe that building the direct product means that both storage mechanisms
(described by the factors) are available and can be used simultaneously. Thus,
valence automata over Bn are automata with n partially blind counters. There-
fore, if Γ is a clique, then MΓ ∼= Bn corresponds to a partially blind multicounter
storage.
Furthermore, the free product of a monoid M with B yields what can be
seen as a stack of elements of M : a valence automaton over M ∗ B can store a
sequence of elements of M (separated by a) such that it can only remove the
topmost element if it is the identity element. The available operations are those
available for M (which then operate on the topmost entry) and in addition push
(represented by a) and pop (represented by ā). Thus, B ∗ B corresponds to a
stack over two symbols. In particular, if Γ is an anti-clique (with at least two
vertices), then MΓ ∼ = B(n) represents a pushdown storage.
Finally, valence automata over Zn (regarded as a monoid by way of addition)
correspond to automata with n blind counters. Hence, if Γ is a looped clique,
then MΓ ∼ = Zn corresponds to a blind multicounter storage.
Main Results. Our class of monoids that generalizes pushdown and blind
multicounter storages is the class of MΓ where in Γ , any two looped vertices are
adjacent and no two unlooped vertices are adjacent. Our first main result is the
following.
Theorem 1. Let Γ be a graph such that any two looped vertices are adjacent
and no two unlooped vertices are adjacent. Then, the following are equivalent:
(1) VA+ (MΓ ) = VA(MΓ ).
(2) Every language in VA(MΓ ) is context-sensitive.
(3) The membership problem of each language in VA(MΓ ) is in NP.
(4) Every language in VA(MΓ ) is decidable.
(5) Γ does not contain as an induced subgraph.
440 G. Zetzsche
Note that this generalizes the facts that in pushdown automata and in blind
counter automata, λ-transitions can be avoided. Furthermore, while Greibach’s
construction triples the number of counters, we do not need any additional ones.
It turns out that the storages that satisfy the equivalent conditions of Theorem
1 (and the hypothesis), are exactly those in the following class.
Definition 1. Let C be the smallest class of monoids such that 1 ∈ C and when-
ever M ∈ C, we also have M × Z ∈ C and M ∗ B ∈ C.
Thus, C contains those storage types obtained by successively adding blind coun-
ters and building a stack of elements. For example, we could have a stack each
of whose entries contains n blind counters. Or we could have an ordinary push-
down and a number of blind counters. Or a stack of elements, each of which is
a pushdown storage and a blind counter, etc. The simplest example of a stor-
age mechanism in C beyond blind multicounters and pushdowns is given by the
monoids (B ∗ B) × Zn for n ∈ N. It is not hard to see that these yield the same
languages as Parikh pushdown automata [13]. Hence, our result implies that the
latter also permit the removal of λ-transitions.
Our second main result concerns storages consisting of a number of blind
counters and a number of partially blind counters.
Theorem 2. Let Γ be a graph such that any two distinct vertices are adjacent.
Then, VA+ (MΓ ) = VA(MΓ ) if and only if r ≤ 1, where r is the number of
unlooped vertices in Γ .
In other words, when one has r partially blind counters and s blind counters,
λ-transitions can be eliminated if and only if r ≤ 1. Note that this generalizes
Greibach’s result that in partially blind multicounter automata, λ-transitions
are indispensable.
Key Technical Ingredients. As a first step, we show that for M ∈ C, all lan-
guages in VA(M ) are semilinear. This is needed in various situations throughout
the proof. We prove this using an old result by van Leeuwen [14], which states
that languages that are algebraic over a class of semilinear languages are semi-
linear themselves. Thereby, the corresponding Lemma 2 slightly generalizes one
of the central components in a decidability result by Lohrey and Steinberg on
the rational subset membership problem for graph groups [15] and provides a
simpler proof (relying, however, on van Leeuwen’s result).
Second, we use an undecidability result by Lohrey and Steinberg [15] concern-
ing the rational subset membership problem for certain graph groups. We deduce
that for monoids M outside of C (and satisfying the hypothesis of Theorem 1),
VA(M ) contains an undecidable language.
Third, in order to prove our claim by induction on the construction of M ∈ C,
we use a significantly stronger induction hypothesis: We show that it is not
only possible to remove λ-transitions from valence automata, but also from va-
lence transducers with output in a commutative monoid. Here, however, the con-
structed valence transducer is allowed to output a semilinear set in each step.
Monoids that admit such a transformation will be called strongly λ-independent.
Silent Transitions in Automata with Storage 441
4 Semilinear Languages
This section contains semilinearity results that will be needed in later sections.
The first lemma guarantees small preimages of morphisms from multisets to the
integers. This will be used to bound the number of necessary operations on a
blind counter in order to obtain a given counter value.
Lemma 1. Let ϕ : X ⊕ → Z be a morphism. Then for any n ∈ Z, the set ϕ−1 (n)
is semilinear. In particular, ker ϕ is finitely generated. Furthermore, there is a
constant k ∈ N such that for any μ ∈ X ⊕ , there is a ν . μ with μ ∈ ν + ker ϕ
and |ν| ≤ k · |ϕ(μ)|.
Another fact used in later sections is that languages in VA(M ) are semilinear
if M ∈ C. This will be employed in various constructions, for instance when
the effect of computations (that make use of M as storage) on the output in a
commutative monoid is to be realized by a finite automaton. We prove this using
a result of van Leeuwen [14], which states that semilinearity of all languages in a
442 G. Zetzsche
family is inherited by languages that are algebraic over this family. A language
is called algebraic over a family of languages if it is generated by a grammar in
which each production allows a non-terminal to be replaced by any word from
a language in this family.
Note that in [15], a group G is called SLI-group if every language in VA(G) is
semilinear (in different terms, however). Thus, the following recovers the result
from [15] that the class of SLI-groups is closed under taking the free product.
Lemma 2. Every L ∈ VA(M0 ∗ M1 ) is algebraic over VA(M0 ) ∪ VA(M1 ).
Combining the latter lemma with van Leeuwen’s result and a standard argument
for the preservation of semilinearity when builing the direct product with Z yields
the following.
Lemma 3. Let M ∈ C. Then, every language in VA(M ) is semilinear.
5 Membership Problems
In this section, we study decidability and complexity of the membership problem
for valence automata over MΓ . Specifically, we show in this section that for
certain graphs Γ , the class VA(MΓ ) contains undecidable languages (Lemma
5), while for every Γ , membership for languages in VA+ (MΓ ) is (uniformly)
decidable. We present two nondeterministic algorithms, one of them uses linear
space and one runs in polynomial time (Lemma 4).
These results serve two purposes. First, for those graphs Γ for which there
are undecidable languages in VA(MΓ ), it follows that silent transitions are in-
dispensable. Second, if we can show that silent transitions can be removed from
valence automata over MΓ , the algorithms also apply to languages in VA(MΓ ).
Our algorithms rely on the convergence property of certain reduction sys-
tems. For more information on reduction systems, see [1, 9]. The following
lemma makes use of two algorithms to decide, given a word w ∈ XΓ∗ , whether
[w]Γ = [λ]Γ . Specifically, we have a deterministic polynomial-time algorithm
that employs a convergent trace rewriting system to successively reduce a de-
pendence graph, which is then checked for emptiness. On the other hand, the
convergence of the same rewriting system is used in a (nondeterministic) linear
space algorithm to decide the equality above. These two algorithms are then
used to verify the validity of a guessed run to decide the membership problem
for languages in VA+ (MΓ ).
Lemma 4. For each L ∈ VA+ (MΓ ), the membership problem can be decided
by a nondeterministic polynomial-time algorithm as well as a nondeterministic
linear-space algorithm. Hence, the languages in VA+ (MΓ ) are context-sensitive.
The undecidability result is shown by reducing the rational subset membership
problem of the graph group corresponding to a path on four vertices, which was
proven undecidable by Lohrey and Steinberg [15], to the membership problem
of languages L ∈ VA(MΓ ).
Lemma 5. Let Γ be a graph whose underlying loop-free graph is a path on four
vertices. Then, VA(MΓ ) contains an undecidable language.
Silent Transitions in Automata with Storage 443
6 Rational Sets
When removing silent transitions, we will regard an automaton with silent tran-
sition as an automaton that is λ-free but is allowed to multiply a rational subset
(of the storage monoid) for each input symbol. In order to restrict the ways in
which elements can cancel out, these rational sets are first brought into a normal
form. Our normal form result essentially states that there is an automaton that
reads the generators in an order such that certain cancellations do not occur on
any path. Note that in a valence automaton over M , we can remove all edges
labeled with elements outside of J(M ). This is due to the fact that they cannot
be part of a valid computation. In a valence transducer over M with output
in C, the edges carry elements from X ∗ × M × C. Therefore, in the situation
outlined above, a rational set S ⊆ M × C will be replaced by S ∩ (J(M ) × C).
for 1 ≤ i ≤ n. Moreover,
) )
S ∩ (L(M ) × C) = L i Ui , S ∩ (R(M ) × C) = Ui Ri .
1≤i≤n 1≤i≤n
1∈Ri 1∈Li
7 Silent Transitions
The first lemma in this section can be shown using a simple combinatorial
argument.
Lemma 7. Let Γ be a graph such that any two looped vertices are adjacent, no
two unlooped vertices are adjacent, and Γ does not contain
as an induced subgraph. Then, MΓ is in C.
We prove Theorem 1 by showing that VA+ (M ) = VA(M ) for every M ∈ C. This
will be done using an induction with respect to the definition of C. In order for
this induction to work, we need to strengthen the induction hypothesis. The
latter will state that for any M ∈ C and any commutative monoid C, we can
transform a valence transducer over M with output in C into another one that
has no λ-transitions but is allowed to output a semilinear set of elements in
each step. Formally, we will show that each M ∈ C is strongly λ-independent :
Let C be a commutative monoid and T ⊆ X ∗ × SL(C) be a transduction. Then
Φ(T ) ⊆ X ∗ × C is defined as Φ(T ) = {(w, c) ∈ X ∗ × C | ∃(w, S) ∈ T : c ∈ S}.
For a class F of transductions, Φ(F ) is the class of all Φ(T ) with T ∈ F .
A monoid M is called strongly λ-independent if for any commutative monoid
C, we have VT(M, C) = Φ(VT+ (M, SL(C))). Note that Φ(VT+ (M, SL(C))) ⊆
VT(M, C) holds for any M and C. In order to have equality, it is necessary to
grant the λ-free transducer the ability to output semilinear sets, since valence
444 G. Zetzsche
transducers without λ-transitions and with output in C can only output finitely
many elements per input word. With λ-transitions, however, a valence transducer
can output an infinite set for one input word.
By choosing the trivial monoid for C, we can see that for every strongly
λ-independent monoid M , we have VA+ (M ) = VA(M ). Indeed, given a valence
automaton A over M , add an output of 1 to each edge and transform the resulting
valence transducer into a λ-free one with output in SL(1). The latter can then
clearly be turned into a valence automaton for the language accepted by A.
The following three lemmas each employ a different technique to eliminate
silent transitions. Together with Lemma 7 and the results in Section 5, they
yield the main result.
Lemma 8. B is strongly λ-independent.
Lemma 9. If M ∈ C is strongly λ-independent, then M × Z is as well.
Lemma 10. Suppose M ∈ C is non-trivial and strongly λ-independent. Then,
M ∗ B is strongly λ-independent as well.
We will now outline the proof of Theorem 2. By Theorem 1, we already know
that when r ≤ 1, we have VA+ (MΓ ) = VA(MΓ ). Hence, it suffices to show
that VA+ (MΓ ) VA(MΓ ) if r ≥ 2. Greibach [8] and, independently, Jantzen
[11] have shown that the language L1 = {wcn | w ∈ {0, 1}∗, n ≤ bin(w)}
can be accepted by a partially blind counter machine with two counters, but not
without λ-transitions. Here, bin(w) denotes the number obtained by interpreting
w as a base 2 representation: bin(w1) = 2 · bin(w) + 1, bin(w0) = 2 · bin(w),
bin(λ) = 0. Since we have to show VA+ (Br × Zs ) VA(Br × Zs ) and we know
L1 ∈ VA(Br × Zs ), it suffices to prove L1 ∈ / VA+ (Br × Zs ). We do this by
transforming Greibach’s and Jantzen’s proof into a general property of languages
accepted by valence automata without λ-transitions. We will then apply this to
show that L1 ∈ / VA+ (Br × Zs ).
Let M be a monoid. For x, y ∈ M , write x ≡ y iff x and y have the same
set of right inverses. For a finite subset S ⊆ M and n ∈ N, let fM,S (n) be the
number of equivalence classes of ≡ in S n ∩ R(M ). The following notion is also
used as a tool to prove lower bounds in state complexity of finite automata [7].
Here, we use it to prove lower bounds on the number of configurations that an
automaton must be able to reach in order to accept a language L. Let n ∈ N.
An n-fooling set for a language L ⊆ Θ∗ is a set F ⊆ Θn × Θ∗ such that (i)
for each (u, v) ∈ F , we have uv ∈ L, and (ii) for (u1 , v1 ), (u2 , v2 ) ∈ F such
that u1 = u2 , we have u1 v2 ∈/ L or u2 v1 ∈/ L. Let gL : N → N be defined as
gL (n) = max{|F | | F is an n-fooling set for L}.
The following three lemmas imply that L1 ∈ / VA+ (Br × Zs ) for any r, s ∈ N.
Lemma 11. Let M be a monoid and L ∈ VA+ (M ). Then, there is a constant
k ∈ N and a finite set S ⊆ M such that gL (n) ≤ k · fM,S (n) for all n ∈ N.
Lemma 12. For L = L1 , we have gL (n) ≥ 2n for every n ∈ N.
Lemma 13. Let M = Br × Zs for r, s ∈ N and S ⊆ M a finite set. Then, fM,S
is bounded by a polynomial.
Silent Transitions in Automata with Storage 445
Acknowledgements. The author would like to thank Nils Erik Flick, Reiner
Hüchting, Matthias Jantzen, and Klaus Madlener for comments that improved
the presentation of the paper.
References
[1] Book, R.V., Otto, F.: String-Rewriting Systems. Springer, New York (1993)
[2] Bouajjani, A., Esparza, J., Maler, O.: Reachability Analysis of Pushdown Au-
tomata: Application to Model-Checking. In: Mazurkiewicz, A., Winkowski, J.
(eds.) CONCUR 1997. LNCS, vol. 1243, pp. 135–150. Springer, Heidelberg (1997)
[3] Caucal, D.: On infinite transition graphs having a decidable monadic theory.
Theor. Comput. Sci. 290(1), 79–115 (2003)
[4] Elder, M., Kambites, M., Ostheimer, G.: On Groups and Counter Automata.
Internat. J. Algebra Comput. 18(8), 1345–1364 (2008)
[5] Gilman, R.H.: Formal Languages and Infinite Groups. In: Geometric and Compu-
tational Perspectives on Infinite Groups. DIMACS Series in Discrete Mathematics
and Theoretical Computer Science, vol. 25 (1996)
[6] Ginsburg, S., Spanier, E.H.: Bounded Algol-Like Languages. Trans. Amer. Math.
Soc. 113(2), 333–368 (1964)
[7] Glaister, I., Shallit, J.: A lower bound technique for the size of nondeterministic
finite automata. Inf. Process. Lett. 59(2), 75–77 (1996)
[8] Greibach, S.A.: Remarks on blind and partially blind one-way multicounter ma-
chines. Theor. Comput. Sci. 7(3), 311–324 (1978)
[9] Huet, G.: Confluent Reductions: Abstract Properties and Applications to Term
Rewriting Systems. J. ACM 27(4), 797–821 (1980)
[10] Ibarra, O.H., Sahni, S.K., Kim, C.E.: Finite automata with multiplication. Theor.
Comput. Sci. 2(3), 271–294 (1976)
[11] Jantzen, M.: Eigenschaften von Petrinetzsprachen. German. PhD thesis. Univer-
sität Hamburg (1979)
[12] Kambites, M.: Formal Languages and Groups as Memory. Communications in
Algebra 37(1), 193–208 (2009)
[13] Karianto, W.: Adding Monotonic Counters to Automata and Transition Graphs.
In: De Felice, C., Restivo, A. (eds.) DLT 2005. LNCS, vol. 3572, pp. 308–319.
Springer, Heidelberg (2005)
[14] van Leeuwen, J.: A generalisation of Parikh’s theorem in formal language theory.
In: Loeckx, J. (ed.) ICALP 1974. LNCS, vol. 14, pp. 17–26. Springer, Heidelberg
(1974)
[15] Lohrey, M., Steinberg, B.: The submonoid and rational subset membership prob-
lems for graph groups. J. Algebra 320(2), 728–755 (2008)
[16] Mitrana, V., Stiebe, R.: Extended finite automata over groups. Discrete Applied
Mathematics 108(3), 287–300 (2001)
[17] Render, E., Kambites, M.: Rational subsets of polycyclic monoids and valence
automata. Inform. and Comput. 207(11), 1329–1339 (2009)
New Online Algorithms for Story Scheduling
in Web Advertising
1 Introduction
Online advertising has grown steadily over the last years. The worldwide online
ad spending reached $100 billion in 2012 and is expected to surpass the print ad
spending during the next few years [4,9]. In this paper we study an algorithmic
problem in advertising introduced by Dasgupta, Ghosh, Nazerzadeh and Ragha-
van [3]. An advanced online ad format is storyboarding, which was first launched
by New York Times Digital and is also referred to as surround sessions [10].
In storyboarding, while a user surfs the web and visits a particular website, a
single advertiser controls a major ad position for a certain continuous period of
time. The advertiser can use these time slots to showcase a range of products
and build a linear story line. Typically several advertisers compete for the ad
position, depending on the user’s browsing history and current actions. The goal
of an ad server is to allocate advertisers to the time slots of a user’s browsing
session so as to maximize the total revenue.
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 446–458, 2013.
c Springer-Verlag Berlin Heidelberg 2013
New Online Algorithms for Story Scheduling in Web Advertising 447
no algorithm can achieve a constant competitive ratio and gave a strategy with a
logarithmic competitiveness. Finally Dasgupta et al. studied an extension where
a job must be scheduled immediately upon arrival; otherwise it is lost. Here they
proved a logarithmic lower bound on the performance of any randomized online
strategy.
Our Contribution: We present new and improved online algorithms for story-
boarding. All strategies follow the paradigm of processing a given job sequence
I in phases, where a phase consists of k consecutive time steps in the scheduling
horizon, for some k ∈ N. At the beginning of each phase an algorithm computes
a schedule for the phase, ignoring jobs that may arrive during the phase. Hence
the strategies have to make scheduling decisions only every once in a while.
First in Section 2 we give a simple algorithm that computes an optimal sched-
ule for each phase and preempts jobs that are not finished at the end of the
respective phase. We prove that the competitive ratio of this strategy is exactly
1/(β k−1 (1 − β k )), for all k ∈ N and all β. The best choice of k gives a com-
petitiveness of 4/(2 − β), which is upper bounded by 4 for any β. If k is set to
1, the resulting algorithm is 1/(1 − β)-competitive. This gives further improved
bounds for small β, i.e. when β < 2/3.
In Section 3, as our main contribution, we devise a refined algorithm that
prefers not to preempt jobs sequenced last in a phase but rather tries to continue
them in the following phase. The competitive ratio of this strategy is upper
bounded by 1/β k−1 · max{1/β k−1 , 1/(1 − β 2k ), β 3k /(1 − β k )}. Using the√ best
choice of k, we obtain a competitive factor of c = 1 + φ, where φ = (1 + 5)/2
is the Golden Ratio. Hence c ≈ 2.618 and this performance guarantee is close to
the lower bound of 2 presented by Dasgupta et al. [3] for general β.
In Section 4 we consider for the first time a problem extension where a web
page features not only one but several ad positions where stories can be presented
simultaneously. This is a natural extension because many web pages do contain
a (small) number of ad positions. Again a job sequence I = (ai , vi , li )N i=1 is
triggered by the browsing history of a user. We assume that an ad server may
assign these jobs to a general number m of ad positions. Following the scheduling
terminology we refer to these ad positions as machines. In a feasible schedule
each job must be processed continuously without interruption on one machine.
A
∞ migration
m of jobs among machines is not allowed. The value of a schedule is
t
t=0 j=1 β v(t, j), where v(t, j) is the per-unit value of the job scheduled on
machine j at time t. We extend our first algorithm to this parallel setting √ and
derive
√ a strategy that achieves a competitive ratio of
√ (1 + 1/(1 − β(2 − 2))/(2 −
2). For small β, this ratio can be as
√ low as 2/(2 − 2) ≈ 3.414. For any β, the
ratio is upper bounded by 1/(3 − 2 2) ≈ 5.828.
In the analyses of the algorithms we consider quantized inputs in which job
arrival times are integer multiples of k. For the setting where one ad position
is available (Sections 2 and 3), we are able to prove an interesting property
given any quantized input: In an online schedule or a slight modification thereof,
no job starts later than in an optimal offline schedule. This property has the
important consequence that, for its scheduled job portions, an online algorithm
New Online Algorithms for Story Scheduling in Web Advertising 449
2 A 4-competitive Algorithm
As mentioned before, all algorithms we present in this paper process a job se-
quence in phases. Let k ≥ 1 be an integer. A k-phase consists of k consecutive
time steps in the scheduling horizon. More specifically, the n-th k-phase is the
subsequence of time steps Pn = (n − 1)k, . . . , nk − 1, for any n ≥ 1. Our first
algorithm, called ALG1 k , computes an optimal schedule for any phase, given the
jobs that are available at the beginning of the phase. Such an optimal schedule
is obtained by simply sequencing the available jobs in order of non-increasing
per-unit value. Jobs that arrive during the phase are deferred until the beginning
of the next phase.
Formally, ALG1 k works as follow. We say that a job i is available at time t
if the job has arrived by time t, i.e. ai ≤ t, and has not been scheduled so far at
any time t < t. Consider an arbitrary phase Pn and let Qn be the set of jobs
that are available at the beginning of Pn . We note that Qn includes the jobs
that arrive at time (n − 1)k. ALG1 k constructs a schedule for Pn by first sorting
the jobs of Qn in order of non-increasing per-unit value. Jobs having the same
per-unit value are sorted in order of increasing arrival times; ties may be broken
arbitrarily. Given this sorted sequence, ALG1 k then assigns the jobs one by one
to Pn until the k time steps are scheduled or the job sequence ends. In the former
case, the last job assigned to Pn is preempted at the end of the phase unless the
job completes by the end of Pn . ALG1 k executes this schedule for Pn , ignoring
jobs that may arrive during the phase at times t = (n − 1)k + 1, . . . , nk − 1.
We first evaluate the performance of ALG1 k , for general k. Then we will
determine the best choice of k.
Theorem 1. For all k ∈ N and all probabilities β, ALG1 k is 1/(β k−1 (1 − β k ))-
competitive.
In the following we prove the above theorem. Let I = (ai , vi , li )N
i=1 be an ar-
bitrary input. In processing I, ALG1 k defers jobs arriving after the beginning
of a phase until the start of the next phase. Consider a k-quantized input Ik
450 S. Albers and A. Passen
in which the arrival time of any job is set to the next integer multiple of k,
i.e. Ik = (ai , vi , li )N
i=1 , where ai = k ai /k . If ai is a multiple of k and hence
coincides with the beginning of a k-phase, the job is not delayed. Otherwise
the job is delayed until the beginning of the next phase. The schedule gener-
ated by ALG1 k for Ik is identical to that computed by ALG1 k for I. Thus
ALG1 k (Ik ) = ALG1 k (I). In order to prove Theorem 1 it will be convenient to
compare ALG1 k (Ik ) to OPT (Ik ). The next lemma ensures that OPT (Ik ) and
the true optimum OPT (I) differ by a factor of at most 1/β k−1 .
Lemma 1. For all k ∈ N and all probabilities β, 1/β k−1 · OPT (Ik ) ≥ OPT (I).
In order to estimate OPT (Ik ) we consider a stronger optimal offline algorithm
that was also proposed by Dasgupta et al. [3]. This algorithm is allowed to resume
interrupted jobs at a later point in time. We call this offline strategy CHOP .
For any input, at any time t CHOP schedules a job having the highest per-
unit value among the unfinished jobs that have arrived until time t. Obviously,
CHOP(Ik ) ≥ OPT (Ik ). Let S be the schedule computed by ALG1 k for Ik and
let S be the schedule generated by CHOP for Ik . We assume w.l.o.g. that in
S all jobs having a certain per-unit value v are processed in the same order as
in S. More specifically, all jobs having per-unit value v are processed in order
of increasing arrival times. Jobs of per-unit value v arriving at the same time
are processed in the same order as in S. Schedule S can be easily modified so
that this property is satisfied. For any job i, let tS (i) denote its starting time in
S and let tS (i) be its starting time in S . If job i is never processed in S (or
S ), then we set tS (i) = ∞ (or tS (i) = ∞). The following lemma states that
ALG1 k starts each job at least as early as CHOP .
Lemma 2. For any job i, tS (i) ≤ tS (i).
these units cannot be sequenced before the beginning of phase Pn+1 , i.e. at time
nk. Thus the additional value achievable for units λj +1, . . . , lj is upper bounded
by β nk /(1 − β) · vj , which is obtained if a job of per-unit value vj and infinite
length is sequenced starting at time nk.
Thus CHOP (Pn ) ≤ ALG1 k (Pn ) + β nk /(1 − β) · vj . In each phase ALG1 k
sequences jobs in order of non-increasing per-unit value. Hence each job of In has
a per-unit value of at least vj . We conclude ALG1 k (Pn ) ≥ (β (n−1)k − β nk )/(1 −
β) · vj and CHOP(Pn )/ALG1 k (Pn ) ≤ 1 + β nk /(β (n−1)k − β nk ) = 1/(1 − β k ).
Combining Lemmas 1 and 3 together with the fact ALG1 k (I) = ALG1 k (Ik ),
we obtain Theorem 1. We determine the best value of k.
Corollary 1. For k = − logβ 2 , the resulting ALG1 k is 4/(2 − β)-competitive.
The above theorem shows our analysis of ALG1 k is tight. Finally we consider
the algorithm ALG1 1 in which the phase length k is set to 1.
Corollary 2. For all probabilities β, the competitive ratio of ALG1 1 is exactly
1/(1 − β).
3 A Refined Algorithm
A main goal of the subsequent analysis is to bound the loss incurred by ALG2 k
in preempting jobs. The following lemma will be crucial as it specifies the earliest
time when a job preempted in S can occur again in S ∗ .
The proof of Lemma 5 relies on another lemma that compares per-unit values
of jobs scheduled in S and S . At any time t, let vS (t) be the per-unit value of
the job scheduled in S and let vS (t) be the per-unit value of the job scheduled
in S . Then vS (t) ≥ vS (t).
Phase Classification: We classify phases, considering the original schedule S.
A phase Pn is called preempted if a job is preempted in S(Pn ). Phase Pn is called
continued if the job scheduled last in S(Pn ) is also scheduled at the beginning
of S(Pn+1 ). Phase Pn is complete if all jobs scheduled in S(Pn ) are finished by
the end of Pn .
We mention some properties of these phases in the schedule S. (a) In each
phase Pn at most one job is preempted in S(Pn ). (b) If Pn is a continued or
complete phase, no job is preempted in S(Pn ). (c) If Pn is a preempted phase,
then the job preempted is one having the smallest per-unit value among jobs
scheduled in S(Pn ). These properties can be verified as follows. Let Pn be an
arbitrary phase. When ALG2 k constructs a schedule for Pn , it firsts sorts the
jobs of Qn in order of non-increasing per-unit value. In this sorted sequence only
the last job, say job i, assigned to Pn might not be scheduled completely in the
phase and hence is a candidate for preemption. Job i is one having the smallest
per-unit value among jobs scheduled in the phase. This shows properties (a) and
(c). If job i is not moved to the beginning of the phase in Step (2) of ALG2 k and
continued at the beginning of the next phase, then Pn is a continued phase and
no job is preempted in S(Pn ). By definition, no job is preempted in a complete
454 S. Albers and A. Passen
phase. This shows property (b). We observe that in the schedule S each phase
is either preempted, continued or complete.
Schedule Segments: For the further analysis we partition the schedule S into
segments where a segment consists of up to three consecutive phases. The pur-
pose of these segments is to combine “expensive” preempted phases with other
phases so as to amortize preemption loss. First we build segments consisting of
three phases. Phases Pn , Pn+1 , Pn+2 form a segment if Pn is a preempted phase
that is not preceded by a continued phase, Pn+1 is a continued phase and Pn+2
is a preempted phase. Among the remaining phases we build segments consisting
of two phases. Phases Pn , Pn+1 form a segment if (a) Pn is a preempted phase
that is not preceded by a continued phase and Pn+1 is a continued or complete
phase or (b) Pn is a continued phase followed by a preempted phase Pn+1 . Each
remaining phase forms a separate segment. We observe that a preempted phase
that forms a separate one-phase segment is not preceded by a continued phase
and is followed by a preempted phase.
For a segment σ, let ALG2 k (σ) be the value obtained by ALG2 k on σ. More
specifically, let I be the set of jobs scheduled by ALG2 k in the phases of σ. Set
I also includes those jobs that are only partially processed in σ and might also
be scheduled in phases before or after σ. Suppose that job i ∈ I is processed for
δi time units starting at time ti is σ. Then
ALG2 k (σ) = i∈I β ti (1 − β δi )/(1 − β) · vi .
Let CHOP (σ) denote the value achieved by CHOP in processing the jobs and job
portions scheduled by ALG2 k in σ. More specifically, suppose that in S job i ∈ I
has been processed for λi time units before the beginning of σ. Then CHOP (σ)
represents the value achieved by CHOP in processing the units λi + 1, . . . , λi + δi
of job i in S . If job i is preempted in the segment σ of S, then CHOP (σ)
additionally represents the value achieved by processing units u > λi + δi in S .
There holds
CHOP(σ) ≤ i∈I β tS (i)+λi (1 − β δi )/(1 − β) · vi + vp (σ),
the set of these delayed jobs. If Pn is not preceded by a continued phase, there
are no delayed jobs and we set In = ∅. We observe that tS (i) = tS (i), for all
i ∈ In \ In ∪ {i1n }, and tS (i) = tS (i) + δi1n ,n , for all i ∈ In .
For ease of exposition, let w(t, δ, v) = β t (1 − β δ )/(1 − β) · v be the value
achieved in processing a job of per-unit value v for δ time units starting at time
t. We allow δ = ∞, i.e. a job of infinite length is scheduled starting at time t.
Proof. We first study the case that the phase Pn of σ is a continued or complete
phase, i.e. no job is preempted in S(Pn ). Let i1 = i1n be the first job scheduled
in S(Pn ). There holds
ALG2 k (σ) = w((n − 1)k, δi1 ,n , vi1 ) + i∈In w(tS (i) + δi1 ,n , δi,n , vi )
+ i∈In \(In ∪{i1 }) w(tS (i), δi,n , vi )
≥ β δi1 ,n (w((n − 1)k, δi1 ,n , vi1 ) + i∈In \{i1 } w(tS (i), δi,n , vi )).
The last inequality holds because w(tS (i)+δi1 ,n , δi , vi ) = β δi1 ,n w(tS (i), δi,n , vi ).
Every job i ∈ In , except for possibly i1 , is started in S(Pn ). If job i1 is started
in S(Pn ), where n < n, then the job is scheduled at the end of S(Pn ). Hence
when ALG2 k constructed S(Pn ), the job was not delayed in Step (2) of the
algorithm in order to move another job to the beginning of the phase. Hence
tS (i1 ) = tS (i1 ) ≤ tS (i1 ). Suppose that before Pn job i1 was processed for λi1
time units in S. Since tS (i1 ) ≤ tS (i1 ), the units λi1 + 1, . . . , λi1 + δi1 ,n of job
i1 cannot be started before the beginning of Pn in S . For all jobs i ∈ In \ {i1 },
there holds tS (i) ≤ tS (i). Hence
CHOP (σ) ≤ w((n − 1)k, δi1 ,n , vi1 ) + j∈In \{i1 } w(tS (i), δi,n , vi ).
We obtain CHOP(σ)/ALG2 k (σ) ≤ 1/β δi1 ,n ≤ 1/β k−1 because a job i ∈ In can
be delayed by at most k − 1 time units.
We next study the case that Pn is a preempted phase. The preceding phase
Pn−1 is not a continued phase while the following phase Pn+1 is also a preempted
phase. Since Pn is not preceded by a continued phase all jobs of In are started
in S(Pn ) and tS (i) = tS (i), for all i ∈ In . We obtain
ALG2 k (σ) = i∈In w(tS (i), δi , vi ).
Let ip ∈ In be the job preempted in S(Pn ). The job is preempted at the end of
S(Pn ). Moreover, its per-unit value is strictly smaller than the per-unit value of
any job scheduled in S(Pn+1 ), the schedule of the following phase, since otherwise
ALG2 k would have scheduled job ip in S(Pn+1 ). Phase Pn+1 is also a preempted
phase and the job preempted in S(Pn+1 ) is scheduled at the end of S(Pn+1 ).
Thus the job preempted in S(Pn+1 ) has a strictly smaller per-unit value than
any job scheduled in S(Pn+2 ). It follows that job ip has a strictly smaller per-unit
456 S. Albers and A. Passen
value than any job scheduled in S(Pn+1 ) and S(Pn+2 ). Lemma 5 ensures that
CHOP does not schedule ip in phases Pn+1 and Pn+2 . Thus the value achieved by
CHOP for the preempted portion of ip is upper bounded by w((n + 2)k, ∞, vip )
and
CHOP(σ) ≤ i∈In w(tS (i), δi , vi ) + w((n + 2)k, ∞, vip )
= ALG2 k (σ) + w((n + 2)k, ∞, vip ).
Job ip has the smallest per-unit value among jobs scheduled in S(Pn ). Thus
ALG2 k (σ) ≥ w((n − 1)k, k, vip ) = β (n−1)k (1 − β k )/(1 − β) · vip . Also w((n +
2)k, ∞, vip ) = β (n+2)k /(1 − β)vip . We conclude CHOP(σ)/ALG2 k (σ) ≤ 1 +
β 3k /(1 − β k ).
The next two lemmas address segments consisting of at least two phases, the
analysis of which is more involved.
Lemma 7. Let σ be a segment consisting of at least two phases. If σ consists of
two phases, assume that the first one is a preempted phase. If σ consists of three
phases, assume that the per-unit value of the job preempted in the first phase
is at least as high as that of the job preempted in the third phase. There holds
CHOP(σ)/ALG2 k (σ) ≤ max{1/β k−1 , 1/(1 − β 2k )}.
Theorem 3 now follows from the three above lemmas, taking into account that
Lemmas 7 and 8 cover all possible cases of 2-phase and 3-phase segments.
√
Corollary 4. Let c = 1 + φ, where φ = (1 + 5)/2 is the Golden Ratio. For
k = − 12 logβ c + 1, ALG2 k achieves a competitive ratio of c ≈ 2.618.
machine at time t. We specify a tie breaking rule if, among the unfinished jobs in
Qn , the m-th largest per-unit value is v and there exist several jobs having this
value. In this case preference is given to those jobs that have already been started
at times t , with t < t. Jobs that have not been started yet are considered in
increasing order of arrival time, where ties may be broken arbitrarily. Of course,
if at time t set Qn contains at most m unfinished jobs, then each of them is
scheduled at that time. We observe that a feasible phase schedule, in which each
job is processed without interruption on one machine, can be constructed easily:
If a job of Qn is among those having the m highest per-unit values, then the job
will remain in this subset until it is finished. Hence the job can be sequenced
continuously on the same machine. We also observe that on each machine jobs
are sequenced in order of non-increasing per-unit value. Let S(Pn ) denote the
schedule constructed for phase Pn . While S(Pn ) is executed, newly arriving jobs
are deferred until the beginning of the next phase. At the end of S(Pn ) unfinished
jobs are preempted.
Theorem 4. For all k ∈ N and all probabilities β, ALG(m)k achieves a com-
petitive ratio of 1/β k−1 · (1 + 1/(1 − β k )).
We finally determine the best choice of√k. For any √
β, the competitive
√ ratio of
Corollary 5 is upper bounded by (1+1/( 2−1))/(2− 2) = 1/(3−2 2) ≈ 5.828.
√
Corollary 5. For k = logβ (2 − 2) , the resulting algorithm ALG(m)k
√ √
achieves a competitive ratio of (1 + 1/(1 − β(2 − 2)))/(2 − 2).
References
1. Buchbinder, N., Feldman, M., Ghosh, A., Naor, J(S.): Frequency capping in on-
line advertising. In: Dehne, F., Iacono, J., Sack, J.-R. (eds.) WADS 2011. LNCS,
vol. 6844, pp. 147–158. Springer, Heidelberg (2011)
2. Buchbinder, N., Jain, K., Naor, J(S.): Online primal-dual algorithms for maximiz-
ing ad-auctions revenue. In: Arge, L., Hoffmann, M., Welzl, E. (eds.) ESA 2007.
LNCS, vol. 4698, pp. 253–264. Springer, Heidelberg (2007)
3. Dasgupta, A., Ghosh, A., Nazerzadeh, H., Raghavan, P.: Online story scheduling
in web adverstising. In: Proc. 20th Annual ACM-SIAM Symposium on Discrete
Algorithms, pp. 1275–1284 (2009)
4. http://www.emarketer.com/Article/Digital-Account-One-Five-Ad-Dollars/
1009592
5. Feldman, J., Korula, N., Mirrokni, V., Muthukrishnan, S., Pál, M.: Online ad
assignment with free disposal. In: Leonardi, S. (ed.) WINE 2009. LNCS, vol. 5929,
pp. 374–385. Springer, Heidelberg (2009)
6. Feige, U., Immorlica, N., Mirrokni, V.S., Nazerzadeh, H.: A combinatorial alloca-
tion mechanism with penalties for banner advertising. In: Proc. 17th International
Conferene on World Wide Web, pp. 169–178 (2008)
7. Feldman, J., Mehta, A., Mirrokni, V.S., Muthukrishnan, S.: Online stochastic
matching: Beating 1-1/e. In: Proc. 50th Annual IEEE Symposium on Foundations
of Computer Science, pp. 117–126 (2009)
458 S. Albers and A. Passen
8. Ghosh, A., Sayedi, A.: Expressive auctions for externalities in online advertising.
In: Proc. 19th International Conferene on World Wide Web, pp. 371–380 (2010)
9. http://www.marketingcharts.com/wp/television/
global-online-ad-spend-forecast-to-exceed-print-in-2015-25105/
10. marketingterms.com. Surround session,
http://www.marketingterms.com/dictionary/surround_session/
11. Mehta, A., Saberi, A., Vazirani, U.V., Vazirani, V.V.: AdWords and generalized
online matching. Journal of the ACM 54(5) (2007)
12. Sleator, D.D., Tarjan, R.E.: Amortized efficiency of list update and paging rules.
Communications of the ACM 28, 202–208 (1985)
Sketching for Big Data Recommender Systems
Using Fast Pseudo-random Fingerprints
1 Introduction
The amount of data generated and processed by computers has shown consistent ex-
ponential growth. There are currently over 20 billion webpages on the internet, and
major phone companies process tens of gigabytes of call data each day. Analyzing such
vast amounts of data requires extremely efficient algorithms, both in terms of running
time and storage. This has given rise to the field of massive datasets processing. We
focus on massive recommender systems, which provide users with recommendations
for items that they are likely to find interesting, such as music, videos, or web pages.
These systems keep a profile of each user and compare it to reference characteristics.
One approach is collaborative filtering (CF), where the stored information is the items
consumed or rated by the user in the past. CF systems predict whether an item is likely
to interest the target user by seeking users who share similar rating patterns with the
target user and then using the ratings from those like-minded users to generate a pre-
diction for the target user. Various user similarity measures have been proposed, the
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 459–471, 2013.
c Springer-Verlag Berlin Heidelberg 2013
460 Y. Bachrach and E. Porat
most prominent one being the Jaccard similarity [8,4]. A naive approach, which main-
tains the entire dataset of the items examined by each user and their ratings and directly
computes the similarity between any two users, may not be tractable for big data appli-
cations, both in terms of space and time complexity. A recommender system may have
tens of millions of users1 , and may need to handle a possible set of billions of items2 . A
tractable alternative requires representing knowledge about users concisely while still
allowing inference on relations between users (e.g. user similarity). One method for
concisely representing knowledge in such settings is sketching (also known as finger-
printing) [2,20,9,1]. Such methods store fingerprints, which are concise descriptions of
the dataset, and can be though of as an extreme lossy compression method. These fin-
gerprints are extremely short, far more concise than traditional compression techniques
would achieve. On the other hand, as opposed to compression techniques, they do not
allow a full reconstruction of the original data (even approximately), but rather only
allow inferring very specific properties of the original dataset. Sketching allows keep-
ing short fingerprints of the item sets of users in recommender systems, that can still
be used to approximately compute similarity measures between any two users [5,4,3].
Most such sketches use random hashes [2,20,9,1,5].
Our Contribution. The state of the art sketch in terms of space complexity applies many
random hashes to build a fingerprint [22], and stores only a single bit per hash. A draw-
back of this approach is its high running time, caused by the many applications of hashes
to elements in the dataset. The state of the art method in terms of running time is [14],
which exponentially speeds up the computation time for building the fingerprints. Un-
fortunately, the currently best sketching techniques in terms of space complexity [22]
and time complexity [14] are mutually incompatible, forcing a choice between reducing
space or reducing runtime. Also, the low time complexity method [14] is tailored for
computing Jaccard similarity between users, but is unsuitable for other similarity mea-
sures, such as the more sensitive rank correlation similarity measures [4]. We propose
an alternative general sketching approach, which achieves both a low space complexity
similar to that of [22] and a low time complexity similar to [14]. Our sketch uses random
hashing and has a similar space complexity to [22], storing a single bit per hash, thus out-
performing previous approaches such as [2,13,5] in space complexity. Similarly to [14],
we get an exponential speedup in one factor of the computation time. Our discussion
focuses on Jaccard similarity [5], but our approach is more general than [14], captur-
ing other fingerprints, such as frequency moments [2], Lp sketches [17], rarity [13] and
rank correlations [4]. Our sketch “ties” hashes in a novel way, allowing an exponential
runtime speedup while storing only a single bit per hash. We also make an empirical
contribution and evaluate our method using the Netflix [6] dataset. We analyze the run-
ning time and space complexity of our sketch, comparing it to the above state of the
1
For example, Netflix is a famous provider of on-demand internet streaming media and employs
a recommender system with over 20 million users. Our empirical evaluation is based on the
dataset released by Netflix in a challenge to improve their algorithms [6].
2
An example is a recommender system for webpages. Each such a webpage is a potential infor-
mation item, so there are billions of such items that can potentially be recommended.
Sketching for Big Data Recommender Systems 461
art methods. We show that it in practice the accuracy of our sketch is higher than the
theoretical bounds, so even shorter sketches achieve high quality results.
Related Work. Recent work [5,4,3] already suggests sketching for recommender sys-
tems. Rather than storing the full lists of items consumed by each user and their ratings,
they only store fingerprints of the information for each user, designed so that given
the fingerprints of any two users one can accurately estimate the similarity between
them. These fingerprints are constructed using min-wise independent families of hash
functions, MWIFs for short. MWIFs were introduced in [23,8], and are useful in many
applications as they resemble random permutations. Much of the research on sketching
focused on reducing space complexity while accurately computing data stream prop-
erties, but much less attention was given to time complexity. Recent work that does
focus on running time as well as space is [18,19] and [12] which propose low runtime
sketches for locally sensitive hashing under the l2 norm. Many streaming algorithms
apply many hashes to each element in a very long stream of elements, leading to a high
and sometimes intractable computation time. Similarly to [14], our method achieves
an exponential speedup in one factor of the computation time for constructing finger-
prints of massive data streams. The heart of the method lies in using a specific family
of pseudo-random hashes shown to be approximately-MWIF [16], and for which we
can quickly locate the hashes resulting in a small value of an element under the hash.
Similarly to [24] we use the fact that family members are pairwise independent be-
tween themselves. Whereas previous models examine only one hash at a time, we read
and process “chunks” of hashes to find important elements in the chunk, exploiting the
chunk’s structure to significantly speed up computation. We show that our technique
is compatible with storing a single bit rather than the full element IDs, improving the
fingerprint size, similarly to [22].
Improving Time and Space Complexity. Rather than storing the full stream of b items
of a universe [u], sketching methods only store a fingerprint of the stream. Any sketch
achieves an estimate that is “probably approximately correct”, i.e. with high probability
the estimation error is small. Thus the size of the fingerprint and the time required to
compute it depend on the accuracy of the method and its confidence δ. The accuracy
is the allowed error (the difference between the estimated similarity and the true simi-
larity), and the confidence δ is the maximal allowed probability of obtaining an estimate
with a “large error”, higher than the allowed error . Similarly to [22] we store a single
ln 1
bit per hash function, which results in a fingerprint of length O( 2δ ) bits, rather than
1
ln
O(log u · 2δ ) bits required by previous approaches such as [14]. On the other hand,
similarly to [14], rather than computing the fingerprint of a stream of b items in time of
b ln 1
O( 2 δ ) as required by [22], we can compute it in time O(b · log 1δ · log 1 ), achieving
an exponential speedup for the fingerprint construction. In addition to the theoretical
guarantees, in Section 3 we evaluate our approach on the Netflix dataset, contrasting it
with previous approaches in terms of time and space complexity. We also show that a
high accuracy can be obtained even for very small fingerprints. Our theoretical results
relate the required storage to the accuracy of the Jaccard similarity estimates, but only
462 Y. Bachrach and E. Porat
provide an upper bound regarding the storage required; we show that in practice the
storage required to achieve a good accuracy can be much lower.
Preliminaries. Let H be a family of hashes over source X and target Y , so h ∈ H is a
function h : X → Y , where Y is ordered. We say H is min-wise independent if when
randomly choosing h ∈ H, for any subset C ⊆ X, any x ∈ C has an equal probability
to be minimal after applying h.
Definition 1. H is min-wise independent (MWIF), if for all C ⊆ X, for any x ∈ C,
1
P rh∈H [h(x) = mina∈C h(a)] = |C| .
Rather than storing the full Ci ’s, previous approaches [7,8] store their finger-
prints. Given k hashes h1 , . . . , hk randomly chosen from an γ-MWIF, we can store
mhi 1 , . . . , mhi k . Given Ci , Cj , for any x ∈ [k], the probability that mhi x = mhj x is
Ji,j ± γ. A hash hx where we have mhi x = mhj x is a hash collision. We can estimate
Ji,j by counting the proportion of collision hashes out of all the chosen hashes. In this
approach, the fingerprint contains k item identities in [u], since for any x, mhi x is in [u].
Thus, the fingerprint requires k log u bits. To achieve an accuracy and confidence δ,
ln 1
such approaches require k = O( 2δ ).
Our General Approach. We use a “block fingerprint” that estimates J = Ji,j with
accuracy and confidence of 78 . It stores a single bit per hash (where many previous
approaches store log u bits per hash). Later we show how to get a given accuracy
and confidence δ, by combining several such blocks. To get a single bit per hash, we
use a hash mapping elements in [u] to a single bit — φ : [u] → {0, 1}, taken from
3
The full version includes a proof for Theorem 1.
464 Y. Bachrach and E. Porat
a pairwise independent family (PWIF for short) of hashes. Rather than using mhi =
arg minx∈C1 h(x) we use mφ,h i = φ(arg minx∈C1 h(x)). Storing mφ,h
i rather than mφi
shortens the sketch by a log u factor.
Ji,j
Theorem 3. P rh∈H [mφ,h
i = mφ,h
j ] = 2 + 1
2 ± γ2 .
mhj ] + P r[mφ,h
i = mφ,h
j |mi = mj ] · P rh∈H [mi = mj ] = 1 · P rh∈H [mi = mj ] +
h h h h h h
1+Ji,j ±γ
1
2 · (1 − P rh∈H [mhi = mhj ]) = 2
The purpose of the fingerprint block is to estimate of Ji,j with accuracy . We use
210 −1
k = 8.022 hashes. Denote α = 210 , and let γ = (1 − α) · = 210 . We construct
1
4
a γ-MWIF . To construct the family, consider choosing a0 , . . . , ad and b0 , b1 , . . . , bd
uniformly at random from [p], constructing the polynomials f (x) = a0 + a1 x + a2 x2 +
. . . + ad xd , g(x) = b0 + b1 x + b2 x2 + . . . + bd xd , and using the k hashes hi (x) =
f (x)+ig(x), where i ∈ {0, 1, . . . , k −1}.5. We also use a hash φ : [u] → {0, 1} chosen
from the PWIF of such hashes. We say there is a collision on hl if mφ,h i
l
= mφ,h
j
l
, and
denote the random variable Zl where Zl = 1 if there is a collision on hl for users i, j
and Zl = 0 if there is no such collision. Zl = 1 with probability 12 + J2 ± γ2 and
Zl = 0 with probability 12 − J2 ± γ2 . Thus E(Zl ) = 12 + J2 ± γ2 . Denote Xl = 2Zl − 1.
E(Xl ) = 2E(Zl ) − 1 = J ± γ. Xl can take two values, −1 when Zl = 0, and 1 when
k
Zl = 1. Thus Xl2 always takes the value of 1, so E(Xl2 ) = 1. Consider X = l=1 Xl ,
and take Y = Jˆ = X k as an estimator for J. We show that for the above k, Y is accurate
up to with probability at least 78 .
Theorem 4 (Simple Estimator). P r(|Y − J| ≤ ) ≥ 78 . Proof in full version.
Due to Theorem 4, we approximate J with accuracy and confidence 78 using a “block
fingerprint” for Ci , composed of mhi 1 ,φ1 , . . . , mhi k ,φk , where h1 , . . . , hk are random
members of a γ-MWIF and φ1 , . . . , φk are chosen from the PWIF of hashes φ : [u] →
{0, 1}. It suffices to take k = O( 12 ) to achieve this. Constructing each hi can be done
by choosing f, g using the base random construction and composing hi (x) = f (x) +
i · g(x). The base random construction chooses f, g uniformly at random from Fd , the
family of d-degree polynomials in Zp , where d = O(log 1 ). This achieves a γ-MWIF
where γ = (1 − α) · = 2110 .
procedure quickly finds small elements across columns (by “small” we mean smaller
than t). Our algorithm keeps a bound for the minimal value for each row. It goes through
the columns, finding the small values in each, and updates the row bounds where these
occur.
block-update ((x1 , . . . , xb ), f (x), g(x), k, t) :
1. Let mi = ∞ for i ∈ [k] and let pi = 0 for i ∈ [k]
2. For j = 1 to b:
(a) Let It = pr − small − val(f (x), g(x), k, xj , t)
(b) Let Vt = pr − small − loc(f (x), g(x), k, xj , t)
(c) For y ∈ It : // Indices of the small elements
i. If mIt [y] > Vt [y] // Update to row x required
A. mIt [y] = Vt [y], pIt [y] = xj
If our method updates mi , pi for row i, mi indeed contains the minimal value in that
row, and pi the column where this minimal value occurs, since if even a single update
occurred then the row indeed contains an item that is smaller than t, so the minimal
item in that row is smaller than t and an update would occur for that item. On the other
hand, if all the items in a row are bigger than t, an update would not occur for that
row. The running time of the column procedure is O(log k + |It |), which is a random
variable, that depends on the number of elements returned for that column, |It |. Denote
by Lj the number of elements returned for column j (i.e. |It | for column j). Since we
have b columns, the running time of the block update is O(b log k) + O( bj=1 Lj ). The
b
total number of returned elements is j=1 Lj , which is the total number of elements
that are smaller than t. We denote by Yt = bj=1 Lj the random variable which is the
number of all elements in the block that are smaller than t. The running time of our
block update is thus O(b log k + Yt ). The random variable Yt depends on t, since the
smaller t is the less elements are returned and the faster the column procedure runs. On
the other hand, we only update rows whose minimal value is below t, so if t is too low
we have a high probability of having rows which are not updated correctly. A certain
compromise t value combines a good running time of the block update with a good
probability of correctly computing the values for all the rows.
Theorem 6. Given the threshold t = 12·p·l
b , where l = 80+2 log 1 (so l = O(log 1 )),
the runtime of the block − update procedure is O(b log 1 + 12 log 1 ). Proof in full ver-
sion.
Lemma 3 (Flip Locations Are Small). If b < p2 , at most k2 elements are flip locations,
and all elements that are smaller than b are flip locations.
Using these lemmas, we search for the elements smaller than t by examining the flip lo-
cations series in recursion. If case b < t, given q = t b, due to Lemma 4
f (S), f1 (S), . . . fq−1 (S) are smaller then t, and all of their elements must be returned.
We must also scan fq (S) and also return all the elements of fq (S) which are smaller
then t. This additional scan requires O(|fq (S)|) time |fq (S)| ≤ |f (S)|. Thus the case
of b < t examines O(|It |) elements. By Lemma 3, if b > t, all non-flip locations are
bigger than b and thus bigger than t, so we need only consider the flip-locations as
candidates. Using Lemma 5 we scan the flip locations recursively, examining the arith-
metic series of the flip locations. If at most half of the elements in each recursion are
flip locations, this gives a logarithmic running time, but if b is high, more than half the
elements are flip locations. When b > p2 we examine the same flip-location series S , in
reverse order. The first element in the reversed series is the last element of the current
series, and rather than progressing in steps of b, we progress in steps of p − b. Thus
we obtain the same elements, but in reverse order. In this reversed series, at most half
the elements are flip locations. The procedure below implements our method. It finds
elements smaller then t in time O(log k) = O(log 1 + |It |) where |It | is the number of
468 Y. Bachrach and E. Porat
such values. Given the returned indices, we get the values in them. We use the same b
for all |It |, so this can be done in time O(c log c + |It |) (usually c is a constant).
ps-min(a, b, p, k, t) :
1. if b < t:
(a) Vt = []; if a < t then Vt = Vt + [a + ib for i in range ( t−a
b )]
(b) j = p−a b // First flip (excluding first location)
(c) while j < k:
i. v = (a + jb) mod p
ii. while j < k and v < t:
A. Vt .append(v); j = j + 1; v = v + b
iii. j = j + p−v b //next flip location
iv. return list1
(d) if b > p2 then return f ((a + (k − 1) · b) mod p, p − b, p, k, t)
(e) j = p−a b ; newk = a+bk p
(f) if a < b then j = 0 and newk = newk + 1// get first flip location
(g) return f ((a + jb) mod p, −p mod b, b, newk , t)
3 Empirical Analysis
We empirically evaluated our sketch using the Netflix dataset [6]. This is a movie rat-
ings dataset, with 100 million movie ratings, provided by roughly half a million users
on a collection of 17,000 movies. As there are 100 million ratings, even this meduim-
sized dataset is difficult to fit in memory7, so a massive recommender systems dataset
certainly cannot fit in the main memory, making sketching necessary to handle such
datasets [5]. The state of the art space complexity is achieved using the sketching tech-
nique of [22]. Consider using it to estimate Jaccard similarity, with a reasonable ac-
curacy of = 0.01 and confidence level of δ = 0.001. The approach of [22] applies
roughly 100,000 hash functions for each entry. Each hash computation requires 20 mul-
tiplication operations, and as there are 100 million entries in the dataset, sketching the
entire dataset requires over than 2 · 1014 multiplications. This takes more than a day to
run on a powerful machine. On the other hand, although the approach of [14] allows
a much shorter running time (less than an hour), it requires sacrificing the low space
achieved by the method of [22]. We first compare our approach with [22,14] in terms
of the running time. Figure 2 shows the running time for generating a fingerprint for a
target with 1,000 items, both under our method (FPRF - Fast Pseudo Random Finger-
prints), and under the sketch of [22] (appearing under “1-bit”, as it maintains a single
bit per hash used) and the sketch of [14] (“FPS”, after the names of the authors). The
Figure indicates the massive saving in computation time our approach offers over the
approach of [22], and shows that the running time of our approach and that of [14] is
very similar.
We now examine the accuracy achieved by our approach, which depends on the
sketch size. To analyze empirical accuracy, we isolated users who provided ratings for
7
The Netflix data can easily be stored on disk. It is even possible to store it in memory on
machine with a large RAM, by compressing it or using a sparse matrix representation.
Sketching for Big Data Recommender Systems 469
Fig. 2. Left: running time of fingerprint computation. Right: accuracy depending on size.
over 1,000 movies. There are over 10,000 such users in the dataset, and as these users
have rated many movies, the Jaccard similarity between two such users is very fine-
grained. We tested the fingerprint size required to achieve a target accuracy level for the
Jaccard similarity. Consider a fingerprint size of k bits. Given two users, denote the true
Jaccard similarity between their lists of rated movies as J. J can be easily computed
using the entire dataset. Alternatively, we can use a fingerprint of size k, resulting in an
estimate Jˆ that has a certain error. The error for a pair of users is e = |J − J|.
ˆ We can
sample many such user pairs, and examine the average error obtained using a fingerprint
of size k, which we call the empirical inaccuracy. We wish to minimize the error in our
estimates, but to reduce the inaccuracy we must use larger fingerprints. As each user
in our sample rated at least 1,000 movies, storing the full list of rated movies for a
user takes 1,000 integers. The Netflix dataset only has 17,000 movies, so we require at
least 15 bits to store the ID of each movie. Thus the full data for a user takes at least
15,000 bits. The space required for this data grows linearly with the numbers of movies
a user has rated. Increasing the size of the universe of movies also increases the storage
requirements, as more bits would be required to represent the ID of each movie.
Using our sketch, the required space does not depend on the number of ratings per
user, or on the number of movies in the system, but rather on the target accuracy for the
similarity estimate. Earlier sketches [5,3] eliminated the dependency on the number of
ratings, but not on the number of movies in the system. Also, our fingerprints are faster
to compute.
We tested how the average accuracy of our Jaccard similarity estimates changes as
we chage the fingerprint size. We have tried fingerprints of different sizes, ranging from
500 bits to 10,000 bits. For each such size we sampled many pairs of users, and com-
puted the average inaccuracy of the Jaccard similarity estimates. The results are given
in Figure 2, for both our approach and for the sketch of [14] (“FPS”), as well as the “1-
bit” sketch of [22]. Lower numbers indicate better empirical accuracy. Figure 2 shows
that our sketch achieves a very high accuracy in estimating Jaccard similarity, even for
small fingerprints. Even for a fingerprint size of 2500 bits per user, the Jaccard similar-
ity can be estimated with an error smaller than 1.5%. Thus using fingerprints reduces
the required storage to roughly 10% of that of the full dataset, without sacrifising much
470 Y. Bachrach and E. Porat
accuracy in estimating user similarity. The figure also indicates that for any sketch size,
the accuracy achieved by our approach is superior to that of the FPS sketch [14]. This is
predictable since the theoretical accuracy guarantee for our approach is better than that
for the sketch of [14]. The figure shows no significant difference in accuracy between
our sketch and the 1-bit sketch [22].
Figure 2 shows that on the Netflix dataset, our sketch has the good properties of
the mutually exclusive sketches of [22,14], and outperforms each of these state of the
art methods in either running time or accuracy. The Netflix dataset is a small dataset,
and the saving in space is much greater for larger datasets. A recommender system for
web pages is likely to have several orders of magnitude more users and information
items. While the storage requirements for such a massive recommender system grow
by several orders of magnitude when storing the full data, the required space remains
almost the same using our sketch. Previous approaches [5,3] compute the sketch in
time quadratic in the required accuracy. Using our approach, computing the sketch
only requires time logarithmic in the accuracy, which makes it tractable even when the
required accuracy is very high.
4 Conclusions
We presented a fast method for sketching massive datasets, based on pseudo-random
hashes. Though we focused on collaborative filtering and examined the Jaccard simi-
larity in detail, the same technique can be used for any fingerprint based on minimal
elements under several hashes. Our approach is thus a general technique for exponen-
tially speeding up computation of various fingerprints, while maintaining a single bit
per hash. We showed that even for these small fingerprints which can be quickly com-
puted, the required number of hashes is asymptotically similar to previously known
methods, and is logarithmic in the required confidence and polynomial in the required
accuracy. Our empirical analysis shows that for the Netflix dataset the required storage
is even smaller than the theoretical bounds.
Several questions remain open. Can we speed up the sketch computation further?
Can similar methods be used that are not based on minimal elements under hashes?
References
1. Aggarwal, C.C.: Data streams: models and algorithms. Springer-Verlag New York Inc.
(2007)
2. Alon, N., Matias, Y., Szegedy, M.: The Space Complexity of Approximating the Frequency
Moments. J. Computer and System Sciences 58(1), 137–147 (1999)
3. Bachrach, Y., Herbrich, R.: Fingerprinting Ratings for Collaborative Filtering — Theoretical
and Empirical Analysis. In: Chavez, E., Lonardi, S. (eds.) SPIRE 2010. LNCS, vol. 6393,
pp. 25–36. Springer, Heidelberg (2010)
4. Bachrach, Y., Herbrich, R., Porat, E.: Sketching algorithms for approximating rank correla-
tions in collaborative filtering systems. In: Karlgren, J., Tarhio, J., Hyyrö, H. (eds.) SPIRE
2009. LNCS, vol. 5721, pp. 344–352. Springer, Heidelberg (2009)
5. Bachrach, Y., Porat, E., Rosenschein, J.S.: Sketching techniques for collaborative filtering.
In: IJCAI, Pasadena, California (July 2009)
Sketching for Big Data Recommender Systems 471
6. Bennett, J., Lanning, S.: The netflix prize. In: KDD Cup and Workshop (2007)
7. Broder, A.Z.: On the resemblance and containment of documents. Sequences (1998)
8. Broder, A.Z., Charikar, M., Frieze, A.M., Mitzenmacher, M.: Min-wise independent permu-
tations. Journal of Computer and System Sciences 60(3), 630–659 (2000)
9. Cormode, G., Muthukrishnan, S.: An improved data stream summary: the count-min sketch
and its applications. Journal of Algorithms 55(1), 58–75 (2005)
10. Cormode, G., Muthukrishnan, S., Rozenbaum, I.: Summarizing and mining inverse distribu-
tions on data streams via dynamic inverse sampling. In: VLDB (2005)
11. Das, A.S., Datar, M., Garg, A., Rajaram, S.: Google news personalization: scalable online
collaborative filtering. In: WWW. ACM (2007)
12. Dasgupta, A., Kumar, R., Sarlos, T.: Fast locality-sensitive hashing. In: SIGKDD (2011)
13. Datar, M., Muthukrishnan, S.: Estimating rarity and similarity over data stream windows.
In: Möhring, R., Raman, R. (eds.) ESA 2002. LNCS, vol. 2461, pp. 323–335. Springer,
Heidelberg (2002)
14. Feigenblat, G., Shiftan, A., Porat, E.: Exponential time improvement for min-wise based
algorithms. In: SODA (2011)
15. Hoeffding, W.: Probability inequalities for sums of bounded random variables. Journal of the
American Statistical Association 58(301), 13–30 (1963)
16. Indyk, P.: A Small Approximately Min-Wise Independent Family of Hash Functions. Journal
of Algorithms 38(1), 84–90 (2001)
17. Indyk, P.: Stable distributions, pseudorandom generators, embeddings, and data stream com-
putation. Journal of the ACM (JACM) 53(3), 323 (2006)
18. Kane, D.M., Nelson, J., Porat, E., Woodruff, D.P.: Fast moment estimation in data streams in
optimal space. In: STOC (2011)
19. Kane, D.M., Nelson, J., Woodruff, D.P.: An optimal algorithm for the distinct elements prob-
lem. In: PODS, pp. 41–52. ACM (2010)
20. Karp, R.M., Shenker, S., Papadimitriou, C.H.: A simple algorithm for finding frequent ele-
ments in streams and bags. ACM Transactions on Database Systems (TODS) 28(1), 51–55
(2003)
21. Kirsch, A., Mitzenmacher, M.: Less hashing, same performance: a better Bloom filter. In:
Azar, Y., Erlebach, T. (eds.) ESA 2006. LNCS, vol. 4168, pp. 456–467. Springer, Heidelberg
(2006)
22. Li, P., Koenig, C.: b-Bit minwise hashing. In: WWW (2010)
23. Mulmuley, K.: Randomized geometric algorithms and pseudorandom generators. Algorith-
mica (1996)
24. Pǎtraşcu, M., Thorup, M.: On the k-Independence Required by Linear Probing and Minwise
Independence. In: Abramsky, S., Gavoille, C., Kirchner, C., Meyer auf der Heide, F., Spirakis,
P.G. (eds.) ICALP 2010. LNCS, vol. 6198, pp. 715–726. Springer, Heidelberg (2010)
25. Pavan, A., Tirthapura, S.: Range-efficient counting of distinct elements in a massive data
stream. SIAM Journal on Computing 37(2), 359–379 (2008)
26. Resnick, P., Iacovou, N., Suchak, M., Bergstrom, P., Riedl, J.: Grouplens: an open architec-
ture for collaborative filtering of netnews. In: Computer Supported Cooperative Work (1994)
27. Sarwar, B., Karypis, G., Konstan, J., Reidl, J.: Item-based collaborative filtering recommen-
dation algorithms. In: WWW (2001)
28. Su, X., Khoshgoftaar, T.M.: A survey of collaborative filtering techniques. Advances in Ar-
tificial Intelligence 2009, 4 (2009)
Physarum Can Compute Shortest Paths:
Convergence Proofs and Complexity Bounds
1 Introduction
Physarum polycephalum is a slime mold [BD97] that is apparently able to solve
shortest path problems. In [NYT00], Nakagaki, Yamada, and Tóth report on the
following experiment (see Figure 1): They built a maze, that was later covered
with pieces of Physarum (the slime can be cut into pieces that will merge if
brought into each other’s vicinity), and then fed the slime with oatmeal at two
locations. After a few hours, the slime retracted to the shortest path connecting
the food sources in the maze. The experiment was repeated with different mazes;
in all experiments, Physarum retracted to the shortest path. Tero, Kobayashi
and Nakagaki [TKN07] propose a mathematical model for the behavior of the
mold. Physarum is modeled as a tube network traversed by liquid flow, with the
flow satisfying the standard Poiseuille assumption from fluid mechanics. In the
following, we use terminology from the theory of electrical networks, relying on
the fact that equations for electrical flow and Poiseuille flow are the same [Kir10].
In particular, let G be an undirected graph1 with node set N , edge set E,
++ and two distinguished nodes s0 , s1 ∈ N . In our discussion,
length labels l ∈ RE 2
1
One can easily generalize the model and extend our results to multigraphs at the
expense of heavier notation. Details will appear in the full version of the paper.
2
We let RA , RA+ and R++ denote the set of real, nonnegative real, and positive real
A
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 472–483, 2013.
c Springer-Verlag Berlin Heidelberg 2013
Physarum Can Compute Shortest Paths 473
Fig. 1. The experiment in [NYT00] (reprinted from there): (a) shows the maze uni-
formly covered by Physarum; the yellow color indicates the presence of Physarum. Food
(oatmeal) is provided at the locations labelled AG. After a while, the mold retracts to
the shortest path connecting the food sources as shown in (b) and (c). (d) shows the
underlying abstract graph. The video [You] shows the experiment.
x ∈ RE+ will be a state vector representing the diameters of the tubular channels
of the Physarum (edges of the graph). The value xe is called the capacity of edge
e. The nodes s0 and s1 represent the location of two food sources. Physarum’s
dynamical system is described by the system of differential equations [TKN07]
where h ∈ (0, 1) is the step size of the discretization. We prove that the dynamics
(3) converges to the shortest source-sink path. More precisely, let opt be the
length of the shortest path, n and m be the number of nodes and edges of the
3
We assume uniqueness of the shortest path for simplicity of exposition.
474 L. Becchetti et al.
Fig. 2. Photographs of the connecting paths between two food sources (FS). (a) The
rectangular sheet-like morphology of the organism immediately before the presentation
of two FS and illumination of the region indicated by the dashed white lines. (b),(c)
Examples of connecting paths in the control experiment in which the field was uni-
formly illuminated. A thick tube was formed in a straight line (with some deviations)
between the FS. (d)-(f) Typical connecting paths in a nonuniformly illuminated field
(95 K lx). Path length was reduced in the illuminated field, although the total path
length increased. Note that fluctuations in the path are exhibited from experiment to
experiment. (Figure and caption reprinted from [NIU+ 07, Figure 2].)
graph, and L be the largest length of an edge. We show that, for ∈ (0, 1/300)
and for h = /mL, the discretized model yields a solution of value at most (1 +
O())opt in O(mL(log n + log L)/3 ) steps, even when O(log(nL/))-bit number
arithmetic is used. For bounded L, the time bound is therefore polynomial in
the size of the input data.
Our second contribution was inspired by the following experiment of Nakagaki
et al., reported in [NIU+ 07] (see also Figure 2). They cover a rectangular plate with
Physarum and feed it at opposite corners of the plate. Two-thirds of the plate are
put under a bright light, and one-third is kept in the dark. Under uniform lighting
conditions, Physarum would retract to a straight-line path connecting the food
sources [NYT00]. However, Physarum does not like light and therefore forms a path
Physarum Can Compute Shortest Paths 475
with one kink connecting the food sources. The path is such that the part under
light is shorter than in a straight-line connection. In the theory section of [NYT00],
a reactivity parameter ae > 0 is introduced into (1):
Note that if, for example, qe (x, l) = 0, the capacity of edge e decreases with
a rate that depends on ae . To model the experiment, ae = 1 for edges in the
dark part of the plate, and ae = C > 1 for the edges in the lighted area, where
C is a constant. The authors of [NIU+ 07] report that in computer simulations,
the dynamics (4) converges to the shortest source-sink path with respect to the
modified length function ae le . A proof of convergence is currently only available
for the uniform case ae = 1 for all e, see [BMV12, Bon13].
A directed version of model (4) was proposed in [IJNT11]. The graph G =
(N, E) is now a directed graph. For a state vector x(t), the flows are defined as
above. A flow qe (x, l) is positive if it flows in the direction of e and is negative
otherwise. The dynamics becomes
Although this model apparently has no physical counterpart, it has the advan-
tage of allowing one to treat directed graphs. Ito et al. [IJNT11] prove con-
vergence to the shortest source-sink path in the uniform case (ae = 1 for all
e). In fact, they show convergence for a somewhat more general problem, the
transportation problem, as does [BMV12] for the undirected model.
We show that the dynamics (5) converges to the shortest directed source-
sink path under the modified length function ae le . This generalizes the conver-
gence result of [IJNT11] from the uniform (ae = 1 for all e) to the nonuniform
case, albeit only for the shortest path problem. Our proof combines arguments
from [MO07, MO08, IJNT11, BMV12, Bon13] and we believe it is simpler than
the one in [IJNT11]. Moreover, for the uniform case (that is, ae = 1 for all e),
we can prove convergence for the discretized model
where h ≤ 1/(n(4nm2 LX02 )2 ) is the step size; here, X0 is the maximum between
the largest capacity and the inverse of the smallest capacity at time zero. In
particular, let P ∗ be the shortest directed source-sink path and let ∈ (0, 1) be
arbitrary:
we show xe (t) ≥ 1 − 2 for e ∈ P ∗ and xe (t) ≤ for e ∈ P ∗ , whenever
t ≥ h 3 ln X0 + 2 ln .
4nL 2m
2 Electrical Networks
def def
Here, R = diag(l/x) ∈ RE×E is the diagonal matrix with value re = le /xe
for the e-th element of the main diagonal, and b ∈ RN is the vector defined by
bv = +1 if v = s0 , bv = −1 if v = s1 , and bv = 0, otherwise. The value re is
called the resistance of edge e. Node s0 is called the source, node s1 the sink. The
def
quantity η = q T Rq is the energy; the quantity bs0 = 1 is the value of the flow
q. The optimality conditions for (7) imply that there exist values p1 , . . . , pn ∈ R
(potentials) that satisfy Ohm’s law [Bol98, Section II.1]:
By the conservation of energy principle, the total energy equals the difference
between the source and sink potentials, times the value of the flow [Bol98, Corol-
lary IX.4]:
η = (ps0 − ps1 )bs0 = ps0 − ps1 . (9)
Assumptions on the input data: We assume that the length labels l and the
initial conditions x(0) satisfy the following:
x(0) = 1; (10)
4
In the directed model discussed in Section 4, this orientation is simply the one given
by the directed graph.
Physarum Can Compute Shortest Paths 477
c. the initially minimum capacity cut is the source cut, and it has unit capacity:
where 1S is the characteristic vector of the set of edges in the cut S, and 10
is the characteristic vector of the set of edges incident to the source. Notice
that this can be achieved even when s0 has not degree 1, by connecting a
new source s0 to s0 via a length 1, capacity 1 edge.
d. every edge has length at least 1.
Basic properties: The first property we show is that the set of fractional s0 -s1
paths is an invariant for the dynamics.
Lemma 1. Let x = x(t) be the solution of (3) under the initial conditions
x(0) = 1. The following properties hold at any time t ≥ 0: (a) x > 0, (b)
1TS · x ≥ 1T0 · x = 1, and (c) x ≤ 1.
Proof. (a.) Let e ∈ E be any edge. Since |qe | ≥ 0, by the evolution equation (3)
we have Δxe (t) = h(|qe | − xe (t)) ≥ −hxe (t). Therefore, by induction, xe (t + 1) ≥
xe (t) − hxe (t) = (1 − h)xe (t) > 0 as long as h < 1.
(b.) We use induction. The property is true for x(0) by the assumptions on
the input data. Then, using (3), induction, and the fact that 1TS · |q| ≥ 1 for any
cut S,
and let
def
V = lT x = le xe = re x2e = xT Rx. (13)
e∈E e∈E
Here η is the energy dissipated by the system, as well as the potential difference
between source and sink. Notice that the quantity V can be interpreted as the
478 L. Becchetti et al.
“infrastructural cost” of the system; in other terms, it is the cost that would
be incurred if every link were traversed by a flow equal to its current capacity.
While η may decrease or increase during the evolution of the system, we will
show that η ≤ V and that V is always decreasing, except on equilibrium points.
Lemma 3. η ≤ V .
Proof. To see the inequality, consider any flow f of maximum value subject to
the constraint that 0 ≤ f ≤ x. The minimum capacity of a source-sink cut is 1
at any time, by Lemma 1(b). Therefore, by the Max Flow-Min Cut Theorem,
the value of the flow f must be 1. Then by (7),
η = q T Rq ≤ f T Rf ≤ xT Rx = V. &
%
Lemma 4. V is a Lyapunov function for (3); in other words, it is continuous
and satisfies (i) V ≥ 0 and (ii) ΔV ≤ 0. Moreover, ΔV = 0 if and only if
Δx = 0.
Proof. V is continuous and nonnegative by construction. Moreover,
ΔV /h = lT Δx/h = lT (|q| − x) by (3),
= x R |q| − x Rx
T T
by l = Rx,
T
= (x R 1/2
) · (R 1/2
|q|) − x Rx
T
≤ (x Rx)
T 1/2
· (q Rq)1/2 − xT Rx
T
by Cauchy-Schwarz [Ste04],
= (ηV )1/2 − V,
≤V −V by Lemma 3.
= 0.
Observe that ΔV = 0 is possible only when equality holds in the Cauchy-Schwarz
inequality. This, in turn, implies that the two vectors R1/2 x and R1/2 |q| are
parallel, that is, |q| = λx for some λ ∈ R. However, by Lemma 1(b), the capacity
of the source cut is 1 and, by (7), the sum of the currents across the source cut
is 1. Therefore, λ = 1 and Δx = h(|q| − x) = 0. &
%
Corollary 1. As t → ∞, x(t) approaches an equilibrium point of (3), and η(t)
approaches the length of the corresponding s0 -s1 path.
Proof. The existence of a Lyapunov function V implies [LaS76, Theorem 6.3]
that x(t) approaches the set {x ∈ RE + : ΔV = 0}, which by Lemma 4 is the
same as the set {x ∈ RE + : Δx = 0}. Since this set consists of isolated points
(Lemma 2), x(t) must approach one of those points, say the point 1P for some
s0 -s1 path P . When x = 1P , one has η = V = 1TP · l. &
%
where P ∗ is the shortest path. Recall that opt denotes the length of P ∗ . Observe
that W (t) ≤ 0 for all t (due to Lemma 1(c)) and W (0) = 0 due to the choice of
initial conditions. Also observe that V (0) = lT · x(0) = e∈E le ≤ mL, where m
is the number of edges of the graph and L is the length of the longest edge.
For a fixed ∈ (0, 1/300), we set h = /mL. We will bound the number of
steps before V falls below (1 + 3)3 opt < (1 + 10)opt.
Definition 1. We call a V -step any time step t such that η(t) ≤ (1+3)opt and
V (t) > (1+3)3opt. We call a W -step any time step t such that η(t) > (1+3)opt
and V (t) > (1 + 3)3 opt.
Proof. For any V -step t we have, by the proof of Lemma 4 and the assumptions
on η and V ,
Proof. Let P ∗ be the shortest path, so that 1TP ∗ · l = opt. For a W -step t, we
have
xe (t + 1) |pu − pv |
W (t + 1) − W (t) = le ln = le ln 1 + h −1 ,
∗
xe (t) ∗
le
e∈P e∈P
where u, v are the endpoints of edge e. Using the bound ln(1 + z) ≥ z/(1 + z),
which is valid for any z > −1 (recall that h < 1), we obtain
|pu −pv |
h le −1 h (|pu − pv | − le )
W (t + 1) − W (t) ≥ le =
|pu −pv |
e∈P ∗ 1+h le −1 e∈P ∗ 1 + h |pul−p
e
v|
−1
|pu − pv | le
=h· −
|pu −pv | |pu −pv |
e∈P ∗ 1+h le −1 e∈P ∗ 1+h le −1
5 6
|pu − pv | le
≥h· − ,
1 + hη 1−h
e∈P ∗ e∈P ∗
480 L. Becchetti et al.
Approximate Computation. Real arithmetic is not needed for the results of the
preceding section; in fact, arithmetic with O(log(nL/)) bits suffices. The proof
that approximate arithmetic suffices mimics the proof in the preceding section;
details are deferred to a full version of the paper.
Electrical flows are uniquely determined by Kirchhoff’s and Ohm’s laws. In our
setting, the electrical flow q(t) and the vertex potentials p(t) are functions of
time. For an edge e = (u, v), let ηe (t) = pu (t) − pv (t), and let η(t) = ps0 (t) −
p
s1 (t). We have the following facts: (1) For any directed source-sink path P ,
e∈P ηe (t) = η(t). (2) xe (t) ≤ max(1, xe (0)) ≤ xmax (0) for all t. (3) xe (t) > 0
for all e ∈ E and all t (the existence
of a directed source-sink path is crucial
t
here). (4) ln xe (t) = ln xe (0) + ae η̂el(t)
e
− 1 · t, where η̂e (t) = (1/t) 0 ηe (s)ds
is the average potential drop on edge e up to time t. For a directed source-sink
path P , let
le
lP = le and wP (t) = ln xe (t).
ae
e∈P e∈P
be its length and its weighted sum of log capacities, respectively. The quantity wP
was introduced in [MO07, MO08], and the following property (15) was derived
in these papers.
Lemma 9. Assume (A1), (A2) and let P be any directed source-sink path. Then
d
ẇP (t) = η(t) − lP and (wP (t) − wP ∗ (t)) = lP ∗ − lP . (15)
dt
Moreover, wP (t) ≤ (3nL ln X0 )/amin − t, if P is a non-shortest source-sink
path and (A3) holds: For ∈ (0, 1), let t1 = nL(3 ln X0 + ln(1/))/amin. Then
mine∈P xe (t) ≤ for t ≥ t1 .
The last claim states that for any non-shortest path P , mine∈P xe (t) goes to
zero. This is not the same as stating that there is an edge in P whose capacity
converges to zero. Such a stronger property will be shown in the proof of the
main theorem.
The Convergence Proof: The proof proceeds in two steps. We first show that
the vector of edge capacities becomes arbitrarily close to a nonnegative non-
circulatory flow and then prove the main theorem. A flow is nonnegative if
fe ≥ 0 for all e, and it is non-circulatory if fe ≤ 0 for at least one edge e on
every directed cycle.
def
Lemma 10. Assume (A1) and (A2): For t > t0 = (1/amin ) ln(3mX0 ), there is
a nonnegative non-circulatory flow f (t) with
Proof. We follow the analysis in [IJNT11], taking reactivities into account. &
%
Proof (of Theorem 2). Let P be the set of non-shortest simple source-sink paths,
and let t > t0 , where t0 is defined as in Lemma 10. The nonnegative non-
circulatory flow f (t) can be written as a sum of flows along simple directed
source-sink paths, i.e.,
we have |fe (t) − xe (t)| ≤ /(2m) for all e (Lemma 10) and mine∈P xe (t) ≤
/(2m) for every non-shortest path P (Lemma 9). Thus, every non-shortest path
contains an edge e with fe (t) ≤ /m. Thus, αP (t) ≤ /m for all non-shortest
paths P , and hence,
The value of the flow f is one. The total flow along the non-shortest paths is at
most . Thus the flow along P ∗ is at least 1 − . Hence xe (t) ≥ 1 − − /(2m) ≥
2
1 − 2 for all e ∈ P ∗ . Finally, ln 10m X0 ≤ nL(3 ln X0 + 2 ln 2m
). &
%
where h is the step size. We will need the following additional assumptions: (A5)
ae = 1 for all e, and (A6) there is an edge e0 = (s0 , s1 ) of length nL and initial
capacity 0. Observe that the existence of this edge does not change the shortest
directed source-sink path. Our main theorem becomes the following; the proof
structure for the discrete case is similar to the one for the continuous case.
is reached. For the uniform model (ae = 1), we also prove convergence of the
discretization.
There are many open questions: (i) Convergence of the nonuniform undirected
model; (ii) Convergence of the discretized nonuniform directed model; (iii) Are
our bounds best possible? In particular, can the dependency on L be replaced
by a dependency on log L?
References
[BD97] Baldauf, S.L., Doolittle, W.F.: Origin and evolution of the slime molds
(Mycetozoa). Proc. Natl. Acad. Sci. USA 94, 12007–12012 (1997)
[BMV12] Bonifaci, V., Mehlhorn, K., Varma, G.: Physarum can compute shortest
paths. Journal of Theoretical Biology 309, 121–133 (2012); A preliminary
version of this paper appeared at SODA 2012, pp. 233–240
[Bol98] Bollobás, B.: Modern Graph Theory. Springer, New York (1998)
[Bon13] Bonifaci, V.: Physarum can compute shortest paths: A short proof. Infor-
mation Processing Letters 113(1-2), 4–7 (2013)
[IJNT11] Ito, K., Johansson, A., Nakagaki, T., Tero, A.: Convergence properties for
the Physarum solver. arXiv:1101.5249v1 (January 2011)
[Kir10] Kirby, B.J.: Micro- and Nanoscale Fluid Mechanics: Transport in Microflu-
idic Devices. Cambridge University Press, Cambridge (2010)
[LaS76] LaSalle, J.B.: The Stability of Dynamical Systems. SIAM (1976)
[MO07] Miyaji, T., Ohnishi, I.: Mathematical analysis to an adaptive network of
the Plasmodium system. Hokkaido Mathematical Journal 36(2), 445–465
(2007)
[MO08] Miyaji, T., Ohnishi, I.: Physarum can solve the shortest path problem on
Riemannian surface mathematically rigourously. International Journal of
Pure and Applied Mathematics 47(3), 353–369 (2008)
[NIU+ 07] Nakagaki, T., Iima, M., Ueda, T., Nishiura, Y., Saigusa, T., Tero, A.,
Kobayashi, R., Showalter, K.: Minimum-risk path finding by an adaptive
amoebal network. Physical Review Letters 99(068104), 1–4 (2007)
[NYT00] Nakagaki, T., Yamada, H., Tóth, Á.: Maze-solving by an amoeboid organ-
ism. Nature 407, 470 (2000)
[SM03] Süli, E., Mayers, D.: Introduction to Numerical Analysis. Cambridge Uni-
versity Press (2003)
[Ste04] Steele, J.: The Cauchy-Schwarz Master Class: An Introduction to the Art
of Mathematical Inequalities. Cambridge University Press (2004)
[TKN07] Tero, A., Kobayashi, R., Nakagaki, T.: A mathematical model for adaptive
transport network in path finding by true slime mold. Journal of Theoret-
ical Biology 244, 553–564 (2007)
[You] http://www.youtube.com/watch?v=czk4xgdhdY4
On Revenue Maximization for Agents
with Costly Information Acquisition
Extended Abstract
1 Introduction
In many real-world scenarios, people rarely know precisely how they value an
item, but can pay some cost (e.g., money, time or effort) to attain more certainty.
This not only occurs in online ad markets (where advertisers can buy information
about users), but also in everyday life. Suppose you want to buy a house. You
would research the area, school district, commute, and possibly pay experts such
as a real estate agent or an inspection company. Each such action has some cost,
but also helps better evaluate the worth of the house. In some cases, e.g., if you
find out your commute would be more than an hour, you may simply walk away.
However, if the commute is reasonable, you may choose to proceed further and
take more actions (at more cost) in order to gain even more information. This
continues until you take a final decision. A deliberative agent as defined in this
paper has this kind of multiple-round information-buying capability.
Previous work shows that mechanism design for deliberative agents is funda-
mentally different than classical mechanism design due to the greater flexibility
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 484–495, 2013.
c Springer-Verlag Berlin Heidelberg 2013
On Revenue Maximization for Agents with Costly Information Acquisition 485
in the agents’ strategies. A classical agent has to decide how much information
to reveal; a deliberative agent has to additionally decide how much information
to acquire. This affects equilibrium behavior. For example, in second-price auc-
tions, deliberative agents do not have dominant strategies [20], and standard
mechanisms and techniques do not apply. Revenue-optimal mechanisms have re-
mained elusive, and the majority of positive results are for simple models where
agents can determine their value exactly in one round, often restricting further
to binary values or single-item auctions [2,5,3,24,7]. Positive results for more
general deliberative settings restrict agents in other ways, such as forcing agents
to acquire information before the mechanism begins [22,8], to commit to partic-
ipate before deliberating [13], or to deliberate in order to be served [4]. (Also see
[1,19,14].) Furthermore, impossibility results exist for certain types of dominant
strategy1 deliberative mechanisms [20,21]. This result, however, relies crucially
on the fact that agents are assumed to have the ability to deliberate about other
agent’s values. In an independent value model, this is not a natural assumption.
In this paper we continue a line of research begun by Thompson and Leyton-
Brown [24,7] related to dominant strategy mechanism design in the independent
value model. Specifically, we extend results to a general deliberative model in
which agents can repeatedly refine their information. Our first main result is that
the profit maximizing mechanism (a.k.a. optimal mechanism) is, without loss of
generality, a sequential posted price mechanism (SPP).2 Our second main result
is that, via a suitable reduction, we can leverage classical results (see [10,11,18])
that show revenue-optimal mechanisms can be approximated with SPPs, in order
to construct construct approximately optimal SPPs in our setting. These are
first results in an interesting model that raises many more questions than it
answers. In the final section, we take first steps towards understanding Bayes-
Nash incentive-compatible mechanisms in a simpler deliberative setting.
2 Deliberative Model
In our model, each agent has a set of “deliberative possibilities” that describe
the ways in which they can acquire information about their value.
Definition 1 (Deliberative Possibilities). An agent’s deliberative possibili-
ties are represented by tuples (F , D, c) where
– F is a probability distribution over the possible values the agent can have;
– D is a set of deliberations the agent can perform; and
– c : D → R+ , where c(d) > 0 represents the cost to perform deliberation d.
In any given state (F , D, c), the agent may choose one of the deliberations d ∈ D
to perform. A deliberation is a random function that maps the agent to a new
1
Dominant strategy equilibria occur when each agent has a strategy that is optimal
against any (potentially suboptimal) strategies the other agents play.
2
In a sequential posted price mechanism (SPP), agents are offered take-it-or-leave-it
prices in sequence; the mechanism is committed to sell to an agent at the offered
price if she accepts, and will not serve the agent at any point point if she rejects.
486 L.E. Celis, D.C. Gklezakos, and A.R. Karlin
state (F , D , c ), where F is the new prior the agent has over his value, D is
the new set of deliberations the agent can perform, and c (·) the corresponding
costs. The distribution over new priors is such that the marginals agree with F ;
i.e., while v ∼ F is drawn from a new distribution (the updated prior), v ∼ d(F )
is identically distributed as v ∼ F . 3
We focus on the design of mechanisms in single-parameter environments [17,16],
where each agent has a single private (in our case, unknown) value for “service”,
and there is a combinatorial feasibility constraint on the set of agents that can
be served simultaneously.4
A mechanism in the deliberative setting is a (potentially) multi-stage process
in which the mechanism designer interacts with the agents. It concludes with
an allocation and payment rule (x, p) where xi = 1 if agent i is served and is 0
otherwise5 and agent i is charged pi .6 The mechanism designer knows the agents’
deliberative possibilities and initial priors. At any point during the execution of
the mechanism, an agent is free to perform any of her deliberation possibilities
according to her current state (F , D, c). Indeed, it may be in the mechanism
designer’s best interest to incentivize her to do certain deliberations.
We focus in this paper on a public communication model; i.e., every agent
observes the interaction between any other agent and the mechanism. Versions
of our results also extend to the private communication model. We also make
the standard assumption that agents have full knowledge of the mechanism to
be executed. Crucially however, if and when an agent deliberates, there is no
way for other agents or the mechanism to certify that the deliberation occurred.
Moreover, the outcome of a deliberation is always private. Hence, the mecha-
nism designer must incentivize the agent appropriately in order to extract this
information.
If, over the course of the execution, an agent performs deliberations d1 , . . . , dk ,
then her expected utility is
Otherwise, if there are two different prices, p and p , that are be reached
depending on i’s report(s), then this again contradicts dominant-strategy truth-
fulness. This is due to the fact that an agent’s behavior must be truthful against
any set of fixed strategies for the other agents. Thus, whenever i reports a value
in H, she must charged the same price p.
If agent i is never served when i reports v ∈ M , the proof is complete. Assume
otherwise. Let pm be some price that she is served at along a path in M and let
ph be the price she is charged if she reports a value in Hd . Clearly, if pm > ph
then if i’s value is in M she would have incentive to lie. Additionally, if pm < ph ,
then there is a set of strategies we can fix for the other agents for which i would
again have incentive to lie. Hence, by dominant strategy truthfulness, pm = ph .
We conclude by observing that, by truthfulness, it is straightforward to see
that an agent must be served at the above price p whenever her effective value
is above p (and not served otherwise). &
%
Lemma 4. Let M be a truthful SDM such that the price it charges i, assuming
i is served, only depends on the history before M’s first interaction with i. Then,
M is revenue-equivalent to an SPP N .
1. For any price p ∈ [0, ∞), determine the utility-maximizing set of deliber-
ations the agent would perform, and the probability α(p) that the agent
accepts this price when she deliberates optimally. We denote the agent’s
optimal expected utility when offered a price of p by u(p).
2. Note that f (p) = 1 − α(p) defines a cumulative distribution function on
[0, ∞].
490 L.E. Celis, D.C. Gklezakos, and A.R. Karlin
3. Observe that this implies any SPP has the same expected revenue in the
deliberative setting as it does in the classical setting when agents’ values are
drawn from the distribution v ∼ 1 − α(·).10
4. Use known approximation results [9,10,11,18] that show how to derive ap-
proximately optimal SPPs in the classical setting to derive an approximately
optimal SPP in the deliberative setting.
We apply this recipe to bounded deliberative agents for which we can efficiently
compute the distribution f (p) = 1 − α(p).
Definition 4 (Bounded Deliberative Agent). An deliberative agent is
bounded if the following holds:
1. Every prior has bounded expectation, i.e, E[F(t) ] < ∞ for all i, t.
2. Every set of deliberative actions is finite, i.e, D(t) < ∞ for all i, t.
3. Every deliberative action results in one of finitely-many potential priors F (t) .
4. There is some finite T such that D(t) = ∅ for all t ≥ T , i.e., no further
deliberation is possible.
We now define a lemma that contains the key insight for this result.
Lemma 5. The probability and utility functions α(p) and u(p) have the follow-
ing properties:
1. u is piecewise linear and convex.
2. α is a step function and decreasing.
3. If the agents are bounded, α and u can be constructed in polynomial time in
the size of the deliberation tree.
The utility of a player that does not deliberate and reports valuation w is:
w
uE (w) = μa(w) − p(w) = μa(w) − wa(w) + a(x)dx
0
Condition 2: If the mechanism offers the item to the agent and expects her to
take it without deliberation at price e, it must be that her utility uE = μ − e is
greater than the utility she could obtain from deliberating, that is:
∞ e
μ−e≥ (v − e)f (v)dv − c which after simplification is F (v)dv ≤ c.
e 0
&
%
To give an example, consider a single item auction in the classical setting, with
two agents whose values are drawn uniformly on [0, 1]. Hence, the revenue-
optimal mechanism is a Vickrey auction with reserve price 1/2, which achieves
an expected revenue of 5/12. Note that this acution is dominant strategy truth-
ful. In the deliberative setting this is no longer the case, since that would require
that, ex-post, an agent has “no regrets”. However, a deliberative agent will regret
having paid a deliberation cost c if she ends up losing. It follows though from
1
Proposition 1 that VCG is BIC for for c < 12 . It also follows from condition 2
√
that an agent will take the item without deliberating at a price up to 2c. Thus,
when c = 1/12 − the following mechanism raises more revenue than VCG:
494 L.E. Celis, D.C. Gklezakos, and A.R. Karlin
6 Future Work
We view this as very preliminary work in the setting of deliberative environ-
ments; numerous open problems remain. In the specific model studied, directions
for future research include understanding other communication models, and the
power of randomization. Beyond dominant strategies, revenue maximization us-
ing other solution concepts is wide open. It would also be interesting to study
objectives other than revenue maximization. Finally, it would be interesting to
derive “price of anarchy” style results that compare optimal revenue in deliber-
ative and non-deliberative settings.
References
1. Babaioff, M., Kleinberg, R., Leme, R.P.: Optimal mechanisms for selling informa-
tion. In: 12th International World Wide Web Conference (2012)
2. Bergemann, D., Valimaki, J.: Information acquisition and efficient mechanism de-
sign. Econometrica 70(3) (2002)
3. Bergemann, D., Valimaki, J.: Information acquisition and efficient mechanism de-
sign. Econometrica 70(3) (2002)
4. Bikhchandani, S.: Information acquisition and full surplus extraction. Journal of
Economic Theory (2009)
5. Cavallo, R., Parkes, D.C.: Efficient metadeliberation auctions. In: AAAI, pp. 50–56
(2008)
6. Celis, L.E., Gklezakos, D.C., Karlin, A.R.: On revenue maximization for agents
with costly information acquisition (2013), Full version
http://homes.cs.washington.edu/~ gklezd/publications/deliberative.pdf
7. Celis, L.E., Karlin, A., Leyton-Brown, K., Nguyen, T., Thompson, D.: Approxi-
mately revenue-maximizing mechanisms for deliberative agents. In: Association for
the Advancement of Artificial Intelligence (2011)
8. Chakraborty, I., Kosmopoulou, G.: Auctions with edogenous entry. Economic Let-
ters 72(2) (2001)
9. Chawla, S., Hartline, J., Kleinberg, R.: Algorithmic pricing via virtual valuations.
In: Proc. 9th ACM Conf. on Electronic Commerce (2007)
10. Chawla, S., Hartline, J., Malec, D., Sivan, B.: Sequential posted pricing and multi-
parameter mechanism design. In: Proc. 41st ACM Symp. on Theory of Computing
(2010)
On Revenue Maximization for Agents with Costly Information Acquisition 495
11. Chawla, S., Malec, D., Sivan, B.: The power of randomness in bayesian optimal
mechanism design. In: ACM Conference on Electronic Commerce, pp. 149–158
(2010)
12. Compte, O., Jehiel, P.: Auctions and information acquisition: Sealed-bid or dy-
namic formats? Levine’s Bibliography 784828000000000495, UCLA Department of
Economics (October 2005)
13. Cramer, J., Spiegel, Y., Zheng, C.: Optimal selling mechanisms wth costly infor-
mation acquisition. Technical report (2003)
14. Cremer, J., McLean, R.P.: Full extraction of surplus in bayesian and dominant
strategy auctions. Econometrica 56(6) (1988)
15. Gibbard, A.: Manipulation of voting schemes: a general result. Econometrica 41,
211–215 (1973)
16. Hartline, J.: Lectures on approximation and mechanism design. Lecture notes
(2012)
17. Hartline, J., Karlin, A.: Profit maximization in mechanism design. In: Nisan, N.,
Roughgarden, T., Tardos, É., Vazirani, V. (eds.) Algorithmic Game Theory, ch.
13, pp. 331–362. Cambridge University Press (2007)
18. Kleinberg, R., Weinberg, S.M.: Matroid prophet inequalities. In: Symposium on
Theoretical Computer Science (2012)
19. Larson, K.: Reducing costly information acquisition in auctions. In: AAMAS,
pp. 1167–1174 (2006)
20. Larson, K., Sandholm, T.: Strategic deliberation and truthful revelation: an impos-
sibility result. In: ACM Conference on Electronic Commerce, pp. 264–265 (2004)
21. Lavi, R., Swamy, C.: Truthful and near-optimal mechanism design via linear pro-
gramming. In: Proc. 46th IEEE Symp. on Foundations of Computer Science (2005)
22. Levin, D., Smith, J.L.: Equilibrium in auctions with entry. American Economic
Review 84, 585–599 (1994)
23. Myerson, R.: Optimal auction design. Mathematics of Operations Research 6,
58–73 (1981)
24. Thompson, D.R., Leyton-Brown, K.: Dominant-strategy auction design for agents
with uncertain, private values. In: Twenty-Fifth Conference of the Association for
the Advancement of Artificial Intelligence, AAAI 2011 (2011)
Price of Stability in Polynomial Congestion
Games
1 Introduction
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 496–507, 2013.
c Springer-Verlag Berlin Heidelberg 2013
Price of Stability in Polynomial Congestion Games 497
has a cost function that only depends on the number of players that use it.
Each player aspires to minimise the sum of the resources’ costs in its strategy
given the strategies chosen by the other players. Congestion games always admit
a pure Nash equilibrium [20], where players pick a single strategy and do not
randomize. Rosenthal [20] showed this by means of a potential function having
the following property: if a single player deviates to a different strategy then the
value of the potential changes by the same amount as the cost of the deviating
player. Pure Nash equilibria correspond to local optima of the potential function.
Games admitting such a potential function are called potential games and every
potential game is isomorphic to a congestion game [19].
Today we have a strong theory which provides a thorough understanding of
the PoA in congestion games [1,4,5,11,21]. This theory includes the knowledge
of the exact value of the PoA for games with linear [4,11] and polynomial [1] cost
functions, a recipe for computing the PoA for general classes of cost functions
[21], and an understanding of the “complexity” of the strategy space required to
achieve the worst case PoA [5].
In contrast, we still only have a very limited understanding of the Price of
Stability (PoS) in congestion games. Exact values for the PoS are only known
for congestion games with linear cost functions [9,13] and certain network cost
sharing games [3]. The reason for this is that there are more considerations when
bounding the PoS as compared to bounding the PoA. For example, for linear
congestion games, the techniques used to bound the PoS are considerably more
involved than those used to bound the PoA.
A fundamental concept in the design of games is the notion of a dominant-
strategy equilibrium. In such an equilibrium each player chooses a strategy which
is better than any other strategy no matter what the other players do. It is well-
known that such equilibria do not always exist, as the requirements imposed are
too strong. However, it is appealing for a game designer, as it makes outcome
prediction easy. It also simplifies the strategic reasoning of the players and is
therefore an important concept in mechanism design. If we restrict to instances
where such equilibria exist, it is natural to ask how inefficient those equilibria
can be. Interestingly, for linear congestion games, they can be as inefficient as
the PoS [9,13,14].
For any degree d, this gives the exact value of the Price of Stability. For example,
for d = 1 and d = 2, we get
√
3 r2 − 2 r + 1 3 11 r3 − 3 r2 + 1
max 2 =1+ ≈ 1.577 and max ≈ 2.36,
r 2r −2r +2 3 r 5 r3 − 3 r2 + 7
respectively. The PoS converges to d + 1 for large d.
We further show that in contrast to linear congestion games [13,14], already
for d = 2, there is no instance which admits a dominant strategy equilibrium and
achieves this value. More precisely, we show in Theorem 4 that for the subclass
of games that admit a dominant strategy equilibrium the Price of Anarchy is
strictly smaller than the Price of Stability for the general class.
Upper Bound Techniques. Both finding upper and lower bounds for the PoS,
seem to be a much more complicated task than bounding the PoA. For the PoA
of a class of games, one needs to capture the worst-case example of any Nash
equilibrium, and the PoA methodology has been heavily based on this fact. On
the other hand, for the PoS of the same class one needs to capture the worst-
case instance of the best Nash equilibrium. So far, we do not know a useful
characterization of the set of best-case Nash equilibria. It is not straightforward
to transfer the techniques for the PoA to solve the respective PoS problem.
A standard approach that has been followed for upper bounding the PoS can
be summarised as follows:
1. Define a restricted subset R of Nash equilibria.
2. Find the Price of Anarchy with respect to Nash equilibria that belong in R.
The above recipe introduces new challenges: What is a good choice for R, and
more importantly, how can we incorporate the description of R in the Price of
Anarchy methodology? For example, if R is chosen to be the set of all Nash
equilibria, then one obtains the PoA bound. Finding an appropriate restriction
is a non-trivial task and might depend on the nature of the game, so attempts
vary in the description level of R from natural, “as the set of equilibria with
optimum potential”, to the rather more technical definitions like “the equilibria
that can be reached from a best-response path starting from an optimal setup”.
Like previous work (see for example [3,6,9,13,14]) we consider the PoA of Nash
equilibria with minimum potential (or in fact with potential smaller than the
one achieved in the optimum).
Then we use a linear combination of two inequalities, which are derived from
the potential and the Nash equilibrium conditions, respectively. Using only the
Nash inequality gives the PoA value [1]. Using only the potential inequality gives
an upper bound of d + 1. The question is what is the best way to combine these
inequalities to obtain the minimum possible upper bound? Caragiannis et al. [9]
showed how to do this for linear congestion games. Our analysis shows how to
combine them optimally for all polynomials (cf. parameter ν7 in Definition 3).
The main technical challenge is to extend the techniques used for proving
upper bounds for the PoA [1,11,21]. In general those techniques involve optimiz-
ing over two parameters λ, μ such that the resulting upper bound on the PoA
Price of Stability in Polynomial Congestion Games 499
Lower Bound Techniques. Proving lower bounds for the PoA and PoS is usually
done by constructing specific classes of instances. However, there is a conceptual
difference: Every Nash equilibrium provides a lower bound on the PoA, while for
the PoS we need to give a Nash equilibrium and prove that this is the best Nash
equilibrium. To guarantee optimality, the main approach is based on constructing
games with unique equilibria. One way to guarantee this is to define a game
with a dominant-strategy equilibrium. This approach gives tight lower bounds
in congestion games with linear cost functions [13,14]. Recall, that our separation
result (Theorem 4) shows that, already for d = 2, dominant-strategy equilibria
will not give us a tight lower bound. Thus, we use a different approach. We
construct an instance with a unique Nash equilibrium and show this by using
an inductive argument (Lemma 1).
The construction of our lower bound was governed by the inequalities used
in the proof of the upper bound. At an abstract level, we have to construct an
instance that uses the cost functions and loads on the resource that make all
used inequalities tight. This is not an easy task as there are many inequalities:
most prominently, one derived from the Nash equilibrium condition, one from
the potential, and a third one that upper bounds a linear combination of them
(see Proposition 1). To achieve this we had to come up with a completely novel
construction.
The term Price of Stability was introduced by Anshelevich et al. [3] for a network
design game, which is a congestion game with special decreasing cost functions.
For such games with n players, they showed that the Price of Stability is exactly
Hn , i.e., the n’th harmonic number. For the special case of undirected networks,
the PoS is known to be strictly smaller than Hn [15,7,12,3], but while the best
general upper bound [15] is close to Hn , the best current lower bound is a con-
stant [8]. For special cases better upper bound can be achieved. Li [18] showed an
upper bound of O(log n/ log log n) when the players share a common sink, while
Fiat et al. [16] showed a better upper bound of O(log log n) when in addition
there is a player in every vertex of the network. Chen and Roughgarden [10]
studied the PoS for the weighted variant of this game, where each player pays for
a share of each edge cost proportional to her weight, and Albers [2] showed that
the PoS is Ω(log W/ log log W ), where W is the sum of the players’ weights.
The PoS has also been studied in congestion games with increasing
√ cost func-
tions. For linear congestion games, the PoS is equal to 1 + 3/3 ≈ 1.577 where
the lower bound was shown in [13] and the upper bound in [9]. Bilo[6] showed
upper bounds on the PoS of 2.362 and 3.322 for congestion games with quadratic
500 G. Christodoulou and M. Gairing
and cubic functions respectively. He also gives non-matching lower bounds, which
are derived from the lower bound for linear cost functions in [14].
Awerbuch et al. [4] and Christodoulou and Koutsoupias [11] showed that the
PoA of congestion games with linear cost functions is 52 . Aland et. al. [1] obtained
the exact value on the PoA for polynomial cost functions. Roughgarden’s [21]
smoothness framework determines the PoA with respect to any set of allowable
cost functions. These results have been extended to the more general class of
weighted congestion games [1,4,5,11].
2 Definitions
For any positive integer k ∈ N, denote [k] = {1, . . . , k}. A congestion game [20]
is a tuple (N, E, (Si )i∈N , (ce )e∈E ), where N = [n] is a set of n players and E is
a set of resources. Each player chooses as her pure strategy a set si ⊆ E from a
given set of available strategies Si ⊆ 2E . Associated with each resource e ∈ E is
a nonnegative cost function ce : N → R+ . In this paper we consider polynomial
cost functions with maximum degree d and nonnegative coefficients; that is every
d
cost function is of the form ce (x) = j=0 ae,j · xj with ae,j ≥ 0 for all j.
A pure strategy profile is a choice of strategies s = (s1 , s2 , ...sn ) ∈ S = S1 ×
· · ·×Sn by players. We use the standard notation s−i = (s1 , . . . , si−1 , si+1 , . . . sn ),
S−i = S1 × · · · × Si−1 × Si+1 × · · · × Sn , and s = (si , s−i ). For a pure strategy
profile s define the load ne (s) = |i ∈ N : e ∈ si | as the number of players that
use resource e. The cost for player i is defined by Ci (s) = e∈si ce (ne (s)).
Definition 1. A pure strategy profile s is a pure Nash equilibrium if and only
if for every player i ∈ N and for all si ∈ Si , we have Ci (s) ≤ Ci (si , s−i ).
Definition 2. A pure strategy profile s is a (weakly) dominant strategy equilib-
rium if and only if for every player i ∈ N and for all si ∈ Si and s−i ∈ S−i , we
have Ci (s) ≤ Ci (si , s−i ).
The social cost of a pure strategy profile s is the sum of the players costs
Denote opt = mins SC(s) as the optimum social cost over all strategy profiles
s ∈ S. The Price of Stability of a congestion game is the social cost of the
best-case Nash equilibrium over the optimum social cost
SC(s)
PoS = min .
s is a Nash Equilibrium opt
Price of Stability in Polynomial Congestion Games 501
The PoS for a class of games is the largest PoS among all games in the class.
For a class of games that admit dominant strategy equilibria, the Price of
Anarchy of dominant strategies, dPoA, is the worst case ratio (over all games)
between the social cost of the dominant strategies equilibrium and the optimum
social cost. ne (s)
Congestion games admit a potential function Φ(s) = e∈E j=1 ce (j) which
was introduced by Rosenthal [20] and has the following property: for any two
strategy profiles s and (si , s−i ) that differ only in the strategy of player i ∈ N , we
have Φ(s) − Φ(si , s−i ) = Ci (s) − Ci (si , s−i ). Thus, the set of pure Nash equilibria
correspond to local optima of the potential function. More importantly, there
exists a pure Nash eqilibrium s, s.t.
3 Lower Bound
In this section we use the following instance to show a lower bound on PoS.
Example 1. Given nonnegative integers n, k and d, define a congestion game as
follows:
The remaining players i ∈ [n+1, n+k] are fixed to choose the single resource
Γ . To simplify notation denote by s = (s1 , . . . , sn ) and s∗ = (s∗1 , . . . , s∗n ) the
corresponding strategy profiles. Those profiles correspond to the unique Nash
equilibrium and to the optimal allocation respectively.
In the following lemma we show that s is the unique Nash equilibrium for the
game in Example 1. To do so, we show that s1 is a dominant strategy for player 1
and that given that the first i − 1 players play s1 , . . . , si−1 , then si is a dominant
strategy for player i ∈ [n].
502 G. Christodoulou and M. Gairing
We use the instance from Example 1 to show the lower bound in the following
theorem. We define ρ = nk and r = k+n k = 1 + ρ1 > 1. We let n → ∞ and
determine the r > 1 which maximises the resulting lower bound1 . Note that
r > 1 is the ratio of the loads on resource Γ in Example 1.
Theorem 2. For congestion games with polynomial cost functions with maxi-
mum degree d and nonnegative coefficients, we have
(2d d + 2d − 1) · rd+1 − (d + 1) · rd + 1
PoS ≥ max . (2)
r>1 (2d + d − 1) · rd+1 − (d + 1) · rd + 2d d − d + 1
4 Upper Bound
In this section we show an upper bound on the PoS for polynomial congestion
games. We start with two technical lemmas and a definition, all of which will be
used in the proof of Proposition 1. This proposition is the most technical part of
the paper. It shows an upper bound on a linear combination of two expressions;
one is derived from the Nash equilibrium condition and the other one from the
potential. Equipped with this, we prove our upper bound in Theorem 3.
Lemma 2. Let f be a nonnegative
x and convex
x function, then for all nonnegative
integers x, y with x ≥ y, i=y+1 f (i) ≥ y f (t)dt + 12 (f (x) − f (y)).
Observe that for all d ≥ 1 and r > 1, f (ν) is a monotone increasing function in ν.
Thus ν7 ∈ (0, 1] is well defined since f (0) < 0 and f (1) > 0 for all r > 1. Moreover,
f (ν) ≥ 0 for all ν ≥ ν7. We will make use of the following bounds on ν7.
Lemma 3. Define ν7 as in Definition 3. Then d
2d +d−1
≤ ν7 < d+1
2d +d−1
.
1
Notice that the value r that optimizes the right hand side expression of (2) might
not be rational. The lower bound is still valid as we can approximate an irrational r
arbitrarily close by a rational.
Price of Stability in Polynomial Congestion Games 503
Proof. Since c is a polynomial cost function with maximum degree d and non-
negative coefficients it is sufficient to show the claim for all monomials of degree
t where 0 ≤ t ≤ d. Thus, we will show that
x
y
(μ + ν − 1) · xt+1 + λ · y t+1 − ν · y(x + 1)t + (1 − ν)(d + 1) it − it ≥ 0 (3)
i=1 i=1
1
μ · xt+1 + (λ + ν − 1) · y t+1 − ν · y(x + 1)t + (1 − ν)(d + 1)(xt − y t )
2
λ+ν −1 ν 3 t
≥ μ+ ·x t+1
− · x t+1
+x ·2
t
−1
r t+1 r 2
1 1
+ (1 − ν)(d + 1) 1 − t
· xt
2 r
t
λ+ν −1 ν 1 1 2ν 3
= μ+ − ·x t+1
+ (1 − ν)(d + 1) 1 − t − −1 ·xt .
r t+1 r 2 r r 2
:=A(ν) :=B(ν)
where the first inequality holds since ν ≤ 1 and the second inequality is by
Definition 3 and ν ≥ ν7. Since x ≥ 2, we get
A(ν) · xt+1 + B(ν) · xt ≥ (2A(ν) + B(ν)) · xt .
To complete the proof we show that 2A(ν) + B(ν) ≥ 0 for ν ≥ ν7.
2A(ν) + B(ν)
t
1 2 1 1 2 3
= d+1
2 + 2(d − 1) 1 − − − (d + 1) 1 − t − −1 ·ν
r t+1 r 2 r r 2
1 1 1
− 2d 1 − + (d + 1) 1 − t
r t+1 2 r
t
1 1 1 2 3
= d+1
2 + 2(d − 1) 1 − − (d + 1) 1 − t − ·ν
r t+1 2 r r 2
1 1 1
− 2d 1 − + (d + 1) 1 − t ,
r t+1 2 r
We are now ready to prove the upper bound of our main result.
Theorem 3. For congestion games with polynomial cost functions with maxi-
mum degree d and nonnegative coefficients, we have
(2d d + 2d − 1) · rd+1 − (d + 1) · rd + 1
P oS ≤ max .
r>1 (2d + d − 1) · rd+1 − (d + 1) · rd + 2d d − d + 1
With λ = d + 1 − d7
ν and μ = (2d + d − 1)7
ν − d, applying Proposition 1 gives
Thus,
SC(s) λ d + 1 − d7ν
≤ = ,
SC(s∗ ) 1−μ d + 1 − (2d + d − 1)7
ν
d(1 − rd+1
1
)
ν7 ≥ . (8)
2 + (d − 1)(1 − rd+1
d 1
) − 1r
506 G. Christodoulou and M. Gairing
Denote r̂ as the value for r > 1 which makes inequality (8) tight. Such a value
r̂ must exist since ν7 is the minimum value satisfying this inequality. So,
d(r̂d+1 − 1)
ν7 = .
2d r̂d+1 + (d − 1)(r̂d+1 − 1) − r̂d
d + 1 − d7ν
P oS ≤
d + 1 − (2d + d − 1)7
ν
(d+1)2d r̂ d+1 +(d2 −1)(r̂ d+1 −1)−(d+1)r̂ d −d2 (r̂ d+1 −1)
= 2d (d+1)r̂ d+1+(d2 −1)(r̂ d+1 −1)−(d+1)r̂ d −2d d(r̂ d+1 −1)−d(d−1)(r̂ d+1−1)
(2d d + 2d − 1)r̂d+1 − (d + 1)r̂d + 1
= d
(2 + d − 1)r̂d+1 − (d + 1)r̂d + 2d d − d + 1
(2d d + 2d − 1) · rd+1 − (d + 1) · rd + 1
≤ max d ,
r>1 (2 + d − 1) · rd+1 − (d + 1) · rd + 2d d − d + 1
5 Separation
For the linear case, the Price of Stability was equal to the Price of Anarchy of
dominant strategies, as the matching lower bound instance would hold for dom-
inant strategies. Here, we show that linear functions was a degenerate case, and
that this is not true for higher order polynomials. We show that for games that
possess dominant equilibria, the Price of Anarchy for them is strictly smaller2 .
Our separation leaves as an open question what is the exact value of the Price
of Anarchy of dominant strategies for these games.
Theorem 4. Consider a congestion game with quadratic cost functions which
admits a dominant strategy equilibrium s. Then SC(s)
opt ≤ 3 .
7
Observe that this upper bound is strictly smaller than the exact value of the
PoS for general congestion games with quadratic cost functions from Theorem 1,
which was ≈ 2.36.
References
1. Aland, S., Dumrauf, D., Gairing, M., Monien, B., Schoppmann, F.: Exact price
of anarchy for polynomial congestion games. SIAM Journal on Computing 40(5),
1211–1233 (2011)
2. Albers, S.: On the value of coordination in network design. SIAM Journal on Com-
puting 38(6), 2273–2302 (2009)
2
By a more elaborate analysis one can come up with an upper bound of ≈ 2.242 Here
we just wanted to demonstrate the separation of the two measures.
Price of Stability in Polynomial Congestion Games 507
3. Anshelevich, E., Dasgupta, A., Kleinberg, J.M., Tardos, É., Wexler, T.,
Roughgarden, T.: The price of stability for network design with fair cost allocation.
SIAM Journal on Computing 38(4), 1602–1623 (2008)
4. Awerbuch, B., Azar, Y., Epstein, A.: Large the price of routing unsplittable flow.
In: Proceedings of STOC, pp. 57–66 (2005)
5. Bhawalkar, K., Gairing, M., Roughgarden, T.: Weighted congestion games: Price of
anarchy, universal worst-case examples, and tightness. In: de Berg, M., Meyer, U.
(eds.) ESA 2010, Part II. LNCS, vol. 6347, pp. 17–28. Springer, Heidelberg (2010)
6. Bilò, V.: A unifying tool for bounding the quality of non-cooperative solutions
in weighted congestion games. In: Erlebach, T., Persiano, G. (eds.) WAOA 2012.
LNCS, vol. 7846, pp. 215–228. Springer, Heidelberg (2013)
7. Bilò, V., Bove, R.: Bounds on the price of stability of undirected network design
games with three players. Journal of Interconnection Networks 12(1-2), 1–17 (2011)
8. Bilò, V., Caragiannis, I., Fanelli, A., Monaco, G.: Improved lower bounds on
the price of stability of undirected network design games. In: Kontogiannis, S.,
Koutsoupias, E., Spirakis, P.G. (eds.) SAGT 2010. LNCS, vol. 6386, pp. 90–101.
Springer, Heidelberg (2010)
9. Caragiannis, I., Flammini, M., Kaklamanis, C., Kanellopoulos, P., Moscardelli,
L.: Tight bounds for selfish and greedy load balancing. Algorithmica 61, 606–637
(2011)
10. Chen, H.-L., Roughgarden, T.: Network design with weighted players. Theory of
Computing Systems 45, 302–324 (2009)
11. Christodoulou, G., Koutsoupias, E.: The price of anarchy of finite congestion
games. In: Proceedings of STOC, pp. 67–73 (2005)
12. Christodoulou, G., Chung, C., Ligett, K., Pyrga, E., van Stee, R.: On the price of
stability for undirected network design. In: Bampis, E., Jansen, K. (eds.) WAOA
2009. LNCS, vol. 5893, pp. 86–97. Springer, Heidelberg (2010)
13. Christodoulou, G., Koutsoupias, E.: On the price of anarchy and stability of cor-
related equilibria of linear congestion games. In: Brodal, G.S., Leonardi, S. (eds.)
ESA 2005. LNCS, vol. 3669, pp. 59–70. Springer, Heidelberg (2005)
14. Christodoulou, G., Koutsoupias, E., Spirakis, P.G.: On the performance of approx-
imate equilibria in congestion games. Algorithmica 61(1), 116–140 (2011)
15. Disser, Y., Feldmann, A.E., Klimm, M., Mihalák, M.: Improving the hk -bound
on the price of stability in undirected shapley network design games. CoRR,
abs/1211.2090 (2012); To appear in CIAC 2013
16. Fiat, A., Kaplan, H., Levy, M., Olonetsky, S., Shabo, R.: On the price of stability for
designing undirected networks with fair cost allocations. In: Bugliesi, M., Preneel,
B., Sassone, V., Wegener, I. (eds.) ICALP 2006. LNCS, vol. 4051, pp. 608–618.
Springer, Heidelberg (2006)
17. Koutsoupias, E., Papadimitriou, C.: Worst-case equilibria. In: Meinel, C., Tison,
S. (eds.) STACS 1999. LNCS, vol. 1563, pp. 404–413. Springer, Heidelberg (1999)
18. Li, J.: An O( logloglogn n ) upper bound on the price of stability for undirected Shapley
network design games. Information Processing Letters 109(15), 876–878 (2009)
19. Monderer, D., Shapley, L.: Potential games. Games and Economics Behavior 14,
124–143 (1996)
20. Rosenthal, R.W.: A class of games possessing pure-strategy Nash equilibria. Inter-
national Journal of Game Theory 2, 65–67 (1973)
21. Roughgarden, T.: Intrinsic robustness of the price of anarchy. Communications of
the ACM 55(7), 116–123 (2012)
Localization for a System of Colliding Robots
1 Introduction
Due to their simplicity, efficiency, and flexibility mobile agents or robots have
been widely used in diverse areas namely artificial intelligence, computational
economics, and robotics [3]. Mobile robots are autonomous entities that possess
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 508–519, 2013.
c Springer-Verlag Berlin Heidelberg 2013
Localization for a System of Colliding Robots 509
the ability to move within their environment, to interact with other robots, to
perceive the information of the environment and to process this information.
Some examples of tasks carried out by mobile robots are environment explo-
ration, perimeter patrolling, mapping, pattern formation and localization.
In order to reduce power consumption and to prevent scalability problems,
minimum communication among robots and robots with limited capabilities are
frequently sought. With this in mind, in this paper, we study distributed systems
of mobile robots that allow no communication whatsoever and have limited
capabilities. Part of our motivation is to understand the algorithmic limitations
of what a set of such robots can compute.
The task of our interest is that each robot localizes the initial position of
every other robot also deployed on the ring with respect to its own position. Our
model assumes robot anonymity, collisions as the only way of interaction between
robots, and robots’ movements completely out of their control. The abilities of
each robot are limited to observing the time of any of its collisions, awareness of
its velocity at any time and the capacity to process this information.
Distributed applications often concern mobile robots of very limited commu-
nication and sensing capabilities, mainly due to the limited production cost,
size and battery power. Such collections of mobile robots, called swarms, often
perform exploration or monitoring tasks in hazardous or hard to access envi-
ronments. The usual swarm robot attributes assumed for distributed models
include anonymity, negligible dimensions, no explicit communication, no com-
mon coordinate system (see [4]). In most situations involving such weak robots
the fundamental research question concerns the feasibility of solving the given
task (cf. [5,4]).
In our paper, besides the limited sensing and communication capabilities,
a robot has absolutely no control on its movement, which is determined by the
bumps against its neighbors. In [6,7] the authors introduced population protocols,
modeling wireless sensor networks by limited finite-state computational devices.
The agents of population protocols also follow mobility patterns totally out
of their control. This is called passive mobility, intended to model, e.g., some
unstable environment, like a flow of water, chemical solution, human blood, wind
or unpredictable mobility of agents’ carriers (e.g. vehicles or flocks of birds).
Pattern formation is sometimes considered as one of the steps of more complex
distributed tasks. Our interest in the problem of this paper was fueled by the
patrolling problem [8]. Patrolling is usually more efficient if the robots are evenly
distributed around the environment. Clearly, location discovery is helpful in
uniform spreading of the collection. [9] investigated a related problem, where
uniform spreading in one-dimensional environment has been studied.
The dynamics of the robots in our model is similar to the one observed in
some systems of gas particles which have motivated some applications for mo-
bile robots. The study of the dynamics of particles sliding in a surface that collide
among themselves has been of great interest in physics for a long time. Much of
such work has been motivated for the sake of understanding the dynamic prop-
erties of gas particles [10,11,12,13]. The simplest models of such particle systems
510 J. Czyzowicz, E. Kranakis, and E. Pacheco
assume either a line or a ring as the environment in which particles move. For
instance, Jepsen [14], similarly to our paper, considers particles of equal mass
and arbitrary velocity moving in a ring. He assumes the conservation of momen-
tum and conservation of energy principles, such that when two particles collide
they exchange velocities. Jepsen studies the probabilistic movement of particles
because of its importance for understanding some gas equilibrium properties.
Other works have found applications of particle systems in different fields. For
example, Cooley and Newton [15,16] described a method to generate pseudo
random numbers efficiently by using the dynamics of particle systems.
The distributed computing community has exploited the simple dynamics of
some particle systems to design algorithms for mobile robots. [17] consider a
system of mobile robots that imitate the impact behavior of n elastic particles
moving in a ring. They considered a set of n synchronous robots that collide elas-
tically moving in a frictionless ring in order to carry out perimeter surveillance.
Sporadic communication at the times of collision is assumed. Another example
of a system of robots that mimics particle’s dynamics is found in [18], where the
problem of motion synchronization in the line is studied.
In our paper we also assume a system wherein robots imitate the dynamics of
gas particles moving in a ring, with the restriction that robots can not communi-
cate. The task we consider is localization of the initial position of every robot in
the ring. We call this problem the localization problem. The localization problem
has been previously studied in [2] from a randomized approach and robots oper-
ating in synchronous rounds. Czyzowicz et.al [1], considered a simplified version
of the localization task from a deterministic point of view. They assumed that
all robots have equal speed and that when two of them collide they bounce back.
Czyzowicz et.al show that all robot configurations in which not all the robots
have the same initial direction are feasible and provided a position detection
algorithm for all feasible configurations.
When robots’ velocities are arbitrary and each robot is aware only of its
current velocity, as we assume in this paper, the characterization of all feasible
robot configurations becomes much more complex. In [1] infeasible configurations
can be detected by robots in finite time, while we show here, that without the
knowledge of initial velocities, there always exists some robot for which it is
impossible to decide whether the given configuration is feasible, even if the total
number of robots is known in advance.
We provide a complete characterization of all feasible configurations. If
v0 , v1 , . . . , vn−1 is the collection of velocities of a given robot configuration S,
we prove that S is feasible if and only if for all i, 0 ≤ i ≤ n − 1 we have
vi = v0 +...+v n
n−1
. Moreover, we provide an upper bound of min0≤i≤n−1 2
|vi −v̄| on
the necessary time to solve the localization problem. Hence the feasibility of any
robot configuration is independent of the starting positions of the robots.
2 The Model
We consider a set of n synchronous and anonymous robots r0 , r1 , . . . , rn−1 de-
ployed on a continuous, one-dimensional ring of perimeter one, represented by
Localization for a System of Colliding Robots 511
the real segment [0, 1) wherein 0 and 1 are identified as the same point. Each
robot ri starts moving at time t = 0 with velocity vi either in counterclockwise
or in clockwise direction. By |vi | we denote the speed of velocity vi .
By ri (t) ∈ [0, 1) we denote the position in the ring of robot ri at time t.
Let P denote the sequence p0 , p1 , . . . , pn−1 of initial positions of the robots,
meaning pi = ri (0), 0 ≤ i ≤ n − 1. W.l.o.g, we assume p0 = 0 as well as a
non-decreasing order in the counterclockwise direction of the initial positions of
the robots. If robot ri moves freely along the ring with velocity vi during the
time interval [t1 , t2 ], then its position at time t ∈ [t1 , t2 ] is given by ri (t) =
ri (t1 ) + vi · (t − t1 ). When two robots collide they exchange velocities following
the principle of momentum conservation and conservation of energy in classical
mechanics for objects of equal mass [19]. We assume that in any collision no
more than two robots are involved.
Regarding the capabilities of the robots, we assume that each of them has a
clock which can measure time in a continuous way. Each robot is always aware of
its clock, current velocity and the time of any of its collisions. The movement of
a robot is beyond its control in that it depends solely on its initial position and
velocity, as well as the collisions with other robots along the way. At the time
of deployment, no robot is aware of the initial position and the velocity of any
other robot nor of the total number of robots deployed in the ring. Moreover,
robots do not have a common sense of direction.
Let S = (P, V ) be a system of n mobile robots r0 , r1 , . . . , rn−1 with initial po-
sitions P = (p0 , p1 , . . . , pn−1 ) and velocities V = (v0 , v1 , . . . , vn−1 ) respectively;
we denote by v̄ the average of the velocities in V . We say that the localization
problem for S is feasible if there exists a finite time T , such that each robot can
determine the initial positions, and the initial velocities of all robots in the sys-
tem with respect to its own starting position and its own orientation of the ring.
This should be accomplished by each robot by observing the times of a sequence
of collisions taking place within some time interval [0, T ]. Note that each colli-
sion is accompanied by the measurement of collision time and a corresponding
exchange of velocities.
At issue here is not only to determine the feasibility of the localization problem
for the given system S, but also to characterize all such feasible system instances.
For two points p, q in the ring, by d(+) (p, q) we denote the counterclockwise
distance from p to q in the ring, i.e. the distance which needs to be travelled in
the counterclockwise direction in order to arrive at q starting from p. Note that
for p = q we have 0 < d(+) (p, q) < 1, and d(+) (p, q) = 1 − d(+) (q, p).
In order to visualize the dynamics of the robots in the ring, we consider an
infinite line L = (−∞, ∞) and for each robot ri we create an infinite number of
(j)
its copies ri , all having the same initial velocity, such that their initial positions
(j)
in L are ri (0) = j + ri (0) for all integer values of j ∈ Z.
512 J. Czyzowicz, E. Kranakis, and E. Pacheco
We use the idea of baton, applied previously in [1,2], in order to simplify our
arguments and to gain intuition of the dynamics of the robots. Assume that
each robot holds a virtual object, called baton, and when two robots collide they
(j) (j)
exchange their batons. By bi we denote the baton originally held by robot ri
(j)
and by bi (t) we denote the position of this baton on L at time t. Notice that
(j)
the velocity of baton bi is constant so its trajectory corresponds to the line of
slope 1/vi .
By putting together the infinite line and the trajectories of batons, we can
depict the walk of the robots up to any given time. For instance, in Fig. 1, the
dynamics of a system of three mobile robots is depicted. The walk of robot r0
along the ring corresponds to the thick polyline.
−1 0 1 2
(−1) (−1) (−1) (0) (0) (0) (1) (1) (0) (2) (2) (2)
r0 r1 r3 r0 r1 r3 r0 r1 r3 r0 r1 r3
t0
t1 t2
t3
t4 t5
time
Fig. 1. Trajectory of robot r0 corresponds to the thick polyline. The times of its first
six collisions are also shown.
When a robot moves from any given position p on line L to the position p + 1
(or p − 1) such a robot has completed a tour along the ring in counterclockwise
(or resp. clockwise) direction. For example r0 in Fig. 1 has completed two coun-
terclockwise tours along the ring between time t0 and t3 . We show first, that the
feasibility of the localization problem does not change when the initial speeds of
all robots are increased, or decreased by the same value.
Lemma 1. Let S be a system of robots and let Sc be any of its translations. For
every time t, velocities vi and vj are exchanged in S at time t if, and only if at
time t velocities vi − c and vj − c are exchanged in Sc .
Localization for a System of Colliding Robots 513
We show below that every robot, by each of its collisions, acquires information
about the initial position (relative to its own initial position) and initial velocity
514 J. Czyzowicz, E. Kranakis, and E. Pacheco
0 1 2 0 1 2
(0) (0) (0) (1) (1) (1) (2) (0) (0) (0) (1) (1) (1) (2)
r0 r1 r2 r0 r1 r2 r0 r0 r1 r2 r0 r1 r2 r0
t=0
t0
t1
t2
t3
time
a) b)
of some other robot of the system. We show later that if S is feasible, at some
time moment the collision revealing the position and velocity of any other robot
will eventually arise. However it is worth noting that up to that time moment,
some collisions revealing the positions of the same robot may arise several times.
We assume that, at time t = 0 each robot learns about its initial velocity.
Lemma d(+) (pq , ps ) = ds , we have d(+) (pq , pt ) = (d(+) (pq , ps ) + d(+) (ps , pt ))
mod 1 = ((vs − vt )ti+1 + ds ) mod 1.
It follows from Lemma 3 that for a robot to figure out the starting position
of every other robot it should acquire every velocity of the system in a finite
amount of time. Lemma 3 provides the core of an algorithm for robots to report
the starting position of every robot. We describe such an algorithm later on. The
next lemma is an immediate consequence of Lemma 2 and Lemma 3.
Localization for a System of Colliding Robots 515
Lemma 4. For any system S and its translation Sc , the position discovery prob-
lem is solvable for S, if and only if it is solvable for Sc .
Given a fixed point ρ in the ring, which we call the reference point and S a
system of robots, we associate with each robot ri an integer counter ci that we
call cycle counter. A cycle counter ci increases its value by one each time robot
ri traverses the reference point ρ in the counterclockwise direction and decreases
by one when traversing ρ in clockwise direction. We denote by ci (t) the value of
cycle counter ci at time t. The initial value of ci is set to 0, meaning ci (0) = 0.
(+)
Let Di (t) denote the total distance that robot ri travelled until time t in
(−)
the counterclockwise direction, and Di (t) - the total distance travelled by ri
(+) (−)
in the clockwise direction. Denote Di (t) = Di (t) − Di (t). The following
n−1
observation is the immediate consequence of i=0 vi = 0 for system Sv̄ :
Lemma 5. Consider the translation Sv̄ of any system S. At any time t, no two
cycle counters differ by more than 1, i.e |ci (t) − cj (t)| ≤ 1, 0 ≤ i, j ≤ n − 1.
Moreover, there should be a cycle counter ck(t) such that ck(t) (t) = 0 for some
0 ≤ k(t) ≤ n − 1.
Proof. Let us observe that since robots can not overpass each other they always
keep their initial cyclic order. Therefore, we can simulate the traversals on ρ
by the robots by assuming that robots remain static while ρ is moving in one
of the two directions along the ring; when ρ traverses a robot ri in clockwise
direction, counter ci increases by one and decreases by one if ρ traverses ri in
counterclockwise direction.
We prove first that |ci (t)| ≤ 1, for each 0 ≤ i ≤ n − 1. Indeed, suppose to the
contrary, that |ci (t)| ≥ 2. Consider first the case when ci (t) ≥ 2. In such a case,
ri must have traversed point ρ at least two more times in the counterclockwise
direction than in the clockwise one. Since the robots do not change their rela-
tive order around the ring, each other robot rj must have traversed ρ at least
once more in the counterclockwise direction than in the clockwise n−1one. Hence
(+) (−)
Di (t) > Di (t) for each i = 0, . . . , n − 1. This contradicts i=0 Di (t) = 0.
The argument for ci (t) ≤ −2 is symmetric.
It is easy to see that there are no two robots ri , rj , such that ci (t) = 1 and
cj (t) = −1. Indeed in such a case these robots must have traversed point ρ in
opposite directions which would have forced them to overpass - a contradiction.
Hence the values of all cycle counters at time t belong to the set {0, 1} or to
the set {0, −1}. However ci (t) = 0, for all i = 0, . . . , n − 1 would imply Di (t) be
n−1
all positive or all negative, contradicting i=0 Di (t) = 0, which concludes the
proof.
We can conclude with the following Corollary:
Corollary 1. For each robot ri of Sv̄ and any time t we have |Di (t)| < 1.
516 J. Czyzowicz, E. Kranakis, and E. Pacheco
(+)
Proof. Suppose to the contrary that |Di (t)| ≥ 1 or, by symmetry, that Di (t)−
(−)
Di (t) ≥ 1. In such a case, ri at time t made a full counterclockwise tour around
the ring. By putting the reference point ρ = ri (0), we notice that this forces each
other robot rj to have cj (t) ≥ 1, which contradicts Observation 1.
−1 0 1 2
(−1) (−1) (−1) (−1) (0) (0) (0) (0) (1) (1) (1) (1) (2) (2) (2) (2)
r0 r1 r2 r3 r0 r1 r2 r3 r0 r1 r2 r3 r0 r1 r2 r3
time
Fig. 3. An example of a system of robots where the average of the velocities is equal
to 0. Notice that no robot completes more than one round in any direction.
Fig. 3 depicts a system of mobile robots, where the average of the velocities
is equal to 0. Notice that every robot in the picture never completes more than
one round along the ring in any direction. In the picture the movements of r0
are shown with a thick polyline to illustrate this.
Proof. By Lemma 4, it is sufficient to prove the theorem for Sv̄ = (P, Vv̄ ).
We prove first, that if some robot ri has the initial velocity vi = v̄ = 0, then
the system is not feasible. For the localization problem to be feasible in Sv̄ , each
robot must hold every baton at some time within some finite time interval [0, T ].
We prove by contradiction that, if there is a baton bq of velocity 0, then there
exists a robot whose trajectory will not intersect the trajectory of bq . Thus, such
a robot would not obtain the information about the velocity and the position of
robot rq .
Consider cycle counters cj (t) for each robot rj , 0 ≤ j ≤ n − 1, where the
reference point is set to ρ = rq (0). Because vq = 0, there is always a robot of Sv̄
that remains motionless at point ρ. In other words, each robot of Sv̄ , in order to
hold baton bq has to move to position ρ and collide with the current robot at that
position. Observe that it is not possible that all robots arrive at point ρ from
Localization for a System of Colliding Robots 517
the same direction around the ring. Indeed, in such a case the robot velocities
would be all positive or all negative implying v̄ = 0. Consequently, observe that
there must exist two time moments t1 , t2 and two consecutive robots ri and ri+1
(where index i + 1 is taken modulo n) such that one of these robots visited ρ at
time t1 while walking in one direction and the other robot visited ρ at time t2
while walking in the opposite direction. Notice that t1 = t2 , since we supposed
no three robots meeting simultaneously, and ρ coincides with a stationary robot.
Suppose, that ri arrived at ρ at time t1 while walking clockwise and ri+1
arrived at ρ at time t2 while walking counterclockwise. As robots are arranged
in the counterclockwise order around the ring it follows that within the time
interval [t1 , t2 ] each other robot has to walk counterclockwise through ρ (or walk
more times counterclockwise than clockwise) increasing its cycle counter.
Let S = (P , Vv̄ ), where P = (r0 (t1 ), . . . , rn−1
(t1 )) and let cj be the respec-
tive cycle counter of robot rj for every 0 ≤ j ≤ n − 1. Notice that during the
interval of time [0, t2 − t1 ] every robot of S behaves exactly the same way as
does every robot in Sv̄ in the interval of time [t1 , t2 ]. Thus, at time t∗ = t2 − t1
we have cj (t∗ ) > 0 for all 0 ≤ j ≤ n − 1 which contradicts Lemma 5. This
implies that there is at least one robot that does not learn the initial position of
all robots.
The cases where ri+1 , rather than ri , arrived at ρ at time t1 and when the
directions of ri and ri+1 while walking through ρ are reversed, are symmetric.
Suppose now that no robot has the initial velocity v̄ = 0. Consider any robot
ri and the interval I2 = [ri (0) − 1, ri (0) + 1] of the infinite line L. By Corollary 1
robot ri never leaves interval I2 during its movement, hence its trajectory is
bound to the vertical strip of width 2 (cf. Fig. 3). Consider any baton bj . Suppose,
by symmetry, that vj > 0. Take the trajectory of a copy of baton bj which origins
from the left half of I2 , i.e. from the segment [ri (0) − 1, ri (0]. This trajectory will
go across the vertical strip of width 2 enclosing I2 and leave it before time |v2j | ,
forcing the meeting of robot ri and baton bj . If vj < 0 we need to take a copy
of bj starting at the right half of I2 , i.e. in [ri (0), ri (0) + 1] and the argument is
the same. The time of |v2j | is maximized for j minimizing |vj |.
An example of an infeasible robot configuration is shown in Fig. 2, in which
robot r0 never learns the initial position of robot r1 .
clearly avoided providing robots with linear-size memory to recall all previously
output robots.
The main theorem ensures that at this time all robots have discovered all the
initial positions if the system is feasible.
In algorithm RingLocalization we assume that a robot has at any time im-
mediate access to its clock as well as to the information of its current velocity
through the variables clock and velocity, respectively. So the value of these vari-
ables can not be modified by the robot and they get updated instantaneously
as a collision happens. We can assume that the values of these variables cor-
respond to the readings of robots’ sensors. A robot uses auxiliary variables,
namely old velocity and pos for recalling the position and the velocity of the
robot detected through its last collision.
Algorithm RingLocalization;
1. var pos ← 0, old velocity ← velocity : real; move ← true : boolean;
2. reset clock to 0;
3. while move do
4. walk until collision;
5. pos ← ((velocity − old velocity) · clock + pos) mod 1;
6. output ("Robot of velocity" velocity "detected at position" pos);
7. old velocity ← velocity;
Since variable pos clearly keeps track of ds = d(+) (pq , ps ), Theorem 1 and
Lemma 3 imply the following result.
Theorem 2. Let S = (P, V ) be a system of robots. Suppose that no robot
has initial velocity v̄, meaning vi = v̄ for all vi ∈ V , and that the algorithm
RingLocalization is executed by each robot for time min0≤i≤n−1 2
|vi −v̄| . Then,
every robot correctly reports the initial positions and directions of all robots on
the ring with respect to its initial position.
5 Conclusions
We characterized configurations of all feasible systems. Observe that without the
knowledge of velocities, even if the number of robots in the system is known, it is
impossible for a robot to decide at any time if the system is infeasible. Indeed, by
Theorem 1 to any system S it is possible to add a new robot of velocity equal to
the average v̄, making S infeasible for at least some robot ri of S. Consequently,
given arbitrarily large time T ∗ it is also possible to add to S a robot of velocity
close to v̄, so the system stays feasible but not within the time bound of T ∗
Notice also, that already for two robots at small distance , starting in opposite
directions with small velocities v1 and v2 = −v1 it takes time 1− 2v1 to get the
first collision, so the worst-case time of localization algorithm proportional to
1
min0≤i≤n−1 |vi −v̄| is unavoidable.
Localization for a System of Colliding Robots 519
References
1. Czyzowicz, J., Gąsieniec, L., Kosowski, A., Kranakis, E., Ponce, O.M., Pacheco,
E.: Position discovery for a system of bouncing robots. In: Aguilera, M.K. (ed.)
DISC 2012. LNCS, vol. 7611, pp. 341–355. Springer, Heidelberg (2012)
2. Friedetzky, T., Gąsieniec, L., Gorry, T., Martin, R.: Observe and remain silent
(communication-less agent location discovery). In: Rovan, B., Sassone, V., Wid-
mayer, P. (eds.) MFCS 2012. LNCS, vol. 7464, pp. 407–418. Springer, Heidelberg
(2012)
3. Kranakis, E., Krizanc, D., Markou, E.: The mobile agent rendezvous problem in
the ring. Synthesis Lectures on Distributed Computing Theory 1(1), 1–122 (2010)
4. Suzuki, I., Yamashita, M.: Distributed anonymous mobile robots: Formation of
geometric patterns. SIAM J. Comput. 28(4), 1347–1363 (1999)
5. Das, S., Flocchini, P., Santoro, N., Yamashita, M.: On the computational power of
oblivious robots: forming a series of geometric patterns. In: PODC, pp. 267–276
(2010)
6. Angluin, D., Aspnes, J., Diamadi, Z., Fischer, M.J., Peralta, R.: Computation in
networks of passively mobile finite-state sensors. Distributed Computing 18(4),
235–253 (2006)
7. Angluin, D., Aspnes, J., Eisenstat, D.: Stably computable predicates are semilinear.
In: PODC, pp. 292–299 (2006)
8. Czyzowicz, J., Gasieniec, L., Kosowski, A., Kranakis, E.: Boundary patrolling by
mobile agents with distinct maximal speeds. Algorithms–ESA 2011, 701–712 (2011)
9. Cohen, R., Peleg, D.: Local spreading algorithms for autonomous robot systems.
Theor. Comput. Sci. 399(1-2), 71–82 (2008)
10. Murphy, T.: Dynamics of hard rods in one dimension. Journal of Statistical
Physics 74(3), 889–901 (1994)
11. Sevryuk, M.: Estimate of the number of collisions of n elastic particles on a line.
Theoretical and Mathematical Physics 96(1), 818–826 (1993)
12. Tonks, L.: The complete equation of state of one, two and three-dimensional gases
of hard elastic spheres. Physical Review 50(10), 955 (1936)
13. Wylie, J., Yang, R., Zhang, Q.: Periodic orbits of inelastic particles on a ring.
Physical Review E 86(2), 026601 (2012)
14. Jepsen, D.: Dynamics of a simple many-body system of hard rods. Journal of
Mathematical Physics 6, 405 (1965)
15. Cooley, B., Newton, P.: Random number generation from chaotic impact collisions.
Regular and Chaotic Dynamics 9(3), 199–212 (2004)
16. Cooley, B., Newton, P.: Iterated impact dynamics of n-beads on a ring. SIAM
Rev. 47(2), 273–300 (2005)
17. Susca, S., Bullo, F.: Synchronization of beads on a ring. In: 46th IEEE Conference
on Decision and Control, pp. 4845–4850 (2007)
18. Wang, H., Guo, Y.: Synchronization on a segment without localization: algorithm
and applications. In: International Conference on Intelligent Robots and Systems,
IROS, pp. 3441–3446 (2009)
19. Gregory, R.: Classical mechanics. Cambridge University Press (2006)
Fast Collaborative Graph Exploration
are sometimes required. This shows a clear separation between the global and
local communication models.
1 Introduction
Exploring an undirected graph-like environment is relatively straight-forward for a sin-
gle agent. Assuming the agent is able to distinguish which neighboring vertices it has
previously visited, there is no better systematic traversal strategy than a simple depth-
first search of the graph, which takes 2(n − 1) moves in total for a graph with n vertices.
The situation becomes more interesting if multiple agents want to collectively explore
the graph starting from a common location. If arbitrarily many agents may be used, then
This work was initiated while A. Kosowski was visiting Y. Disser at ETH Zurich.
Supported by ANR project DISPLEXITY and by NCN under contract DEC-
2011/02/A/ST6/00201. The authors are grateful to Shantanu Das for valuable discussions
and comments on the manuscript. The full version of this paper is available online at:
http://hal.inria.fr/hal-00802308.
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 520–532, 2013.
c Springer-Verlag Berlin Heidelberg 2013
Fast Collaborative Graph Exploration 521
we can generously send nD agents through the graph, where D is the distance from the
starting vertex to the most distant vertex of the graph. At each step, we spread out the
agents located at each node (almost) evenly among all the neighbors of the current
vertex, and thus explore the graph in D steps.
While the cases with one agent and arbitrarily many agents are both easy to under-
stand, it is much harder to analyze the spectrum in between these two extremes. Of
course, we would like to explore graphs in as few steps as possible (i.e., close to D),
while using a team of as few agents as possible. In this paper we study this trade-off
between exploration time and team size. A trivial lower bound on the number of steps
required for exploration with k agents is Ω(D + n/k): for example, in a tree, some
agent has to reach the most distant node from r, and each edge of the tree has to be
traversed by some agent. We look at the case of larger groups of agents, for which D
is the dominant factor in this lower bound. This complements previous research on the
topic for trees [6,8] and grids [17], which usually focused on the case of small groups
of agents (when n/k is dominant).
Another important issue when considering collaborating agents concerns the model
that is assumed for the communication between agents. We need to allow communica-
tion to a certain degree, as otherwise there is no benefit to using multiple agents for
exploration [8]. We may, for example, allow agents to freely communicate with each
other, independent of their whereabouts, or we may restrict the exchange of informa-
tion to agents located at the same location. This paper also studies this tradeoff between
global and local communication.
Table 1. Our bounds for the time required to explore general graphs with using Dnc agents. The
same upper and lower bounds hold for trees. The lower bounds use graphs with D = no(1) .
were explored so far, constructed based only the knowledge that originates from the
agent’s own observations and from other agents that it has met.
Our results. Our main contribution is an exploration strategy for a team of polynomial
size to explore graphs in an asymptotically optimal number of steps. More precisely, for
any > 0, the strategy can operate with Dn1+ < n2+ agents and takes time O(D).
It works even under the local communication model and without prior knowledge of n
or D.
We first restrict ourselves to the exploration of trees (Section 2). We show that with
global communication trees can be explored in time D · (1 + 1/(c − 1) + o(1)) for any
c > 1, using a team of Dnc agents. Our approach can be adapted to show that with
local communication trees can be explored in time D · (1 + 2/(c − 1) + o(1)) for any
c > 1, using the same number of agents. We then carry the results for trees over to
the exploration of general graphs (Section 3). We obtain precisely the same asymptotic
bounds for the number of time steps needed to explore graphs with Dnc agents as for
the case of trees, under both communication models.
Finally, we provide lower bounds for collaborative graph exploration that almost
match our positive results (Section 4). More precisely, we show that, in the worst case
and for any c > 1, exploring a graph with Dnc agents takes at least D · (1 + 1/c − o(1))
time steps in the global communication model, and at least D·(1+2/c−o(1)) time steps
in the local communication model. Table 1 summarizes our upper and corresponding
lower bounds.
Related Work. Collaborative online graph exploration has been intensively studied for
the special case of trees. In [8], a strategy is given which explores any tree with a team of
k agents in O(D+n/ log k) time steps, using a communication model with whiteboards
at each vertex that can be used to exchange information. This corresponds to a compet-
itive ratio of O(k/ log k) with respect to the optimum exploration time of Θ(D + n/k)
when the graph is known. In [13] authors show that the competitive ratio of the strategy
presented in [8] is precisely k/ log k. Another DFS-based algorithm, given in [2], has an
exploration time of O(n/k + Dk−1 ) time steps, which provides an improvement only
for graphs of small diameter and small teams of agents, k = O(logD n). For a special
subclass of trees called sparse trees, [6] introduces online strategies with a competitive
ratio of O(D1−1/p ), where p is the density of the tree as defined in that work. The best
currently known lower bound is √much lower: in [7], it is shown that any deterministic
exploration strategy with k < n has a competitive ratio of Ω(log k/ log log k), even
Fast Collaborative Graph Exploration 523
in the global communication model. A stronger lower bound of Ω(k/ log k) holds for
so-called greedy algorithms [13]. Both for deterministic and randomized
√ strategies, the
competitive ratio is known to be at least 2 − 1/k, when k < n [8]. None of these
lower bounds concern larger teams of agents. In [16] a lower bound of Ω(D1/(2c+1) )
on competitive ratio is shown to hold for a team of k = nc agents, but this lower bound
only concerns so-called rebalancing algorithms which keep all agents at the same height
in the tree throughout the exploration process.
The same model for online exploration is studied in [17], where a strategy is pro-
posed for exploring graphs which can be represented as a D × D grid with a certain
number of disjoint rectangular holes. The authors show that such graphs can be explored
with a team of k agents in time O(D log2 D + n log D/k), i.e., with a competitive ratio
of O(log2 D). By adapting the approach for trees from [7], they also show lower bounds
on the competitive√ ratio in this class of graphs of Ω(log k/log log k) for deterministic
strategies and Ω( log k/log log k) for randomized strategies. These lower bounds also
hold in the global communication model.
Collaborative exploration has also been studied with different optimization objec-
tives. An exploration strategy for trees with global communication is given in [7],
achieving a competitive ratio of (4 − 2/k) for the objective of minimizing the maxi-
mum number of edges traversed by an agent. In [5] a corresponding lower bound of
3/2 is provided.
Our problem can be seen as an online version of the k Traveling Salesmen Problem
(k-TSP) [9]. Online variants of TSP (for a single agent) have been studied in various
contexts. For example, the geometric setting of exploring grid graphs with and without
holes is considered by [10,11,14,15,17], where a variety of competitive algorithms with
constant competitive ratios is provided. A related setting is studied in [4], where an
agent has to explore a graph while being attached to the starting point by a rope of
restricted length. A similar setting is considered in [1], in which each agent has to
return regularly to the starting point, for example for refueling. Online exploration of
polygons is considered in [3,12].
2 Tree Exploration
We start our considerations by designing exploration strategies for the special case when
the explored graph is a tree T rooted at a vertex r. For any exploration strategy, the set
of all encountered vertices (i.e., all visited vertices and their neighbors) at the beginning
of step s = 1, 2, 3, . . . forms a connected subtree of T , rooted at r and denoted by T (s) .
In particular, T (1) is the vertex r together with its children, which have not yet been
visited. For v ∈ V (T ) we write T (s) (v) to denote the subtree of T (s) rooted at v. We
denote by L(T (s) , v) the number of leaves of the tree T (s) (v). Note that L(T (s) , v) ≤
L(T (s+1) , v) because each leaf in T (s) (v) is either a leaf of the tree T (s+1) or the root of
a subtree containing at least one vertex. If v is an unencountered vertex at the beginning
of step s, i.e., its parent was not yet visited, we define L(T (s) , v) = 1.
524 D. Dereniowski et al.
and define α∗i as the number of agents of the i-th wave that reach the leaf f , i.e., the size
of the i-th wave in step i + Df . If α∗1 = α∗2 = · · · = α∗i−1 = 0 and α∗i ≥ 1 for some
time step i, then we say that leaf f is explored by the i-th wave. Before we proceed with
the analysis, we show the following auxiliary claim.
Claim (*). Let i be a time step for which αi ≥ log x. Then, α∗i ≥ αi , and thus αi is
a lower bound on the number of agents reaching f in step i + Df .
(i+j) (i+j)
Proof (of the claim). We define cj = λj+1 /λj for j = 0, . . . , Df − 1. For i ≥ 1
Df −1
we have αi = x/2 j=0 cj . Since cj ≤ 1 for all j and since αi ≥ log x, there exist
at most log x different j such that cj ≤ 1/2. Denote the set of all such j by J , with
|J | ≤ log x. Also, denote the size of wave wi in step i + s by as (for s = 0, 1, 2, . . .),
in particular a0 = x.
(i+s) (i+s)
Consider some index s for which cs > 1/2. We have λs+1 /λs > 1/2, thus
(i+s)
more than half of all leaves of the tree T (fs ) also belong to the tree T (i+s) (fs+1 ).
But then, in time step i + s + 1, agents are sent from fs to fs+1 according to the defi-
nition in expression (ii) in procedure TEG. Thus, we can lower-bound the size of wave
wi in step i + s + 1 by as+1 ≥ as cs . Otherwise, if cs ≤ 1/2 (i.e., if s ∈ J ), then
agents are sent according the definition in expression (i) in procedure TEG, and hence
as+1 ≥ as cs . Note that these bounds also hold if there are no agents left in the wave,
i.e., as = as+1 = 0. Thus, we have:
1, if s ∈ J ,
as+1 ≥ as cs − δs , where δs =
0, otherwise.
In this way we expand the expression for α∗i = aDf :
α∗i = aDf ≥ aDf −1 cDf −1 −δDf −1 ≥ . . . ≥ (... ((a0 c0 −δ0 )c1 −δ1 )c2 −. . .)cDf −1 −δDf −1 =
⎛ ⎞
Df −1 Df −1 Df −1 Df −1
=x cj − ⎝δj cj ⎠ ≥ 2αi − δj ≥ 2αi − |J | ≥ 2αi − log x.
j=0 j=0 p=j+1 j=0
a
We want to find a, such that i=1 αi ≥ (log x)a . Taking into account (1), it is sufficient
to find a satisfying
(x/2)a
≥ (log x)a ,
na+D
which for sufficiently large x (we take x > 6(n log n + 1)) can be equivalently trans-
formed by taking logarithms and arithmetic to the form:
D
a≥ .
logn x − 1 − logn (2 log x)
D
Hence, for a = log x−1−log , we have that there exists some i such that
n n (2 log x)
αi ≥ log x. For the same i we have α∗i ≥ log x, by Claim (*). Thus, a waves are
sufficient to explore the path F . This analysis can be done for any leaf f , thus it is
enough to send a waves in order to explore the graph G. Considering that a wave wi is
completed by the end of step D+i−1, the exploration takes at most D+a−1 time steps
(2 log x) ) time steps. %
&
1
in total. Thus, the exploration takes at most D·(1+ log x−1−log
n n
We remark that in the above Lemma, the total number of agents used throughout all
steps of procedure TEG is x · D · (1 + log x−1−log
1
). For any c > 1, by appro-
n n (2 log x)
c
priately setting x = Θ(n ), we directly obtain the following theorem.
way about the discovery of the new vertices. Although information about the discovery
may be delayed, in every step s, all agents at vertex v know the entire subtree T (s ) (v)
which was explored until some previous time step s ≤ s. The state flag also has a
third state, “discarded”, which is assigned to agents no longer used in the exploration
process.
The formulation of procedure TEL is not given from the perspective of individual
agents, however, based on its description, the decision on what move to make in the
current step can be made by each individual agent. The correctness of the definition of
the procedure relies on the subsequent lemma, which guarantees that for a certain value
s the tree T (s ) (v) is known to all agents at v.
for each i ∈ {1, . . . , d} do if |Avi | ≥ 2 then for each agent g ∈ Avi do move(s) g to vi .
for each i ∈ {1, . . . , d} do if |Avi | = 1 then change state to “discarded” for agent in Avi .
end for
for each v ∈ V (T (s) ) which is a leaf do move(s) all agents located at v to the parent of v.
end procedure TEL.
Lemma 2. Let T be a tree rooted at some vertex r and let v be a vertex with distance
δ to r. After running procedure TEL until time step s, all agents which: ;are located at
vertex v at the start of time step s know the tree T (s ) (v), for s = δ+s
2 .
Lemma 3. In the local communication model, procedure TEL with parameter x ex-
2+1/ log n
plores any rooted tree T in at most D · (1 + log x−1−log ) time steps, for
n n (4 log x)
x > 17(n log n + 1).
528 D. Dereniowski et al.
Proof (sketch). As in the proof of Lemma 1, we consider any leaf f and the path F =
(f0 , f1 , . . . , fDf ) from r to f . As before, we denote the number of leaves in the subtree
(i)
of T (i) rooted at fj by λj = L(T (i) , fj ). Recall that if fj is not yet discovered in step
i, we have L(T (i) , fj ) = 1. We adopt the definition of a wave from Lemma 1. We define
the values αi differently, however, to take into account the fact that the procedure relies
on a delayed exploration tree, and that some waves lose agents as a result of deploying
( 2i ) λ( 2i +1) ( i +Df −1)
λD 2
x λ1
notifying agents: αi = 4 2
· · · f i +D −1 .
( i ) λ( 2i +1)
λ 2
(
λ 2
f )
0 1 Df −1
We call a wave that discovered at least log x new nodes (or equivalently, a wave
whose agents were the first to visit at least log x nodes of the tree) a discovery wave.
D
Thus, there are at most logfx ≤ log D
x discovery waves along the considered path.
Observe that if a wave is not a discovery wave, then the number of notifying agents it
sends out is at most 2 log x.
We define by α∗i the number of agents of the i-th wave that reach leaf f . We first
prove that the following analogue of Claim (*) from the proof of Lemma 1 holds for
non-discovery waves (we leave out the details from this extended abstract).
Claim (**). Let i be a time step for which wi is not a discovery wave and αi ≥ log x.
Then, α∗i ≥ αi , and thus αi is a lower bound on the number of agents reaching f in
step i + Df .
Finally, we prove that if the number of waves a in the execution of the procedure is
2+1/ log n
sufficiently large, i.e. a ≥ D · ( log x−1−log ), there exists an index i ≤ a, such
n n (4 log x)
that wave wi is not a discovery wave and αi ≥ log x. Exploration is then completed
when the last wave reaches leaves, i.e. in D + a − 1 steps, which completes the proof.
&
%
Acting as in the previous Subsection, from Lemma 3 we obtain a strategy for online
exploration of trees in the model with local communication.
Theorem 2. For any fixed c > 1, the online tree exploration problem can be solved
communication and knowledge of n using a team of k ≥ Dn
c
in the model with local
2
agents in at most D 1 + c−1 + o(1) time steps. &
%
Lemma 4. A team of agents can simulate the virtual exploration of tree T starting from
root (r), while physically moving around graph G starting from vertex r. The simulation
satisfies the following conditions:
(1) An agent virtually occupying a vertex P of T is physically located at a vertex
end(P ) in G.
(2) Upon entering a vertex P of T in the virtual exploration, the agent obtains the
identifiers of all children of P in T .
(3) A virtual move along an edge of T can be performed in a single time step, by
moving the agent to an adjacent location in G.
(4) Agents occupying the same virtual location P in T can communicate locally, i.e.,
they are physically located at the same vertex of G.
We remark that the number of vertices of tree T is exponential in n. Hence, our goal is
to perform the simulation with only a subset of the vertices of T . For a vertex v ∈ V ,
let Pmin (v) ∈ P be the minimum (with respect to the linear order on P) walk ending
at v. We observe that, by property (1) in Lemma 4, if, for all v ∈ V , the vertex Pmin (v)
of T has been visited by at least one agent in the virtual exploration of T , the physical
exploration of G is completed. We define Pmin = {Pmin (v) : v ∈ V }, and show that
all vertices of Pmin are visited relatively quickly if we employ the procedure TEG (or
TEL) for T , subject to a simple modification. In the original algorithm, we divided the
agents descending to the children of the vertex according to the number of leaves of
the discovered subtrees. We introduce an alternate definition of the function L(T (s) , v),
so as to take into account only the number of vertices in T (s) corresponding to walks
which are smallest among all walks in T (s) sharing the same end-vertex.
and for P ∈ P \ V (T (s) ), let L(T (s) , P ) = 1. Subject to this definition of L, pro-
cedure TEG with parameter x > 6(n log n + 1) (procedure TEL with parameter x >
17(n log n + 1)) applied to tree T starting from root (r) visits all vertices from Pmin
530 D. Dereniowski et al.
2+1/ log n
within D · (1 + log x−1−log
1
) (respectively, D · (1 + log x−1−log )) time
n n (2 log x) n n (4 log x)
steps.
Proof. The set Pmin spans a subtree Tmin = T [Pmin] in T , rooted at (r). We can
perform an analysis analogous to that used in the Proofs of Lemmas 1 and 3, evaluating
sizes of waves of agents along paths in the subtree Tmin . We observe that for any P ∈
Pmin which is not a leaf in Tmin , we always have L(T (s) , P ) ≥ 1. Moreover, we
have L(T (s) , P ) ≤ |V (T (s) (P ))|, and so L(T (s) , P ) ≤ n. Since these two bounds
were the only required properties of the functions L in the Proofs of Lemmas 1 and
3, the analysis from these proofs applies within the tree Tmin without any changes. It
follows that each vertex of Pmin is reached by the exploration algorithm within D · (1 +
log x−1−log (2 log x) ) time steps in case of global communication, and within D · (1 +
1
n n
2+1/ log n
logn x−1−logn (4 log x) ) time steps in case of local communication. &
%
For the case when we do not assume knowledge of (an upper bound on) n, we provide
a variant of the above theorem which also completes exploration in O(D) steps, with a
slightly larger multiplicative constant.
Theorem 4. For any c > 1, there exists an algorithm for the local communication
model, which explores a rooted graph of unknown order n and unknown diameter D
using a team of k agents, such that its exploration time is O(D) if k ≥ Dnc .
We remark that by choosing x = Θ(n log n) in Lemma 2, we can also explore a graph
using k = Θ(Dn log n) agents in time Θ(D log n), with local communication. This
bound is the limit of our approach in terms of the smallest allowed team of agents.
4 Lower Bounds
In this section, we show lower bounds for exploration with Dnc agents, complementary
to the positive results given by Theorem 3. The graphs that produce the lower bound are
a special class of trees. The same class of trees appeared in the lower bound from [8]
for the competitive ratio of tree exploration algorithms with small teams of agents. In
our scenario, we obtain different lower bounds depending on whether communication
is local or global.
Theorem 5. For all n > 1 and for every increasing function f , such that log f (n) =
o(log n), and every constant c > 0, there exists a family of trees Tn,D , each with n
vertices and height D = Θ(f (n)), such that
Fast Collaborative Graph Exploration 531
(i) for every exploration strategy with global communication that uses Dnc agents
there exists atree in Tn,D such
that number of time steps required for its exploration
is at least D 1 + 1c − o(1) ,
(ii) for every exploration strategy with local communication that uses Dnc agents there
exists a tree in Tn,D such
that number of time steps required for exploration is at
least D 1 + 2c − o(1) .
When looking at the problem of minimizing the size of the team of agents, our work
(Theorem 4) shows that it is possible to achieve asymptotically-optimal online explo-
ration time of O(D) using a team of k ≤ Dn1+ agents, for any > 0. For graphs
of small diameter, D = no(1) , we can thus explore the graph in O(D) time steps us-
ing k ≤ n1+ agents. This result almost matches the lower bound on team size of
k = Ω(n1−o(1) ) for the case of graphs of small diameter, which follows from the trivial
lower bound Ω(D + n/k) on exploration time (cf. e.g. [8]). The question of establish-
ing precisely what team size k is necessary and sufficient for performing exploration in
O(D) steps in a graph of larger diameter remains open.
References
1. Awerbuch, B., Betke, M., Rivest, R.L., Singh, M.: Piecemeal graph exploration by a mobile
robot. Information and Computation 152(2), 155–172 (1999)
2. Brass, P., Cabrera-Mora, F., Gasparri, A., Xiao, J.: Multirobot tree and graph exploration.
IEEE Transactions on Robotics 27(4), 707–717 (2011)
3. Czyzowicz, J., Ilcinkas, D., Labourel, A., Pelc, A.: Worst-case optimal exploration of terrains
with obstacles. Information and Computation 225, 16–28 (2013)
4. Duncan, C.A., Kobourov, S.G., Kumar, V.S.A.: Optimal constrained graph exploration. ACM
Transactions on Algorithms 2(3), 380–402 (2006)
5. Dynia, M., Korzeniowski, M., Schindelhauer, C.: Power-aware collective tree exploration.
In: Grass, W., Sick, B., Waldschmidt, K. (eds.) ARCS 2006. LNCS, vol. 3894, pp. 341–351.
Springer, Heidelberg (2006)
6. Dynia, M., Kutyłowski, J., Meyer auf der Heide, F., Schindelhauer, C.: Smart robot teams
exploring sparse trees. In: Královič, R., Urzyczyn, P. (eds.) MFCS 2006. LNCS, vol. 4162,
pp. 327–338. Springer, Heidelberg (2006)
7. Dynia, M., Łopuszański, J., Schindelhauer, C.: Why robots need maps. In: Prencipe, G., Zaks,
S. (eds.) SIROCCO 2007. LNCS, vol. 4474, pp. 41–50. Springer, Heidelberg (2007)
8. Fraigniaud, P., Ga̧sieniec, L., Kowalski, D.R., Pelc, A.: Collective tree exploration. Net-
works 48(3), 166–177 (2006)
9. Frederickson, G.N., Hecht, M.S., Kim, C.E.: Approximation algorithms for some routing
problems. SIAM Journal on Computing 7(2), 178–193 (1978)
10. Gabriely, Y., Rimon, E.: Competitive on-line coverage of grid environments by a mobile
robot. Computational Geometry 24(3), 197–224 (2003)
11. Herrmann, D., Kamphans, T., Langetepe, E.: Exploring simple triangular and hexagonal grid
polygons online. CoRR, abs/1012.5253 (2010)
12. Higashikawa, Y., Katoh, N.: Online exploration of all vertices in a simple polygon. In: Proc.
6th Frontiers in Algorithmics Workshop and the 8th Int. Conf. on Algorithmic Aspects of
Information and Management (FAW-AAIM), pp. 315–326 (2012)
13. Higashikawa, Y., Katoh, N., Langerman, S., Tanigawa, S.-I.: Online graph exploration al-
gorithms for cycles and trees by multiple searchers. Journal of Combinatorial Optimization
(2013)
532 D. Dereniowski et al.
14. Icking, C., Kamphans, T., Klein, R., Langetepe, E.: Exploring an unknown cellular en-
vironment. In: Proc. 16th European Workshop on Computational Geometry (EuroCG),
pp. 140–143 (2000)
15. Kolenderska, A., Kosowski, A., Małafiejski, M., Żyliński, P.: An improved strategy for ex-
ploring a grid polygon. In: Kutten, S., Žerovnik, J. (eds.) SIROCCO 2009. LNCS, vol. 5869,
pp. 222–236. Springer, Heidelberg (2010)
16. Łopuszański, J.: Tree exploration. Tech-report, Institute of Computer Science, University of
Wrocław, Poland (2007) (in Polish)
17. Ortolf, C., Schindelhauer, C.: Online multi-robot exploration of grid graphs with rectangu-
lar obstacles. In: Proc. 24th ACM Symp. on Parallelism in Algorithms and Architectures
(SPAA), pp. 27–36 (2012)
Deterministic Polynomial Approach in the Plane
1 Introduction
Among numerous tasks performed by mobile agents one of the most basic and well
studied is that of meeting (or rendezvous) of two agents [4,30]. Agents are mobile
entities equipped with computational power and they may model humans, animals,
mobile robots, or software agents in communication networks. Applications of ren-
dezvous are ubiquitous. People may want to meet in an unknown town, rescuers
have to find a lost tourist in the mountains, while animals meet to mate or to give
food to their offsprings. In human-made environments mobile robots meet to ex-
change collected samples or to divide between them the task of future exploration
of a contaminated terrain, while software agents meet to share data collected from
nodes of a network or to distribute between them the task of collective network
maintenance and checking for faulty components. The basic task of meeting of two
agents is a building block for gathering many agents. In all these cases it is impor-
tant to achieve the meeting in an efficient way.
Supported in part by NSERC discovery grant and by the Research Chair in Dis-
tributed Computing of the Université du Québec en Outaouais.
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 533–544, 2013.
c Springer-Verlag Berlin Heidelberg 2013
534 Y. Dieudonné and A. Pelc
The Model and the Problem. Agents are usually modeled as points moving
in a graph representing the network, or in the plane. In the first case the meeting
of two agents is defined as both agents being at the same time in the same node
of the graph [15,31] or in the same point inside an edge [11,14]. This is possible to
achieve even when agents have radius of vision 0, i.e., when they cannot sense the
other agent prior to the meeting. As observed in [13], if agents freely circulate
in the plane and can start in arbitrary unknown points of it, bringing them
simultaneously to the same point is impossible with radius of vision 0. A natural
assumption in this case is that agents have some positive radius of vision and
the task is to bring them within this distance, so they can see each other. Once
this is achieved, agents are in contact, so they can get even closer and exchange
information or objects. It should be noted that the expression radius of vision
does not need to be interpreted optically. It is a distance at which the agents can
mutually sense each other optically, audibly (e.g. by emitting sounds in the dark),
chemically (animals smelling each other), or even by touch (real agents are not
points but have positive size, so if a point is chosen inside each of them, there is
some positive distance s, such that they will touch before these chosen points get
at distance s). Since in this paper we study agents moving in the plane, we are
interested in the above described task of bringing the points representing them
at some pre-defined positive distance. Without loss of generality we assume that
this distance is 1 and we call approach the task of bringing the points representing
the two agents at distance at most 1.
An adversary chooses the initial positions of the agents, which are two arbi-
trary points of the plane, it chooses their possibly different starting times, and
it assigns a different label and a possibly different speed to each of them. At
all times each of the agents moves at the assigned speed or stays idle. Labels
are positive integers. Each agent is equipped with a compass showing the cardi-
nal directions, with a measure of length, and with a clock. Clocks of the agents
are not necessarily synchronized. Hence an agent can perform basic actions of
the form: “go North/East/South/West at a given distance” and “stay idle for
a given amount of time”. In fact, these will be the only actions performed by
agents in our solution. Each agent knows its label, having a clock and a mea-
sure of length it can calculate its speed, but it has no information about the
other agent: it does not know the initial position of the other agent relative to
its own, the distance separating them, it does not know the speed of the other
agent or its label. Agents do not have any global system of coordinates and,
prior to accomplishing the approach, they cannot communicate. The cost of an
algorithm accomplishing the task of approach is the total distance travelled by
both agents, and the time of an algorithm is counted from the start of the later
agent.
Our Results. Our main result is a deterministic algorithm to accomplish the
task of approach, working in time polynomial in the unknown initial distance
between the agents, in the length of (the binary representation of) the shorter
label and in the inverse of the larger speed. (Hence it is also polynomial in the
distance, the length of the other label and the inverse of the other speed.) The
Deterministic Polynomial Approach in the Plane 535
cost of the algorithm is polynomial in the first two parameters and does not
depend on the third. The problem of approach in the plane reduces to a network
problem: that of rendezvous in an infinite grid. Due to lack of space, all the
proofs will appear in the journal version of the paper.
Discussion and Open Problems. In this paper we are only interested in
deterministic solutions to the approach problem. Randomized solutions, based on
random walks on a grid, are well known [29]. Let us first discuss the assumptions
concerning the equipment of the agents. From an application point of view the
three tools provided to the agents, i.e., a compass, a unit of length and a clock,
do not seem unrealistic when agents are humans or robots. Nevertheless it is
an interesting question if these tools are really necessary. It is clear that an
agent needs some kind of compass just to be able to change direction of its
walk. However it remains open if our result remains true if the compasses of the
agents are subject to some level of inaccuracy. The same remark concerns the
measure of length: without it an agent could not carry out any moving plan,
but it remains open if the result is still valid if agents have different, possibly
completely unrelated units of length. Probably the most interesting question
concerns the necessity of equipping the agents with a clock. In our solution
clocks play a vital role, as the algorithm is based on interleaving patterns of
moves with prescribed waiting periods. However, the possibility of designing a
polynomial algorithm for the task of approach without any waiting periods, with
each agent always traveling at its steady speed prescribed by the adversary, is
not excluded. Such an algorithm could possibly work without relying on any
clock.
We count the execution time of the algorithm from the starting time of the
later agent. Notice that counting time from the start of the earlier agent does
not make sense. Indeed, the adversary can assign an extremely small speed to
the earlier agent, give a large speed to the later one and start it only when the
earlier agent traversed half of the initial distance between them. The time of
traversing this distance by the earlier agent can be arbitrarily large with respect
to the inverse of the speed of the later agent, and approach must use at least
this time, if the initial distance is larger than 2.
Notice that assigning different labels to agents is the only way to break sym-
metry between them in a deterministic way, and hence to ensure deterministic
approach. Anonymous (identical) agents would make identical moves, and hence
could never approach if started simultaneously with the same speed.
Concerning the complexity of our algorithm, our goal in this paper is only
to keep both the time and the cost polynomial. We do not make any attempt
at optimizing the obtained polynomials. Some improvements may have been
obtained by using more complicated but slightly more efficient procedures or by
performing tighter analysis. However getting optimal time and cost seems to be
a very challenging open problem.
Next, it is interesting to ponder the degree of asynchrony allowed in the nav-
igation of the agents. Some asynchrony is included in our model, by allowing
the adversary to assign arbitrary, possibly different, mutually unknown speeds
536 Y. Dieudonné and A. Pelc
to both agents. Nevertheless we assume that when agents move, they move at
constant speed. A higher level of asynchrony was assumed in [7,11,13,14,22]: the
adversary could change the speed of each agent arbitrarily or halt the agent for
an arbitrary finite time. In such a model it is of course impossible to limit the
time of approach, so our main result could not remain valid. However, it is still
perhaps possible to preserve our other result: design an algorithm in the scenario
of arbitrarily varying speeds of agents, in which the distance travelled by each
agent until approach is polynomial in the unknown initial distance between the
agents and in the length of the shorter label. We leave this as an open problem.
Finally, let us consider the issue of the memory size of the agents. In our model
we do not impose any restriction on it, treating agents, from the computational
point of view, as Turing machines. However, it is easy to see that the execution
of our algorithm requires memory of O(log D + log L + log(1/v)) bits, where D is
the initial distance between the agents, L is the agent’s label and v is its speed.
As for the corresponding lower bound, Ω(log L) bits of memory are necessary to
store the label of the agent, and it can be shown that Ω(log D) bits of memory
are necessary for approach even in the easier scenario where agents are on a line
instead of the plane. By contrast, the lower bound Ω(log(1/v)) is much less clear.
Indeed, if a wait-free solution not using the clock is possible, it could perhaps
be implemented by agents whose memory size does not depend on their speed.
Also this question remains open.
Related Work. The literature on rendezvous can be broadly divided accord-
ing to whether the agents move in a randomized or in a deterministic way. An
extensive survey of randomized rendezvous in various scenarios can be found in
[4], cf. also [2,3,5,6,26]. In the sequel we briefly discuss the literature on deter-
ministic rendezvous that is more closely related to our scenario. This literature
is naturally divided according to the way of modeling the environment: agents
can either move in a graph representing a network, or in the plane. Deterministic
rendezvous in networks has been surveyed in [30].
In most papers on rendezvous in networks a synchronous scenario was as-
sumed, in which agents navigate in the graph in synchronous rounds. Rendezvous
with agents equipped with tokens used to mark nodes was considered, e.g., in [27].
Rendezvous of two agents that cannot mark nodes but have unique labels was
discussed in [15,25,31]. These papers are concerned with the time of synchronous
rendezvous in arbitrary graphs. In [15] the authors show a rendezvous algorithm
polynomial in the size of the graph, in the length of the shorter label and in
the delay between the starting time of the agents. In [25,31] rendezvous time is
polynomial in the first two of these parameters and independent of the delay.
Memory required by two anonymous agents to achieve deterministic rendezvous
has been studied in [20,21] for trees and in [12] for general graphs.
Rendezvous of more than two agents, often called gathering, has been studied,
e.g., in [16,17,28,32]. In [16] agents were anonymous, while in [32] the authors
considered gathering many agents with unique labels. Gathering many labeled
agents in the presence of Byzantine agents was studied in [17]. Gathering many
agents in the plane has been studied in [8,9,19] under the assumption that agents
Deterministic Polynomial Approach in the Plane 537
are memoryless, but they can observe other agents and make navigation deci-
sions based on these observations. Fault-tolerant aspects of this problem were
investigated, e.g., in [1,10]. On the other hand, gathering memoryless agents in
a ring, assuming that agents can see the entire ring and positions of agents in
it, was studied in [23,24].
Asynchronous rendezvous of two agents in a network has been studied in
[7,11,13,14,18,22] in a model when the adversary can arbitrarily change the speed
of each agent or halt the agent for an arbitrary finite time. As mentioned previ-
ously, in this model time cannot be bounded, hence the authors concentrated on
the cost of rendezvous, measured as the total number of edge traversals executed
by both agents. In [14] the authors investigated the cost of rendezvous in the
infinite line and in the ring. They also proposed a rendezvous algorithm for an
arbitrary graph with a known upper bound on the size of the graph. This as-
sumption was subsequently removed in [13], but both in [14] and in [13] the cost
of rendezvous was exponential in the size of the graph and in the larger label.
In [22] asynchronous rendezvous was studied for anonymous agents and the cost
was again exponential. The result from [13] implies a solution to the problem of
approach in the plane at cost exponential in the initial distance between agents
and in the larger of the labels.
The first asynchronous rendezvous algorithms at cost polynomial in the initial
distance of the agents were presented in [7,11]. In these papers the authors
worked in infinite multidimensional grids and their result implies a solution to
the problem of approach in the plane at cost polynomial in the initial distance of
the agents. However, they used the powerful assumption that each agent knows
its starting position in a global system of coordinates. It should be stressed
that the assumptions and the results in these papers are incomparable to the
assumptions and results in the present paper. In [7,11] the authors allow the
adversary to arbitrarily control and change the speed of each agent, and hence
cannot control the time of rendezvous and do not use clocks. To get polynomial
cost (indeed, their cost is close to optimal) they use the assumption of known
starting position in an absolute system of coordinates. By contrast, we assume
arbitrary, possibly different and unknown but constant speeds of each agent, use
clocks and different integer labels of agents but not their positions (in fact our
agents are completely ignorant of where they are) and obtain an algorithm of
polynomial time and cost (in the previously described parameters).
In a recent paper [18] we designed a rendezvous algorithm working for an
arbitrary finite graph in the above asynchronous model. The algorithm has cost
polynomial in the size of the graph and in the length of the smaller label. Again,
the assumptions and the results are incomparable to those of the present paper.
First, in [18], as in [7,11,13], time cannot be controlled and cost in [18] is polyno-
mial in the size of the graph. More importantly, it is unlikely that the methods
from [18], tailored for arbitrary finite graphs, could be used even to obtain our
present result about cost. Indeed, it is easy to see that making cost polynomial
in the initial distance is not possible in arbitrary graphs, as witnessed by the
case of the clique: the adversary can hold one agent at a node and make the
538 Y. Dieudonné and A. Pelc
other agent traverse Θ(n) edges before rendezvous (even at steady speed), in
spite of the initial distance 1. Also in [18] agents walk in the same finite graph,
which is not the case in our present scenario.
2 Preliminaries
It follows from [13] that the problem of approach can be reduced to that of
rendezvous in an infinite grid, in which every node u is adjacent to 4 nodes at
Euclidean distance 1 from it, and located North, East, South and West from node
u. We call this grid a basic grid. Rendezvous in this grid means simultaneously
bringing two agents starting at arbitrary nodes of the grid to the same node or
to the same point inside some edge.
Hence in the rest of the paper we will consider rendezvous in a basic grid,
instead of the task of approach. Instructions in a rendezvous algorithm are:
“go North/East/South/West at distance 1” and “stay idle for a given amount
of time”. Before executing our rendezvous algorithm in a basic grid, an agent
performs two preprocessing procedures. The first is the procedure of transforming
the label of the agent and works as follows. Let L = (b0 b1 . . . br−1 ) be the binary
representation of the label of the agent. We define its transformed label L∗
as the binary sequence b0 b0 b1 b1 . . . br−1 br−1 01). Notice that the length of the
transformed label L∗ is 2r + 2, where r is the length of label L. Moreover,
transformed labels are never prefixes of each other and they must differ at some
position different from the first. This is why original labels are transformed.
The second preprocessing procedure performed by an agent is computing the
inverse of its speed: the agent measures the time θ it takes it to traverse a
distance of length 1. This time, called the basic time of the agent, will be used to
establish the length of waiting periods in the execution of the algorithm. In fact,
measuring θ can be done when the agent traverses the first edge of the basic grid
indicated by the algorithm.
We denote by Δ be√the initial distance between agents in the basic grid.
Notice that D ≤ Δ ≤ 2D, where D is the initial Euclidean distance between
the agents. Let λ be the length of the shorter of the transformed labels of agents,
and let τ be the shorter basic time.
3 Algorithm
Patterns. We first describe several patterns of moves that will be used by our
algorithm. All the patterns are routes in the basic grid, and distances between
nodes are measured also in the basic grid, i.e., in the Manhattan metric. We use
N (resp. E,S,W) to denote the instruction “make an edge traversal by port North
(resp. East, South, West)”. We define the reverse path to the path v1 , . . . , vk of
the agent as the path vk , vk−1 , . . . , v1 . We also define a sub-path of the path
v1 , . . . , vk as vi , vi+1 , . . . , vj−1 , vj , for some 1 ≤ i < j ≤ k.
Pattern BALL(v, s), for a node v and an integer s ≥ 1, visits all nodes of the grid
at distance at most s from v and traverses all edges of the grid between such nodes.
Deterministic Polynomial Approach in the Plane 539
Moreover, executing this pattern the agent is always at distance at most s from v.
Let S(v, i) be the set of nodes at distance exactly i from v. Pattern BALL(v, s) is
executed in s phases, each of which starts and ends at v. Phase 1 is the unit cross with
center v corresponding to the sequence NSEWSNWE. Suppose that phase i − 1,
for i > 1, has been executed. Let v1 , . . . , vq be nodes of S(v, i − 1) with v1 situated
North of v, and all other nodes of S(v, i − 1) ordered clockwise. Phase i consists of
q stages σ1 , . . . , σq . Stage σ1 consists of going from v to v1 using the shortest path
and performing the unit cross NSEWSNWE with center v1 . Stage σj , for 1 < j < q
consists of going from vj−1 to vj using the unique path of length 2 with midpoint
in S(v, i − 2) and performing the unit cross NSEWSNWE with center vj . Stage
σq consists of going from vq−1 to vq , performing the unit cross NSEWSNWE with
center vq and going back to v by the lexicographically smallest shortest path (coded
as a sequence of letters N, E, S, W).
Pattern SU P ERBALL(v, s), for a node v and an integer s ≥ 0, consists
of performing the sequence of patterns BALL(v, 1), BALL(v, 2),...,BALL(v, s),
followed by the reverse path of this sequence of patterns.
For the subsequent patterns we will use the following notation. For i =
1, . . . , s, let w(i, 1), w(i, 2), ... ,w(i, q(i)) be the enumeration of all nodes u at
distance at most i from v in the lexicographic order of the lexicographically
smallest shortest path from v to u.
Pattern F LOW ER(v, s, k) is executed in phases 1, 2, . . . , ks. Each phase con-
sists of two parts. For i ≤ s, part 1 of phase i consists of q(i) stages. Stage
j consists of going from v to w(i, j) by the lexicographically smallest short-
est path π(i, j), then executing SU P ERBALL(w(i, j), i) and then backtrack-
ing to v using the path reverse to π(i, j). For i > s, part 1 of phase i is the
same as part 1 of phase s, except that SU P ERBALL(w(s, j), s) is replaced
by SU P ERBALL(w(s, j), i). Part 2 of every phase is backtracking using the
reverse path to that used in part 1.
Pattern BOU QU ET (v, s, k) is executed in epochs 1, 2, . . . , ks. Each epoch con-
sists of two parts. For i ≤ s, part 1 of epoch i consists of q(i) stages. Stage j consists
of going from v to w(i, j) by the lexicographically smallest shortest path π(i, j),
then executing phase 1, phase 2, ..., phase i of F LOW ER(w(i, j), s, k) and then
backtracking to v using the path reverse to π(i, j). For i > s, part 1 of phase i is the
same as part 1 of phase s, except that the execution of phase 1, phase 2, ..., phase
s of F LOW ER(w(s, j), s, k) is replaced by the execution of phase 1, phase 2, ...,
phase s, phase s + 1, ..., phase i of F LOW ER(w(s, j), s, k). Part 2 of every epoch
is backtracking using the reverse path to that used in part 1.
Pattern CAT CH − BOU QU ET (v, s, k) is executed in q(s) stages. Stage j
consists of going from v to w(s, j) by the lexicographically smallest shortest path
π(s, j), then executing pattern BOU QU ET (w(s, j), s, k) and then backtracking
to v using the path reverse to π(s, j).
Pattern BORDER(v, s, n) consists of executing n times SU P ERBALL(v, s).
Apart from the above patterns of moves, our algorithm will use procedures
W AIT0 (v, s, k), W AIT1 (v, s, k), W AIT2 (v, s, k), and W AIT3 (v, s, k). Each of
540 Y. Dieudonné and A. Pelc
these procedures consists of waiting at the initial position v of the agent for a
prescribed period of time. We will specify these periods of waiting later on.
The Main Idea. The main idea of our rendezvous algorithm in the basic grid is
the following. In order to guarantee rendezvous, symmetry in the actions of the
agents must be broken. Since agents have different transformed labels, this can
be done by designing the algorithm so that each agent processes consecutive bits
of its transformed label, acting differently when the current bit is 0 and when
it is 1. The aim is to force rendezvous when each agent processes the bit cor-
responding to the position where their transformed labels differ. This approach
requires to overcome two major difficulties. The first is that due to the possibly
different starting times and different speeds, agents may execute corresponding
bits of their transformed labels at different times. This problem is solved in our
algorithm by carefully scheduling patterns BORDER and waiting times, in or-
der to synchronize the agents. Patterns BORDER and waiting times have the
following role in this synchronization effort. While a pattern BORDER executed
by one agent pushes the other agent to proceed in its execution, or otherwise
rendezvous is accomplished, waiting periods slow down the executing agent. The
joint application of these two algorithmic ingredients guarantees that agents will
at some point execute almost simultaneously the bit on which they differ. The
second difficulty is to orchestrate rendezvous after the first difficulty has been
overcome, i.e., when each agent executes this bit. This is done by combining
waiting periods with patterns that are included in one another for some pa-
rameters. Our algorithm is designed in such a way that the execution of bit 0
consists of executing a pattern F LOW ER followed by a waiting period followed
by pattern CAT CH − BOU QU ET , while the execution of bit 1 consists of ex-
ecuting a pattern BOU QU ET followed by a waiting period. According to our
algorithm, either F LOW ER will be included in BOU QU ET , or BOU QU ET
will be included in CAT CH − BOU QU ET . If one agent executes a pattern
P included in the pattern P executed simultaneously by the other agent, one
agent must “catch” the other, i.e., rendezvous must occur. The main role of the
waiting periods associated with these patterns is to slow down the agent execut-
ing the pattern included in the other. Indeed, these waiting periods ensure that
the agent executing pattern P does not complete it too early and start some
other action. It can be shown that this synchronization occurs soon enough in
the execution to guarantee rendezvous at polynomial time and cost.
Description of the Algorithm. We are now ready to present a detailed de-
scription of our rendezvous algorithm in the basic grid, executed by an agent
with transformed label L∗ = (c0 c1 . . . c−1 ) of length and with basic time θ.
The agent starts at node v. For technical reasons we define cj = 0 for all j ≥ .
The main “repeat” loop is executed until rendezvous is accomplished. At this
time both agents stop.
For any pattern P we will use the notation C[P ] to denote the number of edge
traversals in the execution of P .
Deterministic Polynomial Approach in the Plane 541
Algorithm Meeting
s := 1; i := 0
repeat
j := 0
while j ≤ s − 1 do
if cj = 0 then
execute F LOW ER(v, s, 4i + 1)
execute W AIT0 (v, s, 4i + 1)
execute CAT CH − BOU QU ET (v, s, 4i + 1)
else
execute BOU QU ET (v, s, 4i + 1)
execute W AIT1 (v, s, 4i + 1)
endif
j := j + 1; i := i + 1; N := 3 · C[CAT CH − BOU QU ET (v, s, 4i + 1)]
if j ≤ s − 1 then
execute BORDER(v, (4i + 1)s, N )
execute W AIT2 (v, s, 4i + 1)
else
M := 2s · C[BORDER(v, (4i + 1)s, N )]
execute BORDER(v, (4i + 1)s, M )
execute W AIT3 (v, s, 4i + 1)
endif
endwhile
s := s + 1
It remains to give the lengths of the waiting periods used by our algorithm. To
this end we introduce the following terminology. We first define fences and walls.
A wall is a pattern BORDER executed in the algorithm immediately prior to a
waiting period W AIT3 . A fence is any other pattern BORDER. We next define
pieces as follows. Notice that any execution of the algorithm can be viewed as
a concatenation of chunks of the following form: some sequence of instructions
Q immediately followed by a wall, immediately followed by a waiting period
W AIT3 . We define the first piece Q1 as the sequence of instructions before the
first wall, and the i-th piece Qi , for i > 1, as the sequence of instructions between
the end of the (i − 1)th W AIT3 and the beginning of the ith wall. We next define
segments. Consider any piece. It can be viewed as a concatenation of chunks of
the following form: some sequence of instructions S immediately followed by
a fence, immediately followed by a waiting period W AIT2 . We define the first
segment S1 of a piece as the sequence of instructions before the first fence of
this piece, and the i-th segment Si of the piece, for i > 1, as the sequence
of instructions between the end of the (i − 1)th W AIT2 in the piece and the
beginning of the ith fence in it. Notice that segments correspond to bits of the
transformed label of the agent: these are sequences of instructions executed in
the statement “if cj = 0 then ... else ...”. A pattern F LOW ER, BOU QU ET or
CAT CH − BOU QU ET will be called an atom of its segment. Now we are ready
542 Y. Dieudonné and A. Pelc
to give the lengths of waiting periods W AIT0 (v, s, 4i + 1), W AIT1 (v, s, 4i + 1),
W AIT2 (v, s, 4i + 1), and W AIT3 (v, s, 4i + 1).
Consider the waiting period W AIT0 (v, s, 4i + 1).
Let τ0 = θ · C[F LOW ER(v, s, 4i + 1)] be the time spent by the agent to perform
F LOW ER(v, s, 4i + 1). The length of the waiting period W AIT0 (v, s, 4i + 1) is
defined as τ0 · C[BOU QU ET (v, 2s, 4i + 1)]. Notice that if W AIT0 (v, s, 4i + 1)
is located in the m-th segment of the s-th piece, then its length upper-bounds
the time of executing the first atom of the m-th segment of the (2s)-th piece –
assuming that this segment corresponds to bit 1 – by an agent with basic time
τ0 (because this atom is BOU QU ET (v, 2s, 4i + 1)). This property is essential
for the proof of correctness.
Consider the waiting period W AIT1 (v, s, 4i + 1) located in the m-th segment
of the s-th piece. Let τ1 = θ ·C[BOU QU ET (v, s, 4i + 1)] be the time spent by the
agent to perform BOU QU ET (v, s, 4i+1). Let i = i+s2 +s(s−1)/2. The length
of the waiting period W AIT1 (v, s, 4i + 1) is defined as the time of executing the
m-th segment of the (2s)-th piece – assuming that this segment corresponds to
bit 0 – by an agent with basic time τ1 .
Consider the waiting period W AIT2 (v, s, 4i + 1) located immediately before
the m-th segment of the s-th piece. Let τ2 be the sum of times spent by the agent
with basic time θ to perform the following chunks: the (m − 1)-th segment of the
s-th piece, the (m − 1)-th fence of the s-th piece, and the first atom of the m-th
segment of the s-th piece. The length of the waiting period W AIT2 (v, s, 4i + 1)
is defined as the time to perform the (m − 1)-th segment of the (2s)-th piece –
assuming that this segment corresponds to bit 1 – together with the (m − 1)-th
fence of the (2s)-th piece, by an agent with basic time τ2 .
Consider the waiting period W AIT3 (v, s, 4i + 1). This period is located im-
mediately before the (s + 1)-th piece. Let τ3 be the sum of times spent by the
agent with basic time θ to perform the following chunks: the s-th piece, the s-th
wall, and the first atom of the first segment of the (s + 1)-th piece. The length
of the waiting period W AIT3 (v, s, 4i + 1) is defined as the time to perform the
(2s)-th wall by an agent with basic time τ3 .
The lengths of the waiting periods having been defined, the description of our
algorithm is now complete.
Theorem 2. Let Δ be the initial distance between agents in the basic grid. Let
λ be the length of the shorter of the transformed labels of agents. Let τ be the
shorter of the basic times of the agents. Then the execution time of Algorithm
Meeting is polynomial in Δ, λ and τ , and its cost is polynomial in Δ and λ.
Since Δ is linear in the initial Euclidean distance between agents, and the length
of the transformed label of an agent is linear in the length of the original label,
in view of the reduction described in Section 2 we have the following corollary
concerning the task of approach in the plane.
References
1. Agmon, N., Peleg, D.: Fault-tolerant gathering algorithms for autonomous mobile
robots. SIAM J. Comput. 36, 56–82 (2006)
2. Alpern, S.: The rendezvous search problem. SIAM J. on Control and Optimiza-
tion 33, 673–683 (1995)
3. Alpern, S.: Rendezvous search on labelled networks. Naval Research Logistics 49,
256–274 (2002)
4. Alpern, S., Gal, S.: The theory of search games and rendezvous. Int. Series in
Operations research and Management Science. Kluwer Academic Publisher (2002)
5. Alpern, J., Baston, V., Essegaier, S.: Rendezvous search on a graph. Journal of
Applied Probability 36, 223–231 (1999)
6. Anderson, E., Weber, R.: The rendezvous problem on discrete locations. Journal
of Applied Probability 28, 839–851 (1990)
7. Bampas, E., Czyzowicz, J., Gasieniec,
L., Ilcinkas, D., Labourel, A.: Almost opti-
mal asynchronous rendezvous in infinite multidimensional grids. In: Lynch, N.A.,
Shvartsman, A.A. (eds.) DISC 2010. LNCS, vol. 6343, pp. 297–311. Springer, Hei-
delberg (2010)
8. Cieliebak, M., Flocchini, P., Prencipe, G., Santoro, N.: Solving the robots gathering
problem. In: Baeten, J.C.M., Lenstra, J.K., Parrow, J., Woeginger, G.J. (eds.)
ICALP 2003. LNCS, vol. 2719, pp. 1181–1196. Springer, Heidelberg (2003)
9. Cohen, R., Peleg, D.: Convergence properties of the gravitational algorithm in
asynchronous robot systems. SIAM J. Comput. 34, 1516–1528 (2005)
10. Cohen, R., Peleg, D.: Convergence of autonomous mobile robots with inaccurate
sensors and movements. SIAM J. Comput. 38, 276–302 (2008)
11. Collins, A., Czyzowicz, J., Gasieniec,
L., Labourel, A.: Tell me where I am so
I can meet you sooner. In: Abramsky, S., Gavoille, C., Kirchner, C., Meyer auf
der Heide, F., Spirakis, P.G. (eds.) ICALP 2010. LNCS, vol. 6199, pp. 502–514.
Springer, Heidelberg (2010)
12. Czyzowicz, J., Kosowski, A., Pelc, A.: How to meet when you forget: Log-space
rendezvous in arbitrary graphs. Distributed Computing 25, 165–178 (2012)
13. J. Czyzowicz, A. Labourel, A. Pelc, How to meet asynchronously (almost) every-
where. ACM Transactions on Algorithms 8, article 37 (2012)
544 Y. Dieudonné and A. Pelc
14. De Marco, G., Gargano, L., Kranakis, E., Krizanc, D., Pelc, A., Vaccaro, U.: Asyn-
chronous deterministic rendezvous in graphs. Theoretical Computer Science 355,
315–326 (2006)
15. Dessmark, A., Fraigniaud, P., Kowalski, D., Pelc, A.: Deterministic rendezvous in
graphs. Algorithmica 46, 69–96 (2006)
16. Dieudonné, Y., Pelc, A.: Anonymous meeting in networks. In: Proc. 24rd Annual
ACM-SIAM Symposium on Discrete Algorithms (SODA 2013), pp. 737–747 (2013)
17. Dieudonné, Y., Pelc, A., Peleg, D.: Gathering despite mischief. In: Proc.
23rd Annual ACM-SIAM Symposium on Discrete Algorithms (SODA 2012),
pp. 527–540 (2012)
18. Dieudonné, Y., Pelc, A., Villain, V.: How to meet asynchronously at polynomial
cost. In: Proc. 32nd Annual ACM Symposium on Principles of Distributed Com-
puting, PODC 2013 (to appear, 2013)
19. Flocchini, P., Prencipe, G., Santoro, N., Widmayer, P.: Gathering of asynchronous
oblivious robots with limited visibility. In: Ferreira, A., Reichel, H. (eds.) STACS
2001. LNCS, vol. 2010, pp. 247–258. Springer, Heidelberg (2001)
20. Fraigniaud, P., Pelc, A.: Deterministic rendezvous in trees with little memory.
In: Taubenfeld, G. (ed.) DISC 2008. LNCS, vol. 5218, pp. 242–256. Springer,
Heidelberg (2008)
21. Fraigniaud, P., Pelc, A.: Delays induce an exponential memory gap for rendezvous
in trees. In: Proc. 22nd Ann. ACM Symposium on Parallel Algorithms and Archi-
tectures (SPAA 2010), pp. 224–232 (2010)
22. Guilbault, S., Pelc, A.: Asynchronous rendezvous of anonymous agents in arbitrary
graphs. In: Fernàndez Anta, A., Lipari, G., Roy, M. (eds.) OPODIS 2011. LNCS,
vol. 7109, pp. 421–434. Springer, Heidelberg (2011)
23. Klasing, R., Kosowski, A., Navarra, A.: Taking advantage of symmetries: Gather-
ing of many asynchronous oblivious robots on a ring. Theoretical Computer Sci-
ence 411, 3235–3246 (2010)
24. Klasing, R., Markou, E., Pelc, A.: Gathering asynchronous oblivious mobile robots
in a ring. Theoretical Computer Science 390, 27–39 (2008)
25. Kowalski, D., Malinowski, A.: How to meet in anonymous network. In: Flocchini,
P., Gasieniec,
L. (eds.) SIROCCO 2006. LNCS, vol. 4056, pp. 44–58. Springer,
Heidelberg (2006)
26. Kranakis, E., Krizanc, D., Morin, P.: Randomized rendez-vous with limited mem-
ory. In: Laber, E.S., Bornstein, C., Nogueira, L.T., Faria, L. (eds.) LATIN 2008.
LNCS, vol. 4957, pp. 605–616. Springer, Heidelberg (2008)
27. Kranakis, E., Krizanc, D., Santoro, N., Sawchuk, C.: Mobile agent rendezvous in
a ring. In: Proc. 23rd Int. Conference on Distributed Computing Systems (ICDCS
2003), pp. 592–599. IEEE (2003)
28. Lim, W., Alpern, S.: Minimax rendezvous on the line. SIAM J. on Control and
Optimization 34, 1650–1665 (1996)
29. Mitzenmacher, M., Upfal, E.: Probability and computing: randomized algorithms
and probabilistic analysis. Cambridge University Press (2005)
30. Pelc, A.: Deterministic rendezvous in networks: A comprehensive survey. Net-
works 59, 331–347 (2012)
31. Ta-Shma, A., Zwick, U.: Deterministic rendezvous, treasure hunts and strongly
universal exploration sequences. In: Proc. 18th ACM-SIAM Symposium on Discrete
Algorithms (SODA ), pp. 599–608 (2007)
32. Yu, X., Yung, M.: Agent rendezvous: a dynamic symmetry-breaking problem.
In: Meyer auf der Heide, F., Monien, B. (eds.) ICALP 1996. LNCS, vol. 1099,
pp. 610–621. Springer, Heidelberg (1996)
Outsourced Pattern Matching
1 Introduction
The problem of securely outsourcing computation to an untrusted server gained
momentum with the recent penetration of cloud computing services. In cloud
computing, clients can lease computing services on demand rather than main-
taining their own infrastructure. While such an approach naturally has numerous
advantages in cost and functionality, the outsourcing mechanism crucially needs
to enforce privacy of the outsourced data and integrity of the computation. Cryp-
tographic solutions for these challenges have been put forward with the concept
of secure delagatable computation [1,6,11,2,8].
Supported in part by the BEAT project 7th Framework Research Programme of the
European Union, grant agreement number: 284989.
Supported from the Danish National Research Foundation, the National Science
Foundation of China (under the grant 61061130540), the Danish Council for In-
dependent Research (under the DFF Starting Grant 10-081612) and also from the
CFEM research center within which part of this work was performed.
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 545–556, 2013.
c Springer-Verlag Berlin Heidelberg 2013
546 S. Faust, C. Hazay, and D. Venturi
communication overhead per search query grows linearly with the text length.
Moreover, the text holder delegates its work to an external untrusted server and
cannot control the content of the server’s responses.
In the outsourced setting we consider a set of clients CT , (C1 , . . . , Cl ) that
interact with a server S in the following way. (1) In a setup phase client CT
uploads a preprocessed text to an external server S. This phase is run only
once and may be costly in terms of computation and communication. (2) In a
query phase clients C1 , . . . , Cl query the text by searching patterns and learn the
matched text locations. The main two goals of our approach are as follows:
To simplify notation we will always only talk about a single client C that interacts
with CT and S in the query phase.
2
This definition is more applicable for search engines where the first few results are
typically more relevant, whereas the former variant is more applicable for a DNA
search where it is important to find all matched positions. For simplicity we only
consider the first variant, our solutions support both variants.
Outsourced Pattern Matching 549
Semi-Honest Outsourced Pattern Matching from Subset Sum. Our first construc-
tion for outsourced pattern matching is secure against semi-honest adversaries.
In this construction client CT generates a vector of random values, conditioned
on that the sum of elements in all positions that match the pattern equals some
specified value that will be explained below. Namely, CT builds an instance T4
for the subset sum problem, where given a trapdoor R the goal is to find whether
there exists a subset in T4 that sums to R. More formally, the subset sum prob-
lem is parameterized by two integers and M . An instance of the problem is
generated by picking random vectors T4 ← ZM , s ← {0, 1} and outputting
(T4, R = T4 · s mod M ). The problem is to find s given T4 and a trapdoor R.
Looking ahead, we will have such a trapdoor Rp for each pattern p of length
m, such that if p matches T then with overwhelming probability there will be
a unique solution to the subset sum instance (T4, Rp ). This unique solution is
placed at exactly the positions where the pattern appears in the text. The client
C that wishes to search for a pattern p obtains this trapdoor from CT and will
hand it to the server. Consequently, we are interested in easy instances of the
subset sum problem since we require the server to solve it for each query. This
is in contrast to prior cryptographic constructions, e.g., [18] that design crypto-
graphic schemes based on the hardness of this problem. We therefore consider
low-density instances which can be solved in polynomial time by a reduction to
a short vector in a lattice [16,10,7].
We further note that the security of the scheme relies heavily on the unpre-
dictability of the trapdoor. Namely, in order to ensure that the server cannot
guess the trapdoor for some pattern p (and thus solve the subset problem and
find the matched locations), we require that the trapdoor is unpredictable. We
therefore employ a pseudorandom function (PRF) F on the pattern and fix this
value as the trapdoor, where the key k for the PRF is picked by CT and the two
clients CT and C communicate via a secure two-party protocol to compute the
evaluation of the PRF.
Efficiency Considerations. The scheme described above does not yet satisfy the
desired properties outlined in the previous paragraphs and has a very limited
usage in practice. Recall that the server is asked to solve subset sum instances
of the form (T4, Rp ), where T4 is a vector of length = n − m + 1 with elements
from ZM for some integer M . In order to ensure correctness we must guarantee
that given a subset sum instance, each trapdoor has a unique solution with high
probability. In other words, the collision probability, which equals 2 /M (stated
also in [13]), should be negligible. Fixing M = 2κ+n for a security parameter
κ, ensures this for a large enough κ, say whenever κ ≥ 80. On the other hand,
we need the subset sum problem to be solvable in polynomial √ time. A simple
calculation (see Eq. (1)), yields in this case a value of ≈ κ. This poses an
inherent limitation on the length of the text to be preprocessed. For instance,
even using a high value of κ ≈ 104 (yielding approximately subset sum elements
of size 10 KByte) limits the length of the text to only 100 bits. This scheme
also requires quadratic communication complexity in the text length during the
setup phase since client CT sends O(n2 + κn) bits.
550 S. Faust, C. Hazay, and D. Venturi
The Definition. Formally, denote by IDEALFOPM ,Sim(z) (κ, (−, T, (p1 , . . . , pλ )))
the output of an ideal adversary Sim, server S and clients CT , C in the above
ideal execution of FOPM upon inputs (−, (T, (p1 , . . . , pλ ))) and auxiliary input z
given to Sim.
We implement functionality FOPM via a protocol π = (πPre , πQuery , πOpm ) con-
sisting of three two-party protocols, specified as follows. Protocol πPre is run
in the preprocessing phase by CT to preprocess text T and forward the out-
come T4 to S. During the query phase, protocol πQuery is run between CT and
C (holding a pattern p); this protocol outputs a trapdoor Rp that depends on
p and will enable the server to search the preprocessed text. Lastly, protocol
πOpm is run by S upon input the preprocessed text and trapdoor Rp (forwarded
by C); this protocol returns C the matched text positions (if any). We denote
by REALπ,Adv(z) (κ, (−, T, (p1 , . . . , pλ ))) the output of adversary Adv, server S
and clients CT , C in a real execution of π = (πPre , πQuery , πOpm ) upon inputs
(−, (T, (p1 , . . . , pλ ))) and auxiliary input z given to Adv.
552 S. Faust, C. Hazay, and D. Venturi
Functionality FOPM
Let m, λ ∈ N. Functionality FOPM sets the table B initially to the empty and
proceeds as follows, running with clients CT and C, server S and adversary Sim.
The schemes described in the next sections, implement the ideal functionality
FOPM in the random oracle model.
Setup phase, πPre . The protocol is invoked between client CT and server S.
Given input T and integer m, client CT picks a random key k ∈ {0, 1}κ and
prepares first the text T for the packaging by writing it as
where u = n/m − 1. Next, for each block Bb and each of the m + 1 patterns
p ∈ {0, 1}m that appear in Bb we proceed as follows (suppose there are at
most t matches of p in Bb ).
1. Client CT evaluates Rp := H(F(k, p)||b), samples a1 , . . . , at−1 ∈ ZM at
random and then fixes at such that at = Rp − t−1 j=1 aj mod M .
2. Set B b [vj ] = aj for all j ∈ [t] and vj ∈ [m + 1]. Note that here we
denote by {vj }j∈[t] (vj ∈ [m + 1]) the set of indexes corresponding to the
positions where p occurs in Bb . Later in the proof we will be more precise
and explicitly denote to which block vj belongs by using explicitly the
notation vjb .
Finally, we outsource the text T = (B 1 , . . . , B
u ) to S.
Query phase, πQuery . Upon issuing a query p ∈ {0, 1}m by client C, clients CT
and C engage in an execution of protocol πQuery which implements the oblivious
PRF functionality (k, p) → (−, F(k, p)). Upon completion, C learns F(k, p).
Oblivious pattern matching phase, πOpm . This protocol is executed between
server S (holding T) and client C (holding F(k, p)). Upon receiving F(k, p)
from C, the server proceeds as follows for each block B b . It interprets
(H(F(k, p)||b), Bb ) as a subset sum instance and computes s as the solution
of Bb · s = H(F(k, p)||b). Let {vj }j∈[t] denote the set of indexes such that
s[vj ] = 1, then the server S returns the set of indexes {ϕ(b, vj )}b∈[u],j∈[t] to
the client C.
Efficiency. Although the protocol described above provides a first basic solution
for the outsourced pattern matching, it suffers from a strong restriction as only
very short texts are supported. (On the positive side, the above scheme does not
rely on a random oracle.) The server S is asked to solve subset sum instances
of the form (T4, Rp ), where T4 is a vector of length = n − m + 1 with elements
from ZM for some integer M . To achieve correctness, we require that each subset
sum instance has a unique solution with high probability. In order to satisfy this
property, one needs to set the parameters such that the value 2 /M is negligible.
Fixing M = 2κ+ achieves a reasonable correctness level.
On the other hand, we need to let S solve subset sum instances efficiently.
The hardness of subset sum depends on the ratio between and log M , which
is usually referred to as the density Δ of the subset sum instance. In particular
both instances with Δ < 1/ (so called low-density instances) and Δ > / log2
(so called high-density instances) can be solved in polynomial time. Note that,
however, the constraint on the ratio 2 /M immediately rules out algorithms for
high-density subset sum (e.g., algorithms based on dynamic programming, since
they usually need to process a matrix of dimension M ). On the other hand, for
low-density instances, an easy calculation shows that + κ > 2 , so that we need
to choose κ, in such a way that
1 √
< 1 + 4κ − 1 . (1)
2
√
The above analysis yields a value of ≈ κ. This poses an inherent limitation on
the length of the text. For instance, even using κ ≈ 104 (yielding approximately
subset sum elements of size 10 KByte) limits the length of the text to only 100 bits.
Packaging. To overcome this severe limitation, we partition the text into smaller
pieces each of length 2m, where each such piece is handled as a separate instance of
the protocol. More specifically, for a text T = (T [1], . . . , T [n]) let (T [1], . . . , T [2m]),
(T [m+1], . . . , T [3m]), . . . be blocks, each of length 2m, such that every two consec-
utive blocks overlap in m bits. Then, for each pattern p that appears in the text the
Outsourced Pattern Matching 555
client CT computes an individual trapdoor for each block where the pattern p ap-
pears. In other words, suppose that pattern p appears in block Bb then we compute
the trapdoor for this block (and pattern p) as H(F(k, p)||b). Here, H is a crypto-
graphic hash function that will be modeled as a random oracle in our proofs. Given
the trapdoors, we apply the preprocessing algorithm to each block individually.
The sub-protocols πQuery and πOpm work as described above with a small
change. In πQuery client C learns the output of the PRF F(k, p) instead of the
actual trapdoors and in πOpm client C forwards directly the result F(k, p) to S.
The server can then compute the actual trapdoor using the random oracle. This
is needed to keep the communication complexity of the protocol low. Note that in
this case if we let {vjb }jb ∈[tb ] be the set of indices corresponding to the positions
where p occurs in a given block Bb , the server needs to map these positions to
the corresponding positions in T (and this has to be done for each of the blocks
where p matches). It is easy to see that such a mapping from a position vjb
in block Bb to the corresponding position in the text T can be computed as
ϕ(b, vj ) = (b − 1)m + vj . The entire protocol is shown in Fig. 2.
Note that now each of the preprocessed blocks B 4b consist of = m+1 elements
in ZM . The advantage is that the blocks are reasonably short which yields subset
sum instances of the form (B 4b , Rp ). Combined with Eq. (1) this yields a value
√
of = 2m − m + 1 = m + 1 < κ, which is an upper bound on the length of
the pattern (and not on the length of the text as before). By combining many
blocks we can support texts of any length polynomial in the security parameter.
Finally, we emphasize that the communication/computational complexities of
πQuery depends on the underlying oblivious PRF evaluation. This in particular
only depends on m (due to the algebraic structure of the [21] PRF). Using
improved PRFs can further reduce the communication complexity. On the other
hand, the communication complexity of πOpm is dominated by the number of
matches of p in T which is optimal.
We state the following result. The proof can be found in the full version [9].
Theorem 1. Let κ ∈ N be the security parameter. For integers n, m we set
λ = poly(κ), μ = poly(κ), u = n/m − 1, = (m + 1)u and M = 2m+κ+1 . We
furthermore require that κ is such that 2m+1 /M is negligible (in κ). Assume
H : {0, 1}μ → ZM is a random oracle and F : {0, 1}κ × {0, 1}m → {0, 1}μ is a
pseudorandom function. Then, protocol πSH from Fig. 2 securely implements the
FOPM functionality in the presence of semi-honest adversaries.
References
1. Applebaum, B., Ishai, Y., Kushilevitz, E.: From secrecy to soundness: Efficient
verification via secure computation. In: Abramsky, S., Gavoille, C., Kirchner, C.,
Meyer auf der Heide, F., Spirakis, P.G. (eds.) ICALP 2010. LNCS, vol. 6198, pp.
152–163. Springer, Heidelberg (2010)
2. Asharov, G., Jain, A., López-Alt, A., Tromer, E., Vaikuntanathan, V., Wichs, D.:
Multiparty computation with low communication, computation and interaction
via threshold FHE. In: Pointcheval, D., Johansson, T. (eds.) EUROCRYPT 2012.
LNCS, vol. 7237, pp. 483–501. Springer, Heidelberg (2012)
556 S. Faust, C. Hazay, and D. Venturi
3. Benabbas, S., Gennaro, R., Vahlis, Y.: Verifiable delegation of computation over
large datasets. In: Rogaway, P. (ed.) CRYPTO 2011. LNCS, vol. 6841, pp. 111–131.
Springer, Heidelberg (2011)
4. Boneh, D., Di Crescenzo, G., Ostrovsky, R., Persiano, G.: Public key encryption
with keyword search. In: Cachin, C., Camenisch, J.L. (eds.) EUROCRYPT 2004.
LNCS, vol. 3027, pp. 506–522. Springer, Heidelberg (2004)
5. Canetti, R., Feige, U., Goldreich, O., Naor, M.: Adaptively secure multi-party
computation. In: STOC, pp. 639–648 (1996)
6. Chung, K.-M., Kalai, Y., Vadhan, S.: Improved delegation of computation us-
ing fully homomorphic encryption. In: Rabin, T. (ed.) CRYPTO 2010. LNCS,
vol. 6223, pp. 483–501. Springer, Heidelberg (2010)
7. Coster, M.J., Joux, A., LaMacchia, B.A., Odlyzko, A.M., Schnorr, C.-P., Stern,
J.: Improved low-density subset sum algorithms. Computational Complexity 2,
111–128 (1992)
8. Damgård, I., Faust, S., Hazay, C.: Secure two-party computation with low com-
munication. In: Cramer, R. (ed.) TCC 2012. LNCS, vol. 7194, pp. 54–74. Springer,
Heidelberg (2012)
9. Faust, S., Hazay, C., Venturi, D.: Outsourced pattern matching. Cryptology ePrint
Archive, Report 2013/XX, http://eprint.iacr.org/
10. Frieze, A.M.: On the lagarias-odlyzko algorithm for the subset sum problem. SIAM
J. Comput. 15(2), 536–539 (1986)
11. Gennaro, R., Gentry, C., Parno, B.: Non-interactive verifiable computing: Out-
sourcing computation to untrusted workers. In: Rabin, T. (ed.) CRYPTO 2010.
LNCS, vol. 6223, pp. 465–482. Springer, Heidelberg (2010)
12. Gentry, C.: Fully homomorphic encryption using ideal lattices. In: STOC,
pp. 169–178 (2009)
13. Impagliazzo, R., Naor, M.: Efficient cryptographic schemes provably as secure as
subset sum. J. Cryptology 9(4), 199–216 (1996)
14. Ishai, Y., Kilian, J., Nissim, K., Petrank, E.: Extending oblivious transfers effi-
ciently. In: Boneh, D. (ed.) CRYPTO 2003. LNCS, vol. 2729, pp. 145–161. Springer,
Heidelberg (2003)
15. Kamara, S., Mohassel, P., Raykova, M.: Outsourcing multi-party computation.
IACR Cryptology ePrint Archive, 2011:272 (2011)
16. Lagarias, J.C., Odlyzko, A.M.: Solving low-density subset sum problems. J.
ACM 32(1), 229–246 (1985)
17. López-Alt, A., Tromer, E., Vaikuntanathan, V.: On-the-fly multiparty computation
on the cloud via multikey fully homomorphic encryption. In: STOC, pp. 1219–1234
(2012)
18. Lyubashevsky, V., Palacio, A., Segev, G.: Public-key cryptographic primitives prov-
ably as secure as subset sum. In: Micciancio, D. (ed.) TCC 2010. LNCS, vol. 5978,
pp. 382–400. Springer, Heidelberg (2010)
19. Micali, S., Rabin, M.O., Kilian, J.: Zero-knowledge sets. In: FOCS, pp. 80–91 (2003)
20. Mohassel, P.: Efficient and secure delegation of linear algebra. IACR Cryptology
ePrint Archive 2011:605 (2011)
21. Naor, M., Reingold, O.: Number-theoretic constructions of efficient pseudo-random
functions. In: FOCS, pp. 458–467 (1997)
22. Papamanthou, C., Tamassia, R., Triandopoulos, N.: Optimal verification of oper-
ations on dynamic sets. In: Rogaway, P. (ed.) CRYPTO 2011. LNCS, vol. 6841,
pp. 91–110. Springer, Heidelberg (2011)
Learning a Ring Cheaply and Fast
1 Introduction
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 557–568, 2013.
c Springer-Verlag Berlin Heidelberg 2013
558 E.G. Fusco, A. Pelc, and R. Petreschi
that nodes can solve them simulating a central monitor. We are interested in the
efficiency of deterministic algorithms for labeled map construction.
In this paper we use the extensively studied LOCAL model of communication
[12]. In this model, communication proceeds in synchronous rounds and all nodes
start simultaneously. In each round each node can exchange arbitrary messages
with all its neighbors and perform arbitrary local computations. The time of
completing a task is the number of rounds it takes. Our goal is to investigate
tradeoffs between the time of constructing a labeled map and its cost, i.e., the
number of messages needed to perform this task. To see extreme examples of
such a tradeoff, consider the map construction task on an n-node ring. The
fastest way to complete this task is in time D, where D = n/2 is the diameter
of the ring. This can be achieved by flooding, but the number of messages used
is then Θ(n2 ). On the other hand, cost Θ(n) (which is optimal) can be achieved
by a version of the time slicing algorithm [11], but then time may become very
large and depends on the labels of the nodes.
The general problem of tradeoffs between time and cost of labeled map con-
struction can be formulated as follows.
For a given time T , what is the smallest number of messages needed for
constructing a labeled map by each node in time T ?
For trees this problem is trivial: leaves of an n-node tree initiate the communica-
tion process and information about ever larger subtrees gets first to the central
node (or central pair of adjacent nodes) and then back to all leaves, using time
equal to the diameter of the tree and O(n) messages, both of which are optimal.
However, as soon as there are cycles in the network, there is no canonical place
to start information exchange on each cycle and proceeding fast seems to force
many messages to be sent in parallel, which in turn intuitively implies large
cost. This phenomenon is present already in the simplest such network, i.e., the
ring. Indeed, our study shows that meaningful tradeoffs between time and cost
of labeled map construction already occur in rings.
We consider rings whose nodes have unique labels that are binary strings of
length polynomial in the size of the ring. (Our results are valid also for much longer
labels, but these can be dismissed for practicality reasons.) In the beginning, every
node knows only its own label, the allowed time T and the diameter D of the ring.
Equivalently, we provide each node with its label, with the diameter D and with
the delay θ = T − D, which is the extra time allowed on top of the minimum time
D in which labeled map construction can be achieved, knowing D a priori.
Knowing its own label is an obvious assumption. Without any additional
knowledge, nodes would have to assume the least possible time and hence do
flooding at quadratic cost. Instead of providing nodes with D and θ, we could
have provided them only with the allowed delay over the least possible time of
learning the ring without a priori knowledge of the diameter. This would not
affect our asymptotic bounds. However, it would result in more cumbersome
formulations because, without knowing D a priori, the optimal time of labeled
map construction varies between D and D + 1, depending on whether the ring is
Learning a Ring Cheaply and Fast 559
of even or odd size. We are interested in achieving map construction with small
delay: in particular, we assume θ ≤ D.
We assume that messages are of arbitrary size, but in our algorithms they
need only to be sufficiently large to contain already acquired information about
the n-node ring, i.e., strings of up to n labels and port numbers. This is a
natural assumption for the task of labeled map construction whose output has
large size, similarly as is done, e.g., in gossiping [7]. This should be contrasted
with such tasks as leader election [9], distributed minimum weight spanning tree
construction [2], or distributed coloring [8], where each node has to output only
a small amount of information, and considered messages are often of small size.
Our Results. We prove almost tight upper and lower bounds on the minimum
cost (number of messages) needed to deterministically perform labeled map con-
struction on a ring in a given time. Our bounds depend on the diameter D of
the ring and on the delay θ = T − D above the least possible time D in which
this task can be performed. We prove a lower bound Ω(D2 /θ) on the cost of
any algorithm with delay θ, and we design a class of algorithms that give an
almost matching upper bound: for any positive constant 0 < ε < 1 there is an
algorithm working with delay θ ≤ D and using O(D2 (log∗ D)/θ1−ε ) messages.
We also provide tradeoffs between time and cost of labeled map construction for
a more general class of graphs, when the delay is larger.
Due to the lack of space, several proofs are omitted.
Related Work. The task of constructing a map of a network has been studied
mostly for anonymous networks, both in the context of message passing systems
[14] and using a mobile agent exploring a network [3]. The goal was to determine
the feasibility of map construction (also called topology recognition) and to
find fast algorithms performing this task. For networks with unique labels, map
construction is of course always feasible and can be done in time equal to the
diameter of the network plus one (in the LOCAL model), which is optimal.
Tradeoffs between the time and the number of messages have been studied
for various network problems, including leader election [6,9,13] weak unison [10],
and gossiping [5]. It should be noticed that if the requirement concerning time is
loose, i.e., concerns only the order of magnitude, then there are no tradeoffs to
speak of for labeled map construction. It follows from [2] that minimum weight
spanning tree construction can be done in time O(n) and at cost O(m+n log n) in
any network with n nodes and m edges, both of which are known to be optimal.
This implies the same complexities for constructing a labeled map. However, our
results show that the task of labeled map construction is very sensitive to time:
time vs. cost tradeoffs occur for the ring between the time spans D and 2D.
To the best of our knowledge, the problem of time vs. cost tradeoffs for labeled
map construction has never been studied before.
We prove the lower bound on the class of oriented rings of even size. (Restricting
the class on which the lower bound is proved only increases the strength of the re-
sult.) We formalize orientation by assigning port numbers 0 and 1 in the clockwise
order at each node. For every node v, let (v) be its label.
We first define the history H(v, t) of node v at time t. Intuitively H(v, t) rep-
resents the entire knowledge that node v can acquire by time t. Since we want
to prove a lower bound on cost, it is enough to assume that whenever a node v
sends a message to a neighbor in round t + 1, the content of this message is its
entire history H(v, t). We define histories of all nodes by simultaneous induction
on t. Define H(v, 0) as the one-element sequence (v). In the inductive defini-
tion, we will use two symbols, s0 and s1 , corresponding to the lack of message
(silence) on port 0 and 1, respectively. Assume that histories of all nodes are
defined until round t. We define H(v, t + 1) as:
– H(v, t), s0 , s1 , if v did not get any message in round t + 1;
– H(v, t), s0 , H(u, t), if v did not get any message in round t+1 on port 0 but
received a message on port 1 from its clockwise neighbor u in that round;
– H(v, t), H(w, t), s1 , if v did not get any message in round t + 1 on port 1
but received a message on port 0 from its counterclockwise neighbor w in
that round;
– H(v, t), H(w, t), H(u, t), if v received a message on port 0 from its counter-
clockwise neighbor w and a message on port 1 from its clockwise neighbor
u, in round t + 1.
We define a communication pattern until round t for the set E of all edges of
the ring as a function f : E × {1, . . . , t} −→ {0, 1}, where f (e, i) = 0, if and
only if no message is sent on edge e in round i. Executing a map construction
algorithm A on a given ring determines a communication pattern, which in turn
determines histories H(v, t), for all nodes v and all rounds t.
For any path πk = u0 . . . uk between nodes u0 and uk we define, by induction
on k, the communication delay δ(πk , f ) induced on πk by the communication
pattern f . For k = 1, δ(π1 , f ) = d, if and only if, f ({u0 , u1 }, i + 1) = 0, for
all i < d, and f ({u0 , u1 }, d + 1) = 1. In particular, if f ({u0 , u1 }, 1) = 1 then
δ(π1 , f ) = 0. Suppose that δ(πk−1 , f ) has been defined. We define δ(πk , f ) =
δ(πk−1 , f )+d, if and only if, f ({uk−1 , uk }, δ(πk−1 , f )+k+i) = 0, for all i < d, and
f ({uk−1 , uk }, δ(πk−1 , f ) + k + d) = 1. In particular, if f ({uk−1 , uk }, δ(πk−1 , f ) +
k) = 1 then δ(πk , f ) = δ(πk−1 , f ). Intuitively the communication delay on a
path between u and v indicates the additional time, with respect to the length
of this path, that it would take node v to acquire any information about node
u, along this path, if no information could be coded by silence. In fact some
information can be coded by silence, and analyzing this phenomenon is the main
conceptual difficulty of our lower bound proof. In particular, we will show that if
map construction has to be performed quickly, then the number of configurations
that can be coded by silence is small with respect to the total number of possible
instances, and hence many messages have to be used for some of them.
We define the communication delay induced by a communication pattern f
between a node x and its antipodal node x as the minimum of the delays induced
Learning a Ring Cheaply and Fast 561
3 The Algorithm
The general idea of our labeled map construction algorithm is to spend the
allowed delay θ in a preprocessing phase that deactivates some nodes, using
the residual time D for a phase devoted to information spreading. This results
in a reduction of the overall cost of the algorithm, with respect to flooding,
since non-active nodes are only responsible for relaying messages originated at
nodes that remained active after the preprocessing phase. Hence, this approach
requires to deactivate as many nodes as possible. However, within delay θ, we
cannot afford to deactivate sequences of consecutive nodes of length larger than
2θ. Indeed, deactivating such long sequences would imply that the label of some
non-active node is unknown to all active nodes, which would make the time of
the information spreading phase exceed the remaining D rounds. We reconcile
these opposite requirements by defining local rules that allow us to deactivate
almost half of the currently active nodes, without deactivating two consecutive
ones. This process is then iterated as many times as possible within delay θ.
The preprocessing phase of our algorithm is divided into stages, each of which
is in turn composed of multiple steps. In the first stage, all nodes are active.
Nodes that become non-active at the end of a stage will never become active
again. In order to simplify the description of the algorithm, we will use the
concept of residual ring. In such a ring, the set of nodes is a subset of the
original set of nodes, and edges correspond to paths of consecutive removed
nodes. In particular, stage i is executed on the residual ring Ri composed of
nodes that remained active at the end of the previous stage. Communication
between consecutive nodes Ri is simulated by a multi-hop communication in
the original ring, where non-active nodes relay messages of active nodes. Each
simulated message exchange during stage i is allotted 2i−1 rounds.
Steps inside stage i are devoted to the election of (i, j)-leaders, where j is the
number of the step. At the beginning of the first step of stage i, (i, 0)-leaders
Learning a Ring Cheaply and Fast 563
are all still active nodes. Step j of stage i is executed on the residual ring Ri,j
composed of (i, j − 1)-leaders from the step j − 1. Multi-hop communication
between two consecutive nodes in Ri,j is allotted 2i−1 4j−1 rounds.
Whenever a node v (active or not) sends or relays a message to its neighbor
w, it appends to the message its label and the port number, at v, corresponding
to the edge {v, w}. In order to simplify the description of the algorithm, we omit
these message parts. We use log to denote logarithms to base two.
We first introduce three procedures that will be used as parts of our algorithm.
The first procedure is due to Cole and Vishkin [4] and Goldberg et al. [8]. It colors
every ring with at most three colors, so that adjacent nodes have distinct colors.
We call it Procedure RTC as an abbreviation of ring three coloring.
Procedure RTC
Input: i, j.
The procedure starts from a ring whose nodes have unique labels of k bits and
produces a coloring of the ring using at most 3 colors in time O(log∗ k). Let
{1, 2, 3} be the set of these colors. Let α log∗ k, where α is a positive constant,
be an upper bound on the duration of this procedure, when labels are of k bits.
The procedure with input i, j is executed on the residual ring Ri,j . 9
The second procedure elects (i, j)-leaders in the ring Ri,j .
Procedure Elect
Input: i, j.
Each node u sends its color c(u) ∈ {1, 2, 3} to its neighbors in Ri,j .
Let v and w be the neighbors of u in Ri,j .
Node u becomes an (i, j)-leader, if and only if c(u) > c(v) and c(u) > c(w). 9
The third procedure is used to deactivate a subset of active nodes at the end
of each stage.
Procedure Deactivate
Input: i, ε.
Each (i, log(8/ε) )-leader u sends its color c(u) ∈ {1, 2, 3} to both its neighbors
in Ri .
All nodes in Ri that are not (i, log(8/ε) )-leaders, upon receiving a message
containing a sequence of colors from a neighbor in Ri , add their color to the
message and relay it to the other neighbor in Ri .
Let l and r be two consecutive (i, log(8/ε) )-leaders. Let S be the sequence
of consecutive active nodes between l and r. Each node in the sequence S, upon
discovering the sequence of colors in S and its position in the sequence, proceeds
according to the following rules.
– If S is of odd length, i.e., S = la1 . . . ak−1 ak bk−1 . . . b1 r, nodes at and bt
become non-active, for all odd values of t. This means that every second
node is deactivated, starting from both ends.
– If S is of even length, i.e., S = lak . . . a1 b1 . . . bk r, nodes at and bt become
non-active, for all even values of t. This means that every second node is
deactivated, starting from the neighbors of the two central nodes. 9
564 E.G. Fusco, A. Pelc, and R. Petreschi
We are now ready to provide a detailed description of our labeled map con-
struction algorithm. For each task that cannot be carried out locally, we allot
a specific number of rounds to maintain synchronization between the execution
of a given part of the algorithm by different nodes. In the analysis we will show
that the allotted times are always sufficient.
Algorithm RingLearning
Input: D, θ, and ε.
Phase 1 – preprocessing
set all nodes as active – (locally);
for i ← 1 to log θ − 2 log(8/ε) − log(α(log∗ D + 3)) //STAGE
construct the residual ring Ri of active nodes – (locally);
elect all nodes in Ri as (i, 0)-leaders – (locally);
for j ← 1 to log(8/ε) //STEP
construct the residual ring Ri,j of (i, j − 1)-leaders – (locally);
assign color c(u) to all nodes u in Ri,j with procedure RTC(i, j);
(allotted time 2i−1 4j−1 α(log∗ D + 1))
elect (i, j)-leaders with procedure Elect(i, j);
(allotted time 2i−1 4j−1 )
run procedure Deactivate(i, ε) in Ri ;
(allotted time 2i−1 4log(8/ε) )
Phase 2 – information spreading
in round θ + 1 each node that is still active constructs locally a labeled map of
the part of the original ring consisting of nodes from which it received messages
during Phase 1, and sends this map to its neighbors;
both active and non-active nodes that receive a message from one neighbor, send
it to the other neighbor;
at time D + θ, all nodes have the labeled map of the ring and stop. 9
We now prove the correctness of Algorithm RingLearning and analyze it by
estimating its cost for a given delay θ. The first two lemmas show that the time
2i−1 allotted for multi-hop communication between consecutive active nodes in
stage i, and the time 2i−1 4j−1 allotted for multi-hop communication between
consecutive (i, j − 1)-leaders in step j of stage i, are sufficient to perform the
respective tasks.
Lemma 2. The distance between two consecutive (i, j)-leaders is at most 2i−1 4j .
The next two lemmas will be used to prove the correctness of Algorithm Ring-
Learning.
Lemma 3. All calls to procedures RTC, Elect, and Deactivate can be carried
out within times allotted in Algorithm RingLearning.
is completed in time at most 2i−1 4j−1 α log∗ L ≤ 2i−1 4j−1 α(log∗ D + 1). Hence
the allotted time is sufficient.
Running Procedure Elect(i, j) requires time 2i−1 4j−1 to allow each (i, j − 1)-
leader to learn the new color of its neighboring (i, j − 1)-leaders. Hence the
allotted time is sufficient.
Running Procedure Deactivate(i, ε) on the residual ring Ri takes time
2i−1 4log(8/ε) . Indeed, within this time, all nodes between two consecutive
(i, log(8/ε) )-leaders learn labels of all nodes between them and decide locally
if they should be deactivated. Hence the allotted time is sufficient. &
%
Proof. The correctness of Procedure RTC follows from [8], provided that enough
time is allotted for its completion. Elections of (i, j)-leaders are carried out ac-
cording to the largest color rule by Procedure Elect(i, j), provided that each
node knows the colors assigned to its neighbors in Ri,j . Decisions to become non-
active can be carried out locally by each node, according to the appropriate rule
from Procedure Deactivate, provided that nodes of each sequence S between
two (i, log(8/ε) )-leaders know the entire sequence. By Lemma 3 the times al-
lotted to all three procedures are sufficient to satisfy the above conditions.
Due to Lemma 4, all nodes stop executing the preprocessing phase within
round θ, hence D more rounds are available for the information spreading phase.
At the end of stage i each (i, log(8/ε) )-leader knows the sequences of node
labels and port numbers connecting it to both closest (i, log(8/ε) )-leaders.
Hence, at the beginning of the information spreading phase, the union of the
sequences known to all active nodes covers the entire ring, and consecutive se-
quences overlap. This in turn implies that, after D rounds of the information
spreading phase, all nodes get the complete labeled map of the ring. &
%
The next three lemmas are used to analyze the cost of Algorithm RingLearning,
running with delay θ.
Lemma 5. At the end of stage i there are at most n((ε/2 + 1)/2)i active nodes
in a ring of size n.
Proof. As shown in the proof of Lemma 4, the time used for stage i is at most
2i−1 4s α(log∗ D + 3), where s = log(8/ε) is the number of steps in each stage.
In view of Lemma 5, during stage i there are at most n((ε/2 + 1)/2)i−1 active
nodes in a ring of size n. Hence the cost of stage i is at most
566 E.G. Fusco, A. Pelc, and R. Petreschi
i−1
ε/2 + 1
2i−1 4s α(log∗ D + 3) · n .
2
Since the number of stages is less than log θ, the overall cost of the preprocessing
phase is less than
%log θ& i−1
∗ ε/2 + 1
2 4 α(log D + 3) · n
i−1 s
.
i=1
2
Bounding each summand with the last one which is the largest we obtain
%log θ& i−1 < =2
ε/2 + 1 8
2i−1 4s α(log∗ D+3)·n ≤ αn(log∗ D+3)θlog(1+ε/2) log θ ,
i=1
2 ε
Proof. Lemmas 6 and 7 imply that the cost of Algorithm RingLearning, ex-
ecuted with parameters D, θ, and ε, in a ring of diameter D, is of the or-
der O(D log∗ D θlog(1+ε/2) log θ + D2 log∗ D/(θ1−ε )), for any constant 0 < ε <
1. Since log(1 + ε/2) − ε is negative for all ε > 0, and θ ≤ D, we have
D
θ1+log(1+ε/2)−ε log θ < D, for sufficiently large D. Hence θ1−ε > θlog(1+ε/2) log θ,
which implies
D2 log∗ D D2 log∗ D
O D log∗ D θlog(1+ε/2) log θ + = O .
θ1−ε θ1−ε
&
%
A subsequent stage works on the residual network of active nodes from the
previous stage. In the case of rings, the residual network remains a ring and hence
coloring with few colors can be done again. As soon as we move to networks of
degree higher than two, the maximum degree of the residual network can grow
exponentially in the number of stages, and thus the technique of fast coloring
with few colors cannot be applied repeatedly. However, allowing delays larger
than D, but still linear in D, permits to use a different approach that is successful
on a larger class of networks.
Consider the class of networks in which neighborhoods of nodes grow poly-
nomially in the radius. More precisely, let Nr (v) be the set of all nodes within
distance at most r from v. We will say that a network has polynomially growing
neighborhoods, if there exists a constant c ≥ 1 (called the growth parameter)
such that |Nr (v)| ∈ Θ(rc ) for all nodes v. Notice that the class of networks
with polynomially growing neighborhoods is fairly large, as it includes, e.g., all
multidimensional grids and tori, as well as rings. On the other hand, all such
networks have bounded maximum degree.
Consider the following doubling algorithm, working in two phases. The prepro-
cessing phase of the algorithm is a generalization of the leader election algorithm
for rings from [9]. In the beginning all nodes are active. Each node v that is ac-
tive at the beginning of stage i ≥ 0 has the largest label in the neighborhood
N2i (v). In stage i, every active node sends its label at distance 2i+1 and it re-
mains active at the end of this stage, if it does not receive any larger label. We
devote a given amount of time τ to the preprocessing phase. The rest of the
algorithm is the information spreading phase, in which each node that is still
active constructs independently a BFS spanning tree of the network in time D.
Information exchange in each BFS tree is then initiated by its leaves and com-
pleted in additional time 2D. (Hence BFS trees constructed by active nodes are
used redundantly, but - as will be seen - the total cost can still be controlled.)
Upon completion of information spreading, each node has a labeled map of the
whole network.
We now analyze the cost of the above doubling algorithm.
Proposition 1. The cost of the doubling algorithm, executed in time 3D + τ on
a network with polynomially growing neighborhoods, of diameter D and size n,
is in O(n log τ + nDβ /τ β ), for some constant β > 1.
In particular, for τ ∈ Θ(D), i.e., when the total available time is (3 + η)D for
some constant η > 0, the total cost is O(n log D).
We close the paper with two open problems. The above tradeoffs are valid
for fairly large running times (above 3D). This means that the tradeoff curve
remains flat for a long period of time. It is thus natural to ask for tradeoffs
between cost and time for delays below D, i.e., for overall time below 2D. Can
such tradeoffs be established for some other classes of networks (such as bounded
degree networks or even just grids and tori), similarly as we did for rings?
Finally, notice that for rings the information spreading phase can be performed
in time 2D (instead of 3D) by letting each active node initiate two sequences
of messages (one clockwise, and the other counterclockwise), each containing
568 E.G. Fusco, A. Pelc, and R. Petreschi
labels of all already visited nodes. Moreover, the overall cost of the doubling
algorithm, executed in time 2D + τ on a ring of diameter D and size n, is
O(n log τ + nD/τ ) = O(D log τ + D2 /τ ). This should be compared to the cost
of Algorithm RingLearning, that can be as small as O(D1+ε log∗ D) for total
time 2D and any constant ε > 0. The cost of the doubling algorithm becomes
asymptotically smaller when the overall time is larger than 2D + D1−ε / log∗ D.
Closing the small gap between our bounds on the time vs. cost tradeoffs for
labeled map construction on rings is another open problem.
References
1. Attiya, H., Bar-Noy, A., Dolev, D., Koller, D., Peleg, D., Reischuk, R.: Renaming
in an asynchronous environment. Journal of the ACM 37, 524–548 (1990)
2. Awerbuch, B.: Optimal distributed algorithms for minimum weight spanning tree,
counting, leader election and related problems. In: Proc. 19th Annual ACM Sym-
posium on Theory of Computing (STOC 1987), pp. 230–240 (1987)
3. Chalopin, J., Das, S., Kosowski, A.: Constructing a map of an anonymous graph:
Applications of universal sequences. In: Proc. 14th International Conference on
Principles of Distributed Systems (OPODIS 2010), pp. 119–134 (2010)
4. Cole, R., Vishkin, U.: Deterministic coin tossing with applications to optimal par-
allel list ranking. Information and Control 70, 32–53 (1986)
5. Czumaj, A., Gasieniec, L., Pelc, A.: Time and cost trade-offs in gossiping. SIAM
Journal on Discrete Mathematics 11, 400–413 (1998)
6. Fredrickson, G.N., Lynch, N.A.: Electing a leader in a synchronous ring. Journal
of the ACM 34, 98–115 (1987)
7. Gasieniec, L., Pagourtzis, A., Potapov, I., Radzik, T.: Deterministic communication
in radio networks with large labels. Algorithmica 47, 97–117 (2007)
8. Goldberg, A.V., Plotkin, S.A., Shannon, G.E.: Parallel symmetry- breaking in
sparse graphs. SIAM Journal on Discrete Mathematics 1, 434–446 (1988)
9. Hirschberg, D.S., Sinclair, J.B.: Decentralized extrema-finding in circular configu-
rations of processes. Communications of the ACM 23, 627–628 (1980)
10. Israeli, A., Kranakis, E., Krizanc, D., Santoro, N.: Time-message trade-offs for the
weak unison problem. Nordic Journal of Computing 4, 317–341 (1997)
11. Lynch, N.L.: Distributed algorithms. Morgan Kaufmann Publ. Inc., San Francisco
(1996)
12. Peleg, D.: Distributed Computing, A Locality-Sensitive Approach, Philadelphia.
SIAM Monographs on Discrete Mathematics and Applications (2000)
13. Peterson, G.L.: An O(n log n) unidirectional distributed algorithm for the circular
extrema problem. ACM Transactions on Programming Languages and Systems 4,
758–762 (1982)
14. Yamashita, M., Kameda, T.: Computing on anonymous networks: Part I - charac-
terizing the solvable cases. IEEE Trans. Parallel and Distributed Systems 7, 69–89
(1996)
Competitive Auctions for Markets
with Positive Externalities
1 Introduction
In economics, the term externality is used to describe situations in which private
costs or benefits to the producers or purchasers of a good or service differ from
the total social costs or benefits entailed in its production and consumption. In
this context a benefit is called a positive externality, while a cost is referred to
as a negative one. One needs not to go far to find examples of positive external
influence in digital and communications markets, when a customer’s decision
to buy a good or purchase a service strongly relies on its popularity among
his/her friends or generally among other customers, e.g. instant messenger and
cell phone users will want a product that allows them to talk easily and cheaply
with their friends. Another good example is social network, where a user is
more likely to appreciate membership in a network if many of his/her friends
are already using it. There exist a number of applications, like the very popular
Farm Ville in online social network Facebook, where a user would have more fun
when participating with friends. In fact, quite a few such applications explicitly
reward players with a large number of friends.
On the other hand, negative external effects occur when a potential buyer,
e.g. a big company, incurs a great loss if a subject it fights for, like a small firm or
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 569–580, 2013.
c Springer-Verlag Berlin Heidelberg 2013
570 N. Gravin and P. Lu
2 Preliminaries
agents who will obtain the good and vector of prices to charge each of them.
The auctioneer is interested in maximizing his/her revenue.
For every i ∈ [n] we impose the following mild requirements on vi .
1. vi (S) ≥ 0.
2. vi (S) = 0 if i ∈
/ S.
3. vi (S) is a monotone sub-additive function of S, i.e.
(a) vi (S) ≤ vi (R) if S ⊆ R ⊆ [n].
(b) vi (S ∪ R) ≤ vi (S) + vi (R), for each i ∈ S, R ⊆ [n]
We should note here that the sub-additivity requirement is only for those subsets
that include the agent i. This is a natural assumption since vi (S) = 0 if i ∈
/ S.
all buyers in the winning set. We assume that the seller incurs no additional
cost for making a copy of the good. This assumption is essential for our model,
since unlike the classical digital auction case there is no simple reduction of the
settings with a positive price per issuing the item
to the settings with zero price.
The best revenue the seller can hope for is i∈[n] vi ([n]). However, it is not
realistic when the seller does not know agents’ valuation functions. We follow the
tradition of previous literature [11, 12, 16, 20] of algorithmic mechanism design
on competitive auctions with limited or unlimited supply and consider the best
revenue uniform price benchmark, which is defined as maximal revenue that
the auctioneer can get for a fixed uniform price for the good. In the literature
on classical competitive auctions this benchmark was called F and is formally
defined as follows.
Definition 3.
F (k) (b) = max c · |S||S| ≥ k, ∀i ∈ S bi (S) ≥ c .
c≥0,S⊂[n]
574 N. Gravin and P. Lu
However, in case of our model the benchmark F (2) does not imply the exis-
tence of a constant approximation truthful mechanism. In order to illustrate that
later in Section 4 we will introduce a couple of new models which differ from the
original one in certain additional restrictions on the domain of agent’s bids. We
further give a complete characterization of truthful mechanisms for these new
restricted settings substantially exploiting the fact that every agent’s bidding
language is single-parameter. Later, we use that characterization to argue that
no truthful mechanism can achieve constant approximation with respect to F (2)
benchmark even for these cases. On the positive side, and quite surprisingly, we
can furnish our work in the next section with the truthful mechanism which has
a constant approximation ratio w.r.t. F (3) benchmark for the general case of
multi-parameter bidding.
3 Competitive Mechanism
Promotion-Testing-Selling Mechanism
Bidders in A receive items for free and increase the demand of agents from B.
One may say that they “advertise” the goods and resemble the promotion that
occurs when selling to participants. The agents in C play the role of the “testing”
group, the only service of which is to determine the right price. Note that we
take no agents of the testing group into the winning set, therefore, they have
nothing to gain for bidding untruthfully. The agents of B appear to be the source
of the mechanism’s revenue, which is being extracted from B by a cost sharing
mechanism as follows.
We note here that a more “natural” mechanism is simply to set that r(C) =
rA (C) rather than max{rA (C), rB (C)}. But unfortunately, we have a counter
example to show that this simpler mechanism cannot guarantee a constant ap-
proximation ratio compared to our benchmark.
Competitive Auctions for Markets with Positive Externalities 575
1. S ← X.
2. Repeat until T = ∅:
– T ← {i|i ∈ S and bi (S ∪ Y ) < |S|
r
}.
– S ← S \ T.
3. If S = ∅ sell items to everyone in S at r
|S|
price.
Proof. The partitioning of the set [n] into A, B, C does not depend on the
agent bids. When the partition is fixed, our mechanism becomes deterministic.
Therefore, we are only left to prove the truthfulness for that deterministic part.
Let us do so by going through the proof separately for each set A, B and C.
Proof. We are left to prove the lower bound on the competitive ratio of our
mechanism, as we have shown the truthfulness in Lemma 4.
For the purpose of analysis, we separate the random part of our mechanism
into two phases. In the first phase, we divide agents randomly into three groups
S1 , S2 , S3 and in the second one, we label the groups at random by A, B and
C. Note that the combination of these two phases produces exactly the same
distribution over partitions as in the mechanism.
Let S be the set of winners in the optimal F (3) solution and the best fixed
price be p∗ . For 1 ≤ i = j ≤ 3 we may compute rij the largest revenue for a fixed
price that one can extract from set Si given Sj is “advertising” the good, that
576 N. Gravin and P. Lu
is agents in Sj get the good for free and thus increase the valuations of agents
from Si though contribute nothing directly to the revenue.
First, let us note that the cost-sharing part of our mechanism will extract one
of these rij from at least one of the six possible labels for every sample of the
dividing phase (in general cost-sharing mechanism may extract 0 revenue, e.g.
if the target revenue is set too high). Indeed, let i0 and j0 be the indexes for
which ri0 j0 achieves maximum over all rij and let k0 = {1, 2, 3} \ {i0 , j0 }. Then
the cost-sharing mechanism will retract the revenue r(C) = max(rA (C), rB (C))
on the labeling with Sj0 = A, Si0 = B and Sk0 = C. It turns out, as we will
prove in the following lemma, that one can get a lower bound on this revenue
within a constant factor of rF (C); the revenue we got from the agents of C in
the benchmark F (3) .
rF (C)
Lemma 6. r(C) ≥ 4 .
In order to conclude the proof of the theorem we are only left to estimate the
expected value of min{k1 , k2 , k3 } from below by some constant factor of |S|. The
next lemma will do this for us.
Lemma 7. Let m ≥ 3 items independently at random be put in one of the three
boxes and let a, b and c be the random variables denoting the number of items
in these boxes. Then E[min{a, b, c}] ≥ 27
2
m.
4.1 A Characterization
The basic question of mechanism design is to describe truthful mechanisms in
terms of simple geometric conditions. Given a vector of n bids, b = (b1 , . . . , bn ),
let b−i denote the vector, where bi is replaced with a ‘?’. It is well known that
truthfulness implies a monotonicity condition stating that if an agent i wins
for the bid vector b = (b−i , bi ) then she should win for any bid vector (b−i , bi )
with bi ≥ bi . In single-dimensional domains monotonicity turns out to be a suffi-
cient condition for truthfulness [6], where prices are determined by the threshold
functions.
In our model, valuation of an agent may vary for different winning sets and
thus may depend on his/her bid. Nevertheless, any truthful mechanism still has
to have a bid-independent allocation rule, although now it is not sufficient for the
truthfulness. However, in the case of linear valuation functions we are capable
of giving a complete characterization.
578 N. Gravin and P. Lu
bi · wi (A(b−i , bi )) + wi (A(b−i , bi )) − p ≥ bi · wi (A(b−i , bi )) + wi (A(b−i , bi )) − p.
Adding these two inequalities and using the fact that bi ≥ bi , we have
M . Each truthful mechanism M in D either sells items to both bidders for some
pair of bids (b1 , b2 ), or for all pairs of bids sells not more than one item. In
the first case, by our characterization of truthful mechanisms (see theorem 8),
M should also sell two items for the bids (x, b2 ) and (b1 , y), where x ≥ b1 and
y ≥ b2 . Therefore, M has to sell two items for any bid (x, y) with x ≥ b1 and
y ≥ b2 . Let us denote the first and the second group of mechanisms in D by G1
and G2 respectively.
For any small we may pick sufficiently large x0 , such that at least 1− fraction
of G1 mechanisms in D are selling two items for the bids (x = 2M x0 y0
, y = 2M ).
Note that
– revenue of F (2) for the bids (x0 , x0 ) is 2M x0 ,
– revenue of any M in G2 for the bids (x0 , x0 ) is not greater than x0 ,
– revenue of more than 1 − fraction of G1 mechanisms in D is not greater
x0
than 2M 2M = x0 .
– revenue of the remaining fraction of G1 mechanisms is not greater than
2M x0 .
Thus we can upper bound the revenue of MD by x0 (1 − ) + 2M x0 while the
revenue of F (2) is 2M x0 . By choosing sufficiently large M and small we get an
arbitrarily large approximation ratio.
Remark 10. In fact, the same inapproximability results w.r.t. F (2) holds for a
weaker notion of truthfulness, namely truthfulness in expectation.
References
1. Aggarwal, G., Feldman, J., Muthukrishnan, S.M., Pál, M.: Sponsored search auc-
tions with markovian users. In: Papadimitriou, C., Zhang, S. (eds.) WINE 2008.
LNCS, vol. 5385, pp. 621–628. Springer, Heidelberg (2008)
2. Akhlaghpour, H., Ghodsi, M., Haghpanah, N., Mahini, H., Mirrokni, V.S., Nikzad,
A.: Optimal Iterative Pricing over Social Networks. In: Proceedings of the Fifth
Workshop on Ad Auctions (2009)
3. Akhlaghpour, H., Ghodsi, M., Haghpanah, N., Mirrokni, V.S., Mahini, H., Nikzad,
A.: Optimal iterative pricing over social networks (Extended abstract). In: Saberi,
A. (ed.) WINE 2010. LNCS, vol. 6484, pp. 415–423. Springer, Heidelberg (2010)
4. Alaei, S., Malekian, A., Srinivasan, A.: On random sampling auctions for digital
goods. In: EC, pp. 187–196 (2009)
5. Anari, N., Ehsani, S., Ghodsi, M., Haghpanah, N., Immorlica, N., Mahini, H.,
Mirrokni, V.S.: Equilibrium pricing with positive externalities (Extended abstract).
In: Saberi, A. (ed.) WINE 2010. LNCS, vol. 6484, pp. 424–431. Springer, Heidelberg
(2010)
6. Archer, A., Tardos, É.: Truthful mechanisms for one-parameter agents. In: FOCS,
pp. 482–491 (2001)
7. Arthur, D., Motwani, R., Sharma, A., Xu, Y.: Pricing strategies for viral marketing
on Social Networks, pp. 101–112. Springer (2009)
8. Candogan, O., Bimpikis, K., Ozdaglar, A.: Optimal pricing in the presence of local
network effects. In: Saberi, A. (ed.) WINE 2010. LNCS, vol. 6484, pp. 118–132.
Springer, Heidelberg (2010)
580 N. Gravin and P. Lu
9. Chen, W., Lu, P., Sun, X., Tang, B., Wang, Y., Zhu, Z.A.: Optimal pricing in social
networks with incomplete information. In: Chen, N., Elkind, E., Koutsoupias, E.
(eds.) WINE 2011. LNCS, vol. 7090, pp. 49–60. Springer, Heidelberg (2011)
10. Domingos, P., Richardson, M.: Mining the network value of customers. In: ACM
SIGKDD, pp. 57–66. ACM Press, New York (2001)
11. Feige, U., Flaxman, A.D., Hartline, J.D., Kleinberg, R.D.: On the competitive ratio
of the random sampling auction. In: Deng, X., Ye, Y. (eds.) WINE 2005. LNCS,
vol. 3828, pp. 878–886. Springer, Heidelberg (2005)
12. Fiat, A., Goldberg, A.V., Hartline, J.D., Karlin, A.R.: Competitive generalized
auctions. In: STOC, pp. 72–81 (2002)
13. Ghosh, A., Mahdian, M.: Externalities in online advertising. In: WWW,
pp. 161–168. ACM (2008)
14. Ghosh, A., Sayedi, A.: Expressive auctions for externalities in online advertising.
In: WWW, pp. 371–380. ACM (2010)
15. Giotis, I., Karlin, A.R.: On the equilibria and efficiency of the GSP mechanism in
keyword auctions with externalities. In: Papadimitriou, C., Zhang, S. (eds.) WINE
2008. LNCS, vol. 5385, pp. 629–638. Springer, Heidelberg (2008)
16. Goldberg, A.V., Hartline, J.D., Karlin, A.R., Saks, M., Wright, A.: Competitive
auctions. Games and Economic Behavior 55(2), 242–269 (2006)
17. Gomes, R., Immorlica, N., Markakis, E.: Externalities in keyword auctions: An
empirical and theoretical assessment. In: Leonardi, S. (ed.) WINE 2009. LNCS,
vol. 5929, pp. 172–183. Springer, Heidelberg (2009)
18. Haghpanah, N., Immorlica, N., Mirrokni, V.S., Munagala, K.: Optimal auctions
with positive network externalities. In: EC, pp. 11–20 (2011)
19. Hartline, J., Mirrokni, V., Sundararajan, M.: Optimal marketing strategies over
social networks. In: WWW, pp. 189–198. ACM (2008)
20. Hartline, J.D., McGrew, R.: From optimal limited to unlimited supply auctions.
In: EC, pp. 175–182. ACM (2005)
21. Jehiel, P., Moldovanu, B., Stacchetti, E.: How (not) to sell nuclear weapons. Amer-
ican Economic Review 86(4), 814–829 (1996)
22. Kempe, D., Kleinberg, J.M., Tardos, É.: Influential nodes in a diffusion model
for social networks. In: Caires, L., Italiano, G.F., Monteiro, L., Palamidessi, C.,
Yung, M. (eds.) ICALP 2005. LNCS, vol. 3580, pp. 1127–1138. Springer, Heidelberg
(2005)
23. Kempe, D., Mahdian, M.: A cascade model for externalities in sponsored search.
In: Papadimitriou, C., Zhang, S. (eds.) WINE 2008. LNCS, vol. 5385, pp. 585–596.
Springer, Heidelberg (2008)
24. Kleinberg, J.: Cascading behavior in networks: algorithmic and economic issues.
Cambridge University Press (2007)
25. Nisan, N., Roughgarden, T., Tardos, É., Vazirani, V.V.: Algorithmic game theory.
Cambridge University Press (2007)
26. Sääskilahti, P.: Monopoly pricing of social goods, vol. 3526. University Library of
Munich, Germany (2007)
Efficient Computation of Balanced Structures
Supported in part by NSF Award CNS-1010789.
Supported in part by Nanyang Technological University grant M58110000, Singa-
pore Ministry of Education (MOE) Academic Research Fund (AcRF) Tier 2 grant
MOE2010-T2-2-082, and MOE AcRF Tier 1 grant MOE2012-T1-001-094, and by
a grant from the United States-Israel Binational Science Foundation (BSF).
Supported in part by Nanyang Technological University grant M58110000 and
Singapore Ministry of Education (MOE) Academic Research Fund (AcRF) Tier 2
grant MOE2010-T2-2-082.
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 581–593, 2013.
c Springer-Verlag Berlin Heidelberg 2013
582 D.G. Harris et al.
1 Introduction
Fundamental graph-theoretic structures such as maximal independent set (MIS)
and minimal dominating set (MDS) and their efficient distributed computa-
tion are very important, especially in the context of distributed computing and
networks where they have many applications [8]. MIS, for example, is a basic
building block in distributed computing and is useful in basic tasks such as mon-
itoring, scheduling, routing, clustering, etc. (e.g., [7,9]). Extensive research has
gone into designing fast distributed algorithms for these problems since the early
eighties (e.g., see [5,10] and the references therein) . We now know that problems
such as MIS are quite local, i.e., they admit distributed algorithms that run in a
small number of rounds (typically logarithmic in the network size). However, one
main drawback of these algorithms is that there is no guarantee on the quality
of the structure output. For example, the classical MIS algorithm of Luby [6]
computes an MIS in O(log n) rounds (throughout, n stands for number of nodes
in the network) with high probability, but does not give any guarantees on the
properties of the output MIS. (Another O(log n) round parallel algorithm was
independently found by Alon, Babai, and Itai [1].) In this paper, we initiate a
systematic study of “balanced” versions of these structures, i.e., the average de-
gree of the nodes belonging to the structure (the degrees of nodes in the structure
are with respect to the original subgraph, and not with respect to the subgraph
induced by the structure) is small, in particular, compared to the average degree
of the graph (note that, in general, the best possible balance we can achieve is
the average degree of the graph, as in a regular graph). For example, as we de-
fine later, a balanced MIS (BMIS) is an MIS where the average degree of nodes
belonging to the MIS is small.
We note that the maximum independent set (which is a well-studied NP-complete
problem [2]) in a graph G is not necessarily a BMIS in G. Consider the graph G
that contains a complete graph Kp (assume p is even), and a complete bipartite
graph KA,B with |A| = 2 and |B| = 3. Each vertex in A is connected to a different
half of the set of vertices in Kp (i.e., one vertex of A is connected to one half of
vertices of Kp and the second vertex of A is connected to the other half of Kp ),
and each vertex in B is connected to all vertices in Kp . Clearly, B is the maximum
independent set in G and has average degree p + 2, while A is a BMIS in G since
its average degree is p/2 + 3. Thus BMIS is a different problem compared to the
maximum independent set problem (which is not the focus of this paper).
There are two key motivations for studying balanced structures. The first is
from an application viewpoint. In distributed networks, especially in resource-
constrained networks such as ad hoc networks, sensor and mobile networks,
it is important to design structures that favor load balancing of tasks among
nodes (belonging to the structure). This is crucial in extending the lifetime of
the network (see e.g., [11] and the references therein). For example, in a typical
application, an MIS (or an MDS) can be used to form clusters with low diameter,
with the nodes in the MIS being the “clusterheads” [7]. Each clusterhead is
responsible for monitoring the nodes that are adjacent to it. Having an MIS with
low degree is useful in a resource/energy-constrained setting since the number
Efficient Computation of Balanced Structures 583
of nodes monitored per node in the MIS will be low (on average). This can lead
to better load balancing, and consequently less resource or energy consumption
per node, which is crucial for ad hoc and sensor networks, and help in extending
the lifetime of such networks while also leading to better fault-tolerance. For
example, in an n-node star graph, the above requirements imply that it is better
for the leaf nodes to form the MIS rather than the central node alone. In fact,
the average degree of the MIS formed by the leaf nodes (which is 1) is within a
constant factor of the average degree of a star (which is close to 2), whereas the
average degree of the MIS consisting of the central node alone (which is n − 1)
is much larger.
Another potential application of balanced structures is in the context of dy-
namic networks where one would like to maintain structures such as MIS effi-
ciently even when nodes or links (edges) fail or change with time. For example,
this is a feature of ad hoc and mobile networks where links keep changing either
due to mobility or failures. BMIS can be a good candidate for maintaining an
MIS efficiently in an incremental fashion: since the degrees of nodes in the MIS
are balanced, this will lead to less overhead per insertion or deletion.
The second key motivation of our work is understanding the complexity of
local computation of globally optimal (or near optimal) fundamental structures.
The correctness of structures such as MIS or MDS can be verified strictly locally
by a distributed algorithm. In the case of MIS, for example, each node can check
the MIS property by communicating only with its neighbors; if there is a violation
at least one node will raise an alarm. On the other hand, it is not difficult to
show that the correctness of balanced structures such as BMIS cannot be locally
verified (in the above sense) as the BMIS refers to a “global” property: nodes
have to check the average degree property, in addition to the MIS property.
In fact, one can show that at least D rounds (D being the network diameter)
would be needed to check whether a structure is a BMIS. Moreover, we prove
that BMIS is an NP-hard problem and hence the optimality of the structure is
not easy to check even in a centralized setting. A key issue that we address in
this paper is whether one can compute near-optimal local (distributed) solutions
to balanced global structures such as BMIS. A main result of this paper is that
despite the global nature, we can design efficient distributed algorithms that
output high quality balanced structures.
Our work is also a step towards understanding the algorithmic complexity of
balanced problems. While every MIS is an MDS, they differ significantly in their
balanced versions. In particular, we show that there exist graphs for which no
MIS is a good BMDS. Hence we need a different approach to compute a good
BMDS as compared to a good BMIS. Even for BMIS, we show that while one can
(for example) use Luby’s algorithm [6] to efficiently compute an MIS, the same
approach fails to compute a good quality BMIS. We present new algorithms for
computing such balanced structures.
To show the above theorem (the full proof is in [4]) we show that Luby’s MIS
algorithm[6] returns an MIS with average degree at most δ 2 /8 + O(δ), albeit
with inverse polynomially small probability. This can be easily turned into a
centralized algorithm by repeating this algorithm a polynomial number of times
till the desired bound is obtained. (However, this does not give a fast distributed
algorithm.) The above algorithm is nearly optimal with respect to the average
degree of the MIS, as we show an almost matching lower bound (this also answers
the question (i) posed above in the negative):
Theorem 2. For any real number α > 1, there is a graph G with average degree
α, but in which every MIS has average degree α2 /8 + 3α/4 + 5/8.
We next consider distributed approximation algorithms for BMIS and show that
we can output near-optimal solutions fast, i.e., solutions that are close to the
lower bound. We consider the following standard model for our distributed algo-
rithms where the given graph G represents a system of n nodes (each node has
a distinct ID). Each node runs an instance of the distributed algorithm and the
computation advances in synchronous rounds, where, in each round, nodes can
communicate with their neighbors in G by sending messages of size O(log n). A
node initially has only local knowledge limited to itself and its neighbors (it may
however know n, the network size). We assume that local computation (per-
formed by the node itself) is free as long it is polynomial in the network size.
Each node u has local access to a special bit (initially 0) that indicates whether
u is part of the output set. Our focus is on the time complexity, i.e., the number
of rounds of the distributed computation.
We present two distributed algorithms for BMIS (cf. Section 2.1), the second
algorithm gives a better bound on the average degree at the cost of (somewhat)
increased run time. However, both algorithms are fast, i.e., run in polylogarith-
mic rounds.
Note that in general, due to the lower bound (cf. Theorem 2), the bounds pro-
vided by algorithms of the above theorem are optimal up to constant factors
We next present results on BMDS. Since an MIS is also an MDS, an algorithm
for MIS can also be used to output an MDS. However, this can lead to a bad
approximation guarantee, since there are graphs for which every MIS has a bad
average degree compared to some MDS. This follows from the graph family used
in the proof of Theorem 2: while the average degree of every MIS (of any graph
in the family) is Ω(δ 2 ), there exists an MDS with average degree only O(δ).
Because an MIS is also an MDS, the results of Theorem 3 also hold for BMDS.
Our next theorem shows that much better guarantees are possible for BMDS.
586 D.G. Harris et al.
The next theorem shows that the bound of Theorem 4 is optimal (in general),
up to constant factors:
Theorem 5. For any real number α > 0, there are graphs with average degree
α, but for which any MDS has an average degree of Ω( log
α log α
log α ).
Finally, we show the following result for the BMVC problem which shows that
there cannot be any bounded approximation algorithm for the problem:
Theorem 6. For any real number α > 2, there are graphs for which the average
degree is at most α, but for which the average degree of any MVC approaches to
infinity.
This section is devoted for designing different distributed algorithms for BMIS.2
In particular we will prove Theorem 3 (Parts 1, and 2). The proposed algorithms
do not require any global information of the original graph other than n.
will only affect the running time by a constant factor. This is the strongest form
in which an algorithm can be said to succeed with high probability.
The algorithm
has three
phases, which are √ intended to address √ the cases where
δ O( n/ log n), Θ( n/ log n) δ Θ( n), and δ Ω( n) respectively.
first phase runs Luby’s algorithm for MIS on the vertices with degree
The
n/ log n. The next phase gradually extends the resulting independent set by
finding MIS’s of the subgraphs consisting of successively larger degrees. Finally,
using Luby’s algorithm, this is extended to an MIS of G itself. It is easy to see that
this leads to an MIS of G, and the resulting algorithm runs in O(log n×log log n)
rounds. We will also show that if we run only Phases I and III of this algorithm,
then we can obtain an MIS of degree O(δ 2 log δ) in time O(log n).
We introduce the following definition which will be used throughout the proof.
For any real number s, we let Gs denote the subgraph of G induced on the vertices
of degree s. This notation is used in describing Algorithm 1.
The following basic principle will be used in a variety of places in this proof:
Proposition 1. Suppose a graph G has n vertices and average degree δ. Suppose
s > 1. Then the subgraph Gsδ contains at least n(1 − 1/s) vertices.
We now show that this algorithm√ has good behavior in the first two parameter
regimes. The third regime δ = Ω( n) is trivial.
Lemma 1 (First Phase). Suppose δ φ2 n/ log n. Then with probability 1 −
n−Ω(1/φ) , the independent set produced at the end of the first phase, contains
Ω(n/δ) vertices. In particular, the final MIS produced has average degree O(δ 2 ).
Proof. Let n , δ denote the number of vertices and average degree of the graph
Gφ√n/ log n . Note δ δ. By Proposition 1 we have n n/2.
For each vertex v ∈ Gφ√n/ log n let Xv be the random variable indicating
that v was marked, and Xv the random variable indicating that v was accepted
588 D.G. Harris et al.
probability 1 − n−Ω(1/φ) , the independent set produced at the end of the sec-
ond phase, contains Ω(n/δ) vertices. In particular, the final MIS produced has
average degree O(δ 2 ).
Proof. Let n , δ represent the number of vertices and average degree of G√n .
By Proposition
1 we must have n = Ω(n) and δ δ.
If δ 2 n/ log n, then by Proposition 1 there would be Ω(n) vertices of
φ
G with degree φ2 n/ log n. By Lemma 1, phase 1 would then produce an
independent set with Ω(n/ n/ log n) = Ω(n/δ 2 ) vertices.
So suppose δ φ2 n/ log n. Now, as i increases, xi is multiplied by a factor
√
of 2 as it increases from φ n/ log n to n. In particular, there is some value of i
which has 2δ xi 4δ . At this point, the standard analysis shows that φ log n
iterations of Luby’s algorithm produces, with probability 1 − n−Ω(1/φ) , an MIS
of the graph Gxi . By Proposition 1, Gxi contains Ω(n ) vertices. Furthermore,
any MIS of G must contain Ω(n /δ ) vertices; the reason for this is that the
maximum degree of any vertex in Gxi is O(δ ), and it is necessary to select
Ω(n /δ ) simply to ensure that every vertex is covered by the MIS.
Now, at stage i we produce an MIS of Gxi which contains Ω(n/δ) vertices.
This is eventually extended to an MIS of G with Ω(n/δ) vertices. &
%
Proof of Part 2 of Theorem 3. The greedy algorithm for BMIS is very simple.
We label the vertices in order of increasing degree (breaking ties arbitrarily).
Each vertex is added to the IS (Initially, IS=∅), unless it was adjacent to a
earlier vertex already selected. This is a simple deterministic algorithm which
requires time O(m).
Efficient Computation of Balanced Structures 589
δ2
Theorem 7. The greedy algorithm produces an MIS of degree at most 4 + δ.
Proof. Order the vertices in order of increasing degree d1 d2 . . . dn .
Define the indicator variable xv to be 1 if v ∈ I and 0 otherwise, where I is the
MIS produced. For any pair of vertices u and v with du dv , we also define the
indicator yvu to be 1 if v ∈ I and there is an edge from v to u. (It may seem
strange to include the variable yvv , as we always have yvv = 0 in the intended
solution, but this will be crucial in our proof, which is based on LP relaxation.)
As the greedy algorithm selects v iff no earlier vertex was adjacent to it, we
have xv = 1 if and only if y1v = y2v = · · · = yv−1,v = 0. In particular, xv
satisfies the linear constraint xv 1 − y1v − y2v − · · · − yvv . The variables x, y
also clearly satisfy the linear constraints ∀v : 0 xv 1, ∀v u : 0 yvu , and
∀v : vu dv xv . which
u y we refer to as the core constraints. The final MIS
contains xv verticesand v d v xv edges, and hence the average degree of the
resulting MIS is δI = v dv xv / v xv .
d x
We wish to find an upper bound on the ratio R = v vxv v . The variables x, y
v
satisfy many other linear and non-linear constraints, and in particular are forced
to be integral. However, we will show that the core constraints are sufficient to
bound R. The way we will prove this is to explicitly construct a solution x, y
which satisfies the core constraints and maximizes R subject to them, and then
2
show that the resulting x, y still satisfies R δ4 + δ.
Let x, y be real vectors which maximizes R among all real vectors satisfying
the core constraints, and among all such vectors, which minimize u>v yvu .
Suppose yvu > 0 for some u > v. If xu = 1, then we simply decrement yvu by .
The constraint xu 1 − y1u − · · · − yuu clearly remains satisfied as xu = 1, and
all other constraints are unaffected. The objective function is also unchanged.
However, this reduces u>v yvu , contradicting maximality of x, y.
Suppose yvu > 0 for some u > v, and xu < 1 strictly. Note that yvu dv xv ,
so we must have xv > 0 strictly. For some sufficiently small , we change x, y
as follows: yvu = yvu − , yvv = yvv + dv+1 , xv = xv − dv+1 , xu = xu + du+1 ,
and yuu = yuu + dd u
u +1
. All other values remain unchanged. We claim that the
constraints on x, y are still preserved. Furthermore, the numerator of R increases
the denominator decreases; hence R R. This contradicts the maximality of
x, y.
In summary, we can assume yvu = 0 for all u > v. In this case, the core
constraints on v become simply 1 − yvv xv 1 and yvv dv xv . It is a
simple exercise to maximize R subject to these constraints (every vertex operates
completely independently), and the maximum is achieved when xv = dv1+1 for
dv t, and xv = 1 for dv > t. In this case, the objective function R(x) satisfies
dv
dv +1 + dv
R dv t 1
dv >t Let δS , δB denote the average degrees of the vertices
dv t dv +1 + dv >t 1
of degree t, > t respectively, and let nS , nB represent the number of such
vertices. Then by concavity, we have
nS δSδS+1 + nB δB δ(δB − δS ) + δB δS (δ − δS )
R
nS
δS +1 + nB δS (δ − δS ) + (δB − δS )
590 D.G. Harris et al.
1: Mark each vertex of degree > 2δ independently with prob. logt t where
2δ log δ
t = log log δ
.
2: Mark every vertex of degree 2δ.
3: If any vertex v is not marked, and none of the neighbors of v are marked,
then mark v.
4: Let M denote the set of marked vertices at this point. M forms a dominating
set of G, but is not necessarily minimal. Using any algorithm, select a minimal
dominating set M ⊆ M .
5: Check if δM t. If so, return M . Otherwise, return FAIL.
This greedy algorithm can be converted, with only a little loss, to a distributed
algorithm as shown in Algorithm 2. This algorithm is basically the sequential
greedy algorithm, except we are quantizing the degrees to multiples of some
parameter φ. Allowing φ → 1 sufficiently slowly, we obtain an algorithm which
requries log2+o(1) n rounds and returns an MIS of degree (1 + o(1))(δ 2 /4 + δ)
w.h.p. As we have seen in Theorem 2, this is within a factor of 2 of the lowest
degree possible.
For arbitrary graphs, we turn our attention to designing algorithms for finding
approximate solutions to BMDS. Since any MIS in a given graph G is also an
MDS in G, all algorithms designed for BMIS also return an BMDS in G of the
same average degree. Thus, we have the same bounds (and distributed algo-
rithms) corresponding to those in Section 2.However, for BMDS, better bounds
are possible. Given a graph with average degree δ, we will show a polynomial-time
δ log δ
algorithm that finds an MDS of average degree O( log log δ ). We will also construct
δ log δ
a family of graphs G for which every MDS has average degree Ω( log log δ ).
Proof of Theorem
4. For a target degree t, and any set of vertices V0 , we
define StV0 = v∈V0 (dv − t). Our goal is to find an MDS X with StX 0, for
some t = O(δ log δ/ log log δ).
Let x = 2δ and divide the vertices into three classes: A, the set of vertices of
degree x; B, the set of vertices of degree > x, which have at least one neighbor
in A; and C, the set of vertices of degree > x, all of whose neighbors are in B
or C. Mark each vertex in B ∪ C with probability p = logt t . Next, form the set
Y ⊆ B ∪ C, by inserting all marked vertices in B ∪ C and vertices in C with no
marked neighbors. Clearly Y dominates C, and A ∪ Y dominates G. Now, select
two subsets A ⊆ A and Y ⊆ Y such that X = A ∪ Y is an MDS of G.
Efficient Computation of Balanced Structures 591
We first examine StY . Any vertex of G with degree t contributes at most
0 to StY . Otherwise, suppose v has degree t. If v ∈ B, it is selected for
Y with probability at most logt t . If v ∈ C, all its neighbors are marked with
probability logt t , so it is selected for Y with probability at most logt t +(1− logt t )t
2 logt t . Hence the expected contribution of such vertex to StY is at most 2dv logt t .
Summing over all such vertices, we have E[StY ] 2|B ∪ C|δB∪C logt t , where
δB∪C denote the average degree of vertices in B ∪ C.
Now, some of the vertices in A are dominated by B-vertices of Y . Let A0 be
the set of vertices not dominated by Y . These vertices can only be dominated
by vertices of A , so we must have |A |(δA + 1) |A0 |. Subject to the conditions
|A |(δA + 1) |A0 | and δA x, we have StA |A0x+1 |(x−t)
. The ultimate MDS
may contain vertices in A − A0 as well; however, as x t, these will have a
negative contribution to St , and hence they will only help up in showing an
upper bound on St .
Consider the expected value of E[|A0 |]. A vertex v ∈ A lies in A0 if none of its
neighbors are marked (this is not a necessary condition), and vertices are marked
independently with probability p. Hence E[|A0 |] v∈A (1−p)dv |A|(1−p)δA .
Putting all this together, we have that the final MDS X = A ∪ Y satisfies
E[StX ] 2p|B ∪ C|δB∪C + |A| x+1 x−t
(1 − p)δA . For δ sufficiently large, p approaches
zero, so that that (1 − p)δA e−2pδA .
We know that |A| + |B| + |C| = n, and |A|δA + (|B| + |C|)δB∪C nδ.
Eliminating |A|, |B|, |C| we have
Routine calculus shows that, for t sufficiently large, this achieves its maximum
t−2δ
t log( 4δ+2 )
value at δB∪C → ∞, δA = log t , yielding
2δ log t t − 2δ
E[StX ] − 2 log − 2.
t 4δ + 2
4 Conclusion
We initiate the study (graph-theoretic, algorithmic, and distributed) of the bal-
anced versions of some fundamental graph-theoretic structures. As discussed
in Section 1, the study of balanced structures can be useful in providing fault-
tolerant, load-balanced MISs and MDSs. We develop reasonably-close upper and
lower bounds for many of these problems. Furthermore, for the BMIS problem,
we are able to develop fast (local) distributed algorithms that achieves an ap-
proximation close to the best possible in general. A main open problem that is
left open is whether one can do the same for the BMDS problem. We view our
results also as a step in understanding the complexity of local computation of
these structures whose optimality itself cannot be verified locally.
References
1. Alon, N., Babai, L., Itai, A.: A fast and simple randomized parallel algorithm for
the maximal independent set problem. J. Algorithms 7(4), 567–583 (1986)
2. Garey, M.R., Johnson, D.S.: Computers and Intractability: A Guide to the Theory
of NP-Completeness. W. H. Freeman (1979)
3. Gavinsky, D., Lovett, S., Saks, M., Srinivasan, S.: A tail bound for read-k families
of functions. arXiv preprint arXiv:1205.1478 (2012)
4. Harris, D.G., Morsy, E., Pandurangan, G., Robinson, P., Srinivasan, A.: Efficient
Computation of Balanced Structures, http://static.monoid.at/balanced.pdf
5. Kuhn, F., Moscibroda, T., Wattenhofer, R.: Local computation: Lower and upper
bounds. CoRR, abs/1011.5470 (2010)
6. Luby, M.: A simple parallel algorithm for the maximal independent set problem.
SIAM J. Comput. 15(4), 1036–1053 (1986)
7. Moscibroda, T.: Clustering. In: Algorithms for Sensor and Ad Hoc Networks, pp.
37–60 (2007)
8. Peleg, D.: Distributed Computing: A Locality-Sensitive Approach. SIAM (2000)
9. Rajaraman, R.: Topology control and routing in ad hoc networks: a survey.
SIGACT News 33(2), 60–73 (2002)
10. Suomela, J.: Survey of local algorithms. ACM Comput. Surv. 45(2) (2013)
11. Zhang, H., Shen, H.: Balancing energy consumption to maximize network lifetime
in data-gathering sensor networks. IEEE TPDS 20(10), 1526–1539 (2009)
A Refined Complexity Analysis
of Degree Anonymization in Graphs
1 Introduction
For many scientific disciplines, including the understanding of the spread of dis-
eases in a globalized world or power consumption habits with impact on fighting
global warming, the availability of (anonymized) social network data becomes
more and more important. In a landmark paper, Liu and Terzi [16] introduced
the following simple graph-theoretic model for identity anonymization on (social)
networks. Herein, they transferred the k-anonymity concept known for tabular
data in databases [9] to graphs.
Liu and Terzi [16] assume in this model that an adversary (who wants to de-
anonymize the network) knows only the degree of the vertex of a target individual;
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 594–606, 2013.
c Springer-Verlag Berlin Heidelberg 2013
A Refined Complexity Analysis of Degree Anonymization in Graphs 595
this is a modest adversarial model. Clearly, there are stronger adversarial mod-
els which (in many cases very realistically) assume that the adversary has more
knowledge, making it possible to breach privacy provided by a “k-anonymized
graph” [20]. Moreover, it has been argued that graph anonymization has funda-
mental theoretical barriers which prevent a fully effective solution [1]. Degree
Anonymity, however, provides the perhaps most basic and still practically rele-
vant model for graph anonymization; it is the subject of active research [4, 5, 18].
Graph anonymization problems are typically NP-hard. Thus, almost all
algorithms proposed in this field are heuristic in nature, this also being true
for algorithms for Degree Anonymity [16, 18]. Indeed, as the field of graph
anonymization is young and under strong development, there is very little re-
search on its theoretical foundations, particularly concerning computational com-
plexity and algorithms with provable performance guarantees [6].
Our Contributions. Our central result is to show that Degree Anonymity has
a polynomial-size problem kernel when parameterized by the maximum vertex
degree Δ of the input graph. In other words, we prove that there is a polynomial-
time algorithm that transforms any input instance of Degree Anonymity into
an equivalent instance with at most O(Δ7 ) vertices. Indeed, we encounter a “win-
win” situation when proving this result: We show that Liu and Terzi’s heuristic
strategy [16] finds an optimal solution when the size s of a minimum solution
is larger than 2Δ4 . As a consequence, we can bound s in O(Δ4 ) and, hence, a
polynomial kernel we provide for the combined parameter (Δ, s) is also a poly-
nomial kernel only for Δ. Furthermore, our kernelization has the useful property
(e. g. for approximations) that each solution derived for the kernel instance one-
to-one corresponds to a solution of the original instance. While this kernelization
directly implies fixed-parameter tractability for Degree Anonymity parame-
terized by Δ, we also develop a further improved fixed-parameter algorithm.
In addition, we prove that the polynomial kernel for Δ is tight in the sense that
even for constant values of the “stronger” parameter (that is, provably smaller)
H-index1 , Degree Anonymity becomes NP-hard. The same proof also yields
NP-hardness in 3-colorable graphs. Further, from a parameterized perspective,
we show that Degree Anonymity is W[1]-hard when parameterized by the
solution size s (the number of added edges), even when k = 2. In other words,
there is no hope for tractability even when the level k of anonymity is low and
the graph needs only few edge additions (meaning little perturbation) to achieve
k-anonymity.
Why is the parameter “maximum vertex degree Δ” of specific interest? First,
note that from a parameterized complexity perspective it seems to be a “tight”
parameterization in the sense that for the only little “stronger” parameter H-
index our results already show NP-hardness for H-index three (also implying
hardness e.g. for the parameters degeneracy and average degree). Social networks
typically have few vertices with high degree and many vertices of small degree.
1
The H-index of a graph G is the maximum integer h such that G has at least h
vertices with degree at least h. Thus G has at most h vertices of degree larger
than h.
596 S. Hartung et al.
Leskovec and Horvitz [15] studied a huge instant-messaging network (180 million
nodes) with maximum degree bounded by 600. For the DBLP co-author graph
generated in February 2012 with more than 715,000 vertices we measured a
maximum degree of 804 and an H-index of 208, so there are not more than 208
vertices with degree larger than 208. Thus, a plausible strategy might be to only
anonymize vertices of “small” degree and to remove high-degree vertices for the
anonymization process because it might be overly expensive to anonymize these
high-degree vertices and since they might be well-known (that is, not anonymous)
anyway. Indeed, high-degree vertices can be interpreted as outliers [2], potentially
making their removal plausible.
Related Work. The most important reference is Liu and Terzi’s work [16] where
the basic model was introduced, sophisticated (heuristic) algorithms (also using
algorithms to determine the realizability of degree sequences) have been devel-
oped and validated on experimental data. Somewhat more general models have
been considered by Zhou and Pei [25] (studying the neighborhood of vertices
instead of only the degree) and by Chester et al. [5] (anonymizing a subset of
the vertices of the input). Chester et al. [4] investigate the variant of adding
vertices instead of edges. Building on Liu and Terzi’s work, Lu et al. [18] pro-
pose a “more efficient and more effective” algorithm for Degree Anonymity.
Again, this algorithm is heuristic in nature. Today, the field of graph anonymiza-
tion has grown tremendously with numerous surveys and research directions. We
only mention some directly related work.
There are many other, often more complicated models for graph anonymiza-
tion. Weaknesses Degree Anonymity (mainly depending on the assumed ad-
versary model where for many practical situations the adversary may e.g. have
an auxiliary network that helps in de-anonymizing) of and other models have
been pointed out [1, 20, 24]. In conclusion, given the generality of background
knowledge an adversary may or may not have, graph anonymization remains a
chimerical target [18] and, thus, a universally best model is not available.
Finally, from a (parameterized) computational complexity perspective, the
closest work we are aware of is due to Mathieson and Szeider [19] who provide
a study on editing graphs to satisfy degree constraints. In their basic model,
each vertex is equipped with a degree list and the task is to edit the graph such
that each vertex achieves a degree contained in its degree list. They study the
editing operations edge addition, edge deletion, and vertex deletion and provide
numerous parameterized tractability and intractability results. Interestingly, on
the technical side they also rely on the computation of general factors in graphs
(as we do) and they also study kernelization, where they leave as most challenging
open problem to extend their kernelization results to cases that include vertex
deletion and edge addition, emphasizing that the presence of edge additions
makes their approach inapplicable.
Due to the lack of space, many technical details are deferred to a full version
of the paper.
A Refined Complexity Analysis of Degree Anonymization in Graphs 597
2 Preliminaries
Parameterized complexity. The concept of parameterized complexity was pio-
neered by Downey and Fellows [7] (see also [8, 21] for more recent textbooks). A
parameterized problem is called fixed-parameter tractable if there is an algorithm
that decides any instance (I, k), consisting of the “classical” instance I and a
parameter k ∈ N0 , in f (k) · |I|O(1) time, for some computable function f solely
depending on k. A core tool in the development of fixed-parameter algorithms
is polynomial-time kernelization [3, 12]. Here, the goal is to transform a given
problem instance (I, k) in polynomial time into an equivalent instance (I , k ),
the so-called kernel, such that k ≤ g(k) and |I | ≤ g(k) for some function g. If g
is a polynomial, then it is called a polynomial kernel. A parameterized problem
that is classified as W[1]-hard (using so-called parameterized reductions) is un-
likely to admit a fixed-parameter algorithm. There is good complexity-theoretic
reason to believe that W[1]-hard problems are not fixed-parameter tractable.
3 Hardness Results
In this section we provide two polynomial-time many-to-one reductions yielding
three (parameterized) hardness results.
Proof (Sketch). We give a reduction from the NP-hard Independent Set prob-
lem, where given a graph G = (V, E) and a positive integer h, the question is
whether there is a size-h independent set, that is, a vertex subset of pairwise
nonadjacent vertices. We assume without loss of generality that in the given
Independent Set instance (G, h) it holds that |V | ≥ 2h + 1. We construct an
598 S. Hartung et al.
In this main section we provide a polynomial kernel with respect to the param-
eter maximum degree Δ (Theorem 4). Our proof has two main ingredients: first
we show in Section 4.2 a polynomial kernel with respect to the combined pa-
rameter (Δ, s); second we show in Section 4.3 that a slightly modified variant of
Liu and Terzi’s heuristic [16] exactly solves any instance having a minimum-size
k-insertion set of size at least (Δ2 + 4Δ + 3)2 . Hence, either we can solve a
given instance in polynomial time or we can upper-bound s by (Δ2 + 4Δ + 3)2 ,
implying that the kernel polynomial in (Δ, s) is indeed polynomial only in Δ.
We begin by presenting the main technical tool used in our work, the so-called
f -Factor problem.
Lemma 1 ([14]). Let G = (V, E) be a graph with minimum vertex degree δ and
let a ≤ b be two positive integers. Suppose further that
b a+b
δ≥ |V | and |V | > (b + a − 3).
a+b a
Then, for any function f : V → {a, a + 1, ..., b} where v∈V f (v) is even, G has
an f -factor.
We now explain the kernelization algorithm in detail (see Algorithm 1 for the
pseudocode). Let (G, s, k) be an instance of Degree Anonymity. For brevity
we set β = (Δ + 4)s + 1. We compute in polynomial time an equivalent in-
stance (G , s, k ) with at most O(Δ3 s) vertices: First set k = min{k, β} (Line 4).
We arbitrarily select from each block DG (i) a certain number x of vertices and
collect all these vertices into the set A (Line 14). To cope with the above men-
tioned second problem, the “certain number” is defined in a case distinction on
the value of k (see Lines 5 to 14). Intuitively, if k is large then we distinguish be-
tween “small” blocks of size at most 2s and “large” blocks of size at least k − 2s.
Obviously, if there is a block which is neither small nor large, then the instance
is a no-instance (see Line 7). Thus, in the problem kernel we keep for small
blocks the “distance to size zero” and for large blocks the “distance to size k”.
Furthermore, in order to separate between small and large blocks it is sufficient
that k > 4s. However, to guarantee that Observation 1 is applicable, the case
distinction is a little bit more complicated, see Lines 5 to 14.
We start building G by first copying G[A] into it (Line 15). Next, adding
a pendant vertex to v means that we add a new vertex to G and make it
A Refined Complexity Analysis of Degree Anonymization in Graphs 601
Lemma 2. If there is a k-insertion set S for G with |S| ≤ s, then there is also
a k-insertion set S for G with |S | = |S| such that V (S ) ∩ P = ∅.
Based on Lemma 2 we now prove the correctness of our kernelization algorithm.
vertices. Then the main idea is that if it influences the degree of “many” vertices
from the same block, say DG (i), then by Observation 1 the corresponding ver-
tices can be arbitrarily “interchanged”. Thus it is not important to know which
vertex from DG (i) has to be “moved” up to a certain degree by adding edges,
because Observation 1 ensures that we can greedily find one. This, however, im-
plies that the actual structure of the input graph (which forbids to insert certain
edges since they are already present) no longer matters. Hence, we solve De-
gree Anonymity without taking the graph structure into account. Thereby, if
we can k-anonymize the degree sequence corresponding to G (the sequence of
degrees of G) such that “many” degrees have to be adjusted, then by Corollary 1
we can conclude that G contains an f -factor where f (v) captures the difference
between the degree of v in G and the anonymized degree sequence. The f -factor
can be found in polynomial time [10] and, hence, a k-insertion set can be found
in polynomial time. We now formalize this idea.
We first show that a “large” minimum-size k-insertion set increases the max-
imum degree by at most two.
First observe that degG (v) + f (v) ≤ Δ + 2 for all v ∈ V . Furthermore, observe
that f (v) = f (v) for all v ∈ V \ X ∈ X it holds that
and for all v
f (v) < f (v)
and f (v) − f (v) is even. Thus, v∈V f (v) > v∈V f (v) and v∈V f (v) is
even. It remains to show that (i) G contains an f -factor G = (V, S ) and (ii)
G + S is k-anonymous.
To prove (i) let V4 = {v ∈ V | f (v) > 0} and observe that if f (v) > 0,
then, by definition of f , we have f (v) > 0 and hence V4 = V (S). Furthermore,
4 = G[V4 ]. Observe that G
let G 4 has minimum degree |V4 | − Δ − 1 and |V4 | =
A Refined Complexity Analysis of Degree Anonymization in Graphs 603
cases, since any k-insertion set for G of size j ≤ s directly implies that (D, k, j)
is a yes-instance for k-Degree Sequence Anonymity, it follows that we can
bound the parameter s by a function in Δ.
Lemma 5. Let (G, k, s) be an instance of Degree Anonymity. Either one
can decide the instance in polynomial time or (G, k, s) is a yes-instance if and
only if (G, k, min{(Δ2 + 4Δ + 3)2 , s}) is a yes-instance.
By Lemma 5 it follows that in polynomial time we can either find a solution or
we have s < (Δ2 + 4Δ + 3)2 . By Theorem 3 this implies our main result.
Theorem 4. Degree Anonymity admits an O(Δ7 )-vertex kernel.
5 Fixed-Parameter Algorithm
We provide a direct combinatorial algorithm for the combined parameter (Δ, s).
Roughly speaking, for fixed k-insertion set S the algorithm branches into all
suitable structures of G[S], that is, graphs of at most 2s vertices with vertex
labels from {1, . . . , Δ}. Then the algorithm checks whether the respective struc-
ture occurs as a subgraph in G such that the labels on the vertices match the
degree of the corresponding vertex in G.
Theorem 5. Degree Anonymity can be solved in (6s2 Δ3 )2s · s2 · nO(1) time.
Note that due to the upper bound s < (Δ2 + 4Δ + 3)2 (see Lemma 5) and
the polynomial kernel for the parameter Δ (see Theorem 4), Theorem 5 also
4
provides an algorithm running in ΔO(Δ ) + nO(1) time.
6 Conclusion
One of the grand challenges of theoretical research on computationally hard
problems is to gain a better understanding of when and why heuristic algorithms
work [13]. In this theoretical study, we contributed to a better theoretical under-
standing of a basic problem in graph anonymization, on the one side partially
explaining the quality of a successful heuristic approach [16] and on the other
side providing a first step towards a provably efficient algorithm for relevant spe-
cial cases (bounded-degree graphs). Our work just being one of the first steps
in the so far underdeveloped field of studying the computational complexity of
graph anonymization [6], there are numerous challenges for future research. For
instance, our focus was on classification results rather than engineering the upper
bounds, a natural next step to do. Second, it would be interesting to perform a
data-driven analysis of parameter values on real-world networks in order to gain
parameterizations that can be exploited in a broad-band multivariate complex-
ity analysis [22] of Degree Anonymity. Finally, with Degree Anonymity
we focused on a very basic problem of graph anonymization; there are numer-
ous other models (partially mentioned in the introductory section) that ask for
similar studies.
A Refined Complexity Analysis of Degree Anonymization in Graphs 605
References
[1] Aggarwal, C.C., Li, Y., Yu, P.S.: On the hardness of graph anonymization. In:
Proc. 11th IEEE ICDM, pp. 1002–1007. IEEE (2011)
[2] Aggarwal, G., Feder, T., Kenthapadi, K., Khuller, S., Panigrahy, R., Thomas,
D., Zhu, A.: Achieving anonymity via clustering. ACM Transactions on Algo-
rithms 6(3), 1–19 (2010)
[3] Bodlaender, H.L.: Kernelization: New upper and lower bound techniques. In: Chen,
J., Fomin, F.V. (eds.) IWPEC 2009. LNCS, vol. 5917, pp. 17–37. Springer, Hei-
delberg (2009)
[4] Chester, S., Kapron, B.M., Ramesh, G., Srivastava, G., Thomo, A., Venkatesh, S.:
k-Anonymization of social networks by vertex addition. In: Proc. 15th ADBIS (2).
CEUR Workshop Proceedings, vol. 789, pp. 107–116 (2011), CEUS-WS.org
[5] Chester, S., Gaertner, J., Stege, U., Venkatesh, S.: Anonymizing subsets of social
networks with degree constrained subgraphs. In: Proc. ASONAM, pp. 418–422.
IEEE Computer Society (2012)
[6] Chester, S., Kapron, B., Srivastava, G., Venkatesh, S.: Complexity of social net-
work anonymization. Social Network Analysis and Mining (2012) (online available)
[7] Downey, R.G., Fellows, M.R.: Parameterized Complexity. Springer (1999)
[8] Flum, J., Grohe, M.: Parameterized Complexity Theory. Springer (2006)
[9] Fung, B.C.M., Wang, K., Chen, R., Yu, P.S.: Privacy-preserving data publishing: A
survey of recent developments. ACM Computing Surveys 42(4), 14:1–14:53 (2010)
[10] Gabow, H.N.: An efficient reduction technique for degree-constrained subgraph
and bidirected network flow problems. In: Proc. 15th STOC, pp. 448–456. ACM
(1983)
[11] Garey, M.R., Johnson, D.S.: Computers and Intractability: A Guide to the Theory
of NP-Completeness. Freeman (1979)
[12] Guo, J., Niedermeier, R.: Invitation to data reduction and problem kernelization.
SIGACT News 38(1), 31–45 (2007)
[13] Karp, R.M.: Heuristic algorithms in computational molecular biology. J. Comput.
Syst. Sci. 77(1), 122–128 (2011)
[14] Katerinis, P., Tsikopoulos, N.: Minimum degree and f -factors in graphs. New
Zealand J. Math. 29(1), 33–40 (2000)
[15] Leskovec, J., Horvitz, E.: Planetary-scale views on a large instant-messaging net-
work. In: Proc. 17th WWW, pp. 915–924. ACM (2008)
[16] Liu, K., Terzi, E.: Towards identity anonymization on graphs. In: Proc. ACM
SIGMOD 2008, pp. 93–106. ACM (2008)
[17] Lovász, L., Plummer, M.D.: Matching Theory. Annals of Discrete Mathematics,
vol. 29. North-Holland (1986)
[18] Lu, X., Song, Y., Bressan, S.: Fast identity anonymization on graphs. In: Liddle,
S.W., Schewe, K.-D., Tjoa, A.M., Zhou, X. (eds.) DEXA 2012, Part I. LNCS,
vol. 7446, pp. 281–295. Springer, Heidelberg (2012)
[19] Mathieson, L., Szeider, S.: Editing graphs to satisfy degree constraints: A param-
eterized approach. J. Comput. Syst. Sci. 78(1), 179–191 (2012)
[20] Narayanan, A., Shmatikov, V.: De-anonymizing social networks. In: Proc. 30th
IEEE SP, pp. 173–187. IEEE (2009)
606 S. Hartung et al.
1 Introduction
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 607–619, 2013.
c Springer-Verlag Berlin Heidelberg 2013
608 M. Henzinger, S. Krinninger, and D. Nanongkai
through the network, routing, and control. In this paper, we study the problem
of maintaining a BFS tree on dynamic distributed networks. Our main interest
is repairing a BFS tree as fast as possible after each topology change.
Model. We model the communication network by the CONGEST model [25],
one of the major models of (locality-sensitive) distributed computation. Consider
a synchronous network of processors modeled by an undirected unweighted graph
G, where nodes model the processors and edges model the bounded-bandwidth
links between the processors. We let V (G) and E(G) denote the set of nodes
and edges of G, respectively. For any node u and v, we let dG (u, v) be the
distance between u and v in G. The processors (henceforth, nodes) are assumed
to have unique IDs of O(log n) bits and infinite computational power. Each
node has limited topological knowledge; in particular, it only knows the IDs of
its neighbors and knows no other topological information. The communication
is synchronous and occurs in discrete pulses, called rounds. All the nodes wake
up simultaneously at the beginning of each round. In each round each node
u is allowed to send an arbitrary message of O(log n) bits through each edge
(u, v) that is adjacent to u, and the message will reach v at the end of the
current round. There are several measures to analyze the performance of such
algorithms, a fundamental one being the running time, defined as the worst-case
number of rounds of distributed communication.
We model dynamic networks by a sequence of attack and recovery stages fol-
lowing the initial preprocessing. The dynamic network starts with a preprocessing
on the initial network denoted by N0 , where nodes communicate on N0 for some
number of rounds. Once the preprocessing is finished, we begin the first attack
stage where we assume that an adversary, who sees the current network N0 and
the states of all nodes, inserts and deletes an arbitrary number of edges in N0 .
We denote the resulting network by N1 . This is followed by the first recovery
stage where we allow nodes to communicate on N1 . After the nodes have finished
communicating, the second attack stage starts, followed by the second recovery
stage, and so on. We assume that Nt is connected for every stage t. For any
algorithm, we let the total update time be the total number of rounds needed
by nodes to communicate during all recovery stages. Let the amortized update
time be the total time divided by q which is defined to be the number of edges
inserted and deleted. Important parameters in analyzing the running time are n,
the number of nodes (which remains the same throughout all changes) and D, the
maximum diameter, defined to be the maximum diameter among all networks
in {N0 , N1 , . . .}. Note that D ≤ n since we assume that the network remains
connected throughout. Following the convention from the area of (sequential)
dynamic graph algorithms, we say that a dynamic network is fully dynamic if
both insertions and deletions can occur in the attack stages. Otherwise, it is par-
tially dynamic. Specifically, if only edge insertions can occur, it is an incremental
dynamic network. If only edge deletions can occur, it is decremental.
Our model highlights two aspects of dynamic networks: (1) how quick a net-
work can recover its infrastructure after changes (2) how edge failures and ad-
ditions affect the network. These aspects have been studied earlier but we are
Sublinear-Time Maintenance of BFS Tree in Dynamic Networks 609
not aware of any previous model identical to ours. To highlight these aspects,
there are also a few assumptions inherent in our model. First, it is assumed that
the network remains static in each recovery stage. This assumption is often used
(e.g. [18,13,21,24]) and helps emphasizing the running time aspect of dynamic
networks. Second, our model assumes that only edges can change. While there
are studies that assume that nodes can change as well (e.g. [18,13]), this as-
sumption is common and practical; see, e.g., [1,4,22,8] and references therein.
Our amortized update time is also similar in spirit to the amortized commu-
nication complexity heavily studied earlier (e.g. [4]). Finally, the results in this
paper are on partially dynamic networks. While fully dynamic algorithms are
more desirable, we believe that the partially dynamic setting is worth studying,
for two reasons. The first reason, which is our main motivation, comes from an
experience in the study of sequential dynamic algorithms, where insights from
the partially dynamic setting often lead to improved fully dynamic algorithms.
Moreover, partially dynamic algorithms can be useful in cases where one type of
changes occurs much more frequently than the other type.
Problem. We are interested in maintaining an approximate BFS tree. For any
α ≥ 1, an α-approximate BFS tree of graph G with respect to a given root s is
a spanning tree T such that for every node v, dT (s, v) ≤ αdG (s, v) (note that,
clearly, dT (s, v) ≥ dG (s, v)). If α = 1, then T is an (exact) BFS tree. The goal
of our problem is to maintain an approximate BFS tree Tt at the end of each
recovery stage t in the sense that every node v knows its approximate distance
to the preconfigured root s in Nt and, for each neighbor u of v, v knows if u is
its parent or child in Tt .
Results. Clearly, maintaining a BFS tree by recomputing it from scratch in
every recovery stage requires Θ(D) time. Our main results are partially dynamic
algorithms that break this time bound over a long run. They can maintain,
for any constant 0 < ≤ 1, a (1 + )-approximate BFS tree in time that is
sublinear in D when amortized over ω( n log D
D ) edge changes. To be precise, the
1/3 2/3
amortized update time over q edge changes is O((1+ n2/3D
q1/3
) log D +n/q) in the
1/7
D6/7
incremental setting and O(( n q1/7
) log D + n
7/2 q
) in the decremental one. For
the particular case of q = Ω(n), we get amortized update times of O(D2/3 log D)
and O(D6/7 log D) for the incremental and decremental cases, respectively. Our
algorithms do not require any prior knowledge about the dynamic network, e.g.,
D and q. We note that, while there is no previous literature on this problem,
one can parallelize the algorithm of Even and Shiloach [9] (also see [17,27]) to
obtain an amortized update time of O(nD/q + 1) over q changes in both the
incremental and the decremental setting. This bound is sublinear in D when
q = ω(n). Our algorithms give a sublinear time guarantee for a smaller number
of changes, especially in applications where D is large. Consider, for example,
an application where we want to maintain a BFS tree of the network under
link failures until the network diameter is larger than, say n/10 (at this point,
the network will alert an administrator). In this case, our algorithms guarantee
610 M. Henzinger, S. Krinninger, and D. Nanongkai
on maintaining a BFS tree on dynamic networks, there are a few related results.
Much previous attention (e.g. [4]) has been paid on the problem of maintaining
a spanning tree. In a seminal paper by Awerbuch et al. [4], it was shown that
the amortized message complexity of maintaining a spanning tree can be sig-
nificantly smaller than the cost of the previous approach of recomputing from
scratch [1]. Our result is in the same spirit as [4] in breaking the cost of recom-
puting from scratch. An attempt to maintain spanning trees of small diameter
has also motivated a problem called best swap. The goal is to replace a failed edge
in the spanning tree by a new edge in such a way that the diameter is minimized.
This problem has recently gained considerable attention in both sequential (e.g.
[15,3]) and distributed (e.g. [12,10]) settings.
In the sequential dynamic graph algorithms literature, a problem similar to
ours is the single-source shortest paths (SSSP) problem on undirected graphs.
This problem has been studied in partially dynamic settings and has applications
to other problems, such as all-pairs shortest paths and reachability. As we have
mentioned earlier, the classic bound of [9], which might be optimal [27], has
recently been improved by a decremental approximation algorithm [5], and we
achieve a similar result in the incremental setting.
All our algorithms are based on a simple idea of lazy updating. Implementing
this idea on different models requires modifications to cope with difficulties and
to maximize efficiency. In this section, we explain the main idea by sketching a
simple algorithm and its analysis for the incremental setting in the sequential
and the distributed model. We start with an algorithm that has additive error:
Let κ and δ be parameters. For every recovery stage t, we maintain a tree Tt
such that dTt (s, v) ≤ dNt (s, v) ≤ dTt (s, v) + κδ for every node v. We will do this
by recomputing a BFS tree from scratch for O(q/κ + nD/δ 2 ) times.
During the preprocessing, our algorithm constructs a BFS tree of N0 , denoted
by T0 . This means that every node u knows its parent and children in T0 and the
value of dT0 (s, u). Suppose that, in the first attack stage, an edge is inserted, say
(u, v) where dN0 (s, u) ≤ dN0 (s, v). As a result, the distances from v to s might
decrease, i.e. dN1 (s, v) < dN0 (s, v). In this case, the distances from s to some
other nodes (e.g. the children of v in T0 ) could decrease as well, and we may wish
to recompute the BFS tree. Our approach is to do this lazily: We recompute the
BFS tree only when the distance from v to s decreases by at least δ; otherwise,
we simply do nothing! In the latter case, we say that v is lazy. Additionally, we
regularly “clean up” by recomputing the BFS tree after every κ insertions.
To prove an additive error of κδ, observe that errors occur for this single
insertion only when v is lazy. Intuitively, this causes an additive error of δ since
we could have decreased the distance of v and other nodes by at most δ, but we
did not. This argument can be extended to show that if we have i lazy nodes,
then the additive error will be at most iδ. Since we do the cleanup every κ
insertions, the additive error will be at most κδ as claimed.
612 M. Henzinger, S. Krinninger, and D. Nanongkai
For the number of BFS tree recomputations, first observe that the cleanup
clearly contributes O(q/κ) recomputations in total, over q insertions. Moreover,
a recomputation also could be caused by some node v, whose distance to s de-
creases by at least δ. Since every time a node v causes a recomputation, its dis-
tance decreases by at least δ, and dN0 (s, v) ≤ D, v will cause the recomputation
at most D/δ times. This naive argument shows that there are nD/δ recomputa-
tions (caused by n different nodes) in total. This analysis is, however, not enough
for our purpose. A tighter analysis, which is crucial to all our algorithms relies
on the observation that when v causes a recomputation, the distance from v’s
neighbor, say v , to s also decreases by at least δ−1. Similarly, the distance of v ’s
neighbor to s decreases by at least δ − 2, and so on. This leads to the conclusion
that one recomputation corresponds to (δ+(δ−1)+(δ−2)+. . .) = Ω(δ 2 ) distance
decreases. Thus, the number of recomputations is at most nD/δ 2 . Combining the
two bounds, we get that the number of BFS tree computations is O(q/κ+nD/δ 2 )
as claimed. We get the total time in sequential and distributed models by mul-
tiplying this number by m, the final number of edges, and D (time for BFS tree
computation), respectively.
To convert the additive error into a multiplicative error of (1 + ), we execute
the above algorithm only for nodes whose distances to s are greater than κδ/.
For other nodes, we can use the algorithm of Even and Shiloach [9] to maintain
a BFS tree of depth κδ/. This requires an additional time of O(mκδ/) in the
sequential model and O(nκδ/) in the distributed model.
By setting κ and δ appropriately, the above algorithm immediately gives us
the claimed time bound for the sequential model. For incremental distributed
networks, we need one more idea called layering, where we use different values of
δ and κ depending on the distance of each node to s. In the decremental setting,
the situation is much more difficult, mainly because it is nearly impossible for a
node v to determine how much its distance to s has increased after a deletion.
Moreover, unlike the incremental case, nodes cannot simply “do nothing” when
an edge is deleted. We have to cope with this using several other ideas, e.g.,
constructing an imaginary tree (where edges sometimes represent paths).
3 Incremental Algorithm
not exceed some parameter δ, our algorithm keeps its tree T0 and accepts an
additive error of δ for every node. When the decrease exceeds δ, our algorithm
starts a new phase and recomputes the BFS tree. It also start a new phase after
every κ edge insertions to keep the additive error limited to κδ. The algorithm
will answer a query for the distance from a node x to s by returning dG0 (x, s),
the distance from x to s at the beginning of the current phase. It can also return
the path from x to s in T0 of length dG0 (x, s). Besides δ and κ, the algorithm has
a third parameter X which indicates up to which distance from s the BFS tree
will be computed. In the following we denote by G0 the state of the graph at the
beginning of the current phase and by G we denote the current state of the graph
after all insertions. It is easy to see that the algorithm gives the desired additive
4 Decremental Algorithm
In the decremental setting we use an algorithm of the same flavor as in the
incremental setting (see Algorithm 2). However, the update procedure is more
complicated because it is not obvious which edge should be used to repair the
tree after a deletion. Our solution exploits the fact that in the distributed model
it is relatively cheap to examine the local neighborhood of every node. As in
Sublinear-Time Maintenance of BFS Tree in Dynamic Networks 615
the incremental setting, the algorithm has the parameters κ, δ, and X. The
tree update procedure of Algorithm 2 either computes a (weighted) tree T that
approximates the real distances with additive error κδ, or it reports a distance
increase by at least δ since the beginning of the current phase. Let T0 denote
the BFS tree computed at the beginning of the current phase and let F be
the forest resulting from removing those edges from T0 that have already been
deleted in the current phase. After every edge deletion, the tree update procedure
tries to rebuild a tree T by starting from F . Every node u that had a parent
in T0 but has no parent in F tries to find a “good” node v to reconnect to.
This process is repeated until F is a full tree again. Algorithm 2 imposes three
conditions (Lines 17-19) on a “good” node v. Condition (1) guarantees that
the error introduced by each reconnection is at most δ, (2) avoids that the
reconnections introduce any cycles, and (3) states that the node v should be
found relatively close to u. This is the key to efficiently find such a node.
For the analysis of the tree update procedure of Algorithm 2, we assume that
the edges in F are directed. When we compute a BFS tree, we consider all edges
as directed towards the root. The weighted, directed distance from x to y in F
616 M. Henzinger, S. Krinninger, and D. Nanongkai
is denoted by dw F (x, y). We assume for the analysis that F initially contains all
nodes. By T we denote the graph returned by the algorithm. By Condition (1),
every reconnection made by the tree update procedure adds an additive error
of δ. In total there are at most κ reconnections (one per previous edge deletion)
and therefore the total additive error introduced is κδ.
Lemma 7. After every iteration, we have, for all nodes x and y such that
F (x, y) < ∞, dF (x, y) + dG0 (y, s) ≤ dG0 (x, s) + κδ.
dw w
By Condition (2) we avoid that the reconnection process introduces any cycle.
Ideally, a node u ∈ U should reconnect to a node v that is in the subtree of the
root s. We could achieve this if every node in U marked its whole subtree in
F . However, this would be too inefficient. Instead, marking the subtree up to a
limited depth (3κδ) is sufficient.
We can show that the algorithm makes progress in every iteration. There is
always at least one node for which a “good” reconnection is possible that fulfills
the conditions of the algorithm. Even more, if such a node does not exist, then
there is a node whose distance to s has increased by at least δ since the beginning
of the current phase.
The marking and the search process both take time O(κδ). Since there is at
least one reconnection in every iteration (unless the algorithm reports a distance
increase), there are at most κ iterations that take time O(κδ) each.
Lemma 10. The tree update procedure of Algorithm 2 either reports “distance
increase” and guarantees that there is a node x such that dG (x, s) > dG0 (x, s)+δ,
or it computes a tree T such that for every node x we have dG0 (x, s) ≤ dG (x, s) ≤
T (x, s) ≤ dG0 (x, s) + κδ. It runs in time O(κ δ).
dw 2
In the following we clarify some implementation issues of the tree update proce-
dure in the distributed model.
Weighted Edges. The tree computed by the algorithm contains weighted edges.
Such an edge e corresponds to a path P of the same distance in the network.
We implement weighted edges by a routing table for every node v that stores
the next node on P if a message is sent over v as part of the weighted edge e.
Avoiding Congestion. The marking can be done in parallel without congestion
because the trees in the forest F do not overlap. We avoid congestion during the
search as follows. If a node receives more than one message from its neighbors,
we always give priority to search requests originating from the node u with the
Sublinear-Time Maintenance of BFS Tree in Dynamic Networks 617
References
1. Afek, Y., Awerbuch, B., Gafni, E.: Applying static network protocols to dynamic
networks. In: FOCS, pp. 358–370 (1987)
2. Afek, Y., Awerbuch, B., Plotkin, S.A., Saks, M.E.: Local management of a global
resource in a communication network. J. ACM 43(1), 1–19 (1996)
3. Alstrup, S., Holm, J., de Lichtenberg, K., Thorup, M.: Maintaining information in
fully dynamic trees with top trees. ACM Transactions on Algorithms 1(2), 243–264
(2005), announced at ICALP 1997 and SWAT 2000
4. Awerbuch, B., Cidon, I., Kutten, S.: Optimal maintenance of a spanning tree. J.
ACM 55(4) (2008); announced at FOCS 1990
5. Bernstein, A., Roditty, L.: Improved dynamic algorithms for maintaining approxi-
mate shortest paths under deletions. In: SODA, pp. 1355–1365 (2011)
6. Cicerone, S., D’Angelo, G., Stefano, G.D., Frigioni, D.: Partially dynamic efficient
algorithms for distributed shortest paths. Theor. Comput. Sci. 411(7-9), 1013–1037
(2010)
7. Cicerone, S., D’Angelo, G., Stefano, G.D., Frigioni, D., Petricola, A.: Partially dy-
namic algorithms for distributed shortest paths and their experimental evaluation.
JCP 2(9), 16–26 (2007)
8. Elkin, M.: A near-optimal distributed fully dynamic algorithm for maintaining
sparse spanners. In: PODC, pp. 185–194 (2007)
9. Even, S., Shiloach, Y.: An on-line edge-deletion problem. J. ACM 28(1), 1–4 (1981)
10. Flocchini, P., Enriques, A.M., Pagli, L., Prencipe, G., Santoro, N.: Point-of-failure
shortest-path rerouting: Computing the optimal swap edges distributively. IEICE
Transactions 89-D(2), 700–708 (2006)
11. Garay, J., Kutten, S., Peleg, D.: A sublinear time distributed algorithm for
minimum-weight spanning trees. SIAM J. on Computing 27, 302–316 (1998); an-
nounced at FOCS 1993
12. Gfeller, B., Santoro, N., Widmayer, P.: A distributed algorithm for finding all best
swap edges of a minimum-diameter spanning tree. IEEE Trans. Dependable Sec.
Comput. 8(1), 1–12 (2011), announced at DISC 2007
13. Hayes, T.P., Saia, J., Trehan, A.: The forgiving graph: a distributed data structure
for low stretch under adversarial attack. Distributed Computing 25(4), 261–278
(2012); announced at PODC 2009
14. Italiano, G.F.: Distributed algorithms for updating shortest paths. In:
WDAG(DISC), pp. 200–211 (1991)
15. Italiano, G.F., Ramaswami, R.: Maintaining spanning trees of small diameter. Al-
gorithmica 22(3), 275–304 (1998)
16. Khan, M., Kuhn, F., Malkhi, D., Pandurangan, G., Talwar, K.: Efficient distributed
approximation algorithms via probabilistic tree embeddings. Distributed Comput-
ing 25(3), 189–205 (2012); announced at PODC 2008
17. King, V.: Fully dynamic algorithms for maintaining all-pairs shortest paths and
transitive closure in digraphs. In: FOCS, pp. 81–91 (1999)
18. Korman, A.: Improved compact routing schemes for dynamic trees. In: PODC,
pp. 185–194 (2008)
19. Korman, A., Kutten, S.: Controller and estimator for dynamic networks. Inf. Com-
put. 223, 43–66 (2013)
Sublinear-Time Maintenance of BFS Tree in Dynamic Networks 619
20. Korman, A., Peleg, D.: Dynamic routing schemes for graphs with low local density.
ACM Transactions on Algorithms 4(4) (2008)
21. Krizanc, D., Luccio, F.L., Raman, R.: Compact routing schemes for dynamic ring
networks. Theory Comput. Syst. 37(5), 585–607 (2004)
22. Kuhn, F., Lynch, N.A., Oshman, R.: Distributed computation in dynamic net-
works. In: STOC, pp. 513–522 (2010)
23. Lynch, N.A.: Distributed Algorithms. Morgan Kaufmann Publishers, San Francisco
(1996)
24. Malpani, N., Welch, J.L., Vaidya, N.H.: Leader election algorithms for mobile ad
hoc networks. In: DIAL-M, pp. 96–103 (2000)
25. Peleg, D.: Distributed computing: a locality-sensitive approach. SIAM, Philadel-
phia (2000)
26. Ramarao, K.V.S., Venkatesan, S.: On finding and updating shortest paths distribu-
tively. J. Algorithms 13(2), 235–257 (1992)
27. Roditty, L., Zwick, U.: On dynamic shortest paths problems. Algorithmica 61(2),
389–401 (2011); announced at ESA 2004
Locally Stable Marriage with Strict Preferences
1 Introduction
Matching problems form the basis of many assignment and allocation tasks en-
countered in computer science, operations research, and economics. A prominent
and popular approach in all these areas is stable matching, as it captures aspects
like distributed control and rationality of participants that arise in many as-
signment problems today. A variety of allocation problems in markets can be
analyzed within the context of two-sided stable matching, e.g., the assignment
of jobs to workers [2,5], organs to patients [18], or general buyers to sellers. In ad-
dition, stable marriage problems have been successfully used to study distributed
resource allocation problems in networks [9].
In this paper, we consider a game-theoretic model for matching with dis-
tributed control and information. Agents are rational agents embedded in a
(social) network and strive to find a partner for a joint relationship or activity,
Supported by DFG Cluster of Excellence MMCI and grant Ho 3831/3-1.
An extended full version of this paper can be found at
http://arxiv.org/abs/1207.1265
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 620–631, 2013.
© Springer-Verlag Berlin Heidelberg 2013
Locally Stable Marriage with Strict Preferences 621
e.g., to do sports, write a research paper, exchange data etc. Such problems are
of central interest in economics and sociology, and they act as fundamental coor-
dination tasks in distributed computer networks. Our model extends the stable
marriage problem, in which we have sets U and W of men and women. Each
man (woman) can match to at most one woman (man) and has a complete strict
preference list over all women (men). Given a matching M , a blocking pair is a
man-woman pair such that both strictly improve by matching to each other. A
matching without blocking pair is a stable matching.
A central assumption in stable marriage is that every agent knows all agents
it can match to. In reality, however, agents often have limited information about
their matching possibilities. For instance, in a large society we would not expect
a man to match up with any other woman immediately. Instead, there exist re-
strictions in terms of knowledge and information that allow some pairs to match
up directly, while others would have to get to know each other before being
able to start a relationship. We incorporate this aspect by assuming that agents
are embedded in a fixed network of links. Links represent an enduring knowl-
edge relation that is not primarily under the control of the agents. Depending
on the interpretation, links could represent, e.g., family, neighbor, colleague or
teammate relations. Each agent strives to build one matching edge to a partner.
The set of links and edges defines a dynamic information structure based on
triadic closure, a standard idea in social network theory: If two agents have a
common friend, they are likely to meet and learn about each other. Translated
into our model this implies that each agent can match only to partners in its
2-hop neighborhood of the network of matching edges and links. Then, a local
blocking pair is a blocking pair of agents that are at hop distance at most 2 in
the network. Consequently, a locally stable matching is a matching without local
blocking pairs. Local blocking pairs are a subset of blocking pairs. In turn, every
stable matching is a locally stable matching, because it allows no (local or global)
blocking pairs. Thus, one might be tempted to think that locally stable match-
ings are easier to find and/or reach using distributed dynamics than ordinary
stable matchings. In contrast, we show in this paper that locally stable match-
ings have a rich structure and can behave quite differently than ordinary stable
matchings. Our study of locally stable matching with arbitrary strict preferences
significantly extends recent work on the special case of correlated or weighted
matching [11], in which preferences are correlated via matching edge benefits.
is NP-hard to decide Reachability, even if the network exists only among one
partition of agents. Moreover, there exist games and initial matchings such that
every sequence of local blocking pairs terminating in a locally stable matching is
exponentially long. Hence, Reachability might even be outside NP. If we need
to decide Reachability for a given initial matching and a specific locally stable
matching to be reached, the problem is even NP-hard for correlated matching.
Our NP-hardness results hold even if the network exists only among one par-
tition. In Section 4, we concentrate on a more general class of games in which
links exist in one partition and between partitions (i.e., one partition has no
internal links). This is a natural assumption when considering objects that do
not generate knowledge about each other, e.g., when matching resources to net-
worked nodes or users, where initially resources are only known to a subset of
users. Here we characterize the impact of memory on distributed dynamics. For
recency memory, each agent remembers in every round the most recent partner
that is different from the current one. With recency memory, Reachability
is always true, and for every initial matching there exists a sequence of poly-
nomially many local or remembered blocking pairs leading to a locally stable
matching. In contrast, for quality memory where all agents remember their best
partner Reachability stays NP-hard. This formally supports the intuition that
recency memory is more powerful than quality memory, as the latter yields agents
that are “hung up” on preferred but unavailable partners. This provides a novel
distinction between recency and quality memory.
Our positive results for recency memory in Section 4 imply that if we pick lo-
cal blocking pairs uniformly at random in each step, we achieve convergence with
probability 1. The proof relies only on the memory of one partition. In contrast,
if only the other partition has memory, we obtain NP-hardness of Reachabil-
ity. Convergence with probability 1 can also be guaranteed for random mem-
ory if in each round each agent remembers one of his previous matches chosen
uniformly at random. The latter result holds even when links exist among or
between both partitions. However, using known results on stable marriage with
full information [1], convergence time can be exponential with high probability,
independently of any memory.
In contrast to ordinary stable matchings, two locally stable matchings can
have very different size. This motivates our search for maximum locally stable
matchings in Section 5. While a simple 2-approximation algorithm exists, we can
show a non-approximability result of 1.5 − ε under the unique games conjecture.
For spatial reasons most of the proofs are omitted but can be found in the full
version.
Related Work Locally stable matchings were introduced by Arcaute and Vassil-
vitskii [2] in a two-sided job-market model, in which links exist only among one
partition. The paper uses strong uniformity assumptions on the preferences and
addresses the lattice structure for stable matchings and a local Gale-Shapley
algorithm. More recently, we studied locally stable matching with correlated
preferences in the roommates problem, where arbitrary pairs of agents can be
matched [11]. Using a potential function argument, Reachability is always
Locally Stable Marriage with Strict Preferences 623
true and convergence guaranteed. Moreover, for every initial matching there
is a polynomial sequence of local blocking pairs that leads to a locally stable
matching. The expected convergence time of random dynamics, however, is ex-
ponential. If we restrict to resolution of pairs with maximum benefit, then for
random memory the expected convergence time becomes polynomial, but for
recency or quality memory convergence time remains exponential, even if the
memory is of polynomial size.
For an introduction to stable marriage and some of its variants we refer the
reader to several books in the area [10, 19]. There is a significant literature on
dynamics, especially in economics, which is too broad to survey here. These
works usually do not address issues like computational complexity or worst-
case bounds. We focus on a subset of prominent analytical works related to
our scenario. For the stable marriage problem, it is known that better-response
dynamics, in which agents sequentially deviate to blocking pairs, can cycle [16].
On the other hand, Reachability is always true, and for every initial matching
there exists a sequence of polynomially many steps to a stable matching [20]. If
blocking pairs are chosen uniformly at random at each step, convergence time is
exponential [1] in the worst case.
In the roommates problem, in which every pair of agents can be matched, sta-
ble matchings can be absent. Deciding existence and computing stable matchings
if they exist can be done in polynomial time [14]. In addition, if a stable matching
exists, then Reachability is always true [8]. A similar statement can be made
even more generally for relaxed concepts like P -stable matchings that always
exist [12]. Ergodic sets of the underlying Markov chain have been studied [13]
and related to random dynamics [15]. In addition, for computing (variants of)
stable matchings via iterative entry dynamics see [4–6].
The problem of computing a maximum locally stable matchings has recently
been considered in [7]. In addition to characterizations for special cases, a NP-
hardness result is shown and non-approximability of (21/19 − ε) unless P= NP.
Computing maximum stable matchings with ties and incomplete lists has gener-
ated a significant amount of research interest over the past decade. The currently
best results are a 1.5-approximation algorithm [17] and (4/3 − ε)-hardness under
the unique games conjecture [21].
2 Preliminaries
job-market games. We present the proof of the latter result in detail, as it pro-
vides the basic idea for the omitted NP-hardness proofs as well.
Proof. We use a reduction from 3Sat . Given a 3Sat formula with k variables
x1 , . . . , xk and l clauses C1 , . . . , Cl , where clause Cj contains the literals l1j , l2j
and l3j , we have
x1
a1 x1
xk
xk
We do not restrict the set of matching edges, but assume that every edge not
appearing in the list below has benefit ; 1 (resulting in them being irrelevant
for the dynamics). The other benefits are given as follows.
u∈U w∈W b({u, w})
uCj a j j = 1, . . . , l
uxi a i+l i = 1, . . . , k
bh a h + 12 h = 1, . . . , k + l − 1
uCj l1j /l2j /l3j k+l+1 j = 1, . . . , l
uxi xi /xi k+l+1 i = 1, . . . , k
uCj vxi k+l+1+i i = 1, . . . , k, j = 1, . . . , l
uxi vxi k + l + 1 + i i = 1, . . . , k, i = 1, . . . , i
uCj vCj 2k + l + 1 + j j = 1, . . . , l, j = 1, . . . , j
is moved on from one u-vertex to another after it has left a. Thus, at the time
when an edge to a clause u-vertex is created that still exists in the final matching
(but is connected to some vCj then), the edges for all variable u-vertices must
have been created already.
Assume that the 3Sat formula is satisfiable. Then we first create a matching
edge at {uCj , a}, move it over the u-and b-vertices to uxk , and then move it
into the branching to the one of xk or xk that negates its value in the satisfy-
ing assignment. Similarly, one after the other (in descending order), we create
a matching edge at a for each of the variable u-vertices and move it into the
branching to the variable vertex that negates its value in the satisfying assign-
ment. As every clause is fulfilled, at least one of the three vertices that yield an
improvement for the clause u-vertex from a is not blocked by a matching edge to
a variable u-vertex. Then, the edges to clause u-vertices can bypass the existing
edges (again, one after the other in descending order) and reach their positions
in M ∗ . After that, the variable-edges can leave the branching and move to their
final position in the same order as before.
Now assume that we can reach M ∗ from ∅. We note that the edges to clause
u-vertices have to overtake the edges to variable u-vertices somewhere on the
way to reach their final position. The only place to do so is in the branching
leading over the xi and xi . Thus all variable-edges have to wait at some xi or
xi until the clause-edges have passed. But from a, vertex uxi is only willing to
switch to xi or xi . Thus, every vertex blocks out a different variable (either in
its true or in its false value). Similarly, a vertex uCj will only move further from
a if it can reach one of its literals. Hence, if all clauses can bypass the variables,
then for every clause there was one of its literals left open for passage. Thus, if
we set each variable to the value that yields the passage for clause-edges in the
branching, we obtain a satisfying assignment. &
%
Theorem 3. For every network game with correlated preferences, every locally
stable matching M ∗ ∈ E and initial matching M0 ∈ E such that M ∗ can be
reached from M0 through local improvement steps, there exists a sequence of at
most O(|E|3 ) local improvement steps leading from M0 to M ∗ .
Locally Stable Marriage with Strict Preferences 627
(1) An edge can only be deleted by a stronger edge, that is, every chain of one
edge deleting the next is limited in length by rmax .
(2) If an edge is created, then possibly moved, and finally deleted without delet-
ing an edge on its way, this edge would not have to be introduced in the first
place.
Suppose our initial matching is the empty matching, then every edge in the
locally stable matching has to be created and by (repeated application of) (2)
we only need to create and move edges that are needed for the final matching.
Thus we have |M ∗ | edges, which each made at most rmax steps.
Now if we start with an arbitrary matching, the sequence might be forced
to delete some edges that cannot be used for the final matching. Each of these
edges generates a chain of edges deleting each other throughout the sequence,
but (1) tells us that this chain is limited as well as the number of steps each
of these edges has to make. The only remaining issue is what happens to edges
”accidentally” deleted during this procedure. Again, we can use (2) to argue
that there is no reason to rebuild such an edge just to delete it again. Thus, such
deletions can happen only once for every edge we had in M0 (not necessarily
on the position it had in M0 ). It does not do any harm if it happens to an
edge of one of the deletion-chains, as it would just end as desired. For the edges
remaining in |M ∗ | the same bounds holds as before. Thus, we have an overall
bound of |M0 | · rmax · rmax + |M ∗ | · rmax ∈ O(|E|3 ) steps, where the first term
results from the deletion chains and the second one from the edges surviving in
the final matching. &
%
Theorem 4. There is a network game with strict preferences such that a locally
stable matching can be reached by a sequence of local improvement steps from
the initial matching M = ∅, but every such sequence has length 2Ω(|V |) .
4 Memory
Given the impossibility results in the last section, we now focus on the impact of
memory. As a direct initial result, no memory can yield reachability of a given
locally stable matching, even in a correlated job-market game.
Corollary 2. It is NP-hard to decide Reachability to a given locally stable
matching in a correlated job-market game with any kind of memory.
628 M. Hoefer and L. Wagner
Quality Memory. With quality memory, each agent remembers the best match-
ing partner he ever had before. While this seems quite a natural choice and
appears like a smart strategy, it can be easily fooled by starting with a much-
liked partner, who soon after matches with someone more preferred and never
becomes available again. This way the memory becomes useless which leaves us
with the same dynamics as before.
Proposition 1. There is a network game with strict preferences, links L ⊆
(W × W ) ∪ (U × W ), quality memory and initial matching M = ∅ such that
no locally stable matching can be reached with local improvement steps from M .
This even holds if every agent remembers the best k previous matches.
Theorem 5. It is NP-hard to decide Reachability to an arbitrary locally sta-
ble matching in a network game with quality memory.
Recency Memory. With recency memory, each agent remembers the last partner
he has been matched to. This is again quite a very natural choice as it expresses
the human character of remembering the latest events best. Interestingly, here
we actually can ensure that a locally stable matching can be reached.
Theorem 6. For every network game with strict preferences, links L ⊆ (U ×
W ) ∪ (W × W ), recency memory and every initial matching, there is a sequence
of O(|U |2 |W |2 ) many local improvement steps to a locally stable matching.
Proof. Our basic approach is to construct the sequence in two phases similarly
as in [1]. In the first phase, we let the matched vertices from U improve, but
ignore the unmatched ones. In the second phase, we make sure that vertices from
W have improved after every round.
Preparation phase: As long as there is at least one u ∈ U with u matched and
u part of a blocking pair, allow u to switch to the better partner.
The preparation phase terminates after at most |U | · |W | steps, as in every
round one matched u ∈ U strictly improves in terms of preference. This can hap-
pen at most |W | times for each matched u. In addition, the number of matched
vertices from U only decreases.
Memory phase: As long as there is a u ∈ U with u part of a blocking pair,
pick u and execute a sequence of local improvement steps involving u until u is
not part of any blocking pair anymore. For every edge e = {u , w} with u = u
that was deleted during the sequence, recreate e from the memory of u .
We claim that if we start the memory phase after the preparation phase, at the
end of every round we have the following invariants: The vertices from W that
have been matched before are still matched, they do not have a worse partner
than before, and at least one of them is matched strictly better than before.
Also, only unmatched vertices from U are involved in local blocking pairs.
Locally Stable Marriage with Strict Preferences 629
Obviously, at the end of the preparation phase the only U -vertices in local
blocking pairs are unmatched, i.e., initially only unmatched U -vertices are part
of local blocking pairs. Let u be the vertex chosen in the following round of
the memory phase. At first we consider the outcome for w ∈ W . If w is the
vertex matched to u in the end, then w clearly has improved. Otherwise w gets
matched to its former partner (if it had one) through memory and thus has the
same utility as before. In particular, every w that represents an improvement
to some u but was blocked by a higher ranked vertex still remains blocked.
Together with the fact that u plays local improvement steps until it is not part
of a local blocking pair anymore, this guarantees that all matched U -vertices
cannot improve at the end of the round. As one W -vertex improves in every
round, we have at most |U | · |W | rounds in the memory phase, where every
round consists of at most |W | steps by u and at most |U | − 1 edges reproduced
from memory. &
%
The existence of sequences to (locally) stable matchings also implies that ran-
dom dynamics converge in the long run with probability 1 [8, 12, 20]. In general,
we cannot expect fast convergence here, as there are instances where random
dynamics yield an exponential sequence with high probability even if all infor-
mation is given – e.g., reinterpret the instance from [1] with L = U × W , then
every agent knows every possible partner and memory has no effect.
Observe that the previous proof relies only on the recency memory of partition
U . Hence, the existence of short sequences holds even if only agents from U have
memory. In contrast, if only agents from W have recency memory, the previous
NP-hardness constructions can be extended.
Random Memory. Finally, with random memory, each agent remembers a part-
ner chosen uniformly at random in each step. We consider random memory and
reaching a locally stable matching from every starting state even in general net-
work games. While we cannot expect fast convergence, we can show that random
memory helps with reachability:
Theorem 8. For every network game with random memory, random dynamics
converge to a locally stable matching with probability 1.
Theorem 9. For every graph G = (V, E) there is a job-market game that admits
a maximum locally stable matching of size |V | + k if and only if G holds a
maximum independent set of size k.
In fact, our reduction applies in the setting of the job-market game, where one
side has no network at all. This shows that even under quite strong restric-
tions the hardness of approximation holds. In contrast, it is easy to obtain a
2-approximation in every network game that admits a globally stable matching.
References
1. Ackermann, H., Goldberg, P., Mirrokni, V., Röglin, H., Vöcking, B.: Uncoordinated
two-sided matching markets. SIAM J. Comput. 40(1), 92–106 (2011)
2. Arcaute, E., Vassilvitskii, S.: Social networks and stable matchings in the job mar-
ket. In: Leonardi, S. (ed.) WINE 2009. LNCS, vol. 5929, pp. 220–231. Springer,
Heidelberg (2009)
3. Austrin, P., Khot, S., Safra, M.: Inapproximability of vertex cover and independent
set in bounded degree graphs. Theory of Computing 7(1), 27–43 (2011)
4. Biró, P., Cechlárová, K., Fleiner, T.: The dynamics of stable matchings and half-
matchings for the stable marriage and roommates problems. Int. J. Game The-
ory 36(3-4), 333–352 (2008)
5. Blum, Y., Roth, A., Rothblum, U.: Vacancy chains and equilibration in senior-level
labor markets. J. Econom. Theory 76, 362–411 (1997)
6. Blum, Y., Rothblum, U.: “Timing is everything” and martial bliss. J. Econom.
Theory 103, 429–442 (2002)
7. Cheng, C., McDermid, E.: Maximum locally stable matchings. In: Proc. 2nd Intl.
Workshop Matching under Preferences (MATCH-UP), pp. 51–62 (2012)
8. Diamantoudi, E., Miyagawa, E., Xue, L.: Random paths to stability in the room-
mates problem. Games Econom. Behav. 48(1), 18–28 (2004)
9. Goemans, M., Li, L., Mirrokni, V., Thottan, M.: Market sharing games applied to
content distribution in ad-hoc networks. IEEE J. Sel. Area Comm. 24(5), 1020–
1033 (2006)
10. Gusfield, D., Irving, R.: The Stable Marriage Problem: Structure and Algorithms.
MIT Press (1989)
11. Hoefer, M.: Local matching dynamics in social networks. Inf. Comput. 222, 20–35
(2013)
12. Inarra, E., Larrea, C., Moris, E.: Random paths to P -stability in the roommates
problem. Int. J. Game Theory 36(3-4), 461–471 (2008)
13. Inarra, E., Larrea, C., Moris, E.: The stability of the roommate problem revisited.
Core Discussion Paper 2010/7 (2010)
14. Irving, R.: An efficient algorithm for the ”stable roommates” problem. J. Algo-
rithms 6(4), 577–595 (1985)
15. Klaus, B., Klijn, F., Walzl, M.: Stochastic stability for rommate markets. J.
Econom. Theory 145, 2218–2240 (2010)
16. Knuth, D.: Marriages stables et leurs relations avec d’autres problemes combina-
toires. Les Presses de l’Université de Montréal (1976)
17. McDermid, E.: A 3/2-approximation algorithm for general stable marriage. In:
Albers, S., Marchetti-Spaccamela, A., Matias, Y., Nikoletseas, S., Thomas, W.
(eds.) ICALP 2009, Part I. LNCS, vol. 5555, pp. 689–700. Springer, Heidelberg
(2009)
18. Roth, A., Sönmezc, T., Ünver, M.U.: Pairwise kidney exchange. J. Econom. The-
ory 125(2), 151–188 (2005)
19. Roth, A., Sotomayor, M.O.: Two-sided Matching: A study in game-theoretic mod-
eling and analysis. Cambridge University Press (1990)
20. Roth, A., Vate, J.V.: Random paths to stability in two-sided matching. Economet-
rica 58(6), 1475–1480 (1990)
21. Yanagisawa, H.: Approximation algorithms for stable marriage problems. PhD the-
sis, Kyoto University, Graduate School of Informatics (2007)
Distributed Deterministic Broadcasting
in Wireless Networks of Weak Devices
1 Introduction
1.1 The Model
We consider a wireless network consisting of n stations, also called nodes, de-
ployed into an Euclidean plane and communicating by a wireless medium. The
Euclidean metric on the plane is denoted dist(·, ·). Each station v has its trans-
mission power Pv , which is a positive real number. There are three fixed model
parameters: path loss α > 2, threshold β ≥ 1, and ambient noise N > 0.
The full version of the paper is available at [13]. This work was supported by the
Polish National Science Centre grant DEC-2012/06/M/ST6/00459.
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 632–644, 2013.
c Springer-Verlag Berlin Heidelberg 2013
Distributed Broadcasting 633
The SIN R(v, u, T ) ratio, for given stations u, v and a set of (transmitting)
stations T , is defined as follows:
Pv dist(v, u)−α
SIN R(v, u, T ) = −α
(1)
N+ w∈T \{v} Pw dist(w, u)
In the weak devices model considered in this work, a station u successfully receives
a message from a station v in a round if v ∈ T , u ∈ / T , and:
a) Pv dist−α (v, u) ≥ (1 + ε)βN , and
b) SIN R(v, u, T ) ≥ β,
where T is the set of stations transmitting at that time and ε > 0 is a fixed
signal sensitivity parameter of the model.1
Ranges and Uniformity. The communication range rv of a station v is the ra-
dius of the ball in which a message transmitted by the station is heard, provided
no other station transmits at the same time. A network is uniform, when trans-
mission powers Pv and thus ranges of all stations rv are equal, or nonuniform
otherwise. In this paper, only uniform networks are considered, i.e., Pv = P and
r = rv = (P/(N β(1 + ε)))1/α . The range area of a station v is defined to be the
ball of radius r centered in v.
Communication Graph and Graph Notation. The communication graph
G(V, E), also called the reachability graph, of a given network consists of all
network nodes and edges (v, u) such that u is in the range area of v. Note that
the communication graph is symmetric for uniform networks. By a neighborhood
of a node u we mean the set (and positions) of all neighbors of u in G, i.e.,
the set {w | (w, u) ∈ E(G)}. The graph distance from v to w is equal to the
length of a shortest path from v to w in the communication graph, where the
length of a path is equal to the number of its edges. The eccentricity of a node
is the maximum graph distance from this node to any other node (note that the
eccentricity is of order of the diameter). By Δ we denote the maximum degree
of a node in the communication graph.
Synchronization. It is assumed that algorithms work synchronously in rounds,
each station can either act as a sender or as a receiver during a round. We do
not assume global clock ticking.
Carrier Sensing. We consider the model without carrier sensing, that is, a
station u has no other feedback from the wireless channel than receiving or not
receiving a message in a round t.
1
This model is motivated by the fact that it is too costly for weak devices to have
receivers doing signal acquisition continuously, c.f., [7]. Therefore, in many systems
they rather wait for an energy spike, c.f., condition (a), and once they see it, they
start sampling and correlating to synchronize and acquire a potential packet pream-
ble [19]. Once synchronized, they can detect signals, c.f., condition (b).
634 T. Jurdzinski, D.R. Kowalski, and G. Stachowiak
Knowledge of Stations. Each station has its unique ID from the set [N ],2
where N is polynomial in n. Stations also know their locations, and parameters n,
N . Some subroutines use the granularity g, defined as r divided by the minimum
distance between any two stations (c.f., [5]). We distinguish between networks
without local knowledge (ad hoc), where stations do not know anything about
the topology of the network, and networks with local knowledge, in which each
station knows locations and IDs of its neighbors in the communication graph.
Broadcasting Problem and Complexity Parameters. In the broadcast
problem, there is one distinguished node, called the source, which initially holds
a piece of information (also called a source message or a broadcast message).
The goal is to disseminate this message to all other nodes. The complexity
measure is the worst-case time to accomplish the broadcast task, taken over
all connected networks with specified parameters. Time, also called the round
complexity, denotes the number of communication rounds in the execution of a
protocol: from the round when the source is activated with its source message
till the broadcast task is accomplished. For the sake of complexity formulas, we
consider the following parameters: n, N , D, and g.
Messages and Initialization of Stations Other than Source. We assume
that a single message sent in the execution of any algorithm can carry the broad-
cast message and at most polynomial, in the size of the network, number of
control bits. (For the purpose of our algorithms, it is sufficient that positions of
stations on the plane are stored with accuracy requiring O(log n) bits; therefore,
we assume that each message contains the position of its sender.) A station other
than the source starts executing the broadcast protocol after the first successful
receipt of the source message; it is often called a non-spontaneous wake-up model.
is much higher, by factor around min{n/D, Δ}, than the cost of broadcast itself
(i.e., broadcast performed when such neighborhoods would be provided). If the
granularity g is known, a complexity O(D log g) can be achieved by a variation
of the algorithm mentioned above.
Our results rely on novel techniques which simultaneously exploit specific
properties of conflict resolution in the SINR model (see e.g., [1]) and several
algorithmic techniques developed for a different radio network model. In par-
ticular, we show how to efficiently combine a novel SINR-based communication
technique, ensuring several simultaneous point-to-point communications inside
the range area of one station (which is unfeasible to achieve in the radio network
model), with strongly selective families and methods based on geometric grids
developed in the context of radio networks. As a result, we are able to transform
algorithms relying on the knowledge of network’s granularity into algorithms of
asymptotically similar performance (up to a log n factor) that do not require such
knowledge; this is in particular demonstrated in the leader election algorithms.
Details of some algorithms and technical proofs can be found in the full version
of the paper [13].
will refer to (boxes of) Gγ . The boxes C, C of the pivotal grid are neighbors in
a network if there are stations v ∈ C and v ∈ C such that the edge (v, v )
belongs to the communication graph. We define the set DIR ⊂ [−2, 2]2 such
that (d1 , d2 ) ∈ DIR iff it is possible that boxes C(i, j) and C(i + d1 , j + d2 ) are
neighbors.
Schedules. A (general) broadcast schedule S of length T wrt N ∈ N is a mapping
from [N ] to binary sequences of length T . A station with identifier v ∈ [N ] follows
the schedule S of length T in a fixed period of time consisting of T rounds, when
v transmits a message in round t of that period iff the position t mod T of S(v)
is equal to 1. For the tuples (i1 , j1 ), (i2 , j2 ) the relation (i1 , j1 ) ≡ (i2 , j2 ) mod d
for d ∈ N denotes that (|i1 − i2 | mod d) = 0 and (|j1 − j2 | mod d) = 0. A set
of stations A on the plane is δ-diluted wrt Gc , for δ ∈ N \ {0}, if for any two
stations v1 , v2 ∈ A with grid coordinates (i1 , j1 ) and (i2 , j2 ), respectively, the
relationship (i1 , j1 ) ≡ (i2 , j2 ) mod d holds. We say that δ-dilution is applied
to a schedule S if each round of an execution of S is replaced with δ 2 rounds
parameterized by (i, j) ∈ [0, δ − 1]2 such that a station v ∈ C(a, b) can transmit
a message only in the rounds (i, j) such that (i, j) ≡ (a, b) mod δ.
Proposition 1. For each α > 2 and ε > 0, there exists a constant d0 such that
the following properties hold. Assume that a set of n stations A is d-diluted wrt
the grid Gx , where x = γ/c, c ∈ N, c > 1 and d ≥ d0 . Moreover, at most one
station from A is located in each box of Gx . Then, if all stations from A transmit
simultaneously, each of them transmits 2r c -successfully.
Proposition 2. For each α > 2 and ε > 0, there exists a constant d satisfying
the√following property. Let A be a set of stations such that minu,v∈A {dist(u, v)} =
x· 2, where x ≤ γ. If a station u ∈ C(i, j) for a box C(i, j) of Gx is transmitting
in a round t and no other station in any box C(i , j ) of Gx such that max{|i −
i |, |j − j |} ≤ d is transmitting at that round, then v can hear the message from
u at round t.
The first thread keeps combining stations into groups such that eventually,
for any box C of the pivotal grid, all stations located in C form one group.
Moreover, each group has the leader, and eventually each station should be aware
of (i) which group it belongs to, (ii) which station is the leader of that group,
and (iii) which stations belong to that group. Upon waking up, each station
forms a group with a single element (itself), and the groups increase gradually
by merging. The merging process builds upon the following observation. Let σ be
the smallest distance between two stations and let u, v be the closest stations.
Thus, there is at most one station in each box of the grid Gσ/√2 . Then, if u
transmits a message and no other station in distance d · σ, for some constant d,
transmits at the same time, then v can hear that message (see Prop. 2). Using
a (N, (2d + 1)2 )-strongly-selective family as a broadcast schedule S on the set of
leaders of groups, c.f., [16], one can assure that such a situation occurs in each
O(log N ) rounds. If u can hear v and v can hear u during such a schedule, the
groups of u and v can be merged. In order to coordinate the merging process,
we implicitly build a matching among pairs (u, v) such that u can hear v and v
can hear u during execution of S.
The second thread is supposed to guarantee that the broadcast message is
transmitted from boxes containing informed stations to their neighbors. Each
station determines its temporary ID (TID) as the rank of its ID in the set of IDs
in its group. Using these TIDs, the stations apply round-robin strategy. Thus,
if each group corresponds to all stations in the appropriate box, transmissions
are successful (see Prop. 1), and thus they guarantee that neighbors of a box
containing informed stations will also contain informed stations.
The main problem with implementation of these ideas is that, as long as there
are many groups inside a box, transmissions in the second thread may cause
unwanted interferences. Another problem is that the set of stations attending the
protocol changes gradually, when new stations become informed and can join the
execution of the protocol. These issues are managed by measuring the progress
of a protocol using amortized analysis. The details of the implementation and
analysis can be found in the full version of the paper.
Algorithm 1. LeaderElection(V, n)
1: For each v ∈ V : cand(v) ← true;
2: for i = 1, . . . , log n + 1 do Elimination
3: for j, k ∈ [0, 2] do
4: Execute S twice on the set:
5: {w ∈ V | cand(w) = true and w ∈ C(j , k )
6: such that (j mod 2, k mod 2) = (j, k)};
7: Each w ∈ V determines and stores Xw during the first execution of S, and
8: Xv , for each v ∈ Xw , during the second execution of S;
9: for each v ∈ V do
10: u ← min(Xv );
11: if Xv = ∅ or v > min(Xu ∪ {u}) then cand(v) ← f alse; ph(v) ← i;
12: For each v ∈ V : state(v) ← active; Selection
13: for i = log n, (log n) − 1, . . . , 2, 1 do
14: Vi ← GranLeaderElection({v ∈ V |
15: ph(v) = i, state(v) = active}, 1/n); Vi – leaders
16: Each element v ∈ Vi sets state(v) ← leader and
17: transmits successfully using constant dilution (see Prop. 1);
18: Simultaneously, for each v ∈ V which can hear u ∈ box(v): state(v) ← passive.
the end of each execution of the leader election procedure, each leader chosen in
that execution transmits a message successfully — this can be done in a constant
number of rounds, by using d-dilution with appropriate constant d (c.f., Prop. 1).
In this way, each station receives the source message after O(DΔ log2 n) rounds.
(Note that there are at most Δ stations in a box of the pivotal grid.)
In the following, we describe the leader election algorithm — its pseudo-code
is presented as Algorithm 1. We are given a set of stations V of size at most
n. The set V is not known to stations, each station knows merely whether it
belongs to V or it does not belong to V . In the algorithm, we use (N, e)-ssf S of
size s = O(log N ), where e = (2d + 1)2 and d is the constant depending merely
on the parameters of the model, the same as in Section 2.1 (see also Prop. 2).
Let Xv , for a given execution of S be the set of stations which belong to box(v)
and v can hear them during that execution.
The following proposition combines properties of ssf with Prop. 2.
Proposition 3. For each α > 2 and ε > 0, there exists a constant k satisfying
the following property. Let W be a 3-diluted (wrt the pivotal grid) set of stations
and let C be a box of the pivotal grid. If minu,v∈C∩W = x ≤ r/n and dist(u, v) =
x for some u, v ∈ W such that box(u) = box(v) = C, then v can hear the message
from u during an execution of a (N, k)-ssf on W .
The leader election algorithm consists of two stages. The first stage gradually
eliminates elements from the set of candidates for the leaders of boxes in con-
secutive executions of the ssf S in the first for loop. Therefore, we call this stage
Elimination. Let phase l of Elimination stage denote the executions of S for
i = l. Each station v “eliminated” in phase l has assigned the value ph(v) = l.
Let V (l) = {v | ph(v) > l} and VC (l) = {v | ph(v) > l and box(v) = C} for l ∈ N
640 T. Jurdzinski, D.R. Kowalski, and G. Stachowiak
and C being a box of the pivotal grid. That is, VC (l) is the set of stations from
C which are not eliminated until phase l. The key property of the sets VC (l) is
that |VC (l + 1)| ≤ |VC (l)|/2 and the granularity of VC (lC
) is smaller than n for
each box C and l ∈ N, where lC is the largest l ∈ N such that VC (l) is not empty.
such that either v was in state active or v belongs to the same box of the pivotal
grid as u. That is, let C be a box of the pivotal grid, let u ∈ C be in state
asleep at the beginning of Inter-Box-Bdcst. The only possibility that u receives
a message and it does not change its state from asleep to active at the end of
Inter-Box-Bdcst is that each message received by u is sent by a station v which
is in state asleep when it sends the message and v ∈ C.
The intended properties of an execution of Inter-Box-Bdcst are:
(I) For each box C of the pivotal grid, states of all stations in C are equal.
(P) The broadcast message is (successfully) sent from each box C containing
stations in state active to all stations located in boxes which are neighbors
of C.
The following proposition easily follows from the above stated properties.
Proposition 4. If (I) and (P) are satisfied, the source message is transmitted
to the whole network in O(D · T ) rounds, where T is the number of rounds in a
single execution of Inter-Box-Bdcst.
References
1. Avin, C., Emek, Y., Kantor, E., Lotker, Z., Peleg, D., Roditty, L.: Sinr dia-
grams: towards algorithmically usable sinr models of wireless networks. In: PODC,
pp. 200–209 (2009)
2. Clementi, A.E.F., Monti, A., Silvestri, R.: Selective families, superimposed codes,
and broadcasting on unknown radio networks. In: SODA, pp. 709–718 (2001)
3. Czumaj, A., Rytter, W.: Broadcasting algorithms in radio networks with unknown
topology. In: FOCS, pp. 492–501 (2003)
4. Dessmark, A., Pelc, A.: Broadcasting in geometric radio networks. J. Discrete Al-
gorithms 5(1), 187–201 (2007)
5. Emek, Y., Gasieniec, L., Kantor, E., Pelc, A., Peleg, D., Su, C.: Broadcasting in udg
radio networks with unknown topology. Distributed Computing 21(5), 331–351
(2009)
6. Emek, Y., Kantor, E., Peleg, D.: On the effect of the deployment setting on broad-
casting in euclidean radio networks. In: PODC, pp. 223–232 (2008)
7. Goldsmith, A.J., Wicker, S.B.: Design challenges for energy-constrained ad hoc
wireless networks. IEEE Wireless Communications 9(4), 8–27 (2002)
8. Goussevskaia, O., Moscibroda, T., Wattenhofer, R.: Local broadcasting in the phys-
ical interference model. In: DIALM-POMC, pp. 35–44 (2008)
9. Goussevskaia, O., Pignolet, Y.A., Wattenhofer, R.: Efficiency of wireless networks:
Approximation algorithms for the physical interference model. Foundations and
Trends in Networking 4(3), 313–420 (2010)
10. Hobbs, N., Wang, Y., Hua, Q.-S., Yu, D., Lau, F.C.M.: Deterministic distributed
data aggregation under the SINR model. In: Agrawal, M., Cooper, S.B., Li, A.
(eds.) TAMC 2012. LNCS, vol. 7287, pp. 385–399. Springer, Heidelberg (2012)
11. Jurdzinski, T., Kowalski, D.R.: Distributed backbone structure for algorithms in
the SINR model of wireless networks. In: Aguilera, M.K. (ed.) DISC 2012. LNCS,
vol. 7611, pp. 106–120. Springer, Heidelberg (2012)
12. Jurdzinski, T., Kowalski, D.R.: On the complexity of distributed broadcasting and
MDS construction in radio networks. In: Baldoni, R., Flocchini, P., Binoy, R. (eds.)
OPODIS 2012. LNCS, vol. 7702, pp. 209–223. Springer, Heidelberg (2012)
13. Jurdzinski, T., Kowalski, D.R., Stachowiak, G.: Distributed deterministic broad-
casting in wireless networks of weak devices under the sinr model. CoRR,
abs/1210.1804 (2012)
14. Jurdzinski, T., Kowalski, D.R., Stachowiak, G.: Distributed deterministic broad-
casting in uniform-power ad hoc wireless networks. CoRR, abs/1302.4059 (2013)
644 T. Jurdzinski, D.R. Kowalski, and G. Stachowiak
1 Introduction
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 645–656, 2013.
c Springer-Verlag Berlin Heidelberg 2013
646 H. Lipmaa and T. Toft
literature. They are required for tasks as diverse as auctions, data-mining, and
benchmarking. A prime example is the first real-world MPC execution [4], which
required both integer additions and GT tests.
In this paper, we introduce two new Eq tests and improve over state of the art
GT testing in the ABB model. The main focus is online efficiency, i.e., parties
may generate joint randomness in advance (e.g, while setting up an auction) to
increase efficiency once the inputs have been supplied (bids have been given).
2 Preliminaries
Encpk (β), where r ← ZM . (3) Alice computes Decsk (a) = r(α − x) + β, which is
equal to β when α = x. Clearly, this protocol is perfectly complete, and encryp-
tion, decryption, and exponent-arithmetic can be replaced by ABB operations.
If M is not a prime but has sufficiently large prime factors (like in the case of
existing additively homomorphic public-key cryptosystems), then the resulting
DIE protocol, proposed by Laur and Lipmaa in [9], is somewhat more compli-
cated. Let be the bitlength of β. Let T ← 2− ·M . Let spf (M ) be the smallest
prime factor of the plaintext group order M . We assume ≤ 12 log2 M + log2 ε,
where ε ≤ 2−80 is the hiding parameter. Here we assume that Bob knows the
public key and Alice knows the secret key and the parties use an additively ho-
momorphic public-key cryptosystem like the one by Paillier [14]. (1) Alice sends
q ← Encpk (α) to Bob. (2) If the ciphertext is invalid, Bob returns ⊥. Otherwise,
he returns a ← (q · Encpk (−x))r · Encpk (β + 2 · t), where r ← ZM and t ← ZT .
(3) Alice computes Decsk (a) mod 2 .
As shown in [9], this protocol is (1 − ε)-semisimulatable [12] (that is, game-
based computationally private against a malicious server, and simulation-based
statistically private against a malicious client) as long as 2−1 /spf (M ) is
bounded by ε. That is, if x = α then the distribution of U (ZM ) · (α − x) +
2 · U (ZT ) is ε-far from the√uniform distribution U (ZM ) on ZM . Since in the
case of Paillier, spf (M ) ≈ M , we need that − 1 − 12 · log2 M ≤ log2 ε or
< 12 · log2 M + log2 ε, as mentioned. The idea behind including the addi-
tional term 2 · t in the Laur-Lipmaa protocol is that if M is composite, then
Decpk ((q · Encpk (−x))U(ZM ) ) = U (ZM ) · (α − x) can be a random element of a
nontrivial subgroup of ZM and thus far from random in ZM ; adding 2 · U (ZT )
guarantees that the result is almost uniform in ZM .
Preprocessing:
[[r]]; [[r M −1 ]], . . . , [[r0 ]] ← RandBits()
([[R]], [[R−1 ]]) ← RandInv()
[[R]], [[R2 ]], . . . , [[R M ]] ← prefix× ([[R]], [[R]], . . . , [[R]])
Online:
[[m]] ← [[r]] + [[x]]
m . m
M −1
[[1 + H]] ← 1 + i=0 (mi + [[ri ]] − 2 · mi · [[ri ]])
[[mH ]] ← [[R−1 ]] · [[1 + H]]
mH mH
.
for i ← 0 to M do [[(1 + H)i ]] ← miH · [[Ri ]]
M
[[x =? 0]] ← i=0 αi · [[(1 + H) ]] = [[P M (H + 1)]]
i
Complexity. The preprocessing phase consists of generating [[r]] along with its
bits, [[ri−1 ]] as well as [[R]], [[R−1 ]], and [[Ri ]] for i ∈ {1, . . . , M }. Overall this
amounts to O(M ) work. Online, only 1 ABB-multiplication (to compute mH )
and 2 outputs are needed. Computing the Hamming distance and evaluating
PM are costless.
2
PM exists both when M is a prime or an RSA-modulus and the coefficients, αi , can
be computed using Lagrange interpolation. For technical reasons, the input to PM
must belong to Z∗M , this is ensured by adding 1.
3
Always the case since M is either a prime or the product of two large primes.
Secure Equality and GT Tests with Sublinear Online Complexity 651
Bounded Inputs. If the input is of bounded size, [[x]] < 2 , and 2+k+log n ; M
where k is a statistical security parameter, the following variation is possible:
Each party Pj inputs a uniformly random k-bit value, r(j) , and the n parties
jointly generate random bits, [[ri ]], using RandBit. The ABB then computes
n −1
[[r]] ← j=1 [[r(j) ]] · 2 + ( i=0 2i [[ri ]]). Here, r statistically masks x: m mod 2 is
uniformly random, while a single r(j) masks the ’th carrybit of the addition, x+
r, i.e., m/2 is statistically indistinguishable from a sum of uniformly random
k-bit values plus the ri of malicious parties. Testing equality between r mod 2
and m mod 2 is sufficient; note that this zero-test allows equality testing even
when the difference between the inputs is negative.
Theorem 1. Given two -bit values [[x]] and [[y]] stored in an n-party arith-
metic black-box for ZM augmented with a proof of boundedness, equality may
be computed with 2 outputs and 1 ABB-multiplication in the online phase and
O() operations overall. This is the case both when = M as well as when
2+k+log n ; M , where k is a statistical security parameter.
We utilize the DIE protocol in the ABB model to construct a statistically correct
zero test (and hence an equality test) in the presence of mutually incorruptible
parties, denoted Alice and Bob. Complexity linear in the correctness parameter,
κ, i.e., it is only useful when the input is of greater bitlength, say = 1000 and
κ = 80. For the sake of concreteness, we describe the case where M is composite.
The idea is to transform [[x]], x ∈ {0, 1}, to [[y]], where y = 0 when x = 0,
and y is (1 − ε)-close to uniformly random, for an exponentially small ε, when
x = 0. Note that here we use the security parameter κ as the bitlength in the
DIE protocol. (See Sect. 2 for the explanation of ε= 2κ−1 /spf (M ).) The value
y is then used to “mask” t · 2κ + β, i.e., disclose it when x = 0 and hide it
otherwise. The value revealed to Alice is always statistically close to uniformly
random, hence reducing it modulo 2κ and testing equality with β provides a zero
test with a probability of failure of 2−κ . Details are seen as Protocol 2, where eq
denotes the equality test from Sect. 3.1 but for κ-bit inputs. We focus on the case
when M is an RSA-modulus and limit the description to the two-party case. The
main benefit of this combined protocol is that by combining it with the equal-
ity test above replaces the O() offline computation/communication with O(κ)
offline computation/communication. As a drawback, it requires two mutually
incorruptible parties and has only has statistical (not perfect) correctness.
Preprocessing:
[[r]] ← RandElem() β ∈ Z2κ
β < 2κ ; t < T t ∈ ZT
Online:
[[m]] ← [[x]] · [[r]] + (2κ · [[t]] + [[β]])
m
m̃ = m mod 2κ < 2κ
[[x = 0]] ← eq(m̃, β)
m̃ < 2κ , but also that m̃ = m mod 2κ . This can be done by providing not
only m̃ = m mod 2κ < 2κ , but also m/2κ < M/2κ , and verifying that
m = m/2κ · 2κ + m̃ (e.g., by outputting the difference).
Privacy. A corrupt Bob receives no outputs from the ABB, hence simulation
is trivial: do nothing. For a corrupt Alice, note that the only value leaving the
ABB is m, hence this is the only possible information leak. Since Bob is honest,
t·2κ + β is chosen correctly, thus, no matter the value of x, m will be statistically
close to uniformly random – either due to Bob’s random choice or the addition
of x · r. Hence, simulation will consist of a uniformly random element.
if = 1 then return
( ) ( )
([[e1 ]], . . . , [[eSe ]]) ← eq( /2),preproc ;
for i ← 0 to − 1 do [[ri ]] ← RandBit
( ) /2−1 i
[[r⊥ ]] ← 2 [[ri ]];
( ) i=0 /2−1 i
[[r ]] ← i=0 2 [[ri+ /2 ]];
r (A, )
← Z2k r (B, )
← Z2k
r (A, )
< 2k r (B, )
< 2k
.
( ) ( )
[[R( ) ]] ← 2 ([[r (A, ) ]] + [[r (B, ) ]]) + 2 /2
[[r ]] + [[r⊥ ]]
( ) ( )
([[g1 ]], . . . , [[gSg ]]) ← gt( /2),log,preproc
ignore the /2 least significant ones; if they are equal then continue with the
/2 least significant ones. (This description is not correct, but provides sufficient
intuition at this point.)
m⊥ = m mod 2 /2 m⊥ = m mod 2 /2
m = %m/2 /2 & mod 2 /2
m = %m/2 /2 & mod 2 /2
( )
[[b]] ← eq(( /2)),online (m , [[r ]])
[[m̃]] ← [[b]]·(m⊥ − m ) + m
( ) ( ) ( )
[[r̃]] ← [[b]]·([[r⊥ ]] − [[r ]]) + [[r ]]
[[f ]] ← 1 − (gt( /2),log,online ([[m̃]], [[r̃]]))
( ) ( )
[[z mod 2 ]] ← ((m mod 2 ) − (2 /2 [[r ]] + [[r⊥ ]]) + 2 [[f ]]
return [[x ≥ y]] ← 2− ([[z]] − [[z mod 2 ]])
Theorem 4. Given two -bit values [[x]] and [[y]] stored in an n-party arithmetic
black-box for ZM augmented with a proof of boundedness, greater-than may be
computed with O(c · 1/c ) ABB operations in O(c) rounds in the online phase
when 2+k+log n ; M , where k is a security parameter.
eqDIE,(·) is much more efficient than the equality test used in [16]. Thus, com-
bining this with Toft’s original protocol4 improves practical efficiency and re-
duces the theoretical online complexity – O(log ) rounds and work online and5
O(log (κ+loglog )) ABB-operations overall. The constant-rounds protocol may
also be combined with eqDIE resulting in an O(c) rounds protocol with O(c·1/c )
work online and O(1/c (κ+ log )) work overall. We state the following theorems:
Theorem 5. Given two -bit values [[x]] and [[y]] stored in an n-party arithmetic
black-box for ZM augmented with a proof of boundedness, GT may be computed in
the presence of two mutually incorruptible parties with 4 log outputs and 3 log +
1 ABB-multiplications in the online phase and O(log (κ + loglog )) operations
overall when 2+k+log n ; M , where k is a statistical security parameter.
Theorem 6. Given two -bit values [[x]] and [[y]] stored in an n-party arithmetic
black-box for ZM augmented with a proof of boundedness, greater-than may be
computed in the presence of two mutually incorruptible parties with O(c · 1/c )
ABB-operations in O(c) rounds in the online phase and O(1/c (κ + log )) oper-
ations overall when 2+k+log n ; M , where k is a statistical security parameter.
References
1. Aiello, W., Ishai, Y., Reingold, O.: Priced Oblivious Transfer: How to Sell Digital
Goods. In: Pfitzmann, B. (ed.) EUROCRYPT 2001. LNCS, vol. 2045, pp. 119–135.
Springer, Heidelberg (2001)
2. Bar-Ilan, J., Beaver, D.: Non-Cryptographic Fault-Tolerant Computing in a Con-
stant Number of Rounds of Interaction. In: Rudnicki, P. (ed.) PODC 1989,
pp. 201–209. ACM Press (1989)
4
The key difference from Protocol 4 is that Bob selects r, while only Alice learns m.
5
We add loglog to κ to compensate for a non-constant number of equality tests.
656 H. Lipmaa and T. Toft
3. Ben-Or, M., Goldwasser, S., Wigderson, A.: Completeness Theorems for Non-
Cryptographic Fault-Tolerant Distributed Computation. In: STOC 1988, pp. 1–10.
ACM Press (1988)
4. Bogetoft, P., Christensen, D.L., Damgård, I., Geisler, M., Jakobsen, T., Krøigaard,
M., Nielsen, J.D., Nielsen, J.B., Nielsen, K., Pagter, J., Schwartzbach, M., Toft,
T.: Secure Multiparty Computation Goes Live. In: Dingledine, R., Golle, P. (eds.)
FC 2009. LNCS, vol. 5628, pp. 325–343. Springer, Heidelberg (2009)
5. Chaabouni, R., Lipmaa, H., Zhang, B.: A Non-interactive Range Proof with
Constant Communication. In: Keromytis, A.D. (ed.) FC 2012. LNCS, vol. 7397,
pp. 179–199. Springer, Heidelberg (2012)
6. Damgård, I.B., Fitzi, M., Kiltz, E., Nielsen, J.B., Toft, T.: Unconditionally Se-
cure Constant-Rounds Multi-party Computation for Equality, Comparison, Bits
and Exponentiation. In: Halevi, S., Rabin, T. (eds.) TCC 2006. LNCS, vol. 3876,
pp. 285–304. Springer, Heidelberg (2006)
7. Damgård, I.B., Nielsen, J.B.: Universally Composable Efficient Multiparty Com-
putation from Threshold Homomorphic Encryption. In: Boneh, D. (ed.) CRYPTO
2003. LNCS, vol. 2729, pp. 247–264. Springer, Heidelberg (2003)
8. Groth, J.: Short Pairing-Based Non-interactive Zero-Knowledge Arguments. In:
Abe, M. (ed.) ASIACRYPT 2010. LNCS, vol. 6477, pp. 321–340. Springer, Heidel-
berg (2010)
9. Laur, S., Lipmaa, H.: A New Protocol for Conditional Disclosure of Secrets and
Its Applications. In: Katz, J., Yung, M. (eds.) ACNS 2007. LNCS, vol. 4521,
pp. 207–225. Springer, Heidelberg (2007)
10. Lipmaa, H.: On Diophantine Complexity and Statistical Zero-Knowledge Argu-
ments. In: Laih, C.-S. (ed.) ASIACRYPT 2003. LNCS, vol. 2894, pp. 398–415.
Springer, Heidelberg (2003)
11. Lipmaa, H.: Progression-Free Sets and Sublinear Pairing-Based Non-Interactive
Zero-Knowledge Arguments. In: Cramer, R. (ed.) TCC 2012. LNCS, vol. 7194, pp.
169–189. Springer, Heidelberg (2012)
12. Naor, M., Pinkas, B.: Oblivious Transfer and Polynomial Evaluation. In: STOC
1999, pp. 245–254. ACM Press (1999)
13. Nishide, T., Ohta, K.: Multiparty Computation for Interval, Equality, and Com-
parison Without Bit-Decomposition Protocol. In: Okamoto, T., Wang, X. (eds.)
PKC 2007. LNCS, vol. 4450, pp. 343–360. Springer, Heidelberg (2007)
14. Paillier, P.: Public-Key Cryptosystems Based on Composite Degree Residuosity
Classes. In: Stern, J. (ed.) EUROCRYPT 1999. LNCS, vol. 1592, pp. 223–238.
Springer, Heidelberg (1999)
15. Thorbek, R.: Linear Integer Secret Sharing. Ph.D. thesis, Aarhus University (2009)
16. Toft, T.: Sub-linear, Secure Comparison with Two Non-colluding Parties. In: Cata-
lano, D., Fazio, N., Gennaro, R., Nicolosi, A. (eds.) PKC 2011. LNCS, vol. 6571,
pp. 174–191. Springer, Heidelberg (2011)
17. Toft, T.: Primitives and Applications for Multiparty Computation. Ph.D. thesis,
Aarhus University (2007)
18. Yu, C.H.: Sign Modules in Secure Arithmetic Circuits. Tech. Rep. 2011/539, IACR
(October 1, 2011), http://eprint.iacr.org/2011/539 (checked in February 2013)
Temporal Network Optimization
Subject to Connectivity Constraints
1 Introduction
A temporal (or dynamic) network is, loosely speaking, a network that changes
with time. This notion encloses a great variety of both modern and traditional
networks such as information and communication networks, social networks,
transportation networks, and several physical systems.
In this work, embarking from the foundational work of Kempe et al. [KKK00],
we consider discrete time, that is, we consider networks in which changes occur
at discrete moments in time, e.g. days. This choice is not only a very natural
Supported in part by (i) the project FOCUS implemented under the “ARISTEIA”
Action of the OP “Education and Lifelong Learning” and co-funded by the EU
(ESF) and Greek National Resources, (ii) the FET EU IP project MULTIPLEX
under contract no 317532, and (iii) the EPSRC Grant EP/G043434/1. Full version:
http://ru1.cti.gr/aigaion/?page=publication&kind=single&ID=977
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 657–668, 2013.
c Springer-Verlag Berlin Heidelberg 2013
658 G.B. Mertzios et al.
abstraction of many real systems but also gives to the resulting models a purely
combinatorial flavor. In particular, we consider those networks that can be de-
scribed via an underlying graph G and a labeling λ assigning to each edge of
G a (possibly empty) set of discrete labels. Note that this is a generalization of
the single-label-per-edge model used in [KKK00], as we allow many time-labels
to appear on an edge. These labels are drawn from the natural numbers and
indicate the discrete moments in time at which the corresponding connection is
available. For example, in the case of a communication network, availability of
a communication link at some time t may mean that a communication protocol
is allowed to transmit a data packet over that link at time t.
In this work, we initiate the study of the following fundamental network design
problem: “Given an underlying (di)graph G, assign labels to the edges of G so that
the resulting temporal graph λ(G) minimizes some parameter while satisfying some
connectivity property”. In particular, we consider two cost optimization parame-
ters for a given graph G. The first one, called temporality of G, measures the maxi-
mum number of labels that an edge of G has been assigned. The second one, called
temporal cost of G, measures the total number of labels that have been assigned
to all edges of G (i.e. if |λ(e)| denotes the number of labels assigned to edge e, we
are interested in e∈E |λ(e)|). Each of these two cost measures can be minimized
subject to some particular connectivity property P that the temporal graph λ(G)
has to satisfy. In this work, we consider two very basic connectivity properties. The
first one, that we call the all paths property, requires the temporal graph to pre-
serve every simple path of its underlying graph, where by “preserve a path of G”
we mean that the labeling should provide at least one strictly increasing sequence
of labels on the edges of that path (we also call such a path time-respecting).
For an illustration, consider a directed ring u1 , u2 , . . . , un . We want to deter-
mine the temporality of the ring subject to the all paths property, that is, we
want to find a labeling λ that preserves every simple path of the ring and at the
same time minimizes the maximum number of labels of an edge. Consider the
paths P1 = (u1 , . . . , un ) and P2 = (un−1 , un , u1 , u2 ). It is immediate to observe
that an increasing sequence of labels on the edges of path P1 implies a decreasing
pair of labels on edges (un−1 , un ) and (u1 , u2 ). On the other hand, path P2 uses
first (un−1 , un ) and then (u1 , u2 ) thus it requires an increasing pair of labels
on these edges. It follows that in order to preserve both P1 and P2 we have to
use a second label on at least one of these two edges, thus the temporality is at
least 2. Next, consider the labeling that assigns to each edge (ui , ui+1 ) the labels
{i, n + i}, where 1 ≤ i ≤ n and un+1 = u1 . It is not hard to see that this labeling
preserves all simple paths of the ring. Since the maximum number of labels that
it assigns to an edge is 2, we conclude that the temporality is also at most 2. In
summary, the temporality of preserving all simple paths of a directed ring is 2.
The other connectivity property that we define, called the reach property,
requires the temporal graph to preserve a path from node u to node v whenever
v is reachable from u in the underlying graph. Furthermore, the minimization
of each of our two cost measures can be affected by some problem-specific con-
straints on the labels that we are allowed to use. We consider here one of the
Temporal Network Optimization Subject to Connectivity Constraints 659
most natural constraints, namely an upper bound of the age of the constructed
labeling λ, where the age of a labeling λ is defined to be equal to the maximum
label of λ minus its minimum label plus 1. Now the goal is to minimize the cost
parameter, e.g. the temporality, satisfy the connectivity property, e.g. all paths,
and additionally guarantee that the age does not exceed some given natural k.
Returning to the ring example, it is not hard to see, that if we additionally re-
strict the age to be at most n − 1 then we can no longer preserve all paths of a
ring using at most 2 labels per edge. In fact, we must now necessarily use the
worst possible number of labels, i.e. n − 1 on every edge.
Minimizing such parameters may be crucial as, in most real networks, making
a connection available and maintaining its availability does not come for free. At
the same time, such a study is important from a purely graph-theoretic perspec-
tive as it gives some first insight into the structure of specific families of temporal
graphs (e.g. no temporal ring exists with fewer than n + 1 labels). Finally, we
believe that our results are a first step towards answering the following funda-
mental question: “To what extent can algorithmic and structural results of graph
theory be carried over to temporal graphs? ”. For example, is there an analogue
of Menger’s theorem for temporal graphs? One of the results of the present work
is an affirmative answer to the latter question.
1.2 Contribution
In Section 2, we formally define the model of temporal graphs under consid-
eration and provide all further necessary definitions. In Section 3, we give two
efficient algorithms for computing shortest time-respecting paths. Then in Sec-
tion 4 we present an analogue of Menger’s theorem which we prove valid for
arbitrary temporal graphs. In the full paper, we also apply our Menger’s ana-
logue to substantially simplify the proof of a recent result on distributed token
gathering. In Section 5, we formally define the temporality and temporal cost
optimization metrics for temporal graphs. In Section 5.1, we provide several up-
per and lower bounds for the temporality of some fundamental graph families
such as rings, directed acyclic graphs (DAGs), and trees, as well as an inter-
esting trade-off between the temporality and the age of rings. Furthermore, we
provide in Section 5.2 a generic method for computing a lower bound of the
temporality of an arbitrary graph w.r.t. the all paths property, and we illustrate
its usefulness in cliques and planar graphs. Finally, we consider in Section 5.3
the temporal cost of a digraph G w.r.t. the reach property, when additionally
the age of the resulting labeling λ(G) is restricted to be the smallest possible.
We prove that this problem is APX-hard. To prove our claim, we first prove
(which may be of interest in its own right) that the Max-XOR(3) problem is
APX-hard via a PTAS reduction from Max-XOR. In Max-XOR(3) problem, we
are given a 2-CNF formula φ, every literal of which appears in at most 3 clauses,
and we want to compute the greatest number of clauses of φ that can be simul-
taneously XOR-satisfied. Then we provide a PTAS reduction from Max-XOR(3)
to our temporal cost minimization problem. On the positive side, we provide
an (r(G)/n)-factor approximation algorithm for the latter problem, where r(G)
denotes the total number of reachabilities in G.
2 Preliminaries
Given a (di)graph G = (V, E), a labeling of G is a mapping λ : E → 2IN , that is,
a labeling assigns to each edge of G a (possibly empty) set of natural numbers,
called labels.
also denote by λmin = min{l ∈ λ(E)} the minimum label and by λmax = max{l ∈
λ(E)} the maximum label assigned by λ. We define the age of a temporal graph
λ(G) as α(λ) = λmax − λmin + 1. Note that in case λmin = 1 then we have
α(λ) = λmax . For every graph G we denote by LG the set of all possible labelings
λ of G. Furthermore, for every k ∈ N, we define LG,k = {λ ∈ LG : α(λ) ≤ k}.
For every time r ∈ IN, we define the rth instance of a temporal graph λ(G)
as the static graph λ(G, r) = (V, E(r)), where E(r) = {e ∈ E : r ∈ λ(e)} is the
(possibly empty) set of all edges of the underlying graph G that are assigned label
r by labeling λ. A temporal graph λ(G) may be also viewed as a sequence of static
graphs (G1 , G2 , . . . , Gα(λ) ), where Gi = λ(G, λmin + i − 1) for all 1 ≤ i ≤ α(λ).
Another, often convenient, representation of a temporal graph is the following.
Definition 2. The static expansion of a temporal graph λ(G) is a DAG H =
(S, A) defined as follows. If V = {u1 , u2 , . . . , un } then S = {uij : λmin − 1 ≤ i ≤
λmax , 1 ≤ j ≤ n} and A = {(u(i−1)j , uij ) : if j = j or (uj , uj ) ∈ E(i) for some
λmin ≤ i ≤ λmax }.
A journey (or time-respecting path) J of a temporal graph λ(G) is a path
(e1 , e2 , . . . , ek ) of the underlying graph G = (V, E), where ei ∈ E, together
with labels l1 < l2 < . . . < lk such that li ∈ λ(ei ) for all 1 ≤ i ≤ k. In words, a
journey is a path that uses strictly increasing edge-labels. If labeling λ defines
a journey on some path P of G then we also say that λ preserves P . A natural
notation for a journey is (e1 , l1 ), (e2 , l2 ), . . . , (ek , lk ) where each (ei , li ) is called
a time-edge. A (u, v)-journey J is called foremost from time t ∈ IN if l1 ≥ t and
lk is minimized. We say that a journey J leaves from node u (arrives at, resp.)
at time t if (u, v, t) ((v, u, t), resp.) is a time-edge of J. Two journeys are called
out-disjoint (in-disjoint, respectively) if they never leave from (arrive at, resp.)
the same node at the same time. If, in addition to the labeling λ, a positive
weight w(e) > 0 is assigned to every edge e ∈ E, then we get a weighted tempo-
ral graph. If this is the case, then a journey J is called shortest if it minimizes
the sum of the weights of its edges.
Throughout the text, unless otherwise stated, we denote by n the number
of nodes of (di)graphs and by d(G) the diameter of a (di)graph G, that is the
length of the longest shortest path between any two nodes of G. Finally, by δu
we denote the degree of a node u ∈ V (G) (in case of an undirected graph G).
3 Journey Problems
Theorem 1. Let λ(G) be a temporal graph, s ∈ V be a source node, and tstart
a time s.t. λmin ≤ tstart ≤ λmax . There is an algorithm that correctly computes
for all w ∈ V \{s} a foremost (s, w)-journey from time tstart . The running time
of the algorithm is O(nα3 (λ) + |λ|).
Theorem 2. Let λ(G) be a weighted temporal graph and let s, t ∈ V . Assume
also that |λ(e)| = 1 for all e ∈ E. Then, we can compute a shortest journey J
between
s and t in λ(G) (or report that no such journey exists) in O(m log m +
v∈V v ) = O(n ) time, where m = |E|.
2 3
δ
662 G.B. Mertzios et al.
In this section, we introduce (in Definition 3) the temporality and temporal cost
measures. These measures can be minimized subject to some particular connec-
tivity property P that the labeled graph λ(G) has to satisfy. For simplicity of
notation, we consider the connectivity property P as a subset of the set LG of all
possible labelings λ on the (di)graph G. Furthermore, the minimization of each
of these two cost measures can be affected by some problem-specific constraints
on the labels that we are allowed to use. We consider one of the most natural
constraints, namely an upper bound on the age of the constructed labeling.
Temporal Network Optimization Subject to Connectivity Constraints 663
Note that Definition 3 can be stated for an arbitrary property P of the labeled
graph λ(G) (e.g. some proper coloring-preserving property). Nevertheless, we
only consider here P to be a connectivity property of λ(G). In particular, we
investigate the following two connectivity properties P:
Lemma 1 implies that any upper bound on the temporality of preserving the
reachabilities of strongly connected digraphs can be used as an upper bound
on the temporality of preserving the reachabilities of general digraphs. An in-
teresting question is whether there is some bound on τ (G, reach) either for all
digraphs or for specific families of digraphs. By using Lemma 1, it can be proved
that indeed there is a very satisfactory generic upper bound.
Theorem 4. τ (G, reach) ≤ 2 for all digraphs G.
The following theorem states that an edge-kernel of size k needs at least k labels
on some edge(s).
this clause by (xi ∨ xj ), since (xi ∨ xj ) = (xi ∨ xj ) in XOR. Thus, we can assume
w.l.o.g. that every clause of φ is either of the form (xi ∨ xj ) or (xi ∨ xj ), i < j.
For every i = 1, 2, . . . , n we construct the graph Gφ,i of Figure 1. Note that
the diameter of Gφ,i is d(Gφ,i ) = 9 and the maximum length of a directed
cycle in Gφ,i is 2. In this figure, we call the induced subgraph of Gφ,i on the
13 vertices {sxi , ux1 i , . . . , ux6 i , v1xi , . . . , v6xi } the trunk of Gφ,i . Furthermore, for
every p ∈ {1, 2, 3}, we call the induced subgraph of Gφ,i on the 5 vertices
{ux7,p
i
, ux8,p
i xi
, v7,p xi
, v8,p , txp i , } the pth branch of Gφ,i . Finally, we call the edges ux6 i ux7,p i
xi xi
and v6 v7,p the transition edges of the pth branch of Gφ,i . Furthermore, for every
i = 1, 2, . . . , n, let ri ≤ 3 be the number of clauses in which variable xi appears
in φ. For every 1 ≤ p ≤ ri , we assign the pth appearance of the variable xi
(either as xi or as xi ) in a clause of φ to the pth branch of Gφ,i .
Consider now a clause α = (i ∨ j ) of φ, where i < j. Then, by our as-
sumptions on φ, it follows that i = xi and j ∈ {xj , xj }. Assume that the
literal i (resp. j ) of the clause α corresponds to the pth (resp. to the qth)
appearance of the variable xi (resp. xj ) in φ. Then we identify the vertices of
the pth branch of Gφ,i with the vertices of the qth branch of Gφ,j as follows.
If j = xj then we identify the vertices ux7,p i
, ux8,p
i xi
, v7,p xi
, v8,p , txp i with the vertices
xj xj xj xj xj
v7,q , v8,q , u7,q , u8,q , tq , respectively. Otherwise, if j = xj then we identify the
xj xj xj xj x
vertices ux7,p i
, ux8,p
i xi
, v7,p xi
, v8,p , txp i with the vertices u7,q , u8,q , v7,q , v8,q , tq j , respec-
tively. This completes the construction of the graph Gφ . Note that, similarly to
the graphs Gφ,i , 1 ≤ i ≤ n, the diameter of Gφ is d(Gφ ) = 9 and the maximum
length of a directed cycle in Gφ is 2. Furthermore, note that for each of the m
clauses of φ, one branch of a gadget Gφ,i coincides with one branch of a gadget
Gφ,j , where 1 ≤ i < j ≤ n, while every Gφ,i has three branches. Therefore Gφ
has exactly 3n − 2m branches which belong to only one gadget Gφ,i , and m
branches that belong to two gadgets Gφ,i , Gφ,j .
ux7,1
i
ux8,1
i
tx1 i
xi
v7,1 xi
v8,1
ux1 i ux2 i ux6 i ux7,2
i
ux8,2
i
...
Gi : s xi tx2 i
... xi
v1xi v2xi v6xi
xi
v7,2 v8,2
ux7,3
i ux8,3
i
tx3 i
xi xi
v7,3 v8,3
That is, assuming a PTAS for computing κ(G, reach, d(G)), we obtain a PTAS
for the Max-XOR(3) problem, which is a contradiction by Lemma 4. Therefore
computing κ(G, reach, d(G)) is APX-hard. Finally, notice that the constructed
graph Gφ has maximum length of a directed cycle at most 2. &
%
References
[AAD+ 06] Angluin, D., Aspnes, J., Diamadi, Z., Fischer, M.J., Peralta, R.: Compu-
tation in networks of passively mobile finite-state sensors. In: Distributed
Computing, pp. 235–253 (March 2006)
[AKL08] Avin, C., Koucký, M., Lotker, Z.: How to explore a fast-changing world
(Cover time of a simple random walk on evolving graphs). In: Aceto,
L., Damgård, I., Goldberg, L.A., Halldórsson, M.M., Ingólfsdóttir, A.,
Walukiewicz, I. (eds.) ICALP 2008, Part I. LNCS, vol. 5125, pp. 121–132.
Springer, Heidelberg (2008)
[Ber96] Berman, K.A.: Vulnerability of scheduled networks and a generalization of
Menger’s theorem. Networks 28(3), 125–134 (1996)
[CFQS12] Casteigts, A., Flocchini, P., Quattrociocchi, W., Santoro, N.: Time-varying
graphs and dynamic networks. IJPEDS 27(5), 387–408 (2012)
[CKS01] Creignou, N., Khanna, S., Sudan, M.: Complexity classifications of boolean
constraint satisfaction problems. SIAM Monographs on Discrete Mathe-
matics and Applications (2001)
[CMM+ 08] Clementi, A.E., Macci, C., Monti, A., Pasquale, F., Silvestri, R.: Flooding
time in edge-markovian dynamic graphs. In: Proc. of the 27th ACM Symp.
on Principles of Distributed Computing (PODC), pp. 213–222 (2008)
[FT98] Fleischer, L., Tardos, É.: Efficient continuous-time dynamic network flow
algorithms. Operations Research Letters 23(3), 71–80 (1998)
[GPPR01] Gavoille, C., Peleg, D., Pérennes, S., Raz, R.: Distance labeling in graphs.
In: Proc. of the 12th annual ACM-SIAM Symposium on Discrete Algo-
rithms (SODA), Philadelphia, PA, USA, pp. 210–219 (2001)
[KKK00] Kempe, D., Kleinberg, J., Kumar, A.: Connectivity and inference prob-
lems for temporal networks. In: Proceedings of the 32nd Annual ACM
Symposium on Theory of Computing (STOC), pp. 504–513 (2000)
[KKKP04] Katz, M., Katz, N.A., Korman, A., Peleg, D.: Labeling schemes for flow
and connectivity. SIAM Journal on Computing 34(1), 23–40 (2004)
[KLO10] Kuhn, F., Lynch, N., Oshman, R.: Distributed computation in dynamic
networks. In: Proceedings of the 42nd ACM Symposium on Theory of
Computing (STOC), pp. 513–522. ACM, New York (2010)
[KMSV99] Khanna, S., Motwani, R., Sudan, M., Vazirani, U.: On syntactic ver-
sus computational views of approximability. SIAM Journal on Comput-
ing 28(1), 64–191 (1999)
[MCS11a] Michail, O., Chatzigiannakis, I., Spirakis, P.G.: Mediated population pro-
tocols. Theoretical Computer Science 412(22), 2434–2450 (2011)
[MCS11b] Michail, O., Chatzigiannakis, I., Spirakis, P.G.: New Models for Popula-
tion Protocols. In: Lynch, N.A. (ed.) Synthesis Lectures on Distributed
Computing Theory. Morgan & Claypool (2011)
[MCS12] Michail, O., Chatzigiannakis, I., Spirakis, P.G.: Causality, influence, and
computation in possibly disconnected synchronous dynamic networks. In:
Baldoni, R., Flocchini, P., Binoy, R. (eds.) OPODIS 2012. LNCS, vol. 7702,
pp. 269–283. Springer, Heidelberg (2012)
[Sch02] Scheideler, C.: Models and techniques for communication in dynamic net-
works. In: Alt, H., Ferreira, A. (eds.) STACS 2002. LNCS, vol. 2285, pp.
27–49. Springer, Heidelberg (2002)
[XFJ03] Xuan, B., Ferreira, A., Jarry, A.: Computing shortest, fastest, and foremost
journeys in dynamic networks. International Journal of Foundations of
Computer Science 14(02), 267–285 (2003)
Strong Bounds for Evolution in Networks
Abstract. This work extends what is known so far for a basic model of
evolutionary antagonism in undirected networks (graphs). More specif-
ically, this work studies the generalized Moran process, as introduced
by Lieberman, Hauert, and Nowak [Nature, 433:312-316, 2005], where
the individuals of a population reside on the vertices of an undirected
connected graph. The initial population has a single mutant of a fitness
value r (typically r > 1), residing at some vertex v of the graph, while
every other vertex is initially occupied by an individual of fitness 1. At
every step of this process, an individual (i.e. vertex) is randomly chosen
for reproduction with probability proportional to its fitness, and then it
places a copy of itself on a random neighbor, thus replacing the individ-
ual that was residing there. The main quantity of interest is the fixation
probability, i.e. the probability that eventually the whole graph is occu-
pied by descendants of the mutant. In this work we concentrate on the
fixation probability when the mutant is initially on a specific vertex v,
thus refining the older notion of Lieberman et al. which studied the fix-
ation probability when the initial mutant is placed at a random vertex.
We then aim at finding graphs that have many “strong starts” (or many
“weak starts”) for the mutant. Thus we introduce a parameterized no-
tion of selective amplifiers (resp. selective suppressors) of evolution. We
prove the existence of strong selective amplifiers (i.e. for h(n) = Θ(n)
vertices v the fixation probability of v is at least 1 − c(r) n
for a func-
tion c(r) that depends only on r), and the existence of quite strong
selective suppressors. Regarding the traditional notion of fixation prob-
ability from a random start, we provide strong upper and lower bounds:
first we demonstrate the non-existence of “strong universal” amplifiers,
and second we prove the Thermal Theorem which states that for any
undirected graph, when the mutant starts at vertex v, the fixation prob-
ability at least (r − 1)/(r + degdeg v
). This theorem (which extends the
min
“Isothermal Theorem” of Lieberman et al. for regular graphs) implies
an almost tight lower bound for the usual notion of fixation probability.
Our proof techniques are original and are based on new domination ar-
guments which may be of general interest in Markov Processes that are
of the general birth-death type.
This work was partially supported by (i) the FET EU IP Project MULTIPLEX
(Contract no 317532), (ii) the ERC EU Grant ALGAME (Agreement no 321171),
and (iii) the EPSRC Grant EP/G043434/1. The full version of this paper is available
at http://arxiv.org/abs/1211.2384
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 669–680, 2013.
c Springer-Verlag Berlin Heidelberg 2013
670 G.B. Mertzios and P.G. Spirakis
1 Introduction
Population and evolutionary dynamics have been extensively studied [2, 6, 7, 15,
21, 24, 25], mainly on the assumption that the evolving population is homoge-
neous, i.e. it has no spatial structure. One of the main models in this area is the
Moran Process [19], where the initial population contains a single mutant with
fitness r > 0, with all other individuals having fitness 1. At every step of this
process, an individual is chosen for reproduction with probability proportional
to its fitness. This individual then replaces a second individual, which is chosen
uniformly at random, with a copy of itself. Such dynamics as the above have been
extensively studied also in the context of strategic interaction in evolutionary
game theory [11–14, 23].
In a recent article, Lieberman, Hauert, and Nowak [16] (see also [20]) in-
troduced a generalization of the Moran process, where the individuals of the
population are placed on the vertices of a connected graph (which is, in general,
directed) such that the edges of the graph determine competitive interaction. In
the generalized Moran process, the initial population again consists of a single
mutant of fitness r, placed on a vertex that is chosen uniformly at random, with
each other vertex occupied by a non-mutant of fitness 1. An individual is chosen
for reproduction exactly as in the standard Moran process, but now the second
individual to be replaced is chosen among its neighbors in the graph uniformly
at random (or according to some weights of the edges) [16, 20]. If the underly-
ing graph is the complete graph, then this process becomes the standard Moran
process on a homogeneous population [16, 20]. Several similar models describing
infections and particle interactions have been also studied in the past, including
the SIR and SIS epidemics [10, Chapter 21], the voter and antivoter models and
the exclusion process [1,9,17]. However such models do not consider the issue of
different fitness of the individuals.
The central question that emerges in the generalized Moran process is how the
population structure affects evolutionary dynamics [16, 20]. In the present work
we consider the generalized Moran process on arbitrary finite, undirected, and
connected graphs. On such graphs, the generalized Moran process terminates
almost surely, reaching either fixation of the graph (all vertices are occupied
by copies of the mutant) or extinction of the mutants (no copy of the mutant
remains). The fixation probability of a graph G for a mutant of fitness r, is the
probability that eventually fixation is reached when the mutant is initially placed
at a random vertex of G, and is denoted by fr (G). The fixation probability can,
in principle, be determined using standard Markov Chain techniques. But doing
so for a general graph on n vertices requires solving a linear system of 2n linear
equations. Such a task is not computationally feasible, even numerically. As a
result of this, most previous work on computing fixation probabilities in the
generalized Moran process was either restricted to graphs of small size [6] or
to graph classes which have a high degree of symmetry, reducing thus the size
of the corresponding linear system (e.g. paths, cycles, stars, and cliques [3–5]).
Experimental results on the fixation probability of random graphs derived from
grids can be found in [22].
Strong Bounds for Evolution in Networks 671
A recent result [8] shows how to construct fully polynomial randomized ap-
proximation schemes (FPRAS) for the probability of reaching fixation (when
r ≥ 1) or extinction (for all r > 0). The result of [8] uses a Monte Carlo es-
timator, i.e. it runs the generalized Moran process several times1 , while each
run terminates in polynomial time with high probability [8]. Note that improved
lower and upper bounds on the fixation probability immediately lead to a better
estimator here. Ontil now, the only known general bounds for the fixation proba-
bility on connected undirected graphs, are that fr (G) ≥ n1 and fr (G) ≤ 1 − n+r
1
.
Lieberman et al. [16, 20] proved the Isothermal Theorem, stating that (in the
case of undirected graphs) the fixation probability of a regular graph (i.e. of
a graph with overall the same vertex degree) is equal to that of the complete
graph (i.e. the homogeneous population of the standard Moran process), which
equals to (1 − 1r )/(1 − r1n ), where n is the size of the population. Intuitively,
in the Isothermal Theorem, every vertex of the graph has a temperature which
determines how often this vertex is being replaced by other individuals dur-
ing the generalized Moran process. The complete graph (or equivalently, any
regular graph) serves as a benchmark for measuring the fixation probability of
an arbitrary graph G: if fr (G) is larger (resp. smaller) than that of the com-
plete graph then G is called an amplifier (resp. a suppressor ) [16, 20]. Until
now only graphs with similar (i.e. a little larger or smaller) fixation probability
than regular graphs have been identified [3–5, 16, 18], while no class of strong
amplifiers/suppressors is known so far.
Our Contribution. The structure of the graph, on which the population re-
sides, plays a crucial role in the course of evolutionary dynamics. Human societies
or social networks are never homogeneous, while certain individuals in central po-
sitions may be more influential than others [20]. Motivated by this, we introduce
in this paper a new notion of measuring the success of an advantageous mutant
in a structured population, by counting the number of initial placements of the
mutant in a graph that guarantee fixation of the graph with large probability.
This provides a refinement of the notion of fixation probability. Specifically, we
do not any more consider the fixation probability as the probability of reaching
fixation when the mutant is placed at a random vertex, but we rather consider
the probability fr (v) of reaching fixation when a mutant with fitness r > 1 is
introduced at a specific vertex v of the graph; fr (v) is termed the fixation prob-
ability of vertex v. Using this notion, thefixation probability fr (G) of a graph
G = (V, E) with n vertices is fr (G) = n1 v∈V fr (v).
We aim in finding graphs that have many “strong starts” (or many “weak
starts”) of the mutant. Thus we introduce the notions of (h(n), g(n))-selective
amplifiers (resp. (h(n), g(n))-selective suppressors), which include those graphs
c(r)
with n vertices for which there exist at least h(n) vertices v with fr (v) ≥ 1 − g(n)
c(r)
(resp. fr (v) ≤ g(n) ) for an appropriate function c(r) of r. We contrast this new
1
For approximating the probability to reach fixation (resp. extinction), one needs a
number of runs which is about the inverse of the best known lower (resp. upper)
bound of the fixation probability.
672 G.B. Mertzios and P.G. Spirakis
fr (G) of any undirected graph G. The latter lower bound is almost tight, as it
implies that fr (G) ≥ r−1 r+1 for a regular graph G, while the Isothermal Theorem
implies that the fixation probability of a regular graph G tends to r−1 r as the size
of G increases. Note that our new upper/lower bounds for the fixation probability
lead to better time complexity of the FPRAS proposed in [8], as the Monte Carlo
technique proposed in [8] now needs to simulate the Moran process a less number
of times (to estimate fixation or extinction).
Our techniques are original and of a constructive combinatorics flavor.
For the class of strong selective amplifiers (the urchin graphs) we introduce
a novel decomposition of the Markov chain M of the generalized Moran pro-
cess into n − 1 smaller chains M1 , M2 , . . . , Mn−1 , and then we decompose each
Mk into two even smaller chains M1k , M2k . Then we exploit a new way of com-
posing these smaller chains (and returning to the original one) that is carefully
done to maintain the needed domination properties. For the proof of the lower
bound in the Thermal Theorem, we first introduce a new and simpler weighted
Strong Bounds for Evolution in Networks 673
process that bounds fixation probability from below (the generalized Moran pro-
cess is a special case of this new process). Then we add appropriate dummy states
to its (exponentially large) Markov chain, and finally we iteratively modify the
resulting chain by maintaining the needed monotonicity properties. Eventually
this results to the desired lower bound of the Thermal Theorem. Finally, our
proof for the non-existence of strong universal amplifiers is done by contradic-
tion, partitioning appropriately the vertex set of the graph and discovering an
appropriate independent set that leads to the contradiction.
2 Preliminaries
fr (S) =
r 1
xy∈E deg x + deg y
3 Amplifier Bounds
In this section we prove that there exist no strong universal amplifiers (Sec-
tion 3.1), although there exists a class of strong selective amplifiers (Section 3.2).
k k k
x i i
Gn : n-clique Qki,x : i Pi : Pi :
Fig. 1. (a) The “urchin” graph Gn . Furthermore, the state (b) Qki,x and the state Pik ,
where (c) i ≤ k, and (d) i > k.
Note by Corollary 2 that, in order to compute a lower bound for the fixation
probability fr (v) of a nose v of the graph Gn , we can assume that, whenever we
have k infected noses and i infected clique vertices, we are at state Pik . That is,
in the Markov chain of the generalized Moran process, we replace any transition
to a state Qki,x with a transition to state Pk+i−xk
. Denote this relaxed Markov
chain by M; we will compute a lower bound of the fixation probability of state
P01 in the Markov chain M (cf. Theorem 2).
In order to analyze M, we decompose it first into the n − 1 smaller Markov
chains M1 , M2 , . . . , Mn−1 , as follows. For every k ∈ {1, 2, . . . , n−1}, the Markov
chain Mk captures all transitions of M between states with k infected noses. We
denote by Fk−1 (resp. Fk+1 ) an arbitrary state with k − 1 (resp. k + 1) infected
noses. Moreover, we consider Fk−1 and Fk+1 as absorbing states of Mk . Since we
want to compute a lower bound of the fixation probability, whenever we arrive
at state Fk+1 (resp. at state Fk−1 ), we assume that we have the smallest number
of infected clique vertices with k + 1 (resp. with k − 1) infected noses. That is,
whenever Mk reaches state Fk+1 , we assume that M has reached state Pk+1 k+1
(and thus we move to the Markov chain Mk+1 ). Similarly, whenever Mk reaches
state Fk−1 , we assume that M has reached state P0k−1 (and thus we move to
the Markov chain Mk−1 ).
(resp. to state Fk−1 ) is equal to hk (resp. 1 − hk ), while all other transition prob-
k k
abilities between two states in M2k are the same as the corresponding transition
probabilities in Mk .
(resp. P0k−1 ) is skk (resp. 1 − skk ). Recall that skk is the probability that, starting
at Pkk in M2 (and thus also in M), we reach state Fk+1 before we reach Fk−1 .
Furthermore, the transition probability from state P0k to state Pkk is equal to the
Strong Bounds for Evolution in Networks 677
probability that, starting at P0k in M1 , we reach Pkk before we reach Fk−1 . Note
that this probability is larger than hk0 . Therefore, in order to compute a lower
bound of the fixation probability of a nose in Gn , we can assume that in M the
transition probability from state P0k to Pkk (resp. P0k−1 ) is hk0 (resp. 1 − hk0 ).
Note that for every k ∈ {2, . . . , n − 1} the infected vertices of state P0k is a
strict subset of the infected vertices of state Pkk . Therefore, in order to compute
a lower bound of the fixation probability of state P01 in M, we can relax M by
k−1
changing every transition from state Pk−1 to state Pkk to a transition from state
Pk−1 to state P0 , where k ∈ {2, . . . , n − 1}. After eliminating the states Pkk in
k−1 k
Theorem 2. For any r > 5 and for sufficiently large n, the fixation probability
p1 of state P01 in Bn is p1 ≥ 1 − c(r)
n , for some appropriate function c(r) of r.
4 Suppressor Bounds
In this section we prove our lower bound for the fixation probability of an ar-
bitrary undirected graph, namely the Thermal Theorem (Section 4.1), which
generalizes the analysis of the fixation probability of regular graphs [16]. Fur-
√
thermore we present for every function φ(n), where φ(n) = ω(1) and φ(n) ≤ n,
n n
a class of ( φ(n)+1 , φ(n) )-selective suppressors in Section 4.2.
Consider a graph G = (V, E) and a fitness value r > 1. Denote by Mr (G) the
generalized Moran process on G with fitness r. Then, for every subset S ∈ / {∅, V }
of its vertices, the fixation probability fr (S) of S in Mr (G) is given by (1),
where fr (∅) = 0 and fr (V ) = 1. That is, the fixation probabilities fr (S), where
S∈ / {∅, V }, are the solution of the linear system (1) with boundary conditions
fr (∅) = 0 and fr (V ) = 1.
Suppose that at some iteration of the generalized Moran process the set S
of vertices are infected and that the edge xy ∈ E (where x ∈ S and y ∈ / S)
is activated, i.e. either x infects y or y disinfects x. Then (1) implies that the
1
probability that x infects y is higher if deg x is large; similarly, the probability
1
that y disinfects x is higher if deg y is large. Therefore, in a fashion similar
to [16], we call for every vertex v ∈ V the quantity deg 1
v the temperature of v: a
“hot” vertex (i.e. with high temperature) affects more often its neighbors than
678 G.B. Mertzios and P.G. Spirakis
a “cold” vertex (i.e. with low temperature). It follows now by (1) that for every
set S ∈
/ {∅, V } there exists at least one pair x(S), y(S) of vertices with x(S) ∈ S,
y(S) ∈/ S, and x(S)y(S) ∈ E such that
r
deg x(S) fr (S + y(S)) + 1
deg y(S) fr (S − x(S))
fr (S) ≥ r 1 (2)
deg x(S) + deg y(S)
Thus, solving the linear system that is obtained from (2) by replacing inequalities
with equalities, we obtain a lower bound for the fixation probabilities fr (S),
where S ∈ / {∅, V }. In the next definition we introduce a weighted generalization
of this linear system, which is a crucial tool for our analysis in obtaining the
Thermal Theorem.
Before we provide the Thermal Theorem (Theorem 4), we first prove an auxiliary
result in the next lemma which generalizes the Isothermal Theorem of [16] for
regular graphs, i.e. for graphs with the same number of neighbors for every
vertex.
We are now ready to provide our main result in this section which provides a
lower bound for the fixation probability on arbitrary graphs, parameterized by
the maximum ratio between two different temperatures in the graph.
Strong Bounds for Evolution in Networks 679
The lower bound for the fixation probability in Theorem 4 is almost tight. Indeed,
if a graph G = (V, E) with n vertices is regular, i.e. if deg u = deg v for every
1− 1
u, v ∈ V , then fr (G) = 1− r1n by Lemma 3 (cf. also the Isothermal Theorem
r
in [16]), and thus fr (G) ∼
= r−1
r for large enough n. On the other hand, Theorem 4
implies for a regular graph G that fr (G) ≥ r−1
r+1 .
In this section we present for every function φ(n), where φ(n) = ω(1) and φ(n) ≤
√
n, the class Gφ(n) = {Gφ(n),n : n ≥ 1} of ( φ(n)+1 n n
, φ(n) )-selective suppressors.
We call these graphs φ(n)-urchin graphs, since for φ(n) = 1 they coincide with
the class of urchin graphs in Section 3.2. For every n, the graph Gφ(n),n =
(Vφ(n),n , Eφ(n),n ) has n vertices. Its vertex set Vφ(n),n can be partitioned into two
φ(n)
1
sets Vφ(n),n 2
and Vφ(n),n , where |Vφ(n),n
1
| = φ(n)+1
n
and |Vφ(n),n
2
| = φ(n)+1 n, such
1 2
that Vφ(n),n induces a clique and Vφ(n),n induces an independent set in Gφ(n),n .
Furthermore, every vertex u ∈ Vφ(n),n 2 1
has φ(n) neighbors in Vφ(n),n , and every
vertex v ∈ Vφ(n),n has φ (n) neighbors in Vφ(n),n . Therefore deg v = n+φ2 (n)−1
1 2 2
References
1. Aldous, D., Fill, J.: Reversible Markov Chains and Random Walks on Graphs.
Monograph in preparation,
http://www.stat.berkeley.edu/aldous/RWG/book.html
2. Antal, T., Scheuring, I.: Fixation of strategies for an evolutionary game in finite
populations. Bulletin of Math. Biology 68, 1923–1944 (2006)
3. Broom, M., Hadjichrysanthou, C., Rychtar, J.: Evolutionary games on graphs
and the speed of the evolutionary process. Proceedings of the Royal Society
A 466(2117), 1327–1346 (2010)
4. Broom, M., Hadjichrysanthou, C., Rychtar, J.: Two results on evolutionary
processes on general non-directed graphs. Proceedings of the Royal Society
A 466(2121), 2795–2798 (2010)
5. Broom, M., Rychtar, J.: An analysis of the fixation probability of a mutant on spe-
cial classes of non-directed graphs. Proceedings of the Royal Society A 464(2098),
2609–2627 (2008)
6. Broom, M., Rychtar, J., Stadler, B.: Evolutionary dynamics on small order graphs.
Journal of Interdisciplinary Mathematics 12, 129–140 (2009)
680 G.B. Mertzios and P.G. Spirakis
7. Sasaki, A., Taylor, C., Fudenberg, D., Nowak, M.A.: Evolutionary game dynamics
in finite populations. Bulletin of Math. Biology 66(6), 1621–1644 (2004)
8. Diáz, J., Goldberg, L., Mertzios, G., Richerby, D., Serna, M., Spirakis, P.: Approx-
imating fixation probabilities in the generalized moran process. In: Proceedings of
the ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 954–960 (2012)
9. Durrett, R.: Lecture notes on particle systems and percolation. Wadsworth Pub-
lishing Company (1988)
10. Easley, D., Kleinberg, J.: Networks, Crowds, and Markets: Reasoning about a
Highly Connected World. Cambridge University Press (2010)
11. Gintis, H.: Game theory evolving: A problem-centered introduction to modeling
strategic interaction. Princeton University Press (2000)
12. Hofbauer, J., Sigmund, K.: Evolutionary Games and Population Dynamics. Cam-
bridge University Press (1998)
13. Imhof, L.A.: The long-run behavior of the stochastic replicator dynamics. Annals
of applied probability 15(1B), 1019–1045 (2005)
14. Kandori, M., Mailath, G.J., Rob, R.: Learning, mutation, and long run equilibria
in games. Econometrica 61(1), 29–56 (1993)
15. Karlin, S., Taylor, H.: A First Course in Stochastic Processes, 2nd edn. Academic
Press, NY (1975)
16. Lieberman, E., Hauert, C., Nowak, M.A.: Evolutionary dynamics on graphs. Na-
ture 433, 312–316 (2005)
17. Liggett, T.M.: Interacting Particle Systems. Springer (1985)
18. Mertzios, G.B., Nikoletseas, S., Raptopoulos, C., Spirakis, P.G.: Natural models for
evolution on networks. In: Chen, N., Elkind, E., Koutsoupias, E. (eds.) Internet and
Network Economics. LNCS, vol. 7090, pp. 290–301. Springer, Heidelberg (2011)
19. Moran, P.A.P.: Random processes in genetics. Proceedings of the Cambridge Philo-
sophical Society 54, 60–71 (1958)
20. Nowak, M.A.: Evolutionary Dynamics: Exploring the Equations of Life. Harvard
University Press (2006)
21. Ohtsuki, H., Nowak, M.A.: Evolutionary games on cycles. Proceedings of the Royal
Society B: Biological Sciences 273, 2249–2256 (2006)
22. Rychtář, J., Stadler, B.: Evolutionary dynamics on small-world networks. Interna-
tional Journal of Computational and Mathematical Sciences 2(1), 1–4 (2008)
23. Sandholm, W.H.: Population games and evolutionary dynamics. MIT Press (2011)
24. Taylor, C., Iwasa, Y., Nowak, M.A.: A symmetry of fixation times in evoultionary
dynamics. Journal of Theoretical Biology 243(2), 245–251 (2006)
25. Traulsen, A., Hauert, C.: Stochastic evolutionary game dynamics. In: Reviews of
Nonlinear Dynamics and Complexity, vol. 2. Wiley, NY (2008)
Fast Distributed Coloring Algorithms
for Triangle-Free Graphs
University of Michigan
1 Introduction
F.V. Fomin et al. (Eds.): ICALP 2013, Part II, LNCS 7966, pp. 681–693, 2013.
c Springer-Verlag Berlin Heidelberg 2013
682 S. Pettie and H.-H. Su
round some property is guaranteed to hold with some small non-zero probability.
Kim [18] proved that in any girth-5 graph G, χ(G) ≤ (1 + o(1)) lnΔΔ . This bound
is optimal to within a factor-2 under any lower bound on girth. (Constructions
of Kostochka and Masurova [19] and Bollobás [7] show that there is a graph G of
Δ
arbitrarily large girth and χ(G) > 2 ln Δ .) Building on [18], Johansson (see [23])
Δ
proved that χ(G) = O( ln Δ ) for any triangle-free (girth-4) graph G.1 In relatively
recent work Jamall [14] proved that the chromatic number of triangle-free graphs
is at most (67 + o(1)) lnΔΔ .
√ log n
min eO( ln ln n) , Δ + log∗ n · (k + log∗ Δ) ·
= log1+o(1) n
Δ1− ln Δ −
4k
The first time bound comes from an O(k + log∗ Δ)-round procedure, each round
of which succeeds with probability 1 − 1/ poly(n). However, as Δ decreases the
probability of failure tends to 1. To enforce that each step succeeds with high
1
We are not aware of any extant copy of Johansson’s manuscript. It is often cited as
a DIMACS Technical Report, though no such report exists. Molloy and Reed [23]
reproduced a variant of Johansson’s proof showing that χ(G) ≤ 160 lnΔΔ for triangle-
free G.
2
In short, vertices host processors which operate is synchronized rounds; vertices can
communicate one arbitrarily large message across each edge in each round; local
computation is free; time is measured by the number of rounds.
3
They claimed that their algorithm could also be extended to triangle-free graphs.
Jamall [15] pointed out a flaw in their argument.
Fast Distributed Coloring Algorithms for Triangle-Free Graphs 683
probability we use a version of the Local Lemma algorithm of Moser and Tar-
dos [24] optimized for the parameters of our problem.4
By choosing k = ln Δ/(4 + ) and = /(2(4 + )), we obtain new bounds on
the chromatic number of triangle-free graphs.
Corollary 1. For any > 0 and Δ sufficiently large (as a function of ), χ(G) ≤
(4 + ) lnΔΔ . Consequently, the chromatic number of triangle-free graphs is (4 +
o(1)) lnΔΔ , where the o(1) is a function of Δ.
Our result also extends to girth-5 graphs with Δ1− ln Δ − replaced by Δ1− ln Δ − ,
4k k
which allows us to (1 + )Δ/ ln Δ-color such graphs. Our algorithm can clearly
be applied to trees (girth ∞). Elkin [11] noted that with Bollobás’s construc-
tion [7], Linial’s lower bound [22] on coloring trees can be strengthened to show
that it is impossible to o(Δ/ ln Δ)-color a tree in o(logΔ n) time. We prove that
it is possible to (1 + o(1))Δ/ ln Δ-color a tree in O(log Δ + logΔ log n) time.
Also, we√ show that (Δ + 1)-coloring for triangle-free graphs can be obtained in
exp(O( log log n)) time.
Technical Overview. In the iterated approaches of [12, 14, 18, 23] each vertex u
maintains a palette, which consists of the colors that have not been selected by
its neighbors. To obtain a t-coloring, each palette consists of colors {1, . . . , t}
initially. In each round, each u tries to assign itself a color (or colors) from
its palette, using randomization to resolve the conflicts between itself and the
neighbors. The c-degree of u is defined to be the number of its neighbors whose
palettes contain c. In Kim’s algorithm [18] for girth-5 graphs, the properties
maintained for each round are that the c-degrees are upper bounded and the
palette sizes are lower bounded. In girth-5 graphs the neighborhoods of the
neighbors of u only intersect at u and therefore have a negligible influence on each
other, that is, whether c remains in one neighbor’s palette has little influence
on a different neighbor of u. Due to this independence one can bound the c-
degree after an iteration using standard concentration inequalities. In triangle-
free graphs, however, there is no guarantee of independence. If two neighbors
of u have identical neighborhoods, then after one iteration they will either both
keep or both lose c from their palettes. In other words, the c-degree of u is
a random variable that may not have any significant concentration around its
mean. Rather than bound c-degrees, Johansson [23] bounded the entropy of the
remaining palettes so that each color is picked nearly uniformly in each round.
Jamall [14] claimed that although each c-degree does not concentrate, the average
c-degree (over each c in the palette) does concentrate. Moreover, it suffices to
consider only those colors within a constant factor of the average in subsequent
iterations.
Our (Δ/k)-coloring algorithm performs the same coloring procedure in each
round, though the behavior of the algorithm has two qualitatively distinct phases.
4
Note that for many reasonable parameters (e.g., k = O(1), Δ = log1−δ n), the run-
ning time is sublogarithmic.
684 S. Pettie and H.-H. Su
In the first O(k) rounds the c-degrees, palette sizes, and probability of remain-
ing uncolored are very well behaved. Once the available palette is close to the
number of uncolored neighbors the probability of remaining uncolored begins
to decrease drastically in each successive round, and after O(log∗ n) rounds all
vertices are colored, w.h.p.
Our analysis is similar to that of Jamall [14] in that we focus on bounding the
average of the c-degrees. However, our proof needs to take a different approach,
for two reasons. First, to obtain an efficient distributed algorithm we need to
obtain a tighter bound on the probability of failure in the last O(log∗ n) rounds,
where the c-degrees shrink faster than a constant factor per round. Second, there
is a small flaw in Jamall’s application of Azuma’s inequality in Lemma 12 in [14],
the corresponding Lemma 17 in [15], and the corresponding lemmas in [16]. It
is probably possible to correct the flaw, though we manage to circumvent this
difficulty altogether. See the full version for a discussion of this issue.
The second phase presents different challenges. The natural way to bound
c-degrees using Chernoff-type inequalities gives error probabilities that are ex-
ponential in the c-degree, which is fine if it is Ω(log n) but becomes too large
as the c-degrees are reduced in each coloring round. At a certain threshold we
switch to a different analysis (along the lines of Schneider and Wattenhofer [30])
that allows us to bound c-degrees with high probability in the palette size, which,
again, is fine if it is Ω(log n).
In both phases, if we cannot obtain small error probabilities (via concentration
inequalities and a union bound) we revert to a distributed implementation of
the Moser-Tardos Lovász Local Lemma algorithm [24]. We show that for certain
parameters the symmetric LLL can be made to run in sublogarithmic time.
For the extensions to trees and the (Δ + 1)-coloring algorithm for triangle-free
graphs, we adopt the ideas from [5,6,29] to reduce the graph into several smaller
components and color each of them separately by deterministic algorithms [4,25],
which will run faster as the size of each subproblem is smaller.
Organization. Section 2 presents the general framework for the analysis. Sec-
tion 3 describes the algorithms and discusses what parameters to plug into the
framework. Section 4 describes the extension to graphs of girth 5, trees, and the
(Δ + 1)-coloring algorithm for triangle-free graphs.
2 The Framework
Every vertex maintains a palette that consists of all colors not previously chosen
by its neighbors. The coloring is performed in rounds, where each vertex chooses
zero or more colors in each round. Let Gi be the graph induced by the uncolored
vertices after round i, so G = G0 . Let Ni (u) be u’s neighbors in Gi and let Pi (u)
be its palette after round i. The c-neighbors Ni,c (u) consist of those v ∈ Ni (u)
with c ∈ Pi (v). Call |Ni (u)| the degree of u and |Ni,c (u)| the c-degree of u after
round i. This notation is extended to sets of vertices in a natural way, e.g.,
Ni (Ni (u)) is the set of neighbors of neighbors of u in Gi .
Fast Distributed Coloring Algorithms for Triangle-Free Graphs 685
Algorithm 1. Select(u, πi , βi )
repeat
Round i = 1, 2, 3, . . . .
for each u ∈ Gi−1 do
(Si (u), Ki (u)) ← Select(u, πi , βi )
Set Pi (u) ← Ki (u) \ Si (Ni−1 (u))
if Si (u) ∩ Pi (u) = ∅ then color u with any color in Si (u) ∩ Pi (u) end if
(Variant A) Pi (u) ← {c ∈ Pi (u) | |Ni,c (u)| ≤ 2ti }
(Variant B) Pi (u) ← Pi (u)
end for
Gi ← Gi−1 \ {colored vertices}
until the termination condition occurs
2.1 Analysis A
Given {πi }, p0 , t0 , and δ, the parameters for Variant A are derived below.
i−1
/2)pi
βi = (1 − πi )2ti−1 αi = (1 − πi )(1−(1+δ)
pi = βi pi−1 ti = max(αi βi ti−1 , T ) (1)
pi = (1 − δ/8) pi
i
ti i
= (1 + δ) ti
Let us take a brief tour of the parameters. The sampling probability πi will be
inversely proportional to ti−1 , the ideal c-degree at end of round i − 1. (The
exact expression for πi depends on .) Since we filter out colors with more
than twice the ideal c-degree, the probability that a color is not selected by
any neighbor is at least (1 − πi )2ti−1 = βi . Note that since πi = Θ(1/ti−1 ) we
have βi = Θ(1). Thus, we can force all colors to be retained in the palette with
probability precisely βi , making the ideal palette size pi = βi pi−1 . Remember
that a c-neighbor stays a c-neighbor if it remains uncolored and it does not
remove c from its palette. The latter event happens with probability βi . We use
αi as an upper bound on the probability that a vertex remains uncolored, so the
ideal c-degree should be ti = αi βi ti−1 . To account for deviations from the ideal
we let pi and ti be approximate versions of pi and ti , defined in terms of a small
error control parameter δ > 0. Furthermore, certain high probability bounds will
fail to hold if ti becomes too small, so we will not let it go below a threshold T .
When the graph has girth 5, the concentration bounds allow us to show that
|Pi (u)| ≥ pi and |Ni,c (u)| ≤ ti with certain probabilities. As pointed out by
Jamall [14,15], |Ni,c (u)| does not concentrate
in triangle-free graphs. He showed
that the average c-degree, ni (u) = c∈Pi (u) |Ni,c (u)|/|Pi (u)|, concentrates and
will be bounded above by ti with a certain probability. Since ni (u) concentrates,
it is possible to bound the fraction of colors filtered for having c-degrees larger
than 2ti .
Let λi (u) = min(1, |Pi (u)|/pi ). Since Pi (u) is supposed to be at least pi , if
we do not filter out colors, 1 − λi (u) can be viewed as the fraction that has
been filtered. In the following we state an induction hypotheses equivalent to
Jamall’s [14].
Di (u) ≤ ti , where Di (u) = λi (u)ni (u) + (1 − λi (u))2ti
Di (u) can be interpreted as the average of the c-degrees of Pi (u) with pi −|Pi (u)|
dummy colors whose c-degrees are exactly 2ti . Notice that Di (u) ≤ ti also implies
1 − λi (u) ≤ (1 + δ)i /2, because (1 − λi (u))2ti ≤ Di (u) ≤ ti . Therefore:
|Pi (u)| ≥ (1 − (1 + δ)i /2)pi
Recall Pi (u) is the palette consisting of colors c for which |Ni,c (u)| ≤ 2ti .
The main theorem for this section shows the inductive hypothesis holds with
a certain probability. See the full version for the proof.
Theorem 2. Suppose that Di−1 (x) ≤ ti−1 for all x ∈ Gi−1 , then for a given u ∈
2
Gi−1 , Di (u) ≤ ti holds with probability at least 1−Δe−Ω(δ T ) −(Δ2 +2)e−Ω(δ pi ) .
2
Fast Distributed Coloring Algorithms for Triangle-Free Graphs 687
2.2 Analysis B
Analysis A has a limitation for smaller c-degrees, since the probability guarantee
becomes smaller as ti goes down. Therefore, Analysis A only works well for
ti ≥ T , where T is a threshold for certain probability guarantees. For example,
if we want Theorem 2 to hold with high probability in n, then we must have
T < log n.
To get a good probability guarantee below T , we will use an idea by Schneider
and Wattenhofer [30]. They took advantage of the trials done for each color inside
the palette, rather than just considering the trials on whether each neighbor is
colored or not. We demonstrate this idea in the proof of Theorem 3 in the full
version. The probability guarantee in the analysis will not depend on the current
c-degree but on the initial c-degree and the current palette size.
The parameters for Variant B are chosen based on an initial lower bound on
the palette size p0 , upper bound on the c-degree t0 , and error control parameter
δ. The selection probability is chosen to be πi = 1/(ti−1 + 1) and the probability
a color remains in a palette βi = (1 − πi )ti−1 . The ideal palette size and its
relaxation are pi = βi pi−1 and pi = (1 − δ)i pi , and the ideal c-degree ti =
max(αi ti−1 , 1). One can show the probability of remaining uncolored is upper
bounded by αi = 5t0 /pi ,
Let Ei (u) denote the event that |Pi (u)| ≥ pi and |Ni,c (u)| < ti for all c ∈
Pi (u). Although a vertex could lose its c-neighbor if the c-neighbor becomes
colored or loses c in its palette, in this analysis, we only use the former to
bound its c-degree. Also, if Ei−1 (u) is true, then Pr(c ∈ / Si (Ni−1 (u))) > βi for
all c ∈ Pi−1 (u). Thus in Select(u, πi , βi ), we will not ignore any colors in the
palette. Each color remains in the palette with probability exactly βi .
The following theorem shows the inductive hypothesis holds with a certain
probability. See the full version for the proof.
Theorem 3. If Ei−1 (x) holds for all x ∈ Gi−1 , then for a given u ∈ Gi−1 ,
2
Ei (u) holds with probability at least 1 − Δe−Ω(t0 ) − (Δ2 + 1)e−Ω(δ pi )
Let si = ti /pi be the ratio between the ideal c-degree and the ideal palette size.
Initially, s0 = k and si = αi si−1 ≤ si−1 e−(1−o(1))(C/si−1 ) . Initially, si decreases
roughly linearly by C for each round until the ratio si ≈ C is a constant. Then,
si decreases rapidly in the order of iterated exponentiation. Therefore, it takes
roughly O(k + log∗ Δ) rounds to reach the terminating condition where ti ≤ T .
Our goal is to show upon reaching the terminating condition, the palette size
bound pi is greater than T by some amount, in particular, pi ≥ 30e3/ Δ2 . See
the full version for the proof of the following Lemma.
Thus, if the induction hypothesis Di (u) ≤ ti holds for every u ∈ Gi for every round
i during this phase, we will have |Pi (u)| ≥ (1 − (1 + δ)i /2)pi ≥ 10e3/ Δ2 for all
u ∈ Gi and |Ni,c (u)| ≤ 2ti < Δ1 for all u ∈ Gi and all c ∈ Pi (u) in the end.
i 3
Now since αi ≤ Δ− /3 , after 3
rounds, ti ≤ t0 j=1 αj ≤ Δ Δ− /3 ≤ 1.
The c-degree bound, t /3 , becomes 1. Recall that the induction hypothesis Ei (u)
is the event that |Pi (u)| ≥ pi and |Ni,c (u)| < ti . If Ei (u) holds for every u ∈ Gi
for every round i during this phase, then in the end, every uncolored vertex has
no c-neighbors, as implied by |Ni,c (u)| < ti ≤ 1. This means these vertices can
be colored with anything in their palettes, which are non-empty.
Since T = Δ1 /3, t0 = Δ1 , pi ≥ Δ2 , Pr(A(u)) ≤ p for large enough Δ.
If Δ1− ln Δ − > c log n, then p < 1/nc . By the union bound over all u ∈ Gi−1 ,
4k
the probability that any of the A(u) fails is at most 1/nc−1 . The induction
hypothesis holds for all u ∈ Gi ⊆ Gi−1 with high probability. In this case,
O(k + log∗ Δ) rounds suffice, because each round succeeds with high probability.
On the other hand, if Δ1− ln Δ − < c log n, then we apply Moser and Tardos’
4k
resampling algorithm to make A(u) simultaneously hold for all u with high
probability. At round i, the bad event A(u) depends on the random variables
which are generated by Select(v, πi , βi ) for v within distance 2 in Gi−1 . Therefore,
the dependency graph G≤4 i−1 consists of edges (u, v) such that distGi−1 (u, v) ≤ 4.
Each event A(u) shares variables with at most d < Δ4 other events. The Lovász
Local Lemma [1] implies that if ep(d + 1) ≤ 1, then the probability that all A(u)
simultaneously hold is guaranteed to be non-zero. Moser and Tardos showed
how to boost this probability by resampling. In each round of resampling, their
algorithm finds an MIS I in the dependency graph induced by the set of bad
events B and then resamples the random variables that I depends on. In our
case, it corresponds to finding an MIS I in G≤4 i−1 [B], where B = {u ∈ Gi−1 |
A(u) fails}. Then, we redo Select(v, πi , βi ) for v ∈ G within distance 2 from I to
resample the random variables that I depends on. By plugging in the parameters
for the symmetric case, their proof shows if ep(d+1) ≤ 1−, then the probability
any of the bad events occur after t rounds of resampling is at most (1 − )t n/d.
1
Thus, O(log n/ log( 1− )) rounds will be sufficient for all A(u) to hold with high
5
probability in n.
5
In the statement of Theorem 1.3 in [24], they used 1/ as an approximation for
1
log( 1− ). However, this difference can be significant in our case, when 1 − is very
small.
690 S. Pettie and H.-H. Su
1− 4k −
As shown in previous sections, p ≤ e−Δ ln Δ
/(eΔ4 ). We can let 1 − =
4k
−Δ1− ln Δ −
. Therefore, O(log n/Δ1− ln Δ − ) resampling rounds
4k
ep(d + 1) ≤ e
will√be sufficient. Also, an MIS can be found in O(Δ + log∗ n) time [3, 20], or
eO( log log n) since Δ ≤ (c log n)1/(1− ln Δ − ) ≤ (c log n)1/ ≤ logO(1) n [5]. Each
4k
of the O(k+log∗ Δ) rounds is delayed by O(log n/Δ1− ln Δ − ) resampling rounds,
4k
which are futher delayed by the rounds needed to find an MIS. Therefore, the
total number of rounds is
log n
O (k + log∗ Δ) ·
· min exp O log log n , Δ + log ∗
n
Δ1− ln Δ −
4k
4 Extensions
4.1 Graphs of Girth at Least 5
For graphs of girth at least 5, existential results [18, 23] show that there exists
(1 + o(1))Δ/ ln Δ-coloring. We state a matching algorithmic result. The proof
will be included in the full version.
Theorem 4. Fix a constant > 0. Let Δ be the maximum degree of a girth-
5 graph G, assumed to be at least some Δ depending on . Let k ≥ 1 be
a parameter such that 2 ≤ 1 − lnkΔ . Then G can be (Δ/k)-colored, in time
O(k + log∗ Δ) if Δ1− ln Δ − = Ω(ln n), and, for any Δ, in time on the order of
k
√ log n
min eO( ln ln n) , Δ + log∗ n · (k + log∗ Δ) ·
= log1+o(1) n
Δ1− ln Δ −
k
4.2 Trees
Trees are graphs of infinity girth. According to Theorem 4, it is possible to get a
(Δ/k)-coloring in O(k + log∗ Δ) time if Δ1− ln Δ − = Ω(log n). If Δ1− ln Δ − =
k k
O(log n), we will show that using additional O(q) colors, it is possible to get a
√
(Δ/k + O(q))-coloring in O k + log∗ n + logloglogq n time. By choosing q = Δ,
we can find a (1 + o(1))Δ/ ln Δ-coloring in O(log Δ + logΔ log n) rounds.
The algorithm is the same with the framework, except that at the end of each
round we delete the bad vertices, which are the vertices that fail to satisfy the
induction hypothesis. The remaining vertices must satisfy the induction hypoth-
esis, and then we will continue the next round on these vertices. Using the idea
from [5,6,29], we can show that after O(k + log∗ Δ) rounds of the algorithm,
the
size of each component formed by the bad vertices is at most O Δ4 log n with
high probability. See the full version for the proof.
Barenboim and Elkin’s deterministic algorithm [4] obtains O(q)-coloring in
∗
O log n
log q + log n time for trees (arboricity = 1). We then apply their algorithm
Fast Distributed Coloring Algorithms for Triangle-Free Graphs 691
on each component formed by bad vertices. Since the size of each component
is at most O(Δ4 log n), their algorithm will run in O log loglog
n+log Δ
q + log∗ n
time,
using the additional O(q) colors. Note that this running time is actually
O logloglogq n + log∗ n , since Δ = logO(1) n.
5 Conclusion
The time bounds of Theorem 1 show an interesting discontinuity. When Δ is
large we can cap the error at 1/ poly(n) by using standard concentration in-
equalities and a union bound. When Δ is small we can use the Moser-Tardos
LLL algorithm to reduce the failure probability again to 1/ poly(n). Thus, the
distributed complexity of our coloring algorithm is tied to the distributed com-
plexity of the constructive Lovász Local Lemma.
We showed that χ(G) ≤ (4 + o(1))Δ/ ln Δ for triangle-free graphs G. It would
be interesting to see if it is possible to reduce the palette size to (1+o(1))Δ/ ln Δ,
matching Kim’s [18] bound for girth-5 graphs.
Alon et al. [2] and Vu [32] extended Johansson’s result [23] for triangle-free
graphs to obtain an O(Δ/ log f )-coloring for locally sparse graphs (the latter
also works for list coloring), in which no neighborhood of any vertex spans more
than Δ2 /f edges. It would be interesting to extend our result to locally sparse
graphs and other sparse graph classes.
References
1. Alon, N., Spencer, J.H.: The Probabilistic Method. Wiley Series in Discrete Math-
ematics and Optimization. Wiley (2011)
2. Alon, N., Krivelevich, M., Sudakov, B.: Coloring graphs with sparse neighborhoods.
Journal of Combinatorial Theory, Series B 77(1), 73–82 (1999)
692 S. Pettie and H.-H. Su
28. Reed, B., Sudakov, B.: Asymptotically the list colouring constants are 1. J. Comb.
Theory Ser. B 86(1), 27–37 (2002)
29. Rubinfeld, R., Tamir, G., Vardi, S., Xie, N.: Fast local computation algorithms. In:
ICS 2011, pp. 223–238 (2011)
30. Schneider, J., Wattenhofer, R.: A new technique for distributed symmetry break-
ing. In: PODC 2010, pp. 257–266. ACM, New York (2010)
31. Vizing, V.G.: Some unsolved problems in graph theory. Uspekhi Mat.
Nauk 23(6(144)), 117–134 (1968)
32. Van Vu, H.: A general upper bound on the list chromatic number of locally sparse
graphs. Comb. Probab. Comput. 11(1), 103–111 (2002)
Author Index