ABSTRACT
We present Flix, a declarative programming language for specifying and solving least fixed point problems, particularly static program analyses. Flix is inspired by Datalog and extends it with lattices and monotone functions. Using Flix, implementors of static analyses can express a broader range of analyses than is currently possible in pure Datalog, while retaining its familiar rule-based syntax. We define a model-theoretic semantics of Flix as a natural extension of the Datalog semantics. This semantics captures the declarative meaning of Flix programs without imposing any specific evaluation strategy. An efficient strategy is semi-naive evaluation which we adapt for Flix. We have implemented a compiler and runtime for Flix, and used it to express several well-known static analyses, including the IFDS and IDE algorithms. The declarative nature of Flix clearly exposes the similarity between these two algorithms.
- L. O. Andersen. Program Analysis and Specialization for the C Programming Language. PhD thesis, University of Copenhagen, 1994.Google Scholar
- K. R. Apt, H. A. Blair, and A. Walker. Towards a Theory of Declarative Knowledge. In Foundations of Deductive Databases and Logic Programming. 1988. doi: 10.1016/ B978-0-934613-40-8.50006-3. Google ScholarDigital Library
- F. Bancilhon, D. Maier, Y. Sagiv, and J. D. Ullman. Magic Sets and Other Strange Ways to Implement Logic Programs. In Proc. Principles of Database Systems (PODS), 1985. doi: 10. 1145/6012.15399. Google ScholarDigital Library
- W. C. Benton and C. N. Fischer. Interactive, Scalable, Declarative Program Analysis: From Prototype to Implementation. In Proc. Principles and Practice of Declarative Programming (PPDP), 2007. doi: 10.1145/1273920.1273923. Google ScholarDigital Library
- N. Bjørner, K. McMillan, and A. Rybalchenko. On Solving Universally Quantified Horn Clauses. In Proc. Symposium on Static Analysis (SAS), 2013.Google ScholarCross Ref
- doi: 10.1007/ 978-3-642-38856-9_8.Google Scholar
- S. M. Blackburn, R. Garner, C. Hoffman, A. M. Khan, K. S. McKinley, R. Bentzur, A. Diwan, D. Feinberg, D. Frampton, S. Z. Guyer, M. Hirzel, A. Hosking, M. Jump, H. Lee, J. E. B. Moss, A. Phansalkar, D. Stefanovi´c, T. VanDrunen, D. von Dincklage, and B. Wiedermann. The DaCapo benchmarks: Java Benchmarking Development and Analysis. In Proc. Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), 2006. doi: 10.1145/1167473. Google ScholarDigital Library
- 1167488.Google Scholar
- M. Bravenboer and Y. Smaragdakis. Strictly Declarative Specification of Sophisticated Points-To Analyses. In Proc. Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), 2009. doi: 10.1145/1640089.1640108. Google ScholarDigital Library
- G. Brewka, T. Eiter, and M. Truszczy´nski. Answer Set Programming at a Glance. Communications of the ACM, 2011. Google ScholarDigital Library
- doi: 10.1145/2043174.2043195.Google Scholar
- S. Ceri, G. Gottlob, and L. Tanca. What You Always Wanted to Know About Datalog (and Never Dared to Ask). IEEE Transactions on Knowledge and Data Engineering (TKDE), 1989. doi: 10.1109/69.43410. Google ScholarDigital Library
- W. Clocksin and C. S. Mellish. Programming in Prolog. Springer Berlin Heidelberg, 2003.Google ScholarCross Ref
- doi: 10.1007/ 978-3-642-55481-0.Google Scholar
- M. Codish, A. Mulkers, M. Bruynooghe, M. G. De La Banda, and M. Hermenegildo. Improving Abstract Interpretations by Combining Domains. ACM Transactions on Programming Languages and Systems (TOPLAS), 1995. doi: 10.1145/ 200994.200998. Google ScholarDigital Library
- J. Cohen. Constraint Logic Programming Languages. Communications of the ACM, 1990. doi: 10.1145/79204.79209. Google ScholarDigital Library
- N. Conway, W. R. Marczak, P. Alvaro, J. M. Hellerstein, and D. Maier. Logic and Lattices for Distributed Programming. In Proc. Symposium on Cloud Computing (SoCC), 2012. doi: 10. 1145/2391229.2391230. Google ScholarDigital Library
- A. Cortesi, G. Costantini, and P. Ferrara. A Survey on Product Operators in Abstract Interpretation. In Proc. Festschrift for David Schmidt, 2013. doi: 10.4204/EPTCS.129.19.Google ScholarCross Ref
- P. Cousot and R. Cousot. Abstract Interpretation: A Unified Lattice Model for Static Analysis of Programs by Construction or Approximation of Fixpoints. In Proc. Principles of Programming Languages (POPL), 1977. doi: 10.1145/512950. Google ScholarDigital Library
- 512973.Google Scholar
- P. Cuoq, F. Kirchner, N. Kosmatov, V. Prevosto, J. Signoles, and B. Yakobowski. Frama-C – A Software Analysis Perspective. In Software Engineering and Formal Methods (SEFM), 2012. Google ScholarDigital Library
- doi: 10.1007/978-3-642-33826-7_16.Google Scholar
- E. Dantsin, T. Eiter, G. Gottlob, and A. Voronkov. Complexity and Expressive Power of Logic Programming. ACM Computing Surveys (CSUR), 2001. doi: 10.1145/502807.502810. Google ScholarDigital Library
- S. Dawson, C. Ramakrishnan, and D. Warren. Practical Program Analysis Using General Purpose Logic Programming Systems – A Case Study. In Proc. Programming Language Design and Implementation (PLDI), 1996. doi: 10.1145/ 231379.231399. Google ScholarDigital Library
- O. de Moor, G. Gottlob, T. Furche, and A. Sellers, editors. Datalog Reloaded – First International Workshop, Datalog 2010, 2011. doi: 10.1007/978-3-642-24206-9. Google ScholarDigital Library
- T. Eiter, G. Gottlob, and H. Mannila. Adding Disjunction to Datalog. In Proc. Principles of Database Systems (PODS), 1994. doi: 10.1145/182591.182639. Google ScholarDigital Library
- T. Eiter, G. Gottlob, and H. Mannila. Disjunctive Datalog. ACM Transactions on Database Systems (TODS), 1997. doi: 10. 1145/261124.261126. Google ScholarDigital Library
- S. Fink and J. Dolby. WALA – The TJ Watson Libraries for Analysis, 2012.Google Scholar
- M. Fitting. Fixpoint Semantics for Logic Programming a Survey. Theoretical Computer Science (TCS), 2002. doi: 10. 1016/S0304-3975(00)00330-3. Google ScholarDigital Library
- C. Flanagan. Automatic Software Model Checking Using CLP. In Proc. European Symposium on Programming (ESOP), 2003. Google ScholarDigital Library
- doi: 10.1007/3-540-36575-3_14.Google Scholar
- M. Gelfond and V. Lifschitz. The Stable Model Semantics for Logic Programming. In Proc. International Conference on Logic Programming (ICLP/SLP), 1988.Google Scholar
- M. Gelfond and V. Lifschitz. Classical Negation in Logic Programs and Disjunctive Databases. New Generation Computing, 1991. doi: 10.1007/BF03037169.Google ScholarCross Ref
- G. Graefe. Query Evaluation Techniques for Large Databases. ACM Computing Surveys (CSUR), 1993. Google ScholarDigital Library
- doi: 10.1145/ 152610.152611.Google Scholar
- S. Gregory. Parallel Logic Programming in PARLOG: The Language and its Implementation. Addison-Wesley, 1987. Google ScholarDigital Library
- S. Gulwani and A. Tiwari. Combining Abstract Interpreters. In Proc. Programming Language Design and Implementation (PLDI), 2006. doi: 10.1145/1133981.1134026. Google ScholarDigital Library
- E. Hajiyev, M. Verbaere, and O. D. Moor. codeQuest: Scalable Source Code Queries with Datalog. In Proc. European Conference on Object-Oriented Programming (ECOOP), 2006. Google ScholarDigital Library
- doi: 10.1007/11785477_2.Google Scholar
- M. Hind. Pointer Analysis: Haven’t We Solved This Problem Yet? In Proc. Program Analysis for Software Tools and Engineering (PASTE), 2001. doi: 10.1145/379605.379665. Google ScholarDigital Library
- S. S. Huang, T. J. Green, and B. T. Loo. Datalog and Emerging Applications: An Interactive Tutorial. In Proc. Management of Data (SIGMOD), 2011. doi: 10.1145/1989323.1989456. Google ScholarDigital Library
- J. Jaffar and J.-L. Lassez. Constraint Logic Programming. In Proc. Principles of Programming Languages (POPL), 1987. Google ScholarDigital Library
- doi: 10.1145/41625.41635.Google Scholar
- J. Jaffar and M. J. Maher. Constraint Logic Programming: A Survey. Journal of Logic Programming, 1994. doi: 10.1016/ 0743-1066(94)90033-7.Google Scholar
- J. B. Kam and J. D. Ullman. Monotone Data Flow Analysis Frameworks. Acta Informatica, 1977. doi: 10.1007/ BF00290339. Google ScholarDigital Library
- K. Kunen. Negation in Logic Programming. Journal of Logic Programming, 1987. doi: 10.1016/0743-1066(87) 90007-0. Google ScholarDigital Library
- M. S. Lam, J. Whaley, V. B. Livshits, M. C. Martin, D. Avots, M. Carbin, and C. Unkel. Context-sensitive Program Analysis as Database Queries. In Proc. Principles of Database Systems (PODS), 2005. doi: 10.1145/1065167.1065169. Google ScholarDigital Library
- N. Leone, G. Pfeifer, W. Faber, T. Eiter, G. Gottlob, S. Perri, and F. Scarcello. The DLV System for Knowledge Representation and Reasoning. ACM Transactions on Computational Logic (TOCL), 2006. doi: 10.1145/1149114.1149117. Google ScholarDigital Library
- O. Lhoták and K.-C. A. Chung. Points-To Analysis with Efficient Strong Updates. In Proc. Principles of Programming Languages (POPL), 2011. doi: 10.1145/1925844.1926389.Google Scholar
- O. Lhoták and L. Hendren. Scaling Java Points-To Analysis using Spark. In Proc. Compiler Construction (CC), 2003. Google ScholarDigital Library
- doi: 10.1007/3-540-36579-6_12.Google Scholar
- N. Li and J. C. Mitchell. Datalog with Constraints: A Foundation for Trust Management Languages. In Proc. Practical Aspects of Declarative Languages (PADL), 2003. doi: 10. 1007/3-540-36388-2_6. Google ScholarDigital Library
- V. Lifschitz. Answer Set Planning. In Proc. Logic Programming and Nonmonotonic Reasoning (LPNMR), 1999. Google ScholarDigital Library
- doi: 10.1007/3-540-46767-X_28.Google Scholar
- V. Lifschitz. What Is Answer Set Programming? In Proc. Artificial Intelligence (AAAI), 2008. Google ScholarDigital Library
- F. Martin. PAG – An Efficient Program Analyzer Generator. Journal on Software Tools for Technology Transfer (STTT), 1998. doi: 10.1007/s100090050017.Google Scholar
- M. Méndez-Lojo, J. Navas, and M. Hermenegildo. A Flexible, (C)LP-Based Approach to the Analysis of Object-Oriented Programs. In Proc. Logic-Based Program Synthesis and Transformation (LOPSTR), 2007.Google Scholar
- doi: 10.1007/ 978-3-540-78769-3_11.Google Scholar
- K. Muthukumar and M. Hermenegildo. Compile-time Derivation of Variable Dependency Using Abstract Interpretation. Journal of Logic Programming, 1992. Google ScholarDigital Library
- doi: 10.1016/ 0743-1066(92)90035-2.Google Scholar
- N. A. Naeem and O. Lhoták. Typestate-like Analysis of Multiple Interacting Objects. In Proc. Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), 2008. Google ScholarDigital Library
- doi: 10.1145/1449764.1449792.Google Scholar
- N. A. Naeem, O. Lhoták, and J. Rodriguez. Practical Extensions to the IFDS Algorithm. In Proc. Compiler Construction (CC), 2010. Google ScholarDigital Library
- F. Nielson, H. R. Nielson, and H. Seidl. A Succinct Solver for ALFP. Nordic Journal of Computing (NJC), 2002. Google ScholarDigital Library
- F. Nielson, H. R. Nielson, H. Sun, M. Buchholtz, R. R. Hansen, H. Pilegaard, and H. Seidl. The Succinct Solver Suite. In Proc. Tools and Algorithms for the Construction and Analysis of Systems (TACAS), 2004. doi: 10.1007/978-3-540-24730-2_ 21.Google ScholarCross Ref
- N. Ramsey, J. Dias, and S. P. Jones. Hoopl: A Modular, Reusable Library for Dataflow Analysis and Transformation. In Proc. Haskell Symposium, 2010. doi: 10.1145/1863523. Google ScholarDigital Library
- 1863539.Google Scholar
- T. Reps, S. Horwitz, and M. Sagiv. Precise Interprocedural Dataflow Analysis via Graph Reachability. In Proc. Principles of Programming Languages (POPL), 1995. doi: 10.1145/ 199448.199462. Google ScholarDigital Library
- M. Sagiv, T. Reps, and S. Horwitz. Precise Interprocedural Dataflow Analysis with Applications to Constant Propagation. Theoretical Computer Science (TCS), 1996. doi: 10.1016/ 0304-3975(96)00072-2. Google ScholarDigital Library
- Y. Smaragdakis and M. Bravenboer. Using Datalog for Fast and Easy Program Analysis. In Datalog Reloaded, 2011. Google ScholarDigital Library
- doi: 10.1145/1926385.1926390.Google Scholar
- Y. Smaragdakis, M. Bravenboer, and O. Lhoták. Pick Your Contexts Well: Understanding Object-Sensitivity. In Proc. Principles of Programming Languages (POPL), 2011. doi: 10. 1145/1925844.1926390. Google ScholarDigital Library
- L. Sterling and E. Y. Shapiro. The Art of Prolog: Advanced Programming Techniques. MIT Press, 1994. Google ScholarDigital Library
- T. Swift and D. S. Warren. XSB: Extending Prolog with Tabled Logic Programming. Theory and Practice of Logic Programming (TPLP), 2012. doi: 10.1017/S1471068411000500. Google ScholarDigital Library
- J. D. Ullman. Principles of Database Systems. Galgotia publications, 1984. Google ScholarDigital Library
- J. D. Ullman. Principles of Database and Knowledge-Base Systems, Volume I. Computer Science Press, 1988. Google ScholarDigital Library
- R. Vallée-Rai, P. Co, E. Gagnon, L. Hendren, P. Lam, and V. Sundaresan. Soot – A Java Bytecode Optimization Framework. In Proc. Centre for Advanced Studies on Collaborative Research (CASCON), 1999. Google ScholarDigital Library
- A. Van Gelder, K. A. Ross, and J. S. Schlipf. The Well-Founded Semantics for General Logic Programs. Journal of the ACM (JACM), 1991. doi: 10.1145/116825.116838. Google ScholarDigital Library
- P. Wadler and S. Blott. How to Make Ad-hoc Polymorphism Less Ad Hoc. In Proc. Principles of Programming Languages (POPL), 1989. doi: 10.1145/75277.75283. Google ScholarDigital Library
- J. Whaley and M. S. Lam. Cloning-based Context-sensitive Pointer Alias Analysis using Binary Decision Diagrams. In Proc. Programming Language Design and Implementation (PLDI), 2004. doi: 10.1145/996893.996859. Google ScholarDigital Library
Index Terms
- From Datalog to flix: a declarative language for fixed points on lattices
Recommendations
From Datalog to flix: a declarative language for fixed points on lattices
PLDI '16We present Flix, a declarative programming language for specifying and solving least fixed point problems, particularly static program analyses. Flix is inspired by Datalog and extends it with lattices and monotone functions. Using Flix, implementors ...
Semi-Inflationary DATALOG: A declarative database language with procedural features
This paper presents a rule-based database language which extends stratified DATALOG by adding a controlled form of inflationary fixpoint, immersed in a context of classical stratified negation with least fixpoint. The proposed language, called Semi-...
Datafun: a functional Datalog
ICFP 2016: Proceedings of the 21st ACM SIGPLAN International Conference on Functional ProgrammingDatalog may be considered either an unusually powerful query language or a carefully limited logic programming language. Datalog is declarative, expressive, and optimizable, and has been applied successfully in a wide variety of problem domains. ...
Comments