https://github.com/kiranandcode/clingo-lang
#lang clingo for Racket (WIP)
https://github.com/kiranandcode/clingo-lang
Last synced: 5 months ago
JSON representation
#lang clingo for Racket (WIP)
- Host: GitHub
- URL: https://github.com/kiranandcode/clingo-lang
- Owner: kiranandcode
- License: other
- Created: 2023-12-10T07:07:24.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-22T09:08:27.000Z (over 2 years ago)
- Last Synced: 2025-04-22T12:18:46.199Z (about 1 year ago)
- Language: Racket
- Size: 93.8 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# A `#lang clingo` clingo integration with Racket
Aim: to be able to call Clingo (an ASP solver) directly from Racket.
```
#lang clingo
(person (|| 'alice 'bob))
(evil 'alice)
(:- (good p)
(person p) (not (evil p)))
;; returns '((person alice) (person bob)
;; (evil alice)
;; (good bob))
```
You'll need libclingo installed on your system.
For example, on debian-based systems do:
```
sudo apt install gringo
```
Files of interest:
- see `unsafe.rkt` for an FFI binding to libclingo (currently hard codes the path to libclingo.so)
- see `main.rkt` for an example use of the FFI binding (ideally at the end, we'd like to have a #lang)