Prolog Tree Nodes Path

前端 未结 1 1532
广开言路
广开言路 2021-01-27 01:54

Hello, I have basic knowledge about prolog and I am facing problems in writing the prolog code for the following problem: Write the fact about the above figure and writ

相关标签:
1条回答
  • 2021-01-27 02:24
    edge(ne,n1).
    edge(n1,n2).
    edge(n1,n3).
    edge(n3,n7).
    edge(n7,nx).
    edge(n3,n4).
    edge(n4,n5).
    edge(n5,nx).
    edge(n4,n6).
    edge(n6,nx).
    
    pos_path(A, B, Path) :-
       path(edge, Path, A, B).
    

    using path/4 defined in another question.

    0 讨论(0)
提交回复
热议问题