Skip to search boxSkip to navigationSkip to main content

From Logic Programming to Programming in Logica: A First-Course in Declarative Data Science & Engineering

  • Evgeny Skvortsovc(Author)
    ,
  • Yilin Xiab(Author)
    ,
  • Shawn Bowersa(Author)
    ,
  • Bertram Ludäscherb(Author)
Research Output: Contribution to journal Conference article Peer-review

Abstract

While imperative programming is prevalent in software engineering and education, the declarative nature of logic programming can play a vital role in helping students further develop problem-solving and conceptual-modeling skills. Logica, an open-source logic programming language, extends Datalog by incorporating support for numerical computations, including aggregation. It serves as a comprehensive execution environment, compiling programs into iterative SQL queries that can be executed locally via DuckDB or SQLite, or in the cloud through PostgreSQL and Google BigQuery. Logica can also be accessed from within Python and Jupyter Notebooks, allowing it to be used seamlessly within typical data-science tool chains. These intuitive features make Logica an accessible and practical tool for students to learn logic programming. In this paper, we propose a new course, complete with lecture materials centered around Logica, aimed at teaching students declarative data science and engineering while covering topics such as knowledge representation and reasoning, database queries, and constraint-based programming.