Abstract
We propose a SSReflect library for logic programming in the Datalog setting. As part of this work, we give a first mechanization of standard Datalog and of its extension with stratified negation. The library contains a formalization of the model theoretical and fixpoint semantics of the languages, implemented through bottom-up and, respectively, through stratified evaluation procedures. We provide corresponding soundness, termination, completeness and model minimality proofs. To this end, we rely on the Coq proof assistant and SSReflect. In this context, we also construct a preliminary framework for dealing with stratified programs. We consider this to be a necessary first step towards the certification of security-aware data-centric applications.
This work was supported by the Datacert project (ANR-15-CE39-0009) of the French ANR.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
Arithmetic predicates and skolem functions destroy this guarantee.
- 2.
- 3.
Term sequences \(t_{1},\ldots ,t_{n}\) are abbreviated as \(\vec {t}\) and \(|\vec {t} |= n\) denotes their length.
- 4.
We call language constructs that are variable-free, ground and, otherwise, open.
- 5.
The set of program constants is also called its active domain, denoted adom(P).
- 6.
Also called clause instantiation.
- 7.
\(\sqcup \) denotes the pairwise disjoint set union.
- 8.
A program can have multiple stratifications.
- 9.
As proven by Apt et al. [3], \(M_n\) is independent from the choice of stratification.
- 10.
By abuse of notation, we use the same \(\omega \) for the different numbers of \(T_P\) iterations needed to reach a fixpoint, when evaluating each program slice.
- 11.
Since Datalog does not have function symbols and interpretations are ground, we can restrict substitution codomains to the set of program constants, w.l.o.g.
- 12.
Groundings can be coerced to substitutions and substitutions can be lifted to groundings, by padding with a default element def.
- 13.
We establish corresponding reflexivity, antisymmetry and transitivity properties.
- 14.
We use the boolean quantifier, as the ordinal type of variables is finite.
- 15.
gr_atom_def lifts substitutions to groundings, by padding with the def constant.
- 16.
Thanks to using the bigcup operator from the SSReflect bigop library.
- 17.
We state this as the fwd_chainP reflection lemma.
- 18.
“Positive” interpretations are sets of ground atoms with a true flag.
- 19.
This corresponds to the set of all “positive” ground atoms.
- 20.
This is the top element of interp cf. Sect. 3.1.
- 21.
The dashed encodep arrow marks the partiality of the cancellation lemma.
- 22.
i.e, \(\mathrm {str}_\le \) stratifies \(\mathrm {p}_{\mathrm {str}_\le }\) and \(\mathrm {str}_>\) stratifies \(\mathrm {p}_{\mathrm {str}_>}\).
- 23.
References
Barceló, P., Pichler, R. (eds.): Datalog in Academia and Industry. LNCS, vol. 7494. Springer, Heidelberg (2012)
Abiteboul, S., Hull, R., Vianu, V.: Foundations of Databases. Addison-Wesley, Boston (1995)
Apt, K.R., Blair, H.A., Walker, A.: Foundations of Deductive Databases and Logic Programming. Morgan Kaufmann Publishers Inc., San Francisco (1988)
Aref, M., ten Cate, B., Green, T.J., Kimelfeld, B., Olteanu, D., Pasalic, E., Veldhuizen, T.L., Washburn, G.: Design and implementation of the LogicBlox system. In: SIGMOD ACM Proceedings of ICMD, pp. 1371–1382 (2015)
Bagan, G., Bonifati, A., Ciucanu, R., Fletcher, G.H.L., Lemay, A., Advokaat, N.: gMark: schema-driven generation of graphs and queries. IEEE TKDE 29, 856–869 (2017)
Calì, A., Gottlob, G., Lukasiewicz, T.: Datalog\({\pm }\): a unified approach to ontologies and integrity constraints. In: Fagin, R. (ed.) ACM Proceedings of ICDT, vol. 361, pp. 14–30 (2009)
Ceri, S., Gottlob, G., Tanca, L.: Logic Programming and Databases. Springer, Heidelberg (1990)
Chin, B., von Dincklage, D., Ercegovac, V., Hawkins, P., Miller, M.S., Och, F.J., Olston, C., Pereira, F.: Yedalog: exploring knowledge at scale. In: Ball, T., Bodk, R., Krishnamurthi, S., Lerner, B.S., Morrisett, G. (eds.) LIPIcs Proceedings of SNAPL, vol. 32, pp. 63–78 (2015)
Datomic. http://www.datomic.com/
DeTreville, J.: Binder, a logic-based security language. In: IEEE Proceedings of the Symposium on Security and Privacy, Washington, DC, USA, pp. 105–115. IEEE Computer Society (2002)
Doczkal, C., Smolka, G.: Completeness and decidability results for CTL in Coq. In: Klein, G., Gamboa, R. (eds.) ITP 2014. LNCS, vol. 8558, pp. 226–241. Springer, Cham (2014). doi:10.1007/978-3-319-08970-6_15
Exeura. http://www.exeura.com/
Gonthier, G.: Point-free, set-free concrete linear algebra. In: van Eekelen, M., Geuvers, H., Schmaltz, J., Wiedijk, F. (eds.) ITP 2011. LNCS, vol. 6898, pp. 103–118. Springer, Heidelberg (2011). doi:10.1007/978-3-642-22863-6_10
Gonthier, G., et al.: A machine-checked proof of the odd order theorem. In: Blazy, S., Paulin-Mohring, C., Pichardie, D. (eds.) ITP 2013. LNCS, vol. 7998, pp. 163–179. Springer, Heidelberg (2013). doi:10.1007/978-3-642-39634-2_14
Gonthier, G., Mahboubi, A., Tassi, E.: A small scale reflection extension for the Coq system (2016). https://hal.inria.fr/inria-00258384
Gottlob, G., Koch, C., Baumgartner, R., Herzog, M., Flesca, S.: The lixto data extraction project: back and forth between theory and practice. In: ACM SIGMOD-SIGACT-SIGART Proceedings of PODS, pp. 1–12. ACM, New York (2004)
Grumbach, S., Wang, F.: Netlog, a rule-based language for distributed programming. In: Carro, M., Peña, R. (eds.) PADL 2010. LNCS, vol. 5937, pp. 88–103. Springer, Heidelberg (2010). doi:10.1007/978-3-642-11503-5_9
Hellerstein, J.M.: The declarative imperative: experiences and conjectures in distributed logic. ACM SIGMOD Rec. J. 39(1), 5–19 (2010)
Huang, S.S., Green, T.J., Loo, B.T.: Datalog and emerging applications: an interactive tutorial. In: ACM SIGMOD Proceedings of ICMD, pp. 1213–1216 (2011)
Kriener, J., King, A., Blazy, S.: Proofs you can believe in: proving equivalences between prolog semantics in Coq. In: ACM Proceedings of PPDP, pp. 37–48 (2013)
Libkin, L.: The finite model theory toolbox of a database theoretician. In: ACM SIGMOD-SIGACT-SIGART Proceedings of PODS, pp. 65–76 (2009)
Lloyd, J.W.: Foundations of Logic Programming. Springer, Heidelberg (1987)
LogicBlox. http://www.logicblox.com/
Loo, B.T., Condie, T., Hellerstein, J.M., Maniatis, P., Roscoe, T., Stoica, I.: Implementing declarative overlays. In: ACM Proceedings of SOSP, pp. 75–90 (2005)
Lu, L., Cleary, J.G.: An operational semantics of starlog. In: Nadathur, G. (ed.) PPDP 1999. LNCS, vol. 1702, pp. 294–310. Springer, Heidelberg (1999). doi:10.1007/10704567_18
Luteberget, B., Johansen, C., Feyling, C., Steffen, M.: Rule-based incremental verification tools applied to railway designs and regulations. In: Fitzgerald, J., Heitmeyer, C., Gnesi, S., Philippou, A. (eds.) FM 2016. LNCS, vol. 9995, pp. 772–778. Springer, Cham (2016). doi:10.1007/978-3-319-48989-6_49
The Coq Development Team: The Coq Proof Assistant. Reference Manual (2016). https://coq.inria.fr/refman/. Version 8.6
Ramakrishnan, R., Ullman, J.D.: A survey of research on deductive database systems. J. Log. Program. 23(2), 125–149 (1993)
Semmle. https://semmle.com/
Seo, J., Park, J., Shin, J., Lam, M.S.: Distributed socialite: a datalog-based language for large-scale graph analysis. Proc. VLDB Endow. 6, 1906–1917 (2013)
Tarski, A.: A lattice-theoretical fixpoint theorem and its applications. Pac. J. Math. 5(2), 285–309 (1955)
Van Emden, M.H., Kowalski, R.A.: The semantics of predicate logic as a programming language. J. ACM 23(4), 733–742 (1976)
Vardi, M.Y.: The complexity of relational query languages. In: ACM Proceedings of STOC, pp. 137–146 (1982)
Whaley, J., Avots, D., Carbin, M., Lam, M.S.: Using datalog with binary decision diagrams for program analysis. In: Yi, K. (ed.) APLAS 2005. LNCS, vol. 3780, pp. 97–118. Springer, Heidelberg (2005). doi:10.1007/11575467_8
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2017 Springer International Publishing AG
About this paper
Cite this paper
Benzaken, V., Contejean, É., Dumbrava, S. (2017). Certifying Standard and Stratified Datalog Inference Engines in SSReflect. In: Ayala-Rincón, M., Muñoz, C.A. (eds) Interactive Theorem Proving. ITP 2017. Lecture Notes in Computer Science(), vol 10499. Springer, Cham. https://doi.org/10.1007/978-3-319-66107-0_12
Download citation
DOI: https://doi.org/10.1007/978-3-319-66107-0_12
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-66106-3
Online ISBN: 978-3-319-66107-0
eBook Packages: Computer ScienceComputer Science (R0)