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

Error when using #include statement and relative imports #94

Closed
nrueh opened this issue Mar 20, 2025 · 3 comments
Closed

Error when using #include statement and relative imports #94

nrueh opened this issue Mar 20, 2025 · 3 comments

Comments

@nrueh
Copy link

nrueh commented Mar 20, 2025

I wanted to try viasp with one of my encodings inside a bigger project structure
where the encoding is split up in modules and I am using #include statements to put them together.

This seems to give an error with the relative imports as the encoding is not in the same directory as from where I am running.
The viasp.log is full of these errors

<string>:1:1-28: error: file could not be opened:
  base/defined.lp

<string>:3:1-30: error: file could not be opened:
  base/structure.lp

<string>:4:1-29: error: file could not be opened:
  base/discrete.lp

<string>:5:1-35: error: file could not be opened:
  base/clingo/integer.lp

<string>:7:1-35: error: file could not be opened:
  base/clingo/boolean.lp

etc...
@nrueh
Copy link
Author

nrueh commented Mar 20, 2025

I just navigated into the directory of the encoding, so the relative imports should be fine but now I am getting the following errors.

<string>:1:10-11: error: lexer error, unexpected "

<string>:1:10-15: error: syntax error, unexpected <IDENTIFIER>, expecting < or <STRING>

<string>:1:10-11: error: lexer error, unexpected "

<string>:1:10-15: error: syntax error, unexpected <IDENTIFIER>, expecting < or <STRING>

I am not entirely sure what this refers to but it should be the first line of my encoding file which looks like this
#include "base/defined.lp".

@nrueh
Copy link
Author

nrueh commented Mar 20, 2025

I pasted together all modules into a single file. The previous errors disappear but I get a different one, see #95

@stephanzwicknagl
Copy link
Collaborator

Thank you for reporting this. This is a duplicate of #92. This is fixed on the dev branch and will be included in the next release. For now, I recommend cloning the repo and installing the dev branch, or comment out include statements and mention the input files in the viasp command.

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

No branches or pull requests

2 participants