🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #4155

Need help in Tree building routine - Problem stated clearly

#4155
From: swaminathan.ravikumar
Date: Mon, 12 Feb 1990 14:47
52 lines
1829 bytes
I posted a question on tree building in Prolog a couple of days
back and I got replies saying that I did not convey the problem
clearly. First my apologies for the mistake. Here is the problem
again.

I want to construct a Prolog structure (possibly a list of list), 
and each element in the structure called "nodes" can be
connected to other nodes in the following way:

		one to one
		one to many
		many to one

To begin with I have the following facts asserted in the Prolog
Database:


	linked(a, b).         a     z
	linked(a, c).	     / \   /
	linked(b, d).       /   \ /
	linked(d, e).      b     c
	linked(c, e).      |     /
	linked(e, f).      d    /
	linked(e, g).       \  /
	linked(e, h).	      e
	linked(z, c).        /|\
	                    / | \
	                    f g  h

The structure I want to construct should also include information
such as the nodes that could be processed in parallel and
minimize repetition of nodes. For the above example I want
something like this:

        (
  	( ((a||z),c)		% I don't see a way to avoid
	||			% duplicating node "a"
	  (a,b,d)
	),
	e,
	(f||g||h)
	)

I have a version of this but it is clumsy because I don't have a
good notation (or operator) for representing parallel and
sequential processing. Any suggestions are welcome.

Thanks.

-- ravi
skumar@hocus.att.com
Technical Details
Message-ID: <8142@cbnewsh.ATT.COM>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!clyde.concordia.ca!jarvis.csri.toronto.edu!cs.utexas.edu!mailrus!ames!pacbell!att!cbnewsh!skumar

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!clyde.concordia.ca!jarvis.csri.toronto.edu!cs.utexas.edu!mailrus!ames!pacbell!att!cbnewsh!skumar
From: skumar@cbnewsh.ATT.COM (swaminathan.ravikumar)
Newsgroups: comp.lang.prolog,comp.ai
Subject: Need help in Tree building routine - Problem stated clearly
Keywords: trees, parallel sequential nodes
Message-ID: <8142@cbnewsh.ATT.COM>
Date: 12 Feb 90 14:47:02 GMT
Organization: AT&T Bell Laboratories
Lines: 52