Papers
Topics
Authors
Recent
Search
2000 character limit reached

Extending Answer Set Programming with Rational Numbers

Published 7 Dec 2023 in cs.AI, cs.LO, cs.PL, and cs.SE | (2312.04249v1)

Abstract: Answer Set Programming (ASP) is a widely used declarative programming paradigm that has shown great potential in solving complex computational problems. However, the inability to natively support non-integer arithmetic has been highlighted as a major drawback in real-world applications. This feature is crucial to accurately model and manage real-world data and information as emerged in various contexts, such as the smooth movement of video game characters, the 3D movement of mechanical arms, and data streamed by sensors. Nevertheless, extending ASP in this direction, without affecting its declarative nature and its well-defined semantics, poses non-trivial challenges; thus, no ASP system is able to reason natively with non-integer domains. Indeed, the widespread floating-point arithmetic is not applicable to the ASP case, as the reproducibility of results cannot be guaranteed and the semantics of an ASP program would not be uniquely and declaratively determined, regardless of the employed machine or solver. To overcome such limitations and in the realm of pure ASP, this paper proposes an extension of ASP in which non-integers are approximated to rational numbers, fully granting reproducibility and declarativity. We provide a well-defined semantics for the ASP-Core-2 standard extended with rational numbers and an implementation thereof. We hope this work could serve as a stepping stone towards a more expressive and versatile ASP language that can handle a broader range of real-world problems.

Summary

  • The paper introduces a novel ASP extension that natively supports rational numbers without altering traditional semantics.
  • It presents an implementation in the I-DLV system that uses a two-phase grounding and solving approach, preserving ASP-Core-2 compatibility.
  • The advancement enhances ASP's ability to address real-world tasks, improving accuracy and explainability in complex computational problems.

Introduction

Answer Set Programming (ASP) is a particularly powerful declarative programming paradigm, especially known for its efficacy in representing and solving complex computational problems. The principle behind ASP involves using logic rules to define the specifics of a problem. From these rules, solutions are derived and explained in a transparent and understandable way. This transparency lends itself to applications which demand explainability—a critical requirement in many modern AI systems, such as those used in industry or robotics.

Extending ASP to Handle Rational Numbers

Despite ASP's strengths, it has traditionally been limited to handling integer numbers, which significantly constrains its capabilities. There are real-world scenarios, such as movement calculation in video games or managing mechanical parts in 3D space, where support for non-integer numbers is crucial. Current ASP systems and standards, like ASP-Core-2, do not provide native support for rational numbers. Instead, workarounds or approximations are used, which can compromise clarity, performance, and accuracy.

This paper introduces an enhancement to ASP that can natively handle rational numbers. The syntax and semantics of the standard ASP-Core-2 language have been extended, allowing for operations with rationals that maintain the language's declarative essence without compromising its well-defined semantics.

Implementation and Properties

An implementation of the extended language is presented, continuing the convention of a two-phase grounding and solving approach. It is realized in the system called I-DLV. The implementation allows for the rational numbers to be used as part of logic rules, and it includes a range of mathematical functions tailored for their manipulation. This expansion retains compatibility with existing ASP solvers via an updated intermediate numeric format.

This extension is designed to incorporate ratios and rational numbers, exhibiting two important characteristics: if only integers and integer division are used, the behavior of the system is equivalent to traditional ASP-Core-2; and semantically, it relies on a countable set of numerals similar to standard ASP.

Practical Implications and Future Directions

By addressing the limitation of non-integer support, ASP can tackle a broader variety of problems, significantly enhancing its relevance in both academic research and practical applications. I-DLV offers a starting point for researchers and practitioners to explore and benefit from this expanded capability. Looking ahead, the extended language holds potential for incorporating additional numeric types or further integration with hybrid symbolic-statistical AI approaches.

This development stands as a marked improvement in the field of declarative logic programming, directly responsive to the pressing needs for more versatile tools in AI and beyond.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Continue Learning

We haven't generated follow-up questions for this paper yet.

Collections

Sign up for free to add this paper to one or more collections.

Tweets

Sign up for free to view the 1 tweet with 0 likes about this paper.