Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It should be possible to return arbitrary sequences and not just lists from external python functions. #147

Closed
rkaminsk opened this issue Apr 16, 2019 · 5 comments
Assignees
Milestone

Comments

@rkaminsk
Copy link
Member

No description provided.

@rkaminsk rkaminsk self-assigned this Apr 16, 2019
@rkaminsk rkaminsk added this to the v5.4.0 milestone Apr 16, 2019
@Aluriak
Copy link

Aluriak commented Apr 26, 2019

Are generators supported ?

def g():
    yield from (1, 2, 3)

@rkaminsk
Copy link
Member Author

rkaminsk commented Apr 26, 2019

Yes, anything that is iterable is supported. But note that str and tuple are converted to clingo.Symbol (of type clingo.SymbolType.String and clingo.SymbolType.Function).

@Aluriak
Copy link

Aluriak commented Apr 30, 2019

Thank you !

@marypopa
Copy link

marypopa commented Feb 5, 2021

Hi! I have a problem. I run this code with the clyngor in python
`from clyngor import ASP, solve

answers = ASP("""
rel(a,(c;d)). rel(b,(d;e)).
obj(X):- rel(X,) ; rel(X,Y): att(Y).
att(Y):- rel(
,Y) ; rel(X,Y): obj(X).
:- not obj(X):obj(X).
:- not att(Y):att(Y).
""")
for answer in answers:
print(answer)and I get this error
FileNotFoundError: [WinError 2] The system cannot find the file specified
`

@Aluriak
Copy link

Aluriak commented Feb 6, 2021

@marypopa Sounds like a clyngor related problem, doubled with an ASP syntax error. Please file this issue on clyngor repository, i will study it as soon as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants