skip to main content
10.1145/3241653.3241655acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
research-article

Parser combinators for context-free path querying

Published: 17 September 2018 Publication History

Abstract

Transparent integration of a domain-specific language for specification of context-free path queries (CFPQs) into a general-purpose programming language as well as static checking of errors in queries may greatly simplify the development of applications using CFPQs. LINQ and ORM can be used for the integration, but they have issues with flexibility: query decomposition and reusing of subqueries are a challenge. Adaptation of parser combinators technique for paths querying may solve these problems. Conventional parser combinators process linear input, and only the Trails library is known to apply this technique for path querying. Trails suffers the common parser combinators issue: it does not support left-recursive grammars and also experiences problems in cycles handling. We demonstrate that it is possible to create general parser combinators for CFPQ which support arbitrary context-free grammars and arbitrary input graphs. We implement a library of such parser combinators and show that it is applicable for realistic tasks.

References

[1]
Pablo Barceló, Gaelle Fontaine, and Anthony Widjaja Lin. 2013. Expressive Path Queries on Graphs with Data. In International Conference on Logic for Programming Artificial Intelligence and Reasoning. Springer, 71-85.
[2]
Osbert Bastani, Saswat Anand, and Alex Aiken. 2015. Specification inference using context-free language reachability. In ACM SIGPLAN Notices, Vol. 50. ACM, 553-566.
[3]
Tevfik Bultan, Fang Yu, Muath Alkhalaf, and Abdulbaki Aydin. 2018. String Analysis for Software Verification and Security.
[4]
James Cheney, Sam Lindley, and Philip Wadler. 2013. A Practical Theory of Language-integrated Query. SIGPLAN Not. 48, 9 (Sept. 2013), 403-416.
[5]
Andrei Marian Dan, Manu Sridharan, Satish Chandra, Jean-Baptiste Jeannin, and Martin Vechev. 2017. Finding Fix Locations for CFL-Reachability Analyses via Minimum Cuts. In International Conference on Computer Aided Verification. Springer, 521-541.
[6]
Semyon Grigorev and Anastasiya Ragozina. 2017. Context-free Path Querying with Structural Representation of Result. In Proceedings of the 13th Central & Eastern European Software Engineering Conference in Russia (CEE-SECR '17). ACM, New York, NY, USA, Article 10, 7 pages.
[7]
Jelle Hellings. 2014. Conjunctive context-free path queries. (2014).
[8]
Jelle Hellings. 2015. Path Results for Context-free Grammar Queries on Graphs. CoRR abs/1502.02242 (2015). http://arxiv.org/abs/1502.02242
[9]
Wei Huang, Yao Dong, Ana Milanova, and Julian Dolby. 2015. Scalable and precise taint analysis for android. In Proceedings of the 2015 International Symposium on Software Testing and Analysis. ACM, 106-117.
[10]
Anastasia Izmaylova, Ali Afroozeh, and Tijs van der Storm. 2016. Practical, General Parser Combinators. In Proceedings of the 2016 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation (PEPM '16). ACM, New York, NY, USA, 1-12.
[11]
Mark Johnson. 1995. Memoization in Top-down Parsing. Comput. Linguist. 21, 3 (Sept. 1995), 405-417. http://dl.acm.org/citation.cfm?id=216261.216269
[12]
Daniel Kröni and Raphael Schweizer. 2013. Parsing Graphs: Applying Parser Combinators to Graph Traversals. In Proceedings of the 4th Workshop on Scala (SCALA '13). ACM, New York, NY, USA, Article 7, 4 pages.
[13]
Kazumasa Kumamoto, Toshiyuki Amagasa, and Hiroyuki Kitagawa. 2015. A System for Querying RDF Data Using LINQ. In Network-Based Information Systems (NBiS), 2015 18th International Conference on. IEEE, 452-457.
[14]
Thomas J. Marlowe, William G. Landi, Barbara G. Ryder, Jong-Deok Choi, Michael G. Burke, and Paul Carini. 1993. Pointer-induced Aliasing: A Clarification. SIGPLAN Not. 28, 9 (Sept. 1993), 67-70.
[15]
Erik Meijer, Brian Beckman, and Gavin Bierman. 2006. LINQ: Reconciling Object, Relations and XML in the.NET Framework. In Proceedings of the 2006 ACM SIGMOD International Conference on Management of Data (SIGMOD '06). ACM, New York, NY, USA, 706-706.
[16]
A. Mendelzon and P. Wood. 1995. Finding Regular Simple Paths in Graph Databases. SIAM J. Computing 24, 6 (1995), 1235-1258.
[17]
Alexander Okhotin. 2003. On the Closure Properties of Linear Conjunctive Languages. Theor. Comput. Sci. 299, 1 (April 2003), 663-685.
[18]
Polyvios Pratikakis, Jeffrey S Foster, and Michael Hicks. 2006. Existential label flow inference via CFL reachability. In SAS, Vol. 6. Springer, 88-106.
[19]
Eric Prud, Andy Seaborne, et al. 2006. SPARQL query language for RDF. (2006).
[20]
Joan Gerard Rekers. 1992. Parser generation for interactive environments. Ph.D. Dissertation. Universiteit van Amsterdam.
[21]
Thomas Reps. 1997. Program Analysis via Graph Reachability. In Proceedings of the 1997 International Symposium on Logic Programming (ILPS '97). MIT Press, Cambridge, MA, USA, 5-19. http://dl.acm.org/citation.cfm?id=271338.271343
[22]
Thomas Reps, Susan Horwitz, and Mooly Sagiv. 1995. Precise Interprocedural Dataflow Analysis via Graph Reachability. In Proceedings of the 22Nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL '95). ACM, New York, NY, USA, 49-61.
[23]
Juan L Reutter, Miguel Romero, and Moshe Y Vardi. 2015. Regular queries on graph databases. Theory of Computing Systems (2015), 1-53.
[24]
Marko A Rodriguez. 2015. The gremlin graph traversal machine and language (invited talk). In Proceedings of the 15th Symposium on Database Programming Languages. ACM, 1-10.
[25]
Elizabeth Scott and Adrian Johnstone. 2010. GLL parsing. Electronic Notes in Theoretical Computer Science 253, 7 (2010), 177-189.
[26]
Elizabeth Scott and Adrian Johnstone. 2013. GLL parse-tree generation. Science of Computer Programming 78, 10 (2013), 1828-1844.
[27]
Elizabeth Scott, Adrian Johnstone, and Rob Economopoulos. 2007. BRNGLR: a cubic Tomita-style GLR parsing algorithm. Acta informatica 44, 6 (2007), 427-461.
[28]
Petteri Sevon and Lauri Eronen. 2008. Subgraph queries by context-free grammars. Journal of Integrative Bioinformatics 5, 2 (2008), 100.
[29]
Kai Wang, Aftab Hussain, Zhiqiang Zuo, Guoqing Xu, and Ardalan Amiri Sani. 2017. Graspan: A Single-machine Disk-based Graph System for Interprocedural Static Analyses of Large-scale Systems Code. In Proceedings of the Twenty-Second International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS '17). ACM, New York, NY, USA, 389-404.
[30]
Dacong Yan, Guoqing Xu, and Atanas Rountev. 2011. Demand-driven Context-sensitive Alias Analysis for Java. In Proceedings of the 2011 International Symposium on Software Testing and Analysis (ISSTA '11). ACM, New York, NY, USA, 155-165.
[31]
Mihalis Yannakakis. 1990. Graph-theoretic methods in database theory. In Proceedings of the ninth ACM SIGACT-SIGMOD-SIGART symposium on Principles of database systems. ACM, 230-242.
[32]
Qirun Zhang and Zhendong Su. 2017. Context-sensitive Data-dependence Analysis via Linear Conjunctive Language Reachability. In Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages (POPL 2017). ACM, New York, NY, USA, 344-358.
[33]
Xiaowang Zhang, Zhiyong Feng, Xin Wang, Guozheng Rao, and Wenrui Wu. 2016. Context-free path queries on RDF graphs. In International Semantic Web Conference. Springer, 632-648.
[34]
Xin Zheng and Radu Rugina. 2008. Demand-driven Alias Analysis for C. In Proceedings of the 35th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL '08). ACM, New York, NY, USA, 197-208.

Cited By

View all
  • (2021)Context-free path querying with all-path semantics by matrix multiplicationProceedings of the 4th ACM SIGMOD Joint International Workshop on Graph Data Management Experiences & Systems (GRADES) and Network Data Analytics (NDA)10.1145/3461837.3464513(1-7)Online publication date: 20-Jun-2021
  • (2020)Context-Free Path Querying with Single-Path Semantics by Matrix MultiplicationProceedings of the 3rd Joint International Workshop on Graph Data Management Experiences & Systems (GRADES) and Network Data Analytics (NDA)10.1145/3398682.3399163(1-12)Online publication date: 14-Jun-2020
  • (2020)Context-Free Path Querying via Matrix EquationsProceedings of the 2020 ACM SIGMOD International Conference on Management of Data10.1145/3318464.3384400(2821-2823)Online publication date: 11-Jun-2020
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
Scala 2018: Proceedings of the 9th ACM SIGPLAN International Symposium on Scala
September 2018
82 pages
ISBN:9781450358361
DOI:10.1145/3241653
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 17 September 2018

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Context-Free Language Reachability
  2. Context-Free Path Querying
  3. GLL
  4. Generalized LL
  5. Graph Databases
  6. Language-Constrained Path Problem
  7. Neo4j
  8. Parser Combinators
  9. Scala

Qualifiers

  • Research-article

Conference

ICFP '18
Sponsor:

Acceptance Rates

Overall Acceptance Rate 5 of 6 submissions, 83%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)9
  • Downloads (Last 6 weeks)1
Reflects downloads up to 26 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2021)Context-free path querying with all-path semantics by matrix multiplicationProceedings of the 4th ACM SIGMOD Joint International Workshop on Graph Data Management Experiences & Systems (GRADES) and Network Data Analytics (NDA)10.1145/3461837.3464513(1-7)Online publication date: 20-Jun-2021
  • (2020)Context-Free Path Querying with Single-Path Semantics by Matrix MultiplicationProceedings of the 3rd Joint International Workshop on Graph Data Management Experiences & Systems (GRADES) and Network Data Analytics (NDA)10.1145/3398682.3399163(1-12)Online publication date: 14-Jun-2020
  • (2020)Context-Free Path Querying via Matrix EquationsProceedings of the 2020 ACM SIGMOD International Conference on Management of Data10.1145/3318464.3384400(2821-2823)Online publication date: 11-Jun-2020
  • (2019)Evaluation of the Context-Free Path Querying Algorithm Based on Matrix MultiplicationProceedings of the 2nd Joint International Workshop on Graph Data Management Experiences & Systems (GRADES) and Network Data Analytics (NDA)10.1145/3327964.3328503(1-5)Online publication date: 30-Jun-2019

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media