google / mangle

Apache License 2.0
1.07k stars 38 forks source link

bug in type checking #33

Closed burakemir closed 1 month ago

burakemir commented 4 months ago

This program does not work:

path(Src, Dst, W) :- edge(Src, Dst, W).
path(Src, Dst, W) :- path(Src, X1, W1), edge(X1, Dst, W2),  W = fn:plus(W1, W2).

Error message:

type mismatch: cannot find assignment that works for premise path(Src,X1,W1)

Expected: no error.

The following program works fine:

path(Src, Dst, W) :- edge(Src, Dst, W).
path(Src, Dst, W) :- path(Src, X1, W1), edge(X1, Dst, W2) |> let W = fn:plus(W1, W2).
burakemir commented 1 month ago

This was fixed in b30e0b6, unfortunately I messed up the description