Różnice

Różnice między wybraną wersją a wersją aktualną.

Odnośnik do tego porównania

pl:prolog:pllib:transitive_closure [2019/06/27 15:50]
pl:prolog:pllib:transitive_closure [2019/06/27 15:50] (aktualna)
Linia 1: Linia 1:
 +====== Transitive closure ======
 +{{tag>​graphs}}
 +===== Description =====
 +The transitive closure of the edge relationship
 +
 +**Source**: ​ The Art of Prolog
 +===== Download =====
 +Program source code: {{transitive_closure.pl}}
 +===== Listing =====
 +<code prolog>
 +/*
 + connected(Node1,​Node2) :-
 + Node1 is connected to Node2 in the graph
 + defined by the edge/2 relation.
 +*/
 + connected(Node,​Node).
 + connected(Node1,​Node2) :- edge(Node1,​Link),​ connected(Link,​Node2).
 +
 +edge(a,b).
 +edge(a,c).
 +edge(b,d).
 +edge(c,d).
 +edge(d,e).
 +edge(f,g).
 +
 +% Program 2.7: The transitive closure of the edge relationship
 +</​code>​
 +===== Comments =====
  
pl/prolog/pllib/transitive_closure.txt · ostatnio zmienione: 2019/06/27 15:50 (edycja zewnętrzna)
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0