0

我有这个代码

DOMAINS
    s = symbol.
    sList = symbol*.

PREDICATES
    nondeterm link(s, s,integer).
    nondeterm depth_first_search(s, s, sList,integer).

CLAUSES


    link("Erbil","Koysinjaq",12).
    link("Erbil","Kirkuk",15).
    link("Erbil","Shaqlawa",15).
    link("Erbil","Mosul",22).
    link("Shaqlawa","Akre",33).
    link("Mosul","Duhok",44).
    link("Mosul","Akre",55).
    link("Kirkuk","Koysinjaq",66).
    link("Kirkuk","Chamchamal",88).
    link("Chamchamal","Sulaimani",34).
    link("Koysinjaq","Sulaimani",22).
    link("Sulaimani","Ranya",33).
    link("Akre","Duhok",22).

    depth_first_search(X, X, [X],0).
    depth_first_search(X, Y, [X|T],L):-
        link(X, Z , L1),
        depth_first_search(Z, Y, T,L2),L=L1+L2 .

GOAL
    depth_first_search("Erbil", "Duhok", PathToGoal,Dis).

我想找到最短路径和两个城市之间的距离,我从目标开始到起始节点,计算距离并返回它,但是我PROGRAM ERROR 1040 在运行它时遇到了那个错误并且不知道任何关于它的信息,所以搜索了在谷歌,没有什么是可以理解的

4

0 回答 0