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

Insufficient checking on unground variable #2379

Open
DerZc opened this issue Dec 23, 2022 · 1 comment
Open

Insufficient checking on unground variable #2379

DerZc opened this issue Dec 23, 2022 · 1 comment
Labels
bug - identified Bugs with an identified cause

Comments

@DerZc
Copy link

DerZc commented Dec 23, 2022

Hi,

Consider the following program:

.type typeHejh = symbol
.type typeMrgs = unsigned
.type typeAiik = symbol

.decl tdfw(A:float, B:float, C:float)
.decl hhxs(A:typeHejh, B:typeAiik, C:number, D:typeAiik)
.decl vxeo(A:typeHejh, B:symbol, C:number, D:typeAiik, E:typeAiik, F:typeHejh)

hhxs("40uD340uD3", "40uD3", 4, "40uD3").
tdfw(10.712999999999999, 16.931999999999999, 10.712999999999999).

vxeo(E, C, F, D, C, D) :- tdfw(B, max(A,7.179), --A), hhxs(D, C, F, E).

.output vxeo

This program would hang. I guess it was caused by the unground variable A, but the grammar checker did not find this.
If I write this rule b(A):-tdfw(B, max(A,7.179), --A), the grammar can find this error.

The souffle version is 3cd802d, I tried with some older version, also have this issue.

@quentin quentin added the bug - identified Bugs with an identified cause label Dec 16, 2023
@quentin
Copy link
Member

quentin commented Dec 16, 2023

The ResolveAnonymousRecordAliasesTransformer that runs before the semantics checker calls the type analysis. And the type analysis loops infinitely because A cannot be given a definite type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug - identified Bugs with an identified cause
Projects
None yet
Development

No branches or pull requests

2 participants