#Include directives
Opened this issue · 1 comments
denismaua commented
Allow for a #include "filename.py" or #include "filename.plp" directive that is equivalent to the Python snippet #python #end, but can be used to split a dpasp program into several files. The type of snipper can be deduced from the file extension. That should also help to make things more efficient, as e.g., we might pre-compile python files or pre-ground plp files.
RenatoGeh commented
- Add support for
#include "filename.plp"
(see 1352f74)- For the logic and probabilistic part of the program, the order of
#include
s should not matter. However, it does matter for the order of#query
's and for setting#semantics
. The current behavior for#query
is top-down for order of#include
s within a file, and breadth-first-search-like for nested#include
's. -
#python
guards should work out of the box, but data should have the same dimensions. E.g. if filea.plp
contains#include "b.py"
and has test data of dimension$d$ , then so should the data inb.plp
(if a#python
block exists). The same must also be true for train data. - For now a simple cycle free implementation prevents infinite
#include
s by simply storing whether that file has been#include
d before. Since order does not (semantically) matter in dPASP, it should not change probabilities, but this should be taken into account when evaluating the output tensor, since the order of#query
's can be tricky in more complicated programs with several nested#include
s.
- For the logic and probabilistic part of the program, the order of
- Add support for
#include "filename.py"