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

#Include directives #7

Open
denismaua opened this issue Oct 6, 2023 · 1 comment
Open

#Include directives #7

denismaua opened this issue Oct 6, 2023 · 1 comment

Comments

@denismaua
Copy link
Contributor

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
Copy link
Member

RenatoGeh commented Aug 26, 2024

  • Add support for #include "filename.plp" (see 1352f74)
    • For the logic and probabilistic part of the program, the order of #includes 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 #includes 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 file a.plp contains #include "b.py" and has test data of dimension $d$, then so should the data in b.plp (if a #python block exists). The same must also be true for train data.
    • For now a simple cycle free implementation prevents infinite #includes by simply storing whether that file has been #included 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 #includes.
  • Add support for #include "filename.py"

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