dyna
dyna copied to clipboard
argument of with_key doesn't parse correctly
Syntactic bug in implementation of #29. This works:
pathto(start) min= 0 with_key [start].
pathto(V) min= pathto(U) + edge(U,V) with_key [V | bestpath(U)].
bestpath(U) = $key(pathto(U)).
But this doesn't:
pathto(start) min= 0 with_key [start].
pathto(V) min= pathto(U) + edge(U,V) with_key [V | $key(pathto(U))].
In the second case, the second rule never seems to fire. It may be misparsing the |
as "or" rather than list syntax. (To understand the message below, note that the vertices in this graph are 5-letter words such as "black" and "blank".)
Error(s) in rule: <repl>
pathto(V) min= pathto(U) + edge(U,V) with_key [V | $key(pathto(U))].
TypeError:
when `$key(pathto("black"))` = ["black"]
pathto(V="blank") min= &with_key((pathto(U="black")=? + edge(U="black", V="blank")=10)=?, [(V="blank" | $key(&pathto(U="black"))=["black"])=?]).
See also discussion on #15
Btw, In the mean time you use single quotes '$key' to side-step the bug.
See also discussion on #15
Ah yes, problem already reported and diagnosed there. But you closed that ticket so I guess the issue will live on here.
Er, wait, wasn't this fixed by ddb104238deedd498b667ada0bf09273d79f24a7? Jason, can you tell me which version of dyna you're using? "(cd which dyna
; git describe --always)" is probably the best way to do that right now.
f4d6dd0