https://github.com/kiranandcode/cleango
Bindings to libclingo for the lean4 prover and programming language!
https://github.com/kiranandcode/cleango
Last synced: over 1 year ago
JSON representation
Bindings to libclingo for the lean4 prover and programming language!
- Host: GitHub
- URL: https://github.com/kiranandcode/cleango
- Owner: kiranandcode
- Created: 2024-04-26T08:39:14.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-03T15:10:56.000Z (almost 2 years ago)
- Last Synced: 2024-10-11T21:48:30.377Z (over 1 year ago)
- Language: C
- Size: 86.9 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CLeanGo - Bindings to libclingo for Lean 4
This repository includes bindings to the Clingo ASP programming system
for the Lean 4 Theorem Prover.
The bindings are currently work in progress, but the final goal is to
have a DSL from which you can write Clingo queries in Lean and have
then sent directly to Clingo and their results returned in a Lean
format.
Using: https://github.com/Anderssorby/SDL.lean/blob/main/bindings/sdl2-shim.c and https://github.com/leanprover/lean4/blob/master/src/include/lean/lean.h for reference
Requires Clingo 5.4.0 (important, as the FFI has changed in newer releases).
Example file:
```lean
def main : IO Unit := do
let control <- Clingo.makeControl
add_clingo_query! control :
p(X) :- q(X).
q(a).
q(b).
Clingo.ground control
Clingo.solve control
println! "finished!"
```