bramucas / xclingo2

A tool for explainability and debugging in Answer Set Programming.
MIT License
10 stars 4 forks source link

embedded script - error: python support not available #13

Open jcouk opened 7 months ago

jcouk commented 7 months ago

Hello!

I'm trying to generate explanations on a file which includes an embedded python script and receive the error message "RuntimeError: :1:1-8:6: error: python support not available"

A sample program is below - although it may not realistically produce something interesting - it should reproduce the error.

`#script (python) import clingo import datetime N = clingo.Number def year(atomDate): date = datetime.datetime.strptime(atomDate.string, '%Y-%m-%d') return N(date.year)

end.

dateAsString("2024-01-01").

year(X, @year(X)) :- dateAsString(X). %!show_trace year(X, Y).`

Versions: xclingo --version xclingo 2.0b14

clingo --version clingo version 5.6.2 Address model: 64-bit

libclingo version 5.6.2 Configuration: with Python 3.10.6, without Lua

libclasp version 3.3.9 (libpotassco version 1.1.0) Configuration: WITH_THREADS=1

Thanks so much!

bramucas commented 6 months ago

Hi, sorry for the late response.

First, clingo 5.6 onwards is not supported yet. Although, it will come soon. Please consider installing clingo 5.5.something in a separate environment to run xclingo properly for now.

Second, the support for embedded scripts hasn't been explored yet.

I will reopen this issue as a TODO for the future.

Thank you for opening the issue!