Datalog-Expressibility for Monadic and Guarded Second-Order Logic

We characterise the sentences in Monadic Second-order Logic (MSO) that are over finite structures equivalent to a Datalog program, in terms of an existential pebble game. We also show that for every class C of finite structures that can be expressed in MSO and is closed under homomorphisms, and for all integers l,k, there exists a *canonical* Datalog program Pi of width (l,k), that is, a Datalog program of width (l,k) which is sound for C (i.e., Pi only derives the goal predicate on a finite structure A if A is in C) and with the property that Pi derives the goal predicate whenever *some* Datalog program of width (l,k) which is sound for C derives the goal predicate. The same characterisations also hold for Guarded Second-order Logic (GSO), which properly extends MSO. To prove our results, we show that every class C in GSO whose complement is closed under homomorphisms is a finite union of constraint satisfaction problems (CSPs) of countably categorical structures.

[1]  Anuj Dawar,et al.  Affine Systems of Equations and Counting Infinitary Logic , 2007, ICALP.

[2]  Phokion G. Kolaitis,et al.  Constraint Satisfaction, Bounded Treewidth, and Finite-Variable Logics , 2002, CP.

[3]  Sebastian Rudolph,et al.  On Logics and Homomorphism Closure , 2021, 2021 36th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS).

[4]  Johan van Benthem,et al.  Modal Languages and Bounded Fragments of Predicate Logic , 1998, J. Philos. Log..

[5]  Phokion G. Kolaitis,et al.  On the expressive power of datalog: tools and a case study , 1990, J. Comput. Syst. Sci..

[6]  Tomás Feder,et al.  The Computational Structure of Monotone Monadic SNP and Constraint Satisfaction: A Study through Datalog and Group Theory , 1999, SIAM J. Comput..

[7]  Hossein Hojjat Monadic Second Order Logic , 2010 .

[8]  Sebastian Rudolph,et al.  Reasonable Highly Expressive Query Languages - IJCAI-15 Distinguished Paper (Honorary Mention) , 2015, IJCAI.

[9]  Manuel Bodirsky,et al.  Datalog and constraint satisfaction with infinite templates , 2006, J. Comput. Syst. Sci..

[10]  Andrei A. Bulatov,et al.  A Dichotomy Theorem for Nonuniform CSPs , 2017, 2017 IEEE 58th Annual Symposium on Foundations of Computer Science (FOCS).

[11]  Sebastian Rudolph,et al.  Flag & check: data access with monadically defined queries , 2013, PODS '13.

[12]  Gregory Cherlin,et al.  Two Problems on Homogeneous Structures, Revisited , 2009, AMS-ASL Joint Special Session.

[13]  Michael Elberfeld,et al.  Where First-Order and Monadic Second-Order Logic Coincide , 2012, 2012 27th Annual IEEE Symposium on Logic in Computer Science.

[14]  Manuel Bodirsky,et al.  Non-dichotomies in Constraint Satisfaction Complexity , 2008, ICALP.

[15]  Erich Grädel Description Logics and Guarded Fragments of First Order Logic , 1998, Description Logics.

[16]  Martin Otto,et al.  Back and forth between guarded and modal logics , 2002, TOCL.

[17]  Leonid Libkin,et al.  Elements of Finite Model Theory , 2004, Texts in Theoretical Computer Science.

[18]  Michael Pinsker,et al.  PROJECTIVE CLONE HOMOMORPHISMS , 2014, The Journal of Symbolic Logic.

[19]  Barnaby Martin,et al.  On the Scope of the Universal-Algebraic Approach to Constraint Satisfaction , 2010, 2010 25th Annual IEEE Symposium on Logic in Computer Science.

[20]  Samuel Braunfeld,et al.  Towards the undecidability of atomicity for permutation classes via the undecidability of joint embedding for hereditary graph classes , 2019, 1903.11932.

[21]  Libor Barto,et al.  Constraint Satisfaction Problems Solvable by Local Consistency Methods , 2014, JACM.

[22]  Bruno Courcelle,et al.  Graph Structure and Monadic Second-Order Logic - A Language-Theoretic Approach , 2012, Encyclopedia of mathematics and its applications.

[23]  Christoph Berkholz Lower Bounds for Existential Pebble Games and k-Consistency Tests , 2012, 2012 27th Annual IEEE Symposium on Logic in Computer Science.

[24]  Manuel Bodirsky,et al.  Complexity of Infinite-Domain Constraint Satisfaction , 2021 .

[25]  J. Engelfriet,et al.  Graph Structure and Monadic Second-Order Logic: Monadic second-order logic , 2012 .

[26]  Wilfrid Hodges,et al.  A Shorter Model Theory , 1997 .

[27]  M. Bodirsky,et al.  Temporal Constraint Satisfaction Problems in Fixed-Point Logic , 2020, LICS.

[28]  Dmitriy Zhuk,et al.  A Proof of CSP Dichotomy Conjecture , 2017, 2017 IEEE 58th Annual Symposium on Foundations of Computer Science (FOCS).