Structural Resolution for Abstract Compilation of Object-Oriented Languages

We propose abstract compilation for precise static type analysis of object-oriented languages based on coinductive logic programming. Source code is translated to a logic program, then type-checking and inference problems amount to queries to be solved with respect to the resulting logic program. We exploit a coinductive semantics to deal with infinite terms and proofs produced by recursive types and methods. Thanks to the recent notion of structural resolution for coinductive logic programming, we are able to infer very precise type information, including a class of irrational recursive types causing non-termination for previously considered coinductive semantics. We also show how to transform logic programs to make them satisfy the preconditions for the operational semantics of structural resolution, and we prove this step does not affect the semantics of the logic program.

[1]  Tom Schrijvers,et al.  Proof Relevant Corecursive Resolution , 2016, FLOPS.

[2]  Davide Ancona,et al.  A formal account of SSA in Java-like languages , 2016, FTfJP@ECOOP.

[3]  J. W. Lloyd,et al.  Foundations of logic programming; (2nd extended ed.) , 1987 .

[4]  Yue Li,et al.  Productive corecursion in logic programming* , 2017, Theory and Practice of Logic Programming.

[5]  Peter J. Stuckey,et al.  Under Consideration for Publication in J. Functional Programming Hm(x) Type Inference Is Clp(x) Solving , 2022 .

[6]  Davide Ancona,et al.  Static Single Information Form for Abstract Compilation , 2012, IFIP TCS.

[7]  Davide Ancona,et al.  Sound and Complete Subtyping between Coinductive Types for Object-Oriented Languages , 2014, ECOOP.

[8]  Andrea Vezzosi,et al.  Executable Relational Specifications of Polymorphic Type Systems Using Prolog , 2016, FLOPS.

[9]  Martin Schmidt,et al.  Coalgebraic logic programming: from Semantics to Implementation , 2013, J. Log. Comput..

[10]  Gopal Gupta,et al.  Coinductive Logic Programming and Its Applications , 2007, ICLP.

[11]  Davide Ancona,et al.  Semantic subtyping for imperative object-oriented languages , 2016, OOPSLA.

[12]  Davide Ancona,et al.  Abstract Compilation of Object-Oriented Languages into Coinductive CLP(X): Can Type Inference Meet Verification? , 2010, FoVeOOS.

[13]  Patricia Johann,et al.  Structural Resolution: a Framework for Coinductive Proof Search and Proof Construction in Horn Clause Logic , 2015, ArXiv.

[14]  Yue Li,et al.  Structural Resolution with Co-inductive Loop Detection , 2017, CoALP-Ty.

[15]  Patricia Johann,et al.  Structural Resolution for Logic Programming , 2015, ICLP.

[16]  Davide Ancona,et al.  Coinductive Type Systems for Object-Oriented Languages , 2009, ECOOP.

[17]  Martin Schmidt,et al.  A Productivity Checker for Logic Programming , 2016, LOPSTR.

[18]  M. A. Nait Abdallah,et al.  Top-Down Semantics of Fair Computations of Logic Programs , 1985, J. Log. Program..

[19]  Ekaterina Komendantskaya,et al.  Operational semantics of resolution and productivity in Horn clause logic , 2016, Formal Aspects of Computing.

[20]  Davide Ancona,et al.  Idealized coinductive type systems for imperative object-oriented programs , 2011, RAIRO Theor. Informatics Appl..

[21]  Bruno Courcelle,et al.  Fundamental Properties of Infinite Trees , 1983, Theor. Comput. Sci..