🤖 AI Summary
This work addresses the NP-hard problem of optimal term extraction from e-graphs by proposing an efficient modeling approach based on Answer Set Programming (ASP), overcoming the inefficiency limitations of earlier ASP formulations. Through carefully optimized ASP encodings, this study achieves—for the first time—comparable solving performance to state-of-the-art Integer Linear Programming (ILP) methods on extraction tasks, while also uncovering additional optimal solutions on several complex instances. Furthermore, the paper explores synergies between ASP and Datalog, introducing a novel paradigm that treats ASP as an enhanced form of Datalog to enable system-level performance gains. The effectiveness and potential of the proposed method are validated on the extraction-gym benchmark suite.
📝 Abstract
Three years ago, Philip Zucker posted an attempt to use answer set programming (ASP) for term extraction from e-graphs Although the task is NP-hard and ASP offers a natural modelling of e-graph terms, the initial attempt did not yield convincing results.
From the aspect of practical ASP users, we first pinpoint the way to make ASP work and work well on the task of e-graph extraction. The initial results show the naïve ASP encoding is comparable on efficiency to the well-optimised ILP-based exact DAG extraction in the extraction-gym, and find several extra optimal extraction on the complex instances. This leads us to a further agenda: with the "better together of egg+Datalog", is there a better "better together" by having ASP as a more powerful Datalog? We discuss the potential benefit from each other.