You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error: Ungrounded variable result in file codegen_fib_error.dl at line 4
fib(x, result) :-
-------^-----------
1 errors generated, evaluation aborted
Some exploration of souffle internal
After some exploration, I found that the original program passed the SemanticChecker.cpp, but ResolveAliases.cpp transformed the original program as follows.
It folds the variable temp into result = r1 + temp and temp = r2 with result - r1, which breaks the grounded constraint between result and temp! Then the GroundedTermsChecker.cpp can't recognize that the result is grounded anymore, and then report the ungrounded error.
Is this a bug or it's an expected "feature"? Thanks for any help or advice.
The text was updated successfully, but these errors were encountered:
I am not an expert of this part of the code, but it looks more like a bug of the ResolveAliases pass that may not behave correcly in presence of such circular constraints.
Hey! Thank you for building this powerful language!
I've been learning and hacking about souffle recently.
When I try to feed the above Fibonacci program to souffle, it blames a ungrounded error like the below:
That's kind of weird for me, since the "grounded constraints" of
result
are satisfied as following:Reported error depends on the order of atoms
What's more weird is, when tweaking the order of some atoms, the souffle's error reporting also changes.
temp = r2
at the end won't trigger error:temp = r2
tor2 = temp
and putting it at the end, the error still reported:Some exploration of souffle internal
After some exploration, I found that the original program passed the
SemanticChecker.cpp
, butResolveAliases.cpp
transformed the original program as follows.It folds the variable
temp
intoresult = r1 + temp
andtemp = r2
withresult - r1
, which breaks thegrounded constraint
betweenresult
andtemp
! Then theGroundedTermsChecker.cpp
can't recognize that theresult
is grounded anymore, and then report the ungrounded error.Is this a bug or it's an expected "feature"? Thanks for any help or advice.
The text was updated successfully, but these errors were encountered: