Basic examples of the clingo Python API
python -m pip install clingoThis repository is organized into folders covering different aspects of the clingo Python API:
- basic_control - Basic Control usage: load, ground, and solve ASP programs
- model_exploration - How to explore and filter atoms in answer set models
- projection - Using the #project directive for answer set projection
- embedded_python - Calling Python functions from ASP using @-syntax
- multishot_solving - Incremental grounding and solving (multi-shot ASP)
Each folder contains a README with specific usage instructions. For example:
cd basic_control
python load_ground_solve.py basic_prog.lpcd model_exploration
python exploring_models.py ../basic_control/basic_prog.lp