A Machine Learning-based Approach for Solving Recurrence Relations and its use in Cost Analysis of Logic Programs

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Rustenholz, Louis, Klemen, Maximiliano, Carreira-Perpiñán, Miguel Ángel, López-García, Pedro
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866910790836027392
author Rustenholz, Louis
Klemen, Maximiliano
Carreira-Perpiñán, Miguel Ángel
López-García, Pedro
author_facet Rustenholz, Louis
Klemen, Maximiliano
Carreira-Perpiñán, Miguel Ángel
López-García, Pedro
contents Automatic static cost analysis infers information about the resources used by programs without actually running them with concrete data, and presents such information as functions of input data sizes. Most of the analysis tools for logic programs (and many for other languages), as CiaoPP, are based on setting up recurrence relations representing (bounds on) the computational cost of predicates, and solving them to find closed-form functions. Such recurrence solving is a bottleneck in current tools: many of the recurrences that arise during the analysis cannot be solved with state-of-the-art solvers, including Computer Algebra Systems (CASs), so that specific methods for different classes of recurrences need to be developed. We address such a challenge by developing a novel, general approach for solving arbitrary, constrained recurrence relations, that uses machine-learning (sparse-linear and symbolic) regression techniques to guess a candidate closed-form function, and a combination of an SMT-solver and a CAS to check if it is actually a solution of the recurrence. Our prototype implementation and its experimental evaluation within the context of the CiaoPP system show quite promising results. Overall, for the considered benchmarks, our approach outperforms state-of-the-art cost analyzers and recurrence solvers, and solves recurrences that cannot be solved by them. Under consideration in Theory and Practice of Logic Programming (TPLP).
format Preprint
id arxiv_https___arxiv_org_abs_2405_06972
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle A Machine Learning-based Approach for Solving Recurrence Relations and its use in Cost Analysis of Logic Programs
Rustenholz, Louis
Klemen, Maximiliano
Carreira-Perpiñán, Miguel Ángel
López-García, Pedro
Programming Languages
Artificial Intelligence
Automatic static cost analysis infers information about the resources used by programs without actually running them with concrete data, and presents such information as functions of input data sizes. Most of the analysis tools for logic programs (and many for other languages), as CiaoPP, are based on setting up recurrence relations representing (bounds on) the computational cost of predicates, and solving them to find closed-form functions. Such recurrence solving is a bottleneck in current tools: many of the recurrences that arise during the analysis cannot be solved with state-of-the-art solvers, including Computer Algebra Systems (CASs), so that specific methods for different classes of recurrences need to be developed. We address such a challenge by developing a novel, general approach for solving arbitrary, constrained recurrence relations, that uses machine-learning (sparse-linear and symbolic) regression techniques to guess a candidate closed-form function, and a combination of an SMT-solver and a CAS to check if it is actually a solution of the recurrence. Our prototype implementation and its experimental evaluation within the context of the CiaoPP system show quite promising results. Overall, for the considered benchmarks, our approach outperforms state-of-the-art cost analyzers and recurrence solvers, and solves recurrences that cannot be solved by them. Under consideration in Theory and Practice of Logic Programming (TPLP).
title A Machine Learning-based Approach for Solving Recurrence Relations and its use in Cost Analysis of Logic Programs
topic Programming Languages
Artificial Intelligence
url https://arxiv.org/abs/2405.06972