2023-08-24 20:06:29 +02:00
|
|
|
* ob-pasp
|
2023-11-30 07:25:04 +01:00
|
|
|
Org-Babel mode to execute Potassco Answer Set Programming code within Org-mode with =clingo=.
|
2023-08-24 20:06:29 +02:00
|
|
|
|
2024-04-20 08:30:07 +02:00
|
|
|
#+begin_src pasp :exports both
|
2023-08-24 20:06:29 +02:00
|
|
|
child(C, P) :- parent(P, C).
|
|
|
|
parent(vader, luke).
|
|
|
|
#show child/2.
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
#+RESULTS:
|
|
|
|
#+begin_example
|
|
|
|
clingo version 5.6.2
|
2023-08-24 20:11:37 +02:00
|
|
|
Reading from /tmp/babel-kEapMk/clingo-4cyjcS
|
2023-08-24 20:06:29 +02:00
|
|
|
Solving...
|
|
|
|
Answer: 1
|
|
|
|
child(luke,vader)
|
|
|
|
SATISFIABLE
|
|
|
|
|
|
|
|
Models : 1
|
|
|
|
Calls : 1
|
|
|
|
Time : 0.000s (Solving: 0.00s 1st Model: 0.00s Unsat: 0.00s)
|
|
|
|
CPU Time : 0.000s
|
|
|
|
#+end_example
|
2023-11-30 07:25:04 +01:00
|
|
|
|
|
|
|
** Installation
|
|
|
|
|
|
|
|
The package is not (yet) available on MELPA, so the package should be installed from github directly.
|
|
|
|
|
|
|
|
*** Dependencies
|
|
|
|
|
|
|
|
To be able to use =ob-pasp= you will need to install =clingo= cli.
|
|
|
|
|
|
|
|
*** Doomemacs
|
|
|
|
|
2024-04-26 19:23:48 +02:00
|
|
|
In your =$DOOMDIR/packages.el= file, you might want to set up the following:
|
2023-11-30 07:25:04 +01:00
|
|
|
#+begin_src emacs-lisp
|
|
|
|
(package! pasp-mode) ;; Add syntax highlighting for Potassco ASP
|
|
|
|
(package! ob-pasp
|
2024-04-20 08:30:07 +02:00
|
|
|
:recipe (:host github :repo "samuelortion/ob-pasp"))
|
2023-11-30 07:25:04 +01:00
|
|
|
#+end_src
|
|
|
|
|
2024-04-20 08:30:07 +02:00
|
|
|
*** TODO Spacemacs :help-wanted:
|
2023-11-30 07:25:04 +01:00
|
|
|
|
2024-04-20 08:30:07 +02:00
|
|
|
*** =use-package= with =straight=
|
|
|
|
The following instructions should work, but I am not sure.
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
(use-package ob-pasp
|
|
|
|
:straight (ob-pasp :type git :host github :repo "samuelortion/ob-pasp"))
|
|
|
|
#+end_src
|