Datalog and Answer Set Programming (ASP) are powerful languages for rule-based database querying and constraint solving, respectively. Similarly, Python is a popular and powerful procedural programming language with applications in many domains including data science. I have developed a problem solving framework called "Possible Worlds Exploration" which is based on combining the two programming paradigms to enable new exploration and problem solving capabilities for a wide audience of users. The primary component of this framework is the Possible Worlds Explorer (PWE), an open source Python-based toolkit that employs Jupyter Notebooks to make working with Datalog and ASP systems easier and more productive. PWE can parse output from different ASP reasoners (Clingo and DLV) and then run analytical queries over all answer sets or "possible worlds" (PWs), e.g., to calculate relative frequencies of atoms across PWs or to hierarchically cluster PWs based on user-defined complexity and similarity measures. PWE also has support for the three-valued well-founded semantics of Datalog programs (via DLV) and temporal models that use a special state argument. Using simple Python functions, generic as well as user-definable presentation and visualization formats can be easily created, e.g., to display all PWs (world views), the unique three-valued well founded model (partial views), and temporal models (timelines and time series). We have illustrated several examples, both theoretical and application-based, to showcase the abilities of PWE. We provide containerized versions of PWE that can be run in the cloud or locally. In this way the Possible Worlds Explorer makes Datalog and ASP more accessible for a wider audience.
【 预 览 】
附件列表
Files
Size
Format
View
Possible worlds explorer: Combining declarative programming with user-friendly Jupyter Notebooks