-
Notifications
You must be signed in to change notification settings - Fork 37
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
[functionality] add functionality field to program #280
Conversation
src/compiler.ml
Outdated
kinds, type_abbrevs, types | ||
let kinds, type_abbrevs, types, functional_preds = | ||
if hash = base_hash then | ||
precomputed_kinds, precomputed_type_abbrevs, precomputed_types, functional_preds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is that type checkig requires to merge some stuff. the precomputed_stuff is already merged.
I have some use cases in which the base used for type checking is not the base used for linking (a bit unsafe at the moment).
If the base is the same for both steps, the already merged stuff can be used. If not, one has to merge since the base changed and the precomputed values are wrong.
If it is also the case for functional_preds, follow the name schema/field positions a the other stuff.
If not, don't computed functional_preds in this if-then-else.
% In the implementation using the input mode of elpi this is no more true. | ||
f X Y :- q X, r X Y. | ||
|
||
main :- std.findall (f _ _) L, print L. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert the length
nice test suite. I think all the tests that pass you should run a findall and assert the length of the returned list is < 2 |
…uted_functional_preds to checked_compilation_unit
[functionality] add functionality field to program
Yet no functionality check but we have the infrastructure to know what predicates are functional and what is the functionality relation of its arguments.
This partially works with type abbreviations, a wrong compiled functionality is given by the following program:where the functionality of the argumentA
ofx
is forgottenTo solve this issue we need an abstraction constructor in the functionality type