Clorm: An ORM API for Clingo
Introduction
Clorm is a Python library that provides an Object Relational Mapping (ORM) style interface to the Clingo Answer Set Programming (ASP) solver. It allows facts to be asserted to, and extracted from, the ASP solver in an intuitive and easy to use way. The goal of this library is to supplement the existing Clingo API to make it easier to build and maintain Python applications that integrate with Clingo.
When integrating an ASP program into a larger application a typical requirement is to model the problem domain as a statically written ASP program, but then to generate problem instances and process the results dynamically. Clorm makes this integration cleaner, both in terms of code readability but also by making it easier to refactor the python code as the ASP program evolves.
Works with Python 3.8+ and Clingo 5.6+
Contents:
- Installation
- Motivation
- Quick Start
- Predicates and Fields
- The Basics
- Overriding the Predicate Name
- Nullary Predicates
- Complex Terms
- Negative Facts
- Field Definitions
- Using Positional Arguments
- Working with Tuples
- Debugging Auxiliary Predicates
- Dealing with Raw Clingo Symbols
- Combining Field Definitions
- Dealing with Nested Lists
- Comparison Operators
- Old Syntax
- Fact Bases and Querying
- Clingo Solver Integration
- Embedding Python into ASP
- Advanced Features
- Experimental Features
- API Documentation