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
I have a question about the meaning of the different components of the datalog result, I didn't find detailed documentation about this.
I have a program as below:
Z 64
snkz(A:Z, B:Z) input
yjuq(A:Z) input
pbbr(A:Z, B:Z, C:Z)
dtlm(A:Z, B:Z, C:Z, D:Z, E:Z, F:Z, G:Z, H:Z)
dimn(A:Z, B:Z, C:Z)
hoal(A:Z, B:Z)
fjkf(A:Z, B:Z, C:Z, D:Z, E:Z, F:Z)
mekn(A:Z, B:Z, C:Z, D:Z, E:Z)
ryyt(A:Z, B:Z, C:Z)
oemf(A:Z, B:Z, C:Z, D:Z)
xjrz(A:Z, B:Z, C:Z)
dsjl(A:Z, B:Z, C:Z, D:Z)
dckg(A:Z, B:Z, C:Z, D:Z, E:Z, F:Z, G:Z)
skna(A:Z)
spvu(A:Z, B:Z, C:Z, D:Z, E:Z, F:Z, G:Z)
vupp(A:Z, B:Z, C:Z, D:Z, E:Z)
waab(A:Z, B:Z, C:Z, D:Z, E:Z, F:Z, G:Z)
dupp(A:Z, B:Z)
sbgg(A:Z, B:Z, C:Z, D:Z, E:Z, F:Z, G:Z)
gmjy(A:Z, B:Z, C:Z, D:Z, E:Z)
kcnm(A:Z)
hmes(A:Z, B:Z, C:Z, D:Z)
gzpe(A:Z)
efnc(A:Z, B:Z, C:Z, D:Z, E:Z)
bwne(A:Z, B:Z, C:Z, D:Z)
eqvu(A:Z)
jhcz(A:Z, B:Z, C:Z, D:Z)
dbbw(A:Z, B:Z, C:Z, D:Z, E:Z)
dpgb(A:Z, B:Z)
pszu(A:Z)
esrk(A:Z, B:Z, C:Z, D:Z, E:Z, F:Z, G:Z, H:Z)
suxv(A:Z)
gpcd(A:Z)
uyot(A:Z, B:Z, C:Z)
xxer(A:Z, B:Z)
bfne(A:Z, B:Z, C:Z, D:Z, E:Z, F:Z, G:Z)
bvsq(A:Z, B:Z, C:Z, D:Z, E:Z)
xjba(A:Z)
vsny(A:Z)
vbmh(A:Z, B:Z, C:Z, D:Z) printtuples
snkz(29, 20).
snkz(9, 34).
snkz(5, 41).
snkz(48, 33).
snkz(49, 16).
snkz(4, 36).
yjuq(0).
yjuq(31).
yjuq(41).
yjuq(29).
yjuq(9).
yjuq(21).
pbbr(A, A, A) :- yjuq(A).
dtlm(C, B, B, B, C, A, B, B) :- snkz(C, B), pbbr(B, A, B), pbbr(A, B, B).
dimn(A, B, B) :- pbbr(A, B, B).
hoal(A, A) :- dimn(C, A, C), dimn(B, A, D).
fjkf(D, A, C, D, B, C) :- pbbr(C, D, B), pbbr(D, D, D), pbbr(D, C, A).
mekn(D, C, E, E, D) :- dimn(B, E, D), pbbr(E, 41, C).
ryyt(A, B, B) :- pbbr(B, A, B), pbbr(A, B, _).
oemf(B, B, B, A) :- dimn(A, B, B).
xjrz(B, D, D) :- fjkf(D, A, B, D, A, D).
dsjl(F, D, E, F) :- hoal(29, F), xjrz(A, F, D), fjkf(E, C, A, B, E, A).
dckg(A, A, A, A, B, C, A) :- pbbr(A, B, C), dsjl(B, B, A, B).
skna(D) :- xjrz(C, C, C), pbbr(D, D, D).
spvu(D, D, B, C, A, D, A) :- mekn(D, E, B, D, B), snkz(C, A), ryyt(E, D, D).
vupp(A, A, A, A, A) :- fjkf(A, _, A, A, B, A).
waab(A, B, A, A, B, A, A) :- hoal(B, B), mekn(A, A, C, B, C), fjkf(A, A, B, A, A, C).
dupp(D, G) :- ryyt(G, G, H), dckg(F, F, G, A, D, D, F).
sbgg(A, B, B, B, B, B, A) :- ryyt(A, B, _).
gmjy(G, F, G, G, F) :- waab(G, G, G, F, B, F, G), dupp(E, A).
kcnm(B) :- gmjy(A, B, A, A, B), gmjy(B, B, B, B, A), hoal(A, A).
hmes(C, C, B, B) :- oemf(C, B, A, B), waab(B, C, A, B, C, C, C).
gzpe(A) :- yjuq(A), dupp(B, _).
efnc(F, H, C, K, E) :- waab(F, E, C, K, G, B, H), waab(C, I, I, G, F, J, A).
bwne(F, B, D, E) :- ryyt(D, D, C), sbgg(G, C, B, E, D, F, G).
eqvu(A) :- hoal(A, A).
jhcz(A, A, A, A) :- efnc(A, A, A, 41, A).
dbbw(F, E, C, E, A) :- gzpe(F), ryyt(E, E, A), pbbr(F, A, C), !dsjl(E, E, _, C).
dpgb(A, A) :- skna(A).
pszu(C) :- hmes(C, B, B, A), !dckg(B, B, C, B, A, B, C).
esrk(A, B, B, A, A, A, B, A) :- skna(A), kcnm(A), skna(B), !oemf(B, A, B, A).
suxv(D) :- sbgg(A, F, D, E, B, D, A), skna(C).
gpcd(B) :- dimn(A, B, B), !dupp(B, B).
uyot(C, B, B) :- gmjy(A, B, C, B, B).
xxer(B, A) :- gzpe(B), dupp(B, A).
bfne(A, A, C, A, A, C, C) :- oemf(C, C, C, B), kcnm(A), sbgg(A, A, A, B, C, B, D).
bvsq(B, B, A, B, C) :- dpgb(D, B), hmes(C, B, B, C), jhcz(D, D, B, A).
xjba(A) :- eqvu(A), oemf(D, A, D, B), !jhcz(D, A, A, D).
vsny(B) :- dpgb(B, B), bwne(B, C, B, C), 25 = B.
vbmh(A, A, A, A) :- eqvu(A).
The result of this program is:
Tuples in vbmh:
(A=25(0),B=25(0),C=25(0),D=25(0))
(A=31(31),B=31(31),C=31(31),D=31(31))
(A=41(41),B=41(41),C=41(41),D=41(41))
(A=29(29),B=29(29),C=29(29),D=29(29))
(A=9(9),B=9(9),C=9(9),D=9(9))
(A=21(21),B=21(21),C=21(21),D=21(21))
This program is too long and I remove some useless statement to build a equivalent program:
Z 64
yjuq(A:Z) input
pbbr(A:Z, B:Z, C:Z)
dimn(A:Z, B:Z, C:Z)
hoal(A:Z, B:Z)
eqvu(A:Z)
vbmh(A:Z, B:Z, C:Z, D:Z) printtuples
yjuq(0).
yjuq(31).
yjuq(41).
yjuq(29).
yjuq(9).
yjuq(21).
pbbr(A, A, A) :- yjuq(A).
dimn(A, B, B) :- pbbr(A, B, B).
hoal(A, A) :- dimn(C, A, C), dimn(B, A, D).
eqvu(A) :- hoal(A, A).
vbmh(A, A, A, A) :- eqvu(A).
And the result of this program is:
Tuples in vbmh:
(A=0(0),B=0(0),C=0(0),D=0(0))
(A=31(31),B=31(31),C=31(31),D=31(31))
(A=41(41),B=41(41),C=41(41),D=41(41))
(A=29(29),B=29(29),C=29(29),D=29(29))
(A=9(9),B=9(9),C=9(9),D=9(9))
(A=21(21),B=21(21),C=21(21),D=21(21))
The difference is the first row(A=25(0),B=25(0),C=25(0),D=25(0)) and (A=0(0),B=0(0),C=0(0),D=0(0)). I want to know which component should be result, the value after = or the value in (), if it is the former, there may be a bug here.
This discussion was converted from issue #6407 on October 18, 2022 16:32.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I have a question about the meaning of the different components of the datalog result, I didn't find detailed documentation about this.
I have a program as below:
The result of this program is:
This program is too long and I remove some useless statement to build a equivalent program:
And the result of this program is:
The difference is the first row
(A=25(0),B=25(0),C=25(0),D=25(0))
and(A=0(0),B=0(0),C=0(0),D=0(0))
. I want to know which component should be result, the value after=
or the value in()
, if it is the former, there may be a bug here.Beta Was this translation helpful? Give feedback.
All reactions