-
Notifications
You must be signed in to change notification settings - Fork 7
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
Delay in file creation with Python implementation in ASP #5
Comments
This is my clingo --version :
|
The problem is due to When, in the python file, you run solely One fix may be : Do this fixes the problem for your real code ? |
Yes, I have tested this fix on my real code and it solves the problem. |
Problem is not solved, and is probably a big one. As shown in the following example, removing
|
Hello,
I have an issue while using Clyngor to encapsulate ASP files (which also use python implementation). The python implementation in ASP is used to select some atoms in the answer and to write these atoms in a file. The ASP encoding and fact have been tested with Clingo (version 5.2.2 compiled with Python) and it works, the file is created.
Clyngor achieves to create the file but there is a delay in the creation of the file. Indeed the file is not accessible right after the solver call. If I try to use the file, I have an error saying that the file doesn't exist. But when the script ends, the file exists.
I write a simple example, with encoding and fact files (which are working with my Clingo) and a python script with Clyngor which creates the file but runs into an error when trying to access the file with the
print(file.read())
.The ASP encoding extracts a number from a predicate with two numbers, assign it to another predicate and then write the new predicate in a file.
Example:
Python script:
Encoding file:
data.lp
:The text was updated successfully, but these errors were encountered: